Repository navigation
fix(sofi): relaying and owning are two operations, and the build says so - #953
Merged
Merged
Conversation
complete_pending_fulfillment read this device's head and its admission
while its own doc comment said any device may run it. Device scenario 4
is "F registered, trader offline: a relayer completes the cells", and
there was nothing a relayer could call.
Owner ruling §44.4: any device may carry immutable signed protocol
objects to storage; only the owning device may touch its own admission,
fence, lineage and leaf cache. The separation is now structural.
SDK/sdk/sofi_relay.rs (new) is the party-neutral half. Each entry point
takes a committed set and a fulfillment id, holds no CoreSDK, reads no
device head and writes nothing local. From the id it fetches F and its P
by content address; relay_position_pair carries F in its published
envelope and C_q derived from the two verified objects to the leader of
s(q) and the other members; relay_fulfillment then reads each leg key
raw and carries the exercise it finds VERBATIM to every key F names.
It never builds an exercise. Building one needs the trader's own closure
objects, which are not a relayer's to hold, so a fulfillment whose
exercise was never published has nothing to relay and the relay reports
that rather than papering over it. Nothing re-gates on conformance:
that gate is the producer's discipline before it publishes, not a second
opinion at every carrier.
ci/sofi_relay_is_party_neutral.sh holds the line a comment could not:
the relay may not name CoreSDK, device_head, pending_economic_admission,
client_db or economic_lineage in production, its entry points must take
exactly a set and a content address, and complete_pending_fulfillment
and resolve_pending_position must still take the owning device.
Controls, each restored byte-identical:
M1 the relay imports CoreSDK -> the gate fails, naming it
M2' the owner-local half is given the
relay's shape -> the gate fails, naming it
M3 the relay carries to one key only -> scenario 4 red
M4 the relay reports legs it never wrote -> the never-invents test red
M2 was first attempted by REORDERING the parameters, which left
core: &CoreSDK present; the gate rightly passed and the mutation was
discarded as non-discriminating.
Also: fake_registers::heal_cell, so a stopped write is not permanent and
a relay can mean something. Spec §33 and §27.
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.
Relaying and owning are two operations, and the build says so
complete_pending_fulfillmentread this device's head and the admission on it, while its own doc comment said "any device may run it again". Device scenario 4 of §44.1 is "Fregistered, trader offline: a relayer completes the cells and the position resolves", and there was nothing a relayer could call.Per the ruling in §44.4: any device may carry immutable signed protocol objects to storage; only the owning device may touch its own admission, fence, lineage and leaf cache. This makes that separation structural rather than a sentence.
The party-neutral half
SDK/sdk/sofi_relay.rsis new. Each entry point takes a committed set and a fulfillment id. It holds noCoreSDK, reads no device head, and writes nothing local.relay_position_paircarriesFin its published envelope andC_q, derived from the two verified objects, to the leader ofs(q)and the other members. Idempotent, because members keep what they were given.relay_fulfillmentdoes that, then reads each leg key raw and carries the exercise it finds verbatim to every keyFnames.It never builds an exercise. Building one needs the trader's own closure objects, which are not a relayer's to hold. A fulfillment whose exercise was never published has nothing to relay, and the relay reports that instead of papering over it.
Nothing re-gates on conformance. That gate is the producer's discipline before it publishes, not a second opinion at every carrier. Members keep what they are given and Core decides what counts, which is the storage contract.
The line is held by the build, not a comment
ci/sofi_relay_is_party_neutral.sh, wired intoci/production_safety_checks.sh:CoreSDK,device_head,pending_economic_admission,client_dboreconomic_lineagein production;complete_pending_fulfillmentandresolve_pending_positionmust still take the owning device.The gate strips comment lines before checking, because this file explains what it may not hold and prose naming a thing is not holding it. That is the mistake G1 made for the whole rebuild, caught here at the moment of writing rather than thirteen steps later.
Device scenario 4, executed
a_relayer_completes_the_cells_and_the_owner_later_resolves_from_its_admission: device A fulfils, then the second leg's cell refuses every member, which is what an offline trader looks like from storage. A's own completion lands one leg, the route cannot be consumed, and resolution isPending. The members are healed. A party holding no device state relays, the exercise reaches every key, and only then does A advance its own lineage from its own durable admission.a_relay_carries_the_pair_but_never_invents_an_exercisepins the other half: the pair is carried, and no leg is claimed.Controls
CoreSDKThe second was first attempted by reordering the parameters, which left
core: &CoreSDKpresent; the gate rightly passed and that mutation was discarded as non-discriminating rather than counted. The gate is a text check and was mutated as text, so that mutant does not compile, which is not what is under test: the gate runs before the compiler and must fail there.Gates
--features test-utils):sdk::sofi_*48/0, two tests new.make lintexit 0;ci/production_safety_checks.shpassed, including the new gate; G1 unchanged at 86 reachable, 7 baselined.fake_registers::heal_cell, so a stopped write is not permanent and a relay can mean something.Spec
§33 states the two operations and what a relay may not do; §27's
sofi.relayrow points at the module.