mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
alloy-core 1.0, alloy 0.14, revm 0.22 (001)
This moves to Rust 1.86 as were prior on Rust 1.81, and the new alloy dependencies require 1.82. The revm API changes were notable for us. Instead of relying on a modified call instruction (with deep introspection into the EVM design), we now use the more recent and now more prominent Inspector API. This: 1) Lets us perform far less introspection 2) Forces us to rewrite the gas estimation code we just had audited Thankfully, it itself should be much easier to read/review, and our existing test suite has extensively validated it. This resolves 001 which was a concern for if/when this upgrade occurs. By doing it now, with a dedicated test case ensuring the issue we would have had with alloy-core 0.8 and `validate=false` isn't actively an issue, we resolve it.
This commit is contained in:
@@ -12,4 +12,30 @@ fn selector_collisions() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn abi_decode_panic() {
|
||||
use alloy_sol_types::SolInterface;
|
||||
|
||||
/*
|
||||
The following code panics with alloy-core 0.8, when the validate flag (commented out) is set to
|
||||
`false`. This flag was removed with alloy-core 1.0, leaving the default behavior of
|
||||
`abi_decode` to be `validate = false`. This test was added to ensure when we removed our
|
||||
practice of `validate = true`, we didn't open ourselves up this as a DoS risk.
|
||||
*/
|
||||
assert!(crate::SeraiIERC20Calls::abi_decode(
|
||||
&alloy_core::primitives::hex::decode(concat!(
|
||||
"a9059cbb",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"000000000000000000000000000000000000000000000000000000000000006f",
|
||||
"ffffffffff000000000000000000000000000000000000000000000000000023",
|
||||
"000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
||||
"ffffff0000000000000000000000000000000000000000000000000000000000",
|
||||
))
|
||||
.unwrap(),
|
||||
// false
|
||||
)
|
||||
.is_err());
|
||||
}
|
||||
|
||||
// This is primarily tested via serai-processor-ethereum-router
|
||||
|
||||
Reference in New Issue
Block a user