-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of Mempool Syncer #2832
base: albatross
Are you sure you want to change the base?
Conversation
010d273
to
e129d1c
Compare
mempool/src/executor.rs
Outdated
}; | ||
|
||
network.validate_message::<T>(pubsub_id, acceptance); | ||
if let Some(pubsub_id) = pubsub_id { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still somehow punish the sender of an invalid transaction, even if it's not sent via gossipsub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this. If some of the verification variants are encountered, the peer is banned.
eabf6dd
to
4f5c75a
Compare
0f84490
to
c43f4ae
Compare
2011b40
to
b09686b
Compare
95e9128
to
0b03d91
Compare
Why is this a breaking change ( |
Because it introduces some new network request messages. Technically it is behind a feature flag because the syncer utilizes an yet unused service flag so these new request messages would only go to peers that also have this new component. So even though it's breaking, it shouldn't be too difficult to get in but for bookkeeping I kept the label around. |
The syncers get initiated once the Mempool Executors are spawned. One Syncer per Executor is started in order to sync the regular and control transactions separately. First the Syncer starts to discover which transaction hashes other nodes with a mempool have and compare those with what we have locally. Then we distribute those unknown hashes among the peers we know have those transactions and retrieve the actual transactions. Lastly for every received transaction we do a full verification which should add it to our local mempool if everything checks out.
…ain a collection of peers that are in live sync
…ool syncer is active
…ConsensusProxy rather than the Consensus directly
- Only try to construct mempool transaction requests if new hashes are discovered - Check the mempool state first before checking the blockchain if a transaction is already known/included - Bound the amount of received hashes that will be processed per peer - Fix tests
0b03d91
to
0bc22d5
Compare
What's in this pull request?
The Mempool Syncer is responsible for acquiring the transactions that are currently in the mempool of other nodes directly after reaching consensus.
The mempool syncers get initiated once the Mempool Executors are spawned. One Syncer per Executor is started in order to sync the regular and control transactions separately. First the Syncer starts to discover which transaction hashes other peers with a mempool have and compare those with what we have locally. Then we distribute those unknown hashes among the peers we know have those transactions and retrieve the actual transaction. Lastly for every received transaction we do a full verification which should add it to our local mempool if everything checks out.
Open design questions
Max transactions we acquire per peer: 25.000
Amount of transaction per request: 500
After 10 minutes
This fixes #2625 .
Pull request checklist
clippy
andrustfmt
warnings.