Skip to content

fix(settlement): accumulate validator notes across rate change segments#271

Merged
ZenGround0 merged 1 commit intomainfrom
audit-fix-268-accumulate-notes
Feb 26, 2026
Merged

fix(settlement): accumulate validator notes across rate change segments#271
ZenGround0 merged 1 commit intomainfrom
audit-fix-268-accumulate-notes

Conversation

@ZenGround0
Copy link
Copy Markdown
Contributor

Closes #268

I went with the append option. I think this is fine as non empty notes only show up as error conditions in our only existing validator and as auditors have pointed out settling many segments will cost linearly increasing gas so this is only adding a constant term to an existing efficiency problem not creating a whole new problem. And it is a simple matter for users to settle smaller spans of time if we actually start hitting gas problems.

Previously, when settling a rail with multiple rate changes in the queue,
only the final segment's note was retained. Now notes from all segments
are accumulated with "; " separators, following the pattern used in
checkAndFinalizeTerminatedRail.

Only non-empty notes are added to the accumulator.

Updated test to verify the accumulated notes behavior.

Fixes #268

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
Comment thread src/FilecoinPayV1.sol
// Accumulate validation notes from each segment
if (bytes(validationNote).length > 0) {
if (bytes(note).length > 0) {
note = string.concat(note, "; ", validationNote);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a pretty expensive operation in ethereum because memory gas is quadratic and solidity will leak each of these strings, but it's probably fine in the FEVM.

@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FOC Jan 29, 2026
@BigLep BigLep added this to the M4.5: GA Fast Follows milestone Jan 30, 2026
@ZenGround0 ZenGround0 merged commit 7bc77d8 into main Feb 26, 2026
4 of 5 checks passed
@ZenGround0 ZenGround0 deleted the audit-fix-268-accumulate-notes branch February 26, 2026 20:00
@github-project-automation github-project-automation Bot moved this to 🎉 Done in Payments Feb 26, 2026
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done 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: 🎉 Done
Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Audit Fix L02: Accumlate notes

5 participants