Commit 80afbbdc authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: fix deposit gas limit (#10449)

* contracts-bedrock: fix deposit gas limit

Ensures that the gas limit is high enough for the system
deposit to go through. The previous gas limit was slightly
too small. This ups it so that we are sure the system deposit
goes through.

* contracts-bedrock: fix test
parent b9eb669a
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
"sourceCodeHash": "0xf5fcf570721e25459fadbb37e02f9efe349e1c8afcbf1e3b5fdb09c9f612cdc0" "sourceCodeHash": "0xf5fcf570721e25459fadbb37e02f9efe349e1c8afcbf1e3b5fdb09c9f612cdc0"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0x8ca0ac98c37ad221d679c744b295b1b38742bfebac050f789197d658951709f5", "initCodeHash": "0xc820f7434345b665a77bc17e8b486ba97b7ff9845d336a51f024a41599c4c155",
"sourceCodeHash": "0x8e9221539290a9b3cfb933d30ab77b137e2a76a1481671e41469ed1014ffbdc4" "sourceCodeHash": "0x3d0e9dc8ed75b6f2e59444e9204341b18d343af02d6e37ecd9f759da2c8c118b"
}, },
"src/L1/OptimismPortal2.sol": { "src/L1/OptimismPortal2.sol": {
"initCodeHash": "0xea32d79e8297956d4f9a4c7985bb53ff8bb3735e5b307d4e118fea71f503a38e", "initCodeHash": "0xea32d79e8297956d4f9a4c7985bb53ff8bb3735e5b307d4e118fea71f503a38e",
......
...@@ -45,7 +45,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -45,7 +45,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
uint64 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000; uint64 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000;
/// @notice The L2 gas limit for system deposit transactions that are initiated from L1. /// @notice The L2 gas limit for system deposit transactions that are initiated from L1.
uint32 internal constant SYSTEM_DEPOSIT_GAS_LIMIT = 80_000; uint32 internal constant SYSTEM_DEPOSIT_GAS_LIMIT = 200_000;
/// @notice Address of the L2 account which initiated a withdrawal in this transaction. /// @notice Address of the L2 account which initiated a withdrawal in this transaction.
/// If the of this variable is the default L2 sender address, then we are NOT inside of /// If the of this variable is the default L2 sender address, then we are NOT inside of
...@@ -128,8 +128,8 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -128,8 +128,8 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.7.0 /// @custom:semver 2.8.0
string public constant version = "2.7.0"; string public constant version = "2.8.0";
/// @notice Constructs the OptimismPortal contract. /// @notice Constructs the OptimismPortal contract.
constructor() { constructor() {
......
...@@ -460,7 +460,7 @@ contract OptimismPortal_Test is CommonTest { ...@@ -460,7 +460,7 @@ contract OptimismPortal_Test is CommonTest {
abi.encodePacked( abi.encodePacked(
uint256(0), // mint uint256(0), // mint
uint256(0), // value uint256(0), // value
uint64(80000), // gasLimit uint64(200_000), // gasLimit
false, // isCreation, false, // isCreation,
abi.encodeCall(L1Block.setGasPayingToken, (_token, _decimals, _name, _symbol)) abi.encodeCall(L1Block.setGasPayingToken, (_token, _decimals, _name, _symbol))
) )
......
...@@ -356,7 +356,7 @@ contract SystemConfig_Init_CustomGasToken is SystemConfig_Init { ...@@ -356,7 +356,7 @@ contract SystemConfig_Init_CustomGasToken is SystemConfig_Init {
abi.encodePacked( abi.encodePacked(
uint256(0), // mint uint256(0), // mint
uint256(0), // value uint256(0), // value
uint64(80000), // gasLimit uint64(200_000), // gasLimit
false, // isCreation, false, // isCreation,
abi.encodeCall(L1Block.setGasPayingToken, (address(token), 18, bytes32("Silly"), bytes32("SIL"))) abi.encodeCall(L1Block.setGasPayingToken, (address(token), 18, bytes32("Silly"), bytes32("SIL")))
) )
...@@ -467,7 +467,7 @@ contract SystemConfig_Setters_TestFail is SystemConfig_Init { ...@@ -467,7 +467,7 @@ contract SystemConfig_Setters_TestFail is SystemConfig_Init {
contract SystemConfig_Setters_Test is SystemConfig_Init { contract SystemConfig_Setters_Test is SystemConfig_Init {
/// @dev Tests that `setBatcherHash` updates the batcher hash successfully. /// @dev Tests that `setBatcherHash` updates the batcher hash successfully.
function testFuzz_setBatcherHash_succeeds(bytes32 newBatcherHash) external { function testFuzz_setBatcherHash_succeeds(bytes32 newBatcherHash) external {
vm.expectEmit(true, true, true, true); vm.expectEmit(address(systemConfig));
emit ConfigUpdate(0, SystemConfig.UpdateType.BATCHER, abi.encode(newBatcherHash)); emit ConfigUpdate(0, SystemConfig.UpdateType.BATCHER, abi.encode(newBatcherHash));
vm.prank(systemConfig.owner()); vm.prank(systemConfig.owner());
...@@ -477,7 +477,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init { ...@@ -477,7 +477,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init {
/// @dev Tests that `setGasConfig` updates the overhead and scalar successfully. /// @dev Tests that `setGasConfig` updates the overhead and scalar successfully.
function testFuzz_setGasConfig_succeeds(uint256 newOverhead, uint256 newScalar) external { function testFuzz_setGasConfig_succeeds(uint256 newOverhead, uint256 newScalar) external {
vm.expectEmit(true, true, true, true); vm.expectEmit(address(systemConfig));
emit ConfigUpdate(0, SystemConfig.UpdateType.GAS_CONFIG, abi.encode(newOverhead, newScalar)); emit ConfigUpdate(0, SystemConfig.UpdateType.GAS_CONFIG, abi.encode(newOverhead, newScalar));
vm.prank(systemConfig.owner()); vm.prank(systemConfig.owner());
...@@ -491,7 +491,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init { ...@@ -491,7 +491,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init {
uint64 minimumGasLimit = systemConfig.minimumGasLimit(); uint64 minimumGasLimit = systemConfig.minimumGasLimit();
newGasLimit = uint64(bound(uint256(newGasLimit), uint256(minimumGasLimit), uint256(type(uint64).max))); newGasLimit = uint64(bound(uint256(newGasLimit), uint256(minimumGasLimit), uint256(type(uint64).max)));
vm.expectEmit(true, true, true, true); vm.expectEmit(address(systemConfig));
emit ConfigUpdate(0, SystemConfig.UpdateType.GAS_LIMIT, abi.encode(newGasLimit)); emit ConfigUpdate(0, SystemConfig.UpdateType.GAS_LIMIT, abi.encode(newGasLimit));
vm.prank(systemConfig.owner()); vm.prank(systemConfig.owner());
...@@ -501,7 +501,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init { ...@@ -501,7 +501,7 @@ contract SystemConfig_Setters_Test is SystemConfig_Init {
/// @dev Tests that `setUnsafeBlockSigner` updates the block signer successfully. /// @dev Tests that `setUnsafeBlockSigner` updates the block signer successfully.
function testFuzz_setUnsafeBlockSigner_succeeds(address newUnsafeSigner) external { function testFuzz_setUnsafeBlockSigner_succeeds(address newUnsafeSigner) external {
vm.expectEmit(true, true, true, true); vm.expectEmit(address(systemConfig));
emit ConfigUpdate(0, SystemConfig.UpdateType.UNSAFE_BLOCK_SIGNER, abi.encode(newUnsafeSigner)); emit ConfigUpdate(0, SystemConfig.UpdateType.UNSAFE_BLOCK_SIGNER, abi.encode(newUnsafeSigner));
vm.prank(systemConfig.owner()); vm.prank(systemConfig.owner());
......
...@@ -21,7 +21,7 @@ contract DeploymentSummary is DeploymentSummaryCode { ...@@ -21,7 +21,7 @@ contract DeploymentSummary is DeploymentSummaryCode {
address internal constant l1StandardBridgeProxyAddress = 0x0c8b5822b6e02CDa722174F19A1439A7495a3fA6; address internal constant l1StandardBridgeProxyAddress = 0x0c8b5822b6e02CDa722174F19A1439A7495a3fA6;
address internal constant l2OutputOracleAddress = 0x19652082F846171168Daf378C4fD3ee85a0D4A60; address internal constant l2OutputOracleAddress = 0x19652082F846171168Daf378C4fD3ee85a0D4A60;
address internal constant l2OutputOracleProxyAddress = 0x8B71b41D4dBEb2b6821d44692d3fACAAf77480Bb; address internal constant l2OutputOracleProxyAddress = 0x8B71b41D4dBEb2b6821d44692d3fACAAf77480Bb;
address internal constant optimismPortalAddress = 0xA45db41D98295c8E260dc2000d2a119A11174C82; address internal constant optimismPortalAddress = 0xb7B7121AEcAd4F33131222efFFA34aB6c382ef4c;
address internal constant optimismPortalProxyAddress = 0x978e3286EB805934215a88694d80b09aDed68D90; address internal constant optimismPortalProxyAddress = 0x978e3286EB805934215a88694d80b09aDed68D90;
address internal constant protocolVersionsAddress = 0xfbfD64a6C0257F613feFCe050Aa30ecC3E3d7C3F; address internal constant protocolVersionsAddress = 0xfbfD64a6C0257F613feFCe050Aa30ecC3E3d7C3F;
address internal constant protocolVersionsProxyAddress = 0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6; address internal constant protocolVersionsProxyAddress = 0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6;
...@@ -437,7 +437,7 @@ contract DeploymentSummary is DeploymentSummaryCode { ...@@ -437,7 +437,7 @@ contract DeploymentSummary is DeploymentSummaryCode {
value = hex"000000000000000000000000000000000000000000000000000000000000000a"; value = hex"000000000000000000000000000000000000000000000000000000000000000a";
vm.store(systemOwnerSafeAddress, slot, value); vm.store(systemOwnerSafeAddress, slot, value);
slot = hex"360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"; slot = hex"360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
value = hex"000000000000000000000000a45db41d98295c8e260dc2000d2a119a11174c82"; value = hex"000000000000000000000000b7b7121aecad4f33131222efffa34ab6c382ef4c";
vm.store(optimismPortalProxyAddress, slot, value); vm.store(optimismPortalProxyAddress, slot, value);
slot = hex"0000000000000000000000000000000000000000000000000000000000000000"; slot = hex"0000000000000000000000000000000000000000000000000000000000000000";
value = hex"0000000000000000000000000000000000000000000000000000000000000001"; value = hex"0000000000000000000000000000000000000000000000000000000000000001";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment