You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full transactions received via the InboundService need to be verified and if they pass, inserted into mempool::Storage. A nice place to do this is as a mempool::Request type. From there, the Service will be able to insert this UnminedTx into the mempool::DownloadsStream. mempool::Downloads must be updated to handle a method that accepts the full transaction (verify(tx: UnminedTx) instead of download_and_verify(txid: UnminedTxId)?) vs just the transaction id, and skips the downloading, as it's moot. Everything else remains the same, about the stream inserting the verified transaction into the mempool::Storage if it passes.
It would be moved to inside Mempool and initialized there. The only issue is passing everything that it requires: the network (from where it gets outbound), state and transaction verifier services. The network is the tricky part since inbound.rs has a lot of logic to handle waiting it to be ready. Maybe we can simplify this by only creating the mempool service when the network service is ready? Not sure.
Another part that I'm not sure of is how to "drive" the downloader. Currently this is done in the poll_ready of the Inbound:
I guess we could just do the same in the Mempool::poll_ready, but I'm not 100% sure it will work the same way.
A small heads up: #2727 adds an GossipedTx enum that can be used for the request to download/verify a transaction regardless if it's just a txid or the whole tx.
Motivation
Full transactions received via the
InboundService
need to be verified and if they pass, inserted intomempool::Storage
. A nice place to do this is as amempool::Request
type. From there, theService
will be able to insert thisUnminedTx
into themempool::Downloads
Stream
.mempool::Downloads
must be updated to handle a method that accepts the full transaction (verify(tx: UnminedTx)
instead ofdownload_and_verify(txid: UnminedTxId)
?) vs just the transaction id, and skips the downloading, as it's moot. Everything else remains the same, about the stream inserting the verified transaction into themempool::Storage
if it passes.Designs
https://jamboard.google.com/d/1HUhdqx8afJUqgiBdBcjCw0aAfDod9R9KBJeAH24U1Qg/viewer?f=0
https://docs.google.com/document/d/10PP6wKlnS5gannRph_EQ8V9diR7byddf3W2YFZ564FU/edit#heading=h.1v3bcppsa6wq
Related Work
Related but not resolving: #2708
The text was updated successfully, but these errors were encountered: