Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump gdk #390

Merged
merged 3 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion gdk
Submodule gdk updated 57 files
+5 −4 .dockerignore
+72 −0 CHANGELOG.md
+1 −1 CMakeLists.txt
+29 −0 docker/aws_lambda/Dockerfile
+15 −0 docker/aws_lambda/install_deps.sh
+78 −2 docs/source/gdk-json.rst
+2 −0 downloads/.gitignore
+6 −7 gitlab/common.yml
+0 −1 gitlab/docker.yml
+14 −0 include/gdk.h
+5 −0 src/CMakeLists.txt
+5 −1 src/amount.cpp
+3 −0 src/ffi_c.cpp
+45 −5 src/ga_auth_handlers.cpp
+10 −0 src/ga_auth_handlers.hpp
+56 −20 src/ga_psbt.cpp
+6 −6 src/ga_psbt.hpp
+13 −8 src/ga_rust.cpp
+1 −1 src/ga_session.cpp
+2 −3 src/ga_tor.cpp
+28 −9 src/ga_tx.cpp
+2 −3 src/http_client.cpp
+4 −0 src/swift/GreenGDK/Sources/GreenGDK/GreenGDK.swift
+1 −0 src/swig_java/swig_green_gdk.i
+32 −24 src/swig_python/__init__.py
+23 −6 src/swig_python/swig_green_gdk.i
+4 −4 src/transaction_utils.cpp
+3 −0 src/transaction_utils.hpp
+29 −4 src/utils.cpp
+3 −0 src/utils.hpp
+151 −74 subprojects/gdk_rust/Cargo.lock
+5 −5 subprojects/gdk_rust/gdk_common/Cargo.toml
+6 −6 subprojects/gdk_rust/gdk_common/src/be/transaction.rs
+19 −0 subprojects/gdk_rust/gdk_common/src/descriptor.rs
+8 −5 subprojects/gdk_rust/gdk_common/src/error.rs
+4 −6 subprojects/gdk_rust/gdk_common/src/model.rs
+4 −4 subprojects/gdk_rust/gdk_common/src/network.rs
+3 −3 subprojects/gdk_rust/gdk_common/src/scripts.rs
+7 −1 subprojects/gdk_rust/gdk_common/src/slip132.rs
+7 −1 subprojects/gdk_rust/gdk_common/src/store.rs
+0 −1 subprojects/gdk_rust/gdk_electrum/Cargo.toml
+28 −21 subprojects/gdk_rust/gdk_electrum/src/account.rs
+6 −8 subprojects/gdk_rust/gdk_electrum/src/error.rs
+10 −5 subprojects/gdk_rust/gdk_electrum/src/headers/bitcoin.rs
+13 −8 subprojects/gdk_rust/gdk_electrum/src/interface.rs
+12 −8 subprojects/gdk_rust/gdk_electrum/src/lib.rs
+4 −3 subprojects/gdk_rust/gdk_electrum/src/sweep.rs
+1 −1 subprojects/gdk_rust/gdk_pin_client/Cargo.toml
+1 −1 subprojects/gdk_rust/gdk_pin_client/src/pin_request.rs
+14,936 −8,648 subprojects/gdk_rust/gdk_registry/src/hard_coded/liquid_assets.json
+5 −5 subprojects/gdk_rust/gdk_registry/src/hard_coded/liquid_icons.json
+3 −3 subprojects/gdk_rust/gdk_rust/Cargo.toml
+1 −2 subprojects/gdk_rust/gdk_test/Cargo.toml
+3 −3 subprojects/gdk_rust/gdk_test/src/test_session.rs
+26 −0 tools/bc-ur.patch
+15 −9 tools/builddeps.sh
+1 −1 tools/buildopenssl.sh
8 changes: 7 additions & 1 deletion gdk.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions internal/onchain/wallet/include/gdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions internal/onchain/wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down
Loading