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

Mutants failing on secp256k1 binding #395

Open
ASuciuX opened this issue Feb 5, 2025 · 0 comments · May be fixed by #396
Open

Mutants failing on secp256k1 binding #395

ASuciuX opened this issue Feb 5, 2025 · 0 comments · May be fixed by #396
Assignees
Labels
bug Something isn't working mutation-testing Related to the integration of mutation testing

Comments

@ASuciuX
Copy link
Contributor

ASuciuX commented Feb 5, 2025

TLDR

The issue comes from different versions of the secp256k1 library being used due to dependency conflicts. This problem occurs specifically with mutants, as they copy the project to a temporary folder and build it there, causing issues with binding to one of the secp256k1 versions.

Conflicting dependencies:

  chainhook-sdk → stacks-codec → clarity-vm → stacks-common → secp256k1 v0.24.3
  chainhook-sdk → bitcoincore-rpc → bitcoin → secp256k1 v0.28.2

Solution

https://mutants.rs/in-place.html
The simplest fix is to build mutants within the same project instead of copying it elsewhere. This works fine in CI environments since the project state doesn’t need to be preserved after the run. However, for local development, it’s better to run mutants on a copy of the project, as they modify files.

More details

❯ cargo tree -i [email protected]
secp256k1 v0.24.3
└── stacks-common v0.0.3
    └── clarity-vm v2.3.0
        └── stacks-codec v2.4.1
            └── chainhook-sdk v0.12.10
                ├── chainhook-postgres v0.1.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/chainhook-postgres)
                │   └── ordhook v1.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-core)
                │       └── ordhook-cli v2.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-cli)
                └── ordhook v1.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-core) (*)

^ The latest versions for stacks-common, clarity-vm and stacks-codec are the ones displayed above. So without a new release on all of them, there will continue to be multiple versions of secp256k1.

❯ cargo tree -i [email protected]
secp256k1 v0.28.2
└── bitcoin v0.31.2
    ├── bitcoincore-rpc-json v0.18.0
    │   ├── bitcoincore-rpc v0.18.0
    │   │   └── chainhook-sdk v0.12.10
    │   │       ├── chainhook-postgres v0.1.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/chainhook-postgres)
    │   │       │   └── ordhook v1.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-core)
    │   │       │       └── ordhook-cli v2.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-cli)
    │   │       └── ordhook v1.0.0 (/Users/asuciu/Documents/GitHub/Hiro/ordhook/components/ordhook-core) (*)
    │   └── chainhook-sdk v0.12.10 (*)
    └── miniscript v11.2.0
        └── chainhook-sdk v0.12.10 (*)
@ASuciuX ASuciuX added bug Something isn't working mutation-testing Related to the integration of mutation testing labels Feb 5, 2025
@ASuciuX ASuciuX self-assigned this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mutation-testing Related to the integration of mutation testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant