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

Dev mode is not supported for legacy engine #13438

Open
1 task done
PowVT opened this issue Dec 18, 2024 · 8 comments
Open
1 task done

Dev mode is not supported for legacy engine #13438

PowVT opened this issue Dec 18, 2024 · 8 comments
Labels
C-bug An unexpected or incorrect behavior D-good-first-issue Nice and easy! A great choice to get started

Comments

@PowVT
Copy link

PowVT commented Dec 18, 2024

Describe the bug

when running a dev node per the examples/custom-dev-node example using v1.1.3 i get this error:
Dev mode is not supported for legacy engine

Steps to reproduce

cd examples/custom-dev-node

cargo build

cargo run

Node logs


Platform(s)

No response

Container Type

Not running in a container

What version/commit are you on?

v1.1.3

What database version are you on?

idk

Which chain / network are you on?

dev

What type of node are you running?

Archive (default)

What prune config do you use, if any?

dev

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@PowVT PowVT added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Dec 18, 2024
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Dec 19, 2024
@PowVT
Copy link
Author

PowVT commented Dec 19, 2024

@mattsse any pointers on where/ why this is occurring? Would love to help fix it.

I know it is triggering this line in the node builder:

eyre::bail!("Dev mode is not supported for legacy engine")

but not sure why that line is there and what the context is for a fix. Thanks

@mattsse
Copy link
Collaborator

mattsse commented Dec 19, 2024

@PowVT this currently would require replicating this

let engine_tree_config = TreeConfig::default()
.with_persistence_threshold(engine_args.persistence_threshold)
.with_memory_block_buffer_target(engine_args.memory_block_buffer_target);
let handle = builder
.with_types_and_provider::<EthereumNode, BlockchainProvider2<_>>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.launch_with_fn(|builder| {
let launcher = EngineNodeLauncher::new(
builder.task_executor().clone(),
builder.config().datadir(),
engine_tree_config,
);
builder.launch_with(launcher)
})
.await?;
handle.node_exit_future.await

but legacy is scheduled for deprecating so perhaps not worth doing rn

@PedroRosalba
Copy link

May I try my hand at this?

@PowVT
Copy link
Author

PowVT commented Dec 22, 2024

May I try my hand at this?

I would probably hold off since like @mattsse said they are deprecating legacy and that PR will most likely cover the --dev mode case

@VyuduInc
Copy link

May I try my hand at this?

@simlf
Copy link

simlf commented Jan 4, 2025

Can I tackle this one?

@PowVT
Copy link
Author

PowVT commented Jan 5, 2025

@mattsse I tried your suggestion of adding the experimental flow to the main() it gets past the Dev mode is not supported for legacy engine error, but now I get this error: Error: exceeds block gas limit.

Here is the main.rs code I am running:

async fn main() -> eyre::Result<()> {
    let tasks = TaskManager::current();

    // create node config
    let node_config = NodeConfig::test()
        .dev()
        .with_rpc(RpcServerArgs::default().with_http())
        .with_chain(custom_chain());

    let engine_tree_config = TreeConfig::default()
        .with_persistence_threshold(DEFAULT_PERSISTENCE_THRESHOLD)
        .with_memory_block_buffer_target(DEFAULT_MEMORY_BLOCK_BUFFER_TARGET);

    let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config)
        .testing_node(tasks.executor())
        .with_types_and_provider::<EthereumNode, BlockchainProvider2<_>>()
        .with_components(EthereumNode::components().pool(EthereumPoolBuilder::default()))
        .with_add_ons(EthereumAddOns::default())
        .launch_with_fn(|builder| {
            let launcher = EngineNodeLauncher::new(
                tasks.executor().clone(),
                builder.config().datadir(),
                engine_tree_config,
            );
            builder.launch_with(launcher)
        })
        .await?;

    let mut notifications = node.provider.canonical_state_stream();

    // submit tx through rpc
    let raw_tx = hex!("02f876820a28808477359400847735940082520894ab0840c0e43688012c1adb0f5e3fc665188f83d28a029d394a5d630544000080c080a0a044076b7e67b5deecc63f61a8d7913fab86ca365b344b5759d1fe3563b4c39ea019eab979dd000da04dfc72bb0377c092d30fd9e1cab5ae487de49586cc8b0090");

    let eth_api = node.rpc_registry.eth_api();

    let hash = eth_api.send_raw_transaction(raw_tx.into()).await?;

    let expected = b256!("b1c6512f4fc202c04355fbda66755e0e344b152e633010e8fd75ecec09b63398");

    assert_eq!(hash, expected);
    println!("submitted transaction: {hash}");

    let head = notifications.next().await.unwrap();

    let tx = &head.tip().transactions()[0];
    assert_eq!(tx.hash(), hash);
    println!("mined transaction: {hash}");
    Ok(())
}

@PowVT
Copy link
Author

PowVT commented Jan 5, 2025

whats interesting is that when you change the "gasLimit": "0x1388", param in the custom genesis config to 0x1c9c380 (30,000,000) it works and gets pass the gas limit error (using the experimental engine). What I dont understand is that in the mainnet ethereum genesis.json in the alloy-genesis crate it is set to "0x1388"

although in the sepolia genesis it is set to 0x1c9c380

I guess this is why it was initially set to 5000 for mainnet:
https://ethereum.stackexchange.com/questions/28486/why-is-block-gas-limit-set-to-5000

So to get the other examples to work you need to add .frontier_activated() to the ChainSpec::builder()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

No branches or pull requests

5 participants