You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 or block.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`
function stateHash(ExecutionState calldata execState, uint256 inboxMaxCount)
internal
pure
returns (bytes32)
{
return
keccak256(
abi.encodePacked(
execState.globalState.hash(),
inboxMaxCount,
execState.machineStatus
)
);
}
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 need
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>
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){}
Then compare the 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.
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: