-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
core/txpool/blobpool: return all reinject-addresses #30518
Conversation
This is interesting. On one hand, I would have expected myself to check empty-ness and not add a useless field to the map (i.e. which would make me believe it was intentional); on the other hand, I would expect myself to document such a subtle API interface somewhere to avoid these refactors. I.e. Completely unsure about it :D |
for addr, txs := range reinject {
// Blindly push all the lost transactions back into the pool
for _, tx := range txs {
if err := p.reinject(addr, tx.Hash()); err == nil {
adds = append(adds, tx.WithoutBlobTxSidecar())
}
}
// Recheck the account's pooled transactions to drop included and
// invalidated ones
p.recheck(addr, inclusions)
} Ugh, yeah, so this uses the The failure is not if Filter somehow failed in reorg, the problem if no txs were lost at all. Then lost will be empty and not added at all, so recheck will not run for the included address, so it won't process the txs being included either. Pool goes out of sync with the chain. I'll try to make a test for this. |
|
Pushed a test that reproes the bug this PR fixes. Also, FYI, the blobpool currently is 100% totally broken without this fix. So we need a hotfix release. |
FWIW, the test is very ugly because previously we didn't have to have a live chain, but this reorg functionality does depend on a bunch of chain ops. We can emrge as is for now and then see if we can clean up the tests soemhow with a live chain. Gonna be annoying though. |
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.
LGTM
7004182
to
abbd3d9
Compare
This PR reverts part of #30437.
I failed to take note of this at the time, but now I am unsure if the "avoid reinject adding empty value" part was correct.
Previously,
reinject
would contains an empty list for the addressaddr
, and the blobpool Reset function would then callp.recheck
on thataddr
I think the new code is wrong: it may very well happen that we reorg out a transaction, but it is not eligible for re-injection, because the filtering fails:
That is: we reorg-out a regular transaction, it is not eligible for re-injection (in the blob pool), and thus the blob pool becomes off: it's should have invoked
recheck
on the account.This PR restores the earlier behaviour. I'm still not 100% sure which is correct, opening for discussion.