Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
785eaf4
fix: contracts compiler errors
0xDiscotech Aug 6, 2024
9ef55a2
feat: create some set l1 block values ithmus test
0xDiscotech Aug 7, 2024
0567b20
chore: checkpoint debugging test
0xDiscotech Aug 7, 2024
7ee2530
fix: contracts compiler errors
0xDiscotech Aug 6, 2024
9fd174e
feat: create some set l1 block values ithmus test
0xDiscotech Aug 7, 2024
c86657f
chore: checkpoint debugging test
0xDiscotech Aug 7, 2024
63b9190
refactor: call public function
0xDiscotech Aug 7, 2024
7a74aaa
Merge branch 'feat/ban-deposits-interop' of github-defi:defi-wonderla…
0xDiscotech Aug 7, 2024
43fb36e
fix: update is deposit var storage slot
0xDiscotech Aug 7, 2024
dea7432
chore: update l2 cross inbox tests with the new is deposit check
0xDiscotech Aug 7, 2024
840de88
refactor: set is deposit as an unstructured storage slot var
0xDiscotech Aug 7, 2024
e758d9a
feat: add missing natspec
0xDiscotech Aug 7, 2024
49a02ff
feat: update semver
0xDiscotech Aug 7, 2024
eafba7a
chore: enhance natspec
0xDiscotech Aug 7, 2024
e162361
chore: underscore slot constant name
0xDiscotech Aug 7, 2024
fb0f259
Revert "chore: underscore slot constant name"
0xDiscotech Aug 7, 2024
acdd5d4
Merge branch 'feat/ban-deposits-interop' of github-defi:ethereum-opti…
0xDiscotech Aug 12, 2024
f5afb3b
chore: enhance l1 block test
0xDiscotech Aug 12, 2024
231a0c7
refactor: move the new isthmus logic to the l1 block interop contract
0xDiscotech Aug 12, 2024
9188772
refactor: functions order
0xDiscotech Aug 12, 2024
8c153d5
Merge branch 'feat/ban-deposits-interop' of github-defi:ethereum-opti…
0xDiscotech Aug 12, 2024
58ff74d
feat: benchmark set values ecotone and isthmus functions
0xDiscotech Aug 12, 2024
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
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
+GasBenchMark_L1BlockInterop:test_setL1BlockValuesEcotone_benchmark() (gas: 18858)
+GasBenchMark_L1BlockInterop:test_setL1BlockValuesIsthmus_benchmark() (gas: 40967)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369356)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967496)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564483)
Expand Down
33 changes: 33 additions & 0 deletions packages/contracts-bedrock/test/BenchmarkTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol";
import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
import { Types } from "src/libraries/Types.sol";
import { L1BlockInterop } from "src/L2/L1BlockInterop.sol";

// Free function for setting the prevBaseFee param in the OptimismPortal.
function setPrevBaseFee(Vm _vm, address _op, uint128 _prevBaseFee) {
Expand Down Expand Up @@ -209,3 +210,35 @@ contract GasBenchMark_L2OutputOracle is CommonTest {
l2OutputOracle.proposeL2Output(nonZeroHash, nextBlockNumber, 0, 0);
}
}

contract GasBenchMark_L1BlockInterop is CommonTest {
L1BlockInterop l1BlockInterop;
address depositor;
bytes setValuesEcotoneCalldata;

function setUp() public override {
super.setUp();
depositor = l1Block.DEPOSITOR_ACCOUNT();
l1BlockInterop = new L1BlockInterop();
setValuesEcotoneCalldata = abi.encodePacked(
type(uint32).max,
type(uint32).max,
type(uint64).max,
type(uint64).max,
type(uint64).max,
type(uint256).max,
type(uint256).max,
keccak256(abi.encode(1)),
bytes32(type(uint256).max)
);
vm.startPrank(depositor);
}

function test_setL1BlockValuesEcotone_benchmark() external {
address(l1BlockInterop).call(abi.encodeWithSelector(l1BlockInterop.setL1BlockValuesEcotone.selector));
}

function test_setL1BlockValuesIsthmus_benchmark() external {
address(l1BlockInterop).call(abi.encodeWithSelector(l1BlockInterop.setL1BlockValuesIsthmus.selector));
}
}