Repository navigation
Conversation
Port tronprotocol/libp2p#171: upgrade snappy-java to 1.1.10.12 and Bouncy Castle bcprov, bcpkix and bcutil to 1.86. Align the root bcprov declaration with the vendored P2P dependency and regenerate SHA-256 verification metadata. The new checksums match the upstream import.
Synchronize the in-tree P2P module from libp2p release-v2.3.0 at 5bae7b902f45a9bbd71e492026b4c2c0b6ef0767 through 94dbc75896dc68c72934276c8d3143b4a3540363, following java-tron#7065. Include libp2p#169, tronprotocol#170 and tronprotocol#172-tronprotocol#180; import tronprotocol#171 separately. Retain java-tron's blocked-IP policy, logging conventions, existing payload normalization and handshake deadline coverage. Apply the raw IPv4/IPv6 bounds and IPv6 validation to application-layer HELLO as well. Preserve existing tests when upstream introduces a class with the same name, and use local signed TXT records for the moved DNS sync test. Record the upstream PR mapping and DNS URL/signing-key migration notes in p2p/README.md. Leave wire formats and consensus rules unchanged. Validate on macOS ARM64 / JDK 17 with clean build -x test, the full test suite (5,639 tests, 16 skipped, zero failures/errors), the CI Checkstyle gate plus P2P main/test Checkstyle, check_math_usage.sh and diff --check.
Extract raw IPv4/IPv6 address bounds and IPv6 syntax checks into NetUtil.validAddressFields for P2P HELLO, STATUS and application HELLO. Validate the raw fields before converting and validating the Node, preserving the existing endpoint normalization and optional-from rules.
Stop FetchInvData retrieval and final transaction-batch sends after disconnection, and ignore disconnected peers at application dispatch. Deduplicate trust entries added after relay HELLO authentication and reject invalid explicit IPv4 discovery addresses during configuration. Select manually blocked channels under the admission lock and close them after releasing it, retaining silent closure and admission checks. Keep the README focused on module behavior and source provenance; leave the upstream PR list for the pull request description. Add regression coverage for the downstream handling and EventLoop blacklist closure. Validate targeted framework/P2P tests, Checkstyle, the forbidden-Math gate and a clean build without the full test suite.
317787106
added a commit
to 317787106/java-tron
that referenced
this pull request
Nov 10, 2026
Keep the overlapping HELLO address validation and regression coverage in PR tronprotocol#7098, leaving this branch focused on sync request-cache cleanup.
xxo1shine
approved these changes
Nov 10, 2026
Use messageTypes and declare the channel map so the documented handler compiles. Include required imports and identify the separate Java source files. Closes JT-909
SeriousCoding789
approved these changes
Nov 10, 2026
3for
reviewed
Nov 10, 2026
3for
reviewed
Nov 10, 2026
3for
reviewed
Nov 10, 2026
3for
reviewed
Nov 10, 2026
Keep batch preparation synchronized and perform inventory sends after releasing the service monitor. Cover concurrent peer cleanup with a bounded regression test.
Check the runtime blocked-IP policy before pending admission and before sending a rejection HELLO. Cover blocked sources with temporary bans or saturated quotas and policy changes during admission.
xxo1shine
approved these changes
Nov 10, 2026
3for
reviewed
Nov 10, 2026
| private void disconnect() { | ||
| logger.warn("Close peer {}, pending outbound data limit exceeded", | ||
| channel.getInetSocketAddress()); | ||
| channel.close(); |
Collaborator
There was a problem hiding this comment.
[Non-blocking Follow-up] The move of sendInv() outside the AdvService monitor breaks the previously reported lock cycles, so I consider the original deadlock concern addressed.
Always queuing physical eviction closure, including when already on the victim's EventLoop, can remain an upstream hardening follow-up to reduce callback reentrancy risks for future callers. This should preserve immediate logical disconnection and correct write-budget accounting.
The additional hardening does not need to block this PR.
3for
approved these changes
Nov 10, 2026
This was referenced Nov 24, 2026
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?
Synchronize java-tron's in-tree
:p2pmodule with all twelve libp2p PRs merged after java-tron #7065. The source comparison onrelease-v2.3.0runs from5bae7b902f45a9bbd71e492026b4c2c0b6ef0767through94dbc75896dc68c72934276c8d3143b4a3540363.5f30d6894dbc7506ec8366937e611437beb888916888c19be357e0d752249371f4d931ceeac6d29da652Include the following java-tron integration changes:
NetUtil.validAddressFields()and apply them to P2P HELLO/STATUS and application-layer HELLO, before Node conversion. Preserve application HELLO's optionalfrombehavior and existing IPv6 fallback for invalid IPv4 values within the length limit.AdvServicemonitor, then send the prepared inventory after releasing it.node.discovery.external.ipunless it is an IPv4 literal. Empty settings retain automatic detection and LAN fallback.Align the root
bcprovdeclaration withbcpkix/transitivebcutilat 1.86 and regenerate dependency-verification checksums. Adapt the import to java-tron's logging and existing tests. The moved DNS full-sync test uses local signed TXT records instead of a live public DNS tree. Keep source provenance and DNS migration instructions inp2p/README.md; list the upstream PRs here. Correct the TCP handler examples to usemessageTypes, declare the channel map, include the required imports, and place public classes in separate Java files.Why are these changes required?
Backlogged TCP writes can retain resources, disconnect/registration races can stall or corrupt peer lifecycle handling, and queued frames can continue processing after closure. The discovery and DNS fixes address oversized responses, incorrect probe selection, redundant traversal, validation gaps, and stale publication decisions. The java-tron changes complete the integration by stopping downstream work after disconnect, keeping inventory sends outside the advertisement-state critical section, avoiding repeated trust-list growth, and reporting invalid advertised IPv4 configuration before networking starts. The README corrections let consumers compile the documented handler against the actual API.
This PR has been tested by:
Local validation on macOS ARM64 / JDK 17:
13b06ae7ca): the full./gradlew testsuite passed with 5,639 tests, 16 skipped, and zero failures/errors. This included the signature/address compatibility, P-256, precompiled-contract, batch-signature and multisignature tests.3d3eaa5921): all 643 P2P tests passed (4 skipped), together with 24 framework HELLO/handshake/dispatch tests.b675a2685d): 95 targeted framework tests passed. The blacklist follow-up also passed 41 P2P tests and 37 framework management/lifecycle tests; the two lifecycle cases overlap with the earlier framework run.b53a84d0d2): the three Java source examples compiled withjavac --release 8, and registration of the example's TEST message type passed.c68a7397a9): all 12 targeted framework tests passed (AdvServiceTest: 3;P2pEventHandlerImplTest: 9). The bounded concurrent-cleanup regression failed with the previous lock scope and passed after the adjustment; it also verifies the inventory/fetch messages and peer cleanup.c68a7397a9),./gradlew clean build -x testpassed, including FullNode, standalone P2P and tools packaging. The CI Checkstyle gate (:framework:checkstyleMain :framework:checkstyleTest :plugins:checkstyleMain), P2P main/test Checkstyle,bash .github/scripts/check_math_usage.sh, andgit diff --checkpassed.The full repository test suite was not rerun after the initial migration. Local checks cover ARM64/JDK 17; the remaining platform/JDK combinations are covered by the PR's CI matrix. Manual node/load testing was not performed for this PR.
Follow up
Extra details
treeUrlsand cross-treeknownTreeUrls. Upgrading clients or republishing alone does not repair a previously distributed incorrect URL; key rotation is not required.