#Nonce ledger entries

3 messages · Page 1 of 1 (latest)

radiant raptor
#

With preview 10 we plan to move from per-contract+per-address autoincrement nonces for Soroban auth payloads to temp storage random nonces + signature expiration. This means that nonce no longer is attached to any contract. Our ContractData entries are always attributed to a contract though. So I see two options:

  • use ScAddress instead of Hash contractId in ContractData entries. this way we can store nonces for every valid address, including classic accounts. the downside is +4 bytes/contract data entry. the upside is that we provide an extension point if we ever want to provide some Soroban functionality for classic accounts (a simple example would be adding subscription support)
  • come up with a new entry just for nonces
  • use ContractData entry with some special hash (e.g. 0xff for all values) and address in the ScVal payload. the downside is +32 unnecessary bytes/nonce entry.

I would prefer the first option, but wanted to check if there are other options I'm missing or some concerns
cc @open wigeon @unkempt heron

open wigeon
#

We already use ScAddress instead of Hash for the contract address in contract invocations and auth, so I don't see the issue changing it in ContractData as well. Looks like it would make semantics more consistent.

#

Something to just keep in mind - make sure the config upgrades don't break. They use a hash to refer to the contractID. This should be caught by the test cases though.