Skip to content

Commit

Permalink
Merge branch 'main' into conistent-rnage
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id authored Jul 26, 2024
2 parents afd91f3 + 1e71630 commit cb8a383
Show file tree
Hide file tree
Showing 56 changed files with 959 additions and 208 deletions.
9 changes: 9 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ pull_request_rules:
backport:
branches:
- v0.34.x-celestia

- name: Backport to main
conditions:
- label=S:backport-to-main
- merged
actions:
backport:
branches:
- main
2 changes: 1 addition & 1 deletion .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.3"
go-version: "1.22.4"

- uses: actions/checkout@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.22.3"
go-version: "1.22.4"
- name: Create a file with all the pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.3"
go-version: "1.22.4"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand All @@ -70,7 +70,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.3"
go-version: "1.22.4"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-nightly-34x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: "1.22.3"
go-version: "1.22.4"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

# Similar check to ./release-version.yml, but enforces this when pushing
# tags. The ./release-version.yml check can be bypassed and is mainly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

- name: Check version
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: '1.22.3'
go-version: '1.22.4'

- name: Generate release notes
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.3"
go-version: "1.22.4"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
# steps:
# - uses: actions/setup-go@v3
# with:
# go-version: "1.22.3"
# go-version: "1.22.4"
# - uses: actions/checkout@v3
# - uses: technote-space/get-diff-action@v6
# with:
Expand Down
2 changes: 1 addition & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use a build arg to ensure that both stages use the same,
# hopefully current, go version.
ARG GOLANG_BASE_IMAGE=golang:1.22.3-alpine
ARG GOLANG_BASE_IMAGE=golang:1.22.4-alpine

# stage 1 Generate CometBFT Binary
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This repo intends on preserving the minimal possible diff with [cometbft/cometbf
- **specific to Celestia**: consider if [celestia-app](https://github.com/celestiaorg/celestia-app) is a better target
- **not specific to Celestia**: consider making the contribution upstream in CometBFT

1. [Install Go](https://go.dev/doc/install) 1.22.3+
1. [Install Go](https://go.dev/doc/install) 1.22.4+
2. Fork this repo
3. Clone your fork
4. Find an issue to work on (see [good first issues](https://github.com/celestiaorg/celestia-core/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22))
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ type InstrumentationConfig struct {
// pyroscope continuous profiling server.
PyroscopeURL string `mapstructure:"pyroscope_url"`

// PyroscopeProfile is a flag that enables tracing with pyroscope.
// PyroscopeTrace is a flag that enables tracing with pyroscope.
PyroscopeTrace bool `mapstructure:"pyroscope_trace"`

// PyroscopeProfileTypes is a list of profile types to be traced with
Expand Down
2 changes: 1 addition & 1 deletion consensus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type Metrics struct {
// was relevant to the block the node is trying to gather or not.
BlockGossipPartsReceived metrics.Counter

// QuroumPrevoteMessageDelay is the interval in seconds between the proposal
// QuorumPrevoteMessageDelay is the interval in seconds between the proposal
// timestamp and the timestamp of the earliest prevote that achieved a quorum
// during the prevote step.
//
Expand Down
2 changes: 1 addition & 1 deletion consensus/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (h *Handshaker) replayBlock(state sm.State, height int64, proxyApp proxy.Ap

// Use stubs for both mempool and evidence pool since no transactions nor
// evidence are needed here - block already exists.
blockExec := sm.NewBlockExecutor(h.stateStore, h.logger, proxyApp, emptyMempool{}, sm.EmptyEvidencePool{})
blockExec := sm.NewBlockExecutor(h.stateStore, h.logger, proxyApp, emptyMempool{}, sm.EmptyEvidencePool{}, sm.WithBlockStore(h.store))
blockExec.SetEventBus(h.eventBus)

var err error
Expand Down
2 changes: 1 addition & 1 deletion consensus/replay_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func newConsensusStateForReplay(config cfg.BaseConfig, csConfig *cfg.ConsensusCo
}

mempool, evpool := emptyMempool{}, sm.EmptyEvidencePool{}
blockExec := sm.NewBlockExecutor(stateStore, log.TestingLogger(), proxyApp.Consensus(), mempool, evpool)
blockExec := sm.NewBlockExecutor(stateStore, log.TestingLogger(), proxyApp.Consensus(), mempool, evpool, sm.WithBlockStore(blockStore))

consensusState := NewState(csConfig, state.Copy(), blockExec,
blockStore, mempool, evpool)
Expand Down
6 changes: 4 additions & 2 deletions consensus/replay_stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ func (emptyMempool) TxsBytes() int64 { return 0 }
func (emptyMempool) TxsFront() *clist.CElement { return nil }
func (emptyMempool) TxsWaitChan() <-chan struct{} { return nil }

func (emptyMempool) InitWAL() error { return nil }
func (emptyMempool) CloseWAL() {}
func (emptyMempool) InitWAL() error { return nil }
func (emptyMempool) CloseWAL() {}
func (emptyMempool) GetTxByKey(types.TxKey) (types.Tx, bool) { return nil, false }
func (emptyMempool) WasRecentlyEvicted(types.TxKey) bool { return false }

//-----------------------------------------------------------------------------
// mockProxyApp uses ABCIResponses to give the right results.
Expand Down
14 changes: 9 additions & 5 deletions consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestMain(m *testing.M) {
// the `Handshake Tests` are for failures in applying the block.
// With the help of the WAL, we can recover from it all!

//------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// WAL Tests

// TODO: It would be better to verify explicitly which states we can recover from without the wal
Expand Down Expand Up @@ -320,7 +320,7 @@ var (
sim testSim
)

//---------------------------------------
// ---------------------------------------
// Test handshake/replay

// 0 - all synced up
Expand Down Expand Up @@ -1041,7 +1041,7 @@ func (app *badApp) Commit() abci.ResponseCommit {
panic("either allHashesAreWrong or onlyLastHashIsWrong must be set")
}

//--------------------------
// --------------------------
// utils for making blocks

func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) {
Expand Down Expand Up @@ -1187,8 +1187,9 @@ func stateAndStore(
return stateDB, state, store
}

//----------------------------------
// ----------------------------------
// mock block store
var _ sm.BlockStore = &mockBlockStore{}

type mockBlockStore struct {
config *cfg.Config
Expand Down Expand Up @@ -1222,6 +1223,9 @@ func (bs *mockBlockStore) LoadBlockMeta(height int64) *types.BlockMeta {
func (bs *mockBlockStore) LoadBlockPart(height int64, index int) *types.Part { return nil }
func (bs *mockBlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) {
}
func (bs *mockBlockStore) SaveTxInfo(block *types.Block, txResponseCode []uint32) error {
return nil
}
func (bs *mockBlockStore) LoadTxInfo(hash []byte) *cmtstore.TxInfo { return &cmtstore.TxInfo{} }

func (bs *mockBlockStore) LoadBlockCommit(height int64) *types.Commit {
Expand All @@ -1245,7 +1249,7 @@ func (bs *mockBlockStore) PruneBlocks(height int64) (uint64, error) {

func (bs *mockBlockStore) DeleteLatestBlock() error { return nil }

//---------------------------------------
// ---------------------------------------
// Test handshake/init chain

func TestHandshakeUpdatesValidators(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion consensus/wal_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) {
})
mempool := emptyMempool{}
evpool := sm.EmptyEvidencePool{}
blockExec := sm.NewBlockExecutor(stateStore, log.TestingLogger(), proxyApp.Consensus(), mempool, evpool)
blockExec := sm.NewBlockExecutor(stateStore, log.TestingLogger(), proxyApp.Consensus(), mempool, evpool, sm.WithBlockStore(blockStore))
consensusState := NewState(config.Consensus, state.Copy(), blockExec, blockStore, mempool, evpool)
consensusState.SetLogger(logger)
consensusState.SetEventBus(eventBus)
Expand Down
21 changes: 11 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cometbft/cometbft

go 1.22.3
go 1.22.4

require (
github.com/BurntSushi/toml v1.2.1
Expand All @@ -12,7 +12,7 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.2.1
github.com/btcsuite/btcd/btcutil v1.1.2
github.com/bufbuild/buf v1.9.0
github.com/celestiaorg/nmt v0.21.0
github.com/celestiaorg/nmt v0.22.0
github.com/cometbft/cometbft-db v0.7.0
github.com/creachadair/taskgroup v0.3.2
github.com/fortytw2/leaktest v1.3.0
Expand All @@ -22,6 +22,7 @@ require (
github.com/go-logfmt/logfmt v0.5.1
github.com/gofrs/uuid v4.3.0+incompatible
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.5.3
github.com/golangci/golangci-lint v1.50.1
github.com/google/orderedcode v0.0.1
Expand Down Expand Up @@ -49,8 +50,8 @@ require (
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0
go.opentelemetry.io/otel/sdk v1.21.0
golang.org/x/crypto v0.21.0
golang.org/x/net v0.23.0
golang.org/x/crypto v0.24.0
golang.org/x/net v0.26.0
gonum.org/v1/gonum v0.8.2
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -275,12 +276,12 @@ require (
go.uber.org/zap v1.23.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand Down
Loading

0 comments on commit cb8a383

Please sign in to comment.