Repository navigation
docs(adr): remove FeeRouter PoC stub allowance per production-from-day-one principle - #558
Conversation
…y-one principle The unified contract surface in ADR 016 § Tunable Economics (introduced in #449 / #454) already handles the simplified-launch case via zero- share buckets on the production FeeRouter contract: launch with shares like 80/0/0/10/10/0 and dial up gauge / delegator / safety as the dependency contracts are wired in. The ADR 003 § PoC stub paragraph — which allowed a 40%-only stub FeeRouter accumulating the other 60% in a single treasury wallet — is redundant with this and conflicts with ADR 016's commitment to "production shape from day one." - ADR 003 § Settlement sequence: PoC stub subsection removed. Replaced with a positive statement that the full six-bucket split applies to every network deployment from launch; simplified launches use setShares, not a reduced-surface stub. - appendix-poc-production-seams.md § 6 FeeRouterClient: the wiring-seam alternative side reframed from "in-process PoC stub (deployment-time backend)" to "in-process test mock for unit / integration test harnesses where no contracts are deployed; never a deployment-time backend." The trait abstraction stays; the network-deployment side is unambiguously the production contract. Closes #547.
There was a problem hiding this comment.
Code Review
This pull request updates the ADR documentation to replace the concept of a 'PoC stub' with a unified 'FeeRouter' implementation that applies the full six-bucket split to all network deployments from launch. It clarifies that simplified launch configurations are managed via tunable shares rather than reduced-surface stubs and updates the 'FeeRouterClient' wiring seams to distinguish between test mocks and network deployments. Review feedback suggests improving the readability of dense paragraphs, ensuring terminology consistency across all tables in the appendix, and standardizing the formatting of contract function references.
| #### PoC stub | ||
|
|
||
| For the PoC, the wiring layer in the `node` crate (per [Appendix: PoC/Production Seams](appendix-poc-production-seams.md)) selects the `FeeRouter` deployment per network. A PoC stub `FeeRouter` MAY perform only the 40% same-tx base payout to the operator and accumulate the remaining 60% in a single forwarding wallet (treasury), to keep the PoC contract surface bounded while preserving the `StablePaymentChannel` ↔ `FeeRouter` interface contract. Production deployments MUST implement the full six-bucket split with epoch-bucketed gauge and delegator pools. | ||
| End-to-end USDC flow (client→node settlement, then the parallel cache-miss bypass) is diagrammed in [ADR 016 §"FeeRouter integration"](016-contract-interactions.md). This ADR documents only the `StablePaymentChannel ↔ FeeRouter` interface contract. The full six-bucket split applies to every network deployment from launch — simplified launch configurations are expressed by setting non-active bucket shares to zero via `FeeRouter.setShares(...)` per [ADR 016 § Tunable Economics](016-contract-interactions.md#tunable-economics), not by deploying a reduced-surface stub. The cross-validation invariant in [ADR 016 § Tunable Economics](016-contract-interactions.md#tunable-economics) ensures any non-zero share has a wired non-zero destination, so the launch share configuration alone determines which downstream contracts must be ready at deploy time. |
There was a problem hiding this comment.
This paragraph is quite dense as it combines the USDC flow diagram reference, contract scope, bucket split logic, and cross-validation invariants. Consider splitting it into two or three sentences to improve readability.
Example:
"End-to-end USDC flow (client→node settlement, then the parallel cache-miss bypass) is diagrammed in ADR 016 §"FeeRouter integration". This ADR documents only the StablePaymentChannel ↔ FeeRouter interface contract.
The full six-bucket split applies to every network deployment from launch. Simplified launch configurations are expressed by setting non-active bucket shares to zero via FeeRouter.setShares(...) per ADR 016 § Tunable Economics, not by deploying a reduced-surface stub. The cross-validation invariant in ADR 016 § Tunable Economics ensures any non-zero share has a wired non-zero destination, so the launch share configuration alone determines which downstream contracts must be ready at deploy time."
| ``` | ||
|
|
||
| | | PoC | Production | | ||
| | | Tests / local dev | Network deployment | |
There was a problem hiding this comment.
The column headers in this table have been updated to Tests / local dev and Network deployment to make the boundary explicit. However, the rest of the tables in this appendix (Sections 1-5 and 7-9) still use the PoC and Production terminology. To maintain consistency across the document, it is recommended to apply this terminology change to all tables in the appendix or at least acknowledge the discrepancy if it's intended to be phased in incrementally.
| |---|-----|------------| | ||
| | Implementation | `NoopFeeRouterClient` — in-process no-op (or local accounting) router; settlement skips the on-chain split | `OnchainFeeRouterClient` — deployed `FeeRouter` contract address per network (configured) | | ||
| | Settlement path | `PaymentChannel.settleChannel` pays operator the full balance; downstream buckets simulated for tests | `PaymentChannel.settleChannel` calls `FeeRouter.routeSettlement(operator, bytesDelivered, amount, epochId)` in the same transaction | | ||
| | Implementation | `MockFeeRouterClient` — in-process mock for harnesses with no deployed contracts; never a deployment-time backend | `OnchainFeeRouterClient` — deployed `FeeRouter` contract address per network; the full production split applies to every network deployment per [ADR 016 § Tunable Economics](016-contract-interactions.md#tunable-economics) (simplified-launch configurations set bucket shares via `setShares` on the same contract, not via a reduced-surface stub) | |
…tShares (#559) Two post-merge review items from #558: - ADR 003 § Settlement sequence: the four-clause paragraph introduced by #558 is split into two paragraphs at the natural boundary between scope statement and launch-configuration discussion. - appendix-poc-production-seams.md §6 table cell: `setShares` → `FeeRouter.setShares(...)` for consistency with the ADR 003 prose that the cell cross-references. The third bot comment — cross-table consistency between §6's new "Tests / local dev | Network deployment" headers and §§1-5, 7-9's existing "PoC | Production" headers — is out of scope here. §§7-9 (VotingEscrow / SafetyReserve / SwapHelper) carry the same "production from day one" applicability as §6 and could be relabelled in a separate pass; §§1-5 (cache backend, gossip, etc.) retain real PoC-vs-production distinctions and should keep the original headers. A separate PR can do the §§7-9 relabel if desired.
Closes #547.
The unified contract surface in ADR 016 § Tunable Economics (introduced by #449 / #454) already handles the simplified-launch case via zero-share buckets on the production
FeeRoutercontract: launch with shares like80/0/0/10/10/0and dial up gauge / delegator / safety as the dependency contracts are wired in. The ADR 003 § PoC stub paragraph — which allowed a 40%-only stubFeeRouteraccumulating the other 60% in a single treasury wallet — is redundant with that mechanism and conflicts with the "production shape from day one" commitment.Decision
Remove the stub allowance entirely. The production
FeeRouteris mandatory from launch on every network (including the Arbitrum Sepolia testnet). The "simplified launch" case is expressed by setting bucket shares to zero viaFeeRouter.setShares(...), not by deploying a reduced-surface contract.Sites updated
#### PoC stubsubsection removed. Replaced with a positive statement that the full six-bucket split applies to every network deployment, with simplified launches expressed viasetShareson the same production contract.FeeRouterClient: the wiring-seam alternative reframed from "in-process PoC stub (deployment-time backend)" to "in-process test mock for unit / integration tests where no contracts are deployed; never a deployment-time backend." The trait abstraction (FeeRouterClient) stays — it is still useful for tests — but the network-deployment side is unambiguously the on-chainFeeRouter. Column headers updated fromPoC / ProductiontoTests / local dev | Network deploymentto make the boundary explicit.The broader leaf-crate / wiring-seam principle in §6.5 ("All mode selection between PoC stubs / fixtures / mocks and production contracts lives in the
nodecrate's wiring layer") still holds — this PR narrows the meaning of the test-side variant from "deployable PoC stub" to "in-process test mock."