Skip to content

fix(RateChangeQueue): remove unreachable array clearing logic#269

Open
ZenGround0 wants to merge 1 commit intomainfrom
audit-fix-266-rate-change-queue
Open

fix(RateChangeQueue): remove unreachable array clearing logic#269
ZenGround0 wants to merge 1 commit intomainfrom
audit-fix-266-rate-change-queue

Conversation

@ZenGround0
Copy link
Copy Markdown
Contributor

Closes #266. I went with the solution removing clearing array size entirely as this is minutely more efficient.

The isEmpty() check after delete was unreachable because:
1. We pass require(queue.head < c.length) to enter dequeue
2. delete doesn't change array length
3. isEmpty() checks queue.head == c.length, which can never be true

This simplifies the dequeue function by always incrementing head.

Fixes #266

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@FilOzzy FilOzzy added this to FOC Jan 28, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jan 28, 2026
@BigLep BigLep added this to the M4.5: GA Fast Follows milestone Jan 30, 2026
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Jan 30, 2026
@rjan90 rjan90 requested a review from wjmelements February 5, 2026 09:51
@wjmelements
Copy link
Copy Markdown
Contributor

prefer #272

@BigLep BigLep moved this from 🔎 Awaiting review to 🐱 Todo in FOC Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🐱 Todo
Status: No status

Development

Successfully merging this pull request may close these issues.

Audit Fix L06: RateChangeQueue clearing behavior

6 participants