Skip to content
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: ecrecover may be wrong #355

Closed
lispc opened this issue Feb 23, 2023 · 1 comment
Closed

bug: ecrecover may be wrong #355

lispc opened this issue Feb 23, 2023 · 1 comment

Comments

@lispc
Copy link

lispc commented Feb 23, 2023

What command(s) is the bug in?

No response

Describe the bug

polkadot-evm/frontier#964


#[test]
pub fn test_ecrecover() {
    // 
    // https://www.evm.codes/playground?unit=Wei&codeType=Mnemonic&code=%27jFirsNplace_parameters+in+memoryZ456e9aea5e197a1f1af7a3e85a3212fa4049a3ba34c2289b4c860fc0b0c64ef3whash%7EY%7E28wvX2YZ9242685bf161793cc25603c231bc2f568eb630ea16aa137d2664ac8038825608wrX4YZ4f8ae3bd7535248d0bd448298cc2e2071e56992d0774dc340c368ae950852adawsX6YqqjDo_call%7E32JSizeX80JOffsetX8VSize%7EVOffset%7E1waddressW4QFFFFFFFFwgasqSTATICCALLqqjPut_resulNalonKon_stackqPOPX80qMLOAD%27%7EW1+w+jq%5Cnj%2F%2F+_+thKZW32QY0qMSTOREX%7E0xWqPUSHV0wargsQ+0xNt+Ke+Jwret%01JKNQVWXYZ_jqw%7E_&fork=merge
    let mut input: String = "".to_string();
    input.push_str("18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c");
    input.push_str("0000000000000000000000000000000000000000000000000000000000000001");
    input.push_str("73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f");
    input.push_str("eeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549");
    let input = hex::decode(input).unwrap();
    let (result, _gas_cost) = execute::<ECRecover>(&input, 0x20000u64);
    assert_eq!(result, [0u8;32].to_vec());

}

Concrete steps to reproduce the bug

No response

@lispc
Copy link
Author

lispc commented Feb 24, 2023

sovled by upgrading frontier dep

@lispc lispc closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant