-
Notifications
You must be signed in to change notification settings - Fork 289
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
L2 block verification in assertion - enhance to use storageProofs #122
Comments
Any update on this? |
Hey, do you need to prove block number or block hash?
You can implement this method by:
If you want to verify the block number, you can translate Also the |
Hey @johnwhitton , for questions like those, it's better to go through Arbitrum's Discord server. I'll close this ticket now (since I think it's also resolved), but feel free to reopen if you are experiencing issues with any of the tutorials. |
Overview
Thanks for your work here and excellent tutorials.
We are looking to create a storageProof showing that the Arbitrum
block.number
for a Node is valid.This is similar to the l2-block-verification-in-assertion tutorial
However instead of relying on event messaging we need to prove the underlying values on chain using a secureMerkleTrie.
We were hoping that the Arbitrum
block.number
orblock.hash
would be stored against the node.However it appears that instead the closest we have is
stateHash
using the following values,assertion.afterstate.bytes32[0]: Arbitrum Block Number
0x17304244fc1e89f12d4a8b9f9dccac8f856f492babc0cc2b573b4bad73bfab41`assertion.afterstate.bytes32[1]: sendRoot
0x7a10019bc1e5caefe0e2ff1d63bf82fcc1b96a08b488d49d7a52ea057890c73e`assertion.u64vals[0]:
InboxPosition653147
assertion.u64.vals[1]:
PositionInMessage:235
assertion.machineStatus
: Finished1
memoryFrame.currentInboxSize
: numBlocks14375
Question
Can you help us provide information as to where we can source the following fields
assertion.u64vals[0]:
InboxPositionassertion.u64.vals[1]:
PositionInMessage:assertion.machineStatus
: Finished `memoryFrame.currentInboxSize
: numBlocksOr suggest an alternate approach to generating a storageProof linking the Node to it's Arbitrum Block Number.
Additional information
Sample data taken from this tenderly transaction
which are calculated in createNewNode using the following logic
Which calls
This means in order to prove this storageSlot we will need to manually calculate the
stateHash
using all the input values from the Assertion. Specifically we needwhich uses
struct ExecutionState { GlobalState globalState; MachineStatus machineStatus; }
and
and
enum MachineStatus { RUNNING, FINISHED, ERRORED, TOO_FAR }
Arbitrum Rollup Admin Storage
Following is the storage for the proxied implementation contract from Sepolia.
To retrieve this use the command
cast storage 0x2Bd2fB395888B799f736E10728dA5C46b83B87Cf --rpc-url https://eth-sepolia.g.alchemy.com/v2/<alchemky-key> -e <etherscan-key>
The text was updated successfully, but these errors were encountered: