From 56cbd34ba7c44318c6d82082be01d6045ce77df4 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 19 May 2026 10:37:44 +0100 Subject: [PATCH 1/9] Use nextParentChainBlockHash in Challenge and OSP entry contract --- src/challengeV2/EdgeChallengeManager.sol | 6 +-- src/mocks/SimpleOneStepProofEntry.sol | 23 ++++++--- src/osp/IOneStepProver.sol | 4 +- src/osp/OneStepProofEntry.sol | 16 +++++- src/state/Deserialize.sol | 63 ++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 14 deletions(-) diff --git a/src/challengeV2/EdgeChallengeManager.sol b/src/challengeV2/EdgeChallengeManager.sol index 0d7de3e53..6cd670507 100644 --- a/src/challengeV2/EdgeChallengeManager.sol +++ b/src/challengeV2/EdgeChallengeManager.sol @@ -399,12 +399,8 @@ contract EdgeChallengeManager is IEdgeChallengeManager, Initializable { assertionChain.validateConfig(prevAssertionHash, prevConfig); - // TODO(PR 427): OSP contracts are marked as pending work in the PR. - // Inbox-position-based checks no longer apply; use type(uint256).max as - // a stopgap until OSP is rewired against `nextParentChainBlockHash`. ExecutionContext memory execCtx = ExecutionContext({ - maxInboxMessagesRead: type(uint256).max, - bridge: assertionChain.bridge(), + maxParentChainBlockHash: prevConfig.nextParentChainBlockHash, initialWasmModuleRoot: prevConfig.wasmModuleRoot }); diff --git a/src/mocks/SimpleOneStepProofEntry.sol b/src/mocks/SimpleOneStepProofEntry.sol index 556150d11..66de0e3eb 100644 --- a/src/mocks/SimpleOneStepProofEntry.sol +++ b/src/mocks/SimpleOneStepProofEntry.sol @@ -9,6 +9,7 @@ import "../state/Deserialize.sol"; contract SimpleOneStepProofEntry is IOneStepProofEntry { using GlobalStateLib for GlobalState; + using MELStateLib for MELState; // End the batch after 2000 steps. This results in 11 blocks for an honest validator. // This constant must be synchronized with the one in execution/engine.go @@ -26,23 +27,33 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { uint256 step, bytes32 beforeHash, bytes calldata proof - ) external view returns (bytes32 afterHash) { + ) external pure returns (bytes32 afterHash) { if (proof.length == 0) { revert("EMPTY_PROOF"); } GlobalState memory globalState; uint256 offset; - (globalState.u64Vals[0], offset) = Deserialize.u64(proof, offset); - (globalState.u64Vals[1], offset) = Deserialize.u64(proof, offset); - if (step > 0 && (beforeHash[0] == 0 || globalState.getPositionInMessage() == 0)) { + (globalState.bytes32Vals[3], offset) = Deserialize.b32(proof, offset); // MELNextMsgHash + (globalState.u64Vals[0], offset) = Deserialize.u64(proof, offset); // MELMsgCount + (globalState.u64Vals[1], offset) = Deserialize.u64(proof, offset); // MELExecutedMsgCount + + MELState memory melState; + (melState.parentChainBlockHash, offset) = Deserialize.b32(proof, offset); + + if (step > 0 && (beforeHash[0] == 0 || globalState.getMELNextMsgHash() == bytes32(0))) { // We end the block when the first byte of the hash hits 0 or we advance a batch return beforeHash; } - if (globalState.getInboxPosition() >= execCtx.maxInboxMessagesRead) { - // We can't continue further because we've hit the max inbox messages read + if ( + melState.parentChainBlockHash == execCtx.maxParentChainBlockHash + && globalState.getMELExecutedMsgCount() >= globalState.getMELMsgCount() + ) { + // We can't continue further because we've executed all messages up to this melState return beforeHash; } require(globalState.hash() == beforeHash, "BAD_PROOF"); + + // TODO: modify this logic once execution_engine.go is modified globalState.u64Vals[1]++; if (globalState.u64Vals[1] % STEPS_PER_BATCH == 0) { globalState.u64Vals[0]++; diff --git a/src/osp/IOneStepProver.sol b/src/osp/IOneStepProver.sol index 6fbc74228..c3b1e69bb 100644 --- a/src/osp/IOneStepProver.sol +++ b/src/osp/IOneStepProver.sol @@ -12,8 +12,8 @@ import "../bridge/ISequencerInbox.sol"; import "../bridge/IBridge.sol"; struct ExecutionContext { - uint256 maxInboxMessagesRead; - IBridge bridge; + bytes32 maxParentChainBlockHash; + // IBridge bridge; bytes32 initialWasmModuleRoot; } diff --git a/src/osp/OneStepProofEntry.sol b/src/osp/OneStepProofEntry.sol index 51e58a077..6f20c6baa 100644 --- a/src/osp/OneStepProofEntry.sol +++ b/src/osp/OneStepProofEntry.sol @@ -15,6 +15,7 @@ contract OneStepProofEntry is IOneStepProofEntry { using MerkleProofLib for MerkleProof; using MachineLib for Machine; using GlobalStateLib for GlobalState; + using MELStateLib for MELState; using MultiStackLib for MultiStack; using ValueStackLib for ValueStack; @@ -104,9 +105,22 @@ contract OneStepProofEntry is IOneStepProofEntry { GlobalState memory globalState; (globalState, offset) = Deserialize.globalState(proof, offset); require(globalState.hash() == mach.globalStateHash, "BAD_GLOBAL_STATE"); + + MELState memory melState; + (melState, offset) = Deserialize.melState(proof, offset); + require(melState.hash() == globalState.getMELStateHash(), "BAD_MEL_STATE"); + + // The machine has finished processing a message and we're at the start of the next execution segment (machineStep == 0). + // If the MELState is not at its target (meaning that it hasn't finished extracting messages), + // or there are still messages to be processed in MEL, we kickstart the machine. if ( mach.status == MachineStatus.FINISHED && machineStep == 0 - && globalState.getInboxPosition() < execCtx.maxInboxMessagesRead + && ( + // Machine hasn't extracted messages for this assertion (should only happen before the extraction process is started) + melState.parentChainBlockHash != execCtx.maxParentChainBlockHash + // Machine finishes extracting all messages, but hasn't finished executing them yet + || globalState.getMELExecutedMsgCount() < globalState.getMELMsgCount() + ) ) { // Kickstart the machine return getStartMachineHash(mach.globalStateHash, execCtx.initialWasmModuleRoot); diff --git a/src/state/Deserialize.sol b/src/state/Deserialize.sol index 7c7a9ac6e..3d9db0f9a 100644 --- a/src/state/Deserialize.sol +++ b/src/state/Deserialize.sol @@ -14,6 +14,7 @@ import "./MerkleProof.sol"; import "./ModuleMemoryCompact.sol"; import "./Module.sol"; import "./GlobalState.sol"; +import "./MELState.sol"; library Deserialize { function u8( @@ -92,6 +93,16 @@ library Deserialize { offset++; } + function addr( + bytes calldata proof, + uint256 startOffset + ) internal pure returns (address ret, uint256 offset) { + offset = startOffset; + uint256 retInt; + (retInt, offset) = u256(proof, offset); + ret = address(uint160(retInt)); + } + function value( bytes calldata proof, uint256 startOffset @@ -252,6 +263,58 @@ library Deserialize { state = GlobalState({bytes32Vals: bytes32Vals, u64Vals: u64Vals}); } + + function melState( + bytes calldata proof, + uint256 startOffset + ) internal pure returns (MELState memory state, uint256 offset) { + offset = startOffset; + uint16 version; + uint64 parentChainId; + uint64 parentChainBlockNumber; + address batchPostingTargetAddress; + address delayedMessagePostingTargetAddress; + bytes32 parentChainBlockHash; + bytes32 parentChainPreviousBlockHash; + uint64 batchCount; + uint64 msgCount; + bytes32 localMsgAccumulator; + uint64 delayedMessagesRead; + uint64 delayedMessagesSeen; + bytes32 delayedMessageInboxAcc; + bytes32 delayedMessageOutboxAcc; + (version, offset) = u16(proof, offset); + (parentChainId, offset) = u64(proof, offset); + (parentChainBlockNumber, offset) = u64(proof, offset); + (batchPostingTargetAddress, offset) = addr(proof, offset); + (delayedMessagePostingTargetAddress, offset) = addr(proof, offset); + (parentChainBlockHash, offset) = b32(proof, offset); + (parentChainPreviousBlockHash, offset) = b32(proof, offset); + (batchCount, offset) = u64(proof, offset); + (msgCount, offset) = u64(proof, offset); + (localMsgAccumulator, offset) = b32(proof, offset); + (delayedMessagesRead, offset) = u64(proof, offset); + (delayedMessagesSeen, offset) = u64(proof, offset); + (delayedMessageInboxAcc, offset) = b32(proof, offset); + (delayedMessageOutboxAcc, offset) = b32(proof, offset); + + state = MELState({ + version: version, + parentChainId: parentChainId, + parentChainBlockNumber: parentChainBlockNumber, + batchPostingTargetAddress: batchPostingTargetAddress, + delayedMessagePostingTargetAddress: delayedMessagePostingTargetAddress, + parentChainBlockHash: parentChainBlockHash, + parentChainPreviousBlockHash: parentChainPreviousBlockHash, + batchCount: batchCount, + msgCount: msgCount, + localMsgAccumulator: localMsgAccumulator, + delayedMessagesRead: delayedMessagesRead, + delayedMessagesSeen: delayedMessagesSeen, + delayedMessageInboxAcc: delayedMessageInboxAcc, + delayedMessageOutboxAcc: delayedMessageOutboxAcc + }); + } function machine( bytes calldata proof, From 9b53a671c68a895340d9e8576cbca261805b65ab Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Thu, 21 May 2026 12:46:00 +0100 Subject: [PATCH 2/9] Add new GET_END_PARENT_CHAIN_BLOCK_HASH opcode and remove READ_INBOX_MESSAGE paths --- src/challengeV2/EdgeChallengeManager.sol | 2 +- src/mocks/SimpleOneStepProofEntry.sol | 2 +- src/osp/IOneStepProver.sol | 3 +- src/osp/OneStepProofEntry.sol | 3 +- src/osp/OneStepProverHostIo.sol | 157 +++++------------------ src/state/Deserialize.sol | 73 +++++------ src/state/Instructions.sol | 8 +- 7 files changed, 72 insertions(+), 176 deletions(-) diff --git a/src/challengeV2/EdgeChallengeManager.sol b/src/challengeV2/EdgeChallengeManager.sol index 6cd670507..8e2d56057 100644 --- a/src/challengeV2/EdgeChallengeManager.sol +++ b/src/challengeV2/EdgeChallengeManager.sol @@ -400,7 +400,7 @@ contract EdgeChallengeManager is IEdgeChallengeManager, Initializable { assertionChain.validateConfig(prevAssertionHash, prevConfig); ExecutionContext memory execCtx = ExecutionContext({ - maxParentChainBlockHash: prevConfig.nextParentChainBlockHash, + targetParentChainBlockHash: prevConfig.nextParentChainBlockHash, initialWasmModuleRoot: prevConfig.wasmModuleRoot }); diff --git a/src/mocks/SimpleOneStepProofEntry.sol b/src/mocks/SimpleOneStepProofEntry.sol index 66de0e3eb..69f490ff7 100644 --- a/src/mocks/SimpleOneStepProofEntry.sol +++ b/src/mocks/SimpleOneStepProofEntry.sol @@ -45,7 +45,7 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { return beforeHash; } if ( - melState.parentChainBlockHash == execCtx.maxParentChainBlockHash + melState.parentChainBlockHash == execCtx.targetParentChainBlockHash && globalState.getMELExecutedMsgCount() >= globalState.getMELMsgCount() ) { // We can't continue further because we've executed all messages up to this melState diff --git a/src/osp/IOneStepProver.sol b/src/osp/IOneStepProver.sol index c3b1e69bb..fb388dd89 100644 --- a/src/osp/IOneStepProver.sol +++ b/src/osp/IOneStepProver.sol @@ -12,8 +12,7 @@ import "../bridge/ISequencerInbox.sol"; import "../bridge/IBridge.sol"; struct ExecutionContext { - bytes32 maxParentChainBlockHash; - // IBridge bridge; + bytes32 targetParentChainBlockHash; bytes32 initialWasmModuleRoot; } diff --git a/src/osp/OneStepProofEntry.sol b/src/osp/OneStepProofEntry.sol index 6f20c6baa..3008f9139 100644 --- a/src/osp/OneStepProofEntry.sol +++ b/src/osp/OneStepProofEntry.sol @@ -117,7 +117,7 @@ contract OneStepProofEntry is IOneStepProofEntry { mach.status == MachineStatus.FINISHED && machineStep == 0 && ( // Machine hasn't extracted messages for this assertion (should only happen before the extraction process is started) - melState.parentChainBlockHash != execCtx.maxParentChainBlockHash + melState.parentChainBlockHash != execCtx.targetParentChainBlockHash // Machine finishes extracting all messages, but hasn't finished executing them yet || globalState.getMELExecutedMsgCount() < globalState.getMELMsgCount() ) @@ -201,6 +201,7 @@ contract OneStepProofEntry is IOneStepProofEntry { ) || (opcode >= Instructions.VALIDATE_CERTIFICATE && opcode <= Instructions.UNLINK_MODULE) || (opcode >= Instructions.NEW_COTHREAD && opcode <= Instructions.SWITCH_COTHREAD) + || (opcode == Instructions.GET_END_PARENT_CHAIN_BLOCK_HASH) ) { prover = proverHostIo; } else { diff --git a/src/osp/OneStepProverHostIo.sol b/src/osp/OneStepProverHostIo.sol index fc4531c21..85b2358bb 100644 --- a/src/osp/OneStepProverHostIo.sol +++ b/src/osp/OneStepProverHostIo.sol @@ -12,8 +12,6 @@ import "../state/Deserialize.sol"; import "../state/ModuleMemory.sol"; import "./IOneStepProver.sol"; import "./ICustomDAProofValidator.sol"; -import "../bridge/Messages.sol"; -import "../bridge/IBridge.sol"; contract OneStepProverHostIo is IOneStepProver { using GlobalStateLib for GlobalState; @@ -26,9 +24,6 @@ contract OneStepProverHostIo is IOneStepProver { using StackFrameLib for StackFrameWindow; uint256 private constant LEAF_SIZE = 32; - uint256 private constant INBOX_NUM = 2; - uint64 private constant INBOX_HEADER_LEN = 40; - uint64 private constant DELAYED_HEADER_LEN = 112 + 1; // CustomDA proof format constants uint256 private constant CERT_SIZE_LEN = 8; @@ -357,124 +352,6 @@ contract OneStepProverHostIo is IOneStepProver { return isValid; } - function validateSequencerInbox( - ExecutionContext calldata execCtx, - uint64 msgIndex, - bytes calldata message - ) internal view returns (bool) { - require(message.length >= INBOX_HEADER_LEN, "BAD_SEQINBOX_PROOF"); - - uint64 afterDelayedMsg; - (afterDelayedMsg,) = Deserialize.u64(message, 32); - bytes32 messageHash = keccak256(message); - bytes32 beforeAcc; - bytes32 delayedAcc; - - if (msgIndex > 0) { - beforeAcc = execCtx.bridge.sequencerInboxAccs(msgIndex - 1); - } - if (afterDelayedMsg > 0) { - delayedAcc = execCtx.bridge.delayedInboxAccs(afterDelayedMsg - 1); - } - bytes32 acc = keccak256(abi.encodePacked(beforeAcc, messageHash, delayedAcc)); - require(acc == execCtx.bridge.sequencerInboxAccs(msgIndex), "BAD_SEQINBOX_MESSAGE"); - return true; - } - - function validateDelayedInbox( - ExecutionContext calldata execCtx, - uint64 msgIndex, - bytes calldata message - ) internal view returns (bool) { - require(message.length >= DELAYED_HEADER_LEN, "BAD_DELAYED_PROOF"); - - bytes32 beforeAcc; - - if (msgIndex > 0) { - beforeAcc = execCtx.bridge.delayedInboxAccs(msgIndex - 1); - } - - bytes32 messageDataHash = keccak256(message[DELAYED_HEADER_LEN:]); - bytes1 kind = message[0]; - uint256 sender; - (sender,) = Deserialize.u256(message, 1); - - bytes32 messageHash = keccak256( - abi.encodePacked(kind, uint160(sender), message[33:DELAYED_HEADER_LEN], messageDataHash) - ); - bytes32 acc = Messages.accumulateInboxMessage(beforeAcc, messageHash); - - require(acc == execCtx.bridge.delayedInboxAccs(msgIndex), "BAD_DELAYED_MESSAGE"); - return true; - } - - function executeReadInboxMessage( - ExecutionContext calldata execCtx, - Machine memory mach, - Module memory mod, - Instruction calldata inst, - bytes calldata proof - ) internal view { - uint256 messageOffset = mach.valueStack.pop().assumeI32(); - uint256 ptr = mach.valueStack.pop().assumeI32(); - uint256 msgIndex = mach.valueStack.pop().assumeI64(); - if ( - inst.argumentData == Instructions.INBOX_INDEX_SEQUENCER - && msgIndex >= execCtx.maxInboxMessagesRead - ) { - mach.status = MachineStatus.ERRORED; - return; - } - - if (ptr + 32 > mod.moduleMemory.size || ptr % LEAF_SIZE != 0) { - mach.status = MachineStatus.ERRORED; - return; - } - - uint256 leafIdx = ptr / LEAF_SIZE; - uint256 proofOffset = 0; - bytes32 leafContents; - MerkleProof memory merkleProof; - (leafContents, proofOffset, merkleProof) = - mod.moduleMemory.proveLeaf(leafIdx, proof, proofOffset); - - { - // TODO: support proving via an authenticated contract - require(proof[proofOffset] == 0, "UNKNOWN_INBOX_PROOF"); - proofOffset++; - - function(ExecutionContext calldata, uint64, bytes calldata) internal view returns (bool) - inboxValidate; - - bool success; - if (inst.argumentData == Instructions.INBOX_INDEX_SEQUENCER) { - inboxValidate = validateSequencerInbox; - } else if (inst.argumentData == Instructions.INBOX_INDEX_DELAYED) { - inboxValidate = validateDelayedInbox; - } else { - mach.status = MachineStatus.ERRORED; - return; - } - success = inboxValidate(execCtx, uint64(msgIndex), proof[proofOffset:]); - if (!success) { - mach.status = MachineStatus.ERRORED; - return; - } - } - - require(proof.length >= proofOffset, "BAD_MESSAGE_PROOF"); - uint256 messageLength = proof.length - proofOffset; - - uint32 i = 0; - for (; i < 32 && messageOffset + i < messageLength; i++) { - leafContents = - setLeafByte(leafContents, i, uint8(proof[proofOffset + messageOffset + i])); - } - - mod.moduleMemory.merkleRoot = merkleProof.computeRootFromMemory(leafIdx, leafContents); - mach.valueStack.push(ValueLib.newI32(i)); - } - function executeHaltAndSetFinished( ExecutionContext calldata, Machine memory mach, @@ -694,6 +571,34 @@ contract OneStepProverHostIo is IOneStepProver { mach.switchCoThreadStacks(); } + function executeGetEndParentChainBlockHash( + ExecutionContext calldata execCtx, + Machine memory mach, + Module memory mod, + Instruction calldata, + bytes calldata proof + ) internal pure { + // Pop pointer to leaf from the value stack where the target parent chain block hash will be written to + uint256 ptr = mach.valueStack.pop().assumeI32(); + + // Validate the leaf + if (!mod.moduleMemory.isValidLeaf(ptr)) { + mach.status = MachineStatus.ERRORED; + return; + } + + // Prove the leaf in memory + uint256 leafIdx = ptr / LEAF_SIZE; + uint256 proofOffset = 0; + MerkleProof memory merkleProof; + (, , merkleProof) = + mod.moduleMemory.proveLeaf(leafIdx, proof, proofOffset); + + // Update merkle root + mod.moduleMemory.merkleRoot = + merkleProof.computeRootFromMemory(leafIdx, execCtx.targetParentChainBlockHash); + } + function executeOneStep( ExecutionContext calldata execCtx, Machine calldata startMach, @@ -719,8 +624,6 @@ contract OneStepProverHostIo is IOneStepProver { impl = executeValidatePreimage; } else if (opcode == Instructions.READ_PRE_IMAGE) { impl = executeReadPreImage; - } else if (opcode == Instructions.READ_INBOX_MESSAGE) { - impl = executeReadInboxMessage; } else if (opcode == Instructions.HALT_AND_SET_FINISHED) { impl = executeHaltAndSetFinished; } else if (opcode == Instructions.LINK_MODULE) { @@ -733,8 +636,10 @@ contract OneStepProverHostIo is IOneStepProver { impl = executePopCoThread; } else if (opcode == Instructions.SWITCH_COTHREAD) { impl = executeSwitchCoThread; + } else if (opcode == Instructions.GET_END_PARENT_CHAIN_BLOCK_HASH) { + impl = executeGetEndParentChainBlockHash; } else { - revert("INVALID_MEMORY_OPCODE"); + revert("INVALID_HOSTIO_OPCODE"); } impl(execCtx, mach, mod, inst, proof); diff --git a/src/state/Deserialize.sol b/src/state/Deserialize.sol index 3d9db0f9a..2ddd27d75 100644 --- a/src/state/Deserialize.sol +++ b/src/state/Deserialize.sol @@ -269,51 +269,40 @@ library Deserialize { uint256 startOffset ) internal pure returns (MELState memory state, uint256 offset) { offset = startOffset; - uint16 version; - uint64 parentChainId; - uint64 parentChainBlockNumber; - address batchPostingTargetAddress; - address delayedMessagePostingTargetAddress; - bytes32 parentChainBlockHash; - bytes32 parentChainPreviousBlockHash; - uint64 batchCount; - uint64 msgCount; - bytes32 localMsgAccumulator; - uint64 delayedMessagesRead; - uint64 delayedMessagesSeen; - bytes32 delayedMessageInboxAcc; - bytes32 delayedMessageOutboxAcc; - (version, offset) = u16(proof, offset); - (parentChainId, offset) = u64(proof, offset); - (parentChainBlockNumber, offset) = u64(proof, offset); - (batchPostingTargetAddress, offset) = addr(proof, offset); - (delayedMessagePostingTargetAddress, offset) = addr(proof, offset); - (parentChainBlockHash, offset) = b32(proof, offset); - (parentChainPreviousBlockHash, offset) = b32(proof, offset); - (batchCount, offset) = u64(proof, offset); - (msgCount, offset) = u64(proof, offset); - (localMsgAccumulator, offset) = b32(proof, offset); - (delayedMessagesRead, offset) = u64(proof, offset); - (delayedMessagesSeen, offset) = u64(proof, offset); - (delayedMessageInboxAcc, offset) = b32(proof, offset); - (delayedMessageOutboxAcc, offset) = b32(proof, offset); + // Initialize with dummy values to avoid filling up the stack state = MELState({ - version: version, - parentChainId: parentChainId, - parentChainBlockNumber: parentChainBlockNumber, - batchPostingTargetAddress: batchPostingTargetAddress, - delayedMessagePostingTargetAddress: delayedMessagePostingTargetAddress, - parentChainBlockHash: parentChainBlockHash, - parentChainPreviousBlockHash: parentChainPreviousBlockHash, - batchCount: batchCount, - msgCount: msgCount, - localMsgAccumulator: localMsgAccumulator, - delayedMessagesRead: delayedMessagesRead, - delayedMessagesSeen: delayedMessagesSeen, - delayedMessageInboxAcc: delayedMessageInboxAcc, - delayedMessageOutboxAcc: delayedMessageOutboxAcc + version: 0, + parentChainId: 0, + parentChainBlockNumber: 0, + batchPostingTargetAddress: address(0), + delayedMessagePostingTargetAddress: address(0), + parentChainBlockHash: bytes32(0), + parentChainPreviousBlockHash: bytes32(0), + batchCount: 0, + msgCount: 0, + localMsgAccumulator: bytes32(0), + delayedMessagesRead: 0, + delayedMessagesSeen: 0, + delayedMessageInboxAcc: bytes32(0), + delayedMessageOutboxAcc: bytes32(0) }); + + // Fill in the actual values + (state.version, offset) = u16(proof, offset); + (state.parentChainId, offset) = u64(proof, offset); + (state.parentChainBlockNumber, offset) = u64(proof, offset); + (state.batchPostingTargetAddress, offset) = addr(proof, offset); + (state.delayedMessagePostingTargetAddress, offset) = addr(proof, offset); + (state.parentChainBlockHash, offset) = b32(proof, offset); + (state.parentChainPreviousBlockHash, offset) = b32(proof, offset); + (state.batchCount, offset) = u64(proof, offset); + (state.msgCount, offset) = u64(proof, offset); + (state.localMsgAccumulator, offset) = b32(proof, offset); + (state.delayedMessagesRead, offset) = u64(proof, offset); + (state.delayedMessagesSeen, offset) = u64(proof, offset); + (state.delayedMessageInboxAcc, offset) = b32(proof, offset); + (state.delayedMessageOutboxAcc, offset) = b32(proof, offset); } function machine( diff --git a/src/state/Instructions.sol b/src/state/Instructions.sol index 3ab22cdef..599981151 100644 --- a/src/state/Instructions.sol +++ b/src/state/Instructions.sol @@ -144,7 +144,7 @@ library Instructions { uint16 internal constant VALIDATE_CERTIFICATE = 0x8019; uint16 internal constant READ_PRE_IMAGE = 0x8020; - uint16 internal constant READ_INBOX_MESSAGE = 0x8021; + uint16 internal constant READ_INBOX_MESSAGE = 0x8021; // Deprecated uint16 internal constant HALT_AND_SET_FINISHED = 0x8022; uint16 internal constant LINK_MODULE = 0x8023; uint16 internal constant UNLINK_MODULE = 0x8024; @@ -153,8 +153,10 @@ library Instructions { uint16 internal constant POP_COTHREAD = 0x8031; uint16 internal constant SWITCH_COTHREAD = 0x8032; - uint256 internal constant INBOX_INDEX_SEQUENCER = 0; - uint256 internal constant INBOX_INDEX_DELAYED = 1; + uint16 internal constant GET_END_PARENT_CHAIN_BLOCK_HASH = 0x8033; + + uint256 internal constant INBOX_INDEX_SEQUENCER = 0; // Deprecated + uint256 internal constant INBOX_INDEX_DELAYED = 1; // Deprecated function hash( Instruction[] memory code From 6fe7c572acf29d84b2af907693b7a7fe4842025a Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Thu, 21 May 2026 12:50:35 +0100 Subject: [PATCH 3/9] Signatures and format --- src/mocks/SimpleOneStepProofEntry.sol | 8 +- src/osp/OneStepProverHostIo.sol | 9 +- src/state/Deserialize.sol | 2 +- test/signatures/EdgeChallengeManager | 134 +++++++------- test/signatures/OneStepProofEntry | 34 ++-- test/signatures/OneStepProver0 | 10 +- test/signatures/OneStepProverHostIo | 14 +- test/signatures/OneStepProverMath | 10 +- test/signatures/OneStepProverMemory | 10 +- test/signatures/RollupAdminLogic | 18 +- test/signatures/RollupCore | 178 +++++++++--------- test/signatures/RollupCreator | 2 +- test/signatures/RollupUserLogic | 250 +++++++++++++------------- test/storage/RollupAdminLogic | 134 +++++++------- test/storage/RollupCore | 134 +++++++------- test/storage/RollupUserLogic | 134 +++++++------- 16 files changed, 553 insertions(+), 528 deletions(-) diff --git a/src/mocks/SimpleOneStepProofEntry.sol b/src/mocks/SimpleOneStepProofEntry.sol index 69f490ff7..d077614b7 100644 --- a/src/mocks/SimpleOneStepProofEntry.sol +++ b/src/mocks/SimpleOneStepProofEntry.sol @@ -33,9 +33,9 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { } GlobalState memory globalState; uint256 offset; - (globalState.bytes32Vals[3], offset) = Deserialize.b32(proof, offset); // MELNextMsgHash - (globalState.u64Vals[0], offset) = Deserialize.u64(proof, offset); // MELMsgCount - (globalState.u64Vals[1], offset) = Deserialize.u64(proof, offset); // MELExecutedMsgCount + (globalState.bytes32Vals[3], offset) = Deserialize.b32(proof, offset); // MELNextMsgHash + (globalState.u64Vals[0], offset) = Deserialize.u64(proof, offset); // MELMsgCount + (globalState.u64Vals[1], offset) = Deserialize.u64(proof, offset); // MELExecutedMsgCount MELState memory melState; (melState.parentChainBlockHash, offset) = Deserialize.b32(proof, offset); @@ -46,7 +46,7 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { } if ( melState.parentChainBlockHash == execCtx.targetParentChainBlockHash - && globalState.getMELExecutedMsgCount() >= globalState.getMELMsgCount() + && globalState.getMELExecutedMsgCount() >= globalState.getMELMsgCount() ) { // We can't continue further because we've executed all messages up to this melState return beforeHash; diff --git a/src/osp/OneStepProverHostIo.sol b/src/osp/OneStepProverHostIo.sol index 85b2358bb..05702a55a 100644 --- a/src/osp/OneStepProverHostIo.sol +++ b/src/osp/OneStepProverHostIo.sol @@ -580,7 +580,7 @@ contract OneStepProverHostIo is IOneStepProver { ) internal pure { // Pop pointer to leaf from the value stack where the target parent chain block hash will be written to uint256 ptr = mach.valueStack.pop().assumeI32(); - + // Validate the leaf if (!mod.moduleMemory.isValidLeaf(ptr)) { mach.status = MachineStatus.ERRORED; @@ -591,12 +591,11 @@ contract OneStepProverHostIo is IOneStepProver { uint256 leafIdx = ptr / LEAF_SIZE; uint256 proofOffset = 0; MerkleProof memory merkleProof; - (, , merkleProof) = - mod.moduleMemory.proveLeaf(leafIdx, proof, proofOffset); - + (,, merkleProof) = mod.moduleMemory.proveLeaf(leafIdx, proof, proofOffset); + // Update merkle root mod.moduleMemory.merkleRoot = - merkleProof.computeRootFromMemory(leafIdx, execCtx.targetParentChainBlockHash); + merkleProof.computeRootFromMemory(leafIdx, execCtx.targetParentChainBlockHash); } function executeOneStep( diff --git a/src/state/Deserialize.sol b/src/state/Deserialize.sol index 2ddd27d75..3f163c41e 100644 --- a/src/state/Deserialize.sol +++ b/src/state/Deserialize.sol @@ -263,7 +263,7 @@ library Deserialize { state = GlobalState({bytes32Vals: bytes32Vals, u64Vals: u64Vals}); } - + function melState( bytes calldata proof, uint256 startOffset diff --git a/test/signatures/EdgeChallengeManager b/test/signatures/EdgeChallengeManager index f90494506..3642b4c69 100644 --- a/test/signatures/EdgeChallengeManager +++ b/test/signatures/EdgeChallengeManager @@ -1,69 +1,69 @@ -╭----------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=============================================================================================================================+ -| LAYERZERO_BIGSTEPEDGE_HEIGHT() | 416e6657 | -|----------------------------------------------------------------------------------------------------------------+------------| -| LAYERZERO_BLOCKEDGE_HEIGHT() | 1dce5166 | -|----------------------------------------------------------------------------------------------------------------+------------| -| LAYERZERO_SMALLSTEPEDGE_HEIGHT() | f8ee77d6 | -|----------------------------------------------------------------------------------------------------------------+------------| -| NUM_BIGSTEP_LEVEL() | 5d9e2444 | -|----------------------------------------------------------------------------------------------------------------+------------| -| assertionChain() | 48dd2924 | -|----------------------------------------------------------------------------------------------------------------+------------| -| bisectEdge(bytes32,bytes32,bytes) | c8bc4e43 | -|----------------------------------------------------------------------------------------------------------------+------------| -| calculateEdgeId(uint8,bytes32,uint256,bytes32,uint256,bytes32) | 004d8efe | -|----------------------------------------------------------------------------------------------------------------+------------| -| calculateMutualId(uint8,bytes32,uint256,bytes32,uint256) | c32d8c63 | -|----------------------------------------------------------------------------------------------------------------+------------| -| challengePeriodBlocks() | 46c2781a | -|----------------------------------------------------------------------------------------------------------------+------------| -| confirmEdgeByOneStepProof(bytes32,(bytes32,bytes),(bytes32,uint256,address,uint64,uint64),bytes32[],bytes32[]) | 8c1b3a40 | -|----------------------------------------------------------------------------------------------------------------+------------| -| confirmEdgeByTime(bytes32,(((bytes32[2],uint64[2]),uint8,bytes32),bytes32,bytes32)) | b2a1408e | -|----------------------------------------------------------------------------------------------------------------+------------| -| confirmedRival(bytes32) | e5b123da | -|----------------------------------------------------------------------------------------------------------------+------------| -| createLayerZeroEdge((uint8,bytes32,uint256,bytes32,bytes,bytes)) | 05fae141 | -|----------------------------------------------------------------------------------------------------------------+------------| -| edgeExists(bytes32) | 750e0c0f | -|----------------------------------------------------------------------------------------------------------------+------------| -| edgeLength(bytes32) | eae0328b | -|----------------------------------------------------------------------------------------------------------------+------------| -| excessStakeReceiver() | e94e051e | -|----------------------------------------------------------------------------------------------------------------+------------| -| firstRival(bytes32) | bce6f54f | -|----------------------------------------------------------------------------------------------------------------+------------| -| getEdge(bytes32) | fda2892e | -|----------------------------------------------------------------------------------------------------------------+------------| -| getLayerZeroEndHeight(uint8) | 42e1aaa8 | -|----------------------------------------------------------------------------------------------------------------+------------| -| getPrevAssertionHash(bytes32) | 5a48e0f4 | -|----------------------------------------------------------------------------------------------------------------+------------| -| hasLengthOneRival(bytes32) | 54b64151 | -|----------------------------------------------------------------------------------------------------------------+------------| -| hasMadeLayerZeroRival(address,bytes32) | 655b42f3 | -|----------------------------------------------------------------------------------------------------------------+------------| -| hasRival(bytes32) | 908517e9 | -|----------------------------------------------------------------------------------------------------------------+------------| -| initialize(address,uint64,address,uint256,uint256,uint256,address,address,uint8,uint256[]) | 1a72d54c | -|----------------------------------------------------------------------------------------------------------------+------------| -| multiUpdateTimeCacheByChildren(bytes32[],uint256) | 432bb78a | -|----------------------------------------------------------------------------------------------------------------+------------| -| oneStepProofEntry() | 48923bc5 | -|----------------------------------------------------------------------------------------------------------------+------------| -| refundStake(bytes32) | 748926f3 | -|----------------------------------------------------------------------------------------------------------------+------------| -| stakeAmounts(uint256) | 1c1b4f3a | -|----------------------------------------------------------------------------------------------------------------+------------| -| stakeToken() | 51ed6a30 | -|----------------------------------------------------------------------------------------------------------------+------------| -| timeUnrivaled(bytes32) | 3e35f5e8 | -|----------------------------------------------------------------------------------------------------------------+------------| -| updateTimerCacheByChildren(bytes32,uint256) | edaab54a | -|----------------------------------------------------------------------------------------------------------------+------------| -| updateTimerCacheByClaim(bytes32,bytes32,uint256) | 8826a370 | -╰----------------------------------------------------------------------------------------------------------------+------------╯ +╭-----------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++==============================================================================================================================+ +| LAYERZERO_BIGSTEPEDGE_HEIGHT() | 416e6657 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| LAYERZERO_BLOCKEDGE_HEIGHT() | 1dce5166 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| LAYERZERO_SMALLSTEPEDGE_HEIGHT() | f8ee77d6 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| NUM_BIGSTEP_LEVEL() | 5d9e2444 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| assertionChain() | 48dd2924 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| bisectEdge(bytes32,bytes32,bytes) | c8bc4e43 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| calculateEdgeId(uint8,bytes32,uint256,bytes32,uint256,bytes32) | 004d8efe | +|-----------------------------------------------------------------------------------------------------------------+------------| +| calculateMutualId(uint8,bytes32,uint256,bytes32,uint256) | c32d8c63 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| challengePeriodBlocks() | 46c2781a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| confirmEdgeByOneStepProof(bytes32,(bytes32,bytes),(bytes32,uint256,address,uint64,bytes32),bytes32[],bytes32[]) | d863f8ac | +|-----------------------------------------------------------------------------------------------------------------+------------| +| confirmEdgeByTime(bytes32,(((bytes32[4],uint64[2]),uint8,bytes32),bytes32)) | 5a7f2fb2 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| confirmedRival(bytes32) | e5b123da | +|-----------------------------------------------------------------------------------------------------------------+------------| +| createLayerZeroEdge((uint8,bytes32,uint256,bytes32,bytes,bytes)) | 05fae141 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| edgeExists(bytes32) | 750e0c0f | +|-----------------------------------------------------------------------------------------------------------------+------------| +| edgeLength(bytes32) | eae0328b | +|-----------------------------------------------------------------------------------------------------------------+------------| +| excessStakeReceiver() | e94e051e | +|-----------------------------------------------------------------------------------------------------------------+------------| +| firstRival(bytes32) | bce6f54f | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getEdge(bytes32) | fda2892e | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getLayerZeroEndHeight(uint8) | 42e1aaa8 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| getPrevAssertionHash(bytes32) | 5a48e0f4 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| hasLengthOneRival(bytes32) | 54b64151 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| hasMadeLayerZeroRival(address,bytes32) | 655b42f3 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| hasRival(bytes32) | 908517e9 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| initialize(address,uint64,address,uint256,uint256,uint256,address,address,uint8,uint256[]) | 1a72d54c | +|-----------------------------------------------------------------------------------------------------------------+------------| +| multiUpdateTimeCacheByChildren(bytes32[],uint256) | 432bb78a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| oneStepProofEntry() | 48923bc5 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| refundStake(bytes32) | 748926f3 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| stakeAmounts(uint256) | 1c1b4f3a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| stakeToken() | 51ed6a30 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| timeUnrivaled(bytes32) | 3e35f5e8 | +|-----------------------------------------------------------------------------------------------------------------+------------| +| updateTimerCacheByChildren(bytes32,uint256) | edaab54a | +|-----------------------------------------------------------------------------------------------------------------+------------| +| updateTimerCacheByClaim(bytes32,bytes32,uint256) | 8826a370 | +╰-----------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/OneStepProofEntry b/test/signatures/OneStepProofEntry index f7ddf4201..4da96afd2 100644 --- a/test/signatures/OneStepProofEntry +++ b/test/signatures/OneStepProofEntry @@ -1,19 +1,19 @@ -╭---------------------------------------------------------------+------------╮ -| Method | Identifier | -+============================================================================+ -| getMachineHash(((bytes32[2],uint64[2]),uint8)) | c39619c4 | -|---------------------------------------------------------------+------------| -| getStartMachineHash(bytes32,bytes32) | 04997be4 | -|---------------------------------------------------------------+------------| -| proveOneStep((uint256,address,bytes32),uint256,bytes32,bytes) | b5112fd2 | -|---------------------------------------------------------------+------------| -| prover0() | 30a5509f | -|---------------------------------------------------------------+------------| -| proverHostIo() | 5f52fd7c | -|---------------------------------------------------------------+------------| -| proverMath() | 66e5d9c3 | -|---------------------------------------------------------------+------------| -| proverMem() | 1f128bc0 | -╰---------------------------------------------------------------+------------╯ +╭-------------------------------------------------------+------------╮ +| Method | Identifier | ++====================================================================+ +| getMachineHash(((bytes32[4],uint64[2]),uint8)) | c0f88fa6 | +|-------------------------------------------------------+------------| +| getStartMachineHash(bytes32,bytes32) | 04997be4 | +|-------------------------------------------------------+------------| +| proveOneStep((bytes32,bytes32),uint256,bytes32,bytes) | 400cc375 | +|-------------------------------------------------------+------------| +| prover0() | 30a5509f | +|-------------------------------------------------------+------------| +| proverHostIo() | 5f52fd7c | +|-------------------------------------------------------+------------| +| proverMath() | 66e5d9c3 | +|-------------------------------------------------------+------------| +| proverMem() | 1f128bc0 | +╰-------------------------------------------------------+------------╯ diff --git a/test/signatures/OneStepProver0 b/test/signatures/OneStepProver0 index 676a0c164..e2be25714 100644 --- a/test/signatures/OneStepProver0 +++ b/test/signatures/OneStepProver0 @@ -1,7 +1,7 @@ -╭--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=========================================================================================================================================================================================================================================================================================================================================================+ -| executeOneStep((uint256,address,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | a92cb501 | -╰--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================================================================================================================================================================================================================================================================+ +| executeOneStep((bytes32,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | 8451c82c | +╰------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/OneStepProverHostIo b/test/signatures/OneStepProverHostIo index 8ae31fa7a..4ded94935 100644 --- a/test/signatures/OneStepProverHostIo +++ b/test/signatures/OneStepProverHostIo @@ -1,9 +1,9 @@ -╭--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=========================================================================================================================================================================================================================================================================================================================================================+ -| customDAValidator() | c3ea90ba | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| executeOneStep((uint256,address,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | a92cb501 | -╰--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================================================================================================================================================================================================================================================================+ +| customDAValidator() | c3ea90ba | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| executeOneStep((bytes32,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | 8451c82c | +╰------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/OneStepProverMath b/test/signatures/OneStepProverMath index 676a0c164..e2be25714 100644 --- a/test/signatures/OneStepProverMath +++ b/test/signatures/OneStepProverMath @@ -1,7 +1,7 @@ -╭--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=========================================================================================================================================================================================================================================================================================================================================================+ -| executeOneStep((uint256,address,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | a92cb501 | -╰--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================================================================================================================================================================================================================================================================+ +| executeOneStep((bytes32,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | 8451c82c | +╰------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/OneStepProverMemory b/test/signatures/OneStepProverMemory index 676a0c164..e2be25714 100644 --- a/test/signatures/OneStepProverMemory +++ b/test/signatures/OneStepProverMemory @@ -1,7 +1,7 @@ -╭--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+=========================================================================================================================================================================================================================================================================================================================================================+ -| executeOneStep((uint256,address,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | a92cb501 | -╰--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++=================================================================================================================================================================================================================================================================================================================================================+ +| executeOneStep((bytes32,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | 8451c82c | +╰------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/RollupAdminLogic b/test/signatures/RollupAdminLogic index 0785cecfb..1bea2fe35 100644 --- a/test/signatures/RollupAdminLogic +++ b/test/signatures/RollupAdminLogic @@ -20,11 +20,13 @@ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | confirmPeriodBlocks() | 2e7acfa6 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| decreaseBaseStake(uint256,uint64) | 089a5d99 | +| currentMelConfigHash() | 010816fb | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| forceConfirmAssertion(bytes32,bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32) | 5bf03833 | +| decreaseBaseStake(uint256,bytes32) | 3d64074a | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| forceCreateAssertion(bytes32,((bytes32,bytes32,(bytes32,uint256,address,uint64,uint64)),((bytes32[2],uint64[2]),uint8,bytes32),((bytes32[2],uint64[2]),uint8,bytes32)),bytes32) | 9a7b4556 | +| forceConfirmAssertion(bytes32,bytes32,((bytes32[4],uint64[2]),uint8,bytes32)) | e6cf817d | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| forceCreateAssertion(bytes32,((bytes32,bytes32,(bytes32,uint256,address,uint64,bytes32)),((bytes32[4],uint64[2]),uint8,bytes32),((bytes32[4],uint64[2]),uint8,bytes32),(uint16,uint64,uint64,address,address,bytes32,bytes32,uint64,uint64,bytes32,uint64,uint64,bytes32,bytes32)),bytes32) | 8fe07f10 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | forceRefundStaker(address[]) | 7c75c298 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| @@ -48,7 +50,7 @@ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | increaseBaseStake(uint256) | 8c69f782 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| initialize((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64),uint256),(address,address,address,address,address,address,address,address,address)) | 10fb7a50 | +| initialize((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[4],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64),uint256),(address,address,address,address,address,address,address,address,address)) | 94d9dbea | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | isFirstChild(bytes32) | 30836228 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| @@ -64,6 +66,8 @@ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | loserStakeEscrow() | f065de3f | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| melConfig(bytes32) | 13f1e3fa | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | minimumAssertionPeriod() | 45e38b64 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | outbox() | ce11e6ab | @@ -96,6 +100,8 @@ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | setLoserStakeEscrow(address) | fc8ffa03 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| setMELConfig(uint16,address,address) | a96d44ea | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | setMinimumAssertionPeriod(uint256) | 948d6588 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | setOutbox(address) | ff204f3b | @@ -126,9 +132,9 @@ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | upgradeToAndCall(address,bytes) | 4f1ef286 | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validateAssertionHash(bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32,bytes32) | e51019a6 | +| validateAssertionHash(bytes32,((bytes32[4],uint64[2]),uint8,bytes32),bytes32) | 7e356e9b | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validateConfig(bytes32,(bytes32,uint256,address,uint64,uint64)) | 04972af9 | +| validateConfig(bytes32,(bytes32,uint256,address,uint64,bytes32)) | d13666eb | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | validatorAfkBlocks() | e6b3082c | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| diff --git a/test/signatures/RollupCore b/test/signatures/RollupCore index 965917474..de3dc208a 100644 --- a/test/signatures/RollupCore +++ b/test/signatures/RollupCore @@ -1,89 +1,93 @@ -╭---------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+====================================================================================================+ -| _stakerMap(address) | e8bd4922 | -|---------------------------------------------------------------------------------------+------------| -| amountStaked(address) | ef40a670 | -|---------------------------------------------------------------------------------------+------------| -| anyTrustFastConfirmer() | 55840a58 | -|---------------------------------------------------------------------------------------+------------| -| baseStake() | 76e7e23b | -|---------------------------------------------------------------------------------------+------------| -| bridge() | e78cea92 | -|---------------------------------------------------------------------------------------+------------| -| chainId() | 9a8a0592 | -|---------------------------------------------------------------------------------------+------------| -| challengeGracePeriodBlocks() | 3be680ea | -|---------------------------------------------------------------------------------------+------------| -| challengeManager() | 023a96fe | -|---------------------------------------------------------------------------------------+------------| -| confirmPeriodBlocks() | 2e7acfa6 | -|---------------------------------------------------------------------------------------+------------| -| genesisAssertionHash() | 353325e0 | -|---------------------------------------------------------------------------------------+------------| -| getAssertion(bytes32) | 88302884 | -|---------------------------------------------------------------------------------------+------------| -| getAssertionCreationBlockForLogLookup(bytes32) | 13c56ca7 | -|---------------------------------------------------------------------------------------+------------| -| getFirstChildCreationBlock(bytes32) | 11715585 | -|---------------------------------------------------------------------------------------+------------| -| getSecondChildCreationBlock(bytes32) | 56bbc9e6 | -|---------------------------------------------------------------------------------------+------------| -| getStaker(address) | a23c44b1 | -|---------------------------------------------------------------------------------------+------------| -| getStakerAddress(uint64) | 6ddd3744 | -|---------------------------------------------------------------------------------------+------------| -| getValidators() | b7ab4db5 | -|---------------------------------------------------------------------------------------+------------| -| inbox() | fb0e722b | -|---------------------------------------------------------------------------------------+------------| -| isFirstChild(bytes32) | 30836228 | -|---------------------------------------------------------------------------------------+------------| -| isPending(bytes32) | e531d8c7 | -|---------------------------------------------------------------------------------------+------------| -| isStaked(address) | 6177fd18 | -|---------------------------------------------------------------------------------------+------------| -| isValidator(address) | facd743b | -|---------------------------------------------------------------------------------------+------------| -| latestConfirmed() | 65f7f80d | -|---------------------------------------------------------------------------------------+------------| -| latestStakedAssertion(address) | 2abdd230 | -|---------------------------------------------------------------------------------------+------------| -| loserStakeEscrow() | f065de3f | -|---------------------------------------------------------------------------------------+------------| -| minimumAssertionPeriod() | 45e38b64 | -|---------------------------------------------------------------------------------------+------------| -| outbox() | ce11e6ab | -|---------------------------------------------------------------------------------------+------------| -| paused() | 5c975abb | -|---------------------------------------------------------------------------------------+------------| -| rollupDeploymentBlock() | 1b1689e9 | -|---------------------------------------------------------------------------------------+------------| -| rollupEventInbox() | aa38a6e7 | -|---------------------------------------------------------------------------------------+------------| -| sequencerInbox() | ee35f327 | -|---------------------------------------------------------------------------------------+------------| -| stakeToken() | 51ed6a30 | -|---------------------------------------------------------------------------------------+------------| -| stakerCount() | dff69787 | -|---------------------------------------------------------------------------------------+------------| -| totalWithdrawableFunds() | 71ef232c | -|---------------------------------------------------------------------------------------+------------| -| validateAssertionHash(bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32,bytes32) | e51019a6 | -|---------------------------------------------------------------------------------------+------------| -| validateConfig(bytes32,(bytes32,uint256,address,uint64,uint64)) | 04972af9 | -|---------------------------------------------------------------------------------------+------------| -| validatorAfkBlocks() | e6b3082c | -|---------------------------------------------------------------------------------------+------------| -| validatorWalletCreator() | bc45e0ae | -|---------------------------------------------------------------------------------------+------------| -| validatorWhitelistDisabled() | 12ab3d3b | -|---------------------------------------------------------------------------------------+------------| -| wasmModuleRoot() | 8ee1a126 | -|---------------------------------------------------------------------------------------+------------| -| withdrawableFunds(address) | 2f30cabd | -|---------------------------------------------------------------------------------------+------------| -| withdrawalAddress(address) | 84728cd0 | -╰---------------------------------------------------------------------------------------+------------╯ +╭-------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++============================================================================================+ +| _stakerMap(address) | e8bd4922 | +|-------------------------------------------------------------------------------+------------| +| amountStaked(address) | ef40a670 | +|-------------------------------------------------------------------------------+------------| +| anyTrustFastConfirmer() | 55840a58 | +|-------------------------------------------------------------------------------+------------| +| baseStake() | 76e7e23b | +|-------------------------------------------------------------------------------+------------| +| bridge() | e78cea92 | +|-------------------------------------------------------------------------------+------------| +| chainId() | 9a8a0592 | +|-------------------------------------------------------------------------------+------------| +| challengeGracePeriodBlocks() | 3be680ea | +|-------------------------------------------------------------------------------+------------| +| challengeManager() | 023a96fe | +|-------------------------------------------------------------------------------+------------| +| confirmPeriodBlocks() | 2e7acfa6 | +|-------------------------------------------------------------------------------+------------| +| currentMelConfigHash() | 010816fb | +|-------------------------------------------------------------------------------+------------| +| genesisAssertionHash() | 353325e0 | +|-------------------------------------------------------------------------------+------------| +| getAssertion(bytes32) | 88302884 | +|-------------------------------------------------------------------------------+------------| +| getAssertionCreationBlockForLogLookup(bytes32) | 13c56ca7 | +|-------------------------------------------------------------------------------+------------| +| getFirstChildCreationBlock(bytes32) | 11715585 | +|-------------------------------------------------------------------------------+------------| +| getSecondChildCreationBlock(bytes32) | 56bbc9e6 | +|-------------------------------------------------------------------------------+------------| +| getStaker(address) | a23c44b1 | +|-------------------------------------------------------------------------------+------------| +| getStakerAddress(uint64) | 6ddd3744 | +|-------------------------------------------------------------------------------+------------| +| getValidators() | b7ab4db5 | +|-------------------------------------------------------------------------------+------------| +| inbox() | fb0e722b | +|-------------------------------------------------------------------------------+------------| +| isFirstChild(bytes32) | 30836228 | +|-------------------------------------------------------------------------------+------------| +| isPending(bytes32) | e531d8c7 | +|-------------------------------------------------------------------------------+------------| +| isStaked(address) | 6177fd18 | +|-------------------------------------------------------------------------------+------------| +| isValidator(address) | facd743b | +|-------------------------------------------------------------------------------+------------| +| latestConfirmed() | 65f7f80d | +|-------------------------------------------------------------------------------+------------| +| latestStakedAssertion(address) | 2abdd230 | +|-------------------------------------------------------------------------------+------------| +| loserStakeEscrow() | f065de3f | +|-------------------------------------------------------------------------------+------------| +| melConfig(bytes32) | 13f1e3fa | +|-------------------------------------------------------------------------------+------------| +| minimumAssertionPeriod() | 45e38b64 | +|-------------------------------------------------------------------------------+------------| +| outbox() | ce11e6ab | +|-------------------------------------------------------------------------------+------------| +| paused() | 5c975abb | +|-------------------------------------------------------------------------------+------------| +| rollupDeploymentBlock() | 1b1689e9 | +|-------------------------------------------------------------------------------+------------| +| rollupEventInbox() | aa38a6e7 | +|-------------------------------------------------------------------------------+------------| +| sequencerInbox() | ee35f327 | +|-------------------------------------------------------------------------------+------------| +| stakeToken() | 51ed6a30 | +|-------------------------------------------------------------------------------+------------| +| stakerCount() | dff69787 | +|-------------------------------------------------------------------------------+------------| +| totalWithdrawableFunds() | 71ef232c | +|-------------------------------------------------------------------------------+------------| +| validateAssertionHash(bytes32,((bytes32[4],uint64[2]),uint8,bytes32),bytes32) | 7e356e9b | +|-------------------------------------------------------------------------------+------------| +| validateConfig(bytes32,(bytes32,uint256,address,uint64,bytes32)) | d13666eb | +|-------------------------------------------------------------------------------+------------| +| validatorAfkBlocks() | e6b3082c | +|-------------------------------------------------------------------------------+------------| +| validatorWalletCreator() | bc45e0ae | +|-------------------------------------------------------------------------------+------------| +| validatorWhitelistDisabled() | 12ab3d3b | +|-------------------------------------------------------------------------------+------------| +| wasmModuleRoot() | 8ee1a126 | +|-------------------------------------------------------------------------------+------------| +| withdrawableFunds(address) | 2f30cabd | +|-------------------------------------------------------------------------------+------------| +| withdrawalAddress(address) | 84728cd0 | +╰-------------------------------------------------------------------------------+------------╯ diff --git a/test/signatures/RollupCreator b/test/signatures/RollupCreator index de9b35f9d..201abf38a 100644 --- a/test/signatures/RollupCreator +++ b/test/signatures/RollupCreator @@ -6,7 +6,7 @@ |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | challengeManagerTemplate() | 9c683d10 | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| createRollup(((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64),uint256),address[],uint256,address,bool,uint256,address[],address,address,address)) | 2d12e32c | +| createRollup(((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[4],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64),uint256),address[],uint256,address,bool,uint256,address[],address,address,address)) | a73e3440 | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | l2FactoriesDeployer() | ac0425bc | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| diff --git a/test/signatures/RollupUserLogic b/test/signatures/RollupUserLogic index 522238a66..7b36a26c0 100644 --- a/test/signatures/RollupUserLogic +++ b/test/signatures/RollupUserLogic @@ -1,125 +1,129 @@ -╭-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ -| Method | Identifier | -+========================================================================================================================================================================================================+ -| _stakerMap(address) | e8bd4922 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| addToDeposit(address,address,uint256) | 685f5ecc | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| amountStaked(address) | ef40a670 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| anyTrustFastConfirmer() | 55840a58 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| baseStake() | 76e7e23b | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| bridge() | e78cea92 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| chainId() | 9a8a0592 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| challengeGracePeriodBlocks() | 3be680ea | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| challengeManager() | 023a96fe | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| computeAssertionHash(bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32) | 33635fc2 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| confirmAssertion(bytes32,bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32,(bytes32,uint256,address,uint64,uint64),bytes32) | 10b98a35 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| confirmPeriodBlocks() | 2e7acfa6 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| fastConfirmAssertion(bytes32,bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32) | 6096686d | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| fastConfirmNewAssertion(((bytes32,bytes32,(bytes32,uint256,address,uint64,uint64)),((bytes32[2],uint64[2]),uint8,bytes32),((bytes32[2],uint64[2]),uint8,bytes32)),bytes32) | 6420fb9f | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| genesisAssertionHash() | 353325e0 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getAssertion(bytes32) | 88302884 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getAssertionCreationBlockForLogLookup(bytes32) | 13c56ca7 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getFirstChildCreationBlock(bytes32) | 11715585 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getSecondChildCreationBlock(bytes32) | 56bbc9e6 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getStaker(address) | a23c44b1 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getStakerAddress(uint64) | 6ddd3744 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| getValidators() | b7ab4db5 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| inbox() | fb0e722b | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| initialize(address) | c4d66de8 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| isFirstChild(bytes32) | 30836228 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| isPending(bytes32) | e531d8c7 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| isStaked(address) | 6177fd18 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| isValidator(address) | facd743b | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| latestConfirmed() | 65f7f80d | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| latestStakedAssertion(address) | 2abdd230 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| loserStakeEscrow() | f065de3f | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| minimumAssertionPeriod() | 45e38b64 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| newStake(uint256,address) | 68129b14 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| newStakeOnNewAssertion(uint256,((bytes32,bytes32,(bytes32,uint256,address,uint64,uint64)),((bytes32[2],uint64[2]),uint8,bytes32),((bytes32[2],uint64[2]),uint8,bytes32)),bytes32) | 7300201c | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| newStakeOnNewAssertion(uint256,((bytes32,bytes32,(bytes32,uint256,address,uint64,uint64)),((bytes32[2],uint64[2]),uint8,bytes32),((bytes32[2],uint64[2]),uint8,bytes32)),bytes32,address) | 50f32f68 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| outbox() | ce11e6ab | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| owner() | 8da5cb5b | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| paused() | 5c975abb | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| proxiableUUID() | 52d1902d | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| reduceDeposit(uint256) | 1e83d30f | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| removeWhitelistAfterFork() | c2c2e68e | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| removeWhitelistAfterValidatorAfk() | 18baaab9 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| returnOldDeposit() | 57ef4ab9 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| returnOldDepositFor(address) | 588c7a16 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| rollupDeploymentBlock() | 1b1689e9 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| rollupEventInbox() | aa38a6e7 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| sequencerInbox() | ee35f327 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| stakeOnNewAssertion(((bytes32,bytes32,(bytes32,uint256,address,uint64,uint64)),((bytes32[2],uint64[2]),uint8,bytes32),((bytes32[2],uint64[2]),uint8,bytes32)),bytes32) | 3b86de19 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| stakeToken() | 51ed6a30 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| stakerCount() | dff69787 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| totalWithdrawableFunds() | 71ef232c | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validateAssertionHash(bytes32,((bytes32[2],uint64[2]),uint8,bytes32),bytes32,bytes32) | e51019a6 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validateConfig(bytes32,(bytes32,uint256,address,uint64,uint64)) | 04972af9 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validatorAfkBlocks() | e6b3082c | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validatorWalletCreator() | bc45e0ae | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| validatorWhitelistDisabled() | 12ab3d3b | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| wasmModuleRoot() | 8ee1a126 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| withdrawStakerFunds() | 61373919 | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| withdrawableFunds(address) | 2f30cabd | -|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| -| withdrawalAddress(address) | 84728cd0 | -╰-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ +╭-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╮ +| Method | Identifier | ++====================================================================================================================================================================================================================================================================================================================+ +| _stakerMap(address) | e8bd4922 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| addToDeposit(address,address,uint256) | 685f5ecc | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| amountStaked(address) | ef40a670 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| anyTrustFastConfirmer() | 55840a58 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| baseStake() | 76e7e23b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| bridge() | e78cea92 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| chainId() | 9a8a0592 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| challengeGracePeriodBlocks() | 3be680ea | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| challengeManager() | 023a96fe | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| computeAssertionHash(bytes32,((bytes32[4],uint64[2]),uint8,bytes32)) | e05b0a7b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| confirmAssertion(bytes32,bytes32,((bytes32[4],uint64[2]),uint8,bytes32),bytes32,(bytes32,uint256,address,uint64,bytes32)) | 4c10ee51 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| confirmPeriodBlocks() | 2e7acfa6 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| currentMelConfigHash() | 010816fb | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| fastConfirmAssertion(bytes32,bytes32,((bytes32[4],uint64[2]),uint8,bytes32)) | abc4dd38 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| fastConfirmNewAssertion(((bytes32,bytes32,(bytes32,uint256,address,uint64,bytes32)),((bytes32[4],uint64[2]),uint8,bytes32),((bytes32[4],uint64[2]),uint8,bytes32),(uint16,uint64,uint64,address,address,bytes32,bytes32,uint64,uint64,bytes32,uint64,uint64,bytes32,bytes32)),bytes32) | 7f34fd33 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| genesisAssertionHash() | 353325e0 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getAssertion(bytes32) | 88302884 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getAssertionCreationBlockForLogLookup(bytes32) | 13c56ca7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getFirstChildCreationBlock(bytes32) | 11715585 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getSecondChildCreationBlock(bytes32) | 56bbc9e6 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getStaker(address) | a23c44b1 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getStakerAddress(uint64) | 6ddd3744 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| getValidators() | b7ab4db5 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| inbox() | fb0e722b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| initialize(address) | c4d66de8 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| isFirstChild(bytes32) | 30836228 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| isPending(bytes32) | e531d8c7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| isStaked(address) | 6177fd18 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| isValidator(address) | facd743b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| latestConfirmed() | 65f7f80d | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| latestStakedAssertion(address) | 2abdd230 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| loserStakeEscrow() | f065de3f | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| melConfig(bytes32) | 13f1e3fa | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| minimumAssertionPeriod() | 45e38b64 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| newStake(uint256,address) | 68129b14 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| newStakeOnNewAssertion(uint256,((bytes32,bytes32,(bytes32,uint256,address,uint64,bytes32)),((bytes32[4],uint64[2]),uint8,bytes32),((bytes32[4],uint64[2]),uint8,bytes32),(uint16,uint64,uint64,address,address,bytes32,bytes32,uint64,uint64,bytes32,uint64,uint64,bytes32,bytes32)),bytes32) | 7f62c2af | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| newStakeOnNewAssertion(uint256,((bytes32,bytes32,(bytes32,uint256,address,uint64,bytes32)),((bytes32[4],uint64[2]),uint8,bytes32),((bytes32[4],uint64[2]),uint8,bytes32),(uint16,uint64,uint64,address,address,bytes32,bytes32,uint64,uint64,bytes32,uint64,uint64,bytes32,bytes32)),bytes32,address) | efa4cb29 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| outbox() | ce11e6ab | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| owner() | 8da5cb5b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| paused() | 5c975abb | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| proxiableUUID() | 52d1902d | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| reduceDeposit(uint256) | 1e83d30f | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| removeWhitelistAfterFork() | c2c2e68e | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| removeWhitelistAfterValidatorAfk() | 18baaab9 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| returnOldDeposit() | 57ef4ab9 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| returnOldDepositFor(address) | 588c7a16 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rollupDeploymentBlock() | 1b1689e9 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| rollupEventInbox() | aa38a6e7 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| sequencerInbox() | ee35f327 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| stakeOnNewAssertion(((bytes32,bytes32,(bytes32,uint256,address,uint64,bytes32)),((bytes32[4],uint64[2]),uint8,bytes32),((bytes32[4],uint64[2]),uint8,bytes32),(uint16,uint64,uint64,address,address,bytes32,bytes32,uint64,uint64,bytes32,uint64,uint64,bytes32,bytes32)),bytes32) | 550dc268 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| stakeToken() | 51ed6a30 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| stakerCount() | dff69787 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| totalWithdrawableFunds() | 71ef232c | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| validateAssertionHash(bytes32,((bytes32[4],uint64[2]),uint8,bytes32),bytes32) | 7e356e9b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| validateConfig(bytes32,(bytes32,uint256,address,uint64,bytes32)) | d13666eb | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| validatorAfkBlocks() | e6b3082c | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| validatorWalletCreator() | bc45e0ae | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| validatorWhitelistDisabled() | 12ab3d3b | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| wasmModuleRoot() | 8ee1a126 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| withdrawStakerFunds() | 61373919 | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| withdrawableFunds(address) | 2f30cabd | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| withdrawalAddress(address) | 84728cd0 | +╰-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ diff --git a/test/storage/RollupAdminLogic b/test/storage/RollupAdminLogic index 8f53588e8..03cd85e86 100644 --- a/test/storage/RollupAdminLogic +++ b/test/storage/RollupAdminLogic @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ +╭--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| currentMelConfigHash | bytes32 | 125 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------| +| melConfig | mapping(bytes32 => struct IRollupCore.MELConfig) | 126 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +╰--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------------------╯ diff --git a/test/storage/RollupCore b/test/storage/RollupCore index e493175c1..848153a39 100644 --- a/test/storage/RollupCore +++ b/test/storage/RollupCore @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+===============================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ +╭--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| currentMelConfigHash | bytes32 | 125 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------| +| melConfig | mapping(bytes32 => struct IRollupCore.MELConfig) | 126 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +╰--------------------------------+--------------------------------------------------+------+--------+-------+--------------------------------------╯ diff --git a/test/storage/RollupUserLogic b/test/storage/RollupUserLogic index b2edbafb4..d43220420 100644 --- a/test/storage/RollupUserLogic +++ b/test/storage/RollupUserLogic @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+=========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -╰--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ +╭--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| currentMelConfigHash | bytes32 | 125 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------| +| melConfig | mapping(bytes32 => struct IRollupCore.MELConfig) | 126 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +╰--------------------------------+--------------------------------------------------+------+--------+-------+------------------------------------------------╯ From 83ca0d11db58e8b324c492833bc3ddc40daf3c44 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Thu, 28 May 2026 15:44:06 +0100 Subject: [PATCH 4/9] Wire HashProofHelper to OneStepProverHostIo --- src/osp/HashProofHelper.sol | 63 ++++++++++++++++++++++------ src/osp/IHashProofHelper.sol | 64 +++++++++++++++++++++++++++++ src/osp/OneStepProverHostIo.sol | 19 ++++++++- test/signatures/OneStepProverHostIo | 2 + 4 files changed, 133 insertions(+), 15 deletions(-) create mode 100644 src/osp/IHashProofHelper.sol diff --git a/src/osp/HashProofHelper.sol b/src/osp/HashProofHelper.sol index 12c88873e..38f3ade04 100644 --- a/src/osp/HashProofHelper.sol +++ b/src/osp/HashProofHelper.sol @@ -4,32 +4,42 @@ pragma solidity ^0.8.0; +import "./IHashProofHelper.sol"; import "../libraries/CryptographyPrimitives.sol"; -/// @dev The requested hash preimage at the given offset has not been proven yet -error NotProven(bytes32 fullHash, uint64 offset); - -contract HashProofHelper { +contract HashProofHelper is IHashProofHelper { + /// @dev Tracks an in-progress split preimage proof struct KeccakState { + /// @dev Offset determining which slice is extracted and stored from the preimage (up to 32 bytes) uint64 offset; + /// @dev The bytes being collected for the [offset, offset+32) slice, built up across chunks bytes part; + /// @dev The 1600-bit keccak internal state as 25 × 64-bit words + /// (stored in column-major order to match CryptographyPrimitives.keccakF's layout) uint64[25] state; + /// @dev Total bytes of preimage data absorbed so far across all chunks uint256 length; } + /// @dev Stores a 32-byte (or shorter) slice extracted from a fully-proven preimage. struct PreimagePart { + /// @dev Whether this entry has been set by a completed proof. bool proven; + /// @dev The extracted slice at this offset. Empty if offset >= preimage length. bytes part; } + /// @dev Completed proofs, keyed by (keccak256 hash of the full preimage, byte offset) mapping(bytes32 => mapping(uint64 => PreimagePart)) private preimageParts; + /// @dev In-progress split proofs, keyed by msg.sender mapping(address => KeccakState) public keccakStates; - event PreimagePartProven(bytes32 indexed fullHash, uint64 indexed offset, bytes part); - + /// @dev Maximum bytes stored per part — matches one EVM word and one WASM ReadPreImage result uint256 private constant MAX_PART_LENGTH = 32; + /// @dev Number of bytes absorbed into the keccak sponge state per round — matches the keccak256 rate for 1600-bit state uint256 private constant KECCAK_ROUND_INPUT = 136; + /// @inheritdoc IHashProofHelper function proveWithFullPreimage( bytes calldata data, uint64 offset @@ -38,8 +48,8 @@ contract HashProofHelper { bytes memory part; if (data.length > offset) { uint256 partLength = data.length - offset; - if (partLength > 32) { - partLength = 32; + if (partLength > MAX_PART_LENGTH) { + partLength = MAX_PART_LENGTH; } part = data[offset:(offset + partLength)]; } @@ -47,9 +57,7 @@ contract HashProofHelper { emit PreimagePartProven(fullHash, offset, part); } - // Flags: a bitset signaling various things about the proof, ordered from least to most significant bits. - // 0th bit: indicates that this data is the final chunk of preimage data. - // 1st bit: indicates that the preimage part currently being built should be cleared before this. + /// @inheritdoc IHashProofHelper function proveWithSplitPreimage( bytes calldata data, uint64 offset, @@ -67,7 +75,12 @@ contract HashProofHelper { } else { require(state.offset == offset, "DIFF_OFFSET"); } + + // Update the keccak state with the new data + // (updates state.state and state.length) keccakUpdate(state, data, isFinal); + + // Obtain the `part` if (uint256(offset) + MAX_PART_LENGTH > startLength && offset < state.length) { uint256 startIdx = 0; if (offset > startLength) { @@ -81,9 +94,14 @@ contract HashProofHelper { state.part.push(data[i]); } } + + // If this is not the final chunk, we can't yet determine the full hash, so we return early if (!isFinal) { return bytes32(0); } + + // Obtain the full hash from the keccak state + // (the first 32 bytes) for (uint256 i = 0; i < 32; i++) { uint256 stateIdx = i / 8; // work around our weird keccakF function state ordering @@ -96,21 +114,33 @@ contract HashProofHelper { delete keccakStates[msg.sender]; } + /** + * @notice Absorbs data into the keccak sponge state, one 136-byte round at a time. + * On the final call, applies keccak padding. + * @param state The in-progress keccak state to update (modified in place) + * @param data The next chunk of preimage bytes to absorb + * @param isFinal If true, pads and processes the final block + */ function keccakUpdate(KeccakState storage state, bytes calldata data, bool isFinal) internal { state.length += data.length; while (true) { if (data.length == 0 && !isFinal) { break; } + + // XOR in the next chunk of data, padding if necessary + // (1 byte per iteration) for (uint256 i = 0; i < KECCAK_ROUND_INPUT; i++) { uint8 b = 0; if (i < data.length) { b = uint8(data[i]); } else { - // Padding + // Padding added in the final chunk or in a chunk on its own if the final chunk is exactly round-aligned + // 1st bit (LSB) is set if this is the first byte after the data if (i == data.length) { b |= uint8(0x01); } + // Last bit (MSB) is always set in the final chunk if (i == KECCAK_ROUND_INPUT - 1) { b |= uint8(0x80); } @@ -124,10 +154,16 @@ contract HashProofHelper { for (uint256 i = 0; i < 25; i++) { state256[i] = state.state[i]; } + + // Scramble the state with keccakF state256 = CryptographyPrimitives.keccakF(state256); + + // Write the new state back to storage for (uint256 i = 0; i < 25; i++) { state.state[i] = uint64(state256[i]); } + + // Strict inequality, because if data is an exact multiple of the round size, keccak still adds a padding chunk if (data.length < KECCAK_ROUND_INPUT) { break; } @@ -135,11 +171,12 @@ contract HashProofHelper { } } + /// @notice Deletes the caller's in-progress split proof state function clearSplitProof() external { delete keccakStates[msg.sender]; } - /// Retrieves up to 32 bytes of the preimage of fullHash at the given offset, reverting if it hasn't been proven yet. + /// @inheritdoc IHashProofHelper function getPreimagePart( bytes32 fullHash, uint64 offset diff --git a/src/osp/IHashProofHelper.sol b/src/osp/IHashProofHelper.sol new file mode 100644 index 000000000..d0f613609 --- /dev/null +++ b/src/osp/IHashProofHelper.sol @@ -0,0 +1,64 @@ +// Copyright 2021-2022, Offchain Labs, Inc. +// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.0; + +/** + * @title IHashProofHelper + * @notice Proves keccak256 preimages and stores slices of up to 32 bytes for later retrieval. + * Used by the OneStepProverHostIo to verify large preimages that don't fit + * in a single transaction's calldata. The preimage is uploaded in advance + * (in one or more transactions), and later retrieved during the one-step proof. + */ +interface IHashProofHelper { + /// @notice Emitted when a preimage part is proven and stored + event PreimagePartProven(bytes32 indexed fullHash, uint64 indexed offset, bytes part); + + /// @notice The requested preimage part has not been proven yet + error NotProven(bytes32 fullHash, uint64 offset); + + /** + * @notice Proves a preimage in a single transaction by providing all data at once + * @param data The full preimage + * @param offset Byte offset into the preimage. Up to 32 bytes at this offset are stored + * as the proven part. If offset is past the end of data, an empty part is stored. + * @return fullHash keccak256(data) + */ + function proveWithFullPreimage( + bytes calldata data, + uint64 offset + ) external returns (bytes32 fullHash); + + /** + * @notice Proves a preimage across multiple transactions by uploading data in chunks. + * Each chunk is absorbed into an incremental keccak256 computation stored + * per sender. On the final chunk, the hash is finalized and the proven part + * is stored. + * @param data The next chunk of preimage data. Must be a multiple of 136 bytes + * (the keccak round size) unless this is the final chunk + * @param offset Byte offset into the full preimage for the 32-byte part to prove. + * Must be the same value across all chunks of a single proof. + * @param flags a bitset signaling various things about the proof, ordered from least to most significant bits: + * - bit 0: indicates that this data is the final chunk of preimage data, which triggers padding, hash finalization, and storage + * - bit 1: indicates that the unfinished preimage currently being built should be cleared before this + * @return fullHash if the final chunk is passed, keccak256 of the full preimage; otherwise, bytes32(0) + */ + function proveWithSplitPreimage( + bytes calldata data, + uint64 offset, + uint256 flags + ) external returns (bytes32 fullHash); + + /** + * @notice Retrieves a previously proven preimage part + * @param fullHash The keccak256 hash of the preimage + * @param offset The byte offset that was used when the part was proven + * @return The proven bytes (up to 32). Reverts with NotProven if the part + * at this hash and offset hasn't been proven yet. + */ + function getPreimagePart( + bytes32 fullHash, + uint64 offset + ) external view returns (bytes memory); +} diff --git a/src/osp/OneStepProverHostIo.sol b/src/osp/OneStepProverHostIo.sol index 05702a55a..a4836688a 100644 --- a/src/osp/OneStepProverHostIo.sol +++ b/src/osp/OneStepProverHostIo.sol @@ -12,6 +12,7 @@ import "../state/Deserialize.sol"; import "../state/ModuleMemory.sol"; import "./IOneStepProver.sol"; import "./ICustomDAProofValidator.sol"; +import "./IHashProofHelper.sol"; contract OneStepProverHostIo is IOneStepProver { using GlobalStateLib for GlobalState; @@ -30,11 +31,14 @@ contract OneStepProverHostIo is IOneStepProver { uint256 private constant CLAIMED_VALID_LEN = 1; ICustomDAProofValidator public immutable customDAValidator; + IHashProofHelper public immutable hashProofHelper; constructor( - address _customDAValidator + address _customDAValidator, + address _hashProofHelper ) { customDAValidator = ICustomDAProofValidator(_customDAValidator); + hashProofHelper = IHashProofHelper(_hashProofHelper); } function setLeafByte(bytes32 oldLeaf, uint256 idx, uint8 val) internal pure returns (bytes32) { @@ -150,6 +154,7 @@ contract OneStepProverHostIo is IOneStepProver { // The machine is asking for a keccak256 preimage if (proofType == 0) { + // The proof contains the full preimage bytes calldata preimage = proof[proofOffset:]; require(keccak256(preimage) == leafContents, "BAD_PREIMAGE"); @@ -158,8 +163,18 @@ contract OneStepProverHostIo is IOneStepProver { preimageEnd = preimage.length; } extracted = preimage[preimageOffset:preimageEnd]; + } else if (proofType == 1) { + // The proof contains a part of the preimage, verified by the HashProofHelper contract + require( + address(hashProofHelper) != address(0), + "HASH_PROOF_HELPER_NOT_SET" + ); + + extracted = hashProofHelper.getPreimagePart( + leafContents, + uint64(preimageOffset) + ); } else { - // TODO: support proving via an authenticated contract revert("UNKNOWN_PREIMAGE_PROOF"); } } else if (inst.argumentData == 1) { diff --git a/test/signatures/OneStepProverHostIo b/test/signatures/OneStepProverHostIo index 4ded94935..173c00507 100644 --- a/test/signatures/OneStepProverHostIo +++ b/test/signatures/OneStepProverHostIo @@ -5,5 +5,7 @@ | customDAValidator() | c3ea90ba | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| | executeOneStep((bytes32,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes) | 8451c82c | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------| +| hashProofHelper() | bef51917 | ╰------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------╯ From 6fd6ad4cb105d4e2c42c769fe35d91134e1c4c69 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Wed, 10 Jun 2026 17:05:51 +0100 Subject: [PATCH 5/9] Format and fix unit tests --- src/mocks/SimpleOneStepProofEntry.sol | 2 +- src/osp/HashProofHelper.sol | 2 +- src/osp/OneStepProofEntry.sol | 8 ++-- src/osp/OneStepProverHostIo.sol | 17 ++----- src/state/GlobalState.sol | 12 ----- test/MockAssertionChain.sol | 19 ++++---- test/foundry/OneStepProverHostIo.t.sol | 66 +++++++++++++++----------- test/foundry/Rollup.t.sol | 2 +- test/foundry/RollupCreator.t.sol | 2 +- 9 files changed, 57 insertions(+), 73 deletions(-) diff --git a/src/mocks/SimpleOneStepProofEntry.sol b/src/mocks/SimpleOneStepProofEntry.sol index d077614b7..afb3424d5 100644 --- a/src/mocks/SimpleOneStepProofEntry.sol +++ b/src/mocks/SimpleOneStepProofEntry.sol @@ -46,7 +46,7 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { } if ( melState.parentChainBlockHash == execCtx.targetParentChainBlockHash - && globalState.getMELExecutedMsgCount() >= globalState.getMELMsgCount() + && globalState.getMELExecutedMsgCount() >= melState.msgCount ) { // We can't continue further because we've executed all messages up to this melState return beforeHash; diff --git a/src/osp/HashProofHelper.sol b/src/osp/HashProofHelper.sol index 38f3ade04..5a4ab0b63 100644 --- a/src/osp/HashProofHelper.sol +++ b/src/osp/HashProofHelper.sol @@ -94,7 +94,7 @@ contract HashProofHelper is IHashProofHelper { state.part.push(data[i]); } } - + // If this is not the final chunk, we can't yet determine the full hash, so we return early if (!isFinal) { return bytes32(0); diff --git a/src/osp/OneStepProofEntry.sol b/src/osp/OneStepProofEntry.sol index 3008f9139..192536984 100644 --- a/src/osp/OneStepProofEntry.sol +++ b/src/osp/OneStepProofEntry.sol @@ -111,15 +111,13 @@ contract OneStepProofEntry is IOneStepProofEntry { require(melState.hash() == globalState.getMELStateHash(), "BAD_MEL_STATE"); // The machine has finished processing a message and we're at the start of the next execution segment (machineStep == 0). - // If the MELState is not at its target (meaning that it hasn't finished extracting messages), - // or there are still messages to be processed in MEL, we kickstart the machine. + // If the MELState is not at its target (meaning that it hasn't finished extracting messages, which should only happen before the extraction process is started), + // or if all messages were extracted, but there are still messages to be executed in MEL, we kickstart the machine. if ( mach.status == MachineStatus.FINISHED && machineStep == 0 && ( - // Machine hasn't extracted messages for this assertion (should only happen before the extraction process is started) melState.parentChainBlockHash != execCtx.targetParentChainBlockHash - // Machine finishes extracting all messages, but hasn't finished executing them yet - || globalState.getMELExecutedMsgCount() < globalState.getMELMsgCount() + || globalState.getMELExecutedMsgCount() < melState.msgCount ) ) { // Kickstart the machine diff --git a/src/osp/OneStepProverHostIo.sol b/src/osp/OneStepProverHostIo.sol index a4836688a..a094526b2 100644 --- a/src/osp/OneStepProverHostIo.sol +++ b/src/osp/OneStepProverHostIo.sol @@ -33,10 +33,7 @@ contract OneStepProverHostIo is IOneStepProver { ICustomDAProofValidator public immutable customDAValidator; IHashProofHelper public immutable hashProofHelper; - constructor( - address _customDAValidator, - address _hashProofHelper - ) { + constructor(address _customDAValidator, address _hashProofHelper) { customDAValidator = ICustomDAProofValidator(_customDAValidator); hashProofHelper = IHashProofHelper(_hashProofHelper); } @@ -165,15 +162,9 @@ contract OneStepProverHostIo is IOneStepProver { extracted = preimage[preimageOffset:preimageEnd]; } else if (proofType == 1) { // The proof contains a part of the preimage, verified by the HashProofHelper contract - require( - address(hashProofHelper) != address(0), - "HASH_PROOF_HELPER_NOT_SET" - ); - - extracted = hashProofHelper.getPreimagePart( - leafContents, - uint64(preimageOffset) - ); + require(address(hashProofHelper) != address(0), "HASH_PROOF_HELPER_NOT_SET"); + + extracted = hashProofHelper.getPreimagePart(leafContents, uint64(preimageOffset)); } else { revert("UNKNOWN_PREIMAGE_PROOF"); } diff --git a/src/state/GlobalState.sol b/src/state/GlobalState.sol index bb338732a..51b222515 100644 --- a/src/state/GlobalState.sol +++ b/src/state/GlobalState.sol @@ -58,18 +58,6 @@ library GlobalStateLib { return state.bytes32Vals[3]; } - function getInboxPosition( - GlobalState memory state - ) internal pure returns (uint64) { - return state.u64Vals[0]; - } - - function getPositionInMessage( - GlobalState memory state - ) internal pure returns (uint64) { - return state.u64Vals[1]; - } - /// @dev Unused. MELState.msgCount should be used instead whenever possible, but this is left here /// to mimic nitro's implementation of GlobalState. function getMELMsgCount( diff --git a/test/MockAssertionChain.sol b/test/MockAssertionChain.sol index fc6b0e804..e2c0067e1 100644 --- a/test/MockAssertionChain.sol +++ b/test/MockAssertionChain.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {IAssertionChain} from "../src/challengeV2/IAssertionChain.sol"; -import {IEdgeChallengeManager} from "../src/challengeV2/IEdgeChallengeManager.sol"; import "../src/bridge/IBridge.sol"; import "../src/rollup/RollupLib.sol"; import "./challengeV2/StateTools.sol"; @@ -21,7 +20,7 @@ struct MockAssertion { } contract MockAssertionChain is IAssertionChain { - mapping(bytes32 => MockAssertion) assertions; + mapping(bytes32 => MockAssertion) private assertions; IBridge public bridge; // TODO: set bridge in this mock bytes32 public wasmModuleRoot; uint256 public baseStake; @@ -44,8 +43,7 @@ contract MockAssertionChain is IAssertionChain { function validateAssertionHash( bytes32 assertionHash, AssertionState calldata state, - bytes32 prevAssertionHash, - bytes32 inboxAcc + bytes32 prevAssertionHash ) external view { require(assertionExists(assertionHash), "Assertion does not exist"); // TODO: HN: This is not how the real assertion chain calculate assertion hash @@ -76,7 +74,7 @@ contract MockAssertionChain is IAssertionChain { requiredStake: configData.requiredStake, challengeManager: configData.challengeManager, confirmPeriodBlocks: configData.confirmPeriodBlocks, - nextInboxPosition: configData.nextInboxPosition + nextParentChainBlockHash: configData.nextParentChainBlockHash }) == assertions[assertionHash].configHash, "BAD_CONFIG" ); @@ -102,8 +100,7 @@ contract MockAssertionChain is IAssertionChain { ) public pure returns (bytes32) { return RollupLib.assertionHash({ parentAssertionHash: predecessorId, - afterState: afterState, - inboxAcc: keccak256(abi.encode(afterState.globalState.u64Vals[0])) // mock accumulator based on inbox count + afterState: afterState }); } @@ -120,7 +117,7 @@ contract MockAssertionChain is IAssertionChain { function addAssertionUnsafe( bytes32 predecessorId, uint256 height, - uint64 nextInboxPosition, + bytes32 nextParentChainBlockHash, AssertionState memory afterState, bytes32 successionChallenge ) public returns (bytes32) { @@ -139,7 +136,7 @@ contract MockAssertionChain is IAssertionChain { requiredStake: baseStake, challengeManager: challengeManager, confirmPeriodBlocks: confirmPeriodBlocks, - nextInboxPosition: nextInboxPosition + nextParentChainBlockHash: nextParentChainBlockHash }) }); childCreated(predecessorId); @@ -149,7 +146,7 @@ contract MockAssertionChain is IAssertionChain { function addAssertion( bytes32 predecessorId, uint256 height, - uint64 nextInboxPosition, + bytes32 nextParentChainBlockHash, AssertionState memory beforeState, AssertionState memory afterState, bytes32 successionChallenge @@ -165,7 +162,7 @@ contract MockAssertionChain is IAssertionChain { ); return addAssertionUnsafe( - predecessorId, height, nextInboxPosition, afterState, successionChallenge + predecessorId, height, nextParentChainBlockHash, afterState, successionChallenge ); } diff --git a/test/foundry/OneStepProverHostIo.t.sol b/test/foundry/OneStepProverHostIo.t.sol index 7bd54918f..3e318a0f7 100644 --- a/test/foundry/OneStepProverHostIo.t.sol +++ b/test/foundry/OneStepProverHostIo.t.sol @@ -7,8 +7,9 @@ import {ICustomDAProofValidator} from "../../src/osp/ICustomDAProofValidator.sol contract OneStepProverHostIoPublic is OneStepProverHostIo { constructor( - address _customDAValidator - ) OneStepProverHostIo(_customDAValidator) {} + address _customDAValidator, + address _hashProofHelper + ) OneStepProverHostIo(_customDAValidator, _hashProofHelper) {} function executeReadPreImagePublic( ExecutionContext calldata context, @@ -23,9 +24,9 @@ contract OneStepProverHostIoPublic is OneStepProverHostIo { contract CustomDAProofValidatorMock is ICustomDAProofValidator { function validateReadPreimage( - bytes32 certHash, - uint256 offset, - bytes calldata proof + bytes32, + uint256, + bytes calldata ) external pure override returns (bytes memory preimageChunk) { return new bytes(32); } @@ -56,16 +57,16 @@ contract CustomDAProofValidatorMock is ICustomDAProofValidator { contract CustomDAProofValidatorBadResponse is ICustomDAProofValidator { function validateReadPreimage( - bytes32 certHash, - uint256 offset, - bytes calldata proof + bytes32, + uint256, + bytes calldata ) external pure override returns (bytes memory preimageChunk) { // Return invalid response (too long) return new bytes(33); } function validateCertificate( - bytes calldata proof + bytes calldata ) external pure override returns (bool isValid) { // Always return false for this mock return false; @@ -74,16 +75,16 @@ contract CustomDAProofValidatorBadResponse is ICustomDAProofValidator { contract CustomDAProofValidatorEmptyResponse is ICustomDAProofValidator { function validateReadPreimage( - bytes32 certHash, - uint256 offset, - bytes calldata proof + bytes32, + uint256, + bytes calldata ) external pure override returns (bytes memory preimageChunk) { // Return empty response return new bytes(0); } function validateCertificate( - bytes calldata proof + bytes calldata ) external pure override returns (bool isValid) { // Always return true for this mock return true; @@ -95,8 +96,9 @@ contract OneStepProverHostIoTest is Test { using ValueLib for Value; using ValueStackLib for ValueStack; - ICustomDAProofValidator mockCustomDAProofValidator; - address owner = address(0x1234); + ICustomDAProofValidator public mockCustomDAProofValidator; + IHashProofHelper public mockHashProofHelper = IHashProofHelper(address(0x0)); + address public owner = address(0x1234); function setUp() public { mockCustomDAProofValidator = new CustomDAProofValidatorMock(); @@ -173,8 +175,9 @@ contract OneStepProverHostIoTest is Test { function testWrongCertificateHash() public { // Deploy OSP with mockCustomDAProofValidator as customDAValidator - OneStepProverHostIoPublic ospHostIo = - new OneStepProverHostIoPublic(address(mockCustomDAProofValidator)); + OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic( + address(mockCustomDAProofValidator), address(mockHashProofHelper) + ); // Create a different certificate hash that the machine expects bytes32 correctCertKeccak256 = keccak256( @@ -213,8 +216,9 @@ contract OneStepProverHostIoTest is Test { function testCustomDAValidatorSupported() public { // Deploy OSP with mockCustomDAProofValidator as customDAValidator - OneStepProverHostIoPublic ospHostIo = - new OneStepProverHostIoPublic(address(mockCustomDAProofValidator)); + OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic( + address(mockCustomDAProofValidator), address(mockHashProofHelper) + ); (bytes32 certKeccak256, bytes memory proof) = buildFullProof(hex"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"); @@ -237,7 +241,8 @@ contract OneStepProverHostIoTest is Test { function testCustomDAValidatorNotSupported() public { // Deploy OSP with address(0) as customDAValidator - OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic(address(0)); + OneStepProverHostIoPublic ospHostIo = + new OneStepProverHostIoPublic(address(0), address(mockHashProofHelper)); (bytes32 certKeccak256, bytes memory proof) = buildFullProof(hex"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"); @@ -261,8 +266,9 @@ contract OneStepProverHostIoTest is Test { function testCustomDAProofTooShort() public { // Deploy OSP with mockCustomDAProofValidator as customDAValidator - OneStepProverHostIoPublic ospHostIo = - new OneStepProverHostIoPublic(address(mockCustomDAProofValidator)); + OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic( + address(mockCustomDAProofValidator), address(mockHashProofHelper) + ); bytes32 certKeccak256 = keccak256("test"); bytes memory merkleProof = buildMerkleProof(certKeccak256); @@ -289,8 +295,9 @@ contract OneStepProverHostIoTest is Test { function testProofTooShortForCert() public { // Deploy OSP with mockCustomDAProofValidator as customDAValidator - OneStepProverHostIoPublic ospHostIo = - new OneStepProverHostIoPublic(address(mockCustomDAProofValidator)); + OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic( + address(mockCustomDAProofValidator), address(mockHashProofHelper) + ); bytes32 certKeccak256 = keccak256("test"); bytes memory merkleProof = buildMerkleProof(certKeccak256); @@ -322,8 +329,9 @@ contract OneStepProverHostIoTest is Test { function testUnknownPreimageProof() public { // Deploy OSP with mockCustomDAProofValidator as customDAValidator - OneStepProverHostIoPublic ospHostIo = - new OneStepProverHostIoPublic(address(mockCustomDAProofValidator)); + OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic( + address(mockCustomDAProofValidator), address(mockHashProofHelper) + ); bytes memory preimage = hex"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"; @@ -354,7 +362,8 @@ contract OneStepProverHostIoTest is Test { function testInvalidCustomDAResponseTooLong() public { // Deploy OSP with a validator that returns too long response CustomDAProofValidatorBadResponse badValidator = new CustomDAProofValidatorBadResponse(); - OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic(address(badValidator)); + OneStepProverHostIoPublic ospHostIo = + new OneStepProverHostIoPublic(address(badValidator), address(mockHashProofHelper)); (bytes32 certKeccak256, bytes memory proof) = buildFullProof(hex"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"); @@ -379,7 +388,8 @@ contract OneStepProverHostIoTest is Test { // Deploy OSP with a validator that returns empty response CustomDAProofValidatorEmptyResponse emptyValidator = new CustomDAProofValidatorEmptyResponse(); - OneStepProverHostIoPublic ospHostIo = new OneStepProverHostIoPublic(address(emptyValidator)); + OneStepProverHostIoPublic ospHostIo = + new OneStepProverHostIoPublic(address(emptyValidator), address(mockHashProofHelper)); (bytes32 certKeccak256, bytes memory proof) = buildFullProof(hex"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"); diff --git a/test/foundry/Rollup.t.sol b/test/foundry/Rollup.t.sol index 9a7dde8a0..810f5f03d 100644 --- a/test/foundry/Rollup.t.sol +++ b/test/foundry/Rollup.t.sol @@ -132,7 +132,7 @@ contract RollupTest is Test { OneStepProver0 oneStepProver = new OneStepProver0(); OneStepProverMemory oneStepProverMemory = new OneStepProverMemory(); OneStepProverMath oneStepProverMath = new OneStepProverMath(); - OneStepProverHostIo oneStepProverHostIo = new OneStepProverHostIo(address(0)); + OneStepProverHostIo oneStepProverHostIo = new OneStepProverHostIo(address(0), address(0)); OneStepProofEntry oneStepProofEntry = new OneStepProofEntry( oneStepProver, oneStepProverMemory, oneStepProverMath, oneStepProverHostIo ); diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 94286e7fd..f29e107f4 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -540,7 +540,7 @@ contract RollupCreatorTest is Test { new OneStepProver0(), new OneStepProverMemory(), new OneStepProverMath(), - new OneStepProverHostIo(address(0)) + new OneStepProverHostIo(address(0), address(0)) ); challengeManager = new EdgeChallengeManager(); From 0ddb0eb94d4797b3d5c2c0670ba3fb1dadc07e62 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 28 Jul 2026 13:06:05 +0100 Subject: [PATCH 6/9] Adapt changes to the new GlobalState struct --- src/mocks/SimpleOneStepProofEntry.sol | 4 ++-- test/foundry/Rollup.t.sol | 27 ++++++++++++++------------- test/foundry/RollupCreator.t.sol | 3 +-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/mocks/SimpleOneStepProofEntry.sol b/src/mocks/SimpleOneStepProofEntry.sol index afb3424d5..37460dcc9 100644 --- a/src/mocks/SimpleOneStepProofEntry.sol +++ b/src/mocks/SimpleOneStepProofEntry.sol @@ -34,8 +34,8 @@ contract SimpleOneStepProofEntry is IOneStepProofEntry { GlobalState memory globalState; uint256 offset; (globalState.bytes32Vals[3], offset) = Deserialize.b32(proof, offset); // MELNextMsgHash - (globalState.u64Vals[0], offset) = Deserialize.u64(proof, offset); // MELMsgCount - (globalState.u64Vals[1], offset) = Deserialize.u64(proof, offset); // MELExecutedMsgCount + (globalState.u64Vals[2], offset) = Deserialize.u64(proof, offset); // MELMsgCount + (globalState.u64Vals[3], offset) = Deserialize.u64(proof, offset); // MELExecutedMsgCount MELState memory melState; (melState.parentChainBlockHash, offset) = Deserialize.b32(proof, offset); diff --git a/test/foundry/Rollup.t.sol b/test/foundry/Rollup.t.sol index 810f5f03d..b4c7e03d9 100644 --- a/test/foundry/Rollup.t.sol +++ b/test/foundry/Rollup.t.sol @@ -185,7 +185,6 @@ contract RollupTest is Test { wasmModuleRoot: WASM_MODULE_ROOT, loserStakeEscrow: loserStakeEscrow, genesisAssertionState: genesisAssertionState, - genesisInboxCount: 0, miniStakeValues: miniStakeValues, layerZeroBlockEdgeHeight: 2 ** 5, layerZeroBigStepEdgeHeight: 2 ** 5, @@ -318,8 +317,10 @@ contract RollupTest is Test { assertionState.globalState.bytes32Vals[1] = FIRST_ASSERTION_SENDROOT; // Sendroot assertionState.globalState.bytes32Vals[2] = melState.hash(); // MELState hash assertionState.globalState.bytes32Vals[3] = bytes32(0); // MEL NextMsgHash - assertionState.globalState.u64Vals[0] = INITIAL_MSG_COUNT; // MsgCount - assertionState.globalState.u64Vals[1] = INITIAL_MSG_COUNT; // ExecutedMsgCount + assertionState.globalState.u64Vals[0] = 0; // InboxPosition (deprecated) + assertionState.globalState.u64Vals[1] = 0; // PositionInMessage (deprecated) + assertionState.globalState.u64Vals[2] = INITIAL_MSG_COUNT; // MsgCount + assertionState.globalState.u64Vals[3] = INITIAL_MSG_COUNT; // ExecutedMsgCount return (assertionState, melState); } @@ -640,8 +641,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[0] += 1; // increase MsgCount - afterState.globalState.u64Vals[1] += 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[2] += 1; // increase MsgCount + afterState.globalState.u64Vals[3] += 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({parentAssertionHash: assertionHash, afterState: afterState}); @@ -1240,8 +1241,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount - afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount + afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, @@ -1299,8 +1300,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount - afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount + afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, @@ -1586,7 +1587,7 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] + [uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] ), MachineStatus.FINISHED, bytes32(0) @@ -1600,7 +1601,7 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] + [uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] ), MachineStatus.FINISHED, bytes32(0) @@ -1674,8 +1675,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount - afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount + afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index f29e107f4..e1a08c517 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -99,7 +99,7 @@ contract RollupCreatorTest is Test { miniStakeValues[1] = 2 ether; miniStakeValues[2] = 3 ether; AssertionState memory emptyState = AssertionState( - GlobalState([bytes32(0), bytes32(0), bytes32(0), bytes32(0)], [uint64(0), uint64(0)]), + GlobalState([bytes32(0), bytes32(0), bytes32(0), bytes32(0)], [uint64(0), uint64(0), uint64(0), uint64(0)]), MachineStatus.FINISHED, bytes32(0) ); @@ -116,7 +116,6 @@ contract RollupCreatorTest is Test { wasmModuleRoot: keccak256("wasm"), loserStakeEscrow: address(200), genesisAssertionState: emptyState, - genesisInboxCount: 0, miniStakeValues: miniStakeValues, layerZeroBlockEdgeHeight: 2 ** 5, layerZeroBigStepEdgeHeight: 2 ** 5, From 80e9482252d4c6da138ab625ede9c33c7feb91e8 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 28 Jul 2026 16:06:12 +0100 Subject: [PATCH 7/9] Format --- test/foundry/Rollup.t.sol | 14 ++++++++++++-- test/foundry/RollupCreator.t.sol | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/test/foundry/Rollup.t.sol b/test/foundry/Rollup.t.sol index b4c7e03d9..517d94a15 100644 --- a/test/foundry/Rollup.t.sol +++ b/test/foundry/Rollup.t.sol @@ -1587,7 +1587,12 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] + [ + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())) + ] ), MachineStatus.FINISHED, bytes32(0) @@ -1601,7 +1606,12 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] + [ + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())), + uint64(uint256(rand.hash())) + ] ), MachineStatus.FINISHED, bytes32(0) diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index e1a08c517..653128f9f 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -99,7 +99,10 @@ contract RollupCreatorTest is Test { miniStakeValues[1] = 2 ether; miniStakeValues[2] = 3 ether; AssertionState memory emptyState = AssertionState( - GlobalState([bytes32(0), bytes32(0), bytes32(0), bytes32(0)], [uint64(0), uint64(0), uint64(0), uint64(0)]), + GlobalState( + [bytes32(0), bytes32(0), bytes32(0), bytes32(0)], + [uint64(0), uint64(0), uint64(0), uint64(0)] + ), MachineStatus.FINISHED, bytes32(0) ); From a1b1cf713621717df692af963e452f8c1be06d96 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 28 Jul 2026 16:23:30 +0100 Subject: [PATCH 8/9] Rollback changes to tests --- test/foundry/Rollup.t.sol | 37 +++++++++++--------------------- test/foundry/RollupCreator.t.sol | 6 ++---- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/test/foundry/Rollup.t.sol b/test/foundry/Rollup.t.sol index 517d94a15..810f5f03d 100644 --- a/test/foundry/Rollup.t.sol +++ b/test/foundry/Rollup.t.sol @@ -185,6 +185,7 @@ contract RollupTest is Test { wasmModuleRoot: WASM_MODULE_ROOT, loserStakeEscrow: loserStakeEscrow, genesisAssertionState: genesisAssertionState, + genesisInboxCount: 0, miniStakeValues: miniStakeValues, layerZeroBlockEdgeHeight: 2 ** 5, layerZeroBigStepEdgeHeight: 2 ** 5, @@ -317,10 +318,8 @@ contract RollupTest is Test { assertionState.globalState.bytes32Vals[1] = FIRST_ASSERTION_SENDROOT; // Sendroot assertionState.globalState.bytes32Vals[2] = melState.hash(); // MELState hash assertionState.globalState.bytes32Vals[3] = bytes32(0); // MEL NextMsgHash - assertionState.globalState.u64Vals[0] = 0; // InboxPosition (deprecated) - assertionState.globalState.u64Vals[1] = 0; // PositionInMessage (deprecated) - assertionState.globalState.u64Vals[2] = INITIAL_MSG_COUNT; // MsgCount - assertionState.globalState.u64Vals[3] = INITIAL_MSG_COUNT; // ExecutedMsgCount + assertionState.globalState.u64Vals[0] = INITIAL_MSG_COUNT; // MsgCount + assertionState.globalState.u64Vals[1] = INITIAL_MSG_COUNT; // ExecutedMsgCount return (assertionState, melState); } @@ -641,8 +640,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[2] += 1; // increase MsgCount - afterState.globalState.u64Vals[3] += 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[0] += 1; // increase MsgCount + afterState.globalState.u64Vals[1] += 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({parentAssertionHash: assertionHash, afterState: afterState}); @@ -1241,8 +1240,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount - afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount + afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, @@ -1300,8 +1299,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount - afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount + afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, @@ -1587,12 +1586,7 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [ - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())) - ] + [uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] ), MachineStatus.FINISHED, bytes32(0) @@ -1606,12 +1600,7 @@ contract RollupTest is Test { AssertionState memory astate = AssertionState( GlobalState( [rand.hash(), rand.hash(), rand.hash(), rand.hash()], - [ - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())), - uint64(uint256(rand.hash())) - ] + [uint64(uint256(rand.hash())), uint64(uint256(rand.hash()))] ), MachineStatus.FINISHED, bytes32(0) @@ -1685,8 +1674,8 @@ contract RollupTest is Test { AssertionState memory afterState; afterState.machineStatus = MachineStatus.FINISHED; - afterState.globalState.u64Vals[2] = beforeState.globalState.u64Vals[2] + 1; // increase MsgCount - afterState.globalState.u64Vals[3] = beforeState.globalState.u64Vals[3] + 1; // increase ExecutedMsgCount + afterState.globalState.u64Vals[0] = beforeState.globalState.u64Vals[0] + 1; // increase MsgCount + afterState.globalState.u64Vals[1] = beforeState.globalState.u64Vals[1] + 1; // increase ExecutedMsgCount afterState.globalState.bytes32Vals[2] = afterMELState.hash(); // update MEL State hash bytes32 expectedAssertionHash = RollupLib.assertionHash({ parentAssertionHash: beforeAssertionHash, diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 653128f9f..f29e107f4 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -99,10 +99,7 @@ contract RollupCreatorTest is Test { miniStakeValues[1] = 2 ether; miniStakeValues[2] = 3 ether; AssertionState memory emptyState = AssertionState( - GlobalState( - [bytes32(0), bytes32(0), bytes32(0), bytes32(0)], - [uint64(0), uint64(0), uint64(0), uint64(0)] - ), + GlobalState([bytes32(0), bytes32(0), bytes32(0), bytes32(0)], [uint64(0), uint64(0)]), MachineStatus.FINISHED, bytes32(0) ); @@ -119,6 +116,7 @@ contract RollupCreatorTest is Test { wasmModuleRoot: keccak256("wasm"), loserStakeEscrow: address(200), genesisAssertionState: emptyState, + genesisInboxCount: 0, miniStakeValues: miniStakeValues, layerZeroBlockEdgeHeight: 2 ** 5, layerZeroBigStepEdgeHeight: 2 ** 5, From 71fc900cb247d34471fb939c8aa3e56f54d12ed5 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Tue, 28 Jul 2026 16:36:10 +0100 Subject: [PATCH 9/9] Update signatures --- test/signatures/OneStepProofEntry | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/signatures/OneStepProofEntry b/test/signatures/OneStepProofEntry index e2ab42352..567557173 100644 --- a/test/signatures/OneStepProofEntry +++ b/test/signatures/OneStepProofEntry @@ -1,19 +1,19 @@ -╭---------------------------------------------------------------+------------╮ -| Method | Identifier | -+============================================================================+ -| getMachineHash(((bytes32[4],uint64[4]),uint8)) | 43d43807 | -|---------------------------------------------------------------+------------| -| getStartMachineHash(bytes32,bytes32) | 04997be4 | -|---------------------------------------------------------------+------------| -| proveOneStep((uint256,address,bytes32),uint256,bytes32,bytes) | b5112fd2 | -|---------------------------------------------------------------+------------| -| prover0() | 30a5509f | -|---------------------------------------------------------------+------------| -| proverHostIo() | 5f52fd7c | -|---------------------------------------------------------------+------------| -| proverMath() | 66e5d9c3 | -|---------------------------------------------------------------+------------| -| proverMem() | 1f128bc0 | -╰---------------------------------------------------------------+------------╯ +╭-------------------------------------------------------+------------╮ +| Method | Identifier | ++====================================================================+ +| getMachineHash(((bytes32[4],uint64[4]),uint8)) | 43d43807 | +|-------------------------------------------------------+------------| +| getStartMachineHash(bytes32,bytes32) | 04997be4 | +|-------------------------------------------------------+------------| +| proveOneStep((bytes32,bytes32),uint256,bytes32,bytes) | 400cc375 | +|-------------------------------------------------------+------------| +| prover0() | 30a5509f | +|-------------------------------------------------------+------------| +| proverHostIo() | 5f52fd7c | +|-------------------------------------------------------+------------| +| proverMath() | 66e5d9c3 | +|-------------------------------------------------------+------------| +| proverMem() | 1f128bc0 | +╰-------------------------------------------------------+------------╯