Skip to content

Commit

Permalink
Merge branch 'master' into release-docs-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman authored Aug 31, 2021
2 parents 9fad349 + d6c1bcf commit 74f22ae
Show file tree
Hide file tree
Showing 23 changed files with 2,766 additions and 64 deletions.
21 changes: 18 additions & 3 deletions packages/arb-bridge-eth/_deployments/1_current_deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
},
"SequencerInbox": {
"proxyAddress": "0x4c6f947Ae67F572afa4ae0730947DE7C874F95Ef",
"implAddress": "0xa4b537d94Ec347cE97F340dF185c3b079Dc75760",
"implDeploymentTxn": "0xaff909656998de061d0509bfec0f9a95d0b850d145f95f3451277fc4ffea1f46",
"implArbitrumCommitHash": "71eb134aa9be05e108d25ab0f9a7d4c62aacc0bd",
"implAddress": "0x9685e7281Fb1507B6f141758d80B08752faF0c43",
"implDeploymentTxn": "0x51bea4c6ebbfd83ee5700404f9d9ab00c42e06df301bc9f2ddea027f1633e3a0",
"implArbitrumCommitHash": "c49e68241bc9a25ac4c46d6f48676cc967424695",
"implBuildInfo": ""
},
"Bridge": {
Expand All @@ -98,6 +98,21 @@
"implDeploymentTxn": "0xd6dc4d8ed2cc893b3bb19f9b1be175e994aae4dd94710ca8e06030f91d7707a6",
"implArbitrumCommitHash": "71eb134aa9be05e108d25ab0f9a7d4c62aacc0bd",
"implBuildInfo": ""
},
"Outbox": {
"proxyAddress": "0x760723CD2e632826c38Fef8CD438A4CC7E7E1A40",
"implAddress": "0x8fdA3500EA1F8c6790cE5Ed482dA23337B3E2A5f",
"implDeploymentTxn": "0x0a7fa5bc8e747b83cdbab256e71590bbc06376c5a8b4f31a7a455e5ec0544158",
"implArbitrumCommitHash": "a69a1012c3d6f314537a713391050f0f7653494d",
"implBuildInfo": ""
}
},
"non-proxy-contracts": {
"GasRefunder": {
"address": "0x284c1875694058b213866f5f2ad015b5a4b9438b",
"deploymentTxn": "0xac34d7dce8cd027246787f0097c7981c6c53e049d5d9e40bb1a32acd347cc3c6",
"arbitrumCommitHash": "8d74aa48db7ccd639ed7998331f7428aef8d0afe",
"implBuildInfo": ""
}
}
}
21 changes: 18 additions & 3 deletions packages/arb-bridge-eth/_deployments/4_current_deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
},
"SequencerInbox": {
"proxyAddress": "0xe1ae39e91c5505f7f0ffc9e2bbf1f6e1122dcfa8",
"implAddress": "0xE23C2a7A93922811ED35BC5b3Ee1a605F6c28539",
"implDeploymentTxn": "0x0a763c671eeaf3bdbfdf53968d3df7e06a7e474e8ed481a5f22c9d51851d85f9",
"implArbitrumCommitHash": "b034a588efe7b1b0801749e59de6226d5c12099a",
"implAddress": "0x3C1C79C22A2A689a15Be2B931B348f3A93cD351F",
"implDeploymentTxn": "0xc61887f3f6843182d6bf271bfc7c3a1454707ba4d1061be255d112df3896c142",
"implArbitrumCommitHash": "56b134a930ca594ae5560962aab1140cb53415c3",
"implBuildInfo": ""
},
"Bridge": {
Expand All @@ -98,6 +98,21 @@
"implDeploymentTxn": "0xda16c51f9d4c15252c5fed9b991361227f9d4fac68de1917e583b8716618cb11",
"implArbitrumCommitHash": "b034a588efe7b1b0801749e59de6226d5c12099a",
"implBuildInfo": ""
},
"Outbox": {
"proxyAddress": "0x2360A33905dc1c72b12d975d975F42BaBdcef9F3",
"implAddress": "0xB9c7b2127865964245c80bb4648aa2A6da36e89a",
"implDeploymentTxn": "0x764010c767989b89478f97a91eed2f8e0a4e5bd607d98bcdec384d3bb0d8571a",
"implArbitrumCommitHash": "a69a1012c3d6f314537a713391050f0f7653494d",
"implBuildInfo": ""
}
},
"non-proxy-contracts": {
"GasRefunder": {
"address": "0xBBeA02117225248de9ca68e5400794BF3f7F6a58",
"deploymentTxn": "0x87be003b34ad9e41b4f81d30d788ea40a78c1ab57cf7c6891bf4ae1801c9647a",
"arbitrumCommitHash": "8d74aa48db7ccd639ed7998331f7428aef8d0afe",
"implBuildInfo": ""
}
}
}
47 changes: 38 additions & 9 deletions packages/arb-bridge-eth/contracts/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "./interfaces/IBridge.sol";
import "../arch/Marshaling.sol";
import "../libraries/Cloneable.sol";
import "../rollup/Rollup.sol";
import "../validator/IGasRefunder.sol";

import "./Messages.sol";

Expand Down Expand Up @@ -63,19 +64,11 @@ contract SequencerInbox is ISequencerInbox, Cloneable {
// it is assumed that maxDelayBlocks and maxDelaySeconds are set by the rollup
}

function postUpgradeInit() external {
function postUpgradeInit() external view {
// it is assumed the sequencer inbox contract is behind a Proxy controlled by a
// proxy admin. this function can only be called by the proxy admin contract
address proxyAdmin = ProxyUtil.getProxyAdmin();
require(msg.sender == proxyAdmin, "NOT_FROM_ADMIN");

// the sequencer inbox needs to query the old rollup interface since it will be upgraded first
OldRollup _rollup = OldRollup(rollup);

maxDelayBlocks = _rollup.sequencerInboxMaxDelayBlocks();
maxDelaySeconds = _rollup.sequencerInboxMaxDelaySeconds();

isSequencer[deprecatedSequencer] = true;
}

/// @notice DEPRECATED - use isSequencer instead
Expand Down Expand Up @@ -187,6 +180,42 @@ contract SequencerInbox is ISequencerInbox, Cloneable {
);
}

function addSequencerL2BatchFromOriginWithGasRefunder(
bytes calldata transactions,
uint256[] calldata lengths,
uint256[] calldata sectionsMetadata,
bytes32 afterAcc,
IGasRefunder gasRefunder
) external {
// solhint-disable-next-line avoid-tx-origin
require(msg.sender == tx.origin, "origin only");

uint256 startGasLeft = gasleft();
uint256 calldataSize;
assembly {
calldataSize := calldatasize()
}

uint256 startNum = messageCount;
bytes32 beforeAcc = addSequencerL2BatchImpl(
transactions,
lengths,
sectionsMetadata,
afterAcc
);
emit SequencerBatchDeliveredFromOrigin(
startNum,
beforeAcc,
messageCount,
afterAcc,
inboxAccs.length - 1
);

if (gasRefunder != IGasRefunder(0)) {
gasRefunder.onGasSpent(msg.sender, startGasLeft - gasleft(), calldataSize);
}
}

/**
* @notice Sequencer adds a batch to inbox.
* @param transactions concatenated bytes of L2 messages
Expand Down
Loading

0 comments on commit 74f22ae

Please sign in to comment.