-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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/legacypool: locals-tracker (second attempt) #29297
Conversation
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.
Looks nice to me. I found it a little surprising though that TxTracker
is in legacypool
and only operates on a single subpool? Curious your reasoning here?
I imagined that the tracker would hold all different types of txs and check/resubmit them to the correct pool.
core/txpool/legacypool/tx_tracker.go
Outdated
nStales = 0 | ||
nOk = 0 |
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.
nStales = 0 | |
nOk = 0 | |
numStales = 0 | |
numOk = 0 |
nit: extra two chars add decent readability
Yeah, the implementation is old, I just rebased and fixed it up to compile. You are right that it should not be 'legacy only' |
Marking this for triage again, would like to have a discussion about if it's an approach that we think is good or not. If not, then I'll drop it. Otherwise, I'll fix it up proper, which means (possibly) integrating it with blobpool/subpools in general, and remove hacks. |
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.
SonuG56
Comments addressed -- it now interacts with the mail pool instead of the legacy subpool. Package-wise, it resides in the This PR so far only contains the locals-tracker and disables the locals-tracking in the pools. It does not delete the actual code. I'm thinking that it's easier to review this PR as is. And then do a follow-up PR which just wipes the old locals-handling, and moves the |
This needs to be considered:
|
About
|
I think one area where local transaction handling might be interesting in the future is once we implement some flavor of inclusion lists, where it would make sense for a node to add their local transactions to the inclusion list in order to force the block builders to include them. |
For inclusion lists, that will be a whole new API method, I'm sure we'll figure it out later. For now, I have reused the It means that the semantics offered by this PR is slightly different than the current way things work. Off the top of my head, I can't think of any obvious drawback or downside with the changes. |
…ocal txs core/txpool/legacypool: handle the case when journalling is disabled core/txpool: store txs to journal on insert
Looks like one of the tests panics
|
Thanks, it's fixed. The fix was already applied on "pt2". I don't really expect tests to pass in this PR: I do expect the tests to pass in that second PR. But that one is so large, I felt it's better to disuss the crux of the new mecanism here. Maybe that's not a great idea, and I should just close this one? |
Closing in favour of #30559 |
This is a re-run of #27535
I still think the idea is solid. Basically, our nodes transaction pool should have no concept of
locals
. Therefore, it is also a very good simulation/approximation of how our peers' pools behave.This PR implements a locals-tracker, which basically is a little thing which, from time to time, asks the pool "did you forget this transaction?". If it did, the tracker resubmits it.
If the txpool had forgotten it, chances are that the peers had also forgotten it. It will be propagated again.
Doing this change means that we can simplify the pool internals, quite a lot (not included in this PR).
This PR as is, does not integrate with worker: hence, block building will pay no special attention to local transactions. If we want to use the approach in this PR, we can discuss if / how to do such an integration (now that mining-pools no longer function like they did earlier, during ethash, I'm not sure that local txs in block-building is as important any longer) .
cc @lightclient since we discussed this a bit