-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug-Candidate]: Cannot decode byte '\xe4': Data.Text.Encoding: Invalid UTF-8 stream
#1241
Comments
Hey, this looks very cool. Do you know if the bug is related to hevm code or echidna? |
I'm really not sure tbh - didn't have time to investigate properly. |
and btw the decode error is also in the CI https://github.com/pcaversaccio/snekmate/actions/runs/8803366873/job/24161302034#step:19:21 |
I think I found partially the issue: Vyper adds the following signature to the init code which I use in the ffi command: sig = b"\xa1\x65vyper\x83".hex() See my comment here: vyperlang/vyper#2860 (comment). And |
On an initial triage, it seems this happens due to Echidna calling Filtering the affected functions so echidna does not try to fuzz them seems to work around the issue: filterFunctions: ["VyperDeployer.deployContract(string,string)", "VyperDeployer.deployContract(string,string,bytes)", "VyperDeployer.deployContract(string,string,bytes,string,bool)", "VyperDeployer.deployContract(string,string,string,bool)"] This is a smaller repro of this issue: interface Hevm {
function ffi(string[] calldata) external returns (bytes memory);
}
contract TestFFI {
address constant HEVM_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D;
function foo() public {
bytes memory w = hex"c328"; // invalid utf-8
string[] memory inputs = new string[](2);
inputs[0] = "echo";
inputs[1] = string(w);
bytes memory res = Hevm(HEVM_ADDRESS).ffi(inputs);
}
}
|
@elopez confirmed, this was the issue. Thanks a lot! Fixed via pcaversaccio/snekmate@0d6889f. Will close the issue accordingly. |
Uhm, is there something we should recommend to hevm to avoid this decoding error? |
maybe raise this issue to them at least and get their thoughts on it? |
Sounds like a plan! |
Describe the issue:
Background: See pcaversaccio/snekmate#239
Whenever I run my
echidna
tests, I see the following warnings:Code example to reproduce the issue:
Version:
2.2.3
0.10.2
Relevant log output:
The text was updated successfully, but these errors were encountered: