diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 75ea89ad6e..6092fa6007 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -64,7 +64,7 @@ LABEL maintainer="developers@dash.org" # private validator file into /tenderdash/config. # # The /tenderdash/data dir is used by tenderdash to store state. -ENV TMHOME /tenderdash +ENV TMHOME=/tenderdash # OS environment setup # Set user right away for determinism, create directory for persistence and give our user ownership 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..2c0ec90ed0 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.25.0 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..0fe9ceb514 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.25.0 h1:tswVRmM2fLHC/JhpuAZ5Oa0TpOO6L+tqiE+QLTCvIQc= +github.com/dashpay/dashd-go v0.25.0/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= diff --git a/privval/signer_requestHandler.go b/privval/signer_requestHandler.go index a74e1b3fd0..61c9dc06df 100644 --- a/privval/signer_requestHandler.go +++ b/privval/signer_requestHandler.go @@ -46,10 +46,6 @@ func DefaultValidationRequestHandler( var proTxHash crypto.ProTxHash proTxHash, err = privVal.GetProTxHash(context.Background()) - if err != nil { - return res, err - } - if err != nil { res = mustWrapMsg(&privvalproto.ProTxHashResponse{ ProTxHash: nil, Error: &privvalproto.RemoteSignerError{Code: 0, Description: err.Error()}}) diff --git a/test/e2e/node/main.go b/test/e2e/node/main.go index caf90c2ac4..fc246e1286 100644 --- a/test/e2e/node/main.go +++ b/test/e2e/node/main.go @@ -407,7 +407,7 @@ func setupCoreServer(cfg *Config) (*mockcoreserver.JRPCServer, error) { srv = mockcoreserver.WithMethods( srv, mockcoreserver.WithQuorumInfoMethod(coreServer, mockcoreserver.Endless), - mockcoreserver.WithQuorumSignMethod(coreServer, mockcoreserver.Endless), + mockcoreserver.WithQuorumSignMethod(coreServer, mockcoreserver.Endless, coreServer.LLMQType), mockcoreserver.WithQuorumVerifyMethod(coreServer, mockcoreserver.Endless), mockcoreserver.WithMasternodeMethod(coreServer, mockcoreserver.Endless), mockcoreserver.WithGetNetworkInfoMethod(coreServer, mockcoreserver.Endless), diff --git a/test/e2e/pkg/mockcoreserver/methods.go b/test/e2e/pkg/mockcoreserver/methods.go index bd5431e61e..5894dfa867 100644 --- a/test/e2e/pkg/mockcoreserver/methods.go +++ b/test/e2e/pkg/mockcoreserver/methods.go @@ -33,18 +33,20 @@ func WithQuorumInfoMethod(cs CoreServer, times int) MethodFunc { } // WithQuorumSignMethod ... -func WithQuorumSignMethod(cs CoreServer, times int) MethodFunc { +func WithQuorumSignMethod(cs CoreServer, times int, quorumType btcjson.LLMQType) MethodFunc { call := OnMethod(func(ctx context.Context, req btcjson.Request) (interface{}, error) { cmd := btcjson.QuorumCmd{} - err := unmarshalCmd(req, &cmd.SubCmd, &cmd.LLMQType, &cmd.RequestID, &cmd.MessageHash, &cmd.QuorumHash, &cmd.Submit) + err := unmarshalCmd(req, &cmd.SubCmd, &cmd.RequestID, &cmd.MessageHash, &cmd.QuorumHash, &cmd.Submit) if err != nil { return nil, err } + cmd.LLMQType = &quorumType + return cs.QuorumSign(ctx, cmd), nil }) return func(srv *JRPCServer) { srv. - On("quorum sign"). + On("quorum platformsign"). Expect(And(Debug())). Times(times). Respond(call, JSONContentType()) @@ -100,7 +102,7 @@ func WithMasternodeMethod(cs CoreServer, times int) MethodFunc { // WithGetNetworkInfoMethod ... func WithGetNetworkInfoMethod(cs CoreServer, times int) MethodFunc { - call := OnMethod(func(ctx context.Context, req btcjson.Request) (interface{}, error) { + call := OnMethod(func(ctx context.Context, _req btcjson.Request) (interface{}, error) { cmd := btcjson.GetNetworkInfoCmd{} return cs.GetNetworkInfo(ctx, cmd), nil }) @@ -115,7 +117,7 @@ func WithGetNetworkInfoMethod(cs CoreServer, times int) MethodFunc { // WithPingMethod ... func WithPingMethod(cs CoreServer, times int) MethodFunc { - call := OnMethod(func(ctx context.Context, req btcjson.Request) (interface{}, error) { + call := OnMethod(func(ctx context.Context, _req btcjson.Request) (interface{}, error) { cmd := btcjson.PingCmd{} return cs.Ping(ctx, cmd), nil })