ethereum-optimism / mocktimism

[WIP!] Coordinates two anvil process (L1 and L2) for testing / forking op-stack chains (mocktimism placeholder name)
MIT License
20 stars 7 forks source link

Add engine api support to anvil #5

Open roninjin10 opened 10 months ago

roninjin10 commented 10 months ago

This is a large sized task of adding engine api support to anvil

Description

Engine API is needed for op-node but currently not supported by anvil. Currently a proxy is being used but ideally this functionality should live in Anvil.

image

Resources and useful links

See https://github.com/ethereum-optimism/mocktimism/issues/66

Engine API Notes

Links

pr: https://github.com/foundry-rs/foundry/pull/6574/files

specs: https://github.com/ethereum-optimism/optimism/blob/develop/specs/exec-engine.md

Issue: https://github.com/foundry-rs/foundry/issues/5994

Work done so far

SubTasks

1 Figure out the data model

Assignee: Will

Estimation (1 week lift): January 19, 2024

This task blocks other tasks and thus we should try and see if we can get this in by friday

Once the data model is in place in theory the endpoints could be worked on in parallel

tbh I don't have enough experience with rust datatypes to exactly know what's appropriate for storing the payloads, I looked at RETH and they used some kind of crazy tokio high concurrency datastructure that I didn't understand

I think Anvil can probably use something much simpler

I think we started using just a plain HashMap?

2 Integration: Integrate anvil with engine api with op-node

Assignee: Will

Estimation (1 week lift): January 26, 2024

2 Endpoints:

Will to implement a first one as a reference, divide and conquer the rest between Will and Base engs

Estimation: (4 weeks lift) -

3 Configuration: Implement engine api configuration

→ DEMO - Tentative date: 15th Feb - Collective All Hands

4 Documentation: Update foundry documentation with engine api

5+ Ship mocktimism

Since deposit tx is in already, after engine api there are no blockers to shipping the rest of mocktimism. This will require merging some of the pending work on other services

roninjin10 commented 10 months ago

https://github.com/mdehoog/op-anvil/issues/2

roninjin10 commented 10 months ago

From @mdehoog

i dumped out requests / responses for the current op-node engine API here, this is what helped me in the engine API -> anvil proxy

roninjin10 commented 10 months ago

Added useful links to https://github.com/ethereum-optimism/mocktimism/issues/66