diff --git a/packages/cluster-tool/src/orchestration/ClusterBuildDefaults.ts b/packages/cluster-tool/src/orchestration/ClusterBuildDefaults.ts index bf09aa62..a4eea77a 100644 --- a/packages/cluster-tool/src/orchestration/ClusterBuildDefaults.ts +++ b/packages/cluster-tool/src/orchestration/ClusterBuildDefaults.ts @@ -55,6 +55,19 @@ const MinFromWireAmount = 100_000_000 * flows never pay it and system-caused reverts refund in full. */ const FromWireRevertFeeBps = 10 +/** + * Epochs a PENDING uwreq may wait for its underwriter race before + * `sysio.uwrit::pruneuwreqs` expires it (refund/revert + EXPIRED). Mirrors + * the contract default; flow races resolve within an epoch, so the timeout + * only fires for genuinely abandoned requests (SEC-129 / WSA-223). + */ +const UwreqPendingTimeoutEpochs = 10 +/** + * Epochs a terminal (COMPLETED / REJECTED / EXPIRED) uwreq row is retained + * for audit before `sysio.uwrit::pruneuwreqs` erases it. Mirrors the + * contract default (SEC-129 / WSA-223). + */ +const UwreqRetentionEpochs = 10 /** Epoch envelope-log retention. */ const EnvelopeLogRetentionEpochs = 10 /** Dev-default batch-operator group COUNT (sliding-window schedule; per-flow overridable via ClusterConfig). */ @@ -697,7 +710,9 @@ export namespace ClusterBuildDefaults { fee_bps: SwapFeeBps, collateral_lock_duration_ms: CollateralLockDurationMs, min_fromwire_amount: MinFromWireAmount, - fromwire_revert_fee_bps: FromWireRevertFeeBps + fromwire_revert_fee_bps: FromWireRevertFeeBps, + uwreq_pending_timeout_epochs: UwreqPendingTimeoutEpochs, + uwreq_retention_epochs: UwreqRetentionEpochs } ) ) diff --git a/packages/cluster-tool/tests/orchestration/steps/contracts/sysio/UwritContractSteps.test.ts b/packages/cluster-tool/tests/orchestration/steps/contracts/sysio/UwritContractSteps.test.ts index 20d3e219..0a87a68c 100644 --- a/packages/cluster-tool/tests/orchestration/steps/contracts/sysio/UwritContractSteps.test.ts +++ b/packages/cluster-tool/tests/orchestration/steps/contracts/sysio/UwritContractSteps.test.ts @@ -4,16 +4,19 @@ import { SysioContracts } from "@wireio/sdk-core" describe("Steps.contracts.sysio.uwrit", () => { it("setconfig carries the uwrit::setconfig data", () => { - // `sysio.uwrit::setconfig` grew the swap-from-WIRE ingress rails: the - // escrow floor (`min_fromwire_amount`, 9-dec base units) and the - // caller-fault drain-revert fee (`fromwire_revert_fee_bps`). The action - // type requires all four fields — a payload missing the new pair fails + // `sysio.uwrit::setconfig` grew the swap-from-WIRE ingress rails (the + // escrow floor `min_fromwire_amount` + caller-fault drain-revert fee + // `fromwire_revert_fee_bps`) and the SEC-129 / WSA-223 UWREQ lifecycle + // knobs (`uwreq_pending_timeout_epochs` + `uwreq_retention_epochs`). The + // action type requires all six fields — a payload missing any pair fails // chain-side serialization. const data: SysioContracts.SysioUwritSetconfigAction = { fee_bps: 30, collateral_lock_duration_ms: 600_000, min_fromwire_amount: 100_000_000, - fromwire_revert_fee_bps: 10 + fromwire_revert_fee_bps: 10, + uwreq_pending_timeout_epochs: 10, + uwreq_retention_epochs: 10 } const step = Steps.contracts.sysio.uwrit.planSetconfig( Report.Actor.Sysio, @@ -28,6 +31,8 @@ describe("Steps.contracts.sysio.uwrit", () => { expect(step.input.data.fee_bps).toBe(30) expect(step.input.data.min_fromwire_amount).toBe(100_000_000) expect(step.input.data.fromwire_revert_fee_bps).toBe(10) + expect(step.input.data.uwreq_pending_timeout_epochs).toBe(10) + expect(step.input.data.uwreq_retention_epochs).toBe(10) expect(typeof step.runner).toBe("function") }) })