Skip to content

Commit 9b90017

Browse files
committed
sql: store ballots, blocks and layers in sqlite (#3047)
## Motivation The existing approach lacks atomicity, causal durability (e.g. an atx may not be on disk when a ballot is saved), and the durability can't be enforced in general without running every leveldb operation in sync mode. All this problems will result in subtle bugs that are hard to diagnose. For those 3 requirements, we want to maintain all state in a single db. Moving state to a single leveldb will require us to enforce isolation ourselves (by maintaining separate namespace and manually concatenating keys like we do in some modules), beside that we have to create every single index manually while with sqlite we can just do `CREATE INDEX` and sqlite will do it for us and probably do a better job. Another significant benefit is that we can duplicate some state in sql table to avoid loading the whole structure into memory. For instance it will be relevant for atx, which is a large (10kb) and usually, after it was validated, we want to know only the associated smesher and weight of the atx. This would be problematic with leveldb, and would require adding custom index. related: #2918 ## Changes - general plumbing for core database stuff (db, transaction, migrations) using https://github.com/crawshaw/sqlite that is a relatively simple wrapper around C sqlite - tables and for layers, blocks and ballots - reworked ZeroLayer, it is relevant only for hare_output, which can be in 3 states - nil, empty, non-empty. SetZeroLayer update hare_output to empty state, at which tortoise will vote against all blocks within hdist. - updated to golang 1.16 for `embed` module. note that there is a bug with go mode tidy in 1.16 so i had to manually fix go.sum and disable go mod tidy on ci - golang/go#44129 ## Test Plan existing and new uts
1 parent 2df35be commit 9b90017

38 files changed

+1313
-518
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI
22

33
env:
4-
go-version: '1.15.13'
4+
go-version: '1.17.6'
55
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
66
PROJECT_NAME: ${{ secrets.PROJECT_NAME }}
77
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
@@ -63,7 +63,7 @@ jobs:
6363
- name: fmt, tidy, lint
6464
run: |
6565
make
66-
make test-tidy
66+
make tidy
6767
make test-fmt
6868
make lint
6969

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Go
2121
uses: actions/setup-go@v1
2222
with:
23-
go-version: '1.15.13'
23+
go-version: '1.17.6'
2424

2525
- if: matrix.os == 'windows-latest'
2626
name: Install dependencies in windows

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ output:
6060
linters-settings:
6161
staticcheck:
6262
# Select the Go version to target. The default is '1.13'.
63-
go: "1.15"
63+
go: "1.17"
6464
# https://staticcheck.io/docs/options#checks
6565
checks: [ "all" ]
6666

@@ -168,7 +168,7 @@ linters-settings:
168168
capital: false
169169
gofumpt:
170170
# Select the Go version to target. The default is `1.15`.
171-
lang-version: "1.15"
171+
lang-version: "1.17"
172172
# Choose whether or not to use the extra rules that are disabled
173173
# by default
174174
extra-rules: false
@@ -208,7 +208,7 @@ linters:
208208
- misspell
209209
- staticcheck
210210
- whitespace
211-
- wrapcheck
211+
# - wrapcheck
212212
# - varcheck
213213
# - unparam
214214
# - deadcode

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ LABEL com.nvidia.volumes.needed="nvidia_driver"
3333

3434
FROM linux as golang
3535
ENV GOLANG_MAJOR_VERSION 1
36-
ENV GOLANG_MINOR_VERSION 15
37-
ENV GOLANG_PATCH_VERSION 14
36+
ENV GOLANG_MINOR_VERSION 17
37+
ENV GOLANG_PATCH_VERSION 6
3838
ENV GOLANG_VERSION $GOLANG_MAJOR_VERSION.$GOLANG_MINOR_VERSION.$GOLANG_PATCH_VERSION
3939
ENV GOPATH /go
4040
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ else
8686
endif
8787

8888
install:
89-
go run scripts/check-go-version.go --major 1 --minor 15
89+
go run scripts/check-go-version.go --major 1 --minor 17
9090
go mod download
9191
GO111MODULE=off go get golang.org/x/lint/golint
9292
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
@@ -105,6 +105,10 @@ harness: get-gpu-setup
105105

106106
tidy:
107107
go mod tidy
108+
# NOTE(dshulyak) go mod tidy for some reason removes github.com/jessevdk/go-flags from indirect dependencies
109+
# starting from 1.16. similar issue was fixed in 1.17 https://github.com/golang/go/issues/44129
110+
# but apparently this is not exactly our case
111+
go get -d github.com/spacemeshos/[email protected]
108112
.PHONY: tidy
109113

110114
ifeq ($(HOST_OS),$(filter $(HOST_OS),linux darwin))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Since the project uses Go Modules it is best to place the code **outside** your
9696

9797
Building is supported on OS X, Linux, FreeBSD, and Windows.
9898

99-
Install [Go 1.15 or later](https://golang.org/dl/) for your platform, if you haven't already.
99+
Install [Go 1.17 or later](https://golang.org/dl/) for your platform, if you haven't already.
100100

101101
On Windows you need to install `make` via [msys2](https://www.msys2.org/), [MingGW-w64](http://mingw-w64.org/doku.php) or [mingw] (https://chocolatey.org/packages/mingw)
102102

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ clone_folder: c:\gopath\src\github.com\spacemeshos\go-spacemesh\
55
environment:
66
GOPATH: c:\gopath
77

8-
stack: go 1.15
8+
stack: go 1.17
99

1010
before_build:
1111
- choco install make

common/types/ballot.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@ func BallotIDsToHashes(ids []BallotID) []Hash32 {
250250
return hashes
251251
}
252252

253+
// NewExistingBallot creates ballot from stored data.
254+
func NewExistingBallot(id BallotID, sig []byte, pub []byte, inner InnerBallot) Ballot {
255+
return Ballot{
256+
ballotID: id,
257+
Signature: sig,
258+
smesherID: signing.NewPublicKey(pub),
259+
InnerBallot: inner,
260+
}
261+
}
262+
253263
// DBBallot is a Ballot structure as it is stored in DB.
254264
type DBBallot struct {
255265
InnerBallot

crypto/sha3/keccakf.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build !amd64 appengine gccgo
5+
//go:build !amd64 || appengine || gccgo
6+
// +build !amd64 appengine gccgo
67

78
package sha3
89

crypto/sha3/xor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build (!amd64 && !386 && !ppc64le) || appengine
56
// +build !amd64,!386,!ppc64le appengine
67

78
package sha3

go.mod

Lines changed: 103 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
module github.com/spacemeshos/go-spacemesh
22

33
require (
4+
crawshaw.io/sqlite v0.3.3-0.20211227050848-2cdb5c1a86a1
45
github.com/ALTree/bigfloat v0.0.0-20201218142103-4a33235224ec
5-
github.com/Microsoft/go-winio v0.4.14 // indirect
66
github.com/bits-and-blooms/bitset v1.2.0
77
github.com/btcsuite/btcd v0.22.0-beta
88
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
9-
github.com/fsnotify/fsnotify v1.5.1 // indirect
109
github.com/golang/mock v1.6.0
1110
github.com/golang/protobuf v1.5.2
12-
github.com/golang/snappy v0.0.3 // indirect
13-
github.com/google/go-cmp v0.5.6 // indirect
14-
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
1511
github.com/google/uuid v1.3.0
1612
github.com/grpc-ecosystem/grpc-gateway v1.16.0
1713
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
1814
github.com/ipfs/go-log/v2 v2.3.0
19-
github.com/klauspost/compress v1.13.5 // indirect
2015
github.com/libp2p/go-eventbus v0.2.1
2116
github.com/libp2p/go-libp2p v0.15.0
2217
github.com/libp2p/go-libp2p-connmgr v0.2.4
@@ -39,7 +34,6 @@ require (
3934
github.com/spacemeshos/poet v0.1.1-0.20201103004828-ef8f28a744fc
4035
github.com/spacemeshos/post v0.0.0-20211014030409-e1a8091bb648
4136
github.com/spacemeshos/sha256-simd v0.0.0-20190111104731-8575aafc88c9
42-
github.com/spf13/afero v1.2.0 // indirect
4337
github.com/spf13/cobra v1.0.0
4438
github.com/spf13/pflag v1.0.5
4539
github.com/spf13/viper v1.4.0
@@ -48,15 +42,112 @@ require (
4842
go.uber.org/atomic v1.9.0
4943
go.uber.org/zap v1.19.0
5044
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
51-
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
52-
golang.org/x/mod v0.5.0 // indirect
5345
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
5446
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
55-
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
56-
golang.org/x/tools v0.1.5 // indirect
5747
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987
5848
google.golang.org/grpc v1.40.0
5949
nanomsg.org/go-mangos v1.4.0
6050
)
6151

62-
go 1.15
52+
require (
53+
github.com/Microsoft/go-winio v0.4.14 // indirect
54+
github.com/benbjohnson/clock v1.1.0 // indirect
55+
github.com/beorn7/perks v1.0.1 // indirect
56+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
57+
github.com/davecgh/go-spew v1.1.1 // indirect
58+
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
59+
github.com/flynn/noise v1.0.0 // indirect
60+
github.com/fsnotify/fsnotify v1.5.1 // indirect
61+
github.com/gogo/protobuf v1.3.2 // indirect
62+
github.com/golang/snappy v0.0.3 // indirect
63+
github.com/google/go-cmp v0.5.6 // indirect
64+
github.com/google/gopacket v1.1.19 // indirect
65+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
66+
github.com/gorilla/websocket v1.4.2 // indirect
67+
github.com/hashicorp/hcl v1.0.0 // indirect
68+
github.com/huin/goupnp v1.0.2 // indirect
69+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
70+
github.com/ipfs/go-cid v0.0.7 // indirect
71+
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
72+
github.com/ipfs/go-log v1.0.5 // indirect
73+
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
74+
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
75+
github.com/jbenet/goprocess v0.1.4 // indirect
76+
github.com/jessevdk/go-flags v1.4.0 // indirect
77+
github.com/klauspost/compress v1.13.5 // indirect
78+
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
79+
github.com/koron/go-ssdp v0.0.2 // indirect
80+
github.com/libp2p/go-addr-util v0.1.0 // indirect
81+
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
82+
github.com/libp2p/go-conn-security-multistream v0.2.1 // indirect
83+
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
84+
github.com/libp2p/go-libp2p-autonat v0.4.2 // indirect
85+
github.com/libp2p/go-libp2p-blankhost v0.2.0 // indirect
86+
github.com/libp2p/go-libp2p-circuit v0.4.0 // indirect
87+
github.com/libp2p/go-libp2p-discovery v0.5.1 // indirect
88+
github.com/libp2p/go-libp2p-mplex v0.4.1 // indirect
89+
github.com/libp2p/go-libp2p-nat v0.0.6 // indirect
90+
github.com/libp2p/go-libp2p-netutil v0.1.0 // indirect
91+
github.com/libp2p/go-libp2p-pnet v0.2.0 // indirect
92+
github.com/libp2p/go-libp2p-swarm v0.5.3 // indirect
93+
github.com/libp2p/go-libp2p-testing v0.4.2 // indirect
94+
github.com/libp2p/go-libp2p-tls v0.2.0 // indirect
95+
github.com/libp2p/go-libp2p-transport-upgrader v0.4.6 // indirect
96+
github.com/libp2p/go-maddr-filter v0.1.0 // indirect
97+
github.com/libp2p/go-mplex v0.3.0 // indirect
98+
github.com/libp2p/go-msgio v0.0.6 // indirect
99+
github.com/libp2p/go-nat v0.0.5 // indirect
100+
github.com/libp2p/go-netroute v0.1.6 // indirect
101+
github.com/libp2p/go-openssl v0.0.7 // indirect
102+
github.com/libp2p/go-reuseport v0.0.2 // indirect
103+
github.com/libp2p/go-reuseport-transport v0.0.5 // indirect
104+
github.com/libp2p/go-sockaddr v0.1.1 // indirect
105+
github.com/libp2p/go-stream-muxer-multistream v0.3.0 // indirect
106+
github.com/libp2p/go-ws-transport v0.5.0 // indirect
107+
github.com/libp2p/go-yamux/v2 v2.2.0 // indirect
108+
github.com/magiconair/properties v1.8.0 // indirect
109+
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
110+
github.com/mattn/go-isatty v0.0.13 // indirect
111+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
112+
github.com/miekg/dns v1.1.43 // indirect
113+
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
114+
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
115+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
116+
github.com/minio/sha256-simd v1.0.0 // indirect
117+
github.com/mitchellh/go-ps v1.0.0 // indirect
118+
github.com/mr-tron/base58 v1.2.0 // indirect
119+
github.com/multiformats/go-base32 v0.0.3 // indirect
120+
github.com/multiformats/go-base36 v0.1.0 // indirect
121+
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
122+
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
123+
github.com/multiformats/go-multibase v0.0.3 // indirect
124+
github.com/multiformats/go-multihash v0.0.15 // indirect
125+
github.com/multiformats/go-multistream v0.2.2 // indirect
126+
github.com/multiformats/go-varint v0.0.6 // indirect
127+
github.com/opentracing/opentracing-go v1.2.0 // indirect
128+
github.com/pelletier/go-toml v1.8.1 // indirect
129+
github.com/pkg/errors v0.9.1 // indirect
130+
github.com/pmezard/go-difflib v1.0.0 // indirect
131+
github.com/prometheus/client_model v0.2.0 // indirect
132+
github.com/prometheus/procfs v0.7.3 // indirect
133+
github.com/sirupsen/logrus v1.7.0 // indirect
134+
github.com/spacemeshos/bitstream v0.0.0-20210407173523-8168e84f83b0 // indirect
135+
github.com/spacemeshos/smutil v0.0.0-20190604133034-b5189449f5c5 // indirect
136+
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
137+
github.com/spf13/afero v1.2.0 // indirect
138+
github.com/spf13/cast v1.3.0 // indirect
139+
github.com/spf13/jwalterweatherman v1.0.0 // indirect
140+
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
141+
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
142+
go.uber.org/multierr v1.7.0 // indirect
143+
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
144+
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
145+
golang.org/x/text v0.3.7 // indirect
146+
golang.org/x/tools v0.1.5 // indirect
147+
google.golang.org/protobuf v1.27.1 // indirect
148+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
149+
gopkg.in/yaml.v2 v2.4.0 // indirect
150+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
151+
)
152+
153+
go 1.17

go.sum

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
3232
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
3333
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
3434
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
35+
crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797 h1:yDf7ARQc637HoxDho7xjqdvO5ZA2Yb+xzv/fOnnvZzw=
36+
crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk=
37+
crawshaw.io/sqlite v0.3.3-0.20211227050848-2cdb5c1a86a1 h1:Ee5qKxzDpjFjX2tdxl8NlPCTr3PDpagnyf0jL5ow+PY=
38+
crawshaw.io/sqlite v0.3.3-0.20211227050848-2cdb5c1a86a1/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4=
3539
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
3640
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3741
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
@@ -43,7 +47,6 @@ github.com/ALTree/bigfloat v0.0.0-20201218142103-4a33235224ec/go.mod h1:+NaH2gLe
4347
github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
4448
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
4549
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
46-
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
4750
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4851
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
4952
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
@@ -308,7 +311,6 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk
308311
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
309312
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
310313
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
311-
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
312314
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
313315
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
314316
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
@@ -427,6 +429,7 @@ github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0
427429
github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4=
428430
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
429431
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
432+
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
430433
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
431434
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
432435
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
@@ -440,7 +443,6 @@ github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/
440443
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
441444
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
442445
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
443-
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
444446
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
445447
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
446448
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
@@ -972,9 +974,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
972974
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
973975
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
974976
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
975-
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
976977
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
977-
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
978978
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
979979
github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY=
980980
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
@@ -1170,8 +1170,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
11701170
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
11711171
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
11721172
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
1173-
golang.org/x/mod v0.5.0 h1:UG21uOlmZabA4fW5i7ZX6bjw1xELEGg/ZLgZq9auk/Q=
1174-
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
11751173
golang.org/x/net v0.0.0-20180404174746-b3c676e531a6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
11761174
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
11771175
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

hare/hare.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ func (h *Hare) getGoodProposal(lyrID types.LayerID, epochBeacon types.Beacon, lo
373373
if err != nil {
374374
if err != database.ErrNotFound {
375375
logger.With().Error("no proposals found for hare, using empty set", log.Err(err))
376-
} else if err = h.mesh.SetZeroBallotLayer(lyrID); err != nil {
377-
logger.With().Warning("failed to tag zero ballot layer", log.Err(err))
378376
}
379377
return []types.ProposalID{}
380378
}

hare/interfaces.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type meshProvider interface {
2626
GetBallot(types.BallotID) (*types.Ballot, error)
2727
ProcessLayerPerHareOutput(context.Context, types.LayerID, types.BlockID) error
2828
RecordCoinflip(context.Context, types.LayerID, bool)
29-
SetZeroBallotLayer(types.LayerID) error
3029
}
3130

3231
type proposalProvider interface {

hare/mocks/mocks.go

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)