Code Monkey home page Code Monkey logo

interbtc's Introduction

interBTC

A modular and programmable layer for Bitcoin and the multi-chain ecosystem.
Explore the docs »

Report Bug · Request Feature

Table of Contents

About the Project

The interBTC project is a modular and programmable layer to bring Bitcoin to the multi-chain ecosystem. It includes:

Built with

The interBTC project is built with:

Structure

Runtime

The Substrate runtime configuration is in the parachain folder.

  • Interlay: The Interlay runtime configuration.
  • Kintsugi: The Kintsugi canary network runtime configuration.
  • Common: Common runtime configuration for Interlay and Kintsugi.

Test networks are build from the mainnet runtimes and have no dedicated runtimes.

Crates

The chain makes use of various custom pallets that are found in the crates folder.

  • annuity: Block rewards for stake-to-vote and vaults.
  • bitcoin: Library for Bitcoin type, parsing and verification functions.
  • btc-relay: Stateful SPV client for Bitcoin. Stores Bitcoin main chain, tracks forks, verifies Merkle proofs and validates specific transaction formats.
  • clients-info: Stores current and future interbtc-client software releases.
  • collator-selection: Decentralized sequencers (collators) for the chain.
  • currency Handles currencies (e.g. DOT/KSM/IBTC).
  • democracy: Optimistic governance fork of pallet-democracy.
  • dex-general: Uniswap v2-style AMM implementation.
  • dex-stable: Curve v1-style AMM implementation.
  • dex-swap-router: Swap router for the AMMs.
  • escrow: Rust implementation of Curve's Voting Escrow contract.
  • farming: Farming module for AMM liquidity mining.
  • fee: Participant reward calculation and distribution.
  • issue: Handles issuing of interBTC for BTC on Bitcoin.
  • loans: Compound v2-style money market implementation.
  • multi-transaction-payment: Pay assets other than the native one for transaction fees.
  • nomination: Interface for vault nomination.
  • oracle: Trusted providers use this to set exchange rates and Bitcoin fee estimates.
  • redeem: Handles redeeming of interBTC for BTC on Bitcoin.
  • replace: Handles replacing vaults.
  • reward: Scalable reward distribution.
  • security: Handles status and error changes.
  • staking: Core logic for vault nomination and slashing.
  • supply: Token minting and inflation.
  • tx-pause: Handles pausing of transactions.
  • vault-registry: Handles registration, collateral and liquidation of vaults.

Getting started

Prerequisites

curl https://sh.rustup.rs -sSf | sh

Please also install the following dependencies:

  • cmake
  • clang (>=10.0.0)
  • clang-dev
  • libc6-dev
  • libssl-dev

Installation

Building requires a specific rust toolchain and nightly compiler version. The requirements are specified in the ./rust-toolchain.toml override file.

Running rustup show from the root directory of this repo should be enough to set up the toolchain and you can inspect the output to verify that it matches the version specified in the override file.

To build, run:

cargo build

For more detailed development instructions see here.

Testing

cargo test --features runtime-benchmarks

To run with coverage, using cargo-cov:

cargo install cargo-cov

# clean up previous coverage result
cargo cov clean

# test the code
cargo cov test

# open the coverage report
cargo cov report --open

Running

To run a local development node, use the dev chain spec.

cargo run --release --bin interbtc-parachain -- --dev

To connect with a local relay-chain follow these instructions.

Development node

Running a development can be achieved without compiling the node with docker and instant-seal. Replace the release version with one of the available tags:

docker run --network=host interlayhq/interbtc:RELEASE_TAG --dev --instant-seal
#  Example
docker run --network=host interlayhq/interbtc:1.25.0-rc5 --dev --instant-seal

Test Coverage

Test coverage reports available under docs/testcoverage.html

Javascript / Typescript

Either use the polkadot.js API or checkout interbtc-api for a TypeScript SDK.

Contributing

If you would like to contribute, please file an issue on GitHub or reach out to us.

License

interBTC is licensed under the terms of the Apache License (Version 2.0). See LICENSE

Contact

Linktree: Linktree

Website: interlay.io

Twitter: @interlayHQ

Discord: Discord

Telegram: Telegram

Acknowledgements

This project is supported by a Web3 Foundation grant and the Substrate Builders Program.

interbtc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interbtc's Issues

Can we remove the UnauthorizedRedeemer error?

Is your feature request related to a problem? Please describe.
If the merkle proof and transaction is valid, why do we limit who can cancel a redeem request?

Describe the solution you'd like
Remove the requirement on cancel_redeem.

Allow cancelled issue requests to be executed

Similar to #580, if the Vault has sufficient capacity we should allow cancelled issue requests to be executed. Note that the griefing collateral will still be slashed (as with the replace cancellation) but this will allow users to recover "dangling" BTC.

Node synchronization is faulty

截屏2021-12-28 下午5 04 40
1、The block corresponding to Best has not been updated for a long time and will be restored after the node is restarted.
2、[finalized #59647] Synchronous slow

unable to build latest release (m1 and intel Mac)

Describe the bug

I cannot get cargo build to work. I've tried on two different architectures

To Reproduce

git clone [email protected]:interlay/interbtc.git
git checkout tags/1.7.2

./script/init.sh
cargo build # this fails, see output below

I think I was able to isolate the package, so the following is the output for

cargo check -p interlay-runtime-parachain
m1 Mac

rustup show

active toolchain
----------------

nightly-2022-02-08-aarch64-apple-darwin (overridden by '/Users/ricky/src/github.com/interlay/interbtc/rust-toolchain.toml')
rustc 1.60.0-nightly (734368a20 2022-02-07)
->% cargo check -p interlay-runtime-parachain
   Compiling interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)
    Checking pallet-collator-selection v3.0.0 (https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c56)
    Checking polkadot-node-network-protocol v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
    Checking refund v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/refund)
    Checking nomination v0.5.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/nomination)
    Checking redeem v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/redeem)
    Checking sc-cli v0.10.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
    Checking issue v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/issue)
    Checking replace v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/replace)
    Checking polkadot-overseer-gen v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
    Checking polkadot-node-subsystem-types v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
    Checking polkadot-node-metrics v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
    Checking relay v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/crates/relay)
    Checking polkadot-overseer v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
    Checking cumulus-relay-chain-interface v0.1.0 (https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c56)
    Checking cumulus-primitives-parachain-inherent v0.1.0 (https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c56)
    Checking cumulus-pallet-parachain-system v0.1.0 (https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f76c56)
error: failed to run custom build command for `interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)`

Caused by:
  process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/build/interlay-runtime-parachain-7ef0e4838b0989e1/build-script-build` (exit status: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: "/Users/ricky/.rustup/toolchains/nightly-2022-02-08-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/Cargo.toml" "--color=always" "--release"
  Using rustc version: rustc 1.60.0-nightly (734368a20 2022-02-07)


  --- stderr
     Compiling secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)
     Compiling sp-runtime v4.1.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
  The following warnings were emitted during compilation:

  warning: In file included from depend/secp256k1/src/secp256k1.c:10:
  warning: In file included from depend/secp256k1/src/assumptions.h:12:
  warning: In file included from depend/secp256k1/src/util.h:16:
  warning: wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_INT_SIZE = sizeof(int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_INT_ALIGN = alignof(int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  warning: extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
  warning:                            ^
  warning: 1 error generated.
  warning: In file included from depend/secp256k1/src/secp256k1.c:13:
  warning: depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
  warning:             ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:15:
  warning: depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
  warning:             ^
  warning: depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
  warning:            ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:16:
  warning: In file included from depend/secp256k1/src/ecmult_impl.h:16:
  warning: In file included from depend/secp256k1/src/ecmult.h:13:
  warning: depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
  warning: static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
  warning:                                      ^
  warning: depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
  warning:             ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:16:
  warning: depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
  warning: static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
  warning:               ^
  warning: depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  warning: 19 warnings and 1 error generated.

  error: failed to run custom build command for `secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)`

  Caused by:
    process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/release/build/secp256k1-sys-43e947a380630527/build-script-build` (exit status: 1)
    --- stdout
    TARGET = Some("wasm32-unknown-unknown")
    OPT_LEVEL = Some("3")
    HOST = Some("aarch64-apple-darwin")
    CC_wasm32-unknown-unknown = None
    CC_wasm32_unknown_unknown = None
    TARGET_CC = None
    CC = None
    CFLAGS_wasm32-unknown-unknown = None
    CFLAGS_wasm32_unknown_unknown = None
    TARGET_CFLAGS = None
    CFLAGS = None
    CRATE_CC_NO_DEFAULTS = None
    DEBUG = Some("false")
    CC_wasm32-unknown-unknown = None
    CC_wasm32_unknown_unknown = None
    TARGET_CC = None
    CC = None
    CFLAGS_wasm32-unknown-unknown = None
    CFLAGS_wasm32_unknown_unknown = None
    TARGET_CFLAGS = None
    CFLAGS = None
    CRATE_CC_NO_DEFAULTS = None
    running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"
    running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/src/secp256k1.o" "-c" "depend/secp256k1/src/secp256k1.c"
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:10:
    cargo:warning=In file included from depend/secp256k1/src/assumptions.h:12:
    cargo:warning=In file included from depend/secp256k1/src/util.h:16:
    cargo:warning=wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_INT_SIZE = sizeof(int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_INT_ALIGN = alignof(int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
    cargo:warning=extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
    cargo:warning=                           ^
    cargo:warning=1 error generated.
    exit status: 1
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:13:
    cargo:warning=depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
    cargo:warning=            ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:15:
    cargo:warning=depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
    cargo:warning=            ^
    cargo:warning=depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
    cargo:warning=           ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
    cargo:warning=In file included from depend/secp256k1/src/ecmult_impl.h:16:
    cargo:warning=In file included from depend/secp256k1/src/ecmult.h:13:
    cargo:warning=depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
    cargo:warning=static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
    cargo:warning=                                     ^
    cargo:warning=depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
    cargo:warning=            ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
    cargo:warning=static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
    cargo:warning=              ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
    cargo:warning=19 warnings and 1 error generated.
    exit status: 1

    --- stderr


    error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c" with args "clang" did not execute successfully (status code exit status: 1).


  warning: build failed, waiting for other jobs to finish...
  error: build failed

ricky[01:27:42][94%] in [~/src/github.com/interlay/interbtc/parachain/runtime/interlay][master]
->% cargo check -p interlay-runtime-parachain
   Compiling interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)
error: failed to run custom build command for `interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)`

Caused by:
  process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/build/interlay-runtime-parachain-7ef0e4838b0989e1/build-script-build` (exit status: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: "/Users/ricky/.rustup/toolchains/nightly-2022-02-08-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/Cargo.toml" "--color=always" "--release"
  Using rustc version: rustc 1.60.0-nightly (734368a20 2022-02-07)


  --- stderr
     Compiling secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)
     Compiling frame-support v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
     Compiling sp-api v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
  The following warnings were emitted during compilation:

  warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  warning: In file included from depend/secp256k1/src/secp256k1.c:10:
  warning: In file included from depend/secp256k1/src/assumptions.h:12:
  warning: In file included from depend/secp256k1/src/util.h:16:
  warning: wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_INT_SIZE = sizeof(int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_INT_ALIGN = alignof(int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: 1 error generated.
  warning: extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
  warning:                            ^
  warning: wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
  warning: extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
  warning:                            ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:13:
  warning: depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
  warning:             ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:15:
  warning: depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
  warning:             ^
  warning: depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
  warning:            ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:16:
  warning: In file included from depend/secp256k1/src/ecmult_impl.h:16:
  warning: In file included from depend/secp256k1/src/ecmult.h:13:
  warning: depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
  warning: static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
  warning:                                      ^
  warning: depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
  warning: static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
  warning:             ^
  warning: In file included from depend/secp256k1/src/secp256k1.c:16:
  warning: depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
  warning: static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
  warning:               ^
  warning: depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
  warning: static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
  warning:            ^
  warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  warning: 19 warnings and 1 error generated.

  error: failed to run custom build command for `secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)`

  Caused by:
    process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/release/build/secp256k1-sys-43e947a380630527/build-script-build` (exit status: 1)
    --- stdout
    TARGET = Some("wasm32-unknown-unknown")
    OPT_LEVEL = Some("3")
    HOST = Some("aarch64-apple-darwin")
    CC_wasm32-unknown-unknown = None
    CC_wasm32_unknown_unknown = None
    TARGET_CC = None
    CC = None
    CFLAGS_wasm32-unknown-unknown = None
    CFLAGS_wasm32_unknown_unknown = None
    TARGET_CFLAGS = None
    CFLAGS = None
    CRATE_CC_NO_DEFAULTS = None
    DEBUG = Some("false")
    CC_wasm32-unknown-unknown = None
    CC_wasm32_unknown_unknown = None
    TARGET_CC = None
    CC = None
    CFLAGS_wasm32-unknown-unknown = None
    CFLAGS_wasm32_unknown_unknown = None
    TARGET_CFLAGS = None
    CFLAGS = None
    CRATE_CC_NO_DEFAULTS = None
    running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/src/secp256k1.o" "-c" "depend/secp256k1/src/secp256k1.c"
    running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"
    cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:10:
    cargo:warning=In file included from depend/secp256k1/src/assumptions.h:12:
    cargo:warning=In file included from depend/secp256k1/src/util.h:16:
    cargo:warning=wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_INT_SIZE = sizeof(int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_INT_ALIGN = alignof(int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=1 error generated.
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
    cargo:warning=                           ^
    cargo:warning=wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
    cargo:warning=extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
    cargo:warning=                           ^
    exit status: 1
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:13:
    cargo:warning=depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
    cargo:warning=            ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:15:
    cargo:warning=depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
    cargo:warning=            ^
    cargo:warning=depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
    cargo:warning=           ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
    cargo:warning=In file included from depend/secp256k1/src/ecmult_impl.h:16:
    cargo:warning=In file included from depend/secp256k1/src/ecmult.h:13:
    cargo:warning=depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
    cargo:warning=static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
    cargo:warning=                                     ^
    cargo:warning=depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
    cargo:warning=static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
    cargo:warning=            ^
    cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
    cargo:warning=static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
    cargo:warning=              ^
    cargo:warning=depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
    cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
    cargo:warning=           ^
    cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
    cargo:warning=19 warnings and 1 error generated.
    exit status: 1

    --- stderr


    error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-3f5230ae6475bb4d/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c" with args "clang" did not execute successfully (status code exit status: 1).


  warning: build failed, waiting for other jobs to finish...
  error: build failed
intel Mac

rustup show

active toolchain
----------------

nightly-2022-02-08-x86_64-apple-darwin (overridden by '/Users/ricky/src/github.com/interlay/interbtc/rust-toolchain.toml')
rustc 1.60.0-nightly (734368a20 2022-02-07)
->% cargo check -p interlay-runtime-parachain
Checking arrayvec v0.7.2
Compiling serde_json v1.0.78
Checking gimli v0.26.1
Compiling num-bigint v0.2.6
Compiling num-rational v0.2.4
Compiling indexmap v1.8.0
Checking libc v0.2.117
Checking object v0.27.1
Checking bitvec v0.20.4
Compiling interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)
Checking getrandom v0.2.4
Checking num_cpus v1.13.1
Checking parking_lot_core v0.8.5
Checking getrandom v0.1.16
Checking time v0.1.44
Checking signal-hook-registry v1.4.0
Checking socket2 v0.4.4
Checking polling v2.2.0
Checking mio v0.7.14
Checking zstd-sys v1.6.2+zstd.1.5.1
Checking hostname v0.3.1
Checking flate2 v1.0.22
Checking if-addrs v0.6.7
Checking net2 v0.2.37
Checking iovec v0.1.4
Checking security-framework-sys v2.6.0
Checking core-foundation v0.9.2
Checking atty v0.2.14
Checking lz4-sys v1.9.2
Checking librocksdb-sys v6.20.3
Checking memmap2 v0.5.2
Checking fs-swap v0.2.6
Checking memmap2 v0.2.3
Checking fs2 v0.4.3
Checking dirs-sys v0.3.6
Checking tempfile v3.3.0
Checking fdlimit v0.2.1
Checking rpassword v5.0.1
Checking futures-executor v0.3.19
Checking threadpool v1.8.1
Checking rand_core v0.6.3
Checking ahash v0.7.6
Checking rand_core v0.5.1
Checking parking_lot v0.11.2
Checking signal-hook v0.3.13
Checking zstd-safe v4.1.3+zstd.1.5.1
Checking chrono v0.4.19
Checking resolv-conf v0.7.0
Checking async-io v1.6.0
Checking bytes v0.4.12
Checking clap v2.34.0
Checking lz4 v1.23.2
Checking mio v0.6.23
Checking rocksdb v0.17.0
Checking directories v4.0.1
Checking tokio v1.16.1
Checking security-framework v2.6.0
Checking thrift v0.15.0
Checking futures v0.3.19
Checking rand_chacha v0.3.1
Checking snow v0.8.0
Checking sp-serializer v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
Checking rand_pcg v0.2.1
Checking rand_chacha v0.2.2
Checking curve25519-dalek v3.2.0
Checking merlin v2.0.1
Checking curve25519-dalek v2.1.3
Checking hashbrown v0.11.2
Checking hashbrown v0.12.0
Checking prometheus v0.13.0
Checking zstd v0.9.2+zstd.1.5.1
Checking async-global-executor v2.0.2
Checking async-process v1.3.0
Checking if-watch v0.2.2
Checking mio-extras v2.0.6
Checking tracing-subscriber v0.2.25
Checking multistream-select v0.10.4
Checking rw-stream-sink v0.2.1
Checking wasm-timer v0.2.5
Checking jsonrpc-core v18.0.0
Checking exit-future v0.2.0
Checking metered-channel v0.9.16 (https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d)
Checking rand v0.8.4
Checking rand v0.7.3
Checking rustls-native-certs v0.5.0
Checking parity-scale-codec v2.3.1
Checking addr2line v0.17.0
Checking async-std v1.10.0
Checking sp-maybe-compressed-blob v4.1.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
Checking lru v0.6.6
Checking lru v0.7.2
Checking x25519-dalek v1.1.1
Checking sc-utils v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7)
Checking trie-db v0.23.1
Checking structopt v0.3.26
Checking backtrace v0.3.64
Checking wasmi v0.9.1
error: failed to run custom build command for `interlay-runtime-parachain v1.2.0 (/Users/ricky/src/github.com/interlay/interbtc/parachain/runtime/interlay)`

Caused by:
process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/build/interlay-runtime-parachain-b02fba5cdef123ee/build-script-build` (exit status: 1)
--- stdout
Information that should be included in a bug report.
Executing build command: "/Users/ricky/.rustup/toolchains/nightly-2022-02-08-x86_64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/Cargo.toml" "--color=always" "--release"
Using rustc version: rustc 1.60.0-nightly (734368a20 2022-02-07)


--- stderr
Compiling secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)
Compiling camino v1.0.7
Compiling semver v1.0.4
The following warnings were emitted during compilation:

warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 1 error generated.
warning: In file included from depend/secp256k1/src/secp256k1.c:10:
warning: In file included from depend/secp256k1/src/assumptions.h:12:
warning: In file included from depend/secp256k1/src/util.h:16:
warning: wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_INT_SIZE = sizeof(int);
warning:                            ^
warning: wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_INT_ALIGN = alignof(int);
warning:                            ^
warning: wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
warning:                            ^
warning: wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
warning:                            ^
warning: wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
warning:                            ^
warning: wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
warning:                            ^
warning: wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
warning:                            ^
warning: wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
warning:                            ^
warning: wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
warning:                            ^
warning: wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
warning: extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
warning:                            ^
warning: In file included from depend/secp256k1/src/secp256k1.c:13:
warning: depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
warning: static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
warning:             ^
warning: In file included from depend/secp256k1/src/secp256k1.c:15:
warning: depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
warning: static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
warning:             ^
warning: depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
warning: static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
warning:            ^
warning: In file included from depend/secp256k1/src/secp256k1.c:16:
warning: In file included from depend/secp256k1/src/ecmult_impl.h:16:
warning: In file included from depend/secp256k1/src/ecmult.h:13:
warning: depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
warning: static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
warning:                                      ^
warning: depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
warning: static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
warning:             ^
warning: In file included from depend/secp256k1/src/secp256k1.c:16:
warning: depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
warning: static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
warning:            ^
warning: depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
warning: static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
warning:            ^
warning: depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
warning: static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
warning:               ^
warning: depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
warning: static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
warning:            ^
warning: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: 19 warnings and 1 error generated.

error: failed to run custom build command for `secp256k1-sys v0.4.0 (https://github.com/rust-bitcoin/rust-secp256k1?rev=8e61874#8e61874d)`

Caused by:
process didn't exit successfully: `/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/release/build/secp256k1-sys-f8c14f22d8d8bc02/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("wasm32-unknown-unknown")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-apple-darwin")
CC_wasm32-unknown-unknown = None
CC_wasm32_unknown_unknown = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-unknown-unknown = None
CFLAGS_wasm32_unknown_unknown = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CC_wasm32-unknown-unknown = None
CC_wasm32_unknown_unknown = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-unknown-unknown = None
CFLAGS_wasm32_unknown_unknown = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-b5ab6a393d49d7df/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"
cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
cargo:warning=1 error generated.
exit status: 1
running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-b5ab6a393d49d7df/out/depend/secp256k1/src/secp256k1.o" "-c" "depend/secp256k1/src/secp256k1.c"
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:10:
cargo:warning=In file included from depend/secp256k1/src/assumptions.h:12:
cargo:warning=In file included from depend/secp256k1/src/util.h:16:
cargo:warning=wasm-sysroot/stdio.h:4:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_INT_SIZE = sizeof(int);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:5:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_INT_ALIGN = alignof(int);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:7:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_SIZE = sizeof(unsigned int);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:8:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_UNSIGNED_INT_ALIGN = alignof(unsigned int);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:10:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_SIZE_T_SIZE = sizeof(size_t);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:11:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_SIZE_T_ALIGN = alignof(size_t);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:13:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_SIZE = sizeof(unsigned char);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:14:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_UNSIGNED_CHAR_ALIGN = alignof(unsigned char);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:16:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_PTR_SIZE = sizeof(void*);
cargo:warning=                           ^
cargo:warning=wasm-sysroot/stdio.h:17:28: warning: 'extern' variable has an initializer [-Wextern-initializer]
cargo:warning=extern const unsigned char WASM32_PTR_ALIGN = alignof(void*);
cargo:warning=                           ^
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:13:
cargo:warning=depend/secp256k1/src/field_impl.h:266:13: warning: unused function 'rustsecp256k1_v0_4_0_fe_inv_all_var' [-Wunused-function]
cargo:warning=static void rustsecp256k1_v0_4_0_fe_inv_all_var(rustsecp256k1_v0_4_0_fe *r, const rustsecp256k1_v0_4_0_fe *a, size_t len) {
cargo:warning=            ^
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:15:
cargo:warning=depend/secp256k1/src/group_impl.h:191:13: warning: unused function 'rustsecp256k1_v0_4_0_ge_set_infinity' [-Wunused-function]
cargo:warning=static void rustsecp256k1_v0_4_0_ge_set_infinity(rustsecp256k1_v0_4_0_ge *r) {
cargo:warning=            ^
cargo:warning=depend/secp256k1/src/group_impl.h:658:12: warning: unused function 'rustsecp256k1_v0_4_0_gej_has_quad_y_var' [-Wunused-function]
cargo:warning=static int rustsecp256k1_v0_4_0_gej_has_quad_y_var(const rustsecp256k1_v0_4_0_gej *a) {
cargo:warning=           ^
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
cargo:warning=In file included from depend/secp256k1/src/ecmult_impl.h:16:
cargo:warning=In file included from depend/secp256k1/src/ecmult.h:13:
cargo:warning=depend/secp256k1/src/scratch.h:24:38: warning: unused function 'rustsecp256k1_v0_4_0_scratch_create' [-Wunused-function]
cargo:warning=static rustsecp256k1_v0_4_0_scratch* rustsecp256k1_v0_4_0_scratch_create(const rustsecp256k1_v0_4_0_callback* error_callback, size_t max_size);
cargo:warning=                                     ^
cargo:warning=depend/secp256k1/src/scratch.h:26:13: warning: unused function 'rustsecp256k1_v0_4_0_scratch_destroy' [-Wunused-function]
cargo:warning=static void rustsecp256k1_v0_4_0_scratch_destroy(const rustsecp256k1_v0_4_0_callback* error_callback, rustsecp256k1_v0_4_0_scratch* scratch);
cargo:warning=            ^
cargo:warning=In file included from depend/secp256k1/src/secp256k1.c:16:
cargo:warning=depend/secp256k1/src/ecmult_impl.h:1035:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_multi_var' [-Wunused-function]
cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_multi_var(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *ctx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
cargo:warning=           ^
cargo:warning=depend/secp256k1/src/ecmult_impl.h:621:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_strauss_batch_single' [-Wunused-function]
cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_strauss_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
cargo:warning=           ^
cargo:warning=depend/secp256k1/src/ecmult_impl.h:863:15: warning: unused function 'rustsecp256k1_v0_4_0_pippenger_scratch_size' [-Wunused-function]
cargo:warning=static size_t rustsecp256k1_v0_4_0_pippenger_scratch_size(size_t n_points, int bucket_window) {
cargo:warning=              ^
cargo:warning=depend/secp256k1/src/ecmult_impl.h:944:12: warning: unused function 'rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single' [-Wunused-function]
cargo:warning=static int rustsecp256k1_v0_4_0_ecmult_pippenger_batch_single(const rustsecp256k1_v0_4_0_callback* error_callback, const rustsecp256k1_v0_4_0_ecmult_context *actx, rustsecp256k1_v0_4_0_scratch *scratch, rustsecp256k1_v0_4_0_gej *r, const rustsecp256k1_v0_4_0_scalar *inp_g_sc, rustsecp256k1_v0_4_0_ecmult_multi_callback cb, void *cbdata, size_t n) {
cargo:warning=           ^
cargo:warning=error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
cargo:warning=19 warnings and 1 error generated.
exit status: 1

--- stderr


error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-I" "wasm-sysroot" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DENABLE_MODULE_SCHNORRSIG=1" "-DENABLE_MODULE_EXTRAKEYS=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-o" "/Users/ricky/src/github.com/interlay/interbtc/target/debug/wbuild/interlay-runtime-parachain/target/wasm32-unknown-unknown/release/build/secp256k1-sys-b5ab6a393d49d7df/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
error: build failed
warning: build failed, waiting for other jobs to finish...
error: build failed

Expected behavior

check or build to pass

Version / Commit (e.g. 1.0.0):

1.7.2

Additional context
Add any other context about the problem here.

Remove nomination pallet

We have unfortunately never used the nomination logic on mainnet and it seems we never will. The goal now is to reduce complexity by removing the pallet and associated code:

  • Remove nomination pallet
  • Remove integration tests
  • Remove staking pallet

If we do remove the staking pallet, and instead use just the reward pallet, we will need to migrate the stake back into the Vault struct.

Add Escrow RPC

We currently duplicate a lot of logic in the javascript library to get the current individual and total escrow balances. This would be better placed in a RPC extension.

Split vault keys into control and stash

The idea is that a control account can transact on behalf of a stash account which is used to manage a Vault's collateral. This would enable the stash key to be stored offline, perhaps in a cold wallet, to minimize fund loss should the physical server hosting the control key be compromised.

.chglog/CHANGELOG.tpl.md

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Run with these arguments '...'
  2. Call this function '....'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version / Commit (e.g. 1.0.0):
The version of the binary you have installed.

Additional context
Add any other context about the problem here.

Weights, fees and storage bloat

We need to improve our weights and fees, as well as how we handle storage bloat. We need to do this to prevent DoS attacks. This includes:

  • Charging for storage. A lot of calls add items to storage but we don't charge based on size
  • We need to remove old state when it becomes irrelevant
  • We need to implement existential deposits
    • Perhaps also for vaults - vaults that have almost no collateral can be removed
  • We need to parametrize the weights of functions better so that we address their actual complexity (instead of using a fixed value)
  • We need to re-run the benchmarks on a machine that represent the typical node hardware
  • Functions that need to improve their weight determination include all functions that deal with bitcoin transactions. We might want to use pre-parsed structs rather than raw bytes to make that easier.
  • We need to address unbounded iteration in e.g. execute_issue
  • We should re-evaluate the amount we charge per byte in the extrinsic
  • We should re-evaluate how we determine xcm fees
  • Some of our dependencies use configurable weights. We currently use the default but we may want to override them
  • Pallets should not use #[pallet::without_storage_info]. See my stackoverflow question
    • All storage items should implement MaxEncodedLen
  • We should start using dispatch classes. See https://docs.substrate.io/build/tx-weights-fees/
  • Attach #[pallet::whitelist_storage] to storage items that are read every block
  • Look into base weight
  • External pallets that we should reconsider config of:
    • pallet_transaction_payment

Oracle offline detection with multi collateral

Context
Before multicollateral, we had a simple oracle off-line detection system. If the oracle was inactive for too long, then we would stop incrementing active_block_count. Each bitcoin block header stored the active_block_count when it got relayed. An issue/redeem/replace is only cancellable when active_block_count increased by a certain number.

Problem
Now that we have multi collateral, we need to account for the possibility that one currency does not get updated, and thus the exchange rate becomes invalid for that specific currency. Operations with other currencies should be able to continue to function.

Solutions

  • Make oracles submit all currencies simultaneously. That way, either all currencies will be outdated, or none will be. Most of the logic can remain unchanged. The problem would be adding or removing currencies - different oracle providers will have to change the calls they are making simultaneously.
  • We can halt for all currencies if one of them is outdated.
  • We can maintain a active_block_count per currency. This requires additional iteration in System, to increment the value each block for all currencies. Note that we iterate over the currencies in the oracle anyway, so the big O complexity does not change. The client cancellation logic gets slightly complicated, but this should be manageable. We currently store active_block_count in bitcoin block headers, so this struct would grow some, but we might be able to store just the normal parachain height - I think we only use it to require a certain number of parachain confirmations before we accept bitcoin blocks.

I think I'm leaning to the last solution. The main downside is that it is the most complex solution, and thus has highest risk of bugs. But I feel it's the most correct solution.

Open

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add deregister extrinsic to vault-registry

If a Vault has no collateral and issued tokens it should be able to call deregister to permanently "tombstone" it's account. This will prevent re-use of it's AccountId and identity if an attacker would compromise the associated key file.

A follow-up to #482 would then be to delete all storage entries in vault-registry and staking, etc..

Vault MultiSigs

We can allow Vaults to pool their collateral in a single MultiSig account and share responsibility for signing BTC transactions - similar to how other bridges use threshold signatures to secure funds.

Architecture

Add a new VaultMultiSig pallet which is similar in architecture to pallet-multisig in FRAME. We can support the following functionality:

  • Create a multi-vault (for some set of accounts) & derive a new multi_account_id
  • Allow to dispatch as that account to add / withdraw collateral
  • Tracks separate balances (need to consider slashing)
  • Set M/N for however many signatories are required
  • Store (partially) signed tx for coordination

Generating Issue Address

Single-key issue addresses are generated as BtcAddress::P2WPKHv0(public_key.to_hash()) where:

secure_id = sha256(issue.requester + nonce + parent_hash)
public_key = vault_public_key * secure_id

To adopt MultiSig payments we should return BtcAddress::P2SH using the following construction for e.g. 2/3:

<OP_2> <A pubkey> <B pubkey> <C pubkey> <OP_3> <OP_CHECKMULTISIG>

Each pubkey should also be derived using the OKD scheme.

Example (Bitcoin Core)

Taken from this guide.

# start bitcoind (ignore fees)
bitcoind -regtest -server -minrelaytxfee=0
bitcoin-cli -regtest createwallet default

# dump required addresses, public and private keys
address1=$(bitcoin-cli -regtest getnewaddress)
address2=$(bitcoin-cli -regtest getnewaddress)
pubkey1=$(bitcoin-cli -regtest -named getaddressinfo address=$address1 | jq -r '.pubkey')
pubkey2=$(bitcoin-cli -regtest -named getaddressinfo address=$address2 | jq -r '.pubkey')
privkey1=$(bitcoin-cli -regtest -named dumpprivkey address=$address1)
privkey2=$(bitcoin-cli -regtest -named dumpprivkey address=$address2)

# generate 2/2 multisig
multisig_address=$(bitcoin-cli -regtest -named createmultisig nrequired=2 keys='''["'$pubkey1'","'$pubkey2'"]''' | jq -r '.address')
multisig_redeem_script=$(bitcoin-cli -regtest -named createmultisig nrequired=2 keys='''["'$pubkey1'","'$pubkey2'"]''' | jq -r '.redeemScript')

# fund the multisig and import
bitcoin-cli -regtest generatetoaddress 101 $multisig_address
bitcoin-cli -regtest -named importaddress address=$multisig_address

# take the last unspent and populate vars
utxo_txid=$(bitcoin-cli -regtest -named listunspent addresses='''["'$multisig_address'"]''' | jq -r 'last | .txid')
utxo_vout=0
utxo=$(bitcoin-cli -regtest -named gettransaction txid=$utxo_txid verbose=true)
utxo_spk=$(echo $utxo | jq -r '.decoded.vout['$utxo_vout'].scriptPubKey.hex')
utxo_value=$(echo $utxo | jq -r '.decoded.vout['$utxo_vout'].value')
recipient=$(bitcoin-cli -regtest getrawchangeaddress)

# spend the entire amount to the change address
rawtxhex=$(bitcoin-cli -regtest -named createrawtransaction inputs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout' } ]''' outputs='''{ "'$recipient'": "'$utxo_value'" }''')

# signed by $privkey1
signedtxhex1=$(bitcoin-cli -regtest -named signrawtransactionwithkey hexstring=$rawtxhex prevtxs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout', "scriptPubKey": "'$utxo_spk'", "redeemScript": "'$multisig_redeem_script'" } ]''' privkeys='["'$privkey1'"]' | jq -r '.hex')

# signed by $privkey2
signedtxhex2=$(bitcoin-cli -regtest -named signrawtransactionwithkey hexstring=$signedtxhex1 prevtxs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout', "scriptPubKey": "'$utxo_spk'", "redeemScript": "'$multisig_redeem_script'" } ]''' privkeys='["'$privkey2'"]' | jq -r '.hex')

# send transaction
multisig_txid=$(bitcoin-cli -regtest -named sendrawtransaction hexstring=$signedtxhex2 maxfeerate=0)
bitcoin-cli -regtest -named gettransaction txid=$multisig_txid verbose=true

Oracle optimisations

  • Cleanup RawValues when outdated
  • Use checked-math in begin_block
  • More general error for MissingExchangeRate - can be tx fees

Relaychain DB errors

Describe the bug
Running the same setup on 3 machines.
VPS 1. No problem, synced using RocksDb from polkashots.io (after 0.9.12 update)
VPS 2. Problem with RocksDb - giving error: Unsupported BABE DB version: 3. Then I tried letting it sync by itself and succeeded.
VPS 3. Problem with RocksDb - giving error: Unsupported BABE DB version: 3.

  • Then I tried letting it sync by itself after finishing it gave error: [Relaychain] DB has been previously marked as corrupted, attempting repair, Error: Service(Client(Backend("Corruption: force_consistency_checks: L0 files seqno 865146853 865787239 1808995 vs. 865524326 865626223 1810803")))
  • Another syncing attempt resulted in this error:
    DatabaseError(DatabaseError(Custom { kind: Other, error: Error { message: "IO error: No such file or directory: While open a file for appending: /home/kintsugi_user/kintsugi/polkadot/chains/ksmcc3/db/full/008326.log: No such file or directory" } }))
  • After trying private relaychain snapshot from Dominik, got this error: Error: Service(Client(Backend("Invalid argument: Column families not opened: col11, col10, col9, col8, col7, col6, col5, col4, col3, col2, col1, col0")))

To Reproduce
Running as a systemd service:

[Unit]
Description=Kintsugi full node

[Service]
User=kintsugi_user
Group=kintsugi_user
ExecStart=/usr/local/bin/interbtc-parachain
--name=Polkadotters
--base-path=/home/kintsugi_user/kintsugi
--telemetry-url "wss://telemetry.interlay.io/submit 0"
--chain=kintsugi
--execution=wasm
--wasm-execution=compiled
--unsafe-ws-external
--rpc-methods=unsafe
--pruning=archive
--
--rpc-cors=all
--no-telemetry
--execution=wasm
--wasm-execution=compiled
--database=RocksDb
--unsafe-pruning
--pruning=1000

Restart=always
RestartSec=120

[Install]
WantedBy=multi-user.target

Expected behavior
Errors from the bug description

Version / Commit (e.g. 1.0.0):
version 1.2.0-0f43318-x86_64-linux-gnu

Additional context

Vault Theft Recovery

Is your feature request related to a problem? Please describe.

Operational errors or implementation bugs may cause Vaults to mistakenly spend or double-spend Bitcoin, causing them to be liquidated for theft. The interbtc protocol does not allow operators to prevent liquidation, even if they are willing to send the Bitcoin back to a registered Vault address.

Describe the solution you'd like

  • Extend the current VaultStatus enum to:
enum VaultStatus {
  Active(bool),
  Liquidated,
  CommittedTheft,
  PendingLiquidation(amount, recovery_deadline_block), // <--- new field
}
  • Add a storage value, TheftRecoveryPeriod, denoting a number of parachain blocks. This is the grace period during which a Vault may report a confirmed Bitcoin transaction that restores stolen funds.
  • Add an extrinsic: recover_theft(vault_id, merkle_proof, raw_tx, active_status). See description below.
  • Add an extrinsic: pending_liquidation_elapsed(vault_id). See description below.

A valid report_vault_theft(...) extrinsic changes a Vault’s status from Active(...) to PendingLiquidation(amount, TheftRecoveryPeriod::get()). The Vault’s collateral is frozen rather than being transferred to the Liquidation Vault, reusing the approach in the slash_for_to_be_redeemed() method.

Subsequent thefts from the same reported VaultId increase the amount stored in the PendingLiquidation status, without extending the recovery deadline. When the recovery period elapses, the vault’s status is set to CommittedTheft.

Triggering of the PendingLiquidation deadline can be performed either by off-chain workers, or by storing an on-chain heap data structure which stores VaultIds and is sorted in ascending order by the recovery_deadline_block. This is done by sending a pending_liquidation_elapsed(vault_id) extrinsic.

A valid recover_theft(vault_id, merkle_proof, raw_tx, active_status) extrinsic decreases the amount stored in the PendingLiquidation status, and if this amount reaches zero, the Vault's status becomes Active(active_status).

Current valid VaultStatus state transition:

Active(_) ---report_vault_theft---> CommittedTheft

Summarizing the above, the proposed extension to the CommittedTheft state transition:

Active(_) ---report_vault_theft(amount)---> PendingLiquidation(amount, TheftRecoveryPeriod::get())
PendingLiquidation(_,_) ---pending_liquidation_elapsed---> CommittedTheft
PendingLiquidation(amount, deadline) ---report_vault_theft(stolen_amount)---> PendingLiquidation(amount + stolen_amount, deadline)
PendingLiquidation(amount,_) ---recover_theft(recovered_amount)---> PendingLiquidation(amount - recovered_amount, deadline), if recovered_amount < amount
PendingLiquidation(amount, _) ---recover_theft(recovered_amount, active_status)---> Active(active_status), if recovered_amount >= amount

Additional context
Historic theft reports are stored on-chain, so recovered Active Vaults are not in danger of being liquidated again for the same Bitcoin transaction.

This feature can be exploited to allow a Vault operator to back more wrapped tokens than the physical Bitcoin it holds. The operator only needs to ensure that they cycle the physical Bitcoin through all the VaultIds they registered, every TheftRecoveryPeriod blocks. This can be mitigated by slashing a small amount of collateral when the Vault becomes active again - however this means that Vault Liquidation Recovery would slash the vault if they already spent the Bitcoin after becoming undercollateralized.

Error calling some RPC methods

Description

RPC methods that use vault_id fail on call:

image

ℹ️ When connecting to the API they are marked as undecorated, so perhaps they are not finished/designed for external use?


Steps to recreate

  1. Call an RPC call that targets a specific VaultId e.g. vaultRegistry.getCollateralizationFromVault()

⚠️ Call fails with following error:

-32602: Invalid params: unknown variant `token`, expected `Token`.

This affects all the RPC calls here that take vault_id type parameters
image

xcm high teleport fees

It's currently using identity fee for xcm:

type Trader = UsingComponents<IdentityFee, ..>;

This is likely to mean the same fees as the relay chain. In all likelyhood parachains don't need as high fees.

paritytech/cumulus#920 - we noticed this on statemint. Encointer have also recently tweaked their code to not use IdentityFee<Balance>. I suspect you might want to do the same.

WIP: switch to the relay chain block height

It has not been possible to produce blocks consistently on Kintsugi which has messed up our time estimations in several places. In particular, tokens take way longer to vest than intended and the lockup period for staking is also elongated. I'll use this ticket to note how we would go about switching to use the relay chain block height instead (which is consistently 6s).

Vesting

The orml-vesting pallet already has a type which allows us to use relay chain block number provider. The only thing to do would be to migrate the VestingSchedules.

Escrow

We can add the same associated type to the pallet Config and import RelaychainBlockNumberProvider from cumulus. This would also require a storage migration over most items in the pallet.

Issue, Redeem, Replace, Refund

Let's use the issue pallet as an example, we would first need to change the IssuePeriod to be 24h over the expected 6s block production interval. Each request is then assigned an opentime based on the ActiveBlockCount. This height is increased on_initialize if the parachain's status is Running, however since the blocks are produced at irregular intervals we instead need to record the relay chain height minus some rolling variance.

The simplest way to do this is increase an alternate storage item (OfflineBlockCount) on_initialize when the parachain is "offline". Checks would then minus this count when checking the "active" height.

Example:

  1. Relay chain height is 500 and OfflineBlockCount is 0
  2. Request issue logs the relay chain height minus OfflineBlockCount (500)
  3. Parachain goes offline for 100 relay chain blocks (OfflineBlockCount = 100)
  4. Execute issue checks 600 - 100 = 500
  5. Parachain goes online for 100 relay chain blocks
  6. Execute issue can now check 700 - 100 = 600

Changes to the active_block_number will require migration of existing, completed and cancelled requests as well as Bitcoin block headers since they also store this height.

Error calling Oracle RPCs

Take this call as an example:

fn collateral_to_wrapped(
    amount: BalanceWrapper<Balance>,
    currency_id: CurrencyId,
) -> Result<BalanceWrapper<Balance>, DispatchError>;

BalanceWrapper has the following concrete type:

pub struct BalanceWrapper {
    pub amount: u128,
}

For some reason polkadot-js/apps requires a second CurrencyId in the amount which results in the following error:

image

dom/fix-vault-double-reporting

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Run with these arguments '...'
  2. Call this function '....'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Version / Commit (e.g. 1.0.0):
The version of the binary you have installed.

Additional context
Add any other context about the problem here.

Automatically withdraw replace requests on cancel

Our clients subscribe to replace requests (using the RequestReplace event) and don't attempt to re-scan on cancellation - the user must call withdraw_replace and then request_replace again. To avoid unnecessarily making two calls we can automatically withdraw the pending replace request and allow the user to re-request replacement after the 24 hour ban has elapsed.

Total collateralization calculation with multi-collateral

We have an RPC that returns the total system collateralization. The function is not called by the parachain itself. We need to decide how we want to calculate the collateralization.

  • Calculate the total across all currencies. However, since each currency potentially has different secure thresholds, the value is meaningless.
  • Calculate the total across all currencies, but scale by secure threshold. E.g. (to_btc(total_DOT) / secure_threshold(total_DOT) +to_btc(total_KSM) / secure_threshold(total_KSM)) / total_INTERBTC. This gives a meaningful value - a value > 1.0 is good. But for users it might be confusing, since they expect overcollateralization. Maybe for users a collateral utilization percentage would be easier to understand, i.e. a value of 0 - 100%, where 100% means we are at the capacity limit
  • Instead of a single value, return a Vec<(CurrencyId, UnsignedFixedPoint)> and let the UI figure out how to display and aggregate it.

I think I'm leaning towards the last solution for greatest flexibility.

Use substrate storage version

Most of the pallets currently declare StorageVersion in types.rs but we can switch to the interface defined by Substrate, for example:

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(3);

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(_);

Vault Liquidation Recovery

Prerequisite: #636

Background

Vaults can be liquidated either by becoming undercollateralized or by being reported for Bitcoin theft. More specifically, liquidation occurs per VaultId, which is a tuple of (AccountId, CollateralCurrency, WrappedCurrency). The VaultId tuple is an identity in and of itself, which enables Vault operators to reuse the same AccountId to back wrapped Bitcoin with multiple collateral currencies. It provides an isolation of risk and responsibilities per each VaultId identity. Thus, liquidation of an operator for one collateral currency does not bear any consequences on the other collateral currencies the operator is using, because they are separate VaultIds. Once liquidated, there is no way for an operator to reinstate a VaultId; its assets are seized and its status is permanently set to Liquidated or CommittedTheft respectively.

Is your feature request related to a problem? Please describe.

A complication arises when operators reuse the same AccountId to register VaultIds for multiple collateral currencies, which is indeed what the official Vault client does. If one of the registered VaultIds gets liquidated but the operator wishes to keep using the collateral type that was liquidated, they need to create a new AccountId. The new AccountId allows for registering a new VaultId with the same currency pair as the liquidated one (wrapped_currency, collateral_currency), to enable the operator to maintain exposure to the same basket of collateral assets as before the liquidation.

Due to how the Vault client is implemented, using an additional AccountId creates two operational burdens:

  1. Requires operators to secure a new pair of private keys (Substrate and Bitcoin).
  2. Requires a separate Vault binary to be run.

Describe the solution you'd like

If the Vault's status is Liquidated or CommittedTheft but there are no more pending requests of any kind in the system (issue, redeem, replace, refund), meaning all of them have either been executed or cancelled, the VaultId can no longer be interacted with and is effectively "sandboxed" by the protocol. Due to this, a recover_vault_id(vault_id, active_status) extrinsic can be added to check the conditions above and then set the Vault status to Active(active_status).

In case the Vault was liquidated for undercollateralization and already spent its Bitcoin, theft reports can be recovered from using the Vault Theft Recovery feature.

Describe alternatives you've considered

Instead of ensuring there are no more pending requests associated with the VaultId, the recover_vault_id(...) extrinsic could check that the to_be_issued, issued, to_be_redeemed fields in the Vault struct are all zero. However, this introduces a dependency on the internal representation of Vault state, which may change in the future. Relying on finalized requests encapsulates this internal representation. Correctness is still preserved by the proposed solution, because the fields mentioned above can only be changed by new and pending requests.

Taproot support

General ticket for discussions related to taproot support on the interBTC parachain.

Overview

As far as I can tell there are no breaking changes that would impact the continued operation of Kintsugi and Interlay. However, I welcome input on ways to utilize the new cryptography - e.g. can Vaults make use of Schnorr signatures for payments?

Addresses

The primary new address format (introduced in BIP 341) is the P2TR (pay-to-taproot) construction.

The output has the following format:

scriptPubKey: OP_1 <32 bytes>

This is interpreted as witness version 1 due to OP_1 and the 32 byte push is the (tweaked) public key Q (P is the untweaked public key).

The spending rules are slightly more complicated...

Key Path

scriptSig: -
witnessStack: sig(Q)

The witness stack contains one entry, the Schnorr signature (BIP 340) for public key Q over the "common signature message".

-> Verify(pk, m, sig)

Script Path

scriptSig: -
witnessStack: [args ...] S P

The witness stack contains multiple entries, but the penultimate entry is always the script S followed by the public key P (which is always the last entry).

-> Q = tweak(P, S) = P + hash(P || S) * G

Notes

To support P2TR addresses we need to add a new variant to the BtcAddress enum. Calculating the "address" from a transaction output is relatively easy, assuming we simply extract Q as defined above. However, calculating the corresponding "address" from the subsequent spending transaction input alone, at least for key path spending, is simply not possible as the Schnorr construction does not support public key recovery. The only way to do this is to also provide the output that is spent and verify Q.

Don't parse, verify

All extrinsics which use the BTC-Relay require "raw" (Vec<u8>) values which are parsed at runtime. In the past this has led to a range of unhandled panics we have caught during fuzzing. Once decoded these types are then re-encoded for verification which is an unnecessary overhead. We should instead use the concrete types which should also allow us to better determine the weights of the extrinsics.

Tracking issue for AMM support

Integrate Zenlink's DEX module (docs).

Notes

No XCM integration for now, see: zenlinkpro/Zenlink-DEX-Module#36 (comment)

Standard AMM

  • Adopts the Uniswap v2 mechanism
  • Supports bootstrapping with incentives
  • Optional protocol fee

Root extrinsics:

  • set fee receiver
  • set fee point (maximum 0.3%)
  • create pair
  • bootstrap create

Stable AMM

  • Based on Curve v1 (StableSwap) model
  • Focuses on similarly priced assets
  • Minimizes impermanent loss and slippage
  • Supports multiple assets per pool

Root extrinsics:

  • create base / meta pool
  • set fee receiver
  • set swap fee
  • set admin fee
  • start / stop ramp (amplification co-efficient)

Resources

[LOW] Wrong SS58 prefix used in vault logs

Description

The vault logs uses prefix 42 instead of whichever chain it is connected to e.g. 2092 for kintsugi.

Tested against: kintsugi main net, vault is successfully integrated to the network though, so this is logging defect only.

Steps to recreate

  1. Run setup for kintsugi mode and start vault as normal

⚠️ Account format used is not for kintsugi

Apr 27 18:29:10 timbo-ubun2 systemd[1]: Started Vault servicing issue and redeem requests for Kintsugi.
Apr 27 18:29:10 timbo-ubun2 vault[7384]: Apr 27 18:29:10.824  INFO vault: Starting Prometheus exporter at http://127.0.0.1:9615
Apr 27 18:29:10 timbo-ubun2 vault[7384]: Apr 27 18:29:10.824  INFO service: Version: 1.9.6
Apr 27 18:29:10 timbo-ubun2 vault[7384]: Apr 27 18:29:10.824  INFO service: AccountId: 5CFUfGrWKPdTJQ5bM4co11cYijfHXnp96PBtYj3K2dk2KSpd

Add dedicated security error for OngoingFork

Transaction verification is disabled if we have an OngoingFork with more confirmations + the security parameter than the main chain (see here). This is not reflected in the security module and thus our client-side code is unable to determine if it is valid to execute a payment. We should reflect this possible downtime in the security pallet to also avoid unintended lapses in the expiry periods.

Banned vaults and Premium Redeems

Hello dev team. Let's assume a vault gets banned for some duration due to lack of response. During the banned period, due to market fluctuations, the collateralization gets in the Premium Redeem range.
In this particular situation, even if banned, the vault should be allowed to accept redeems up to the level that restores a non Premium collateralization.

Looking at the code of the Redeem pallet, I think that this is not the case at the moment.
line 372 you return a VaultBanned error if the vault is banned
ext::vault_registry::ensure_not_banned::(&vault_id)?;

and only at line 388 you check for premium redeem.
let below_premium_redeem = ext::vault_registry::is_vault_below_premium_threshold::(&vault_id)?;

As it is in the interest of the network that collateralization be maintained. The banned status should not be enforced in this particular situation.


Discord comments:
greg — Yesterday at 10:29 AM
Thanks for digging into this @claudio, I think I agree with your assessment. @sander @dom any additional thoughts?
@claudio I think it might be useful to capture this discussion on GitHub so please also feel free to open a ticket!

Sander — Today at 7:57 AM
There is a trade-off here: on the one hand for the vault it is better to get premium redeems. On the other hand if a vault is banned it is not very likely to actually execute the new premium redeem, so it'd affect the user trying to redeem, who would likely have to wait until the redeem period expired. Still, the small chance that the vault might actually execute the premium redeem may be worth it

Testnet chainspec for Light Client Demo

Is your feature request related to a problem? Please describe.
We at Parity are preparing a light client demo for Bitcoin Miami 2022. We want to use a substrate connect light client to move kBTC. It would be nice to do that on the testnet that's live at https://testnet.interlay.io/bridge

With substrate connect, light clients connect to a relay or parachain without syncing with it. All they need is the correct chainspecs. Greg forwarded some chainspecs from Interlay devops:

However these chaispecs don't give us the necessary information on bootNodes. They are:

  • empty on relay chainspec
  • 127.0.0.1 on para chainspec

Without the correct information on bootNodes, we can't get the light client to connect to Interlay testnet, because they don't know how to find the chain.

Describe the solution you'd like
We need chainspecs with bootNodes that are prepared to launch nodes outside of Interlay infrastructure.

Describe alternatives you've considered
Worst case, we will launch our own testnet. But using Interlay infrastructure would be very helpful to us.

Additional context
Here's a screenshot of the burnr wallet in action:

The plan is to have kBTC instead of WND, and interact with the testnet chain over the light client that we will launch from the provided chainspecs.

Vault Upgrade Process

Ideal runtime upgrade process:

  1. Bump spec_version, compile and tag parachain
  2. Upgrade Vault client and tag
  3. Execute authorize_upgrade(code_hash)
  4. Execute some call to notify pending Vault upgrade
  5. Off-chain process downloads new release
  6. Execute enact_authorized_upgrade(code)
  7. Validation function is scheduled to apply on relay chain
  8. Off-chain process waits for new runtime and restarts

Related: interlay/interbtc-clients#310

We can also make use of this event to monitor when the upgrade has been applied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.