Fix profiler overhead, canary baseline rollback, pool leak detection, WebAuthn downgrade protection - #458
Merged
maugauwi-hash merged 1 commit intoAug 31, 2026
Conversation
…ction, WebAuthn downgrade protection - profiler.rs: auto-throttle sample rate when recording overhead exceeds 5% of profiled operation time, expose overhead/sample rate via GET /admin/profiler/overhead - canary.rs: compare canary error rate against a continuously reported baseline cohort error rate and auto-rollback when it exceeds baseline by more than the configured margin, independent of absolute thresholds - pool_optimizer.rs: track per-connection checkout timestamps and flag connections held beyond max_checkout_secs as suspected leaks; log and page on-call via a new oncall::raise_alert helper - webauthn.rs: maintain an explicit COSE algorithm allowlist and reject registrations that downgrade a user to a weaker algorithm than one already on file Closes ethos-protocol#384 Closes ethos-protocol#385 Closes ethos-protocol#386 Closes ethos-protocol#387
|
@kanengchik 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.
Summary
Fixes four issues across observability, deployment safety, database reliability, and authentication security:
Add Profiler Sampling Overhead Guard #384 — Profiler Sampling Overhead Guard:
ProfilerStatenow tracks its own recording overhead as a percentage of profiled operation time. Once overhead exceeds 5%, the sample rate is automatically halved (down to a 1% floor) so continuous profiling can't itself become a bottleneck. Current overhead and sample rate are exposed viaGET /admin/profiler/overhead. Documented indocs/profiling-guide.md.Implement Canary Deployment Automatic Rollback on Error Spike #385 — Canary Deployment Automatic Rollback on Error Spike:
POST /deployments/canary/:id/evaluatenow accepts an optionalbaseline_error_rateon every call, enabling continuous canary-vs-baseline comparison. If the canary's error rate exceeds the reported baseline by more thanthresholds.max_error_rate_margin(default 1 percentage point), the deployment is automatically rolled back — independent of the existing absolutemax_error_rate/max_latency_p99_msthresholds. Documented indocs/canary-deployments.md.Add Pool Optimizer Connection Leak Detection #386 — Pool Optimizer Connection Leak Detection:
OptimizedConnectionPoolnow tracks a checkout timestamp per connection. Connections held longer thanDB_POOL_MAX_CHECKOUT_SECS(default 60s) are flagged as suspected leaks viadetect_leaks(), surfaced inPoolMetrics::suspected_leaks, and can be logged + paged to on-call via the newcheck_for_leaks_and_alert()method, which uses a newoncall::raise_alert()helper. Documented indocs/configuration-reference.md.Implement WebAuthn Credential Algorithm Downgrade Protection #387 — WebAuthn Credential Algorithm Downgrade Protection:
CoseAlgorithmnow has an explicitALLOWED_ALGORITHMSallowlist and a relative strength ranking (EdDSA > ES256 > RS256). Registration is rejected with400if the algorithm isn't allowlisted, and with409if a user attempts to register a new credential using a weaker algorithm than one they already have on file (downgrade attack prevention). Documented indocs/webauthn-setup.md.Each issue's task list called for tests, so unit/integration tests covering the new behavior were added alongside the implementation in each file.
Test plan
cargo test -p ethos-protocol-backend profiler::— overhead throttling testscargo test -p ethos-protocol-backend canary::— baseline rollback trigger/non-trigger testscargo test -p ethos-protocol-backend pool_optimizer::— leak detection testscargo test -p ethos-protocol-backend webauthn::— algorithm allowlist/downgrade testscargo test -p ethos-protocol-backend oncall::— alert-raising testsCloses #384
Closes #385
Closes #386
Closes #387