L2 output-root bonus: embed L2 history merkle accumulator #235
Replies: 6 comments
-
More advanced extension of this idea: include a 2nd tree accumulator, of all historical receipts (each receipt merkleized nicely as well) for easy consumption of L2 events on other chains/L1. That way users do not have to present a long complex proof like |
Beta Was this translation helpful? Give feedback.
-
Yes! I was thinking about that myself. Regarding the code, Read the deposit contract, I'm not surprised it needs formal verification, it's a really tight, but super tricky piece of code. |
Beta Was this translation helpful? Give feedback.
-
How would the fault proof account for a fault in one of these output 'components'? Would we need to modify the proof to allow for a challenge against (for example) the withdrawal storage tree root, or is there an elegant way to incorporate that in the general challenge flow?
This L2 related data would be generated by the execution engine, and included in what is currently referred to as the "L1 attributes deposited transaction"?
So, this would be a storage efficient alternative to just keeping an array of L2 block hashes and state roots. Assuming I got all that, what's the motivation? I suppose it's a utility service we're providing, that facilitates the creation of a things like storage oracles (ie. the uniswap-oracle)? |
Beta Was this translation helpful? Give feedback.
-
Instead of stopping the execution trace as soon as we have the state root, we continue the processing with construction of the L2 output-root. No additional challenges/games required.
Basically yes, we want to expose information like the history accumulator in the EVM, and can do so by deriving a system deposit that calls a contract that maintains + stores it. And instead of an additional one, we can just combine it with the L1 info deposit work.
Indeed, to limit state growth, and since we want a binary merkle tree (for efficient history proofs) without recomputing the merkle-root over all data every block.
Enabling more interesting applications, a history proof can enable a trustless oracle of a block header (includes receipt root) or state root. And we can use it on both L1 and L2. The |
Beta Was this translation helpful? Give feedback.
-
OK, this is interesting, and the effort required to create A natural question then is, should we also provide an L1 history accumulator? |
Beta Was this translation helpful? Give feedback.
-
I am generally in favor of these ideas although we do need to take into account the fact that the more computation that happens during these transactions, the less gas there is in a block for other transactions, since this transaction must be the very first transaction in each block. Making common operations convenient for developers could make a huge difference in adoption vs other chains |
Beta Was this translation helpful? Give feedback.
-
When constructing the output root, we can include many useful things, such as:
There is one bottleneck for introducing more of these though: as a user that wants to create a proof for any of these, all the sibling data needs to be easily accessible. E.g. for a withdrawal proof we do not want to merkleize the full L2 history, but just look it up (like calling a smart-contract or reading a specific storage slot).
The first 4 are directly accessible:
The history accumulator is more difficult: to have instant access, we need to actively keep track of the accumulator root. And preferably without modifying the execution-engine.
So how can we do this? By modifying the
L1Info
predeploy to become a more genericRollupInfo
predeploy: we run this transaction every time, and implement a merkle-accumulator. This can be stack based to save storage, just like the formally-verified Beacon deposit contract does.This would change the contract to look more like:
This way we have a binary-merkle-tree of all L2 block hashes and state-roots (hashed together as leaf value), to proof any L2 history, and make it readable to other EVM users (public
historyRoot
contract storage var), and directly readable to those that need it as merkle sibling data in a proof for other L2 output contents.Beta Was this translation helpful? Give feedback.
All reactions