File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ New features:
9
9
Behaviour changes:
10
10
11
11
Improvements:
12
+ * timer adjustment for most of the consensus time, more accurate block
13
+ intervals (#55 )
12
14
13
15
Bugs fixed:
14
16
* inappropriate log on attempt to construct Commit for anti-MEV enabled WatchOnly
Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ import (
5
5
)
6
6
7
7
func (d * DBFT [H ]) checkPrepare () {
8
+ if d .lastBlockIndex != d .BlockIndex || d .lastBlockView != d .ViewNumber {
9
+ // Notice that lastBlockTimestamp is left unchanged because
10
+ // this must be the value from the last header.
11
+ d .lastBlockTime = d .Timer .Now ()
12
+ d .lastBlockIndex = d .BlockIndex
13
+ d .lastBlockView = d .ViewNumber
14
+ }
8
15
if ! d .hasAllTransactions () {
9
16
d .Logger .Debug ("check prepare: some transactions are missing" , zap .Any ("hashes" , d .MissingTransactions ))
10
17
return
@@ -138,8 +145,6 @@ func (d *DBFT[H]) checkCommit() {
138
145
d .Logger .Fatal ("block processing failed" , zap .Error (err ))
139
146
}
140
147
141
- d .lastBlockIndex = d .BlockIndex
142
- d .lastBlockTime = d .Timer .Now ()
143
148
d .blockProcessed = true
144
149
145
150
// Do not initialize consensus process immediately. It's the caller's duty to
Original file line number Diff line number Diff line change @@ -88,8 +88,9 @@ type Context[H Hash] struct {
88
88
LastSeenMessage []* HeightView
89
89
90
90
lastBlockTimestamp uint64 // ns-precision timestamp from the last header (used for the next block timestamp calculations).
91
- lastBlockTime time.Time // Wall clock time of when the last block was first seen (used for timer adjustments).
91
+ lastBlockTime time.Time // Wall clock time of when we started (as in PrepareRequest) creating the last block (used for timer adjustments).
92
92
lastBlockIndex uint32
93
+ lastBlockView byte
93
94
}
94
95
95
96
// N returns total number of validators.
You can’t perform that action at this time.
0 commit comments