Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/FilecoinPayV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,15 @@ contract FilecoinPayV1 is ReentrancyGuard {

// Add the gross settled amount to our running total
totalGrossSettled += segmentGrossSettled;
note = validationNote;

// Accumulate validation notes from each segment
if (bytes(validationNote).length > 0) {
if (bytes(note).length > 0) {
note = string.concat(note, "; ", validationNote);
Copy link
Collaborator

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.

} else {
note = validationNote;
}
}

// If validator partially settled the segment, exit early
if (rail.settledUpTo < segmentEndBoundary) {
Expand Down
9 changes: 7 additions & 2 deletions test/RailSettlement.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@ contract RailSettlementTest is Test, BaseTestHelper {
RailSettlementHelpers.SettlementResult memory result =
settlementHelper.settleRailAndVerify(railId, block.number, expectedAmount, block.number);

// Verify validator note
assertEq(result.note, "Standard approved payment", "Validator note should match");
// Verify validator notes are accumulated from all 9 segments
// (8 rate changes in the queue + 1 final segment)
string memory expectedNote = "Standard approved payment";
for (uint256 i = 1; i < 9; i++) {
expectedNote = string.concat(expectedNote, "; Standard approved payment");
}
assertEq(result.note, expectedNote, "Validator notes should be accumulated");
}

function testValidationWithReducedAmount() public {
Expand Down
Loading