Skip to content

Commit

Permalink
*: remove NextConsensus mentions from dBFT API
Browse files Browse the repository at this point in the history
NextConsensus API is not used by the users of dBFT. NextConsensus
handling (proposal, verification and agrreement) is moved to the upper
level of dBFT users. Starting from this commit NextConsensus
verification should be performed by dBFT user manually in
WithVerifyPrepareRequest callback.

A part of #84.

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Mar 6, 2024
1 parent a2fdfa4 commit c283b80
Show file tree
Hide file tree
Showing 23 changed files with 312 additions and 387 deletions.
4 changes: 1 addition & 3 deletions block.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dbft

// Block is a generic interface for a block used by dbft.
type Block[H Hash, A Address] interface {
type Block[H Hash] interface {
// Hash returns block hash.
Hash() H

Expand All @@ -16,8 +16,6 @@ type Block[H Hash, A Address] interface {
Index() uint32
// ConsensusData is a random nonce.
ConsensusData() uint64
// NextConsensus returns hash of the validators of the next block.
NextConsensus() A

// Signature returns block's signature.
Signature() []byte
Expand Down
6 changes: 3 additions & 3 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"go.uber.org/zap"
)

func (d *DBFT[H, A]) checkPrepare() {
func (d *DBFT[H]) checkPrepare() {
if !d.hasAllTransactions() {
d.Logger.Debug("check prepare: some transactions are missing", zap.Any("hashes", d.MissingTransactions))
return
Expand Down Expand Up @@ -36,7 +36,7 @@ func (d *DBFT[H, A]) checkPrepare() {
}
}

func (d *DBFT[H, A]) checkCommit() {
func (d *DBFT[H]) checkCommit() {
if !d.hasAllTransactions() {
d.Logger.Debug("check commit: some transactions are missing", zap.Any("hashes", d.MissingTransactions))
return
Expand Down Expand Up @@ -77,7 +77,7 @@ func (d *DBFT[H, A]) checkCommit() {
// new height.
}

func (d *DBFT[H, A]) checkChangeView(view byte) {
func (d *DBFT[H]) checkChangeView(view byte) {
if d.ViewNumber >= view {
return
}
Expand Down
Loading

0 comments on commit c283b80

Please sign in to comment.