Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import: read from era files #2254

Merged
merged 6 commits into from
May 31, 2024
Merged

import: read from era files #2254

merged 6 commits into from
May 31, 2024

Conversation

arnetheduck
Copy link
Member

This PR extends the nimbus import command to also allow reading from era files - this command allows creating or topping up an existing database with data coming from era files instead of network sync.

  • add --era1-dir and --max-blocks options to command line
  • make persistBlocks report basic stats like transactions and gas
  • improve error reporting in several API
  • allow importing multiple RLP files in one go
  • clean up logging options to match nimbus-eth2
  • make sure database is closed properly on shutdown

This PR extends the `nimbus import` command to also allow reading from
era files - this command allows creating or topping up an existing
database with data coming from era files instead of network sync.

* add `--era1-dir` and `--max-blocks` options to command line
* make `persistBlocks` report basic stats like transactions and gas
* improve error reporting in several API
* allow importing multiple RLP files in one go
* clean up logging options to match nimbus-eth2
* make sure database is closed properly on shutdown
@arnetheduck
Copy link
Member Author

currently, when running the command twice, it fails sometimes depending on the chunk size, ie build/nimbus import --era1-dir:/mnt/share/eth --max-blocks=1024 fails on the second launch while build/nimbus import --era1-dir:/mnt/share/eth --max-blocks:16385 can be resumed.


case conf.cmd
of NimbusCmd.`import`:
importBlocks(conf, com)
else:
if conf.trustedSetupFile.isSome:
Copy link
Contributor

@jangko jangko May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loadKzgTrustedSetup should be called before importing blocks or subsequent call to kzg functions in block validation will return error if Cancun hardfork is active.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah - it was explicitly disabled for import, for some reason. I'll move it back then.

@arnetheduck arnetheduck merged commit a375720 into master May 31, 2024
9 checks passed
@arnetheduck arnetheduck deleted the era1-import branch May 31, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants