-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement EXECUTE
precompile
#3865
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
8292fcd
to
5db3a51
Compare
for (const stem of accessedSuffixes.keys()) { | ||
tree.root(parentStateRoot) | ||
// Generate proofs for each stem from prestate root | ||
const proof = await tree.createBinaryProof(hexToBytes(stem)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do multiproof instead of per stem proof? (may be later i guess)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, yes. We just don't have multiproofs implemented for binary trees yet. This is as rudimentary as it gets.
const BinaryTreeExecutionWitness = ssz.container({ | ||
stateDiff: ssz.list(1024, StateDiff), // List of state diffs | ||
parentStateRoot: ssz.bytevector(32), // Parent state root as hex | ||
proof: ssz.list(256, ProofEntry), // List of proof entries with stems and proof data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assuming these are super low test limits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, completely arbitrary.
This is a proof-of-concept implementation of the simplest form of the
EXECUTE
precompile proposal, using transaction re-execution for verification of the L2 state transition.The current design expects a trace as an SSZ encoded object that contains a set of transactions (formatted as
eth_call
transactions) and a witness taking the form of a binary merkle tree execution witness modeled largely on the Verkle Execution Witness but with simple merkle proofs instead of a Verkle proof.As a short cut until proper blob referencing is implemented, the trace is stored as a simple bytestring in the EVM and referenced by the
sha256
hash of the trace in its bytes serialized form.Additional potential todos