Skip to content

Conversation

@bart-linera
Copy link
Contributor

Motivation

find_received_certificates currently downloads all of the sender certificates for a chain from all the validators, before processing them. This is very inefficient with chains receiving lots of messages.

Proposal

Collect the certificates to be downloaded from a quorum, and then try to download each certificate once. Process the certificates every time a download for a chain finishes.

This is the backport of #4708 onto testnet_conway.

Test Plan

CI, manual testing if syncing with Testnet Conway is improved

Release Plan

  • These changes should be backported to the latest testnet branch, then
    • be released in a new SDK,

Links

@bart-linera bart-linera force-pushed the improve_find_received_certificates_conway branch 7 times, most recently from f4b3760 to 824cee5 Compare October 10, 2025 14:32
Add some debugging

Restructure the code; use the new flow for background sync

Reduce some of the logs to trace

Update Cargo.locks

Fix cancellation, remove sync_sleep_ms

Refactor the code into smaller functions

Fix web and a comment

Fix CLI.md

Retry downloading blocks if we receive invalid certificates

Move ReceivedLogs and ValidatorTrackers to separate files; add comments

Perform find_received_certificates in batches

Use a similar strategy when downloading certificates as when downloading blobs

Don't try downloading certificates from validators who don't have them

Improve logging

Change the order of methods

Fix CLI.md and web

Address review comments

Shuffle the nodes with each iteration, so that we download from different nodes every time

Remove a superfluous check

Improve a comment

Fix a Clippy issue

Do not reuse faulty validators

Remove unnecessary pub(super)

Add a unit test for LazyBatches

Fix formatting

Improve the unit test

Address some of the review comments

Improve batching

Fix potential infinite loop when a committee is missing

Address more comments

Fix CLI.md

Fix web

Improve batching: take more than 1 block per chain at once

Make test exercise number of blocks per chain

Add a test with two validators

Move ValidatorTracker to the bottom of the file

Optimize ValidatorTracker

Address review comments

Fix a type conversion

Update a Cargo.lock

Improve the ValidatorTrackers API

Add a tracker filtering test
@bart-linera bart-linera force-pushed the improve_find_received_certificates_conway branch from 824cee5 to f342866 Compare October 10, 2025 16:07
@bart-linera bart-linera requested review from afck, deuszx and ma2bd October 10, 2025 17:57
@bart-linera bart-linera marked this pull request as ready for review October 10, 2025 17:57
@ma2bd
Copy link
Contributor

ma2bd commented Oct 10, 2025

Compatibility test is not passing

@bart-linera
Copy link
Contributor Author

I'll re-run it to see if it's a legitimate issue, or just flakiness.

@bart-linera bart-linera merged commit 04b87c7 into linera-io:testnet_conway Oct 12, 2025
29 of 30 checks passed
@bart-linera bart-linera deleted the improve_find_received_certificates_conway branch October 12, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants