Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
New Opcode: SSTORE_COUNT #119
The SSTORE counter is shared by all recursive invocations of an account. The counter is reset for each transaction. The gas cost of
A contract can call this instruction twice to check if its storage has possibly changed. For instance, a contract can use this instruction before and after a call, to see if its storage has not been altered in a recursive-call to itself. The contract can use
The SSTORE counter is separate for each account, preventing side-channel information leakage.
This is relatively easy to implement, so we can aim at:
An instruction returning
This instruction allows an execution to protect itself from untrusted executions of the same account. Mutex requires cooperation between multiple executions of the same account (in case of re-entrance). With this instruction, only the original execution needs to follow a protocol to ensure its integrity.
Setting&resetting a mutex also consumes 4 times more gas than the usage presented.
Having access to the storage root of an account can also enable other use-cases. It is more general than the
On the other hand, if we give the EVM access to the storage root, any change in the storage trie structure would be a breaking change for the EVM.