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

Notes and links: OP-Node Anvil integration #66

Closed
roninjin10 opened this issue Oct 23, 2023 · 3 comments
Closed

Notes and links: OP-Node Anvil integration #66

roninjin10 opened this issue Oct 23, 2023 · 3 comments

Comments

@roninjin10
Copy link

roninjin10 commented Oct 23, 2023

Description

An important part of mocktimism is integrating op-node and anvil.

Source code

Op-node

From @trianglesphere

OP Usage & Modifications: https://github.com/ethereum-optimism/optimism/blob/develop/specs/exec-engine.md#engine-api

Paris Engine API: https://github.com/ethereum/execution-apis/blob/584905270d8ad665718058060267061ecfd79ca5/src/engine/paris.md

We use all but engine_exchangeTransitionConfigurationV1

Shanghai Engine API: https://github.com/ethereum/execution-apis/blob/584905270d8ad665718058060267061ecfd79ca5/src/engine/shanghai.md

In shanghai, we don't use the new APIs, but have updated to the V2 versions of the ones we use.

@roninjin10
Copy link
Author

The @trianglesphere links are the most important links so deleting the other links and moving them here:

Op-program

Tests

Specs

E2e Testing and mocks

  • fakePos is a testing-only utility to attach to Geth, to build a fake proof-of-stake L1 chain with fixed block time and basic lagging safe/finalized blocks.
  • l2_engine_test.go E2e tests for l2 engine
  • l2_engine.go

Op-wheel

Op-service

Misc

@roninjin10
Copy link
Author

Fork choice updated initiates block production and gives payload
Once you get the id you can insert the payload
It doesn’t update the block hash though you gotta call fork choice updated again

fcu does a lot of stuff at once state management and block building initiation

FCU is overloaded with functionality

payload attributes is non nil which tells it to initiate block production

The second time we do initiate it

Looking at spec in execution-apis/src/engine/Paris.md
If block hash is in future it tells the node to snap sync. But we don’t enable this and wouldn’t expect anvil to support it

Specs are good for explaining the changes needed to execution engine in spec/exec-engine.md

noTxPool is very important not familiar with how anvil manages tx so it might be important

tx need to come at start of block to handle deposits etc.

Question about if Diagram happens once per block

three different code paths from op-node pod
this code path maps to 2 of the points of views
This is creating blocks either from batches or tx or it’s creating new blocks. Comes down to what payload attributes. If no transactions just creating blocks. If is tx we are creating new blocks
From anvil side as long as we implement correctly it will work with flow
There is another flow though
There is another flow where we call fork choice updated without a payload and don’t even build blocks
Sometimes their is a flow of creating a new payload and calling fork choice updated

When we call fork choice updated will be setting safe block and head block hash
Ignore all the syncing stuff geth will do if you tell it to snap sync

Is this determined by the type of node or per tx

It’s determined by lots of factors internally to op-node
The sequencer will alwyas do block building and it’s the only one that does.
Replicas never use tx pool but will use it
Sequencer will occasonally not use tx pool but it’s rare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant