Skip to content

Commit

Permalink
Call createNitroMigrationGenesis on nitro rollup at the end of step 3
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jul 18, 2022
1 parent 018489a commit 182574d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/arb-bridge-eth/contracts/bridge/NitroMigrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ interface INitroRollup {
function inbox() external view returns (INitroInbox.IInbox);

function setInbox(IInbox newInbox) external;

function pause() external;

function unpause() external;

function createNitroMigrationGenesis(uint64 genesisBlockNumber, bytes32 genesisBlockHash)
external;
}

interface IArbOwner {
Expand Down Expand Up @@ -143,6 +150,9 @@ contract NitroMigrator is Ownable, IMessageProvider {
INitroInbox.IInbox oldNitroInbox = nitroRollup.inbox();
nitroBridge.setDelayedInbox(address(oldNitroInbox), false);

require(nitroRollup.latestNodeCreated() == 0, "NITRO_ROLLUP_HAS_NODES");
nitroRollup.pause();

latestCompleteStep = NitroMigrationSteps.Step0;
}

Expand Down Expand Up @@ -211,7 +221,10 @@ contract NitroMigrator is Ownable, IMessageProvider {
latestCompleteStep = NitroMigrationSteps.Step2;
}

function nitroStep3() external onlyOwner {
function nitroStep3(uint64 nitroGenesisBlockNumber, bytes32 nitroGenesisHash)
external
onlyOwner
{
require(latestCompleteStep == NitroMigrationSteps.Step2, "WRONG_STEP");
// CHRIS: TODO: destroying the node in the previous steps does not reset latestConfirmed/latestNodeCreated
require(
Expand Down Expand Up @@ -241,7 +254,8 @@ contract NitroMigrator is Ownable, IMessageProvider {
// we don't enable sequencer inbox and the rollup event bridge in nitro bridge as they are already configured in the deployment
nitroBridge.setDelayedInbox(address(inbox), true);

// TODO: set the genesis block hash of the nitro rollup
nitroRollup.unpause();
nitroRollup.createNitroMigrationGenesis(nitroGenesisBlockNumber, nitroGenesisHash);

latestCompleteStep = NitroMigrationSteps.Step3;
}
Expand Down

0 comments on commit 182574d

Please sign in to comment.