Skip to content

Commit

Permalink
chore(abci)!: remove Snapshot.core_chain_locked_height (#527)
Browse files Browse the repository at this point in the history
* chore(abci)!: remove Snapshot.core_chain_locked_height

* build: bump Golang to 1.19
  • Loading branch information
lklimek authored Dec 15, 2022
1 parent e787cf9 commit 467fb3b
Show file tree
Hide file tree
Showing 17 changed files with 268 additions and 306 deletions.
2 changes: 1 addition & 1 deletion .github/actions/bls/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
steps:
- uses: actions/setup-go@v2
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/checkout@v2
with:
submodules: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand All @@ -81,7 +81,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: '1.18'
go-version: '1.19'

- uses: actions/checkout@v3

Expand All @@ -44,7 +44,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: '1.18'
go-version: '1.19'

- uses: actions/checkout@v3
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 @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: '1.18'
go-version: '1.19'

- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: "1.18"
go-version: "1.19"
- uses: actions/checkout@v3
with:
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
submodules: true
- uses: actions/[email protected]
with:
go-version: '^1.18'
go-version: '^1.19'
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/[email protected]
with:
go-version: '1.18'
go-version: '1.19'

- name: Build
uses: goreleaser/goreleaser-action@v3
Expand Down
2 changes: 1 addition & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# stage 1 Generate Tenderdash Binary
FROM golang:1.18-alpine3.15 AS builder
FROM golang:1.19-alpine3.15 AS builder

RUN apk update && \
apk upgrade && \
Expand Down
503 changes: 233 additions & 270 deletions abci/types/types.pb.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/tutorials/go-built-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Verify that you have the latest version of Go installed:

```sh
$ go version
go version go1.18.x darwin/amd64
go version go1.19.x darwin/amd64
```

Note that the exact patch number may differ as Go releases come out.
Expand Down Expand Up @@ -592,7 +592,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten
```go
module github.com/<username>/kvstore
go 1.18
go 1.19
require (
github.com/dgraph-io/badger/v3 v3.2103.2
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Verify that you have the latest version of Go installed:

```sh
$ go version
go version go1.18.x darwin/amd64
go version go1.19.x darwin/amd64
```

## 1.2 Creating a new Go project
Expand Down Expand Up @@ -454,7 +454,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten
```go
module github.com/<username>/kvstore

go 1.18
go 1.19

require (
github.com/dgraph-io/badger/v3 v3.2103.2
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tendermint/tendermint

go 1.18
go 1.19

require (
github.com/BurntSushi/toml v1.2.0
Expand Down
23 changes: 12 additions & 11 deletions internal/statesync/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package statesync

import (
"crypto/sha256"
"fmt"
"encoding/binary"
"math/rand"
"sort"
"strings"
Expand All @@ -18,12 +18,11 @@ type snapshotKey [sha256.Size]byte

// snapshot contains data about a snapshot.
type snapshot struct {
Height uint64
CoreChainLockedHeight uint32
Format uint32
Chunks uint32
Hash tmbytes.HexBytes
Metadata []byte
Height uint64
Format uint32
Chunks uint32
Hash tmbytes.HexBytes
Metadata []byte

trustedAppHash tmbytes.HexBytes // populated by light client
}
Expand All @@ -34,10 +33,12 @@ type snapshot struct {
func (s *snapshot) Key() snapshotKey {
// Hash.Write() never returns an error.
hasher := sha256.New()
hasher.Write(
[]byte(fmt.Sprintf("%v:%v:%v:%v", s.Height, s.CoreChainLockedHeight, // ignore error
s.Format, s.Chunks)),
)

bz := make([]byte, 0, (64+32+32)/8)
bz = binary.LittleEndian.AppendUint64(bz, s.Height)
bz = binary.LittleEndian.AppendUint32(bz, s.Format)
bz = binary.LittleEndian.AppendUint32(bz, s.Chunks)
hasher.Write(bz)
hasher.Write(s.Hash)
hasher.Write(s.Metadata)
var key snapshotKey
Expand Down
11 changes: 5 additions & 6 deletions proto/tendermint/abci/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,11 @@ message Misbehavior {
// State Sync Types

message Snapshot {
uint64 height = 1; // The height at which the snapshot was taken
uint32 format = 2; // The application-specific snapshot format
uint32 chunks = 3; // Number of chunks in the snapshot
bytes hash = 4; // Arbitrary snapshot hash, equal only if identical
bytes metadata = 5; // Arbitrary application metadata
uint32 core_chain_locked_height = 100; // The core chain locked height
uint64 height = 1; // The height at which the snapshot was taken
uint32 format = 2; // The application-specific snapshot format
uint32 chunks = 3; // Number of chunks in the snapshot
bytes hash = 4; // Arbitrary snapshot hash, equal only if identical
bytes metadata = 5; // Arbitrary application metadata
}

//----------------------------------------
Expand Down
1 change: 0 additions & 1 deletion spec/abci++/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ nondeterministic |
| chunks | [uint32](#uint32) | | Number of chunks in the snapshot |
| hash | [bytes](#bytes) | | Arbitrary snapshot hash, equal only if identical |
| metadata | [bytes](#bytes) | | Arbitrary application metadata |
| core_chain_locked_height | [uint32](#uint32) | | The core chain locked height |



Expand Down
2 changes: 1 addition & 1 deletion test/e2e/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We need to build in a Linux environment to support C libraries, e.g. RocksDB.
# We use Debian instead of Alpine, so that we can use binary database packages
# instead of spending time compiling them.
FROM golang:1.18-bullseye
FROM golang:1.19-bullseye

RUN apt-get -qq update -y && apt-get -qq upgrade -y >/dev/null
RUN apt-get -qq install -y cmake sudo libgmp-dev libleveldb-dev librocksdb-dev >/dev/null
Expand Down
2 changes: 1 addition & 1 deletion test/fuzz/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fuzz

Fuzzing for various packages in Tendermint using the fuzzing infrastructure included in
Go 1.18.
Go 1.19.

Inputs:

Expand Down

0 comments on commit 467fb3b

Please sign in to comment.