-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: XSafe Head Maintainer #11458
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axelKingsley
commented
Aug 13, 2024
axelKingsley
force-pushed
the
axel/interop/crossSafeMaintainer
branch
from
August 13, 2024 22:27
351b4db
to
9e1893c
Compare
axelKingsley
commented
Aug 13, 2024
axelKingsley
commented
Aug 13, 2024
axelKingsley
force-pushed
the
axel/interop/crossSafeMaintainer
branch
from
August 13, 2024 22:52
9e1893c
to
7800128
Compare
axelKingsley
commented
Aug 14, 2024
protolambda
reviewed
Aug 19, 2024
axelKingsley
changed the title
WIP: XSafe Head Maintainer
Interop: XSafe Head Maintainer
Aug 22, 2024
protolambda
approved these changes
Aug 22, 2024
samlaf
pushed a commit
to samlaf/optimism
that referenced
this pull request
Nov 10, 2024
* WIP: Cross-Head Maintenance * Add NextExecutingMessage ; Add ChainsDB Tests * Add Tests for SafetyCheckers * spelling * correct test * add safety_checkers_test.go * Address Coments From Proto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mechanics for keeping the X-Heads up to date for all chains.
The basic components are:
SafetyChecker(s)
Each Safety Checker knows how to read the Heads Storage for the appropriate Cross/Local head for the type the checker is concerned about. It is also able to
Check
a log message against the database, confirming that the executing message is valid, and is inside the associated local-head. Finally, Safety Checkers can create Update Operations which modify the Heads when Applied.Safety Checkers currently can be created through a constructor that switches on a provided string
["safe", "unsafe", "finalized"]
.ChainsDB Entypoint for Updates
The ChainsDB now has a function which can use a Safety Checker to advance the cross-heads of all chains.
It also contains a function which creates a Safe-Safety-Checker and uses it to update the X-Safe heads
Interface Updates
As needed, interfaces were expanded or changed. The new interface functions are:
HeadsStorage
Current
- to return a copy of the current Heads in storageApply
- to apply an update to the stored HeadsLogDB
Contains
- to check if a matching message is stored in the DBLastCheckpointBehind
- to go from any index into the DB, back to checkpoint, so that you can use the IteratorNextExecutingMessage
- takes an iterator, advances it to the next Executing Message, and returns the message.Iterator
Iterators are now exported so that LogDB can return them in
LastCheckpointBehind
Index
- returns the underlyingentryDB.EntryIdx
, derived asi.nextEntryIdx - 1
Contains
The
Contains
function now returns the Index the log is located at. This could have replaced thebool
value, but for now I wanted to only extend the structureTests
Unit tests now exist which test:
Check
Not Included
Not yet included is the actual trigger that makes this update happen. This should be as simple as a timer-loop, and could also leverage some self-feeding (if an update occurs on one chain, update other chains)