Starknet release notes

The following release notes cover the ongoing version changes to Starknet. You can subscribe to get the latest version updates delivered to your inbox at Starknet Roadmap & version updates.

Starknet environments

Within Starknet’s deployment pipeline, there are separate and distinct networks that operate independently of each other for testing before deployment.

Sepolia testnet replaces Goerli testnet.

Goerli testnet support is now removed.

For more information, including bridge support for Sepolia, see Starknet Goerli Deprecation in the Starknet Dev News newsletter.

Table 1. Current versions supported in each environment
Environment Starknet version Sierra version Cairo version

Mainnet

0.13.1.1

1.5.0

2.0.0 - 2.6

Sepolia Testnet

0.13.1.1

1.5.0

2.0.0 - 2.6

Starknet v0.13.1.1 (April 15, 24)

In response to community feedback, Starknet 0.13.1.1 reduces class declaration fees and increases the calldata limit:

Resource Gas cost (0.13.1) Gas cost (0.13.1.1)

CASM bytecode

28 gas/felt

1 gas/felt

Sierra bytecode

28 gas/felt

1 gas/felt

ABI

0.875 gas/character

0.032 gas/character

Entity Limit (0.13.1) Limit (0.13.1.1)

Calldata length (felts)

4,000

5,000

Starknet v0.13.1 (March 13, 24)

New features and enhancements

  • Cheaper data availability (DA): Starknet uses 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.

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.

API: JSON RPC

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.

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

Pricing changes

Computation

  • A Cairo step now costs 0.0025 gas/step, a 50% reduction.

  • All builtins costs are accordingly reduced by 50%.

Calldata and signatures

Each felt in the calldata and signature arrays of all transaction types now costs 0.128 gas/felt.

Class declaration

  • Each felt of a sierra_program in the contract class and of bytecode in the compiled contract class now costs 28 gas/felt.

    v1 DECLARE transactions only include bytecode.

  • Each character in the ABI costs 0.875 gas.

Events

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

Infrastructure updates

Starknet now supports multiple L1 providers.

Additional resources

Community Forum Posts:

Starknet v0.13.0 (Jan 10, 24)

Starknet v0.13.0 is live on Mainnet.

Starknet 0.13.0 includes the following changes:

  • v3 transactions, including:

    • Fee payment in STRK

    • Reserved fields for future features, such as Volition and payment master

  • get_block API: The gas_price field is replaced by the eth_l1_gas_price and strk_l1_gas_price fields. This change applies also to existing blocks. For more information on the new fields, see the JSON RPC API Spec on GitHub

  • Sierra v1.4.0. This new version of Sierra is part of Crate v2.4.0, in the Cairo 2.4.0 package. For more information, see Cairo v2.4.0 is out! on the Community forum.

  • Improved performance of secp256k1_mul and secp256r1_mul syscalls

  • Computation cost is reduced by approximately 50% as a result of reduced Cairo steps and increased use of builtins. L1 data availability cost is reduced by approximately 10%-25%. For an ERC-20 transfer, the DA fee reduction is 25%.

Starknet v0.12.3 (Nov 19, 23)

Starknet v0.12.3 is live on Mainnet.

This release partially removes support for the Starknet feeder gateway. For details, see Feeder Gateway Deprecation in Development Proposals on the Starknet community forum.

Additionally, this version includes the following changes:

  • Performance optimizations in the gateway, the computation of the Patricia storage root, and block hash

  • Support for secp256r1 syscalls in the Starknet OS.

  • Restriction for __validate__ and the constructor of DeployAccount transactions:

    • Restrict access to sequencer_address in the get_execution_info syscall by returning 0's for the address.

    • Restrict access to the following syscalls:

      • Cairo contracts: get_block_hash

      • Cairo 0 contracts: get_sequencer_address

This version is available on both Goerli and Sepolia testnets.

Cairo 0

Move structs that are common to secp256k1 and secp256r1 to a separate file.

Starknet v0.12.2 (Sep 04, 23)

Starknet v0.12.2 is live on Mainnet.

This version includes the following changes:

  • Enabling P2P Authentication: An additional endpoint in the sequencer gateway to provide a signature on the state diff commitment and block hash.

  • Resolving Mismatches in Queries: An extension to the get_state_update endpoint in the sequencer gateway that returns both the pending state diff and the pending block together.

  • Increased maximum Cairo steps per transaction from 1 million to 3 million.

Starknet v0.12.1 (Aug 21, 23)

Starknet v0.12.1 is live on Mainnet.

This version includes the following changes:

  • Mempool Validation.

  • Inclusion of Failed Transactions.

  • Keccak builtin.

Starknet v0.12.0 (July 12, 23)

Starknet v0.12.0 is live on Mainnet.

This version contains the following changes:

  • Use the rust blockifier and LambdaClass’s Cairo VM to accelerate the sequencer’s time to handle transactions.

  • Support version 2.0.0 of the Cairo compiler.

  • Replace the PENDING status of transactions to ACCEPTED_ON_L2 - once a transaction is in that status it means that it will be included in a block, this applies to transactions - blocks still have the PENDING status.

  • Add an experimental get_block_hash syscall.

  • Change HTTP error code from 500 to 400 on API errors.

Starknet v0.11.2 (May 31, 23)

Starknet v0.11.2 is live on Mainnet.

This version contains the following changes:

  • Upgrade Cairo 1.0 version to v1.0.0-rc0 (Cairo 1.0 activated on Starknet!)

Starknet v0.11.1 (May 23, 23)

Starknet v0.11.1 is live on Mainnet.

This version contains the following changes:

  • Upgrade Cairo 1.0 version to v1.0.0-rc0.

  • Charged transaction fee is now based on an average Ethereum gas price instead of a single sample (estimation API is unaffected).

  • API changes:

    • Remove the state root in get_state_update for pending blocks to allow faster responses in future versions.

  • Testing framework:

    • Allow declaring (and interacting with) Cairo 1.0 contracts.

      • Currently, the Cairo 1.0 ABI is not supported yet, so a Cairo 0 ABI should be supplied to declare() manually.

    • Split deploy() to two phases declare and deploy: deprecated_declare() (for Cairo 0 contract) or declare() (for Cairo 1.0 contracts) and deploy() (for both).

  • Add current block hash to the Starknet Core Contract (currently not verified by the Starknet OS):

    • Breaking change: The LogStateUpdate event’s data is changed to include blockHash.

Starknet v0.11.0 (Mar 29, 23)

Starknet v0.11.0 is live on Mainnet.

invoke and declare transactions of version 0 are no longer supported on this version.

In Starknet v0.11.0, you can declare, deploy and run Cairo 1.0 smart contracts. We also introduce a new system call that allows a smooth transitioning of existing contracts to a Cairo 1.0 implementation.

Historically, contract classes have been defined in terms of Cairo assembly, or Casm for short (the class definition also included more information needed for execution, e.g., hint data). The novelty of Cairo 1.0 is the introduction of Sierra (Safe Intermediate Representation), an intermediate layer between Cairo 1.0 and Casm.

The introduction of Cairo 1.0 and Sierra has several effects on the system. Below we list the effects on each component; of particular note are:

  • A new version of the declare transaction, which allows sending the new class structure

  • The state commitment will now include contract classes

  • Changes to the onchain data format

  • New system call - replace_class

Starknet v0.10.3 (Dec 12, 22)

The deploy transaction is no longer supported on this version.

This version contains the following changes:

Starknet

  • Performance - Separate the state commitment computation from the execution of the transactions

  • Add starknet-class-hash command to compute the class hash of a compiled Starknet contract

Cairo:

  • Autoformatter: Automatically break lines inside expressions

Starknet v0.10.2 (Nov 29, 22)

  • This version introduces sequencer parallelization! This is the first step in our roadmap of performance upgrades. Details about the specific mechanism of parallelization and the roadmap in general are described in this medium post.

  • A new endpoint, estimate_fee_bulk, is added to the feeder gateway. This will allow estimating the fee of several transactions at once, where each transaction is executed relative to the resulting state from applying the previous one.

    • Sequencing performance improvements

    • Builtin ratio changes, which affects builtin costs

    • Add estimate_fee_bulk API that computes the fee of multiple transactions that will be executed consecutively

As part of this version, we will also increase the finality of transactions in the pending block, by fixing the timestamp at the time of the block creation. This will solve the issue of transactions moving from pending to rejected on account of too old timestamp

Starknet v0.10.1 (Oct 25, 22)

This version contains the following changes:

Starknet:

  • Add DeployAccount transaction (which will replace the Deploy transaction for deploying account contracts). To use it, you should first add enough funds to your account address to pay the transaction fee, and then you can invoke DeployAccount

  • Split the starknet deploy_account CLI command into starknet new_account and starknet deploy_account

  • Account contracts that are expected to be deployed this way should implement the`validate_deploy()` entry point, which should check the signature of the DeployAccount transaction

  • Improve L1 fee computation: the fee is computed according to the diff of the storage state

  • API: Remove entry_point_type field from transaction information

Cairo:

  • Add uint256_mul_div_mod to uint256.cairo

Starknet v0.10.0 (Sept 05, 22)

This version introduces the next step in Starknet’s account abstraction design, specifically the validate/execute separation. See here for more information.

This version contains the following changes:

Starknet:

  • Contract (breaking changes):

    • @external and @view functions should be imported directly by the main compiled file. Otherwise, they will not be usable as external functions

    • Forbid using the same storage variable name in two modules

  • New transaction version (version 1) for invoke and declare transactions:

    • Transactions of version 0 are deprecated and will not be supported in Starknet from the next version (v0.11.0). Please update your systems to use the new version

In order to use transactions of version 1 you will need to upgrade your account contracts

  • Add nonce field to the transactions. Nonce validation is now part of the Starknet protocol and is enforced to be executed sequentially

  • Invoke:

    • Split execute to two functions:` validate` (only validates the transaction) and execute (only executes the transaction)

    • Remove the selector (which is now always execute) field, following the above change.

  • Declare:

    • declare transaction should now be sent from an account (and is validated using validate_declare in the account contract)

      • Support fee for sending L1 messages. At this point, it’s not mandatory and messages with no fee will still be handled. Starting from the next version it will become mandatory.

Cairo:

Syntax changes in Cairo (to make it more similar to rust and C++):

  • You can use the cairo-migrate script to convert old code to the new syntax. Use the -i flag to apply the changes to the files

  • End statements with ;

New lines are still part of the language at this point, and you cannot put more than one instruction per line. This will change in Cairo1.0.

  • Use { … } for code blocks (instead of : and end)

  • Add () around the condition of if statements

  • Remove the member keyword in structs

  • Change comment to use // instead of #

  • Use …​, ap` instead of `...; ap in low level Cairo code

  • Support return types that are not tuples. For example, func foo() → felt (instead of func foo() → (r: felt)) As a result, it’s now mandatory to specify return types. func foo() → (res) should be replaced by func foo() → (res: felt). The cairo-migrate tool does that automatically.

  • Return statement accepts expressions, rather than only tuples. For example, you can write let x = (5,); return x;

  • A few standard library functions were changed to return felt. The cairo-migrate script also fixes calls to those functions

  • Support using functions as expressions

  • This only applies to functions with → felt signature`, whose ap change is known at compile-time (e.g., recursive functions cannot be used this way)

  • Fix a bug in the secp signature verification code that allowed a malicious prover to ignore the value of v (this does not let the prover fake a signature, but allows it to claim that a valid signature is invalid).

  • Add Cairo code for the recursive STARK verifier

Technical changes: * Move from python3.7 to python3.9

Starknet v0.9.1 (July 20, 22)

This version contains the following changes:

Starknet:

API changes:

  • Add get_block_traces API - returns all the transaction traces of a given block

  • Add a list of declared contracts in get_state_update

  • Add a 0x prefix for class hash in the API

  • Add starknet_version field for blocks (only applies to new blocks)

Starknet CLI:

  • Change the default block number to pending

  • Using a wallet is the default, --no_wallet must be specified explicitly to override this

  • Deploying contracts:

    • Add deploy_contract function to the account contract created by starknet deploy_account

    • Use this function to deploy contract (unless using --no_wallet). In particular, deploy should be used after declaring the contract (it expects the contract class hash)

  • Support --dry_run to get the transaction information without signing or sending it

  • Support deploy_from_zero in the deploy syscall to deploy a contract to an address that does not depend on the deployer

Cairo: * Support and in if statements (if x == y and z == w).

At the moment other boolean combinations are not supported

Starknet v0.9.0 (June 06, 22)

This version introduces the contract class/instance paradigm into Starknet. See here for more information.

This version contains the following changes:

Starknet:

  • Enforce fees - max_fee must not be set to zero, and selector must be execute

  • Split the concepts of contract class and contract instance.

  • Add declare transaction type

  • New API and CLI commands:

  • declare - Declares a contract class

  • get_class_by_hash - Returns the contract class given its hash

  • get_class_hash_at - Returns the class hash for a given contract instance address

  • Rename delegate_call to library_call, and change the contract address argument to class hash.

  • Add a deploy system call.

  • Rename ContractDefinition to ContractClass

  • Reduce the compiled contract file’s size by removing unnecessary identifiers (this optimization can be disabled using --dont_filter_identifiers)

Cairo:

  • Initial support for the EC-op builtin (scalar multiplication over the STARK curve). Not supported in Starknet yet.

  • Add additional helper methods to blake2s.cairo, including big-endian support

Technical changes: * Change function’s return type from a struct to a named tuple. In particular, foo.Return.SIZE is no longer supported.