-
Notifications
You must be signed in to change notification settings - Fork 11
*: add broadcast local txs feature #192
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,8 +247,14 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { | |
| log.Warn("Sanitizing invalid txpool journal time", "provided", rejournal, "updated", time.Second) | ||
| rejournal = time.Second | ||
| } | ||
| eth.localTxTracker = locals.New(config.TxPool.Journal, rejournal, eth.blockchain.Config(), eth.txPool) | ||
| broadcastPendingLocalTx := config.TxPool.BroadcastPendingLocalTx | ||
| if broadcastPendingLocalTx < time.Second { | ||
| log.Warn("Sanitizing invalid txpool broadcast local tx time", "provided", broadcastPendingLocalTx, "updated", time.Second) | ||
| broadcastPendingLocalTx = time.Second | ||
| } | ||
| eth.localTxTracker = locals.New(config.TxPool.Journal, rejournal, eth.blockchain.Config(), eth.txPool, broadcastPendingLocalTx) | ||
| stack.RegisterLifecycle(eth.localTxTracker) | ||
| eth.txPool.PendingLocalTxsPublisher = eth.localTxTracker | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note on the main changes in this PR: The key refactor is in txPool's
Since While the data flow feels a bit indirect (handler → txPool → localTxTracker, instead of handler → localTxTracker), I couldn’t immediately think of a cleaner solution without making broader changes. Overall, I think this approach is fine, so I’ll approve this. Reference of old customized commit: bf10d46#diff-4d08b06f78070fa573caaaa4b6b56dd5cc7bbeb03b04d1b93cafa167fc5577e5R374
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for organizing! The data flow:
|
||
| } | ||
| // Permit the downloader to use the trie cache allowance during fast sync | ||
| cacheLimit := cacheConfig.TrieCleanLimit + cacheConfig.TrieDirtyLimit + cacheConfig.SnapshotLimit | ||
|
|
||
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.
could this be removed?
Uh oh!
There was an error while loading. Please reload this page.
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.
Here, I followed the approach of
Rejournal.store the config value in
legacypool.Configand use it ineth/backend.goforTxTrackerref.
go-ethereum/eth/backend.go
Line 245 in edd6b15