-
Notifications
You must be signed in to change notification settings - Fork 4
Reorg Rewind optimisation #231
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
Open
LeoPatOZ
wants to merge
23
commits into
main
Choose a base branch
from
reorg-log-opt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+413
−58
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
21c4a6e
feat: add common ancestor to notif
LeoPatOZ 5ef900b
fix: update test for new reorg notif
LeoPatOZ c956b43
feat: update common fn with new ancestor block notif
LeoPatOZ 4bc5b1f
feat: add reorg streaming and log removal logic
LeoPatOZ 567ddda
ref: move reorg check to internal
LeoPatOZ 31c0e5a
feat: finalized tip reorg opt
LeoPatOZ 5af945c
format: common rs
LeoPatOZ 4737724
Merge branch 'main' into reorg-log-opt
LeoPatOZ e0286f2
ref: simplify if else
LeoPatOZ 8f204d5
test: latest roerg logic
LeoPatOZ 637fa87
doc: add note about possible opt
LeoPatOZ 3633605
doc: fix comment
LeoPatOZ 11c71aa
Merge branch 'main' into reorg-log-opt
LeoPatOZ aa6c884
ref: ignore reorg tests for now (add comment why)
LeoPatOZ c27b70d
ref: remove from in handle reorg
LeoPatOZ c74e6d5
fix: only send reorg range but continue rewind from previous batch to
LeoPatOZ e357412
ref: remove retain
LeoPatOZ b0eaf4b
ref: better reorg block included test + naming
LeoPatOZ 87ad933
ref: use skip_while
LeoPatOZ c7584ae
Merge branch 'main' into reorg-log-opt
LeoPatOZ 81875e4
doc: add comment about reorg handling
LeoPatOZ b216fa7
comment: explain ignored test in comment
LeoPatOZ ffe122e
test: add BRS tests (ignored until ack channel)
LeoPatOZ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,6 @@ pub enum Notification { | |
| /// in sync scanners. | ||
| SwitchingToLive, | ||
|
|
||
| /// Emitted when a blockchain reorganization is detected during scanning. | ||
| /// | ||
| /// When a reorg occurs, the scanner adjusts its position to re-stream events from the | ||
| /// canonical chain state. The specific behavior depends on the scanning mode (see individual | ||
| /// scanner mode documentation for details). | ||
|
|
@@ -49,7 +47,10 @@ pub enum Notification { | |
| /// handle duplicate logs idempotently (e.g., using transaction hashes or log indices as | ||
| /// deduplication keys). The scanner prioritizes correctness by ensuring all logs from the | ||
| /// canonical chain are delivered, even if it means occasional duplicates during reorgs. | ||
| ReorgDetected, | ||
| /// | ||
| /// The `common_ancestor_block` field contains the block number of the last block | ||
| /// that is still valid on the canonical chain. | ||
| ReorgDetected { common_ancestor_block: u64 }, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can find a more succinct name |
||
|
|
||
| /// Emitted during the latest events phase when no matching logs are found in the | ||
| /// scanned range. | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since BRS is a public type, make sure to document this behavior. I will do the same for
historicmode.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related #235
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an inline comment + something in the doc comment. Is that what you had in mind?