-
Notifications
You must be signed in to change notification settings - Fork 5
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
Str 294 update l1 manifest #527
Conversation
0b49fd1
to
89b8f5c
Compare
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.
Need more rationale for why this new design that tracks epoch transitions was needed. It's rather complicated and the core scanning logic shouldn't need it, since we're only ever using one epoch's rules at a time.
@delbonis, scanning using only one epoch rule is definitely the ideal scenario. But as discussed somewhere in slack, it seems like having to scan blocks(at least the deposit transactions within) requires two(or more probably?) rules to adhere to. That's why I've used the transitions for epochs. I have a feeling that this might still not be sufficient, but I can't see how transitions can be avoided or simplified to use a single rule(at the very least for deposits). |
Can you DM me a link to this conversation? This doesn't seem right. |
7501c9c
to
53248cb
Compare
abddbeb
to
b25bb01
Compare
b25bb01
to
924e809
Compare
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.
Cosmetic nits
924e809
to
f33a5ec
Compare
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.
ACK f33a5ec
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.
Have some more thorough comments now that this is in a more current state.
f33a5ec
to
4148f40
Compare
@delbonis, those are great suggestions! I've updated them accordingly. |
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.
ACK 4148f40
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 think this is fine now.
Description
This PR adds the epoch information to
L1BlockManifest
and rescans recent blocks if the scan rules have changed in the new epoch.This also does some minor refactoring in
btcio::query.rs
to become more "testing" friendly.Idea
If there is a new epoch and filtering rules change on that epoch, that means recent blocks needs to be reparsed with the new rule.
But what defines recent blocks?
An epoch change is only identified when the L1 block containing the epoch is finalized. So, between the time the epoch block appears on L1(Say at L1 height
h
) and the time it is buried and identified in chain, we would have scanned L1 blocks using the previous epoch's rules. This means, we would have scanned blocks fromh
to current block(at the time of updating new epoch), using the old rules. Those are the "recent blocks".So, once the rule changes, a
L1Event
is emitted to revert to heighth
and reader's state is also updated accordingly.Assumption
The
recent_blocks
field inReaderState
holds enough blocks to be able to revert to the point where checkpoint appeared.Type of change
Notes to Reviewers
We still have to derive the filter rules from chainstate which will be the part of another Ticket.
Checklist
Related Issues
STR-716