pub async fn setup_engine_with_chain_import(
num_nodes: usize,
chain_spec: Arc<ChainSpec>,
is_dev: bool,
tree_config: TreeConfig,
rlp_path: &Path,
attributes_generator: impl Fn(u64) -> EthPayloadBuilderAttributes + Send + Sync + Copy + 'static,
) -> Result<ChainImportResult>
Expand description
Creates a test setup with Ethereum nodes that have pre-imported chain data from RLP files.
This function:
- Creates a temporary datadir for each node
- Imports the specified RLP chain data into the datadir
- Starts the nodes with the pre-populated database
- Returns the running nodes ready for testing
Note: This function is currently specific to EthereumNode
because the import process
uses Ethereum-specific consensus and block format. It can be made generic in the future
by abstracting the import process.
It uses NoopConsensus
during import to bypass validation checks like gas limit constraints,
which allows importing test chains that may not strictly conform to mainnet consensus rules. The
nodes themselves still run with proper consensus when started.