Repository navigation
Conversation
Author
|
Validation completed on a clean fork checkout with Solidity 0.8.24. Both reference and optimized builds succeeded. The previously failing fuzz test passed with the original seed (256 runs, 0 failures). Only the test file was modified. |
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.
test: prevent recipient collision in transfer validation zone fuzz test
Summary
Fix a false-positive failure in
TestTransferValidationZoneFuzz.t.solcaused by an address collision between the authorized recipient and the recipient used for negative-path validation.The change ensures that the test always uses a genuinely unauthorized recipient when verifying the transfer validation zone's
InvalidOwnerbehavior.Root Cause
The existing fuzz test uses a fixed address as an unauthorized recipient:
address strangerAddress = address(0xdeafbeef);However, the fuzzer can generate the following valid combination:
offerRecipient = address(0xdeafbeef)shouldSpecifyRecipient = trueshouldUseTransferValidationZone = trueUnder these conditions, the supposedly unauthorized
strangerAddressis identical to the expected recipient.The test still calls
vm.expectRevertexpecting anInvalidOwnererror, even though the recipient is authorized.As a result, the transaction may legitimately proceed instead of reverting, causing the test to fail with:
DifferentialTestAssertionFailed()The underlying failure was traced to the Foundry expectation:
next call did not revert as expectedThis is an issue in the test's negative-path setup rather than evidence of incorrect Seaport protocol behavior.
Fix
The correction ensures that the unauthorized recipient cannot match the authorized recipient.
Specifically:
shouldSpecifyRecipient.address(0xdeafbeef).address(0xdeafbef0)instead.InvalidOwnerassertion.The change preserves the intended negative-path coverage while eliminating the address collision.
Scope of changes:
test/foundry/zone/TestTransferValidationZoneFuzz.t.solReproduction and Root Cause Verification
The original failure was reproduced using an isolated Foundry A/B diagnostic.
Original test:
DifferentialTestAssertionFailed()next call did not revert as expectedCollision-corrected test:
The A/B diagnostic used a Seaport test harness with
seaport-corepinned to:523097f9cee66c15d308c900c50f336b291cda08The comparison confirmed that avoiding the recipient collision eliminated the reproduced failure.
Original Fuzz Seed
0x9626e6de1414e944426b2681d3c3c9f3db7efd26cccfeab3ddb2031480193b41Validation on the Pull Request Branch
The updated test was subsequently validated on a clean checkout of the fork, using the dependencies and submodules associated with the repository's current
mainbranch.Environment:
TestTransferValidationZoneOffererTesttestFulfillAvailableAdvancedFuzzBuild results:
Fuzz test results:
Foundry output:
[PASS] testFulfillAvailableAdvancedFuzz(...) (runs: 256)Suite result: ok. 1 passed; 0 failed; 0 skippedThe previously reproduced address-collision scenario no longer causes the test to fail.
Security and Compatibility Impact
This pull request improves the reliability of the transfer validation zone fuzz test by preventing false-positive failures.
It does not modify:
This is a test correctness fix, not a demonstrated security vulnerability in Seaport.
Conclusion
The reported failure was caused by the test using an address that could also be selected as the authorized recipient.
By ensuring that the negative-test recipient is always distinct from the expected recipient, the test consistently verifies the intended
InvalidOwnerbehavior.The correction has been validated through deterministic A/B reproduction and 256 successful fuzz executions on the updated PR branch.