Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ linters:
- github.com/stretchr/testify/require
- github.com/syndtr/goleveldb
- github.com/decred/dcrd/dcrec/secp256k1/v4
- github.com/supranational/blst/bindings/go
- google.golang.org/grpc
- google.golang.org/protobuf/proto
- golang.org/x/sync
Expand Down Expand Up @@ -81,6 +82,7 @@ linters:
- github.com/spf13
- github.com/stretchr/testify
- github.com/decred/dcrd/dcrec/secp256k1/v4
- github.com/supranational/blst/bindings/go
- google.golang.org/grpc
- google.golang.org/protobuf/proto
- google.golang.org/protobuf/types/known/timestampp
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,37 @@

### API-BREAKING

## Berachain fork (unreleased)

_Berachain-specific changes layered on top of upstream CometBFT, based on upstream cometbft
v0.39.3 (`49b82838f`). These ports keep consensus sign/state bytes byte-compatible with the
bera-v1.x line, so an existing bera-v1.x network can restart on this binary (consensus-compatible
with bera-v1.x networks). Upstream backports are tracked in the sections above. At release, this
section becomes `## v0.39.3-bera.N`._

### FEATURES

- `[consensus,types,state]` Port Proposer-Based Timestamps (PBTS) from the bera-v1.x line.
Block timestamps are set by the proposer and validated against synchrony parameters instead of
the BFT-median of vote times; per-vote timestamps are removed. PBTS is always enabled on this fork.
([\#51](https://github.com/berachain/cometbft/pull/51))
- `[consensus,crypto,types]` Port BLS12-381 signature aggregation. For all-BLS validator sets,
precommit signatures are aggregated into a single commit that is gossiped whole and used for
fast catch-up of lagging nodes.
([\#51](https://github.com/berachain/cometbft/pull/51))
- `[state,abci]` Add `NextBlockDelay` (ADR-115): the application controls the delay before the next
height starts, replacing the static `timeout_commit`. Also adds `next_proposer_address` to
`ProcessProposal`.
([\#51](https://github.com/berachain/cometbft/pull/51))

### STATE-BREAKING

- `[types,state]` New consensus parameters (`SynchronyParams`, `FeatureParams`) and the removal of
per-vote timestamps change consensus sign bytes and persisted-state encoding. These match the
bera-v1.x line byte-for-byte, so an existing bera-v1.x network can restart on this binary; the
encoding is not compatible with pristine upstream v0.39.x state.
([\#51](https://github.com/berachain/cometbft/pull/51))

## v0.39.3

*May 5, 2026*
Expand Down
542 changes: 328 additions & 214 deletions abci/types/types.pb.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions blocksync/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (r *Reactor) respondToPeer(msg *bcproto.BlockRequest, src p2p.Peer) {
}

var extCommit *types.ExtendedCommit
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(msg.Height) {
if state.ConsensusParams.Feature.VoteExtensionsEnabled(msg.Height) {
extCommit = r.store.LoadBlockExtendedCommit(msg.Height)
if extCommit == nil {
r.Logger.Error("Found block in store with no extended commit", "block", block)
Expand Down Expand Up @@ -456,7 +456,7 @@ FOR_LOOP:
//
missingExtension := true
if state.LastBlockHeight == 0 ||
!state.ConsensusParams.ABCI.VoteExtensionsEnabled(state.LastBlockHeight) ||
!state.ConsensusParams.Feature.VoteExtensionsEnabled(state.LastBlockHeight) ||
blocksSynced > 0 ||
initialCommitHasExtensions {
missingExtension = false
Expand Down Expand Up @@ -551,7 +551,7 @@ FOR_LOOP:

// vote extension validations
presentExtCommit := extCommit != nil
extensionsEnabled := state.ConsensusParams.ABCI.VoteExtensionsEnabled(first.Height)
extensionsEnabled := state.ConsensusParams.Feature.VoteExtensionsEnabled(first.Height)

if presentExtCommit != extensionsEnabled {
err = fmt.Errorf("non-nil extended commit must be received iff vote extensions are enabled for its height "+
Expand Down
14 changes: 10 additions & 4 deletions blocksync/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func genesisDocWithValsPowers(powers []int64) (*types.GenesisDoc, []types.PrivVa
sort.Sort(types.PrivValidatorsByAddress(privValidators))

consPar := types.DefaultConsensusParams()
consPar.ABCI.VoteExtensionsEnableHeight = 1
consPar.Feature.VoteExtensionsEnableHeight = 1
return &types.GenesisDoc{
GenesisTime: cmttime.Now(),
ChainID: test.DefaultTestChainID,
Expand Down Expand Up @@ -161,12 +161,18 @@ func newReactor(

// let's add some blocks in
for blockHeight := int64(1); blockHeight <= maxBlockHeight; blockHeight++ {
voteExtensionIsEnabled := genDoc.ConsensusParams.ABCI.VoteExtensionsEnabled(blockHeight)
voteExtensionIsEnabled := genDoc.ConsensusParams.Feature.VoteExtensionsEnabled(blockHeight)

lastExtCommit := seenExtCommit.Clone()

thisBlock, err := state.MakeBlock(blockHeight, nil, lastExtCommit.ToCommit(), nil, state.Validators.Proposer.Address)
require.NoError(t, err)
if options.deterministicVoteTimes {
// Under PBTS the proposer stamps the block with its wall clock;
// pin it so independently constructed test chains with the same
// genesis produce identical block IDs and LastBlockID links.
thisBlock.Time = genDoc.GenesisTime.Add(time.Duration(blockHeight) * time.Second)
}

thisParts, err := thisBlock.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err)
Expand Down Expand Up @@ -432,7 +438,7 @@ func ExtendedCommitNetworkHelper(t *testing.T, maxBlockHeight int64, enableVoteE
config = test.ResetTestRoot("blocksync_reactor_test")
defer os.RemoveAll(config.RootDir)
genDoc, privVals := genesisDocWithValsPowers(valPowers)
genDoc.ConsensusParams.ABCI.VoteExtensionsEnableHeight = enableVoteExtensionAt
genDoc.ConsensusParams.Feature.VoteExtensionsEnableHeight = enableVoteExtensionAt

reactorPairs := make([]ReactorPair, 1, 2)
reactorPairs[0] = newReactor(t, log.TestingLogger(), genDoc, privVals, 0)
Expand Down Expand Up @@ -554,7 +560,7 @@ func (bcR *ByzantineReactor) respondToPeer(msg *bcproto.BlockRequest, src p2p.Pe
return false
}
var extCommit *types.ExtendedCommit
voteExtensionEnabled := state.ConsensusParams.ABCI.VoteExtensionsEnabled(msg.Height)
voteExtensionEnabled := state.ConsensusParams.Feature.VoteExtensionsEnabled(msg.Height)
incorrectBlock := bcR.corruptedBlock == msg.Height
if voteExtensionEnabled && !incorrectBlock || !voteExtensionEnabled && incorrectBlock {
extCommit = bcR.store.LoadBlockExtendedCommit(msg.Height)
Expand Down
1 change: 1 addition & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ plugins:
opt:
- Mgoogle/protobuf/timestamp.proto=github.com/cosmos/gogoproto/types
- Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration
- Mgoogle/protobuf/wrappers.proto=github.com/cosmos/gogoproto/types
- plugins=grpc
- paths=source_relative
Loading
Loading