-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
interop: local head tracking #11983
Comments
Going to journal in this ticket because I think this might take a minute, and I'd like to make sure this work is visible for potential contribution. CurrentlyI've made some changes to my local (based on this PR):
As Safe and Finalized get added, we can make those just do a Heads update based on the database state. these processors can be responsible for responding to reorg when the data is available. Findings so far: Log snippet:
Explanation:
|
Another thing that's turned out to be required is exposing |
There's a core issue when attempting to get a search checkpoint near the front of the database. if the index is |
Ok, I've got things in place such that local heads are tracking, and x-heads are following as expected. Here's a snippet:
Explanation: each line is a printout of the ChainsDB's Head structure, just after any update it handles. Eventually a Safe and Finalized head are found on the network for both chains, and their x-heads track there too. The tech required to make this happen is a new HeadProcessor which is now attached to the Chain Monitor. It uses the last log index for the block to update the local head. More details in: #11991 |
Closing this in favor of #12077 that tracks the need of ingesting this local-safe data from op-nde. |
It appears that the Chain Monitors, while tracking new log events, do not track the head pointers in a way that is usable by the rest of the system. Here I write as much context as I can:
Cross Safe Maintenance
The ChainsDB currently has a routine which runs Cross-Safety Maintenance. It attempts to advance the x-safety pointer as far as possible, and updates the value when its done. The x-safety pointer can't go beyond the local-safety pointer.
It was here we noticed that cross safety was never advancing, and it appears to be due to the local heads never advancing either.
Local Head Pointers
We expect/desire that there are pointers into the database which represent the local safety of a block of messages. We would want this data to write into the Heads Storage, which holds all these pointers as
index
values into the database (which is why I'm calling them pointers)The current flow is:
Chain Monitor
->Head Monitor
->Update Processor
"callback"** Issue 1**: The Update Processor only has one underlying processor at the moment, the Unsafe Processor. We will need to add processors to the Safe and Finalized stages in order to process those updates at all.
Inside this underlying
unsafeBlockProcessor
(of typeHeadUpdateProcessor
) we have a notion of which block number we are on for the sake of making the right data requests. Once we get all the blocks, we unroll them into their receipts and logs, and append them all to the database.Issue 2: Appending to the database happens in a space where the Heads Storage is totally untracked. Chain Monitors have a
store
(underlying is aChainsDB
), so maybe we can use that directly...Another potential solution would be for ChainsDB to maintain local heads asynchronously, in the same way as it maintains x-heads. If every block left a checkpoint in the database, the local update routine could just use the Monitor's "latest" block number, resolve that to an index, and use that as the local head.
The text was updated successfully, but these errors were encountered: