Merged
Conversation
a9458ac to
7947777
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13206 +/- ##
===========================================
- Coverage 44.38% 42.65% -1.73%
===========================================
Files 807 752 -55
Lines 72694 68183 -4511
===========================================
- Hits 32265 29084 -3181
+ Misses 37805 36652 -1153
+ Partials 2624 2447 -177
Flags with carried forward coverage won't be shown. Click here to find out more.
|
7947777 to
b978583
Compare
b978583 to
0ec4830
Compare
protolambda
reviewed
Dec 6, 2024
Contributor
protolambda
left a comment
There was a problem hiding this comment.
Generally LGTM, but a little worried that LastCommonL1 and RecordNewL1 could fall out of sync. But there are consistency checks, so it should still be safe.
Contributor
Author
|
Discussed the potential for de-sync @protolambda had mentioned offline -- while there is a slight lock gap which would allow this,
So even though the gap does indeed exist, we think it is safe and acceptable. |
protolambda
approved these changes
Dec 9, 2024
sigma
pushed a commit
that referenced
this pull request
Dec 19, 2024
* supervisor: L1 Processor * comments ; test fixes * Make L1 source separate from RPC Addr * fix test * Add atomic bool for singleton processor routine
This file contains hidden or 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
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.
What
Introduces
L1 Processorfor SupervisorWhy
We would like for the Supervisor to control the canonical L1 source for "Owned Nodes" in order to have better consistency and control over the data in the system.
How
Introduces the following:
L1RPCL1RPCthroughout, including insupersystemL1ProcessorSupervisorBackendtoStartandStopwith the rest of the systemChainsDBfunctionality to support the L1 ProcessorL1 Processor
The L1 processor spawns a worker routine which uses an L1 RPC Client to periodically check for new L1 blocks. If a new block is discovered, the
ChainsDBis asked to Record itNew ChainsDB Functions
LastCommonL1
For each chain being tracked, the
latestderivation data is checked, and the lowest L1 block height amongst them is returned. This is used to initialize the processor, so that it can start up at the first L1 block which isn't fully recorded. If an error is encountered, the processor defaults to starting at0. This works well when the database is uninitialized, as anErrFuture. The L1 blocks should never diverge once the Supervisor is in charge of the L1 data, so only tracking heights is sufficient.RecordNewL1
RecordNewL1fetches the lastestderivedfor each chain, and extends each database withNewL1:ExistingL2. This happens so that the database records the new L1 row before any new L2 rows appear, making theFromDAdatabase only ever increment one element at a time.Testing
Up Next
Still to come is using the detected L1 block to drive derivation of the Owned Nodes. For that we need a pathway to call down to those Owned Nodes. I may start building a PR to put OP Nodes into that mode of operation to accept the calls, but I am out tomorrow.
We can also add Finalization updating in a future PR, the existing worker can manage the last known finalization and feed it into the database when new values are noticed. I'd like to keep the scope of this initial PR tight so we can start integrating pieces (like Bidirectional RPC)