Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Behaviour changes:
* transactions management refactoring implied library API changes (#164)
* add a separate `DBFT` generic parameter for transaction slice type
specificatoin (#165)
* transaction duplicates in the proposal are not supported any more (#164, #167)
Comment thread
roman-khimov marked this conversation as resolved.
Resolved

Improvements:
* minimum required Go version is 1.26 (#144, #156, #162)
Expand Down
5 changes: 3 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ type Config[H Hash, Tx Transaction[H]] struct {
// StopTxFlow is a callback which is called when the process no longer needs
// any transactions.
StopTxFlow func()
// GetVerified returns a slice of verified transactions
// to be proposed in a new block.
// GetVerified returns a slice of verified transactions to be proposed in a
// new block. It's a caller's responsibility to check for the duplicates in
// the proposed set of transactions.
GetVerified func() []Tx
// VerifyPreBlock verifies if preBlock is valid.
VerifyPreBlock func(b PreBlock[H, Tx]) bool
Expand Down
1 change: 1 addition & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type Context[H Hash, Tx Transaction[H]] struct {
Timestamp uint64
Nonce uint64
// Transactions is a slice containing actual transactions for the current block.
// Duplicates are no-op and will lead to improper block construction.
Transactions []Tx
// MissingTransactions is a map of a missing transaction hash to its index in
// the slice of proposed transactions for the current block. This map is
Expand Down
2 changes: 2 additions & 0 deletions prepare_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ type PrepareRequest[H Hash, Tx Transaction[H]] interface {
// Transactions returns the list of all transactions in a proposed block
// with possible gaps in place of missing transactions and the map of
// missing transaction hashes to their indexes in the proposal list.
// Transaction duplicates are no-op and will lead to improper block
// construction.
Transactions() ([]Tx, map[H]int)
}
Loading