Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
78ba73e7
Unverified
Commit
78ba73e7
authored
Nov 28, 2023
by
Mark Tyneway
Committed by
GitHub
Nov 28, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8312 from ethereum-optimism/feat/fix-contract-tests-race
ctb: Fix data race in generate-l2-genesis
parents
bcf697d6
9bb13a09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
generate-l2-genesis.sh
packages/contracts-bedrock/scripts/generate-l2-genesis.sh
+15
-0
No files found.
packages/contracts-bedrock/scripts/generate-l2-genesis.sh
View file @
78ba73e7
#!/usr/bin/env bash
#!/usr/bin/env bash
set
-euo
pipefail
# Create a L2 genesis.json suitable for the solidity tests to
# Create a L2 genesis.json suitable for the solidity tests to
# ingest using `vm.loadAllocs(string)`.
# ingest using `vm.loadAllocs(string)`.
# This script depends on the relative path to the op-node from
# This script depends on the relative path to the op-node from
...
@@ -30,3 +32,16 @@ if [ ! -f "$OUTFILE_L2" ]; then
...
@@ -30,3 +32,16 @@ if [ ! -f "$OUTFILE_L2" ]; then
--outfile
.l2
"
$OUTFILE_L2
"
\
--outfile
.l2
"
$OUTFILE_L2
"
\
--outfile
.rollup
"
$OUTFILE_ROLLUP
"
>
/dev/null 2>&1
--outfile
.rollup
"
$OUTFILE_ROLLUP
"
>
/dev/null 2>&1
fi
fi
# Wait for the L2 outfile to be over 8M for up to 2 seconds
# This is a hack to ensure that the outfile is fully written
# before the solidity tests try to read it
for
i
in
{
1..8
}
;
do
if
[
$(
du
-m
"
$OUTFILE_L2
"
|
cut
-f1
)
-ge
8
]
;
then
exit
0
fi
sleep
0.25
done
echo
"L2 genesis file not generated in time. Exiting."
exit
1
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment