Open johnwhitton opened 1 month ago
Any update on this?
Hey, do you need to prove block number or block hash?
If, just block hash, you can get assertion
, it related inboxMsgCount
and the node number
off chain, then upload them on chain via this contract interface example:
function verify(Assertion calldata assertion, uint256 inboxMsgCount, uint256 nodeNumber) public returns(bool){}
You can implement this method by:
statehash
of the node you got from step one with the result from the step 2.If you want to verify the block number, you can translate inboxMsgCount
to the l2 block number by add the l2 genesis number
, currently arb1 is 22207817 but note the translation between inboxMsgCount
and l2 block number
might be changed in the future.
Also the roots
on outbox contains blockhash
: https://github.com/OffchainLabs/nitro-contracts/blob/main/src/bridge/AbsOutbox.sol#L105
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 tutorialHowever 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 isstateHash
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
and
and
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>