From beee2605a30991c58c9bbd6e855d4e2ef7ae483a Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 22 Mar 2024 10:49:45 +0300 Subject: [PATCH] consensus: use better dbFT Fetch fresh dbft version with minor adjustments. Signed-off-by: Anna Shaleva --- go.mod | 2 +- go.sum | 4 ++-- pkg/consensus/consensus.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 0571c9313..b677ffe66 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/holiman/uint256 v1.2.4 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/mr-tron/base58 v1.2.0 - github.com/nspcc-dev/dbft v0.1.1-0.20240311071455-88b2f18461e5 + github.com/nspcc-dev/dbft v0.1.1-0.20240321205542-332ff86ba4c6 github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231127165613-b35f351f0ba0 github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.11 diff --git a/go.sum b/go.sum index 64d0a72b9..ed4d95cae 100644 --- a/go.sum +++ b/go.sum @@ -88,8 +88,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/nspcc-dev/dbft v0.1.1-0.20240311071455-88b2f18461e5 h1:XK88zeGFqO/43ZTwHbNSisgxuvExYp8DB/TMbjfw1yk= -github.com/nspcc-dev/dbft v0.1.1-0.20240311071455-88b2f18461e5/go.mod h1:oFE6paSC/yfFh9mcNU6MheMGOYXK9+sPiRk3YMoz49o= +github.com/nspcc-dev/dbft v0.1.1-0.20240321205542-332ff86ba4c6 h1:6rpKY0AvXQpL2ZpLTxGDJAM54ak6ziXghi4uLGUrSdg= +github.com/nspcc-dev/dbft v0.1.1-0.20240321205542-332ff86ba4c6/go.mod h1:oFE6paSC/yfFh9mcNU6MheMGOYXK9+sPiRk3YMoz49o= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 h1:mD9hU3v+zJcnHAVmHnZKt3I++tvn30gBj2rP2PocZMk= github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2/go.mod h1:U5VfmPNM88P4RORFb6KSUVBdJBDhlqggJZYGXGPxOcc= github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y= diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 0518d44a7..f77778ed4 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -179,7 +179,7 @@ func NewService(cfg Config) (Service, error) { } } - srv.dbft = dbft.New[util.Uint256]( + srv.dbft, err = dbft.New[util.Uint256]( dbft.WithTimer[util.Uint256](timer.New()), dbft.WithLogger[util.Uint256](srv.log), dbft.WithSecondsPerBlock[util.Uint256](cfg.TimePerBlock), @@ -209,8 +209,8 @@ func NewService(cfg Config) (Service, error) { dbft.WithVerifyPrepareResponse[util.Uint256](srv.verifyResponse), ) - if srv.dbft == nil { - return nil, errors.New("can't initialize dBFT") + if err != nil { + return nil, fmt.Errorf("can't initialize dBFT: %w", err) } return srv, nil