Repository navigation
Conversation
added 2 commits
October 20, 2026 14:09
Track permission-update owners when blocks are rolled back so cached transaction verification is invalidated. Clear transaction results before caching relay messages and omit full hash lists when transaction inventory is rate limited.
Release the global sync request on every block processing failure so another peer can supply the block without waiting for cache expiration. Disconnect only the sender and preserve other peers' queued blocks and sync progress. Reject advertised blocks whose witness is outside the active set instead of silently dropping them. Keep advertisement recovery on the sync path and retain log-only handling for failures during advertised block application. Unify block application errors as BAD_BLOCK while retaining their causes. Log P2P failure details without a stack trace and keep stack traces for unexpected sync failures.
Clear results only on the transaction copy cached for relay. Keep the original capsule unchanged so broadcasting cannot erase pending execution results or race with block assembly.
halibobo1205
approved these changes
Oct 21, 2026
halibobo1205
left a comment
Collaborator
There was a problem hiding this comment.
LGTM.
Before merge: CI last ran before #7035 landed, so a re-run on the current base would be good. This also conflicts with #7005 in BlockMsgHandler, and the two PRs handle inactive-witness blocks and failed fetch retries differently, so whichever lands second needs a behaviour decision, not just a rebase.
317787106
reviewed
Oct 21, 2026
Comment on lines
+365
to
+368
| if (!witnessScheduleStore.getActiveWitnesses().contains(block.getWitnessAddress())) { | ||
| throw new P2pException(TypeEnum.BAD_BLOCK, | ||
| "Block witness is not active: " + block.getBlockId().getString()); | ||
| } |
added 2 commits
October 26, 2026 17:30
Avoid disconnecting a peer for a single inactive-witness block. Separate basic block validation from advertised-block witness checks, record the last inactive-witness block time per connection, and disconnect only on a repeat within half the current maintenance interval. Log every inactive-witness occurrence before applying the disconnect condition. Keep timestamp, Merkle-root and signature validation ahead of the witness check and allow isolated occurrences to continue processing.
Apply the advertised-block witness activity and repeat-offense checks before basic block validation. Log inactive-witness occurrences before rejecting repeats, and retain timestamp, Merkle-root and signature checks for every response that passes the witness check.
317787106
approved these changes
Oct 26, 2026
Return the advertised-block validation result and stop processing blocks from inactive witnesses before synchronization or relay. Preserve basic block validation and the existing disconnect policy for repeated inactive-witness blocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Release the global sync request on every block processing failure so another peer can supply the block without waiting for cache expiration. Disconnect only the sender and preserve other peers' queued blocks and sync progress.
Separate basic block validation from advertised-block witness checks. Check witness activity first and log and record inactive-witness blocks per connection. Apply the repeated-occurrence disconnect rule before timestamp, Merkle-root and signature validation; all blocks that pass that rule still undergo basic validation. Disconnect the sender with BAD_BLOCK only when another inactive-witness block arrives within half the current maintenance interval. A first occurrence, or one outside that interval, continues normal block processing. Keep advertisement recovery on the sync path and retain log-only handling for failures during advertised block application.
Unify block application errors as BAD_BLOCK while retaining their causes. Log P2P failure details without a stack trace and keep stack traces for unexpected sync failures.
Track permission-update owners when blocks are rolled back so cached transaction verification is invalidated. Clear transaction results before caching relay messages and omit full hash lists when transaction inventory is rate limited.
Remove the ret fields from transactions before broadcasting them to peers.
Remove the verbose log that prints the entire peer-provided transaction hash list when TRX inventory messages are dropped due to rate limiting.
Why are these changes required?
This PR has been tested by:
./gradlew clean build -x teston ARM64 / JDK 17.BlockFetchFailureTest,TronNetDelegateTest,BlockMsgHandlerTest, andBlockAlreadyKnownCounterTest(36 tests).:framework:checkstyleMain,:framework:checkstyleTest, and:plugins:checkstyleMain.Follow up
Extra details