Skip to content

Commit

Permalink
Merge branch 'v0.34.x-celestia' into quic-initial-changes
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
rach-id committed Sep 20, 2024
2 parents 196919f + 0abc1de commit 00de160
Show file tree
Hide file tree
Showing 105 changed files with 857 additions and 905 deletions.
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.5"
go-version: "1.23.1"

- uses: actions/checkout@v4
with:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.23.1"
- name: Create a file with all the pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
run: split -d -n l/4 pkgs.txt pkgs.txt.part.
# cache multiple
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-00"
path: ./pkgs.txt.part.00
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-01"
path: ./pkgs.txt.part.01
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-02"
path: ./pkgs.txt.part.02
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-03"
path: ./pkgs.txt.part.03
Expand All @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.23.1"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand All @@ -70,23 +70,23 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.5"
go-version: "1.23.1"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-${{ matrix.part }}"
if: env.GIT_DIFF
- name: test & coverage report creation
run: |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 8m -race -coverprofile=${{ matrix.part }}profile.out -covermode=atomic
if: env.GIT_DIFF
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
Expand All @@ -102,19 +102,19 @@ jobs:
**/**.go
go.mod
go.sum
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-00-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-01-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-02-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-03-coverage"
if: env.GIT_DIFF
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.5'
go-version: '1.23.1'

- uses: actions/checkout@v4

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.5'
go-version: '1.23.1'

- uses: actions/checkout@v4
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.5'
go-version: '1.23.1'
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
6 changes: 3 additions & 3 deletions .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.5'
go-version: '1.23.1'

- uses: actions/checkout@v4

Expand Down Expand Up @@ -45,14 +45,14 @@ jobs:
continue-on-error: true

- name: Archive crashers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: crashers
path: test/fuzz/**/crashers
retention-days: 1

- name: Archive suppressions
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: suppressions
path: test/fuzz/**/suppressions
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.5"
go-version: "1.23.1"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ jobs:
timeout-minutes: 8
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- uses: golangci/golangci-lint-action@v4.0.0
- uses: golangci/golangci-lint-action@v6.1.0
with:
# Required: the version of golangci-lint is required and
# must be specified without patch version: we always use the
# latest patch version.
version: v1.56.2
version: v1.61.0
args: --timeout 10m
github-token: ${{ secrets.github_token }}
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.5'
go-version: '1.23.1'

# 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.5'
go-version: '1.23.1'

- 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.5'
go-version: '1.23.1'

- name: Generate release notes
run: |
Expand Down
8 changes: 4 additions & 4 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.5"
go-version: "1.23.1"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.2"
go-version: "1.23.1"
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.22.2"
go-version: "1.23.1"
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
# steps:
# - uses: actions/setup-go@v3
# with:
# go-version: "1.22.5"
# go-version: "1.22.6"
# - 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.5-alpine
ARG GOLANG_BASE_IMAGE=golang:1.23.1-alpine

# stage 1 Generate CometBFT Binary
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ format:

lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 run
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run
.PHONY: lint

vulncheck:
Expand Down Expand Up @@ -316,12 +316,12 @@ build_c-amazonlinux:
# Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
docker-compose up
docker compose up
.PHONY: localnet-start

# Stop testnet
localnet-stop:
docker-compose down
docker compose down
.PHONY: localnet-stop

# Build hooks for dredd, to skip or add information on some steps
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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.5+
1. [Install Go](https://go.dev/doc/install) 1.23.1+
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 abci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To get up and running quickly, see the [getting started guide](../docs/app-dev/g
A detailed description of the ABCI methods and message types is contained in:

- [The main spec](https://github.com/cometbft/cometbft/blob/v0.34.x/spec/abci/README.md)
- [A protobuf file](./types/types.proto)
- [A protobuf file](../proto/abci/types.proto)
- [A Go interface](./types/application.go)

## Protocol Buffers
Expand Down
1 change: 1 addition & 0 deletions abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (cli *grpcClient) OnStart() error {

RETRY_LOOP:
for {
//nolint:staticcheck
conn, err := grpc.Dial(cli.addr, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(dialerFunc))
if err != nil {
if cli.mustConnect {
Expand Down
3 changes: 3 additions & 0 deletions abci/example/counter/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli
tx8 := make([]byte, 8)
copy(tx8[len(tx8)-len(req.Tx):], req.Tx)
txValue := binary.BigEndian.Uint64(tx8)
//nolint:gosec
if txValue != uint64(app.txCount) {
return types.ResponseDeliverTx{
Code: code.CodeTypeBadNonce,
Expand All @@ -72,6 +73,7 @@ func (app *Application) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx
tx8 := make([]byte, 8)
copy(tx8[len(tx8)-len(req.Tx):], req.Tx)
txValue := binary.BigEndian.Uint64(tx8)
//nolint:gosec
if txValue < uint64(app.txCount) {
return types.ResponseCheckTx{
Code: code.CodeTypeBadNonce,
Expand All @@ -87,6 +89,7 @@ func (app *Application) Commit() (resp types.ResponseCommit) {
return types.ResponseCommit{}
}
hash := make([]byte, 8)
//nolint:gosec
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
return types.ResponseCommit{Data: hash}
}
Expand Down
1 change: 1 addition & 0 deletions blockchain/v2/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (mp mockPeer) RemoteAddr() net.Addr { return &net.TCPAddr{IP: mp.RemoteIP()

func (mp mockPeer) IsOutbound() bool { return true }
func (mp mockPeer) IsPersistent() bool { return true }
func (mp mockPeer) HasIPChanged() bool { return false }
func (mp mockPeer) CloseConn() error { return nil }

func (mp mockPeer) NodeInfo() p2p.NodeInfo {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cometbft/commands/debug/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func dumpCmdHandler(_ *cobra.Command, args []string) error {
cfg.EnsureRoot(conf.RootDir)

dumpDebugData(outDir, conf, rpc)

//nolint:gosec
ticker := time.NewTicker(time.Duration(frequency) * time.Second)
for range ticker.C {
dumpDebugData(outDir, conf, rpc)
Expand Down
1 change: 1 addition & 0 deletions cmd/cometbft/commands/debug/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ func writeStateJSONToFile(state interface{}, dir, filename string) error {
return fmt.Errorf("failed to encode state dump: %w", err)
}

//nolint:gosec
return os.WriteFile(path.Join(dir, filename), stateJSON, os.ModePerm)
}
1 change: 1 addition & 0 deletions cmd/cometbft/commands/debug/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ func dumpProfile(dir, addr, profile string, debug int) error {
return fmt.Errorf("failed to read %s profile response body: %w", profile, err)
}

//nolint:gosec
return os.WriteFile(path.Join(dir, fmt.Sprintf("%s.out", profile)), body, os.ModePerm)
}
1 change: 1 addition & 0 deletions cmd/cometbft/commands/reindex_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func eventReIndex(cmd *cobra.Command, args eventReIndexArgs) error {
for i := range b.Data.Txs {
tr := abcitypes.TxResult{
Height: b.Height,
//nolint:gosec
Index: uint32(i),
Tx: b.Data.Txs[i],
Result: *(r.DeliverTxs[i]),
Expand Down
4 changes: 2 additions & 2 deletions consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ func TestByzantineConflictingProposalsWithPartition(t *testing.T) {
case <-done:
case <-tick.C:
for i, reactor := range reactors {
t.Logf(fmt.Sprintf("Consensus Reactor %v", i))
t.Logf(fmt.Sprintf("%v", reactor))
t.Logf("Consensus Reactor %v", i)
t.Logf("%v", reactor)
}
t.Fatalf("Timed out waiting for all validators to commit first block")
}
Expand Down
2 changes: 2 additions & 0 deletions consensus/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (app *CounterApplication) Info(req abci.RequestInfo) abci.ResponseInfo {

func (app *CounterApplication) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
txValue := txAsUint64(req.Tx)
//nolint:gosec
if txValue != uint64(app.txCount) {
return abci.ResponseDeliverTx{
Code: code.CodeTypeBadNonce,
Expand Down Expand Up @@ -248,6 +249,7 @@ func (app *CounterApplication) Commit() abci.ResponseCommit {
return abci.ResponseCommit{}
}
hash := make([]byte, 8)
//nolint:gosec
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
return abci.ResponseCommit{Data: hash}
}
Expand Down
Loading

0 comments on commit 00de160

Please sign in to comment.