Skip to content

UTB parity 8/8: approved release pins, real-seal tests, offline-to-new-epoch tests - #8

Merged
ristik merged 1 commit into
mainfrom
dev2/java-8-pins
Nov 8, 2026
Merged

ristik merged 1 commit into
mainfrom
dev2/java-8-pins

Conversation

@ristik

@ristik ristik commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Part of the Java UTB parity stack (owner §51, plan PR 8, the last of the stack). Stacked on #6 (file adapter), #5 (session), #4 (fetch loop) and dev3's #1-#3, #7. Mirrors JS release-pins/, scripts/release-pins/generate.mjs, ReleasePins.generated.ts, tests/unit/api/RealSealsTest.ts and Rust release-pins/, release_pins.rs, tests/{release_pins,utb_real_seals}.rs. Nothing here touches unicitynetwork/*. No public release before this lands, and this PR must not merge to anything that is published before unicity-ids#11 does.

Release pins

  • src/main/resources/release-pins/{manifest.json, unicity-trustbase.mainnet.cbor, unicity-trustbase.testnet2.cbor} are byte-identical to the JS and Rust SDKs' files (manifest sha256 7bbaad4fb41bc5e6d169a1c17d9834e792bd9cdceaf521faa8a25791d2dbe2c1; bundles 9d01b871…bd52 mainnet, 5b0a4fb7…f08a testnet2). Provenance: Unicity Trust Base version 2: GetTrustBase tags; mainnet and testnet2 genesis as one-entry bundles unicitynetwork/unicity-ids#11, source commit 513dc4fcf01ee802a97d59a5bc4e50ba64786d45, still open when this was written. If its files change, regenerate (below) and this PR changes with them; the table below changes with them.
Network Id Epoch (genesis = release tip) Genesis / pinned EntryID
mainnet 1 1 0b6f8143e19e2a585be3534e8f1062f36c3b9621e506158f10abfbc9a56f4e4c
testnet2 4 1 4b49eb2bb0729051b89a48668fd6ef1fda284aad2e10b7d5f23aad4b5faef37f

Real seals and the offline wallet

  • src/test/resources/vectors/real-seals/ is byte-identical to sdk-rust's (9e92ae2): per network the one-entry bundle and the answer of the public gateway (no key) to get_non_inclusion_proof.v1 for a random state id, fetched 2026-11-05. RealSealsTest: both seals verify through the V2 bundles (epoch 1, networks 4 and 1) with the answering shard pinned; controls: testnet2's seal under mainnet's bundle is AUTHORITY_REJECTED; with 0 or 1 of the 4 signatures damaged it still verifies, with 2, 3 or 4 damaged the quorum (3 of 4) is not met. These show existing seals authenticate under the V2 genesis; they are not evidence of a live epoch-2 handoff (nothing on those networks signs V2 entries yet).
  • OfflineWalletFutureEpochTest (synthetic signed epochs, MockWebServer): an epoch-1 token verifies with no request; an epoch-2 token is the typed NO_TRUST_BASE_ENTRY; verifyWithUpdate over HttpTrustBaseSource issues exactly one GET /api/v1/trustbases?from=2 (with the custom X-SDK-Version), then both tokens verify with no further request. A second test does the same through a TrustBaseSession (refresh saves), then a restarted session over the same store verifies the new epoch with no network.

Checks (real JDK 11, Temurin 11.0.33)

  • Full suite: ./gradlew test -> 886 tests, 0 failed, 4 skipped. animalsnifferMain (Android API 31) and checkstyle clean for the main code. No new dependency (Jackson, already used, reads the manifest).
  • Not run: JVM 17/21 matrix (fork CI builds on 21 and will), Android instrumentation, Windows, anything against a live endpoint. Docs/README for the new API are not in this PR.

…s, generated manifest), real-seal tests for mainnet and testnet2, offline-wallet-to-new-epoch tests
@ristik

ristik commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

java#8 (PR8/8) at 87b63c9: APPROVE, for the owner's list.

Checked

  • Release assets: release-pins/manifest.json (7bbaad4f…), unicity-trustbase.mainnet.cbor (9d01b871…) and unicity-trustbase.testnet2.cbor (5b0a4fb7…) are byte-identical to the JS and Rust release tables (unicity-ids#11 at 513dc4fc).
  • Real-seal fixtures: all six files are byte-identical to sdk-rust's tests/vectors/real-seals.
  • Packaging: the assets are in the built main jar (release-pins/*). Unlike JS and Rust, Java loads the table from classpath resources at class initialisation instead of generating source. That's fine for integrity, since each bundle's digest and full chain are verified when a session opens.
  • Tests: ./gradlew build (javadoc and animalsniffer) passes at this head, 886 tests, 4 skipped, 0 failures. CI is green.

Notes (not blocking)

  • Android: the table needs the jar's Java resources to survive app packaging. They normally do, but a shrinker (R8 or ProGuard) can drop them. A keep rule, or a line in the Android docs, would close that, and an Android-side test would be the real check.
  • Not covered: a two-process cross-SDK file run that includes Java (as noted on UTB parity 7/8: optional file adapter for the trust base cache #6), and a live aggregator run from Java.

Open item for the owner: unicity-ids#11 is still open (head 513dc4fc, the commit the manifest records). Nothing publishes from the fork, but the upstream PR must wait for it, and every SDK's table must be regenerated if its files change.

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