refactor(archiver): split L1 checkpoint ingestion into phases - #337
Open
spalladino wants to merge 7 commits into
Open
spalladino wants to merge 7 commits into
spalladino wants to merge 7 commits into
Conversation
…urn sync outputs explicitly
This branch has not been deployed
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.
Splits the archiver's L1 checkpoint ingestion into named phases in a new
CheckpointIngestor, without changing behavior apart from one log-context trim.Context
ArchiverL1Synchronizer.handleCheckpointshad become one 350-line loop doing batch arithmetic, calldata retrieval, promotion lookup, attestation screening, rejected-ancestor tracking, blob fetching, persistence with the sync-point rewinds, and prune events. It shared state through a mutableRollupStatusbag, and the rule that picks which invalid checkpoint to report for invalidation could only be tested by running the whole archiver.Approach
PendingChainValidationTrackerowns the "first invalid checkpoint" rule and the decision of which status to persist per batch. It has its own unit tests.promote/evict/none). The updater'saddCheckpointstakes the promotedPublishedCheckpointdirectly instead of an object that repeated its fields.RollupStatusholds only the rollup's four values, withFrarchives. The validation status, added blocks and last seen checkpoint are returned explicitly, and the write-onlylastRetrievedCheckpointis gone.CheckpointIngestor, the checkpoint counterpart ofInboxMessageSynchronizer. The move is its own commit. Reorg reconciliation stays in the synchronizer.The only behavior change is log context: the "Failed to reach checkpoint … Rolling back" warn no longer carries
validationResult,blocksAddedandlastRetrievedCheckpoint, which serialized whole blocks into one line. The rollup-status trace likewise no longer carriesvalidationResultandblocksAdded.New tests in
archiver-sync.test.tscover the recovery paths directly:Each commit is reviewable on its own.