Commit 9d502a7
authored
Backport of #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.
## Links
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
Backport of #5206
1 parent caf8df4 commit 9d502a7
1 file changed
Lines changed: 61 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| |||
882 | 883 | | |
883 | 884 | | |
884 | 885 | | |
885 | | - | |
886 | | - | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
887 | 889 | | |
888 | 890 | | |
889 | 891 | | |
| |||
895 | 897 | | |
896 | 898 | | |
897 | 899 | | |
898 | | - | |
| 900 | + | |
899 | 901 | | |
900 | 902 | | |
901 | | - | |
| 903 | + | |
902 | 904 | | |
903 | 905 | | |
904 | | - | |
905 | | - | |
| 906 | + | |
| 907 | + | |
906 | 908 | | |
907 | 909 | | |
908 | | - | |
| 910 | + | |
909 | 911 | | |
910 | 912 | | |
911 | 913 | | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 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 | + | |
912 | 966 | | |
913 | 967 | | |
914 | 968 | | |
| |||
0 commit comments