Releases: starkware-libs/cairo-lang
Releases · starkware-libs/cairo-lang
v0.9.0
StarkNet:
- Enforce fees -
max_fee
must not be set to zero, andselector
must be__execute__
- Split the concepts of contract class and contract instance. See here
- Add declare transaction type
- New API and CLI commands:
declare
- Declares a contract classget_class_by_hash
- Returns the contract class given its hashget_class_hash_at
- Returns the class hash for a given contract instance address
- Rename
delegate_call
tolibrary_call
, and change the contract address argument to class hash. See here
- Add a deploy system call. See here
- Rename
ContractDefinition
toContractClass
- 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.
- Change function's return type from a struct to a named tuple. In particular,
v0.8.2
StarkNet:
- Performance improvements in the
get_block
andget_state_update
APIs - Fix a bug in the block hash response of
get_block
- Add
gas_price
andsequencer_address
fields to block info - Add an option to explicitly pass
latest
in theblockNumber
argument (you can passlatest
orpending
in addition to a block number).
Cairo:
- New library functions:
- keccak hash function - Cairo implementation
- secp256k1 ECDSA (Ethereum compatible signature verification) - Cairo implementation
- Auto-formatting of multiline tuple types
v0.8.1
StarkNet:
- API changes (breaking changes):
- Convert the transaction's
signature
field to hex in the response objects - Add
class_hash
to DeploySpecificInfo
- Convert the transaction's
- Fees:
- Change the way transaction fee is computed to include L1 operations and system call costs
- Use L1 data to obtain gas prices in ETH
Cairo:
- Change the auto-formatting of function arguments to an argument-per-line mode (unless all arguments fit into a single line). Use
--no_one_item_per_line
for the old formatting. - Bug fixes:
- A bug that prevented declaring local variables inside a
with_attr
statement - A bug that prevented using
cairo-lang
withpython3.9
- A bug that prevented declaring local variables inside a
v0.8.0
StarkNet
- Support paying fees for transactions
- System calls:
- Add transaction hash and chain id to the
TxInfo
struct. See here
- Add transaction hash and chain id to the
- API:
estimate_fee
get_transaction_trace
- shows the internal calls executed by the transactions in a tree structure. See hereget_transaction
returns a new fieldmax_fee
and thecalldata
field was changed from decimal to hex
- Add an option to cancel an L1->L2 message. See here
- Testing framework:
- Add
replace_abi()
function (useful for the proxy pattern)
- Add
- Technical changes:
- Add
version
andmax_fee
fields to the transaction hash - Account contracts should have an
__execute__
function. To compile a contract with such an external function, you should pass the--account_contract
flag to the compiler.
- Add
Cairo:
v0.7.1
StarkNet:
- Some performance improvements
- System calls:
get_tx_info()
- Return a struct with information about the transactions. See https://www.starknet.io/docs/hello_starknet/more_features.html#retrieving-the-transaction-informationget_tx_signature()
is deprecated - useget_tx_info()
instead.
- API:
get_state_update
- Returns the state diff of a given blockget_full_contract
- Returns the full contract definition (including the hints). See https://www.starknet.io/docs/hello_starknet/cli.html#get-full-contract.
- Client libraries:
- Return structured classes in
FeederGatewayClient
.
- Return structured classes in
Cairo:
- Support
felt*
innondet
expressions.
v0.7.0
StarkNet:
-
Improvements in transaction cost estimations. Note that this may cause transactions that would have been accepted in the past to be rejected, and it may affect how many transactions are included in each block
-
Add nonce to L1->L2 messages (note that this affects the hash of the corresponding transactions)
-
Small optimizations in on-chain data
-
Contracts:
%builtins
directive is no longer required in StarkNet contracts- Support passing and returning arrays of structs in external functions
- Support events (https://starknet.io/docs/hello_starknet/events.html)
- Support delegate calls (https://starknet.io/docs/hello_starknet/calling_contracts.html#delegate-calls)
- Support default entry point (https://starknet.io/docs/hello_starknet/default_entrypoint.html)
- New system calls:
delegate_l1_handler
get_block_number
- Returns the sequential block number of the block containing the transaction (https://starknet.io/docs/hello_starknet/more_features.html#block-number-and-timestamp)get_block_timestamp
- Returns the timestamp at the beginning of the block's creation. Note that currently this value is not validated by the StarkNet OS (https://starknet.io/docs/hello_starknet/more_features.html#block-number-and-timestamp)emit_event
- Support
@raw_input
and@raw_output
that disables the automatic calldata/return-value processing (https://starknet.io/docs/hello_starknet/default_entrypoint.html#default-entry-point)
-
StarkNet CLI:
- Support account contracts (https://starknet.io/docs/hello_starknet/account_setup.html)
- Deploy Open Zeppelin's account contract
- Automatically sign transactions
- Support passing negative inputs to contracts
- Support querying the pending block
- Support reconstructing trace when a contract calls another contract (https://starknet.io/docs/hello_starknet/user_auth.html#retrieving-the-revert-reason)
- Support account contracts (https://starknet.io/docs/hello_starknet/account_setup.html)
-
Testing framework:
- Support negative inputs (up to -PRIME/2)
- Add events to the execution info
postman
- Testing framework for L1<->L2 interaction
Cairo:
- Added
sqrt
(square root) functions forfelt
anduint256
to the math common library - Support attaching indicative error message to failures (https://cairo-lang.org/docs/how_cairo_works/scope_attributes.html)
- Named arguments in struct constructors are now verified by the compiler (they were ignored before)
v0.6.2
StarkNet:
- Split
PENDING
status intoPENDING
andACCEPTED_ON_L2
. - StarkNet CLI: Renamed "alpha" network to "alpha-goerli".
- Storage variables support felts-only types (structs and tuples that don't contain pointers).
Cairo:
Uint256
bitwise functions are now using the bitwise builtin (making them much more efficient).
v0.6.1
v0.6.0
StarkNet:
- Replace block id with block hash (not verified by the OS yet)
- Add constructor arguments to the computation of the contract's address
- Add
get_transaction_receipt
command to thestarknet
CLI - New system calls:
get_contract_address
- returns the address of the current contractget_sequencer_address
- this may be used in the future for paying feesdelegate_call
- partial support
Cairo:
- Add
dw
keyword for defining constant arrays