Commit 4414903
authored
Send only blocks at missing heights (#5206)
## Motivation
When syncing chain information for blobs between validators, we were
sending more data than necessary. The previous implementation would send
**all blocks up to the height** where a blob was published, even when
only the specific block containing that blob was needed.
For sparse chains (chains with gaps in block heights), this meant
sending many unnecessary blocks, wasting network bandwidth and validator
processing time.
Addresses
#5205 (comment)
## Proposal
This PR changes the blob synchronization strategy from "send all blocks
up to height N" to "send only blocks at specific heights":
1. **Modified `send_chain_info_for_blobs`**: Instead of tracking the
maximum height per chain, now collects a `BTreeSet` of all specific
heights where blobs exist
2. **New method `send_chain_info_at_heights`**: Sends chain information
only for the exact block heights specified, not all blocks leading up to
those heights
3. **Updated documentation**: Clarifies that this optimization
specifically benefits sparse chains
### Example Impact
Previously, if blobs existed at heights [5, 10, 15] on a chain:
- Sent blocks 0-5, 0-10, 0-15 (up to 30 blocks sent, with significant
duplication)
Now:
- Sends only blocks at heights 5, 10, 15 (exactly 3 blocks)
## Test Plan
- CI
## Release Plan
- Nothing to do / These changes follow the usual release cycle.
- Backport to `main`.
## Links
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)1 parent 0c9c22a commit 4414903
1 file changed
Lines changed: 61 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
| |||
896 | 897 | | |
897 | 898 | | |
898 | 899 | | |
899 | | - | |
900 | | - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
901 | 903 | | |
902 | 904 | | |
903 | 905 | | |
| |||
909 | 911 | | |
910 | 912 | | |
911 | 913 | | |
912 | | - | |
| 914 | + | |
913 | 915 | | |
914 | 916 | | |
915 | | - | |
| 917 | + | |
916 | 918 | | |
917 | 919 | | |
918 | | - | |
919 | | - | |
| 920 | + | |
| 921 | + | |
920 | 922 | | |
921 | 923 | | |
922 | | - | |
| 924 | + | |
923 | 925 | | |
924 | 926 | | |
925 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
926 | 980 | | |
927 | 981 | | |
928 | 982 | | |
| |||
0 commit comments