-
I was browsing through your repo on the I am curious what is the goal with this. Is it test classification in two buckets - (i) stateful and (ii) stateless? Is it readability in test logs, i.e. not showing state change logs while still being able to run tests as usual? It might be worth it to document and explain this in the NatSpec comments of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@PaulRBerg This is a great question with a nuanced answer, due both to how the Seaport repo is set up and quirks with the Foundry execution environment. The core reason is because the repo contains two implementations of Seaport:
The Foundry fuzz tests are meant to give confidence that these two implementations indeed match up - so we run the same test with the same inputs for each implementation. However, fulfilling an order with one version of Seaport means the overall state changes - it becomes very inconvenient (if not entirely impractical) to manually undo the state changes effected by fulfilling the order (un-transfering NFTs, resetting token and ether balances, etc). When these tests were first written, Foundry did not have the The *In a few cases, on invalid inputs, the optimized and reference implementations will revert with different errors, since the optimized version of Seaport is often handling multiple validation steps at the same time in the assembly blocks - but for successful calls, the idea is that the functionality is exactly the same, and errors wherever possible. |
Beta Was this translation helpful? Give feedback.
@PaulRBerg This is a great question with a nuanced answer, due both to how the Seaport repo is set up and quirks with the Foundry execution environment.
The core reason is because the repo contains two implementations of Seaport:
One is the "optimized" version, which lives in the
contracts
directory, heavily relies assembly for gas and bytecode optimizations, and is meant to be compiled with the latest version ofsolc
and the--via-ir
pipeline (0.8.17
in 1.2)The other is the "reference" implementation, which is meant to mirror the "optimized" version's functionality 1:1*, uses no assembly, and is meant to be compiled with an older, more established version of
solc
and without the--v…