Skip to content

Add on-chain rate-of-change guardrails for protocol parameters - #450

Merged
james2177 merged 1 commit into
stellar-vortex-protocol:mainfrom
josunday002:drips/404
Sep 30, 2026
Merged

james2177 merged 1 commit into
stellar-vortex-protocol:mainfrom
josunday002:drips/404

Conversation

@josunday002

Copy link
Copy Markdown

Summary

Add on-chain rate-of-change guardrails for protocol parameters

What was solved

#404 — [High] Add on-chain rate-of-change guardrails to protocol parameters

Add on-chain rate-of-change guardrails to protocol parameters so that any single set_config (and set_tier_threshold) change is bounded by a per-parameter max_step over an epoch, rejecting oversize steps with ParameterStepTooLarge, tracking last-change timestamp/value per parameter, exempting initial configuration, and exposing a get_parameter_guardrails() view.

Addressed:

  • Changed: README.md
  • Per parameter define max_step (absolute or bps) and an epoch length.
  • set_config must reject oversize steps with a ParameterStepTooLarge error.
  • Safety-increasing directions (e.g. lowering fees, raising the minimum bond) may have looser limits; document which direction is safe per parameter.

Changes

  • README.md (modify)

Approach

  1. In intent_settlement/src/lib.rs, add per-parameter guardrail config (max_step, epoch, safe direction) and a ParameterStepTooLarge error, plus storage for last-change timestamp/value per parameter.
  2. Implement cumulative-within-epoch step checking in set_config (and any timelocked config path), exempting initial configuration, and expose get_parameter_guardrails().
  3. In solver_registry/src/lib.rs, apply the same guardrail pattern to set_tier_threshold with its own per-parameter limits and error.
  4. Add boundary tests per parameter in intent_settlement/src/test.rs (and solver_registry tests) covering oversize rejection, cumulative epoch limits, epoch reset, and initial-config exemption.
  5. Update the README fee section to document the guardrails and safe directions.

Issues

Closes #404

@james2177
james2177 merged commit c9497c1 into stellar-vortex-protocol:main Sep 30, 2026
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.

[High] Add on-chain rate-of-change guardrails to protocol parameters

2 participants