Skip to content

UTB parity 1/4: network names (TESTNET2) and the X-SDK-Version header - #1

Merged
ristik merged 1 commit into
mainfrom
dev3/java-1-network-version
Nov 8, 2026
Merged

ristik merged 1 commit into
mainfrom
dev3/java-1-network-version

Conversation

@ristik

@ristik ristik commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Owner §51, plan briefs/java-utb-parity-plan.md, PR 1. Mirrors JS SdkVersion.ts, NetworkId.ts, AggregatorClient.ts, JsonRpcHttpTransport.ts and Rust network_id.rs, client/http.rs.

  • NetworkId.TESTNET2 (4) added; TESTNET (2) removed with no alias. fromId accepts any valid id (2 stays an unnamed valid id). README updated.
  • SdkVersion.VERSION is generated from the Gradle project version (task generateSdkVersion); header X-SDK-Version: java/<version> on every call of JsonRpcHttpTransport. SdkVersionHeader.sdkDefault()/of(value)/disabled(); of accepts printable ASCII only. New JsonRpcAggregatorClient constructor takes the setting; existing constructors keep the default (on).
  • Tests: wire tests (MockWebServer) for default, custom, disabled on getLatestBlockNumber, getInclusionProof, getInclusionProofs; rejected values; network-name tests.

Evidence: ./gradlew test checkstyleMain animalsnifferMain under Temurin 11: BUILD SUCCESSFUL (checkstyle only prints pre-existing import-order warnings).
Not merged by me; owner list.

…rsion header java/<Gradle version> on every HTTP call, with override and disable

TESTNET is removed with no constant for the old testnet; id 2 stays a valid unnamed id. SdkVersion is generated from the Gradle project version. SdkVersionHeader (default, of(value), disabled) is carried by JsonRpcHttpTransport, so every call, and the trust-base GET of a later PR, sends it. Wire tests for default, custom value, disabled and rejected values.
@ristik

ristik commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

java#1 at d28702d: no blockers. APPROVE once CI is green (this PR has no CI run yet; I'm closing and reopening it to trigger one). NetworkId.TESTNET2 (4) replaces TESTNET (2), with no constant for 2, matching JS and Rust. X-SDK-Version: java/<version> comes from a SdkVersion class generated from the Gradle project version, so it can't drift from the artifact. SdkVersionHeader has default, disabled and of(value) (printable ASCII, non-empty), and JsonRpcHttpTransport sends it on every call. Nit: if project.version is ever unset, SdkVersion.VERSION becomes "unspecified". A build check that refuses that would keep a release honest. The full suite passes at #7's head, which contains this PR (806 tests, 0 failures, JDK 11).

@ristik ristik closed this Nov 8, 2026
@ristik ristik reopened this Nov 8, 2026
@ristik

ristik commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

APPROVE at d28702d, for the owner's list. CI build (which includes javadoc) is green at this head. My review is above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant