Skip to content

Commit

Permalink
preblock: drop Hash()
Browse files Browse the repository at this point in the history
For a single height/view there is a single proper hash and it's not a final
block hash, likely logging it won't help much. Can be done in future if needed,
but let's have view number for now.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Jul 30, 2024
1 parent 5867a3b commit 438f9df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,10 @@ func (d *DBFT[H]) checkPreCommit() {
}

d.preBlock = d.CreatePreBlock()
// TODO: Hash() holds a purely informational purpose (only used for logs).
// Need to uncomment this code and properly implement Hash() on PreBlock
// implementation, but for now let it be commented out.
//hash := d.preBlock.Hash()

d.Logger.Info("processing PreBlock",
zap.Uint32("height", d.BlockIndex),
//zap.Stringer("preBlock hash", hash),
zap.Uint("view", uint(d.ViewNumber)),
zap.Int("tx_count", len(d.preBlock.Transactions())))

if !d.preBlockProcessed {
Expand Down
5 changes: 0 additions & 5 deletions pre_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ package dbft
// It holds a "draft" of block that should be converted to a final block with the
// help of additional data held by PreCommit messages.
type PreBlock[H Hash] interface {
// TODO: used for logs only. Need to uncomment and properly implement this method
// for PreBlock implementation.
// Hash returns PreBlock hash.
// Hash() H // needed for informational log, but may be removed.

// Data returns PreBlock's data CNs need to exchange during PreCommit phase.
// Data represents additional information not related to a final block signature.
Data() []byte
Expand Down

0 comments on commit 438f9df

Please sign in to comment.