fix: incorrect and inadequate checks of sync message #4192
Merged
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.
What problem does this PR solve?
The checks of sync message are incorrect and inadequate since CKB2021.
ckb/sync/src/synchronizer/mod.rs
Lines 718 to 733 in 5dadcbf
SendBlock
is the same before and after CKB2021, so the result of checks is always betrue
.ckb/util/gen-types/schemas/extensions.mol
Lines 264 to 266 in 5dadcbf
The
Block
could have 1 more field after CKB2021.ckb/util/gen-types/schemas/blockchain.mol
Lines 94 to 99 in 5dadcbf
ckb/util/gen-types/schemas/blockchain.mol
Lines 101 to 107 in 5dadcbf
As a comparison, the checks of relay message are correct.
ckb/sync/src/relayer/mod.rs
Lines 780 to 781 in 5dadcbf
ckb/util/gen-types/schemas/extensions.mol
Lines 138 to 153 in 5dadcbf
Check List
Tests
Release note