@arbitrum/nitro-contracts 1.0.0-beta.5 → 1.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/package.json +6 -2
  2. package/src/bridge/Bridge.sol +138 -32
  3. package/src/bridge/IBridge.sol +34 -14
  4. package/src/bridge/IDelayedMessageProvider.sol +15 -0
  5. package/src/bridge/IInbox.sol +8 -19
  6. package/src/bridge/IOutbox.sol +43 -23
  7. package/src/bridge/IOwnable.sol +10 -0
  8. package/src/bridge/ISequencerInbox.sol +30 -32
  9. package/src/bridge/Inbox.sol +133 -35
  10. package/src/bridge/Outbox.sol +145 -33
  11. package/src/bridge/SequencerInbox.sol +179 -60
  12. package/src/challenge/ChallengeLib.sol +0 -2
  13. package/src/challenge/ChallengeManager.sol +4 -8
  14. package/src/challenge/IChallengeManager.sol +1 -1
  15. package/src/libraries/Error.sol +113 -0
  16. package/src/libraries/IGasRefunder.sol +15 -14
  17. package/src/libraries/MerkleLib.sol +11 -2
  18. package/src/libraries/MessageTypes.sol +1 -0
  19. package/src/mocks/BridgeStub.sol +69 -21
  20. package/src/mocks/InboxStub.sol +2 -0
  21. package/src/mocks/SequencerInboxStub.sol +10 -8
  22. package/src/mocks/Simple.sol +8 -0
  23. package/src/node-interface/NodeInterface.sol +62 -4
  24. package/src/osp/IOneStepProver.sol +1 -2
  25. package/src/osp/OneStepProver0.sol +1 -87
  26. package/src/osp/OneStepProverHostIo.sol +5 -6
  27. package/src/osp/OneStepProverMath.sol +37 -27
  28. package/src/osp/OneStepProverMemory.sol +3 -4
  29. package/src/precompiles/ArbAggregator.sol +23 -33
  30. package/src/precompiles/ArbBLS.sol +1 -43
  31. package/src/precompiles/ArbGasInfo.sol +10 -19
  32. package/src/precompiles/ArbOwner.sol +21 -15
  33. package/src/precompiles/ArbRetryableTx.sol +10 -1
  34. package/src/precompiles/ArbSys.sol +4 -4
  35. package/src/precompiles/ArbosActs.sol +9 -2
  36. package/src/rollup/BridgeCreator.sol +23 -28
  37. package/src/rollup/IRollupCore.sol +3 -3
  38. package/src/rollup/{IRollupEventBridge.sol → IRollupEventInbox.sol} +2 -2
  39. package/src/rollup/IRollupLogic.sol +21 -18
  40. package/src/rollup/RollupAdminLogic.sol +72 -34
  41. package/src/rollup/RollupCore.sol +20 -9
  42. package/src/rollup/RollupCreator.sol +21 -11
  43. package/src/rollup/{RollupEventBridge.sol → RollupEventInbox.sol} +10 -10
  44. package/src/rollup/RollupLib.sol +21 -5
  45. package/src/rollup/RollupUserLogic.sol +10 -18
  46. package/src/rollup/ValidatorWallet.sol +125 -8
  47. package/src/rollup/ValidatorWalletCreator.sol +11 -6
  48. package/src/state/Deserialize.sol +3 -22
  49. package/src/state/GlobalState.sol +7 -0
  50. package/src/state/Instructions.sol +2 -10
  51. package/src/state/Machine.sol +0 -4
  52. package/src/state/ModuleMemory.sol +2 -1
  53. package/src/state/Value.sol +2 -3
  54. package/src/test-helpers/BridgeTester.sol +233 -0
  55. package/src/test-helpers/InterfaceCompatibilityTester.sol +11 -0
  56. package/src/test-helpers/OutboxWithoutOptTester.sol +214 -0
  57. package/src/test-helpers/RollupMock.sol +21 -0
  58. package/src/bridge/IMessageProvider.sol +0 -11
  59. package/src/state/PcStack.sol +0 -32
@@ -7,45 +7,35 @@ pragma solidity >=0.4.21 <0.9.0;
7
7
  /// @title Provides aggregators and their users methods for configuring how they participate in L1 aggregation.
8
8
  /// @notice Precompiled contract that exists in every Arbitrum chain at 0x000000000000000000000000000000000000006d
9
9
  interface ArbAggregator {
10
- /// @notice Get the preferred aggregator for an address.
11
- /// @param addr The address to fetch aggregator for
12
- /// @return (preferredAggregatorAddress, isDefault)
13
- /// isDefault is true if addr is set to prefer the default aggregator
10
+ /// @notice Deprecated, customization of preferred aggregator is no longer supported
11
+ /// @notice Get the address of an arbitrarily chosen batch poster.
12
+ /// @param addr ignored
13
+ /// @return (batchPosterAddress, true)
14
14
  function getPreferredAggregator(address addr) external view returns (address, bool);
15
15
 
16
- /// @notice Set the caller's preferred aggregator.
17
- /// @param prefAgg If prefAgg is zero, this sets the caller to prefer the default aggregator
18
- function setPreferredAggregator(address prefAgg) external;
19
-
16
+ /// @notice Deprecated, there is no longer a single preferred aggregator, use getBatchPosters instead
20
17
  /// @notice Get default aggregator.
21
18
  function getDefaultAggregator() external view returns (address);
22
19
 
23
- /// @notice Set the preferred aggregator.
24
- /// This reverts unless called by the aggregator, its fee collector, or a chain owner
25
- /// @param newDefault New default aggregator
26
- function setDefaultAggregator(address newDefault) external;
27
-
28
- /// @notice Get the aggregator's compression ratio
29
- /// @param aggregator The aggregator to fetch the compression ratio for
30
- /// @return The compression ratio, measured in basis points
31
- function getCompressionRatio(address aggregator) external view returns (uint64);
32
-
33
- /// @notice Set the aggregator's compression ratio
34
- /// This reverts unless called by the aggregator, its fee collector, or a chain owner
35
- /// @param aggregator The aggregator to set the compression ratio for
36
- /// @param ratio The compression ratio, measured in basis points
37
- function setCompressionRatio(address aggregator, uint64 ratio) external;
38
-
39
- /// @notice Get the address where fees to aggregator are sent.
40
- /// @param aggregator The aggregator to get the fee collector for
41
- /// @return The fee collectors address. This will often but not always be the same as the aggregator's address.
42
- function getFeeCollector(address aggregator) external view returns (address);
43
-
44
- /// @notice Set the address where fees to aggregator are sent.
45
- /// This reverts unless called by the aggregator, its fee collector, or a chain owner
46
- /// @param aggregator The aggregator to set the fee collector for
20
+ /// @notice Get a list of all current batch posters
21
+ /// @return Batch poster addresses
22
+ function getBatchPosters() external view returns (address[] memory);
23
+
24
+ /// @notice Adds newBatchPoster as a batch poster
25
+ /// This reverts unless called by a chain owner
26
+ /// @param newBatchPoster New batch poster
27
+ function addBatchPoster(address newBatchPoster) external;
28
+
29
+ /// @notice Get the address where fees to batchPoster are sent.
30
+ /// @param batchPoster The batch poster to get the fee collector for
31
+ /// @return The fee collectors address. This will sometimes but not always be the same as the batch poster's address.
32
+ function getFeeCollector(address batchPoster) external view returns (address);
33
+
34
+ /// @notice Set the address where fees to batchPoster are sent.
35
+ /// This reverts unless called by the batch poster, its fee collector, or a chain owner
36
+ /// @param batchPoster The batch poster to set the fee collector for
47
37
  /// @param newFeeCollector The new fee collector to set
48
- function setFeeCollector(address aggregator, address newFeeCollector) external;
38
+ function setFeeCollector(address batchPoster, address newFeeCollector) external;
49
39
 
50
40
  /// @notice Deprecated, always returns zero
51
41
  /// @notice Get the tx base fee (in approximate L1 gas) for aggregator
@@ -4,50 +4,8 @@
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
6
6
 
7
- /// @title Provides a registry of BLS public keys for accounts.
7
+ /// @title Disabled precompile, formerly used to register BLS public keys.
8
8
  /// @notice Precompiled contract that exists in every Arbitrum chain at 0x0000000000000000000000000000000000000067.
9
9
  interface ArbBLS {
10
- /// @notice Deprecated -- equivalent to registerAltBN128
11
- function register(
12
- uint256 x0,
13
- uint256 x1,
14
- uint256 y0,
15
- uint256 y1
16
- ) external; // DEPRECATED
17
10
 
18
- /// @notice Deprecated -- equivalent to getAltBN128
19
- function getPublicKey(address addr)
20
- external
21
- view
22
- returns (
23
- uint256,
24
- uint256,
25
- uint256,
26
- uint256
27
- ); // DEPRECATED
28
-
29
- /// @notice Associate an AltBN128 public key with the caller's address
30
- function registerAltBN128(
31
- uint256 x0,
32
- uint256 x1,
33
- uint256 y0,
34
- uint256 y1
35
- ) external;
36
-
37
- /// @notice Get the AltBN128 public key associated with an address (revert if there isn't one)
38
- function getAltBN128(address addr)
39
- external
40
- view
41
- returns (
42
- uint256,
43
- uint256,
44
- uint256,
45
- uint256
46
- );
47
-
48
- /// @notice Associate a BLS 12-381 public key with the caller's address
49
- function registerBLS12381(bytes calldata key) external;
50
-
51
- /// @notice Get the BLS 12-381 public key associated with an address (revert if there isn't one)
52
- function getBLS12381(address addr) external view returns (bytes memory);
53
11
  }
@@ -75,7 +75,7 @@ interface ArbGasInfo {
75
75
  uint256
76
76
  );
77
77
 
78
- /// @notice Get the gas accounting parameters
78
+ /// @notice Get the gas accounting parameters. `gasPoolMax` is always zero, as the exponential pricing model has no such notion.
79
79
  /// @return (speedLimitPerSecond, gasPoolMax, maxTxGasLimit)
80
80
  function getGasAccountingParams()
81
81
  external
@@ -89,21 +89,6 @@ interface ArbGasInfo {
89
89
  /// @notice Get the minimum gas price needed for a tx to succeed
90
90
  function getMinimumGasPrice() external view returns (uint256);
91
91
 
92
- /// @notice Get the number of seconds worth of the speed limit the gas pool contains
93
- function getGasPoolSeconds() external view returns (uint64);
94
-
95
- /// @notice Get the target fullness in bips the pricing model will try to keep the pool at
96
- function getGasPoolTarget() external view returns (uint64);
97
-
98
- /// @notice Get the extent in bips to which the pricing model favors filling the pool over increasing speeds
99
- function getGasPoolWeight() external view returns (uint64);
100
-
101
- /// @notice Get ArbOS's estimate of the amount of gas being burnt per second
102
- function getRateEstimate() external view returns (uint64);
103
-
104
- /// @notice Get how slowly ArbOS updates its estimate the amount of gas being burnt per second
105
- function getRateEstimateInertia() external view returns (uint64);
106
-
107
92
  /// @notice Get ArbOS's estimate of the L1 basefee in wei
108
93
  function getL1BaseFeeEstimate() external view returns (uint256);
109
94
 
@@ -116,9 +101,6 @@ interface ArbGasInfo {
116
101
  /// @notice Get L1 gas fees paid by the current transaction
117
102
  function getCurrentTxL1GasFees() external view returns (uint256);
118
103
 
119
- /// @notice Get the amount of gas remaining in the gas pool
120
- function getGasPool() external view returns (int64);
121
-
122
104
  /// @notice Get the backlogged amount of gas burnt in excess of the speed limit
123
105
  function getGasBacklog() external view returns (uint64);
124
106
 
@@ -127,4 +109,13 @@ interface ArbGasInfo {
127
109
 
128
110
  /// @notice Get the forgivable amount of backlogged gas ArbOS will ignore when raising the basefee
129
111
  function getGasBacklogTolerance() external view returns (uint64);
112
+
113
+ /// @notice Returns the surplus of funds for L1 batch posting payments (may be negative).
114
+ function getL1PricingSurplus() external view returns (int256);
115
+
116
+ /// @notice Returns the base charge (in L1 gas) attributed to each data batch in the calldata pricer
117
+ function getPerBatchGasCharge() external view returns (int64);
118
+
119
+ /// @notice Returns the cost amortization cap in basis points
120
+ function getAmortizedCostCapBips() external view returns (uint64);
130
121
  }
@@ -24,9 +24,6 @@ interface ArbOwner {
24
24
  /// @notice Retrieves the list of chain owners
25
25
  function getAllChainOwners() external view returns (address[] memory);
26
26
 
27
- /// @notice Set the L1 basefee estimate directly, bypassing the autoregression
28
- function setL1BaseFeeEstimate(uint256 priceInWei) external;
29
-
30
27
  /// @notice Set how slowly ArbOS updates its estimate of the L1 basefee
31
28
  function setL1BaseFeeEstimateInertia(uint64 inertia) external;
32
29
 
@@ -39,18 +36,6 @@ interface ArbOwner {
39
36
  /// @notice Set the computational speed limit for the chain
40
37
  function setSpeedLimit(uint64 limit) external;
41
38
 
42
- /// @notice Set the number of seconds worth of the speed limit the gas pool contains
43
- function setGasPoolSeconds(uint64 factor) external;
44
-
45
- /// @notice Set the target fullness in bips the pricing model will try to keep the pool at
46
- function setGasPoolTarget(uint64 target) external;
47
-
48
- /// @notice Set the extent in bips to which the pricing model favors filling the pool over increasing speeds
49
- function setGasPoolWeight(uint64 weight) external;
50
-
51
- /// @notice Set how slowly ArbOS updates its estimate the amount of gas being burnt per second
52
- function setRateEstimateInertia(uint64 inertia) external;
53
-
54
39
  /// @notice Set the maximum size a tx (and block) can be
55
40
  function setMaxTxGasLimit(uint64 limit) external;
56
41
 
@@ -69,6 +54,27 @@ interface ArbOwner {
69
54
  /// @notice Upgrades ArbOS to the requested version at the requested timestamp
70
55
  function scheduleArbOSUpgrade(uint64 newVersion, uint64 timestamp) external;
71
56
 
57
+ /// @notice Sets equilibration units parameter for L1 price adjustment algorithm
58
+ function setL1PricingEquilibrationUnits(uint256 equilibrationUnits) external;
59
+
60
+ /// @notice Sets inertia parameter for L1 price adjustment algorithm
61
+ function setL1PricingInertia(uint64 inertia) external;
62
+
63
+ /// @notice Sets reward recipient address for L1 price adjustment algorithm
64
+ function setL1PricingRewardRecipient(address recipient) external;
65
+
66
+ /// @notice Sets reward amount for L1 price adjustment algorithm, in wei per unit
67
+ function setL1PricingRewardRate(uint64 weiPerUnit) external;
68
+
69
+ /// @notice Set how much ArbOS charges per L1 gas spent on transaction data.
70
+ function setL1PricePerUnit(uint256 pricePerUnit) external;
71
+
72
+ /// @notice Sets the base charge (in L1 gas) attributed to each data batch in the calldata pricer
73
+ function setPerBatchGasCharge(int64 cost) external;
74
+
75
+ /// @notice Sets the cost amortization cap in basis points
76
+ function setAmortizedCostCapBips(uint64 cap) external;
77
+
72
78
  // Emitted when a successful call is made to this precompile
73
79
  event OwnerActs(bytes4 indexed method, address indexed owner, bytes data);
74
80
  }
@@ -55,6 +55,13 @@ interface ArbRetryableTx {
55
55
  */
56
56
  function cancel(bytes32 ticketId) external;
57
57
 
58
+ /**
59
+ * @notice Gets the redeemer of the current retryable redeem attempt.
60
+ * Returns the zero address if the current transaction is not a retryable redeem attempt.
61
+ * If this is an auto-redeem, returns the fee refund address of the retryable.
62
+ */
63
+ function getCurrentRedeemer() external view returns (address);
64
+
58
65
  /**
59
66
  * @notice Do not call. This method represents a retryable submission to aid explorers.
60
67
  * Calling it will always revert.
@@ -80,7 +87,9 @@ interface ArbRetryableTx {
80
87
  bytes32 indexed retryTxHash,
81
88
  uint64 indexed sequenceNum,
82
89
  uint64 donatedGas,
83
- address gasDonor
90
+ address gasDonor,
91
+ uint256 maxRefund,
92
+ uint256 submissionFeeRefund
84
93
  );
85
94
  event Canceled(bytes32 indexed ticketId);
86
95
 
@@ -36,13 +36,13 @@ interface ArbSys {
36
36
 
37
37
  /**
38
38
  * @notice Returns 0 since Nitro has no concept of storage gas
39
- * @return int 0
39
+ * @return uint 0
40
40
  */
41
- function getStorageGasAvailable() external returns (uint256);
41
+ function getStorageGasAvailable() external view returns (uint256);
42
42
 
43
43
  /**
44
- * @notice check if current call is coming from l1
45
- * @return true if the caller of this was called directly from L1
44
+ * @notice check if current call is top level (meaning it was triggered by an EoA or a L1 contract)
45
+ * @return true if current execution frame is not a call by another L2 contract
46
46
  */
47
47
  function isTopLevelCall() external view returns (bool);
48
48
 
@@ -26,16 +26,23 @@ interface ArbosActs {
26
26
  /**
27
27
  * @notice ArbOS "calls" this when starting a block
28
28
  * @param l1BaseFee the L1 BaseFee
29
- * @param l2BaseFeeLastBlock the L2 BaseFee in the last block's header
30
29
  * @param l1BlockNumber the L1 block number
31
30
  * @param timePassed number of seconds since the last block
32
31
  */
33
32
  function startBlock(
34
33
  uint256 l1BaseFee,
35
- uint256 l2BaseFeeLastBlock,
36
34
  uint64 l1BlockNumber,
35
+ uint64 l2BlockNumber,
37
36
  uint64 timePassed
38
37
  ) external;
39
38
 
39
+ function batchPostingReport(
40
+ uint256 batchTimestamp,
41
+ address batchPosterAddress,
42
+ uint64 batchNumber,
43
+ uint64 batchDataGas,
44
+ uint256 l1BaseFeeWei
45
+ ) external;
46
+
40
47
  error CallerNotArbOS();
41
48
  }
@@ -9,40 +9,40 @@ import "../bridge/SequencerInbox.sol";
9
9
  import "../bridge/ISequencerInbox.sol";
10
10
  import "../bridge/Inbox.sol";
11
11
  import "../bridge/Outbox.sol";
12
- import "./RollupEventBridge.sol";
12
+ import "./RollupEventInbox.sol";
13
13
 
14
14
  import "../bridge/IBridge.sol";
15
15
  import "@openzeppelin/contracts/access/Ownable.sol";
16
16
  import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
17
17
 
18
18
  contract BridgeCreator is Ownable {
19
- Bridge public delayedBridgeTemplate;
19
+ Bridge public bridgeTemplate;
20
20
  SequencerInbox public sequencerInboxTemplate;
21
21
  Inbox public inboxTemplate;
22
- RollupEventBridge public rollupEventBridgeTemplate;
22
+ RollupEventInbox public rollupEventInboxTemplate;
23
23
  Outbox public outboxTemplate;
24
24
 
25
25
  event TemplatesUpdated();
26
26
 
27
27
  constructor() Ownable() {
28
- delayedBridgeTemplate = new Bridge();
28
+ bridgeTemplate = new Bridge();
29
29
  sequencerInboxTemplate = new SequencerInbox();
30
30
  inboxTemplate = new Inbox();
31
- rollupEventBridgeTemplate = new RollupEventBridge();
31
+ rollupEventInboxTemplate = new RollupEventInbox();
32
32
  outboxTemplate = new Outbox();
33
33
  }
34
34
 
35
35
  function updateTemplates(
36
- address _delayedBridgeTemplate,
36
+ address _bridgeTemplate,
37
37
  address _sequencerInboxTemplate,
38
38
  address _inboxTemplate,
39
- address _rollupEventBridgeTemplate,
39
+ address _rollupEventInboxTemplate,
40
40
  address _outboxTemplate
41
41
  ) external onlyOwner {
42
- delayedBridgeTemplate = Bridge(_delayedBridgeTemplate);
42
+ bridgeTemplate = Bridge(_bridgeTemplate);
43
43
  sequencerInboxTemplate = SequencerInbox(_sequencerInboxTemplate);
44
44
  inboxTemplate = Inbox(_inboxTemplate);
45
- rollupEventBridgeTemplate = RollupEventBridge(_rollupEventBridgeTemplate);
45
+ rollupEventInboxTemplate = RollupEventInbox(_rollupEventInboxTemplate);
46
46
  outboxTemplate = Outbox(_outboxTemplate);
47
47
 
48
48
  emit TemplatesUpdated();
@@ -50,10 +50,10 @@ contract BridgeCreator is Ownable {
50
50
 
51
51
  struct CreateBridgeFrame {
52
52
  ProxyAdmin admin;
53
- Bridge delayedBridge;
53
+ Bridge bridge;
54
54
  SequencerInbox sequencerInbox;
55
55
  Inbox inbox;
56
- RollupEventBridge rollupEventBridge;
56
+ RollupEventInbox rollupEventInbox;
57
57
  Outbox outbox;
58
58
  }
59
59
 
@@ -67,16 +67,14 @@ contract BridgeCreator is Ownable {
67
67
  Bridge,
68
68
  SequencerInbox,
69
69
  Inbox,
70
- RollupEventBridge,
70
+ RollupEventInbox,
71
71
  Outbox
72
72
  )
73
73
  {
74
74
  CreateBridgeFrame memory frame;
75
75
  {
76
- frame.delayedBridge = Bridge(
77
- address(
78
- new TransparentUpgradeableProxy(address(delayedBridgeTemplate), adminProxy, "")
79
- )
76
+ frame.bridge = Bridge(
77
+ address(new TransparentUpgradeableProxy(address(bridgeTemplate), adminProxy, ""))
80
78
  );
81
79
  frame.sequencerInbox = SequencerInbox(
82
80
  address(
@@ -86,10 +84,10 @@ contract BridgeCreator is Ownable {
86
84
  frame.inbox = Inbox(
87
85
  address(new TransparentUpgradeableProxy(address(inboxTemplate), adminProxy, ""))
88
86
  );
89
- frame.rollupEventBridge = RollupEventBridge(
87
+ frame.rollupEventInbox = RollupEventInbox(
90
88
  address(
91
89
  new TransparentUpgradeableProxy(
92
- address(rollupEventBridgeTemplate),
90
+ address(rollupEventInboxTemplate),
93
91
  adminProxy,
94
92
  ""
95
93
  )
@@ -100,20 +98,17 @@ contract BridgeCreator is Ownable {
100
98
  );
101
99
  }
102
100
 
103
- frame.delayedBridge.initialize();
104
- frame.sequencerInbox.initialize(IBridge(frame.delayedBridge), rollup, maxTimeVariation);
105
- frame.inbox.initialize(IBridge(frame.delayedBridge));
106
- frame.rollupEventBridge.initialize(address(frame.delayedBridge), rollup);
107
- frame.outbox.initialize(rollup, IBridge(frame.delayedBridge));
108
-
109
- frame.delayedBridge.setInbox(address(frame.inbox), true);
110
- frame.delayedBridge.transferOwnership(rollup);
101
+ frame.bridge.initialize(IOwnable(rollup));
102
+ frame.sequencerInbox.initialize(IBridge(frame.bridge), maxTimeVariation);
103
+ frame.inbox.initialize(IBridge(frame.bridge), ISequencerInbox(frame.sequencerInbox));
104
+ frame.rollupEventInbox.initialize(IBridge(frame.bridge));
105
+ frame.outbox.initialize(IBridge(frame.bridge));
111
106
 
112
107
  return (
113
- frame.delayedBridge,
108
+ frame.bridge,
114
109
  frame.sequencerInbox,
115
110
  frame.inbox,
116
- frame.rollupEventBridge,
111
+ frame.rollupEventInbox,
117
112
  frame.outbox
118
113
  );
119
114
  }
@@ -59,13 +59,13 @@ interface IRollupCore {
59
59
 
60
60
  function wasmModuleRoot() external view returns (bytes32);
61
61
 
62
- function delayedBridge() external view returns (IBridge);
62
+ function bridge() external view returns (IBridge);
63
63
 
64
- function sequencerBridge() external view returns (ISequencerInbox);
64
+ function sequencerInbox() external view returns (ISequencerInbox);
65
65
 
66
66
  function outbox() external view returns (IOutbox);
67
67
 
68
- function rollupEventBridge() external view returns (IRollupEventBridge);
68
+ function rollupEventInbox() external view returns (IRollupEventInbox);
69
69
 
70
70
  function challengeManager() external view returns (IChallengeManager);
71
71
 
@@ -6,10 +6,10 @@ pragma solidity ^0.8.0;
6
6
 
7
7
  import "../bridge/IBridge.sol";
8
8
 
9
- interface IRollupEventBridge {
9
+ interface IRollupEventInbox {
10
10
  function bridge() external view returns (IBridge);
11
11
 
12
- function initialize(address _bridge, address _rollup) external;
12
+ function initialize(IBridge _bridge) external;
13
13
 
14
14
  function rollup() external view returns (address);
15
15
 
@@ -8,8 +8,9 @@ import "./RollupLib.sol";
8
8
  import "./IRollupCore.sol";
9
9
  import "../bridge/ISequencerInbox.sol";
10
10
  import "../bridge/IOutbox.sol";
11
+ import "../bridge/IOwnable.sol";
11
12
 
12
- interface IRollupUserAbs is IRollupCore {
13
+ interface IRollupUserAbs is IRollupCore, IOwnable {
13
14
  /// @dev the user logic just validated configuration and shouldn't write to state during init
14
15
  /// this allows the admin logic to ensure consistency on parameters.
15
16
  function initialize(address stakeToken) external view;
@@ -52,7 +53,18 @@ interface IRollupUserAbs is IRollupCore {
52
53
 
53
54
  function requireUnresolved(uint256 nodeNum) external view;
54
55
 
55
- function withdrawStakerFunds(address payable destination) external returns (uint256);
56
+ function withdrawStakerFunds() external returns (uint256);
57
+
58
+ function createChallenge(
59
+ address[2] calldata stakers,
60
+ uint64[2] calldata nodeNums,
61
+ MachineStatus[2] calldata machineStatuses,
62
+ GlobalState[2] calldata globalStates,
63
+ uint64 numBlocks,
64
+ bytes32 secondExecutionHash,
65
+ uint256[2] calldata proposedTimes,
66
+ bytes32[2] calldata wasmModuleRoots
67
+ ) external;
56
68
  }
57
69
 
58
70
  interface IRollupUser is IRollupUserAbs {
@@ -107,7 +119,7 @@ interface IRollupAdmin {
107
119
  * @param _inbox Inbox contract to add or remove
108
120
  * @param _enabled New status of inbox
109
121
  */
110
- function setInbox(address _inbox, bool _enabled) external;
122
+ function setDelayedInbox(address _inbox, bool _enabled) external;
111
123
 
112
124
  /**
113
125
  * @notice Pause interaction with the rollup contract
@@ -166,21 +178,6 @@ interface IRollupAdmin {
166
178
  */
167
179
  function setStakeToken(address newStakeToken) external;
168
180
 
169
- /**
170
- * @notice Set max time variation from actual time for sequencer inbox
171
- * @param maxTimeVariation the maximum time variation parameters
172
- */
173
- function setSequencerInboxMaxTimeVariation(
174
- ISequencerInbox.MaxTimeVariation memory maxTimeVariation
175
- ) external;
176
-
177
- /**
178
- * @notice Updates whether an address is authorized to be a batch poster at the sequencer inbox
179
- * @param addr the address
180
- * @param isBatchPoster if the specified address should be authorized as a batch poster
181
- */
182
- function setIsBatchPoster(address addr, bool isBatchPoster) external;
183
-
184
181
  /**
185
182
  * @notice Upgrades the implementation of a beacon controlled by the rollup
186
183
  * @param beacon address of beacon to be upgraded
@@ -212,4 +209,10 @@ interface IRollupAdmin {
212
209
  * @param newWasmModuleRoot new module root
213
210
  */
214
211
  function setWasmModuleRoot(bytes32 newWasmModuleRoot) external;
212
+
213
+ /**
214
+ * @notice set a new sequencer inbox contract
215
+ * @param _sequencerInbox new address of sequencer inbox
216
+ */
217
+ function setSequencerInbox(address _sequencerInbox) external;
215
218
  }