From 38393d3e95adef289fd494790c37073818c81a90 Mon Sep 17 00:00:00 2001 From: jackstar12 Date: Tue, 11 Feb 2025 15:23:42 +0100 Subject: [PATCH 1/3] chore: bump gdk --- Makefile | 18 ++++++++++++------ gdk | 2 +- gdk.Dockerfile | 8 +++++++- internal/onchain/wallet/include/gdk.h | 14 ++++++++++++++ 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cd09c37d..f1a2072d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PKG := github.com/BoltzExchange/boltz-client/v2 VERSION := 2.3.8 -GDK_VERSION = 0.73.3 +GDK_VERSION = 0.74.2 GO_VERSION := 1.23.0 RUST_VERSION := 1.82.0 @@ -150,27 +150,33 @@ changelog: PLATFORMS := linux/amd64,linux/arm64 DOCKER_CACHE := boltz/boltz-client:buildcache -DOCKER_ARGS := --platform $(PLATFORMS) --build-arg GO_VERSION=$(GO_VERSION) --build-arg GDK_VERSION=$(GDK_VERSION) --build-arg RUST_VERSION=$(RUST_VERSION) --cache-from type=registry,ref=$(DOCKER_CACHE) --cache-to type=registry,ref=$(DOCKER_CACHE),mode=max +DOCKER_ARGS := --platform $(PLATFORMS) --build-arg GO_VERSION=$(GO_VERSION) --build-arg GDK_VERSION=$(GDK_VERSION) --build-arg RUST_VERSION=$(RUST_VERSION) +DOCKER_CACHE_ARGS := --cache-from type=registry,ref=$(DOCKER_CACHE) --cache-to type=registry,ref=$(DOCKER_CACHE),mode=max docker: @$(call print, "Building docker image") - docker buildx build --push -t boltz/boltz-client:$(VERSION) -t boltz/boltz-client:latest $(DOCKER_ARGS) . + docker buildx build --push -t boltz/boltz-client:$(VERSION) -t boltz/boltz-client:latest $(DOCKER_ARGS) $(DOCKER_CACHE_ARGS) . binaries: @$(call print, "Building binaries") - docker buildx build --output bin --target binaries $(DOCKER_ARGS) . + docker buildx build --output bin --target binaries $(DOCKER_ARGS) $(DOCKER_CACHE_ARGS) . tar -czvf boltz-client-linux-amd64-v$(VERSION).tar.gz bin/linux_amd64 tar -czvf boltz-client-linux-arm64-v$(VERSION).tar.gz bin/linux_arm64 sha256sum boltz-client-*.tar.gz bin/**/* > boltz-client-manifest-v$(VERSION).txt gdk-source: submodules cd gdk && git checkout release_$(GDK_VERSION) && git apply ../gdk.patch - cp ./gdk/include/gdk.h ./onchain/wallet/include/gdk.h + cp ./gdk/include/gdk.h ./internal/onchain/wallet/include/gdk.h build-gdk-builder: gdk-source docker buildx build --push -t boltz/gdk-ubuntu-builder:latest -t boltz/gdk-ubuntu-builder:$(GDK_VERSION) $(DOCKER_ARGS) -f ./gdk/docker/ubuntu/Dockerfile ./gdk +GDK_AMD64_BUILDER := blockstream/gdk-ubuntu-builder@sha256:3470ad91a2bdc42dd7d6210a9323f3c9d59aeb93843c23fe6a17dc8eb8ac99f7 +GDK_ARM64_BUILDER := blockstream/gdk-ubuntu-builder@sha256:0b2c672edaf8dea27041c235170f6b71d8651a09c754e10f00bb989e1e2770ad + build-gdk: - docker buildx build --push -t boltz/gdk-ubuntu:latest -t boltz/gdk-ubuntu:$(GDK_VERSION) -f gdk.Dockerfile $(DOCKER_ARGS) . + docker buildx build --push -t boltz/gdk-ubuntu:latest -t boltz/gdk-ubuntu:$(GDK_VERSION) -f gdk.Dockerfile $(DOCKER_ARGS) \ + --build-arg GDK_AMD64_BUILDER=$(GDK_AMD64_BUILDER) \ + --build-arg GDK_ARM64_BUILDER=$(GDK_ARM64_BUILDER) . .PHONY: build binaries diff --git a/gdk b/gdk index 904e93bd..4f8555a1 160000 --- a/gdk +++ b/gdk @@ -1 +1 @@ -Subproject commit 904e93bdf307c8da769b79fb126e4bae2219796b +Subproject commit 4f8555a16d6debf8f7698a502ff49df6627c85d1 diff --git a/gdk.Dockerfile b/gdk.Dockerfile index 541e40de..34f4e86e 100644 --- a/gdk.Dockerfile +++ b/gdk.Dockerfile @@ -1,5 +1,11 @@ ARG GDK_VERSION -FROM boltz/gdk-ubuntu-builder:$GDK_VERSION AS builder +ARG GDK_AMD64_BUILDER +ARG GDK_ARM64_BUILDER + +FROM $GDK_AMD64_BUILDER AS builder-amd64 +FROM $GDK_ARM64_BUILDER AS builder-arm64 + +FROM builder-$TARGETARCH AS builder ARG GDK_VERSION ARG GDK_ARGS diff --git a/internal/onchain/wallet/include/gdk.h b/internal/onchain/wallet/include/gdk.h index ca583dda..5b9a8407 100644 --- a/internal/onchain/wallet/include/gdk.h +++ b/internal/onchain/wallet/include/gdk.h @@ -1052,6 +1052,20 @@ GDK_API int GA_bcur_encode(struct GA_session* session, GA_json* details, struct */ GDK_API int GA_bcur_decode(struct GA_session* session, GA_json* details, struct GA_auth_handler** call); +/** + * Verify an RSA challenge. + * + * :param session: The session to use. + * :param details: :ref:`rsa-verify` containing the the details to verify. + * :param call: Destination for the resulting ``GA_auth_handler`` to perform the verification. + *| The call handlers result is :ref:`rsa-verify-result`. + * + * .. note:: The returned ``GA_auth_handler`` should be freed using `GA_destroy_auth_handler`. + * + * .. note:: ``details`` is emptied when called directly from C or C++. + */ +GDK_API int GA_rsa_verify(struct GA_session* session, GA_json* details, struct GA_auth_handler** call); + #ifndef SWIG /** * Free a string returned by the api. From 8c8587a47ded0759a81af7e288202a07f26e842d Mon Sep 17 00:00:00 2001 From: jackstar12 Date: Mon, 17 Feb 2025 09:51:09 +0100 Subject: [PATCH 2/3] fix: change `MaxInputs` back to 256 gdk limit is now correct: https://github.com/Blockstream/gdk/commit/2e53b69eb443ea84c889ac5d86306947a8179b72 --- internal/onchain/wallet/wallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/onchain/wallet/wallet.go b/internal/onchain/wallet/wallet.go index b8320444..dedd2ec2 100644 --- a/internal/onchain/wallet/wallet.go +++ b/internal/onchain/wallet/wallet.go @@ -32,7 +32,7 @@ import ( "github.com/BoltzExchange/boltz-client/v2/pkg/boltz" ) -const MaxInputs = uint64(255) // TODO: change back to 256 when gdk is fixed +const MaxInputs = uint64(256) const DefaultAutoConsolidateThreshold = uint64(200) const GapLimit = 100 From 65d9e26feff73c8ad37bf3f9a858c1df421b5c62 Mon Sep 17 00:00:00 2001 From: jackstar12 Date: Mon, 17 Feb 2025 09:51:56 +0100 Subject: [PATCH 3/3] chore: remove fee floor in `estimateFee` now properly implemented in gdk: https://github.com/Blockstream/gdk/commit/1fe1f3b6760b9e9896e0d8ccf8524149f21d9e70 --- internal/onchain/wallet/wallet.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/onchain/wallet/wallet.go b/internal/onchain/wallet/wallet.go index dedd2ec2..6910102f 100644 --- a/internal/onchain/wallet/wallet.go +++ b/internal/onchain/wallet/wallet.go @@ -884,8 +884,7 @@ func (wallet *Wallet) estimateFee() (float64, error) { if err := withOutput(C.GA_get_fee_estimates(wallet.session, &output), output, &estimates); err != nil { return 0, err } - // TODO: remove when proper floor is in gdk - return max(estimates.Fees[0]/1000, 0.1), nil + return estimates.Fees[0] / 1000, nil } func (wallet *Wallet) autoConsolidate() error {