From 41b1c848a86b1634d62ce44d0aaf4d84431153f5 Mon Sep 17 00:00:00 2001 From: Steve Goodman Date: Tue, 12 Mar 2024 16:16:14 +0200 Subject: [PATCH 1/5] Added API updates to release notes --- .../pages/version_notes.adoc | 72 +++++++++++++++++-- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc index 48d12ee699..fb0f6830c7 100644 --- a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc +++ b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc @@ -26,12 +26,57 @@ include::ROOT:partial$snippet_important_goerli2_removed.adoc[] [discrete] === New features and enhancements -* *Cheaper data availability:* Starknet uses link:https://eips.ethereum.org/EIPS/eip-4844[EIP-4844]. +* *Cheaper data availability (DA):* Starknet uses link:https://eips.ethereum.org/EIPS/eip-4844[EIP-4844]. State diffs are now blobs, rather than calldata, requiring the addition of `data_gas` to Starknet blocks. * Time-related syscalls when called from an account contract's `+__validate__+` function: -** `timestamp` returns the hour, rounded down. +** `block_timestamp` returns the hour, rounded down. ** `block_number` returns the block number, rounded down to the nearest multiple of 100. * *Optimization:* Load into memory only the functions in a contract that are actually used when generating the proof. +[discrete] +=== Block header updates +The block header includes the following new fields: + +* `l1_da_mode`: A string enum that takes the value `CALLDATA` or `BLOB`, and indicates whether EIP-4844 is the data availability solution that is used for the block. Also appears in pending block. +* `l1_data_gas_price`: Contains `price_in_wei` and `price_in_fri`, where 1 fri is 10^-18^ STRK. Also appears in pending block. +* `l1_gas_price`: Replaces `eth_l1_gas_price` and `strk_l1_gas_price`. Contains the data gas price (EIP-4844) in addition to the regular gas price. + +[discrete] +=== JSON RPC + +Starknet 0.13.1 is backward compatible with starknet_api_openrpc.json v0.6.0. Responses from 0.13.1 can be mapped naturally into v0.6.0 objects. + +A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes introduced by Starknet using EIP-4844: +[discrete] +==== `BLOCK_HEADER` includes two new fields to support EIP-4844: + +* `l1_data_gas_price`: contains `price_in_wei` and `price_in_fri` (10^-18^ denominations, similar to https://github.com/starkware-libs/starknet-specs/blob/49665932a97f8fdef7ac5869755d2858c5e3a687/api/starknet_api_openrpc.json#L3766[v0.6.0]). +* `l1_da_mode`: An enum that indicates whether this block will use calldata or blobdata and can take the following values: +** `CALLDATA` +** `BLOB` + +[discrete] +==== `FEE_ESTIMATE` + +* Includes two new fields: +** `data_gas_consumed` +** `data_gas_price` +* `overall_fee` is now: + +`gas_consumed` × `gas_price` + `data_gas_consumed` × `data_gas_price` +* Fee estimates will change depending on the data availability solution used by current Starknet blocks. For example, if you estimate the fee against the pending block, and it’s currently using `CALLDATA`, then nodes are expected to return `data_gas_consumed=0` and compute the fee similarly to today, that is, get higher estimates. + +[discrete] +==== Receipts and traces now include data availability resources + +* `COMMON_RECEIPT_PROPERTIES`, the main receipt object, now includes a new entry: execution_resources. +* The `EXECUTION_RESOURCES` object now includes the field `data_availability`. Note that the resources of internal calls will remain the same/ +* For more information, see the https://github.com/starkware-libs/starknet-specs/pull/187/files[PR for the API JSON RPC specs] + +[discrete] +==== `EXECUTION_RESOURCES` + +* Computation resources are separated from data availability resources. This is done by introducing the `data_availability` property, which includes `l1_gas` and `l1_data_gas`, which were consumed due to DA requirements. One of these will always be zero, depending on whether or not the block uses calldata or blobs, as specified by the `l1_da_mode` field in the block header. +* Syscall costs are now included in the execution resources of traces and receipts. These are costs that are already being paid for but were not reported so far. + [discrete] === Pricing changes @@ -65,15 +110,28 @@ v1 `DECLARE` transactions only include bytecode. [discrete] === API changes: +[discrete] +==== Feeder gateway request/response + Starknet block: -* New field `l1_da_mode`, which indicates whether EIP-4844 was used in the block. -* `eth_l1_gas_price` and `strk_l1_gas_price` were replaced, and the information now contains the data gas price (EIP-4844) in addition to the regular gas price -* `execution_resources` in the transaction receipt now contains: -** data availability resources -** syscall resources, which contribute to the transaction fee but were not included in the receipt before this version. +* New field, `l1_da_mode`, in the block header, including the pending block: A string enum that takes the value `CALLDATA` or `BLOB`, and indicates whether EIP-4844 is the data availability solution that is used for the block. +* New field, `l1_data_gas_price`, in the block header, including the pending block: +Contains `price_in_wei` and `price_in_fri`, where 1 fri is 10^-18^ STRK. +* New field, `l1_gas_price`, in the block header, replaces `eth_l1_gas_price` and `strk_l1_gas_price`. Contains the data gas price (EIP-4844) in addition to the regular gas price. +* `get_compiled_class_by_class_hash` returns the updated compiled class structure, including data for segments, such as the new field `bytecode_segments_lengths`, which is a nested list of integers. +* Transaction receipt refactor. `execution_resources` in the transaction receipt that you get with a `get_block` request, now include the following: +** the `data_availability` property, which isolates DA resources from computation resources. This property includes `l1_gas` and `l1_data_gas` that were incurred by state updates. One of them is always zero. +** syscall-related resources. Each syscall has an associated step-cost. For more information, see link:https://github.com/starkware-libs/blockifier/blob/5fe26bd71143ac96beea2902086ce68179f27cbb/crates/blockifier/resources/versioned_constants.json#L167[versioned_constance.json]. So far, these costs were included in the fee but not reported inside receipts. This now changes, so a spike in the receipt resources is to be expected. These costs are not new. Rather, they are already incurred but were not previously reported in the receipt. * `transaction_commitment` and `event_commitment` are added to the block. `0` is returned for old blocks. +The source of truth for the feeder gateway response is link:https://github.com/starkware-libs/cairo-lang/blob/v0.13.1a0/src/starkware/starknet/services/api/feeder_gateway/response_objects.py[response_objects.py]. + +[discrete] +==== JSON RPC + + + [discrete] === Infrastructure updates From b995492e1d2329b5ba7d1c436bd494be7cef25ec Mon Sep 17 00:00:00 2001 From: Steve Goodman Date: Thu, 14 Mar 2024 07:08:06 +0200 Subject: [PATCH 2/5] Added date of 0.13.1 release --- .../Starknet/modules/starknet_versions/pages/version_notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc index fb0f6830c7..4768174fc6 100644 --- a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc +++ b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc @@ -21,7 +21,7 @@ include::ROOT:partial$snippet_important_goerli2_removed.adoc[] |=== [id="version0.13.1"] -== Starknet v0.13.1 +== Starknet v0.13.1 (March 13, 23) [discrete] === New features and enhancements From aedde0fc6450f3392b0826b48efabceed696729e Mon Sep 17 00:00:00 2001 From: Steve Goodman Date: Thu, 14 Mar 2024 11:47:49 +0200 Subject: [PATCH 3/5] Minor edit --- .../pages/version_notes.adoc | 34 +++---------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc index 4768174fc6..b2724b3728 100644 --- a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc +++ b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc @@ -26,8 +26,8 @@ include::ROOT:partial$snippet_important_goerli2_removed.adoc[] [discrete] === New features and enhancements -* *Cheaper data availability (DA):* Starknet uses link:https://eips.ethereum.org/EIPS/eip-4844[EIP-4844]. State diffs are now blobs, rather than calldata, requiring the addition of `data_gas` to Starknet blocks. -* Time-related syscalls when called from an account contract's `+__validate__+` function: +* *Cheaper data availability (DA):* Starknet uses link:https://eips.ethereum.org/EIPS/eip-4844[EIP-4844]. State diffs are now blobs, rather than calldata, requiring the addition of `data_gas` to the Starknet block header. +* Time-related syscalls when called from an account contract's `+__validate__+`, `+__validate_deploy__+`, `+__validate_declare__+`, or `constructor` function: ** `block_timestamp` returns the hour, rounded down. ** `block_number` returns the block number, rounded down to the nearest multiple of 100. * *Optimization:* Load into memory only the functions in a contract that are actually used when generating the proof. @@ -41,11 +41,12 @@ The block header includes the following new fields: * `l1_gas_price`: Replaces `eth_l1_gas_price` and `strk_l1_gas_price`. Contains the data gas price (EIP-4844) in addition to the regular gas price. [discrete] -=== JSON RPC +=== API: JSON RPC -Starknet 0.13.1 is backward compatible with starknet_api_openrpc.json v0.6.0. Responses from 0.13.1 can be mapped naturally into v0.6.0 objects. +Starknet 0.13.1 is backward compatible with `starknet_api_openrpc.json` v0.6.0. Responses from 0.13.1 can be mapped naturally into v0.6.0 objects. A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes introduced by Starknet using EIP-4844: + [discrete] ==== `BLOCK_HEADER` includes two new fields to support EIP-4844: @@ -107,31 +108,6 @@ v1 `DECLARE` transactions only include bytecode. * An additional felt to the data array of an event now costs 0.128 gas/felt, similar to calldata. * An additional felt to the keys array now costs 0.256 gas/felt. -[discrete] -=== API changes: - -[discrete] -==== Feeder gateway request/response - -Starknet block: - -* New field, `l1_da_mode`, in the block header, including the pending block: A string enum that takes the value `CALLDATA` or `BLOB`, and indicates whether EIP-4844 is the data availability solution that is used for the block. -* New field, `l1_data_gas_price`, in the block header, including the pending block: -Contains `price_in_wei` and `price_in_fri`, where 1 fri is 10^-18^ STRK. -* New field, `l1_gas_price`, in the block header, replaces `eth_l1_gas_price` and `strk_l1_gas_price`. Contains the data gas price (EIP-4844) in addition to the regular gas price. -* `get_compiled_class_by_class_hash` returns the updated compiled class structure, including data for segments, such as the new field `bytecode_segments_lengths`, which is a nested list of integers. -* Transaction receipt refactor. `execution_resources` in the transaction receipt that you get with a `get_block` request, now include the following: -** the `data_availability` property, which isolates DA resources from computation resources. This property includes `l1_gas` and `l1_data_gas` that were incurred by state updates. One of them is always zero. -** syscall-related resources. Each syscall has an associated step-cost. For more information, see link:https://github.com/starkware-libs/blockifier/blob/5fe26bd71143ac96beea2902086ce68179f27cbb/crates/blockifier/resources/versioned_constants.json#L167[versioned_constance.json]. So far, these costs were included in the fee but not reported inside receipts. This now changes, so a spike in the receipt resources is to be expected. These costs are not new. Rather, they are already incurred but were not previously reported in the receipt. -* `transaction_commitment` and `event_commitment` are added to the block. `0` is returned for old blocks. - -The source of truth for the feeder gateway response is link:https://github.com/starkware-libs/cairo-lang/blob/v0.13.1a0/src/starkware/starknet/services/api/feeder_gateway/response_objects.py[response_objects.py]. - -[discrete] -==== JSON RPC - - - [discrete] === Infrastructure updates From e3955147691b7d5fe8aa599a18d98c19dd7288be Mon Sep 17 00:00:00 2001 From: Steve Goodman Date: Thu, 28 Mar 2024 12:20:18 +0200 Subject: [PATCH 4/5] Added headers for API versions 0.6.0 and 0.7.0 --- .../starknet_versions/pages/version_notes.adoc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc index b2724b3728..344e610b0b 100644 --- a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc +++ b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc @@ -43,12 +43,18 @@ The block header includes the following new fields: [discrete] === API: JSON RPC +[discrete] +==== Starknet API JSON RPC 0.6.0 + Starknet 0.13.1 is backward compatible with `starknet_api_openrpc.json` v0.6.0. Responses from 0.13.1 can be mapped naturally into v0.6.0 objects. -A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes introduced by Starknet using EIP-4844: +[discrete] +==== Starknet API JSON RPC 0.7.0 + +A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes introduced by Starknet using EIP-4844. [discrete] -==== `BLOCK_HEADER` includes two new fields to support EIP-4844: +===== `BLOCK_HEADER` includes two new fields to support EIP-4844: * `l1_data_gas_price`: contains `price_in_wei` and `price_in_fri` (10^-18^ denominations, similar to https://github.com/starkware-libs/starknet-specs/blob/49665932a97f8fdef7ac5869755d2858c5e3a687/api/starknet_api_openrpc.json#L3766[v0.6.0]). * `l1_da_mode`: An enum that indicates whether this block will use calldata or blobdata and can take the following values: @@ -56,7 +62,7 @@ A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes in ** `BLOB` [discrete] -==== `FEE_ESTIMATE` +===== `FEE_ESTIMATE` * Includes two new fields: ** `data_gas_consumed` @@ -66,14 +72,14 @@ A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes in * Fee estimates will change depending on the data availability solution used by current Starknet blocks. For example, if you estimate the fee against the pending block, and it’s currently using `CALLDATA`, then nodes are expected to return `data_gas_consumed=0` and compute the fee similarly to today, that is, get higher estimates. [discrete] -==== Receipts and traces now include data availability resources +===== Receipts and traces now include data availability resources * `COMMON_RECEIPT_PROPERTIES`, the main receipt object, now includes a new entry: execution_resources. * The `EXECUTION_RESOURCES` object now includes the field `data_availability`. Note that the resources of internal calls will remain the same/ * For more information, see the https://github.com/starkware-libs/starknet-specs/pull/187/files[PR for the API JSON RPC specs] [discrete] -==== `EXECUTION_RESOURCES` +===== `EXECUTION_RESOURCES` * Computation resources are separated from data availability resources. This is done by introducing the `data_availability` property, which includes `l1_gas` and `l1_data_gas`, which were consumed due to DA requirements. One of these will always be zero, depending on whether or not the block uses calldata or blobs, as specified by the `l1_da_mode` field in the block header. * Syscall costs are now included in the execution resources of traces and receipts. These are costs that are already being paid for but were not reported so far. From c8b2321f7da36b48da92929c0e18ae61039673d6 Mon Sep 17 00:00:00 2001 From: Steve Goodman Date: Thu, 28 Mar 2024 12:27:39 +0200 Subject: [PATCH 5/5] Changed H5 to dot headings (because output was too small, hard to read) --- .../starknet_versions/pages/version_notes.adoc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc index 344e610b0b..d12b4f9934 100644 --- a/components/Starknet/modules/starknet_versions/pages/version_notes.adoc +++ b/components/Starknet/modules/starknet_versions/pages/version_notes.adoc @@ -53,16 +53,14 @@ Starknet 0.13.1 is backward compatible with `starknet_api_openrpc.json` v0.6.0. A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes introduced by Starknet using EIP-4844. -[discrete] -===== `BLOCK_HEADER` includes two new fields to support EIP-4844: +.`BLOCK_HEADER` includes two new fields to support EIP-4844: * `l1_data_gas_price`: contains `price_in_wei` and `price_in_fri` (10^-18^ denominations, similar to https://github.com/starkware-libs/starknet-specs/blob/49665932a97f8fdef7ac5869755d2858c5e3a687/api/starknet_api_openrpc.json#L3766[v0.6.0]). * `l1_da_mode`: An enum that indicates whether this block will use calldata or blobdata and can take the following values: ** `CALLDATA` ** `BLOB` -[discrete] -===== `FEE_ESTIMATE` +.`FEE_ESTIMATE` * Includes two new fields: ** `data_gas_consumed` @@ -71,15 +69,13 @@ A new version of `starknet_api_openrpc.json`, 0.7.0, accommodates the changes in `gas_consumed` × `gas_price` + `data_gas_consumed` × `data_gas_price` * Fee estimates will change depending on the data availability solution used by current Starknet blocks. For example, if you estimate the fee against the pending block, and it’s currently using `CALLDATA`, then nodes are expected to return `data_gas_consumed=0` and compute the fee similarly to today, that is, get higher estimates. -[discrete] -===== Receipts and traces now include data availability resources +.Receipts and traces now include data availability resources * `COMMON_RECEIPT_PROPERTIES`, the main receipt object, now includes a new entry: execution_resources. * The `EXECUTION_RESOURCES` object now includes the field `data_availability`. Note that the resources of internal calls will remain the same/ * For more information, see the https://github.com/starkware-libs/starknet-specs/pull/187/files[PR for the API JSON RPC specs] -[discrete] -===== `EXECUTION_RESOURCES` +.`EXECUTION_RESOURCES` * Computation resources are separated from data availability resources. This is done by introducing the `data_availability` property, which includes `l1_gas` and `l1_data_gas`, which were consumed due to DA requirements. One of these will always be zero, depending on whether or not the block uses calldata or blobs, as specified by the `l1_da_mode` field in the block header. * Syscall costs are now included in the execution resources of traces and receipts. These are costs that are already being paid for but were not reported so far.