open-standards/jcp/jcp-rs/crates/jcp-channel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 5b2a171dbf
All checks were successful
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 15m30s
jcp-channel: a channel point holds before a call's work, and states its holds to its peers
SPEC 4.5 required a point spending through the two-phase path to count
its own open holds, and said its peers could not count them because a
statement does not carry them. The channel had no two-phase path at all,
so the first was unreachable and the second left work in flight at one
point invisible to every other.

- Channel::hold reserves as the runtime sizes a hold and refuses one
  larger than the channel has left once peers' stated spend and holds
  are counted; settle_hold settles it. A point counts its own open holds
  in every decision.
- A statement carries held_uj, apart from spent_uj: what the point's
  open holds reserve now. It may go down between statements, as holds
  settle; spent_uj still may not. Absent when zero, so a statement with
  nothing in flight keeps its bytes.
- Peers count a stated hold as committed. A channel whose points state
  themselves after every operation never commits past its budget across
  all of them, given honest settlements: a randomised test of three
  points holds to that, and fails when holds are left out of statements.
- SPEC 4.5 rewritten to match; C17 checks a hold stated and counted, a
  second hold refused at the peer, and a settled hold leaving the count.
  Runtime::hold_bound_chained is public, so a channel can size a hold
  before placing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 13:44:48 -05:00
..
src jcp-channel: a channel point holds before a call's work, and states its holds to its peers 2026-11-11 13:44:48 -05:00
Cargo.toml jcp-channel: a channel point holds before a call's work, and states its holds to its peers 2026-11-11 13:44:48 -05:00