From e4ff025f5c86e43e29b7ef7a09356383b6f49275 Mon Sep 17 00:00:00 2001 From: Lyndon Date: Tue, 16 Dec 2025 10:17:39 +0800 Subject: [PATCH] chore: update secp256k1 to 0.7.0 --- .github/workflows/rust.yml | 6 ++---- .gitmodules | 4 ++-- deps/secp256k1-20210801 | 2 +- tests/omni_lock_rust/build.rs | 2 +- tests/omni_lock_rust/tests/test_omni_lock.rs | 8 +++++++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6697034..a00118b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,8 +12,6 @@ jobs: - name: Update submodules run: git submodule update --init - name: Build contract - run: make all-via-docker + run: make all-via-docker && ls -alth build - name: Run omni_lock tests - run: cd tests/omni_lock_rust && cargo test - - name: Run omni_lock simulator tests - run: cd tests/omni_lock && bash run.sh + run: cd tests/omni_lock_rust && cargo test benchmark -- --nocapture diff --git a/.gitmodules b/.gitmodules index b0c8ac4..92aede2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,5 @@ branch = master [submodule "deps/secp256k1-20210801"] path = deps/secp256k1-20210801 - url = https://github.com/nervosnetwork/secp256k1.git - branch = schnorr + url = https://github.com/bitcoin-core/secp256k1.git + branch = master diff --git a/deps/secp256k1-20210801 b/deps/secp256k1-20210801 index 0cdc758..a660a49 160000 --- a/deps/secp256k1-20210801 +++ b/deps/secp256k1-20210801 @@ -1 +1 @@ -Subproject commit 0cdc758a56360bf58a851fe91085a327ec97685a +Subproject commit a660a4976efe880bae7982ee410b9e0dc59ac983 diff --git a/tests/omni_lock_rust/build.rs b/tests/omni_lock_rust/build.rs index a08dfc6..e6257f4 100644 --- a/tests/omni_lock_rust/build.rs +++ b/tests/omni_lock_rust/build.rs @@ -15,7 +15,7 @@ const CKB_HASH_PERSONALIZATION: &[u8] = b"ckb-default-hash"; const BINARIES: &[(&str, &str)] = &[ ( "omni_lock", - "8f3e1e01b6d8fff5c9fe12f773912902397c733c23cdc42635081cd49326db68", + "01618e4bf2c438e95a82bfc0540bbf6594a54c829c11b97ef2ba7f9473883890", ), ]; diff --git a/tests/omni_lock_rust/tests/test_omni_lock.rs b/tests/omni_lock_rust/tests/test_omni_lock.rs index 69649d5..a344a76 100644 --- a/tests/omni_lock_rust/tests/test_omni_lock.rs +++ b/tests/omni_lock_rust/tests/test_omni_lock.rs @@ -524,7 +524,8 @@ fn test_btc_success(vtype: u8) { verifier.set_debug_printer(debug_printer); let verify_result = verifier.verify(MAX_CYCLES); - verify_result.expect("pass verification"); + let cycles = (verify_result.unwrap() as f64) / 1024. / 1024.; + println!("cycles = {:.2} M", cycles); } fn test_btc_err_pubkey(vtype: u8) { @@ -556,6 +557,11 @@ fn test_btc(vtype: u8) { test_btc_err_pubkey(vtype); } +#[test] +fn test_btc_benchmark() { + test_btc_success(BITCOIN_V_TYPE_SEGWITBECH32); +} + #[test] fn test_btc_unlock() { test_btc(BITCOIN_V_TYPE_P2PKHUNCOMPRESSED);