feat(consensus): add RPC endpoint to query signing tx count by epoch#2223
feat(consensus): add RPC endpoint to query signing tx count by epoch#2223benjamin202410 wants to merge 6 commits intodev-upgradefrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new XDPoS RPC API for querying signing-transaction counts per masternode for a given epoch boundary, and reduces verbosity of some v2 timeout logs.
Changes:
- Add
GetSigningTxCountByEpochto the XDPoS consensus RPC API. - Expose the new method via
internal/web3extasXDPoS_getSigningTxCountByEpoch. - Demote two
getTCEpochInfologs fromInfotoDebugin the v2 engine.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
consensus/XDPoS/api.go |
Implements the new RPC method to compute signing-tx counts by scanning blocks in an epoch. |
internal/web3ext/web3ext.go |
Adds the Web3 extension method wiring for the new RPC call. |
consensus/XDPoS/engines/engine_v2/timeout.go |
Lowers log level for timeout/epoch-info messages to reduce noise. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed changes
Add new GetSigningTxCountByEpoch API method that returns signing transaction
counts for all masternodes (including non-active ones) within a specified epoch.
The method validates that the provided block number is an epoch-switch block,
then walks backwards through the epoch collecting signing transactions at
MergeSignRange boundaries.
Also reduces log verbosity by changing two timeout-related log statements from
Info to Debug level in the v2 consensus engine.
Output:
Changes:
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that