-
Notifications
You must be signed in to change notification settings - Fork 282
feat(txpool): more txn tracing logs #1167
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
feat(txpool): more txn tracing logs #1167
Conversation
WalkthroughThis pull request adjusts logging levels in the transaction pool by changing several log statements from Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/tx_pool.go (1)
1463-1467: Review of Reorg Logging LevelWithin the
runReorgfunction, there are DEBUG/TRACE logs reporting the number of promoted transactions and, conditionally, dumping tx hashes. Given the PR objective to raise the log level for transaction tracing, please double-check whether theselog.Tracestatements should now also be switched tolog.Debugor kept at Trace to avoid excessive verbosity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between d482b2f and 6956a3fbc53351819574fa8c303e9cc62ffd710d.
📒 Files selected for processing (2)
core/tx_pool.go(28 hunks)params/version.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test
- GitHub Check: Analyze (go)
🔇 Additional comments (15)
params/version.go (1)
27-28: VersionPatch Update to Patch 36The version patch constant has been updated from 35 to 36. This correctly reflects the intended patch version bump for the release.
core/tx_pool.go (14)
109-109: Updated dumpReorgTxHashThreshold ConstantThe constant is now defined as 100 with a corrected comment (“transaction hashes” instead of a typo). This provides better control over the verbosity of transaction hash dumps during reorg events.
469-472: Enhanced Debug Logging for Transaction EvictionIn the eviction loop, the log statement now uses the DEBUG level to report when a queued transaction is evicted due to timeout. The message includes relevant details (account, hash, lifetime versus limit) that will aid in troubleshooting.
543-554: Consistent Debug Logging in SetGasPriceWithin the
SetGasPricefunction, the log message reporting removal of transactions below the new price limit now uses DEBUG level. This change makes it easier to track when transactions no longer meeting the updated threshold are being removed.
856-876: Consistent Debug Logging for Transaction AdditionsInside the
addfunction, several log statements have been changed to DEBUG level. In particular, when an already known, skipped, or invalid transaction is encountered, a detailed debug message is emitted. This aids in understanding why a transaction is not added to the pool.
880-884: Debug Logging for Underpriced Transaction HandlingThe updated log message now reports via DEBUG when an underpriced transaction is discarded because the pool is full. The inclusion of details such as the transaction hash and gas fee/tip values enhances traceability.
900-904: Enhanced Debug Logging for Transaction Pool OverflowWhen the pool is full and the new remote transaction cannot be admitted, the DEBUG log now clearly states that the transaction is being discarded due to overflow conditions. This change aligns with the PR objective to provide more granular log output.
1060-1061: Clear Debug Log on Transaction PromotionThe DEBUG log in
promoteTxnow announces when a transaction is promoted from the future queue to the pending set. This additional contextual information will help in tracking the flow of transactions through the pool.
975-978: Debug Logging for Queued Transaction ReplacementWithin the
enqueueTxmethod, the log statement that discards an underpriced queued transaction now uses DEBUG level. This change ensures that queued transaction rejections are clearly communicated.
1233-1234: Debug Log for Transaction RemovalIn the
removeTxfunction, a DEBUG log statement now indicates when a transaction is removed from the pool. This is useful for confirming that removal operations are executing as expected.
1690-1694: Debug Logging for Pending Transaction TruncationThe log message during pending queue truncation now reports at DEBUG level that a pending transaction is being removed to comply with the set hard limit. This added log detail will help diagnose pool size management issues.
1744-1748: Enhanced Debug Logging for Fairness Enforcement in Pending TransactionsThe changes now include DEBUG logs that report when fairness‐exceeding pending transactions (those that exceed the per‐account limit) are removed. This improves visibility into how pending transactions are being balanced among accounts.
1814-1818: Debug Logging in Queue TruncationIn the
truncateQueuefunction, the DEBUG log now clearly shows when queued transactions that exceed the fairness threshold are removed. This is crucial for understanding adjustments to the queue size.
1850-1868: Consistent Debug Logging during Demotion of Unexecutable TransactionsThe
demoteUnexecutablesfunction now logs at DEBUG level when:
• A pending transaction with a low nonce is removed.
• An unpayable pending transaction is removed.
• A transaction is demoted back to the future queue.These messages give a transparent view of the demotion process and help trace why certain transactions no longer remain in the pending set.
1536-1546: Detailed Logging during Transaction Reorg ResetThe DEBUG logs in the
resetfunction now clearly report when transactions are removed from the old chain and re-injected into the pool. These comprehensive messages (e.g., “TXPOOL_REORG: TX removed from old chain” and “TXPOOL_REORG: TX added in the chain”) will greatly help in diagnosing reorg events.
6956a3f to
9d67639
Compare
77b494f to
43ac794
Compare
1. Purpose or design rationale of this PR
Increase transaction tracking logs to
DEBUGlevel, so that these logs can be enabled without other trace logs.Add more logs to cover more cases, e.g.,
Dropped,Executed,Reorged.2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.gobeen updated?4. Breaking change label
Does this PR have the
breaking-changelabel?Summary by CodeRabbit