Repository navigation
Re-pin libsession-util to ce827173: ProProof loses its version field - #51
Merged
mpretty-cyro merged 1 commit intoAug 25, 2026
Merged
Conversation
Picks up the removal of `ProProof::version` (f0b9ab23, in #130). A proof's
format is bound into its signature by the 16-byte domain prefix that format
selects -- `ProProof_v0_____` -- so the version was never part of the signed
bytes and carrying it proved nothing. Protobuf tag 1 is retired and must not be
reused; a future format arrives as its own field rather than a version bump.
Not an inert bump this time: the glue mirrored the field on both sides of JNI,
and both halves have to move together.
- `ProProof.kt` drops `version` from the data class and from the `@Keep`
constructor the JNI layer calls.
- `pro_proof_util.cpp` drops the cached `getVersion` method id and the
`.version` initialiser, and -- the part no compiler checks -- narrows the
constructor signature from `(I[B[BJ[B)V` to `([B[BJ[B)V`. A stale signature
there is not a build error, it is a `NoSuchMethodError` the first time a proof
crosses the boundary.
`ProStatus` gained a fifth case in the same range, `Invalid` (= 5): the message
carried no proof this client can read, so it is delivered as non-Pro rather than
dropped. Nothing in the glue switches on the status -- it is a
`typealias ProProofStatus = Int` handed straight through -- but the companion
object mirrors the C enum, so `STATUS_INVALID` is added to keep that mirror
complete instead of leaving callers to hardcode 5. Note the intermediate commits
in #130 called this case `UnsupportedVersion`; f0b9ab23 replaced it with the
general `Invalid` before the merge, so `Invalid` is the name that landed.
Nothing else in the bump reaches the glue: only `session_protocol.{h,hpp}`
changed under `include/`, `ProProof::status()` keeps its signature, and the new
`attachments::encrypt` input validation is on the `std::filesystem::path`
overload, which this glue does not call.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mpretty-cyro
approved these changes
Aug 25, 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
Re-pins the vendored
libsession-utilsubmodule194752f0 -> ce827173, and moves the JNI glue offProProof::version, which that bump removes.Why
libsession-util #130 (
f0b9ab23) removedProProof::versionentirely. A proof's format is bound into its signature by the 16-byte domain prefix that format selects —ProProof_v0_____— so the version was never part of the signed bytes and carrying it proved nothing. Protobuf tag 1 is retired and must never be reused; a future proof format arrives as its own field rather than a version bump on the existing one.devcommit — maintainer's callNo libsession-util release contains this change yet.
v1.8.0is the latest tag and predates it, so this pins an untaggeddevcommit.Worth being explicit about how far that moves us, because it is further than usual:
v1.8.0is194752f0— the exact commitmainpins today. So this PR does not move from one dev commit to a newer one; it moves the submodule off a tagged release onto the untagged tip ofdev(ce827173, 2026-08-24, againstv1.8.0on 2026-08-12).That is a decision for the maintainer, not something this PR can settle. If the preference is to stay on releases, this should wait for the next libsession-util tag and re-point at that instead — the glue changes below stand either way.
Not the one-line bump it looks like
The glue mirrored
versionon both sides of the JNI boundary, so the field's removal is a compile break inpro_proof_util.cppand both halves have to move together.libsession-util194752f0→ce827173library/src/main/java/.../pro/ProProof.ktversionfrom the data class and the@Keepconstructor; addSTATUS_INVALIDlibrary/src/main/cpp/pro_proof_util.cppgetVersionid and the.versioninitialiser; narrow the constructor signatureThe one that is not a compile error, and so the one to review:
cpp_to_java_prooflooks the Kotlin constructor up by descriptor, and that descriptor narrows from(I[B[BJ[B)Vto([B[BJ[B)V. Leaving it stale would build cleanly and then throwNoSuchMethodErrorthe first time a proof crossed the boundary.ProStatusgained a caseProStatusgained a fifth member in the same range —Invalid(= 5): the message carried no proof this client can read, so it is delivered as non-Pro rather than dropped.Nothing in this repo switches on it.
ProProofStatusis atypealiasforIntandDecodedPro.statuspasses the value straight through, so there is no exhaustivewhento break. But theProProofcompanion object mirrors the C enum, soSTATUS_INVALID: ProProofStatus = 5is added to keep the mirror complete rather than leaving callers to hardcode5.Naming note for anyone reading the upstream branch: the intermediate commits in #130 called this case
UnsupportedVersion;f0b9ab23replaced it with the generalInvalidbefore the merge.Invalidis the name that actually landed.Nothing else in the bump reaches the glue
Checked rather than assumed:
session_protocol.h/session_protocol.hppchanged underinclude/across the two pins.ProProof::status()keeps its signature, sonativeStatusis untouched.attachments::encryptinput validation (#129) is on thestd::filesystem::pathoverload; this glue calls the in-memory span overload, so it is inert here.versionreference survives anywhere inlibrary/src/— Kotlin, JNI C++ or protobuf — andlibrary/src/androidTest/never referenced it.Consumer impact: checked, and there is none
Two things about this change look like they should need a migration in session-android. Both were checked against the checkout and neither does:
ProProofis@Serializable, so dropping a field is a persistence-format change — old stored JSON still carries"version". Harmless here: session-android's injectedJson(AppModule.provideJson) is built withignoreUnknownKeys = true, so the stale key is skipped rather than throwing. AndProProofis never itselfencodeToString/decodeFromString'd anywhere in the app; the backend response path isBackendRequests.parseProProofResponse, i.e. the C++ parser reached over JNI, not kotlinx.api-exposed —library/build.gradle.ktsgenerates Java from../libsession-util/proto/SessionProtos.proto, soSessionProtos.ProProofloses itsgetVersion()/hasVersion()accessors downstream. Nothing in session-android calls either.Build
./gradlew :libsession-util-android:assembleRelease— BUILD SUCCESSFUL in 2m 44s, 42 tasks executed, no warnings from the changed files. Native code compiled against the new pin across all four ABIs (arm64-v8a,armeabi-v7a,x86,x86_64), each exporting 257Java_network_loki_*symbols includingProProof_nativeStatus.The JNI descriptor is the one thing no compiler checks, so it was read back out of the built AAR rather than eyeballed:
which is exactly what
cpp_to_java_proofnow looks up.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code