Open roninjin10 opened 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
Added useful links to https://github.com/ethereum-optimism/mocktimism/issues/66
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.
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
Deposit tx types merged
Blockers to engine api fixed after we surfaced issues. Mattse merged fixes
Hello world endpoint implemented. This endpoint which already has had eyes on it from mattse is a great template of how to implement all the engine api endpoints.
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) -
[engine_forkchoiceUpdatedV2](https://github.com/ethereum-optimism/optimism/blob/develop/specs/exec-engine.md#engine_forkchoiceupdatedv2)
engine_forkchoiceUpdatedV3
engine_newPayloadV2
engine_newPayloadV3
engine_signalSuperchainV1
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