-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: sync: validate (early) that blocks fall within range #10691
Conversation
Well, this definitely broke something. |
Ok, I needed this, but I'm concerned I'm misunderstanding something here. As far as I know, the "catch up" code path shouldn't end up calling |
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 don't know this part of the system well enough to be a very useful approver but the idea and implementation seem good.
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.
Not entirely sure about Ignore/Reject, I guess if we want to be conservative, ignore is better, but I don't have a strong opinion.
Other parts LGTM.
I think it is better to be conservative and Ignore here, otherwise it might have adverse effects with the score penalties. Basically we should only do Reject for obviously bad behaviours, not things that can happen naturally. |
8e82393
to
5c86cca
Compare
This will reject blocks in pubsub validation if they're either: 1. Too far into the future (5 blocks beyond the expected head). 2. Too far into the past (before finality with respect to our current head). Specifically: 1. We were previously rejecting future blocks in the sync logic, but not in pubsub itself. 2. We never used to check if a block was too _old_. Motivation: Blocks that are too new/too old can cause us to perform quite a bit of unnecessary work.
8e82393
to
a097b61
Compare
Ok, this should be good to go. It ignores blocks before finality with respect to our current head and 5 blocks after the expected head. |
Proposed Changes
This will reject blocks in pubsub validation if they're either:
Specifically:
Motivation: Blocks that are too new/too old can cause us to perform quite a bit of unnecessary work.
We should carefully consider that second check as we may need to tweak it (e.g., to handle network issues?). We may want to base this check on the latest synced head, not the expected epoch.
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps