Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Emit an end of block when shutting down for nitro
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jul 27, 2022
1 parent dccfbe1 commit 44ee09b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arb_os/arbos-upgrade.mexe

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion arb_os/arbos.mexe

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions arb_os/inbox.mini
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,17 @@ view write throw func handleUnpackedMessage(msg: IncomingRequest) {
// get ready to relinquish control to Nitro
allowedSenders_allowNone();
outbox_send();
let _ = asm(1 << 128) any { sideload };
// prevent another sideload from immediately occurring

// end the block
outputStats_endOfBlock(globalInbox.arbBlockNum, globalInbox.ethBlockNum, globalInbox.timestamp);
blockhash_submitHash(msg.ethBlockNumber, globalInbox.inboxHashAccumulator);
set globalInbox.arbBlockNum = globalInbox.arbBlockNum + 1;
set globalInbox.ethBlockNum = msg.ethBlockNumber;
set globalInbox.timestamp = msg.timestamp;
set globalInbox.atStartOfBlock = true;

// emit a special sideload signaling to the node that the shutdown for Nitro has begun
let _ = asm(1 << 128) any { sideload };
} else {
// invalid message type -- ignore it
}
Expand Down
2 changes: 1 addition & 1 deletion arb_os/upgrade.json

Large diffs are not rendered by default.

0 comments on commit 44ee09b

Please sign in to comment.