Skip to content

(PFS) Version Pro Proofs on the outside instead of the inside - #131

Open
jagerman wants to merge 3 commits into
session-foundation:pfsfrom
jagerman:proproofversion-scoped-enum-pfs
Open

(PFS) Version Pro Proofs on the outside instead of the inside#131
jagerman wants to merge 3 commits into
session-foundation:pfsfrom
jagerman:proproofversion-scoped-enum-pfs

Conversation

@jagerman

Copy link
Copy Markdown
Member

Same as #130, but for the PFS branch.

jagerman and others added 3 commits August 17, 2026 13:34
…d field

A ProProof is version 0 by its type, not by a value it carries. Scope
ProProofVersion (enum class : uint8_t) and rename ProProof -> ProProof_v0 with
`using ProProof = ProProof_v0` (a note explains the alias becomes a variant or
virtual base when a v1 arrives). The version field is dropped from the C++ and C
proof structs and from operator==, and config no longer sets it.

fill_proof also stops reading a JSON `version` off the generate_pro_proof
response: the endpoint fixes the format and the proof's version is bound into its
signature via the personalisation, so there is nothing for the client to read or
gate on -- a future format is a new endpoint returning a new ProProof_vN, not a
version bump on this response. The wire version survives only where it must: the
protobuf-embedded proof a peer decodes with no endpoint context, where it selects
the layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…the message

A received Pro proof whose wire version we don't recognize used to fail the
parse, discarding the entire message -- the recipient silently never saw it.
That's backwards for a forward-compat field: a newer proof format should cost the
sender their Pro affordances on old clients, not the whole message.

parse_pro_message now treats an unknown (or missing) version as a graceful
degrade: it flags the proof ProStatus::UnsupportedVersion (C
SESSION_PROTOCOL_PRO_STATUS_UNSUPPORTED_VERSION) and returns a non-pro message,
so the caller skips signature evaluation and delivers it as an ordinary message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
session::json::require<T>/maybe<T> now accept a scoped enum T, validated as its
underlying integer (nlohmann converts through the underlying type in extract), so
an enum-typed field can be requested directly rather than cast at the call site.
No current caller needs it -- it is a zero-cost `if constexpr` branch that only
instantiates when asked -- but it rounds out the generic helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jagerman jagerman changed the title Proproofversion scoped enum pfs (PFS) Version Pro Proofs on the outside instead of the inside - #130 Aug 18, 2026
@jagerman jagerman changed the title (PFS) Version Pro Proofs on the outside instead of the inside - #130 (PFS) Version Pro Proofs on the outside instead of the inside Aug 18, 2026
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