-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add debug_executePayload
RPC to capture arbitrary execution witnesses
#12238
base: main
Are you sure you want to change the base?
Conversation
f855193
to
2671e49
Compare
4447422
to
4daa7ad
Compare
hasher.update(tx.hash()); | ||
eth_api.evm_config().fill_tx_env(evm.tx_mut(), &tx, signer); | ||
|
||
match evm.transact() { |
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.
Similar to the first draft of the debug_executionWitness
endpoint, we do need a bit more here. This endpoint also needs to apply the system transactions (4788) and OP Stack system transactions (Canyon's create2 deployer call, etc.)
Curious the Ithaca team's take here. Originally we didn't want to add this directly into the RPC endpoint implementation because of the duplication. For this we need to be able to access the payload building codepath, which may be a bit more annoying to get into the debug
API.
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.
A pretty key thing about this endpoint is that it can return witnesses in blocks that fail to entirely execute. With Holocene, there's the following case:
- Block
$A$ is sent to the engine, has a user-space tx that has an invalid signature. - Engine rejects block
$A$ - Rollup node trims off user-space transactions, sends deposit-only payload back to the engine (block
$A\prime$ ). - Engine accepts block
$A\prime$ .
It looks like we're currently ignoring the errors during transaction processing (and short-circuiting if the block fails to fully execute), though will also need to return whether the payload could be cleanly applied on top of the state at the block requested for the consumer.
Waiting on some new block builder improvements before adding this RPC endpoint. This will allow us to execute system transactions before other transactions in a block. |
This PR adds a new RPC endpoint:
This endpoint allows executing arbitrary transactions on top of parent block hash and returns the necessary state keys and trie preimages to verify the execution with only a state root.
To allow executing partial blocks, if a transaction fails, the storage loads and stores will still result in witnesses being included to be able to prove that the execution failed.
Return Value
Currently, I have it returning the same data as
debug_executionWitness
, but I think we'll also want to include transaction results (receipts, which transactions failed/succeeded, etc).I'm not sure what the interface should look like for the transaction results, but we could go with something like this to keep things simple:
Let me know if adding a transaction result makes sense and what
Open Questions
allowFailure: boolean
that enables the behavior of not failing when a transaction fails?Update 10/31 2:50 PT: Added payload attributes field after clarifying with Optimism team.