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

CLI with Gnosis arguments (block import and state init) #27

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

debjit-bw
Copy link
Member

Custom CLI wrapper to use Gnosis Node and Gnosis Executor instead of Ethereum defaults. This implements custom cli for block imports (in concatenated RLP; only post-merge) and state initialization from state dump. This enables state import without evm.

How to test it out the init-state command:

  • First download the state export from Geth (Gnosis Mainnet) at the block height 57936 here: block_57936.jsonl
  • Download the custom header from here: header.rlp (this is a mock header with the block hash at mainnet block 57936)
  • [IMPORTANT] Empty the state in the genesis alloc (alloc: {}). This is because we aren't loading the chain from genesis, and instead the state will be the exact one in the JSONL file. If you don't do this, you might get state root mismatches.

Then run:

./target/debug/reth --chain ./scripts/chiado_genesis_alloc.json init-state ./block_57936.jsonl --without-evm --header ./new_header.rlp --total-difficulty 0 --header-hash 940b2930e73c2088120f1246b9263e99fda2584b15c7eca32196fa6e023df7d2

@debjit-bw debjit-bw marked this pull request as ready for review November 3, 2024 13:04
@@ -27,7 +27,7 @@ use std::sync::Arc;
mod consensus;
mod errors;
mod evm_config;
mod execute;
pub mod execute;
Copy link
Member

Choose a reason for hiding this comment

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

Why pub?

Copy link
Member Author

Choose a reason for hiding this comment

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

to import the GnosisExecutorProvider in main.rs

Copy link
Member

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

LGTM, we can clean up the dbg! latter

@debjit-bw
Copy link
Member Author

hey, i just changed the dbg and eprintln lines with tracing::{error, info} ones, merging

@debjit-bw debjit-bw merged commit 3c9b63b into master Nov 8, 2024
6 checks passed
@debjit-bw debjit-bw deleted the cli-import-and-init-state branch November 8, 2024 08:50
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