test: use WASM for backwards-compatibility tests#9173
test: use WASM for backwards-compatibility tests#9173near-bulldozer[bot] merged 3 commits intonear:masterfrom
Conversation
`base_test_contract_rs.wasm` is a WASM used in our tests that is supposed to be compatible with the oldest version. That currently requires rustc < 1.70 or some hacks to use unstable cargo features. (`-Zbuild-std`) The easies way forward is to check in the WASM.
| /// just the latest one. In particular, protocol upgrade tests should use this | ||
| /// function rather than [`rs_contract`]. | ||
| /// | ||
| /// Note: Unlike other contracts, this is not automatically build from source |
There was a problem hiding this comment.
Is there a reason why we aren't checking-in all of the wasm files right now? This crate was clearly intended to make the tests easily extensible and more maintainable, but it seems like in doing so it has introduced worse maintenance hazards in other places of the codebase and therefore the net benefit is still negative. And this seemingly could have been any of the contracts from this crate.
There was a problem hiding this comment.
I think most tests want to test only the latest protocol version and use the latest tool chain to build the WASM. For those, this crate seems to be quite useful still.
For the tests that need a fixed WASM, I am tentatively hopeful that we can delete them all once we have limited replayability.
I'd also argue that it's a good thing that some tests failed in this case (1.70 upgrade) because we do care about compatibility with the latest toolchain.
Overall, I'm not necessarily against the idea to check in all WASM files but I'm also not quite convinced it's a positive change right now.
`base_test_contract_rs.wasm` is a WASM used in our tests that is supposed to be compatible with the oldest version. That currently requires rustc < 1.70 or some hacks to use unstable cargo features. (`-Zbuild-std`) The easiest way forward is to check in a WASM built with the correct settings instead or relying on the nearcore toolchain version. This is a pre-requisite to land the 1.70 toolchain upgrade. (#9140)
base_test_contract_rs.wasmis a WASM used in our tests that issupposed to be compatible with the oldest version.
That currently requires rustc < 1.70 or some hacks to
use unstable cargo features. (
-Zbuild-std)The easiest way forward is to check in a WASM built with the correct
settings instead or relying on the nearcore toolchain version.
This is a pre-requisite to land the 1.70 toolchain upgrade. (#9140)