Commit 3ba1ff7c authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: hacky patch for CI failures (#9081)

* contracts-bedrock: hacky patch for CI failures

CI is consistently failing due to the L2 genesis generation happening
out of process using ffi. Ideally the genesis state could be ran a
single time once outside of the process ahead of time but the problem
with this approach is that the deployer nonce is not correct and the
L1 contract addresses in practice end up not matching the addresses
that are injected into the L2 genesis state. There are a few solutions
to this problem, one is deploying the proxies with create2 and another
is to ensure that the deployer does not deploy additional contracts
in the test case setup that are not deployed in the L1 genesis gen
setup so that we are guaranteed that the contracts have the same
addresses.

This is a hacky patch to attempt to fix the issue where it will wait
if the allocs file doesn't exist. Something with the process running in
parallel causes the file to not exist. The downside of this fix is that
CI may hang silently forever if the file is lost for some reason.

Another solution would be to return the JSON to solidity and then write
it to a temp file. This isn't ideal but could work in the short term.
We are working on a rewrite of the L2 genesis generation in solidity
that will fix this issue along with many other devex issues in the
monorepo.

* ctb: update gas snapshot
parent 51425468
...@@ -8,4 +8,4 @@ GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (g ...@@ -8,4 +8,4 @@ GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (g
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 86629) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 86629)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68450) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68450)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68899) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68899)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 153501) GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 153493)
\ No newline at end of file \ No newline at end of file
...@@ -146,6 +146,12 @@ contract Setup { ...@@ -146,6 +146,12 @@ contract Setup {
args[2] = string.concat(vm.projectRoot(), "/scripts/generate-l2-genesis.sh"); args[2] = string.concat(vm.projectRoot(), "/scripts/generate-l2-genesis.sh");
vm.ffi(args); vm.ffi(args);
} }
// Prevent race condition where the genesis.json file is not yet created
while (vm.isFile(allocsPath) == false) {
vm.sleep(1);
}
vm.loadAllocs(allocsPath); vm.loadAllocs(allocsPath);
// Set the governance token's owner to be the final system owner // Set the governance token's owner to be the final system owner
......
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