AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 34 Bitcoin

msggen: keep the generated proto wire format stable

Public commit record

What the developer wrote

Authored by daywalker90

73/100 · Adequate
msggen: keep the generated proto wire format stable

Every field number that msggen emits is recorded in .msggen.json
(grpc-wire-contract) together with its proto3 label and type. When a
JSON schema change later implies a different label or type for a number
that was already released, msggen keeps emitting the released one and
records the difference so the Rust conversions adapt the value instead
of changing the wire format. A change that cannot be bridged that way
aborts generation.

This pins down:

- A field released as optional stays optional, so 0/""/false is never
silently reinterpreted as "absent". Adding optional is allowed and
does not change the encoding.
- uint64 released fields that the schema now types as uint32 stay
uint64 on the wire and are range-checked in the Rust conversion.
- A double released field that the schema now types as an integer
stays double.
- A string released field that the schema now types as bytes/pubkey
stays a string and is hex-decoded/encoded in the conversion.
- Sat-denominated request fields (AmountSat/AmountSatOrAll) keep their
released number as a deprecated msat field and move the sat value to
a fresh *_sat field number. Setting both is rejected, and the old
msat field must hold a whole number of satoshis.
- Numbers that are no longer emitted are marked reserved.

The cln-rpc Rust types follow the schema as before; only the gRPC wire
format is frozen.

Changelog-Deprecated: cln-grpc only: deprecate amount fields for onchain methods, use *_sat fields instead. Old msat fields still work, but must be whole satoshis. Affected messages: AddpsbtoutputRequest, WithdrawRequest, FundpsbtRequest, UtxopsbtRequest, FundchannelRequest, FundchannelStartRequest, MultifundchannelDestinations, OpenchannelBumpRequest, and OpenchannelInitRequest
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit is a large, intentional change to the gRPC code generator used by Core Lightning. Its purpose is to keep the binary wire format of the project's gRPC API stable across future schema changes, so old clients and new servers can still talk to each other. It does this by recording every released field number and type, then adapting mismatches in generated Rust conversion code instead of changing the wire layout. The patch also deprecates several amount fields in on-chain RPCs and introduces new *_sat replacements. There is no obvious security bug in the diff, but the size and complexity of the generator changes create a real risk that future generated conversions could mishandle values, reject valid requests, or silently reinterpret amounts.

Recommended action

Treat this as a high-risk infrastructure change rather than an active vulnerability. Review the generated conversion code for the sat/msat bridges, ensure the new range checks and mutual-exclusion errors cannot be triggered by benign clients, and run the gRPC compatibility test suite against old proto clients. Monitor for follow-up fixes that correct generator edge cases.

Security signals we found

01

Large generator change affecting how request/response values are translated between gRPC wire format and internal Rust types

02

Amount-field deprecation and conversion logic for msat-to-sat fields in on-chain RPCs

03

New range-check and mutual-exclusion helpers (double_to_u32, msat_to_sat, msat_or_all_to_sat, sat_or_legacy)

04

Reserved field numbers/names added to prevent future accidental reuse

05

No explicit security claim or bug fix in commit message

Risk score

Why this scored 34/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 5/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.