Repository navigation
Remove retired OPP reserve, swap and launch carriers - #674
Conversation
26996e7 to
9a4aa45
Compare
9a4aa45 to
3597cc6
Compare
There was a problem hiding this comment.
🟡 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.chainsandsysio.systemABI 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 | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 namessysio.swap(pair quotes viaout_given_in, pair fees viasplit_wire_fee) as the consumer; thewire_feedoc dropssysio.uwrit::fee_bps; thenet > 0note states the 9999 + 1 bps arithmetic without the retired caps, and the clamp / no-underwriter notes describequote_swapandsysio.swapinstead of the retiredapplyswap/applyfromwire/refundwire/paywire/ revert paths.amm_math_tests.cpp: the three comment blocks (lines 144, 181, 284-290 before) dropsysio.uwrit::setconfig,sysio.reservcustody andsetrsvfee.- 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).
3597cc6 to
529d059
Compare
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
529d059 to
02dfa26
Compare
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



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:
ReserveCreateCancel,ReserveCreateCancelled,ReserveReady, their wire enum values, and the inert depot cases.Reserve/ReserveAmount/ReserveStatus, the unused purchase/yield payloads and enum values, and the retired cross-chain emissions notification. Preserve depot-local emissions diagnostics.SwapRequest,UnderwriteIntentCommit,SwapRemit,SwapRevert, andDepositRevert, including their discriminants, serializers, reflections, and inert routing. Their settlement implementations were retired withsysio.reserv/sysio.uwrit.NodeOwnerReg, and unused OPPProtocolState. Preserve activeNodeOwnerRegistration, native collateral audit, rosters, and LIQ custody.PretokenStakeChange,StakeUpdate,StakeResult, theStakeStatusenum, and the STAKE, UNSTAKE, STAKE_UPDATE and STAKE_RESULT discriminants with their serializers, reflections and depot case. Their only producers were two internal EthereumStakingManagersenders with no caller (stakeLiqETHis a_notWiredstub); msgch dropped all four in a deferred case. Also removeAttestationProcessingError, which no chain produces.CHALLENGE_REQUEST(60945) andCHALLENGE_RESPONSE(60932) with theirChallengeRequest/ChallengeOperatorHashpayloads: msgch dropped both, andsysio.chalgdisputes run onDisputeStatusthroughevalcons. Also remove declarations nothing encodes:ChainKeyType,ChainSignature,WirePermission,ChainRequestStatus,ChallengeStatus,DebugEnvelopeDataRecord, and theChain/Token/ChainTokenmessages, which were described as registry carriers althoughsysio.chainsandsysio.tokensstore their own row structs.resolve_account_from_op_address,payload_codes_canonical) and the unusedopp_table::locked_amount_t. The live LIQ paths reject unregistered codes through the token registry.sysio.chains: drop the underwriter outpost rolesoperator_registry_addr/source_deposit_addrand the sharedresolve_role_addr. The batch-operator relay reads onlyopp_addr/opp_inbound_addr. ABI change.sysio.system: dropepochlog.fee_distributed/batch_fee_retained, whichpayepochwrote as constant zero once the reserv fee sweep was deleted. ABI change.sysio.reserv,sysio.uwrit, the underwriter daemon and underwriter challenges (orphanedsysio.chalgdeclarations' docs, test fixtures, emissions notes, Solana client comments, and theamm_mathheader and tests, which now namesysio.swapas their consumer; that code is unchanged).CMAKE_BUILD_TYPEflavor; 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.sysio.opregemitsOPERATOR_ACTION: it records withdraw and slash entries in the operator audit log and queues no attestation; outposts learn a slashed status from theOPERATORSroster. Point the bootstrap-config docs at the registry tables.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):
build/claude:test_opp,contracts_unit_test,plugin_test)test_oppcontracts_unit_test(926 cases)plugin_test(307 cases)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.mjsand 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_valuescase (test_opp18/18) and comment-only documentation fixes (every contract wasm/abi byte-identical;amm_math_tests,sysio_swap_tests,sysio_emissions_tests91/91))://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) andplugin_test: no errors.test_batch_operator_plugin,test_outpost_solana_client_plugin,test_outpost_ethereum_client_plugin, both coverage-map checks, and all 12 flows run locally withrun-flow.mjs+ the heartbeat monitor; the staking removal is covered on this head by the run below.3597cc6f, wire-libraries-ts53519742, wire-tools-ts6fb42b7d, wire-ethereum4c62fc22, wire-solanaa5a15e4d, wire-cdta00bd718.payer_choice_test,protocol_feature_tests) are unrelated to this change and still recorded rather than counted as green.solana_idl_stub_consistency_testreports two divergences (DistributionStatefield order,LatestOutboundEnvelope.datatype) that also fail with the base commit's stub; this PR removes the third (ReserveStatus).Consumer changes (branch
cleanup/retired-opp-carriersin each):cargo update -p wire-opp-solana-models.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