Skip to content

Emit a configuration-change event from every rate-limit and per-call bound setter #90

Description

@mikewheeleer

Add observability events for limit and bound configuration changes

Description

The configuration setters in contracts/escrow/src/lib.rsset_max_requests_per_call, set_min_requests_per_call, set_max_requests_per_window, set_rate_window_seconds, set_require_service_registration, set_allowlist_enabled — all mutate operational policy silently, emitting no event. Unlike set_service_price (which emits price_set) or pause, an indexer or security monitor has no on-chain signal when an operator tightens or loosens these limits. This issue adds a consistent config-change event to each, closing the observability gap for policy mutations.

Requirements and context

  • Repository scope: Agentpay-Org/Agentpay-contracts only.
  • Publish a topic-tagged event from each listed setter, e.g. cfg_set(symbol_short!("max_call"), value) style, or distinct topics per setter — pick a scheme with a single decodable schema and document it.
  • Use symbol_short! topics (≤9 chars) and consistent data tuples; values that are u32/u64/bool should be encoded so one subscriber can decode all config events.
  • Keep the change purely additive — do not alter the price_set or paused payloads, and do not reorder any existing logic.
  • Document the full config-event catalogue (extending any existing events doc if present).

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/contracts-config-change-events
  • Implement changes
    • Write code in: contracts/escrow/src/lib.rsenv.events().publish(...) in each config setter.
    • Write comprehensive tests in: contracts/escrow/src/test.rs — assert the event topic/data via env.events().all() for each setter.
    • Add documentation: document the config events in README.md.
    • Include NatSpec-style doc comments (///) matching the existing style in lib.rs.
    • Validate security: events expose no more than the state already does; topic lengths within Soroban symbol limits.
  • Test and commit

Test and commit

  • Run cargo fmt --all -- --check, cargo build, and cargo test.
  • Cover edge cases: setting a value to its current value still emits, boolean toggles, large numeric values.
  • Include the full cargo test output and a short security notes section in the PR description.

Example commit message

feat: emit config-change events from rate-limit and bound setters

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions