Skip to content

[DO NOT MERGE] [MEL] Implement forceConfirmGenesisMELAssertion - #444

Draft
ganeshvanahalli wants to merge 1 commit into
feat/mel-osp-testingfrom
impl-forceConfirmGenesisMELAssertion
Draft

[DO NOT MERGE] [MEL] Implement forceConfirmGenesisMELAssertion#444
ganeshvanahalli wants to merge 1 commit into
feat/mel-osp-testingfrom
impl-forceConfirmGenesisMELAssertion

Conversation

@ganeshvanahalli

@ganeshvanahalli ganeshvanahalli commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Comment thread src/rollup/RollupCore.sol
Comment on lines +293 to +344
function forceConfirmGenesisMELAssertionInternal(
AssertionState calldata parentState,
bytes32 grandParentAssertionHash
) internal returns (bytes32) {
require(!genesisMELAssertionConfirmed, "MEL_GENESIS_ALREADY_CONFIRMED");
genesisMELAssertionConfirmed = true;
bytes32 parentHash = _latestConfirmed;
require(
RollupLib.assertionHash(grandParentAssertionHash, parentState) == parentHash,
"INVALID_PARENT_STATE"
);
MELState memory genesisMELState;
genesisMELState.parentChainId = uint64(block.chainid);
genesisMELState.batchPostingTargetAddress = address(sequencerInbox());
genesisMELState.delayedMessagePostingTargetAddress = address(bridge);
AssertionState memory afterState = parentState;
afterState.globalState.bytes32Vals[2] = genesisMELState.hash();
bytes32 newAssertionHash = RollupLib.assertionHash(parentHash, afterState);
bytes32 nextParentChainBlockHash = blockhash(block.number - 1);
AssertionNode memory newAssertion = AssertionNodeLib.createAssertion(
true,
RollupLib.configHash({
wasmModuleRoot: wasmModuleRoot,
requiredStake: baseStake,
challengeManager: address(challengeManager),
confirmPeriodBlocks: confirmPeriodBlocks,
nextParentChainBlockHash: nextParentChainBlockHash
})
);
getAssertionStorage(parentHash).childCreated();
_assertions[newAssertionHash] = newAssertion;
AssertionInputs memory assertionInputs;
assertionInputs.afterState = afterState;
assertionInputs.afterMELState = genesisMELState;
emit AssertionCreated(
newAssertionHash,
parentHash,
assertionInputs,
nextParentChainBlockHash,
wasmModuleRoot,
baseStake,
address(challengeManager),
confirmPeriodBlocks
);
bytes32 blockHash = afterState.globalState.getBlockHash();
bytes32 sendRoot = afterState.globalState.getSendRoot();
outbox.updateSendRoot(sendRoot, blockHash);
_latestConfirmed = newAssertionHash;
_assertions[newAssertionHash].status = AssertionStatus.Confirmed;
emit AssertionConfirmed(newAssertionHash, blockHash, sendRoot);
return newAssertionHash;
}
Comment thread src/rollup/RollupCore.sol
RollupLib.assertionHash(grandParentAssertionHash, parentState) == parentHash,
"INVALID_PARENT_STATE"
);
MELState memory genesisMELState;
Comment thread src/rollup/RollupCore.sol
);
getAssertionStorage(parentHash).childCreated();
_assertions[newAssertionHash] = newAssertion;
AssertionInputs memory assertionInputs;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants