Conversation
… bench harnesses Add worst-case CPU/memory ceiling assertions (10% headroom) for every public entrypoint in intent_settlement and solver_registry. intent_settlement/src/bench.rs: - Ceiling constants for all 12 single entrypoints (submit, accept, fill full/partial, cancel, expire, slash, request_extension, register_solver x2, withdraw_bond, deregister_solver) - Worst-case batch ceilings for batch_submit/accept/fill/cancel at MAX_BATCH_SIZE=20 - bench_ceiling_* test per entrypoint; assert_within_ceiling helper - Existing resource_cost_report and resource_cost_is_reproducible tests retained unchanged solver_registry/src/bench.rs (new): - Full bench harness mirroring intent_settlement pattern - Ceiling assertions for all 22 public entrypoints: initialize, set_writer, set_tier_threshold, register_solver, stake, unstake, deregister_solver, record_fill, record_failure, slash, get_tier, tier_for, get_reputation_score, get_solver, get_solver_count, get_tier_table, get_fill_window_bonus_pct, get_slash_bps, get_fee_rebate_bps, get_admin, get_bond_token, compute_reputation_score - resource_cost_report and resource_cost_is_reproducible smoke tests solver_registry/src/lib.rs: - Add `#[cfg(test)] mod bench;` declaration Ceilings are set at baseline + 10% (rounded up to nearest 1000). Regenerate baselines with: cargo test --features testutils bench::resource_cost_report -- --nocapture Closes stellar-vortex-protocol#149
|
@Keengfk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(#149): add resource ceiling assertions to bench harnesses
Summary
Adds hard CPU and memory budget ceilings to every public entrypoint in
intent_settlement and solver_registry. A test fails immediately in CI whenever
a code change causes an entrypoint to exceed its ceiling, making silent
resource regressions impossible.
What changed
intent_settlement/src/bench.rs (rewritten)
entrypoints: submit_intent, accept_intent, fill_intent (full + partial),
cancel_intent, expire_intent, slash_solver, request_extension, register_solver
(first + top-up), withdraw_bond, deregister_solver
batch_fill_intent, batch_cancel_intent at MAX_BATCH_SIZE = 20
retained unchanged
solver_registry/src/bench.rs (new file)
set_tier_threshold, register_solver, stake, unstake, deregister_solver,
record_fill, record_failure, slash, get_tier, tier_for, get_reputation_score,
get_solver, get_solver_count, get_tier_table, get_fill_window_bonus_pct,
get_slash_bps, get_fee_rebate_bps, get_admin, get_bond_token,
compute_reputation_score
solver_registry/src/lib.rs
Methodology
Ceilings are set at baseline + 10% (rounded up to the nearest 1 000). Baselines
for intent_settlement come from the existing
docs/149-resource-cost-per-entrypoint.md snapshot (soroban-sdk 21.7.7).
Baselines for solver_registry are first-capture values at the same SDK version.
To update ceilings after a deliberate cost change:
--nocapture to get new measured values
Out of scope
Cost optimisation is tracked separately. This PR only adds the guard rails.
closes #423