Skip to content

Remove retired OPP reserve, swap and launch carriers - #674

Merged
valthon merged 2 commits into
masterfrom
cleanup/retired-opp-carriers
Oct 12, 2026
Merged

valthon merged 2 commits into
masterfrom
cleanup/retired-opp-carriers

Conversation

@valthon

@valthon valthon commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The external settlement retirement and merged #670 left shared protocol definitions advertising reserve lifecycle, cross-chain swaps/refunds, and other launch APIs whose implementations are gone, plus registry fields, audit fields, helpers and documentation that only served them. This follow-up removes them, and verifies that malformed retired attestations cannot block live LIQ intake.

Libraries #102 has merged. Tools #116, Ethereum #226 and Solana #568 land first; the consumer changes for this PR are stacked on them (see below).

Changes:

  • Remove the complete remaining reserve cancellation/matching family: ReserveCreateCancel, ReserveCreateCancelled, ReserveReady, their wire enum values, and the inert depot cases.
  • Remove reserve snapshots/disbursements, Reserve/ReserveAmount/ReserveStatus, the unused purchase/yield payloads and enum values, and the retired cross-chain emissions notification. Preserve depot-local emissions diagnostics.
  • Remove SwapRequest, UnderwriteIntentCommit, SwapRemit, SwapRevert, and DepositRevert, including their discriminants, serializers, reflections, and inert routing. Their settlement implementations were retired with sysio.reserv/sysio.uwrit.
  • Remove the old underwriting state enums, unused three-field NodeOwnerReg, and unused OPP ProtocolState. Preserve active NodeOwnerRegistration, native collateral audit, rosters, and LIQ custody.
  • Remove the staking lifecycle carriers: PretokenStakeChange, StakeUpdate, StakeResult, the StakeStatus enum, and the STAKE, UNSTAKE, STAKE_UPDATE and STAKE_RESULT discriminants with their serializers, reflections and depot case. Their only producers were two internal Ethereum StakingManager senders with no caller (stakeLiqETH is a _notWired stub); msgch dropped all four in a deferred case. Also remove AttestationProcessingError, which no chain produces.
  • Remove the challenge carriers CHALLENGE_REQUEST (60945) and CHALLENGE_RESPONSE (60932) with their ChallengeRequest / ChallengeOperatorHash payloads: msgch dropped both, and sysio.chalg disputes run on DisputeStatus through evalcons. Also remove declarations nothing encodes: ChainKeyType, ChainSignature, WirePermission, ChainRequestStatus, ChallengeStatus, DebugEnvelopeDataRecord, and the Chain / Token / ChainToken messages, which were described as registry carriers although sysio.chains and sysio.tokens store their own row structs.
  • In total: 30 messages, seven enums, and 20 attestation values.
  • Remove two unread dispatch parameters and the message-id reconstruction performed solely for them. Stored attestation ids, semantic header validation, and active envelope correlation remain intact.
  • Remove msgch helpers that only served the retired ingress (resolve_account_from_op_address, payload_codes_canonical) and the unused opp_table::locked_amount_t. The live LIQ paths reject unregistered codes through the token registry.
  • sysio.chains: drop the underwriter outpost roles operator_registry_addr / source_deposit_addr and the shared resolve_role_addr. The batch-operator relay reads only opp_addr / opp_inbound_addr. ABI change.
  • sysio.system: drop epochlog.fee_distributed / batch_fee_retained, which payepoch wrote as constant zero once the reserv fee sweep was deleted. ABI change.
  • Refresh documentation that still described sysio.reserv, sysio.uwrit, the underwriter daemon and underwriter challenges (orphaned sysio.chalg declarations' docs, test fixtures, emissions notes, Solana client comments, and the amm_math header and tests, which now name sysio.swap as their consumer; that code is unchanged).
  • Rebuild and check in the chains, epoch, liq, msgch, opreg, synd and system artifacts (empty CMAKE_BUILD_TYPE flavor; a base-commit control build reproduces the committed bytes exactly). Retained message fields and enum values are unchanged; the only other ABI shapes that change are the two above and msgch's attestation-type enum (the seven removed values; its wasm is byte-identical). No compatibility exports, replacement enum members, or reserved slots are added.
  • Correct comments that said sysio.opreg emits OPERATOR_ACTION: it records withdraw and slash entries in the operator audit log and queues no attestation; outposts learn a slashed status from the OPERATORS roster. Point the bootstrap-config docs at the registry tables.
  • Add generated-descriptor and opaque-wire regressions; extend real contract dispatch coverage. Remove obsolete unreferenced OPP diagrams and stale retired-flow descriptions.

The audit records producer/consumer evidence, intentionally retained surfaces, and concrete next-wave work.

Validation of the head, 4291581 (adds the challenge-carrier and unused-declaration removal on 02dfa26):

Gate RC
ninja build (build/claude: test_opp, contracts_unit_test, plugin_test) 0
test_opp 0
contracts_unit_test (926 cases) 0
plugin_test (307 cases) 0

All 12 flows passed locally on this head with libraries 213a77e, tools db64dcee, Ethereum ac8c66fa and Solana 6e27c9c1 (#569's head before its rebase onto #568's current head), each run with run-flow.mjs and the heartbeat monitor.

Earlier validation (3597cc6, with the consumer branches below; the head, 02dfa26, adds only review follow-ups: the test-only generated_attestation_type_omits_removed_values case (test_opp 18/18) and comment-only documentation fixes (every contract wasm/abi byte-identical; amm_math_tests, sysio_swap_tests, sysio_emissions_tests 91/91)):

  • Bazel Release build of //wire-sysio:build, including host/CDT contracts and all three model bundles.
  • contracts_unit_test (committed wasm, as CI tests it): 926/926 cases, no errors.
  • test_opp (including the extended retired-carrier regressions) and plugin_test: no errors.
  • The earlier head also passed test_batch_operator_plugin, test_outpost_solana_client_plugin, test_outpost_ethereum_client_plugin, both coverage-map checks, and all 12 flows run locally with run-flow.mjs + the heartbeat monitor; the staking removal is covered on this head by the run below.
  • The E2E Flow Tests workflow passed all 12 flows ("12 flows, 0 failed") on these exact heads: run 38051256122. wire-sysio 3597cc6f, wire-libraries-ts 53519742, wire-tools-ts 6fb42b7d, wire-ethereum 4c62fc22, wire-solana a5a15e4d, wire-cdt a00bd718.
  • The earlier full core unit sweep's nine RAM-quota failures in unmodified KV fixture tests (payer_choice_test, protocol_feature_tests) are unrelated to this change and still recorded rather than counted as green.
  • solana_idl_stub_consistency_test reports two divergences (DistributionState field order, LatestOutboundEnvelope.data type) that also fail with the base commit's stub; this PR removes the third (ReserveStatus).

Consumer changes (branch cleanup/retired-opp-carriers in each):

Release coordination: the OPP Bundles workflow publishes when this schema change reaches master. Land the #670 wave first, then this PR with its consumer PRs. Opening this PR publishes no packages.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ARSeK35wwkiAy4et9mCkVm

@valthon
valthon requested a review from a team October 9, 2026 19:41
@valthon valthon changed the title Remove retired OPP reserve and launch carriers Remove retired OPP reserve, swap and launch carriers Oct 9, 2026
@valthon
valthon force-pushed the cleanup/retired-opp-carriers branch 2 times, most recently from 26996e7 to 9a4aa45 Compare October 10, 2026 00:13
@valthon
valthon force-pushed the cleanup/retired-opp-carriers branch from 9a4aa45 to 3597cc6 Compare October 10, 2026 12:14
@valthon
valthon requested a balanced review from Copilot October 10, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing fields from the middle of the serialized epoch-log layout corrupts existing rows after an upgrade.

3 open findings
What changed in this PR

Removes retired OPP settlement/staking carriers while preserving active LIQ, roster, challenge, and node-owner flows.

Changes:

  • Deletes obsolete protobuf messages, enums, serializers, and dispatch paths.
  • Shrinks sysio.chains and sysio.system ABI structures.
  • Adds regressions for opaque retired attestations and updates related documentation/tests.
File Description
unittests/​test-contracts/​intrinsic_probe/​intrinsic_probe.cpp Removes retired consumer references.
unittests/​test-contracts/​get_table_test/​get_table_test.hpp Updates production-table examples.
unittests/​intrinsic_probe_tests.cpp Updates intrinsic documentation.
unittests/​be_key_codec_tests.cpp Generalizes composite-key examples.
tests/​get_table_tests.cpp Updates singleton examples.
tests/​fixtures/​solana-idl-opp-outpost-stub.json Removes ReserveStatus.
plugins/​outpost_solana_client_plugin/​test/​test_outpost_solana_client_plugin.cpp Aligns tests with desyndication.
plugins/​outpost_solana_client_plugin/​src/​outpost_solana_client.cpp Removes reserve-oriented documentation.
plugins/​outpost_solana_client_plugin/​include/​sysio/​outpost_solana_client_plugin/​outpost_solana_client.hpp Updates custody API documentation.
plugins/​outpost_solana_client_plugin/​include/​sysio/​outpost_solana_client_plugin.hpp Updates remaining-account documentation.
plugins/​outpost_ethereum_client_plugin/​src/​outpost_ethereum_client.cpp Removes retired ABI terminology.
plugins/​outpost_ethereum_client_plugin/​include/​sysio/​outpost_ethereum_client_plugin.hpp Documents the reduced address API.
plugins/​outpost_client_plugin/​include/​sysio/​outpost_client/​outpost_client.hpp Removes underwriting-specific signer documentation.
plugins/​batch_operator_plugin/​src/​batch_operator_plugin.cpp Removes underwriter-daemon references.
libraries/​opp/​test/​test_retired_carriers.cpp Adds descriptor and opaque-wire regressions.
libraries/​opp/​test/​test_opreg_status.cpp Updates helper ownership documentation.
libraries/​opp/​test/​test_chains_registry.cpp Removes retired role-address tests.
libraries/​opp/​proto/​sysio/​opp/​types/​types.proto Removes retired types and discriminants.
libraries/​opp/​proto/​sysio/​opp/​bootstrap/​bootstrap.proto Removes reserve bootstrap references.
libraries/​opp/​proto/​sysio/​opp/​attestations/​attestations.proto Deletes retired payload schemas.
libraries/​opp/​include/​sysio/​opp/​opp.hpp Removes obsolete enum reflections.
libraries/​opp/​include/​sysio/​opp/​depot/​opreg_status.hpp Updates relay documentation.
libraries/​opp/​include/​sysio/​opp/​depot/​chains_registry.hpp Removes retired fields and resolver.
libraries/​libfc/​include/​fc/​slug_name.hpp Generalizes registry-reader documentation.
etc/​schema/​opp_entity_diagram.puml Deletes obsolete schema diagram.
etc/​schema/​opp_entity_diagram-gen.puml Deletes obsolete generated diagram.
docs/​retired-opp-carriers.md Adds the retirement audit and coordination notes.
contracts/​tests/​sysio.tokens_tests.cpp Removes retired test reference.
contracts/​tests/​sysio.opreg_tests.cpp Updates registry-model documentation.
contracts/​tests/​sysio.msgch_tests.cpp Aligns fixtures with active carriers.
contracts/​tests/​sysio.msgch_chain_tests.cpp Replaces retired staking fixture type.
contracts/​tests/​sysio.epoch_tests.cpp Removes reserve-registry references.
contracts/​tests/​sysio.epoch_flushwtdw_tests.cpp Removes underwriting deployment assumptions.
contracts/​tests/​sysio.dispatch_tests.cpp Removes retired routing and expands regressions.
contracts/​tests/​sysio.chains_tests.cpp Tests the reduced outpost-address structure.
contracts/​tests/​emissions_tests.cpp Removes retired fee-field assertions.
contracts/​tests/​contract_test_support.hpp Produces two-field outpost fixtures.
contracts/​sysio.tokens/​include/​sysio.tokens/​sysio.tokens.hpp Removes reserve precision reference.
contracts/​sysio.system/​sysio.system.abi Removes legacy epoch-log fields.
contracts/​sysio.system/​src/​emissions.cpp Removes retired fee audit behavior.
contracts/​sysio.system/​include/​sysio.system/​sysio.system.hpp Updates emissions documentation.
contracts/​sysio.system/​include/​sysio.system/​producer_score.hpp Removes underwriting-lock reference.
contracts/​sysio.system/​include/​sysio.system/​producer_rank.hpp Removes retired dependency reference.
contracts/​sysio.system/​include/​sysio.system/​emissions.hpp Shrinks serialized epoch-log rows.
contracts/​sysio.system/​EMISSIONS.md Removes retired fee-field documentation.
contracts/​sysio.opreg/​src/​sysio.opreg.cpp Updates native audit documentation.
contracts/​sysio.opp.common/​include/​sysio.opp.common/​safe_ops.hpp Removes reserve provenance reference.
contracts/​sysio.opp.common/​include/​sysio.opp.common/​require_privileged.hpp Removes retired registration example.
contracts/​sysio.opp.common/​include/​sysio.opp.common/​registry_metadata.hpp Documents remaining registries.
contracts/​sysio.opp.common/​include/​sysio.opp.common/​opp_table_types.hpp Removes retired serializers and table type.
contracts/​sysio.msgch/​sysio.msgch.abi Removes retired attestation values.
contracts/​sysio.msgch/​src/​sysio.msgch.cpp Deletes retired dispatch and helper logic.
contracts/​sysio.msgch/​include/​sysio.msgch/​sysio.msgch.hpp Updates queue and identity documentation.
contracts/​sysio.chalg/​src/​sysio.chalg.cpp Removes underwriting-challenge references.
contracts/​sysio.chalg/​include/​sysio.chalg/​sysio.chalg.hpp Deletes orphaned challenge documentation.
contracts/​sysio.chains/​sysio.chains.abi Removes two retired address fields.
contracts/​sysio.chains/​src/​sysio.chains.cpp Validates only active address fields.
contracts/​sysio.chains/​include/​sysio.chains/​sysio.chains.hpp Reduces the stored address structure.
contracts/​sysio.authex/​src/​sysio.authex.cpp Updates lookup-consumer documentation.
contracts/​sysio.authex/​include/​sysio.authex/​sysio.authex.hpp Updates cross-contract examples.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

| Three-field node-owner payload | BAR emits `NodeOwnerRegistration`; msgch and the Tools decoder consume that full payload. The three-field message had only a declaration and unused serializers. | `NodeOwnerReg`; retain `NODE_OWNER_REG` and `NodeOwnerRegistration` |
| OPP state wrapper | `ProtocolState` had only a declaration and unused serializers across all audited repositories. Envelope transport uses `Envelope` and its message/header types directly. | OPP `ProtocolState`; native chain `protocol_state_object` is unrelated |
| Dead dispatch work | `attestation_id` and `original_message_id` were never read by the complete dispatcher after swap dispatch retirement. Stored attestation identities and semantic header validation remain intact. | Remove the unused arguments and message-id reconstruction performed solely for them |
| Documentation residue | Relay comments and registry documentation still described removed reserves or the deleted underwriter daemon. Three unreferenced OPP diagrams describe an obsolete pre-refactor schema. | Refresh current comments and remove the obsolete diagrams |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving these as they are, on purpose. amm_math.hpp and its tests belong to the native sysio.swap AMM, which is not final and is excluded from this cleanup by direction; the audit's "Retained live or planned surfaces" section records that sysio.swap and everything it consumes (amm_math, twap, shadow_yield, sysio.andon) are deliberately untouched. Their wording will be refreshed with that implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 02dfa26, superseding my earlier reply: the code stays as it is (the sysio.swap AMM is not final), but its documentation no longer points at deleted contracts.

  • amm_math.hpp: the file header names sysio.swap (pair quotes via out_given_in, pair fees via split_wire_fee) as the consumer; the wire_fee doc drops sysio.uwrit::fee_bps; the net > 0 note states the 9999 + 1 bps arithmetic without the retired caps, and the clamp / no-underwriter notes describe quote_swap and sysio.swap instead of the retired applyswap / applyfromwire / refundwire / paywire / revert paths.
  • amm_math_tests.cpp: the three comment blocks (lines 144, 181, 284-290 before) drop sysio.uwrit::setconfig, sysio.reserv custody and setrsvfee.
  • Also fixed emissions_tests.cpp, whose comment said a UWRIT account gets contract code.

Comment-only: every contract wasm/abi rebuilds byte-identical, and amm_math_tests, sysio_swap_tests and sysio_emissions_tests pass (91 cases).

@valthon
valthon force-pushed the cleanup/retired-opp-carriers branch from 3597cc6 to 529d059 Compare October 10, 2026 13:59
External reserve and dual-commit implementations were retired, but their
shared protocol definitions still advertised unused lifecycle APIs, and
the contracts, plugins and tests around them kept the surfaces those
flows needed.

Remove reserve cancellation, matching, snapshot, and registry types,
and cross-chain swap, dual-commit, remittance and refund carriers;
retire the unused purchase/yield and emissions notification payloads,
obsolete state enums, old node-owner payload, and OPP state wrapper.
Remove dead dispatch correlation inputs and the msgch helpers that only
served the retired ingress: operator-address resolution, payload-code
canonicality and the uwreqs locked-amount row type.

Remove the staking lifecycle carriers as well: PretokenStakeChange,
StakeUpdate, StakeResult, the StakeStatus enum and the STAKE, UNSTAKE,
STAKE_UPDATE and STAKE_RESULT discriminants. Their only producers were
two uncalled StakingManager senders on Ethereum, and msgch dropped all
four in one deferred case. AttestationProcessingError goes too: no chain
produces it and msgch ignored it.

Drop the underwriter outpost roles from the sysio.chains registry
(operator_registry_addr, source_deposit_addr) and the shared role
resolver: the batch-operator relay reads only the OPP and OPPInbound
addresses. Drop the epochlog swap-fee audit fields, which payepoch wrote
as constant zero once the reserv fee sweep was deleted.

Keep live native collateral audit, node-owner registration, LIQ
custody, local emissions diagnostics, and the native sysio.swap AMM.
Retained payload fields and wire discriminants are unchanged. Rebuild
the chains, epoch, liq, msgch, opreg, synd and system artifacts, verify
that opaque removed wire values cannot block a following live LIQ
intake, and refresh documentation that still described the deleted
contracts.

Document producer/consumer evidence and the consumer release wave. The
sysio.chains, epochlog and msgch ABI changes need the matching
libraries, tools, Ethereum and Solana consumers, which land with this
change.

Change-Id: I06515e3ac32964be90eb1b5f9db1ead6b611b788
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ARSeK35wwkiAy4et9mCkVm
@valthon
valthon force-pushed the cleanup/retired-opp-carriers branch from 529d059 to 02dfa26 Compare October 10, 2026 14:24
An audit of every surface left in the OPP protobufs found several with
no producer: CHALLENGE_REQUEST and CHALLENGE_RESPONSE with their
ChallengeRequest / ChallengeOperatorHash payloads (msgch dropped both;
sysio.chalg disputes run on DisputeStatus through evalcons), and
declarations nothing encodes: ChainKeyType, ChainSignature,
WirePermission, ChainRequestStatus, ChallengeStatus,
DebugEnvelopeDataRecord, and the Chain / Token / ChainToken messages,
which were described as registry carriers although sysio.chains and
sysio.tokens store their own row structs.

Remove them with their reflections, serializers and depot case, and
rebuild the msgch ABI (the two enum values; every wasm is unchanged).
Extend the retired-carrier regressions to the new names and wire values.

Correct comments that said sysio.opreg emits OPERATOR_ACTION: it records
withdraw and slash entries in the operator audit log and queues no
attestation; outposts learn a slashed status from the OPERATORS roster.
Point the bootstrap-config docs at the registry tables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ARSeK35wwkiAy4et9mCkVm
Change-Id: I4435e434bd867b3b4b936df7a0f17328fa47b8c3
@valthon
valthon requested review from heifner and jglanz October 12, 2026 15:17

@jglanz jglanz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as requested from @valthon:

I've already given it multiple passes and run the flow tests (in combination with the associated prs on the other heads), so i'm pretty confident it's solid

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.

3 participants