fuel-core
fuel-core copied to clipboard
WIP: Pooled transactions exchange protocol
Work in progress
Scope and design
Partially closes https://github.com/FuelLabs/fuel-core/issues/1049. I say partially because this work will be split into two:
- An initial pooled transactions "handshake" between two newly connected peers, where these two peers will share their pooled transactions. This is the scope of this PR. Then, in a follow-up PR:
- Another sub-service will periodically request pooled transactions from a random, small subset of known peers and compare and share their pooled transactions like the first part of the protocol.
- More details in the RFC.
These two combined will lead to the mempool being more resilient.
Tasks and TODOs
- [x] Create and organize the new
TxPoolSync
service under the current architecture; - [x] Setup the communication between the new service and the main transaction pool service, and the p2p service (the majority of this work falls under this task);
- [x] Implement the pooled transaction sharing
- [x] Current blocker: node gets penalized and disconnected when sending transactions
- [x] Write new tests
- [ ] Fix old tests and CI-related stuff broken due to these changes;
- [ ] Clean-up code (
TODOs
, improve quality, etc.) - [ ] Write more documentation;
To make things a bit easier to review, is it possible/feasible to separate out the nonfunctional formatting changes into a separate PR?
To make things a bit easier to review, is it possible/feasible to separate out the nonfunctional formatting changes into a separate PR?
Yup, I'll revert those; those were automatically done by my editor + my current version of the formatter. I'll do it asap