Skip to content

Comments

feat: fetch unknown blocks from peers#61

Merged
MegaRedHand merged 25 commits intomainfrom
fetch-unknown-blocks
Jan 28, 2026
Merged

feat: fetch unknown blocks from peers#61
MegaRedHand merged 25 commits intomainfrom
fetch-unknown-blocks

Conversation

@MegaRedHand
Copy link
Collaborator

@MegaRedHand MegaRedHand commented Jan 27, 2026

This PR makes the BlockchainServer actively fetch missing blocks from the P2P module. Whenever we try to process a block which we don't have the pre-state for, we instead send a message to the P2P event loop, which sends a request for that block to peers. If any of the requests fail, it keeps retrying it with a backoff mechanism.

libp2p::request_response expects protocols to be equivalent between them,
and negotiates with the peer which one to use. Since we specified the status
first in the list of protocols, it seems to default to that one when we
send a request.
@MegaRedHand MegaRedHand marked this pull request as ready for review January 28, 2026 13:21
@MegaRedHand MegaRedHand merged commit 562471f into main Jan 28, 2026
2 checks passed
@MegaRedHand MegaRedHand deleted the fetch-unknown-blocks branch January 28, 2026 13:30
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.

1 participant