Skip to content

ecdsa_recover produces inconsistent results in ink! v6 e2e tests #2524

Open
@AlexD10S

Description

@AlexD10S

An issue was reported in our Telegram group regarding the ecdsa_recover method in ink! v6:

Hello, I am encountering an issue with the ecdsa_recover method with ink! v6
It seems the method doesn't work in e2e tests.
I reproduced the issue here: https://github.com/GuiGou12358/test_ecddsa_recover/blob/main/test_ecdsa_recover/lib.rs
This test fails: https://github.com/GuiGou12358/test_ecddsa_recover/blob/main/test_ecdsa_recover/lib.rs#L94

A possible cause is the update to the secp256k1 library in #2340 which introduced a change inside ecdsa_recover function:

- let recovery_id = RecoveryId::from_i32(recovery_byte as i32) 
+ let recovery_id = RecoveryId::try_from(recovery_byte as i32)

It's worth noting that the internal test here still passes:

fn ecdsa_recovery_test_from_contracts_pallet() {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions