Skip to content

Empty account should has explicity constraints #27

@noel2004

Description

@noel2004

There are two type of leaf nodes (leaf and empty) at the last row of a mpt circuit, which is adjacent to the rows of a account gadget. When the type of lead node is empty the value (hash) in this row is just zero so we can make the account gadget valid by flushing zero inside it (hashing (0, 0) -> 0 is valid in hash table current) but this has bring some unsound condition and should be fixed later (#17). It is also contradict to the "write on empty accont" entry of the rw table (#14)

So we should add explicity constraints in account gadget to accounting for the empty node in its adjacent mpt row that:

  • All variables in account except for code hashes (nonce, balance, codesize, storage root) is 0
  • code hash is poseidon(nil) and keccak code hash is keccak256(nil)

And make current constraints only being enabled for leaf node

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions