Skip to content

fix: per-slab single-source counter, per-scan ADL errors (M8+M14)#96

Open
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/m8-m14-per-market-counters
Open

fix: per-slab single-source counter, per-scan ADL errors (M8+M14)#96
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/m8-m14-per-market-counters

Conversation

@0x-SquidSol
Copy link
Copy Markdown
Contributor

Summary

M8 — Oracle single-source counter was global:

  • _consecutiveSingleSource was a scalar shared across all markets
  • Any dual-source market reset the counter, masking degradation for single-source markets
  • Now a per-slab Map — each market tracks its own cross-validation coverage independently
  • Alert includes the affected market slab address for targeted debugging

M14 — ADL errors counted per-position instead of per-scan:

  • consecutiveErrors was incremented for each individual position tx failure inside the loop
  • 3 failed positions in one cycle fired the alert meant for 3 consecutive failed scan cycles
  • Now uses a scanHadError flag — counter increments once per failed scan, not per position
  • Reset only when a scan has at least one successful send

Test plan

  • All 133 tests pass

🤖 Generated with Claude Code

…M14)

M8: The oracle _consecutiveSingleSource counter was a single global
scalar. Any market getting dual-source reset the counter, masking
degradation for markets stuck on single-source. Now uses a per-slab
Map so each market tracks its own cross-validation coverage.

M14: ADL consecutiveErrors was incremented per-position failure inside
the position loop. 3 failed positions in one scan fired the alert
meant for 3 consecutive failed scans. Now tracks at scan level: a scan
with any error increments the counter only once, and any successful
send resets it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@0x-SquidSol has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1fd090c1-ed50-4f92-86c6-b834f3272e28

📥 Commits

Reviewing files that changed from the base of the PR and between 3280971 and e34ff9c.

📒 Files selected for processing (2)
  • src/services/adl.ts
  • src/services/oracle.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant