fix(net): skip rejected transaction broadcasts - #50
Conversation
|
Warning Review limit reached
Next review available in: 17 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughChangesTransaction admission handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
c9e2e37 to
a6c2d84
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@framework/src/main/java/org/tron/core/db/Manager.java`:
- Around line 293-301: Update rePushLoop and its getRePushTransactions
processing so a temporarily rejected transaction is removed from the queue and
scheduled for a later retry instead of remaining at the head during sleep; allow
subsequent transactions to be processed immediately while preserving eventual
retry behavior. Add coverage for a rejected Shielded transaction followed by an
admissible transaction, verifying the latter is re-pushed without head-of-line
blocking.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 97f5e428-e48d-4d86-9add-adb7dede9dcc
📒 Files selected for processing (8)
framework/src/main/java/org/tron/core/Wallet.javaframework/src/main/java/org/tron/core/db/Manager.javaframework/src/main/java/org/tron/core/net/TronNetDelegate.javaframework/src/main/java/org/tron/core/net/messagehandler/TransactionsMsgHandler.javaframework/src/test/java/org/tron/core/WalletMockTest.javaframework/src/test/java/org/tron/core/db/ManagerMockTest.javaframework/src/test/java/org/tron/core/net/TronNetDelegateTest.javaframework/src/test/java/org/tron/core/net/messagehandler/TransactionsMsgHandlerTest.java
🚧 Files skipped from review as they are similar to previous changes (6)
- framework/src/test/java/org/tron/core/net/messagehandler/TransactionsMsgHandlerTest.java
- framework/src/main/java/org/tron/core/Wallet.java
- framework/src/test/java/org/tron/core/net/TronNetDelegateTest.java
- framework/src/main/java/org/tron/core/net/messagehandler/TransactionsMsgHandler.java
- framework/src/main/java/org/tron/core/net/TronNetDelegate.java
- framework/src/test/java/org/tron/core/WalletMockTest.java
6a34eb4 to
e6095dc
Compare
e6095dc to
9f2908d
Compare
What does this PR do?
This PR propagates the local transaction admission result to RPC and P2P callers. When the Shielded transaction pending pool is full, RPC returns
SERVER_BUSY, removes the prewritten transaction ID cache entry, and does not broadcast the transaction. The P2P handler logs and drops transactions that were not admitted locally.Regression tests cover RPC rejection, admission-result propagation, and P2P no-broadcast behavior.
Why are these changes required?
Manager.pushTransactionreturnsfalsewhen the Shielded transaction pending pool reaches its limit. The previous RPC and P2P callers ignored this result and continued broadcasting a transaction that had not entered the local pending pool.This PR intentionally leaves re-push behavior unchanged.
rePushLoopreads the queue head withpeek(), so retaining a capacity-rejected transaction would repeatedly select the same transaction and block every transaction behind it. Preserving eventual retry safely requires a separate delayed-retry mechanism with explicit fairness and lifecycle handling, which is outside the scope of this focused fix. Keeping the original re-push behavior also makes transient capacity rejection consistent across RPC, P2P, and re-push: the transaction is dropped rather than broadcast or retained.This PR has been tested by:
WalletMockTest,TronNetDelegateTest, andTransactionsMsgHandlerTestframework:checkstyleMainandframework:checkstyleTestFollow up
A non-blocking delayed-retry design can be considered separately if preserving temporarily rejected re-push transactions becomes a requirement.
Extra details
No database schema, consensus, protocol, or configuration changes are included. The behavioral change is limited to local transaction admission and broadcast handling.