Closed roninjin10 closed 2 weeks ago
Historically i initially made this change to not compiling bytecode by default well over a year ago. Users were suffering from tevm slowing their LSP to a crawl when they started adding more and more contracts and this change put out that fire.
Since then we have:
So even though I think the current API is good and perhaps my favorite API it's worth revisiting before going stable
No changes here until import attributes become universal
Summary
Generating bytecode is as much as 100x slower than generating an ABI. Furthermore, most use cases do not need the bytecode only the abi because the bytecode is already deployed. For this reason, Tevm only compiles bytecode for files that explicitly have a
.s.sol
file extension. Users are expected to either name their files .s.sol or reexport their contract from a .s.sol fileThis issue is to revisit that decision before going stable
Alternative solutions
0 Keep it the same
Pros
Cons
1 Always compile the bytecode
Pros
Cons
2 Import attributes
Uses the new import attribute
Pros
Cons
3 Make the bytecode different import target
This solution borrows from typechain
Pros
Cons