From 6f6753705c73c116c4a8685805f8c9a1c9a999a4 Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 16:16:53 +0200 Subject: [PATCH 1/6] Use matrix strategy --- .github/workflows/build-dev.yml | 47 ++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 25687fe82b..667d3306ee 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -15,17 +15,38 @@ jobs: build_and_test: runs-on: ubuntu-22.04 + strategy: + matrix: + target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin] + env: + TARGET: ${{matrix.target}} + steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update - sudo apt-get install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-dev libboost-dev - wget -O - "https://apt.llvm.org/llvm.sh" | sudo bash -s 18 + sudo apt-get install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 sudo /usr/sbin/update-ccache-symlinks echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc source ~/.bashrc + + - name: Install Windows dependencies + if: ${{ env.TARGET == 'x86_64-w64-mingw32' }} + run: sudo apt-get install g++-mingw-w64-x86-64-posix + + - name: Install OSX dependencies + if: ${{ env.TARGET == 'x86_64-apple-darwin' }} + run: | + sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso cpio + cd depends && mkdir SDKs && cd SDKs + wget https://archive.org/download/xcode-12.2/Xcode_12.2.xip + git clone https://github.com/bitcoin-core/apple-sdk-tools.git + python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i + ../../contrib/macdeploy/gen-sdk './Xcode.app' + tar -xzf Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz + rm -rf Xcode_12.2.xip - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -33,16 +54,16 @@ jobs: key: ${{ github.job }}-${{ runner.os }} max-size: 2G + - name: Build depends + run: make -j$(nproc) -C depends NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 + - name: Build env: - BDB_PREFIX: '/home/runner/work/SEQ-Core-Elements/SEQ-Core-Elements/db4' + CONFIG_SITE: ${{github.workspace}}/depends/${{env.TARGET}}/share/config.site NOWARN_CXXFLAGS: -Wno-deprecated -Wno-unused-result - CC: clang-18 - CXX: clang++-18 run: | ./autogen.sh - CFLAGS='-Wno-error=implicit-function-declaration -Wno-deprecated-non-prototype' ./contrib/install_db4.sh . - BDB_CFLAGS='-I${BDB_PREFIX}/include' BDB_LIBS='-L${BDB_PREFIX}/lib -ldb_cxx-4.8' ./configure --without-gui --without-natpmp --without-miniupnpc --disable-tests + ./configure --enable-any-asset-fees --disable-tests make clean make -j$(nproc) @@ -54,10 +75,10 @@ jobs: - name: Publish artifact - linux uses: actions/upload-artifact@v4 with: - name: sequentia-linux + name: sequentia-${{ env.TARGET }} path: | - src/elementsd - src/elements-cli - src/elements-tx - src/elements-util - src/elements-wallet + src/elementsd* + src/elements-cli* + src/elements-tx* + src/elements-util* + src/elements-wallet* From 9e666c35d22606b51d99ca54a79c93bb65e65b02 Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 16:33:31 +0200 Subject: [PATCH 2/6] Fix --- .github/workflows/build-dev.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 667d3306ee..c0408c170f 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -15,7 +15,9 @@ jobs: build_and_test: runs-on: ubuntu-22.04 + continue-on-error: ${{ matrix.experimental }} strategy: + max-parallel: 2 matrix: target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin] env: @@ -55,7 +57,7 @@ jobs: max-size: 2G - name: Build depends - run: make -j$(nproc) -C depends NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 + run: make -j$(nproc) -C depends HOST=${{env.TARGET}} NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 - name: Build env: @@ -68,6 +70,7 @@ jobs: make -j$(nproc) - name: Run tests + if: ${{ env.TARGET == 'x86_64-pc-linux-gnu' }} run: | echo "Running tests" ./test/functional/test_runner.py From b603d1e44021e0942e2456f131577197bc29caac Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 16:35:19 +0200 Subject: [PATCH 3/6] Fix --- .github/workflows/build-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index c0408c170f..7a7b731f65 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -15,7 +15,7 @@ jobs: build_and_test: runs-on: ubuntu-22.04 - continue-on-error: ${{ matrix.experimental }} + continue-on-error: true strategy: max-parallel: 2 matrix: From f801ce6e2f7956577dce3829e8c9682d1df7483a Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 17:37:21 +0200 Subject: [PATCH 4/6] Fix tests --- .github/workflows/build-dev.yml | 4 ++-- test/functional/interface_bitcoin_cli.py | 2 +- test/functional/rpc_fundrawtransaction.py | 2 +- test/functional/rpc_psbt.py | 2 +- test/functional/wallet_basic.py | 4 ++-- test/functional/wallet_send.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 7a7b731f65..a171d7955d 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -53,7 +53,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: ${{ github.job }}-${{ runner.os }} + key: ${{ github.job }}-${{ env.TARGET }} max-size: 2G - name: Build depends @@ -65,7 +65,7 @@ jobs: NOWARN_CXXFLAGS: -Wno-deprecated -Wno-unused-result run: | ./autogen.sh - ./configure --enable-any-asset-fees --disable-tests + ./configure --enable-any-asset-fees make clean make -j$(nproc) diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py index fcd12f63be..02e6cc0e63 100755 --- a/test/functional/interface_bitcoin_cli.py +++ b/test/functional/interface_bitcoin_cli.py @@ -155,7 +155,7 @@ def run_test(self): assert_equal(int(cli_get_info['Keypool size']), wallet_info['keypoolsize']) assert_equal(int(cli_get_info['Unlocked until']), wallet_info['unlocked_until']) assert_equal(Decimal(cli_get_info['Transaction fee rate (-paytxfee) (RFU/kvB)']), wallet_info['paytxfee']) - assert_equal(Decimal(cli_get_info['Min tx relay fee rate (BTC/kvB)']), network_info['relayfee']) + assert_equal(Decimal(cli_get_info['Min tx relay fee rate (RFU/kvB)']), network_info['relayfee']) assert_equal(self.nodes[0].cli.getwalletinfo(), wallet_info) # Setup to test -getinfo, -generate, and -rpcwallet= with multiple wallets. diff --git a/test/functional/rpc_fundrawtransaction.py b/test/functional/rpc_fundrawtransaction.py index 02fb586016..ef3acb72c4 100755 --- a/test/functional/rpc_fundrawtransaction.py +++ b/test/functional/rpc_fundrawtransaction.py @@ -873,7 +873,7 @@ def test_option_feerate(self): node.fundrawtransaction(rawtx, {"feeRate": 0.00000999, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and fee_rate are passed") - assert_raises_rpc_error(-8, "Cannot specify both fee_rate (rfa/vB) and feeRate (BTC/kvB)", + assert_raises_rpc_error(-8, "Cannot specify both fee_rate (rfa/vB) and feeRate (RFU/kvB)", node.fundrawtransaction, rawtx, {"fee_rate": 0.1, "feeRate": 0.1, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and estimate_mode passed") diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index be870a6418..4ebd23362b 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -309,7 +309,7 @@ def run_basic_tests(self, confidential): self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {"fee_rate": invalid_value, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and fee_rate are passed") - assert_raises_rpc_error(-8, "Cannot specify both fee_rate (rfa/vB) and feeRate (BTC/kvB)", + assert_raises_rpc_error(-8, "Cannot specify both fee_rate (rfa/vB) and feeRate (RFU/kvB)", self.nodes[1].walletcreatefundedpsbt, inputs, outputs, 0, {"fee_rate": 0.1, "feeRate": 0.1, "add_inputs": True}) self.log.info("- raises RPC error if both feeRate and estimate_mode passed") diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index fa1e4166b6..9833be3979 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -297,7 +297,7 @@ def run_test(self): self.log.info("Test sendmany raises if an invalid fee_rate is passed") # Test fee_rate with zero values. - msg = "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)" + msg = "Fee rate (0.000 rfa/vB) is lower than the minimum fee rate setting (1.000 rfa/vB)" for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]: assert_raises_rpc_error(-6, msg, self.nodes[2].sendmany, amounts={address: 1}, fee_rate=zero_value) msg = "Invalid amount" @@ -494,7 +494,7 @@ def run_test(self): self.log.info("Test sendtoaddress raises if an invalid fee_rate is passed") # Test fee_rate with zero values. - msg = "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)" + msg = "Fee rate (0.000 rfa/vB) is lower than the minimum fee rate setting (1.000 rfa/vB)" for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]: assert_raises_rpc_error(-6, msg, self.nodes[2].sendtoaddress, address=address, amount=1, fee_rate=zero_value) msg = "Invalid amount" diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py index 28fd8a4b42..2ccac5c49b 100755 --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -371,7 +371,7 @@ def run_test(self): # Test setting explicit fee rate just below the minimum of 1 sat/vB. self.log.info("Explicit fee rate raises RPC error 'fee rate too low' if fee_rate of 0.99999999 is passed") - msg = "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)" + msg = "Fee rate (0.999 rfa/vB) is lower than the minimum fee rate setting (1.000 rfa/vB)" self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=0.999, expect_error=(-4, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=0.999, expect_error=(-4, msg)) From 465ab4626cc0b6db1a6bc2ce53bdcd06c9850c3c Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 19:13:06 +0200 Subject: [PATCH 5/6] Fix tests and add cache for OSX deps --- .github/workflows/build-dev.yml | 22 +++++++++++++++++++--- test/functional/wallet_basic.py | 2 +- test/functional/wallet_send.py | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index a171d7955d..fbc9f430ac 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -38,18 +38,34 @@ jobs: if: ${{ env.TARGET == 'x86_64-w64-mingw32' }} run: sudo apt-get install g++-mingw-w64-x86-64-posix - - name: Install OSX dependencies + - name: Restore OSX deps cache + id: osx-deps-cache-restore if: ${{ env.TARGET == 'x86_64-apple-darwin' }} + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/depends/SDKs + key: ${{ env.TRAGET }}-osx-deps + + - name: Install OSX dependencies + if: ${{ env.TARGET == 'x86_64-apple-darwin' && steps.osx-deps-cache-restore.cache-hit != 'true'}} run: | sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso cpio cd depends && mkdir SDKs && cd SDKs - wget https://archive.org/download/xcode-12.2/Xcode_12.2.xip + wget https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip git clone https://github.com/bitcoin-core/apple-sdk-tools.git python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i ../../contrib/macdeploy/gen-sdk './Xcode.app' tar -xzf Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz - rm -rf Xcode_12.2.xip + rm -rf Xcode_12.2.xip Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz Xcode.app + - name: Save OSX deps cache + id: osx-deps-cache-save + if: ${{ env.TARGET == 'x86_64-apple-darwin' && steps.osx-deps-cache-restore.cache-hit != 'true'}} + uses: actions/cache/save@v4 + with: + path: ${{github.workspace}}/depends/SDKs + key: ${{ env.TRAGET }}-osx-deps + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index 9833be3979..3f8f92a0a8 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -489,7 +489,7 @@ def run_test(self): # Test setting explicit fee rate just below the minimum. self.log.info("Test sendtoaddress raises 'fee rate too low' if fee_rate of 0.99999999 is passed") - assert_raises_rpc_error(-6, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)", + assert_raises_rpc_error(-6, "Fee rate (0.999 rfa/vB) is lower than the minimum fee rate setting (1.000 rfa/vB)", self.nodes[2].sendtoaddress, address=address, amount=1, fee_rate=0.999) self.log.info("Test sendtoaddress raises if an invalid fee_rate is passed") diff --git a/test/functional/wallet_send.py b/test/functional/wallet_send.py index 2ccac5c49b..62d33b2a4a 100755 --- a/test/functional/wallet_send.py +++ b/test/functional/wallet_send.py @@ -377,7 +377,7 @@ def run_test(self): self.log.info("Explicit fee rate raises if invalid fee_rate is passed") # Test fee_rate with zero values. - msg = "Fee rate (0.000 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)" + msg = "Fee rate (0.000 rfa/vB) is lower than the minimum fee rate setting (1.000 rfa/vB)" for zero_value in [0, 0.000, 0.00000000, "0", "0.000", "0.00000000"]: self.test_send(from_wallet=w0, to_wallet=w1, amount=1, fee_rate=zero_value, expect_error=(-4, msg)) self.test_send(from_wallet=w0, to_wallet=w1, amount=1, arg_fee_rate=zero_value, expect_error=(-4, msg)) From 267cea4e3ee56be7e6bbb3598062727af8f9d145 Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Thu, 23 May 2024 19:28:43 +0200 Subject: [PATCH 6/6] Fix --- .github/workflows/build-dev.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index fbc9f430ac..f690fa2baa 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -51,12 +51,8 @@ jobs: run: | sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso cpio cd depends && mkdir SDKs && cd SDKs - wget https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip - git clone https://github.com/bitcoin-core/apple-sdk-tools.git - python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i - ../../contrib/macdeploy/gen-sdk './Xcode.app' - tar -xzf Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz - rm -rf Xcode_12.2.xip Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz Xcode.app + wget http://mixakuca.ddns.net:8000/Xcode-12.2.tar.gz + tar -xzf Xcode-12.2.tar.gz - name: Save OSX deps cache id: osx-deps-cache-save