Description:
bench.rs measures settlement's resource use, but nothing fails when a change blows up the CPU, memory, or read/write bytes of an entrypoint. Add ceiling assertions for every public entrypoint in all four contracts, measured at the worst case (maximum batch size, maximum list sizes, maximum bond tokens).
Problem Statement & Context:
Solvers price transactions using the published costs (docs/149). A silent 3× regression breaks solver economics, and near-limit entrypoints can start failing outright on mainnet.
Scope & Acceptance Criteria:
- Worst-case fixtures per entrypoint.
- Assertions on CPU instructions, memory bytes, ledger read/write entries and bytes, and event bytes, each with 10% headroom over the current values.
- Budget numbers are generated into
docs/149-*.md from the test output.
- Out of scope: optimizing costs (separate issues).
Implementation Guidelines:
- Key Files/Modules:
intent_settlement/src/bench.rs, new bench modules in each satellite, docs/149-*.md.
- Design/Architecture: Use
env.cost_estimate() / env.budget() from the SDK testutils.
- Edge Cases/Constraints: Numbers differ across SDK versions, so pin them and regenerate on upgrade.
- Testing: The ceilings are themselves the tests.
Definition of "Done":
- CI green, and docs/149 regenerated.
- Reviewed and approved.
Resources:
Complexity: High (200 points)
Description:
bench.rsmeasures settlement's resource use, but nothing fails when a change blows up the CPU, memory, or read/write bytes of an entrypoint. Add ceiling assertions for every public entrypoint in all four contracts, measured at the worst case (maximum batch size, maximum list sizes, maximum bond tokens).Problem Statement & Context:
Solvers price transactions using the published costs (docs/149). A silent 3× regression breaks solver economics, and near-limit entrypoints can start failing outright on mainnet.
Scope & Acceptance Criteria:
docs/149-*.mdfrom the test output.Implementation Guidelines:
intent_settlement/src/bench.rs, new bench modules in each satellite,docs/149-*.md.env.cost_estimate()/env.budget()from the SDK testutils.Definition of "Done":
Resources:
docs/149-resource-cost-per-entrypoint.mdBudget/instruction-count APIs #195, [High] Add drift detection fordocs/149-resource-cost-per-entrypoint.md's published numbers #285Complexity: High (200 points)