Skip to content

Commit

Permalink
docs: Added API updates to 0.13.1 Release notes (starknet-io#1177)
Browse files Browse the repository at this point in the history
* Added API updates to release notes

* Added date of 0.13.1 release

* Minor edit

* Added headers for API versions 0.6.0 and 0.7.0

* Changed H5 to dot headings (because output was too small, hard to read)
  • Loading branch information
stoobie authored and xiaolou86 committed Apr 7, 2024
1 parent 66bd9f8 commit 329fa74
Showing 1 changed file with 51 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,65 @@ 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

* *Cheaper data availability:* Starknet uses link:https://eips.ethereum.org/EIPS/eip-4844[EIP-4844].
* 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.

[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]
=== 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.

[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.

.`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`

.`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.

.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]

.`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

Expand Down Expand Up @@ -62,18 +110,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:

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.
* `transaction_commitment` and `event_commitment` are added to the block. `0` is returned for old blocks.

[discrete]
=== Infrastructure updates

Expand Down

0 comments on commit 329fa74

Please sign in to comment.