Skip to content

Conversation

@dshulyak
Copy link
Contributor

@dshulyak dshulyak commented Oct 7, 2025

using newer secp in the authentication protocol, there were some changes in api.
also erase can be now used on inner type without additional unsafe block

@dshulyak dshulyak changed the title secp: update secp256k1 to 0.31 deps: update secp256k1 to 0.31 Oct 7, 2025
eerkaijun
eerkaijun previously approved these changes Oct 7, 2025
omegablitz
omegablitz previously approved these changes Oct 7, 2025
Base automatically changed from dmitry/zerocopy-update to master October 8, 2025 06:57
@dshulyak dshulyak dismissed stale reviews from omegablitz and eerkaijun October 8, 2025 06:57

The base branch was changed.

@dshulyak
Copy link
Contributor Author

dshulyak commented Oct 8, 2025

wasm compilation is broken in 0.31. looks like version bump is blocked until new secp version is released that will include this fix rust-bitcoin/rust-secp256k1#818

@omegablitz
Copy link
Contributor

Weird, secp shouldnt be a transitive dep in the wasm build. That seems unintended.

@omegablitz
Copy link
Contributor

It's because of this in monad-eth-types:

pub trait ExtractEthAddress {
    fn get_eth_address(&self) -> Address;
}

impl ExtractEthAddress for NopPubKey {
    fn get_eth_address(&self) -> Address {
        Address::new([0_u8; 20])
    }
}

impl ExtractEthAddress for SecpPubkey {
    fn get_eth_address(&self) -> Address {
        Address::from_raw_public_key(&Self::bytes(self)[1..])
    }
}

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 14:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the secp256k1 dependency from version 0.26 to 0.31 and adapts the codebase to accommodate API changes in the newer version.

  • Updated secp256k1 dependency version in Cargo.toml
  • Adapted API calls to match the new secp256k1 interface, including changes to message creation, keypair construction, and recovery ID handling
  • Reorganized trait implementations to resolve circular dependencies between monad-secp and monad-eth-types

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Updated secp256k1 dependency from 0.26 to 0.31
monad-secp/src/secp.rs Adapted secp256k1 API calls for new version, including message creation, keypair construction, and simplified memory cleanup
monad-secp/src/recoverable_address.rs Updated message and recovery ID creation to use new API methods
monad-secp/src/lib.rs Added ExtractEthAddress trait implementation for PubKey
monad-secp/Cargo.toml Added monad-eth-types dependency
monad-eth-types/src/lib.rs Removed ExtractEthAddress implementation for SecpPubkey to avoid circular dependency
monad-eth-types/Cargo.toml Removed monad-secp dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dshulyak
Copy link
Contributor Author

moved implementation of ExtractEthAddress for Pubkey to monad-secp to avoid secp imports in monad-eth-types

@dshulyak dshulyak enabled auto-merge October 14, 2025 15:04
@dshulyak dshulyak added this pull request to the merge queue Oct 14, 2025
Merged via the queue into master with commit 26408a5 Oct 14, 2025
3 checks passed
@dshulyak dshulyak deleted the dmitry/secp-update branch October 14, 2025 15:34
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

Successfully merging this pull request may close these issues.

3 participants