From 51f82bf227c6fab3cd4daf9dd23c084d97c4ad65 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:52:27 +0200 Subject: [PATCH] feat: replace dash core quorum sign with quorum platformsign --- dash/core/client.go | 12 ++++++++++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dash/core/client.go b/dash/core/client.go index 9752be7174..e012d428ef 100644 --- a/dash/core/client.go +++ b/dash/core/client.go @@ -172,13 +172,13 @@ func (rpcClient *RPCClient) QuorumSign( if err := quorumType.Validate(); err != nil { return nil, err } - quorumSignResultWithBool, err := rpcClient.endpoint.QuorumSign( - quorumType, + quorumSignResultWithBool, err := rpcClient.endpoint.QuorumPlatformSign( requestID.String(), messageHash.String(), quorumHash.String(), false, ) + rpcClient.logger.Trace("core rpc call QuorumSign", "quorumType", quorumType, "requestID", requestID.String(), @@ -192,7 +192,15 @@ func (rpcClient *RPCClient) QuorumSign( if quorumSignResultWithBool == nil { return nil, err } + + // as QuorumPlatformSign does not provide the quorum type, we need to check it manually + // to ensure we deliver what was requested by the caller quorumSignResult := quorumSignResultWithBool.QuorumSignResult + if quorumType != btcjson.LLMQType(quorumSignResult.LLMQType) { + return nil, fmt.Errorf("possible misconfiguration: quorum platform sign uses unexpected quorum type %d, expected %d", + quorumSignResultWithBool.LLMQType, quorumType) + } + return &quorumSignResult, err } diff --git a/go.mod b/go.mod index 7afcfdc826..60a87621b1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/containerd/continuity v0.3.0 // indirect github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8 - github.com/dashpay/dashd-go v0.24.1 + github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660 github.com/dashpay/dashd-go/btcec/v2 v2.1.0 // indirect github.com/fortytw2/leaktest v1.3.0 github.com/fxamacker/cbor/v2 v2.4.0 diff --git a/go.sum b/go.sum index 2139ab461e..817d17878a 100644 --- a/go.sum +++ b/go.sum @@ -229,8 +229,8 @@ github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y= github.com/daixiang0/gci v0.11.2/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8 h1:v4K3CiDoFY1gjcWL/scRcwzyjBwh8TVG3ek8cWolK1g= github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8/go.mod h1:auvGS60NBZ+a21aCCQh366PdsjDvHinsCvl28VrYPu4= -github.com/dashpay/dashd-go v0.24.1 h1:w+F5pDt+fqud4QQM/O9sAJihbQ3oswO8DKOmDS/pcNw= -github.com/dashpay/dashd-go v0.24.1/go.mod h1:4yuk/laGME2RnQRTdqTbw87PhT+42hE1anLCnpkgls8= +github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660 h1:cL7Pwgzb8zFuJ5LB9Zxr3+iB8MO668fH8M36fbky54g= +github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660/go.mod h1:4yuk/laGME2RnQRTdqTbw87PhT+42hE1anLCnpkgls8= github.com/dashpay/dashd-go/btcec/v2 v2.1.0 h1:fXwlLf5H+TtgHxjGMU74NesKzk6NisjKMPF04pBcygk= github.com/dashpay/dashd-go/btcec/v2 v2.1.0/go.mod h1:1i8XtxdOmvK6mYEUCneVXTzFbrCUw3wq1u91j8gvsns= github.com/dashpay/dashd-go/btcutil v1.2.0 h1:YMq7L0V0au5bbphIhpsBBc+nfOZqU+gJ4pkgRZB7Eiw=