-
Notifications
You must be signed in to change notification settings - Fork 360
chore: Add Comet mempool and eth txpool metrics #1443
Conversation
WalkthroughThe Cosmos codebase has been updated to enhance transaction telemetry within the mempool. This includes tracking metrics for CometBFT transactions, conditions for transaction ejection, and transaction pool statistics. These changes will provide better insight into the transaction lifecycle, helping developers and network maintainers to monitor and optimize the network's performance. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- cosmos/runtime/txpool/ante.go (3 hunks)
- cosmos/runtime/txpool/handler.go (3 hunks)
- cosmos/runtime/txpool/mempool.go (3 hunks)
- cosmos/runtime/txpool/mocks/tx_sub_provider.go (1 hunks)
- cosmos/runtime/txpool/telemetry.go (1 hunks)
Additional comments: 9
cosmos/runtime/txpool/telemetry.go (1)
- 25-45: The addition of new metric keys in
telemetry.go
is consistent with the PR's objective to enhance telemetry capabilities. The naming convention for the keys is consistent and follows the prefix pattern established for the CometBFT metrics. No issues found.cosmos/runtime/txpool/mocks/tx_sub_provider.go (1)
- 45-47: The
Stats
method inmocks/tx_sub_provider.go
has been correctly added to align with the updatedTxSubProvider
interface. It returns two integers, presumably for pending and queued transactions, and is initialized to return zeros, which is appropriate for a mock implementation.cosmos/runtime/txpool/ante.go (2)
- 40-48: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [43-58]
The
AnteHandle
method inante.go
has been updated to include telemetry increments for transactions from the CometBFT mempool. This aligns with the PR's objective to track transaction conditions and outcomes. The telemetry increments are placed correctly within the conditional checks for transaction ejection.
- 81-92: The
shouldEjectFromCometMempool
method has been updated with telemetry increments for different ejection criteria. The increments are correctly placed after each condition check, which will provide detailed insights into why transactions are being ejected.cosmos/runtime/txpool/mempool.go (2)
- 111-114: The
Insert
method inmempool.go
has been updated to set gauges for pending and queued transactions using theStats
method from theTxPool
interface. This is consistent with the PR's objective to provide real-time monitoring of the transaction pool's state.- 133-139: The
Insert
method also sets a gauge for the mempool size and increments a counter for known transactions. These changes are consistent with the PR's objectives and are correctly placed within the method's logic flow.cosmos/runtime/txpool/handler.go (3)
- 55-55: The
Stats
method has been added to theTxSubProvider
interface inhandler.go
. This change is necessary for themainLoop
andfailedLoop
methods to retrieve transaction statistics and update telemetry metrics.- 156-159: In the
mainLoop
method, theStats
method is called to retrieve transaction statistics, and telemetry metrics are updated accordingly. This is consistent with the PR's objectives to enhance telemetry capabilities.- 176-176: The
failedLoop
method correctly increments a telemetry counter for broadcast retries, which aligns with the PR's objective to provide insights into the reliability of the transaction broadcasting process.
Summary by CodeRabbit