fix(settlement): accumulate validator notes across rate change segments#271
Merged
ZenGround0 merged 1 commit intomainfrom Feb 26, 2026
Merged
fix(settlement): accumulate validator notes across rate change segments#271ZenGround0 merged 1 commit intomainfrom
ZenGround0 merged 1 commit intomainfrom
Conversation
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>
wjmelements
reviewed
Jan 29, 2026
| // Accumulate validation notes from each segment | ||
| if (bytes(validationNote).length > 0) { | ||
| if (bytes(note).length > 0) { | ||
| note = string.concat(note, "; ", validationNote); |
Contributor
There was a problem hiding this comment.
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.
wjmelements
approved these changes
Jan 29, 2026
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.
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.