Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
Possible places where named args for integral literals may be used (e.g.
Possible places where comparison-specific test macros should replace generic comparisons:
2026-11-30 12:52:28 |
081c9a2 to
86d9df2
Compare
|
Rebased on master. Opening this so it can be tested against CI and to make sure nothing obvious is missing. Next step will be testing with real nodes (most likely in Warnet). Things to consider/add:
|
86d9df2 to
5821866
Compare
5821866 to
6554707
Compare
6554707 to
e63db1a
Compare
e63db1a to
23053a3
Compare
23053a3 to
35bcd04
Compare
280d603 to
d08f127
Compare
When we're finalizing negotiation, we should add the peers for which we will initiate reconciliations to the queue. Co-authored-by: Gleb Naumenko <[email protected]>
We initiate reconciliation by looking at the queue periodically with equal intervals between peers to achieve efficiency. This will be later used to see whether it's time to initiate. Co-authored-by: Gleb Naumenko <[email protected]>
When the time comes for the peer, we send a reconciliation request with the parameters which will help the peer to construct a (hopefully) sufficient reconciliation sketch for us. We will then use that sketch to find missing transactions. Co-authored-by: Gleb Naumenko <[email protected]>
Co-authored-by: Gleb Naumenko <[email protected]>
Store the parameters the peer sent us inside th reconciliation request. Co-authored-by: Gleb Naumenko <[email protected]>
Co-authored-by: Gleb Naumenko <[email protected]>
When the time comes, we should send a sketch of our local reconciliation set to the reconciliation initiator. Co-authored-by: Gleb Naumenko <[email protected]>
When the sketches from both sides are combined successfully, the diff is produced. Then this diff can (together with the local txs) be used to identified which transactions are missing locally and remotely. Co-authored-by: Gleb Naumenko <[email protected]>
Move the transaction announcement loop from SendMessages into its own method, so it can be reused to announce transactions after a reconciliation round. No behaviour change.
Transactions the peer is found to be missing during a reconciliation round need to be announced right away, rather than waiting for the next trickle interval and being added back to the reconciliation set. Add AnnounceReconciliationTxs on top of AnnounceTxs. Co-authored-by: Gleb Naumenko <[email protected]>
Co-authored-by: Gleb Naumenko <[email protected]>
If after decoding a reconciliation sketch it turned out to be insufficient to find set difference, request extension. Co-authored-by: Gleb Naumenko <[email protected]>
Store the initial sketches so that we are able to process extension sketch while avoiding transmitting the same data. Co-authored-by: Gleb Naumenko <[email protected]>
To be ready to respond to a sketch extension request from our peer, we should store a snapshot of our state and capacity of the initial sketch, so that we compute extension of the same size and over the exact same transactions. Transactions arriving during this reconciliation will be instead stored in the regular set. Co-authored-by: Gleb Naumenko <[email protected]>
Co-authored-by: Gleb Naumenko <[email protected]>
If peer failed to reconcile based on our initial response sketch, they will ask us for a sketch extension. Store this request to respond later. Co-authored-by: Gleb Naumenko <[email protected]>
Sending an extension may allow the peer to reconcile transactions, because now the full sketch has twice as much capacity. Co-authored-by: Gleb Naumenko <[email protected]>
If a peer sent us an extension sketch, we should reconstruct a full sketch from it with the snapshot we stored initially, and attempt to decode the difference. Co-authored-by: Gleb Naumenko <[email protected]>
This currently unused function is supposed to be used once a reconciliation round is done. It cleans the state corresponding to the passed reconciliation. Co-authored-by: Gleb Naumenko <[email protected]>
Once a peer tells us reconciliation is done, we should behave as follows: - if it was successful, just respond them with the transactions they asked by short ID. - if it was a full failure, respond with all local transactions from the reconciliation set snapshot - if it was a partial failure (only low or high part was failed after a bisection), respond with all transactions which were asked for by short id, and announce local txs which belong to the failed chunk. Co-authored-by: Gleb Naumenko <[email protected]>
1b7d988 to
ffc072f
Compare
We may still need to add more tests, specially around extensions (if we keep them) Co-authored-by: Gleb Naumenko <[email protected]>
…he mempool A transaction that has left our mempool can no longer be served, but nothing removed it from the reconciliation sets it had been added to. It would still be sketched, requested by the peer, and then dropped, wasting sketch capacity and a round trip after every block. Prune on both removal signals: removeUnchecked deliberately skips TransactionRemovedFromMempool for MemPoolRemovalReason::BLOCK, so mined transactions, which are the bulk of the case, only arrive via MempoolTransactionsRemovedForBlock. Snapshots of an in-flight round are left untouched so that a sketch extension still describes the same elements as the sketch already sent. Flagging the wtxid instead keeps it out of the announcement.
Raises the question of whether the current sketch capacity limits are too high
ffc072f to
8b5acf5
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |

Erlay Project Tracking: #30249
Conceptual Discussion: #34542
This is a full implementation of Erlay. Its purpose is to check the integrity and correctness of the implementation against changes/additions that may originate from the review process and/or rebases on top of newer functionality.
This is not to be merged. Functionality will be spread across multiple smaller PRs to ease the review process.
Approach
This approach uses Erlay as a fallback mechanism for transaction propagation. Instead of mixing fanout and reconciliation into a single connection type, the current approach leaves the existing connections as they are, and adds additional low-bandwidth connections to be used in case the node is being eclipsed. This connections should have minimal cost under normal circumstances, and only undergo real traffic in case other 8 full-outbound connections are being captured.
outbound-full-reconciliation connections
For now, we are adding 4 additional reconciliation-only connections to the node while we test it's impact on real node running the approach. Further analysis may be needed to pick a meaningful value for this. The number of inbound connections should also be scaled based on how many connections we are adding.