juno icon indicating copy to clipboard operation
juno copied to clipboard

Address nonce

Open adriantpaez opened this issue 3 years ago • 1 comments

We need to support and maintain the nonce value for the addresses. This feature is required by the starknet_getNonce RPC endpoint.

nonce properties:

  • Counts all the transactions made by an address
  • Its value is relative to a block (or state root)
  • nonce never decreases. The nonce for address X at block i+1 is always greater than or equal to the nonce at block i

Solution proposal

We can store the nonce together with the storage root of the address, which means: in the Trie leaf resulting from traversing (following the address) the Trie from the block state root.

adriantpaez avatar Aug 11 '22 14:08 adriantpaez

With the release of starknet 0.10.0 we have the nonce included on L1 and also fetchable from the Feeder Gateway

stdevMac avatar Sep 01 '22 13:09 stdevMac