• Matthew Slipper's avatar
    ctb: Fix data race in generate-l2-genesis · 9bb13a09
    Matthew Slipper authored
    Forge reads the genesis outfile before it is completely written. This leads to errors like the following:
    
    ```
    [FAIL. Reason: setup failed: failed to parse json file: "/root/project/packages/contracts-bedrock/.testdata/genesis.json": EOF while parsing a value at line 1 column 0]
    ```
    
    To fix this, this PR adds a loop at the end of the file that checks if the L2 outfile is over 8 megabytes. This is a hack - a longer term fix would be to investigate why the process Forge calls via `vm.ffi` exits prior to fully writing the file. I tried calling `Sync()` from within the Go code, but it didn't fix the issue.
    9bb13a09
Name
Last commit
Last update
..
deploy-config Loading commit data...
deployments Loading commit data...
invariant-docs Loading commit data...
lib Loading commit data...
periphery-deploy-config Loading commit data...
scripts Loading commit data...
snapshots Loading commit data...
src Loading commit data...
test Loading commit data...
.eslintignore Loading commit data...
.eslintrc.js Loading commit data...
.gas-snapshot Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.storage-layout Loading commit data...
CHANGELOG.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
STYLE_GUIDE.md Loading commit data...
foundry.toml Loading commit data...
package.json Loading commit data...
semver-lock.json Loading commit data...
slither.config.json Loading commit data...
slither.db.json Loading commit data...
tsconfig.build.json Loading commit data...
tsconfig.json Loading commit data...