foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.14k stars 1.69k forks source link

Add engine API to anvil #5994

Open roninjin10 opened 11 months ago

roninjin10 commented 11 months ago

Component

Anvil

Describe the feature you would like

The Engine API is currently in RETH but not supported in anvil. Adding the engine API to anvil would be generally useful. For example, it would allow Anvil to work seamlessly within a multichain OP-chain devnet running on top of anvil. Without the engine api this must be hacked around.

Additional context

Some links about OP node and engine api:

mattsse commented 11 months ago

Adding the engine API to anvil would be generally useful. For example, it would allow Anvil to work seamlessly within a multichain OP-chain devnet running on top of anvil.

you want support for this in anvil so you have a node and still have all the cheat endpoints? otherwise op-reth would be an option

I think we can add this as an opt-in feature, I can see how this could be useful. But could you elaborate on how this would be used?

Evalir commented 11 months ago

Agree here with mattsse—this could be useful, we just need to scope it properly.

roninjin10 commented 11 months ago

@mattsse exactly! We want to be able to do everything anvil does like cheat endpoints and state dumps within a multichain devnet. We also are looking to contribute helping add this.

Link to issue: https://github.com/ethereum-optimism/mocktimism/issues/5 Link to product document and eng doc: https://github.com/ethereum-optimism/mocktimism/issues/1

mattsse commented 11 months ago

okay, actually I think this shouldn't be too complex,

basically new_payload buffers received blocks FCU then executes the block(s) and updates the state

there are def some limitations when it comes to full validation etc, but getting the newpayload and fcu endpoints working (optimistically without full validation) should be doable.