Skip to content

docs(adr): remove FeeRouter PoC stub allowance per production-from-day-one principle - #558

Merged
alpergundogdu merged 1 commit into
mainfrom
adr-547-feerouter-stub-removal
May 14, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
adr-547-feerouter-stub-removal

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

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 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 that mechanism and conflicts with the "production shape from day one" commitment.

Decision

Remove the stub allowance entirely. The production FeeRouter is mandatory from launch on every network (including the Arbitrum Sepolia testnet). The "simplified launch" case is expressed by setting bucket shares to zero via FeeRouter.setShares(...), not by deploying a reduced-surface contract.

Sites updated

  • ADR 003 § Settlement sequence: #### PoC stub subsection removed. Replaced with a positive statement that the full six-bucket split applies to every network deployment, with simplified launches expressed via setShares on the same production contract.
  • appendix-poc-production-seams.md § 6 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-chain FeeRouter. Column headers updated from PoC / Production to Tests / local dev | Network deployment to 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 node crate's wiring layer") still holds — this PR narrows the meaning of the test-side variant from "deployable PoC stub" to "in-process test mock."

…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.
@alpergundogdu
alpergundogdu merged commit d3a7fca into main May 14, 2026
11 checks passed
@alpergundogdu
alpergundogdu deleted the adr-547-feerouter-stub-removal branch May 14, 2026 14:49

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread adr/003-payments.md
#### 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the terminology used in adr/003-payments.md and to improve clarity, consider using the full function name FeeRouter.setShares(...) and wrapping it in backticks (e.g., ... via FeeRouter.setShares(...) on the same contract ...).

alpergundogdu added a commit that referenced this pull request May 14, 2026
…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.
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.

ADR 003: re-evaluate FeeRouter PoC stub allowance under 'production shape from day one' principle

1 participant