fix(consensus,XDPoS/v2): do not reject syncInfo when the sender has no TC yet - #2525
fix(consensus,XDPoS/v2): do not reject syncInfo when the sender has no TC yet#2525wanwiset25 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
020f813 to
c6c1a86
Compare
There was a problem hiding this comment.
Pull request overview
Allows valid SyncInfo QCs to be processed when accompanied by the initial blank timeout certificate.
Changes:
- Detects bootstrap TCs.
- Skips TC verification only for blank round-zero certificates.
- Adds positive and boundary tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
consensus/XDPoS/engines/engine_v2/timeout.go |
Adds blank-TC detection. |
consensus/XDPoS/engines/engine_v2/engine.go |
Exempts blank TCs during SyncInfo verification. |
consensus/tests/engine_v2_tests/sync_info_test.go |
Tests bootstrap and non-empty TC behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| // Round 0 with no signatures is the bootstrap TC installed by New(), not a real | ||
| // certificate: a TC only comes into existence once a round has timed out. | ||
| // This is the case when a node fresh restarts. Rejecting it would discard the whole syncInfo. |
Proposed changes
TC only exists in memory. When a node fresh restarts, there is no real TC, only the initial blank. Round 0 with no signatures is the bootstrap TC installed by New(), not a real certificate: a TC only comes into existence once a round has timed out. Rejecting it would discard the whole syncInfo, which might have a useful QC.
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that