fix: correctly set the recovered mempool parts#2163
Conversation
| } | ||
| // check if we have any transactions that are in the compact block | ||
| go blockProp.recoverPartsFromMempool(cb) | ||
| blockProp.recoverPartsFromMempool(cb) |
There was a problem hiding this comment.
this is beneficial because we don't want to act on haves before we know what we have locally and what we should request
There was a problem hiding this comment.
iirc didn't we add the coroutine part as mempools we're blocking or slow?
could that happen now? If the mempool was very congested, would that slow consensus?
There was a problem hiding this comment.
I think the goroutine was added as a premature optimization. Even if the mempool is very congested, retrieving transactions from the mempool should be fast enough and if we have any local parts, it's better to retrieve them rather than request them. If this process is slow, I guess the right is to speed it up instead of making it run in parallel.
There was a problem hiding this comment.
also, if the mempool is very congested, we just won't find any transactions in it that are good for us, and this will exist fast.
Improves on: #2161