Skip to content

Commit 16461bc

Browse files
authored
Merge pull request #151 from nspcc-dev/rel-0.4.0
2 parents 8a5c43b + 4540dda commit 16461bc

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

CHANGELOG.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ This document outlines major changes between releases.
44

55
## [Unreleased]
66

7+
New features:
8+
9+
Behaviour changes:
10+
11+
Improvements:
12+
13+
Bugs fixed:
14+
15+
## [0.4.0] (17 July 2025)
16+
17+
This release contains two major changes. First one introduces an ability to
18+
change block generation time every block. This change is triggered by the
19+
transfer of `TimePerBlock` setting to native Policy contract on N3 protocol
20+
which makes this value variable throughout the network lifetime. The second
21+
change allows to vary block generation time from `TimePerBlock` (when there are
22+
some transactions in the network and hence, it's beneficial to accept block as
23+
soon as possible) to `MaxTimePerBlock` (when there are no transactions, but
24+
consensus still needs to take care of the network heartbeat). This change is
25+
beneficial for custom networks with small `TimePerBlock` values to prevent the
26+
chain size explosion. Also, this release contains Go version upgrade to 1.23.
27+
728
New features:
829
* `MaxTimePerBlock` and `SubscribeForTxs` configuration parameters are added
930
to support dynamic block time extension (#150)
@@ -14,8 +35,6 @@ Behaviour changes:
1435
Improvements:
1536
* minimum required Go version is 1.23 now (#145)
1637

17-
Bugs fixed:
18-
1938
## [0.3.2] (30 January 2025)
2039

2140
Important dBFT timer adjustments are included into this patch-release. The first one
@@ -119,6 +138,7 @@ Improvements:
119138
Stable dbft 2.0 implementation.
120139

121140
[Unreleased]: https://github.com/nspcc-dev/dbft/compare/v0.3.2...master
141+
[0.4.0]: https://github.com/nspcc-dev/dbft/releases/v0.4.0
122142
[0.3.2]: https://github.com/nspcc-dev/dbft/releases/v0.3.2
123143
[0.3.1]: https://github.com/nspcc-dev/dbft/releases/v0.3.1
124144
[0.3.0]: https://github.com/nspcc-dev/dbft/releases/v0.3.0

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ for more details.
3838

3939
## Usage
4040
A client of the library must implement its own event loop.
41-
The library provides 5 callbacks that change the state of the consensus
41+
The library provides 6 callbacks that change the state of the consensus
4242
process:
4343
- `Start()` which initializes internal dBFT structures
4444
- `Reset()` which reinitializes the consensus process
45-
- `OnTransaction()` which must be called everytime new transaction appears
45+
- `OnTransaction()` which must be called everytime new transaction from the list
46+
of proposed transactions appears
47+
- `OnNewTransaction()` which is an extension supplying dynamic block time
48+
functionality and must be called everytime new transaction comes to the node's
49+
memory pool if dynamic block time extension is enabled
4650
- `OnReceive()` which must be called everytime new payload is received
4751
- `OnTimer()` which must be called everytime timer fires
4852

dbft.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ func (d *DBFT[H]) initializeConsensus(view byte, ts uint64) {
159159
d.changeTimer(timeout)
160160
}
161161

162-
// OnTransaction notifies service about receiving new transaction.
162+
// OnTransaction notifies service about receiving new transaction from the
163+
// proposed list of transactions.
163164
func (d *DBFT[H]) OnTransaction(tx Transaction[H]) {
164165
// d.Logger.Debug("OnTransaction",
165166
// zap.Bool("backup", d.IsBackup()),

0 commit comments

Comments
 (0)