1.21. Reversible Apoptosis & Capacity Shedding
1.21.1. AIMD and reversible apoptosis
A design study. The reference runs AIMD. Nothing in the repository is called apoptosis or reversible. This document describes the loop that exists, works out what a reversible apoptotic exit would have to be in this protocol’s own terms, and says where it would help and where it would break something the protocol built on purpose.
The table under review:
Phase |
AIMD |
Reversible apoptosis |
|---|---|---|
Degradation trigger |
Reactive monitoring of packet drops or rule violations |
Exceeding strict structural bijections within the bilateral contract |
System footprint |
Dying nodes slowly leak resources and cause routing timeouts |
Dying nodes immediately execute a memory-clearing history inversion |
Data preservation |
High risk of fragmentation or orphan states during a drop |
Zero information loss; states are algebraically unwound and absorbed |
Mesh recovery |
Neighbours must recalculate routes around a black hole |
Neighbours cleanly ingest the dead node’s routing vectors via inverse mapping |
One thing to say first. The two columns are not the same kind of thing. AIMD is the control loop that prices a peering while it is alive. Apoptosis is what a node does when it leaves. The table reads them as substitutes. They are not. What the table is really proposing is that the degradation half of the loop be handed to the subject as a self-initiated unwind. That is worth taking seriously on its own terms. The rest of this document does.
1.21.1.1. 1 · What AIMD is here
Not the TCP shape. The name is kept because the increase is additive and the
decrease is multiplicative. Everything else was rewritten after the first
deployment, and § 9a to § 9f of mechanisms.md record why.
The loop. An issuer publishes a grant (kind 30801). The subject mirrors
each limit in a token bucket and sends signed receipts on a hash chain. At
window close the issuer compares what it measured against what the subject
claimed. class(overrun, divergence) names a severity. adjust applies the
remedy the grant stated before the breach.
clean : limit ← limit + ceiling × max(0.02, 0.10 × strain)
or limit × 0.90 where the window measured nothing and limit > opening
S1 : limit × 0.50 floored at probation
S2 : limit × 0.25 ; tier ← probation
S3 : limit ← 0 for 24h
S4 : revoked ; grant deleted
always: limit ← min(tier ceiling, limit) ; floored to an integer
Constants: aimd_increase_fraction 0.1, aimd_min_increase_fraction 0.02,
aimd_decrease_s1 0.5, aimd_decrease_s2 0.25, decay_fraction 0.9,
decay_idle_windows 24, opening_limit_fraction 0.25.
Where it already stopped being pure. Five departures from textbook AIMD are live. Each was forced by the running mesh.
The step is scaled by strain. An idle peering grows at the floor. Capacity is priced in work rather than in windows.
Unused capacity decays. What a peer has not used it gives back. The floor is where a stranger opens.
A capacity shed is not a finding.
amendcarriescause: capacity. It makes a peer smaller and never a stranger. The ladder has hysteresis (restore_below0.6).A window can be repriced. A receipt arriving late lowers a severity. Never raises one.
Ledger.amendreplaces the window in place so the streak is whole again.A node says goodbye.
Budget.farewellsends a receipt for every open window before the transport goes. The window then prices on the node’s own numbers rather than on its absence.
So the “pure AIMD” the table degrades from is not what runs. The reference is already a loop with a memory and with one-way corrections in it.
What the loop does to a node that dies. This is the row the table cares about. There are four ways out and they cost different things.
How the node leaves |
What its peers see |
What it costs |
|---|---|---|
Vanishes mid-window with traffic |
active silence |
S2 floor on every peering. Tier to probation. Streak reset. Coverage claims sit until expiry. Peers time out pulling from it |
Vanishes with no traffic |
graceful partition |
Nothing. Not evaluated. Streak untouched. Coverage claims still sit until expiry |
Farewell then stop |
a claim |
Priced on its numbers. Usually S0. Coverage claims still sit until expiry |
Revocation (11802) |
a signed retirement |
Every grant zeroed. Standing does not transfer. Successor starts on probation |
The farewell fix closed the first row for planned restarts. What it did not
touch is everything below the accounting: the coverage claims (kind 30803)
that keep pointing at a node that is gone, the shards it held first-hand that
nobody else may claim asserted, the peers that keep retrying a pull against
it, and the strain each of those peers records for having been let down. That
is the real hole. The table calls it “routing timeouts” and “a black hole”.
This protocol has no routes. It has coverage claims and a peering graph. The
hole is the same shape.
1.21.1.2. 2 · What reversible apoptosis would be
Two words from two fields. Both have to be pinned or the phrase is decoration.
Apoptosis is programmed cell death. It is distinct from necrosis in three ways that matter here. It is initiated from inside the cell. It is orderly: the cell shrinks, packages its contents, and signals neighbours to absorb the packages. Nothing spills. Necrosis is the other thing: the membrane fails, the contents leak, and the neighbourhood inflames.
Reversible computation is Bennett and Landauer. A computation whose every step is a bijection can be run backwards. Nothing is erased, so no information is lost. The bill is memory: to keep every step invertible you keep every intermediate state or enough of it to reconstruct one. Erasure is what costs energy. Reversibility is what costs storage.
Put together: a node’s exit is a self-initiated unwind of its own state, run as a sequence of invertible steps, such that at the end its neighbours hold everything it held and nothing was erased along the way. Because the steps are invertible the node can stop unwinding at any point and come back.
Mapping the table’s terms onto this protocol. The table is written in the vocabulary of a packet router. This protocol is a relay peering mesh. Each term has a nearest real thing.
Table says |
Nearest thing here |
|---|---|
structural bijections within the bilateral contract |
the claim ↔ measurement identity a receipt asserts. |
routing vectors |
coverage claims (30803), the descriptor’s endpoint set, and the shard replicas behind the claims |
memory-clearing history inversion |
farewell receipts for every open window, withdrawal of every coverage claim, grants zeroed in both directions with final heads acknowledged, and a revocation |
neighbours ingest via inverse mapping |
peers pull the dying node’s asserted shards over |
black hole |
a 30803 that outlives its node |
A sketch of the protocol. It needs almost nothing new. Every message exists. What is missing is the ordering and the inverse of each step.
0 announce a heartbeat with load at 1.0 and a `retiring` flag
inverse: a heartbeat without it
1 drain enter the leaf_behaviour rung: open no session, serve no pull,
keep answering receipts
inverse: release the rung (the ladder already does this)
2 hand over for each shard claimed asserted first-hand: let peers pull until
their fingerprint equals ours. Publish nothing new
inverse: nothing to undo. The peers hold a copy. Keep claiming
3 withdraw re-publish each 30803 with completeness best-effort and a short
expiry, or delete it
inverse: publish the claim again
4 settle farewell: a final receipt on every open window. Wait for the
receipt-ack carrying `final`
inverse: none needed. A final receipt is a claim and a claim
can be followed by another window
5 retire revocation (11802) naming a successor or none
inverse: none. This is the one-way step
Everything before step 5 is reversible by construction. The node that gets to step 4 and changes its mind opens a new window and republishes its claims. Its peers have lost nothing. Its standing is untouched because a clean farewell prices S0 and S0 counts toward the streak.
That is the useful core of the idea. Note what it is: a graceful exit with a defined inverse at each step. It is not a new reputation mechanism.
1.21.1.3. 3 · The trigger and who pulls it
The table’s trigger is “exceeding strict structural bijections within the
bilateral contract”. Read literally that is divergence > divergence_tolerance.
This protocol already fires on exactly that. It calls it S2. The question is
not whether to detect a broken bijection. It is who acts on it.
Under the ladder the issuer acts. It measured. It prices. It amends the grant and publishes a report the subject signed the evidence for.
Under apoptosis the subject acts. It notices its own claim no longer matches what it can stand behind and unwinds itself.
These cannot be the same mechanism, and here is why. A subject that misreports and then unwinds itself before the window is priced has escaped the report. There is no window to evaluate because the subject closed it clean. The “structural bijection” was broken and the record shows nothing. That is not a corner case. It is the whole attack surface the ladder exists to close: a peer that lies about its accounting must be priced worse than one that overruns honestly, and § 9 records two separate occasions on which the arithmetic got that backwards and had to be fixed.
So the trigger cannot move. The issuer prices the window whatever the subject does. What apoptosis can add is a subject-side trigger that runs beside the ladder: a node that sees its own token bucket about to overrun, or its own clock drifting, or its operator asking it to stop, begins the unwind. It does this because a clean exit prices S0 and a messy one prices S2. The incentive already exists. The ladder made it. Apoptosis is the subject acting on it.
In biology this distinction is real too. Apoptosis is triggered from inside the cell. But there is also a receptor on the outside that lets a neighbour tell a cell to die. That second path is the one to be careful of in a mesh. See § 5.5.
1.21.1.4. 4 · Benefits
Concrete ones. Each names the thing it fixes.
4.1 The rolling upgrade. § 9a-quater: rolling four nodes for a digest change put an S2 on every peering and reset every streak. The farewell fixed the window pricing. It left the coverage claims pointing at four nodes that were briefly gone, and every peer that tried to pull from one recorded a direction of strain for it. A full unwind takes the claims down first and the transport last. A planned restart then costs the mesh nothing at all. This is the strongest case for building it and it is a real one.
4.2 The coverage black hole. A 30803 outlives its node by up to its expiration. Every peer that reads it and pulls gets a timeout. The table’s “routing timeouts” row is this exactly. Withdrawal is one message per claim and closes it entirely. Cheap and worth doing regardless of the rest.
4.3 Asserted shards. § Coverage: a node MUST NOT claim asserted for
shards it holds only through mesh replication. So when the one node that
held a shard first-hand dies, the mesh keeps best-effort copies and nobody
may claim the shard authoritatively. The set is not lost but its authority
is. A handover that lets a peer pull to fingerprint equality and receive a
signed statement that the copy is now first-hand preserves the authority.
That statement is now the handover in § Coverage. This is the table’s “data
preservation” row done honestly. It is not zero loss. It
is loss of authority prevented for the shards somebody chose to take.
4.4 It is the fifth rung. The capacity ladder already has the shape: four
rungs with actions, a release threshold, hysteresis. leaf_behaviour at 1.0
is a node that serves nothing and keeps accounting. Apoptosis is what comes
after that when the pressure does not fall. It fits the existing design
rather than sitting beside it.
4.5 Strain is not recorded for a friend leaving. A peer that vanishes is a direction of strain for every neighbour. A peer that announces and drains is not. The strain ledger already refuses to count a node’s own restart against itself. It should also refuse to count a neighbour’s announced exit. That keeps reserves from thickening in response to maintenance.
4.6 The inverse is free where it matters. Steps 0 through 4 need no new messages. The inverse of a heartbeat flag is a heartbeat. The inverse of a withdrawn claim is the claim. The inverse of a farewell is a new window. The only one-way step is the one that already exists and is already one-way.
1.21.1.5. 5 · Downfalls
These are the places where the table’s claims collide with something the protocol chose. Each is a design constraint rather than a bug in the idea.
5.1 Reversibility is the whitewash attack. § Revocation: standing MUST
NOT transfer to a successor. reprice may only lower a severity. A tier the
ladder dropped stays dropped. view may only lower. Reports may only lower.
Every one of these is a one-way valve and every one is there for the same
reason: an identity that can unwind its history can earn, misbehave, unwind
and be reborn clean. The table’s “zero information loss; states algebraically
unwound” is exactly the property the adverse record must not have. So the
scope of what may be unwound has to be stated in one line and enforced at the
ledger: an exit may unwind capacity and coverage. It may never unwind a
finding. A node mid-apoptosis that is priced S2 for the window it is leaving
takes the S2. Its successor starts on probation. The unwind does not touch
Ledger.windows. If that line is not held the mechanism is a sybil tool.
5.2 Landauer’s bill comes due at the issuer. Reversibility costs storage.
§ 3: the issuer keeps the chain head. Thirty-two bytes per window. That is a
deliberate erasure. To invert a window you need the receipts, not the head.
Budget.KEEP_WINDOWS is the knob and the strain ledger already turns it up
when peers have been vanishing and returning. Full reversibility means every
issuer keeps every receipt of every peer for the whole retention. The design
refused that cost once. The refusal stands. What this means in practice: the
subject can be fully reversible about its own state, because it holds its
own chain. The issuer’s view of it is not, and does not need to be.
5.3 The arithmetic is not a bijection. adjust is not invertible.
max(probation, limit × 0.25) erases the pre-image for anything below four
times probation. within clamps to the ceiling. as_limits floors to an
integer. § 9a-bis records that the clamp hid a broken growth rule for months
because every output was the ceiling whatever the input. Inverting these
means storing the value before the step. That is journaling, and journal.py
already does it. So “algebraically unwound” is a phrase for what is actually
“read back from the journal”. It is fine to build. It is not fine to call it
algebra.
5.4 FLP does not go away. A node that crashes, loses power, or is partitioned does not apoptose. It goes necrotic. The table’s “dying nodes immediately execute” assumes the node is alive enough to die well. The most common deaths are the ones that are not. So every cost in the AIMD column survives for every unplanned death, and the second row of the table is only true of the deaths that were already the cheap ones. Apoptosis is an addition to the loop, never a replacement for it. The ladder still has to price silence, and § 3 already says how.
5.5 Apoptosis can be induced. The receptor path. If a neighbour can tell a node to begin its unwind, one anchor can tell every peer to die. That is a mesh-wide denial of service with a single signed message. The trigger must be the node’s own or its operator’s and nothing on the wire may cause it. This is the same rule the strain note states for reserves: local and defensive only. A remote node may ask. It may never cause.
5.6 Ingest is traffic. “Neighbours cleanly ingest” means bytes through
grants. A large node handing over shards puts load on every neighbour at
once, inside their own capacity ladders, inside their own grants from the
dying node, and priced by windows like everything else. A neighbour at 0.9
pressure that ingests a departing anchor’s shards crosses its own amend_down
rung and cuts every other peer. The handover has to respect the receiving
node’s ladder, which means it is pull-driven and the receiver chooses its
pace. The dying node cannot push and cannot demand.
5.7 Clean death is slow death. A handover takes windows. The table says “immediately”. A node holding gigabytes of asserted shards cannot both exit immediately and leave nothing behind. The honest statement is: the node exits as fast as its peers will pull, and whatever nobody pulled by the time it retires is best-effort from then on. That is the same best-effort the mesh already lives with. It is not zero loss.
5.8 Nothing here is multilateral. Every mechanism in this protocol is bilateral and there is no global state anywhere. “Neighbours ingest the routing vectors” implies someone decides which neighbour takes which shard. Nobody can. The bilateral answer is the only one available: each peer pulls what it wants under its own grant. The dying node withdraws its claims. If two peers both pulled a shard both may claim it. If none did the authority is gone. That is a market for shards at exit, not a handover. It is the same shape as the compute market and the discovery layer, and it is the shape the protocol can actually build.
1.21.1.6. 6 · A corrected table
The original with each cell replaced by what would be true of this protocol.
Phase |
AIMD as built |
Reversible exit as it could be built |
|---|---|---|
Degradation trigger |
The issuer prices claim against measurement at window close. Divergence past tolerance is S2. Silence with traffic is S2. Silence without traffic is not evaluated |
The same. The issuer’s trigger does not move. The subject gains its own trigger to begin an unwind: its operator, its own pressure at 1.0, or its own bucket about to overrun |
System footprint |
A planned exit already prices S0 via farewell. Coverage claims outlive the node. Peers time out and record strain against it |
Coverage withdrawn first, transport last. Peers record no strain. No timeouts. Unplanned deaths are unchanged |
Data preservation |
Best-effort copies survive. Authority over first-hand shards dies with the node. Findings survive because they are signed by the subject |
Peers that pull to fingerprint equality may take authority. What nobody pulled is best-effort. Findings survive. Standing does not transfer |
Mesh recovery |
Peers wait for claim expiry then stop trying. Grants to the dead node decay by disuse over 24 windows |
Grants closed with final heads acknowledged on both sides. Claims withdrawn. Nothing to wait for |
Reversibility |
Repricing may only lower. Tier drops are permanent until a person raises one |
Every step before revocation has a stated inverse. Revocation is one-way. Findings are one-way |
Cost |
32 bytes per window at the issuer |
Unchanged at the issuer. The subject keeps its own journal, which it already does |
1.21.1.7. 7 · What to build and what to refuse
Build the exit. Refuse the reversibility of the record.
Build.
A
retiringflag on the heartbeat (21801). Advisory. Peers reading it stop counting strain for that direction. Built. It is the only thing here that tells a departure from a silence, and FLP permits it because the node says it rather than anyone inferring it.Coverage withdrawal: a node MUST republish every 30803 it holds before its farewell. Built. A claim is addressable, so the withdrawal is a republication at the same coordinate saying
best-effortwith a NIP-40 expiration — the tag had to be added, because the capacity ladder had been documented for months as letting claims lapse at an expiration nothing carried. Enforced the same way the farewell is: nothing may raise.A fifth capacity rung at pressure held at 1.0 for
apoptose_after_windowswindows: begin the unwind. Operator-configurable and off by default. A node that cannot shed enough to recover is better retired cleanly than left serving nothing.Strain: an announced exit is not a direction. Same rule as the node’s own restart. Built, in
sync_wire.pull, againstpresence.is_retiring.Handover as pull. Open when this was first written and closed now, twice over. § Coverage has a
sync/1.0/handoverthe first-hand holder signs, with the three rules inmechanisms.md§ 20; andNodeApp.retiredoes steps 2, 3 and 4 of the sketch above — close the ranges, hand each shard to every granted peer, withdraw the claims, farewell, and a revocation only if asked. One correction to the sketch, found by building it: the handover is sent rather than waited for, and sent store-and-forward. Waiting means outlasting the slowest peer’s pull interval, and the peer this matters most to is the one that is offline while its only first-hand holder leaves.
Refuse.
Any unwind that touches
Ledger.windows, a published 30802, or a tier.Any wire message that causes another node to begin its unwind.
Any issuer-side retention of full receipt chains for the sake of inversion.
The word “bijection” for
adjust. It is not one and pretending so will hide the next § 9a-bis.
Constants this would add.
handover offer (node config, live)
lifecycle.apoptose_after_windows 0 (not built: pressure held at 1.0
is still an operator's decision)
None of these move the protocol version. Nothing on the wire changes shape. The flag is a new tag on an existing ephemeral kind and a reader that does not know it ignores it.
1.21.1.8. What writing this found
The table’s second column describes something worth having and describes it in a vocabulary that would break the protocol if taken literally. The valuable part is the orderly exit. The dangerous part is the word reversible applied to anything other than the exit’s own steps. The reference already learned this the hard way in four places: the session abort, the standing streak, the mid-window vanish and the late receipt. Each was fixed by making the node say something rather than by letting anyone take something back. The exit protocol is the fifth instance of the same rule. Say you are leaving. Say what you held. Say what you used. Then go.