Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions op-chain-ops/deployer/opcm/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ type DeployOPChainInput struct {
Proposer common.Address
Challenger common.Address

BasefeeScalar uint32
BlobBaseFeeScalar uint32
L2ChainId *big.Int
OpcmProxy common.Address
SaltMixer string
GasLimit uint64
BasefeeScalar uint32
BlobBaseFeeScalar uint32
L2ChainId *big.Int
OpcmProxy common.Address
SaltMixer string
GasLimit uint64
EIP1559Denominator uint32
EIP1559Elasticity uint32

DisputeGameType uint32
DisputeAbsolutePrestate common.Hash
Expand Down Expand Up @@ -133,6 +135,8 @@ type opcmDeployInput struct {
StartingAnchorRoots []byte
SaltMixer string
GasLimit uint64
EIP1559Denominator uint32
EIP1559Elasticity uint32
DisputeGameType uint32
DisputeAbsolutePrestate common.Hash
DisputeMaxGameDepth *big.Int
Expand Down Expand Up @@ -259,6 +263,8 @@ func DeployOPChainRaw(
StartingAnchorRoots: input.StartingAnchorRoots(),
SaltMixer: input.SaltMixer,
GasLimit: input.GasLimit,
EIP1559Denominator: input.EIP1559Denominator,
EIP1559Elasticity: input.EIP1559Elasticity,
DisputeGameType: input.DisputeGameType,
DisputeAbsolutePrestate: input.DisputeAbsolutePrestate,
DisputeMaxGameDepth: new(big.Int).SetUint64(input.DisputeMaxGameDepth),
Expand Down
2 changes: 2 additions & 0 deletions op-chain-ops/deployer/pipeline/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
OpcmProxy: st.ImplementationsDeployment.OpcmProxyAddress,
SaltMixer: st.Create2Salt.String(), // passing through salt generated at state initialization
GasLimit: 30_000_000,
EIP1559Denominator: 250,
EIP1559Elasticity: 6,
DisputeGameType: 1, // PERMISSIONED_CANNON Game Type
DisputeAbsolutePrestate: common.HexToHash("0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"),
DisputeMaxGameDepth: 73,
Expand Down
2 changes: 2 additions & 0 deletions op-chain-ops/interopgen/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
OpcmProxy: superDeployment.OpcmProxy,
SaltMixer: cfg.SaltMixer,
GasLimit: cfg.GasLimit,
EIP1559Denominator: uint32(cfg.EIP1559Denominator),
EIP1559Elasticity: uint32(cfg.EIP1559Elasticity),
DisputeGameType: cfg.DisputeGameType,
DisputeAbsolutePrestate: cfg.DisputeAbsolutePrestate,
DisputeMaxGameDepth: cfg.DisputeMaxGameDepth,
Expand Down
18 changes: 9 additions & 9 deletions packages/contracts-bedrock/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchm
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099)
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369242)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967382)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564356)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076571)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467019)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512723)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72618)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369350)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967490)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564464)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076679)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 466998)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512702)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72661)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92973)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68357)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68921)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68422)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68986)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155610)
34 changes: 18 additions & 16 deletions packages/contracts-bedrock/scripts/DeployImplementations.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -369,24 +369,26 @@ contract DeployImplementationsOutput is BaseDeployIO {
require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50");
require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60");
require(systemConfig.gasLimit() == 1, "SYSCON-70");
require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80");
require(systemConfig.eip1559Denominator() == 1, "SYSCON-80");
require(systemConfig.eip1559Elasticity() == 1, "SYSCON-90");
require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-100");

IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig();
require(resourceConfig.maxResourceLimit == 1, "SYSCON-90");
require(resourceConfig.elasticityMultiplier == 1, "SYSCON-100");
require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-110");
require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120");
require(resourceConfig.minimumBaseFee == 0, "SYSCON-130");
require(resourceConfig.maximumBaseFee == 0, "SYSCON-140");

require(systemConfig.startBlock() == type(uint256).max, "SYSCON-150");
require(systemConfig.batchInbox() == address(0), "SYSCON-160");
require(systemConfig.l1CrossDomainMessenger() == address(0), "SYSCON-170");
require(systemConfig.l1ERC721Bridge() == address(0), "SYSCON-180");
require(systemConfig.l1StandardBridge() == address(0), "SYSCON-190");
require(systemConfig.disputeGameFactory() == address(0), "SYSCON-200");
require(systemConfig.optimismPortal() == address(0), "SYSCON-210");
require(systemConfig.optimismMintableERC20Factory() == address(0), "SYSCON-220");
require(resourceConfig.maxResourceLimit == 1, "SYSCON-110");
require(resourceConfig.elasticityMultiplier == 1, "SYSCON-120");
require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-130");
require(resourceConfig.systemTxMaxGas == 0, "SYSCON-140");
require(resourceConfig.minimumBaseFee == 0, "SYSCON-150");
require(resourceConfig.maximumBaseFee == 0, "SYSCON-160");

require(systemConfig.startBlock() == type(uint256).max, "SYSCON-170");
require(systemConfig.batchInbox() == address(0), "SYSCON-180");
require(systemConfig.l1CrossDomainMessenger() == address(0), "SYSCON-190");
require(systemConfig.l1ERC721Bridge() == address(0), "SYSCON-200");
require(systemConfig.l1StandardBridge() == address(0), "SYSCON-210");
require(systemConfig.disputeGameFactory() == address(0), "SYSCON-220");
require(systemConfig.optimismPortal() == address(0), "SYSCON-230");
require(systemConfig.optimismMintableERC20Factory() == address(0), "SYSCON-240");
}

function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view {
Expand Down
16 changes: 16 additions & 0 deletions packages/contracts-bedrock/scripts/DeployOPChain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ contract DeployOPChainInput is BaseDeployIO {
OPContractsManager internal _opcmProxy;
string internal _saltMixer;
uint64 internal _gasLimit;
uint32 internal _eip1559Denominator;
uint32 internal _eip1559Elasticity;

// Configurable dispute game inputs
GameType internal _disputeGameType;
Expand Down Expand Up @@ -80,6 +82,10 @@ contract DeployOPChainInput is BaseDeployIO {
_l2ChainId = _value;
} else if (_sel == this.gasLimit.selector) {
_gasLimit = SafeCast.toUint64(_value);
} else if (_sel == this.eip1559Denominator.selector) {
_eip1559Denominator = SafeCast.toUint32(_value);
} else if (_sel == this.eip1559Elasticity.selector) {
_eip1559Elasticity = SafeCast.toUint32(_value);
} else if (_sel == this.disputeGameType.selector) {
_disputeGameType = GameType.wrap(SafeCast.toUint32(_value));
} else if (_sel == this.disputeMaxGameDepth.selector) {
Expand Down Expand Up @@ -187,6 +193,14 @@ contract DeployOPChainInput is BaseDeployIO {
return _gasLimit;
}

function eip1559Denominator() public view returns (uint32) {
return _eip1559Denominator;
}

function eip1559Elasticity() public view returns (uint32) {
return _eip1559Elasticity;
}

function disputeGameType() public view returns (GameType) {
return _disputeGameType;
}
Expand Down Expand Up @@ -570,6 +584,8 @@ contract DeployOPChain is Script {
startingAnchorRoots: _doi.startingAnchorRoots(),
saltMixer: _doi.saltMixer(),
gasLimit: _doi.gasLimit(),
eip1559Denominator: _doi.eip1559Denominator(),
eip1559Elasticity: _doi.eip1559Elasticity(),
disputeGameType: _doi.disputeGameType(),
disputeAbsolutePrestate: _doi.disputeAbsolutePrestate(),
disputeMaxGameDepth: _doi.disputeMaxGameDepth(),
Expand Down
21 changes: 12 additions & 9 deletions packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,15 @@ contract Deploy is Deployer {
}

IProxyAdmin proxyAdmin = IProxyAdmin(payable(mustGetAddress("ProxyAdmin")));
ISystemConfig.Addresses memory addresses = ISystemConfig.Addresses({
l1CrossDomainMessenger: mustGetAddress("L1CrossDomainMessengerProxy"),
l1ERC721Bridge: mustGetAddress("L1ERC721BridgeProxy"),
l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"),
disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"),
optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
gasPayingToken: customGasTokenAddress
});
proxyAdmin.upgradeAndCall({
_proxy: payable(systemConfigProxy),
_implementation: systemConfig,
Expand All @@ -1091,18 +1100,12 @@ contract Deploy is Deployer {
cfg.blobbasefeeScalar(),
batcherHash,
uint64(cfg.l2GenesisBlockGasLimit()),
uint32(cfg.eip1559Denominator()),
uint32(cfg.eip1559Elasticity()),
cfg.p2pSequencerAddress(),
Constants.DEFAULT_RESOURCE_CONFIG(),
cfg.batchInboxAddress(),
ISystemConfig.Addresses({
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stack too deep.

l1CrossDomainMessenger: mustGetAddress("L1CrossDomainMessengerProxy"),
l1ERC721Bridge: mustGetAddress("L1ERC721BridgeProxy"),
l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"),
disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"),
optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
gasPayingToken: customGasTokenAddress
})
addresses
)
)
});
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OPContractsManager.sol": {
"initCodeHash": "0xd58cb3978affc5c1457cdd498ff8420c90aef804d4c3b62cf42ab2691986d6d2",
"sourceCodeHash": "0x7bfa6eff76176649fe600303cd60009a0f6e282cbaec55836b5ea1f8875cbeb5"
"initCodeHash": "0xeb453dfe363ca345779b8671278c99542df651c0f465ba0ff9500bad369ecec0",
"sourceCodeHash": "0x8d4620523fa18d0ce8cbae546a698f9d6cdfa613fc21d33b8c178bdfb8e4b0b6"
},
"src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
Expand All @@ -48,12 +48,12 @@
"sourceCodeHash": "0x39489a85bc3a5c8560f82d41b31bf7fe22f5b648f4ed538f61695a73092ea9eb"
},
"src/L1/SystemConfig.sol": {
"initCodeHash": "0x2fc36af5b3c493a423a19e0b597f6ff230b756b861b68099f3192d69b6088dc0",
"sourceCodeHash": "0x06a50ac992175fdb434b13e8461893e83862c23ce399e697e6e8109728ad1a3d"
"initCodeHash": "0x983d2115e57a76911d3756a18240bbd75a96814a628181e967a681b440a047e3",
"sourceCodeHash": "0x5e7d3348673d315ae18294611a842ff6c3db833db8fc1d850c19ad50af416584"
},
"src/L1/SystemConfigInterop.sol": {
"initCodeHash": "0x7515e5ed1266412a8c2d27d99aba6266fda2fc9068c20f0b7e6b555ee5073c91",
"sourceCodeHash": "0x441d1e3e8e987f829f55996b5b6c850da8c59ad48f09cf7e0a69a1fa559d42a2"
"initCodeHash": "0x94fcdc582016cc51882454cb440c8a63217625c7768cb23c2294b01fc7ce830f",
"sourceCodeHash": "0x18005ac296708248b59fbe1f3c24dc35aa24ed5d8e4413c15acc1b43970bb04c"
},
"src/L2/BaseFeeVault.sol": {
"initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@
"name": "gasLimit",
"type": "uint64"
},
{
"internalType": "uint32",
"name": "eip1559Denominator",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "eip1559Elasticity",
"type": "uint32"
},
{
"internalType": "GameType",
"name": "disputeGameType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@
"name": "gasLimit",
"type": "uint64"
},
{
"internalType": "uint32",
"name": "eip1559Denominator",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "eip1559Elasticity",
"type": "uint32"
},
{
"internalType": "GameType",
"name": "disputeGameType",
Expand Down
54 changes: 54 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/SystemConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,32 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "eip1559Denominator",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "eip1559Elasticity",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasLimit",
Expand Down Expand Up @@ -283,6 +309,16 @@
"name": "_gasLimit",
"type": "uint64"
},
{
"internalType": "uint32",
"name": "_eip1559Denominator",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "_eip1559Elasticity",
"type": "uint32"
},
{
"internalType": "address",
"name": "_unsafeBlockSigner",
Expand Down Expand Up @@ -586,6 +622,24 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_denominator",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "_elasticity",
"type": "uint32"
}
],
"name": "setEIP1559Params",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
Loading