Skip to content

Commit

Permalink
consensus: use better dbFT
Browse files Browse the repository at this point in the history
Fetch fresh dbft version with minor adjustments.

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Mar 25, 2024
1 parent f3b6363 commit 82d6cb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions pkg/consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)

Check warning on line 213 in pkg/consensus/consensus.go

View check run for this annotation

Codecov / codecov/patch

pkg/consensus/consensus.go#L213

Added line #L213 was not covered by tests
}

return srv, nil
Expand Down

0 comments on commit 82d6cb8

Please sign in to comment.