mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-12 07:42:48 +00:00
Compare commits
34 Commits
finalizeBl
...
rc2/v0.33.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a17fc42af | ||
|
|
8c35827024 | ||
|
|
fa1344bde4 | ||
|
|
635302b880 | ||
|
|
11b521d381 | ||
|
|
bc35442cea | ||
|
|
a1ebf16625 | ||
|
|
f9c2ca51ad | ||
|
|
e2698694fe | ||
|
|
95e00fddd2 | ||
|
|
a1e9193c04 | ||
|
|
31f755a869 | ||
|
|
f9774dea30 | ||
|
|
d34e573823 | ||
|
|
380ff9e2a2 | ||
|
|
e325388450 | ||
|
|
1d127b45ef | ||
|
|
9d9adec4ac | ||
|
|
6ab80c51bf | ||
|
|
2a94e09c65 | ||
|
|
70a4b5ea08 | ||
|
|
6018f2d1a5 | ||
|
|
31a0f48c4a | ||
|
|
13eff7f7ed | ||
|
|
62c1a1399c | ||
|
|
9821af83e7 | ||
|
|
0c0cb9f200 | ||
|
|
2544a5cf3a | ||
|
|
b215e07ecd | ||
|
|
ec9424c6ce | ||
|
|
30e5619ac0 | ||
|
|
e62b21c9bd | ||
|
|
42d8bc5124 | ||
|
|
af99236105 |
66
CHANGELOG.md
66
CHANGELOG.md
@@ -1,5 +1,62 @@
|
||||
# Changelog
|
||||
|
||||
## v.0.33.5
|
||||
|
||||
Special thanks to external contributors on this release: @tau3,
|
||||
|
||||
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES:
|
||||
|
||||
- Go API
|
||||
|
||||
- [privval] [\#4744](https://github.com/tendermint/tendermint/pull/4744) Remove deprecated `OldFilePV` (@melekes)
|
||||
- [mempool] [\#4759](https://github.com/tendermint/tendermint/pull/4759) Modify `Mempool#InitWAL` to return an error (@melekes)
|
||||
- [node] [\#4832](https://github.com/tendermint/tendermint/pull/4832) `ConfigureRPC` returns an error (@melekes)
|
||||
- [rpc] [\#4836](https://github.com/tendermint/tendermint/pull/4836) Overhaul `lib` folder (@melekes)
|
||||
Move lib/ folder to jsonrpc/.
|
||||
Rename:
|
||||
rpc package -> jsonrpc package
|
||||
rpcclient package -> client package
|
||||
rpcserver package -> server package
|
||||
JSONRPCClient to Client
|
||||
JSONRPCRequestBatch to RequestBatch
|
||||
JSONRPCCaller to Caller
|
||||
StartHTTPServer to Serve
|
||||
StartHTTPAndTLSServer to ServeTLS
|
||||
NewURIClient to NewURI
|
||||
NewJSONRPCClient to New
|
||||
NewJSONRPCClientWithHTTPClient to NewWithHTTPClient
|
||||
NewWSClient to NewWS
|
||||
Unexpose ResponseWriterWrapper
|
||||
Remove unused http_params.go
|
||||
|
||||
|
||||
### FEATURES:
|
||||
|
||||
- [pex] [\#4439](https://github.com/tendermint/tendermint/pull/4439) Use highwayhash for pex buckets (@tau3)
|
||||
|
||||
### IMPROVEMENTS:
|
||||
|
||||
- [abci/server] [\#4719](https://github.com/tendermint/tendermint/pull/4719) Print panic & stack trace to STDERR if logger is not set (@melekes)
|
||||
- [types] [\#4638](https://github.com/tendermint/tendermint/pull/4638) Implement `Header#ValidateBasic` (@alexanderbez)
|
||||
- [buildsystem] [\#4378](https://github.com/tendermint/tendermint/pull/4738) Replace build_c and install_c with TENDERMINT_BUILD_OPTIONS parsing. The following options are available:
|
||||
- nostrip: don't strip debugging symbols nor DWARF tables.
|
||||
- cleveldb: use cleveldb as db backend instead of goleveldb.
|
||||
- race: pass -race to go build and enable data race detection.
|
||||
- [mempool] [\#4759](https://github.com/tendermint/tendermint/pull/4759) Allow ReapX and CheckTx functions to run in parallel (@melekes)
|
||||
- [rpc/core] [\#4844](https://github.com/tendermint/tendermint/pull/4844) Do not lock consensus state in `/validators`, `/consensus_params` and `/status` (@melekes)
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [blockchain/v2] [\#4761](https://github.com/tendermint/tendermint/pull/4761) Fix excessive CPU usage caused by spinning on closed channels (@erikgrinaker)
|
||||
- [blockchain/v2] Respect `fast_sync` option (@erikgrinaker)
|
||||
- [light] [\#4741](https://github.com/tendermint/tendermint/pull/4741) Correctly return `ErrSignedHeaderNotFound` and `ErrValidatorSetNotFound` on corresponding RPC errors (@erikgrinaker)
|
||||
- [rpc] [\#4805](https://github.com/tendermint/tendermint/issues/4805) Attempt to handle panics during panic recovery (@erikgrinaker)
|
||||
- [types] [\#4764](https://github.com/tendermint/tendermint/pull/4764) Return an error if voting power overflows in `VerifyCommitTrusting` (@melekes)
|
||||
- [privval] [\#4812](https://github.com/tendermint/tendermint/pull/4812) Retry `GetPubKey/SignVote/SignProposal` a few times before returning an error (@melekes)
|
||||
- [p2p] [\#4847](https://github.com/tendermint/tendermint/pull/4847) Return masked IP (not the actual IP) in addrbook#groupKey (@melekes)
|
||||
|
||||
## v0.33.4
|
||||
|
||||
- Nodes are no longer guaranteed to contain all blocks up to the latest height. The ABCI app can now control which blocks to retain through the ABCI field `ResponseCommit.retain_height`, all blocks and associated data below this height will be removed.
|
||||
@@ -42,7 +99,6 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
|
||||
### BUG FIXES:
|
||||
|
||||
- [rpc] [\#4568](https://github.com/tendermint/tendermint/issues/4568) Fix panic when `Subscribe` is called, but HTTP client is not running. `Subscribe`, `Unsubscribe(All)` methods return an error now (@melekes).
|
||||
|
||||
|
||||
## v0.33.3
|
||||
|
||||
@@ -339,6 +395,12 @@ subjectivity interface. Refer to the [spec](https://github.com/tendermint/spec/b
|
||||
- [consensus/types] [\#4243](https://github.com/tendermint/tendermint/issues/4243) fix BenchmarkRoundStateDeepCopy panics (@cuonglm)
|
||||
- [rpc] [\#4256](https://github.com/tendermint/tendermint/issues/4256) Pass `outCapacity` to `eventBus#Subscribe` when subscribing using a local client
|
||||
|
||||
## v0.32.11
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [privval] [\#4275](https://github.com/tendermint/tendermint/issues/4275) Fix consensus failure when remote signer drops (@melekes)
|
||||
|
||||
## v0.32.10
|
||||
|
||||
*April 6, 2020*
|
||||
@@ -421,7 +483,7 @@ program](https://hackerone.com/tendermint).
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [rpc/lib] [\#4051](https://github.com/tendermint/tendermint/pull/4131) Fix RPC client, which was previously resolving https protocol to http (@yenkhoon)
|
||||
- [rpc/lib] [\#4131](https://github.com/tendermint/tendermint/pull/4131) Fix RPC client, which was previously resolving https protocol to http (@yenkhoon)
|
||||
- [cs] [\#4069](https://github.com/tendermint/tendermint/issues/4069) Don't panic when block meta is not found in store (@gregzaitsev)
|
||||
|
||||
## v0.32.8
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
## v0.33.5
|
||||
## v0.33.6
|
||||
|
||||
|
||||
\*\*
|
||||
|
||||
@@ -16,9 +17,12 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
|
||||
|
||||
- Go API
|
||||
|
||||
- Blockchain Protocol
|
||||
|
||||
### FEATURES:
|
||||
|
||||
|
||||
|
||||
### IMPROVEMENTS:
|
||||
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ ENV GOPATH=/go/src
|
||||
RUN mkdir -p /tendermint
|
||||
WORKDIR /tendermint
|
||||
|
||||
CMD ["/usr/bin/make", "build_c"]
|
||||
CMD ["/usr/bin/make", "build", "TENDERMINT_BUILD_OPTIONS=cleveldb"]
|
||||
|
||||
|
||||
56
Makefile
56
Makefile
@@ -1,11 +1,33 @@
|
||||
PACKAGES=$(shell go list ./...)
|
||||
OUTPUT?=build/tendermint
|
||||
|
||||
BUILD_TAGS?='tendermint'
|
||||
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD` -s -w
|
||||
BUILD_TAGS?=tendermint
|
||||
LD_FLAGS = -X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`
|
||||
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
|
||||
HTTPS_GIT := https://github.com/tendermint/tendermint.git
|
||||
DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf
|
||||
CGO_ENABLED ?= 0
|
||||
|
||||
# handle nostrip
|
||||
ifeq (,$(findstring nostrip,$(TENDERMINT_BUILD_OPTIONS)))
|
||||
BUILD_FLAGS += -trimpath
|
||||
LD_FLAGS += -s -w
|
||||
endif
|
||||
|
||||
# handle race
|
||||
ifeq (race,$(findstring race,$(TENDERMINT_BUILD_OPTIONS)))
|
||||
CGO_ENABLED=1
|
||||
BUILD_FLAGS += -race
|
||||
endif
|
||||
|
||||
# handle cleveldb
|
||||
ifeq (cleveldb,$(findstring cleveldb,$(TENDERMINT_BUILD_OPTIONS)))
|
||||
CGO_ENABLED=1
|
||||
BUILD_TAGS += cleveldb
|
||||
endif
|
||||
|
||||
# allow users to pass additional flags via the conventional LDFLAGS variable
|
||||
LD_FLAGS += $(LDFLAGS)
|
||||
|
||||
all: check build test install
|
||||
.PHONY: all
|
||||
@@ -19,25 +41,13 @@ include tests.mk
|
||||
###############################################################################
|
||||
|
||||
build:
|
||||
CGO_ENABLED=0 go build $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint/
|
||||
CGO_ENABLED=$(CGO_ENABLED) go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o $(OUTPUT) ./cmd/tendermint/
|
||||
.PHONY: build
|
||||
|
||||
build_c:
|
||||
CGO_ENABLED=1 go build $(BUILD_FLAGS) -tags "$(BUILD_TAGS) cleveldb" -o $(OUTPUT) ./cmd/tendermint/
|
||||
.PHONY: build_c
|
||||
|
||||
build_race:
|
||||
CGO_ENABLED=1 go build -race $(BUILD_FLAGS) -tags $(BUILD_TAGS) -o $(OUTPUT) ./cmd/tendermint
|
||||
.PHONY: build_race
|
||||
|
||||
install:
|
||||
CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint
|
||||
CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) -tags $(BUILD_TAGS) ./cmd/tendermint
|
||||
.PHONY: install
|
||||
|
||||
install_c:
|
||||
CGO_ENABLED=1 go install $(BUILD_FLAGS) -tags "$(BUILD_TAGS) cleveldb" ./cmd/tendermint
|
||||
.PHONY: install_c
|
||||
|
||||
###############################################################################
|
||||
### Protobuf ###
|
||||
###############################################################################
|
||||
@@ -125,15 +135,15 @@ gen_certs: clean_certs
|
||||
certstrap init --common-name "tendermint.com" --passphrase ""
|
||||
certstrap request-cert --common-name "server" -ip "127.0.0.1" --passphrase ""
|
||||
certstrap sign "server" --CA "tendermint.com" --passphrase ""
|
||||
mv out/server.crt rpc/lib/server/test.crt
|
||||
mv out/server.key rpc/lib/server/test.key
|
||||
mv out/server.crt rpc/jsonrpc/server/test.crt
|
||||
mv out/server.key rpc/jsonrpc/server/test.key
|
||||
rm -rf out
|
||||
.PHONY: gen_certs
|
||||
|
||||
# deletes generated certificates
|
||||
clean_certs:
|
||||
rm -f rpc/lib/server/test.crt
|
||||
rm -f rpc/lib/server/test.key
|
||||
rm -f rpc/jsonrpc/server/test.crt
|
||||
rm -f rpc/jsonrpc/server/test.key
|
||||
.PHONY: clean_certs
|
||||
|
||||
###############################################################################
|
||||
@@ -197,9 +207,9 @@ build-docker-localnode:
|
||||
@cd networks/local && make
|
||||
.PHONY: build-docker-localnode
|
||||
|
||||
# Runs `make build_c` from within an Amazon Linux (v2)-based Docker build
|
||||
# container in order to build an Amazon Linux-compatible binary. Produces a
|
||||
# compatible binary at ./build/tendermint
|
||||
# Runs `make build TENDERMINT_BUILD_OPTIONS=cleveldb` from within an Amazon
|
||||
# Linux (v2)-based Docker build container in order to build an Amazon
|
||||
# Linux-compatible binary. Produces a compatible binary at ./build/tendermint
|
||||
build_c-amazonlinux:
|
||||
$(MAKE) -C ./DOCKER build_amazonlinux_buildimage
|
||||
docker run --rm -it -v `pwd`:/tendermint tendermint/tendermint:build_c-amazonlinux
|
||||
|
||||
10
UPGRADING.md
10
UPGRADING.md
@@ -7,6 +7,7 @@ a newer version of Tendermint Core.
|
||||
|
||||
<Overview>
|
||||
|
||||
|
||||
## v0.33.4
|
||||
|
||||
### Go API
|
||||
@@ -17,6 +18,15 @@ a newer version of Tendermint Core.
|
||||
|
||||
When upgrading to version 0.33.4 you will have to fetch the `third_party` directory along with the updated proto files.
|
||||
|
||||
## v0.33.1
|
||||
|
||||
This release is compatible with the previous version. The only change that is required is if you are fetching the protobuf files for application use.
|
||||
|
||||
### Protobuf Changes
|
||||
|
||||
When upgrading to version 0.33.1 you will have to fetch the `third_party` directory along with the updated proto files.
|
||||
|
||||
|
||||
## v0.33.0
|
||||
|
||||
This release is not compatible with previous blockchains due to commit becoming signatures only and fields in the header have been removed.
|
||||
|
||||
@@ -34,25 +34,24 @@ func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) service.Se
|
||||
return s
|
||||
}
|
||||
|
||||
// OnStart starts the gRPC service
|
||||
// OnStart starts the gRPC service.
|
||||
func (s *GRPCServer) OnStart() error {
|
||||
if err := s.BaseService.OnStart(); err != nil {
|
||||
return err
|
||||
}
|
||||
ln, err := net.Listen(s.proto, s.addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr)
|
||||
|
||||
s.listener = ln
|
||||
s.server = grpc.NewServer()
|
||||
types.RegisterABCIApplicationServer(s.server, s.app)
|
||||
|
||||
s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr)
|
||||
go s.server.Serve(s.listener)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// OnStop stops the gRPC server
|
||||
// OnStop stops the gRPC server.
|
||||
func (s *GRPCServer) OnStop() {
|
||||
s.BaseService.OnStop()
|
||||
s.server.Stop()
|
||||
}
|
||||
|
||||
@@ -5,9 +5,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
tmlog "github.com/tendermint/tendermint/libs/log"
|
||||
tmnet "github.com/tendermint/tendermint/libs/net"
|
||||
"github.com/tendermint/tendermint/libs/service"
|
||||
)
|
||||
@@ -16,6 +19,7 @@ import (
|
||||
|
||||
type SocketServer struct {
|
||||
service.BaseService
|
||||
isLoggerSet bool
|
||||
|
||||
proto string
|
||||
addr string
|
||||
@@ -42,21 +46,24 @@ func NewSocketServer(protoAddr string, app types.Application) service.Service {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *SocketServer) SetLogger(l tmlog.Logger) {
|
||||
s.BaseService.SetLogger(l)
|
||||
s.isLoggerSet = true
|
||||
}
|
||||
|
||||
func (s *SocketServer) OnStart() error {
|
||||
if err := s.BaseService.OnStart(); err != nil {
|
||||
return err
|
||||
}
|
||||
ln, err := net.Listen(s.proto, s.addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s.listener = ln
|
||||
go s.acceptConnectionsRoutine()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SocketServer) OnStop() {
|
||||
s.BaseService.OnStop()
|
||||
if err := s.listener.Close(); err != nil {
|
||||
s.Logger.Error("Error closing listener", "err", err)
|
||||
}
|
||||
@@ -105,7 +112,7 @@ func (s *SocketServer) acceptConnectionsRoutine() {
|
||||
if !s.IsRunning() {
|
||||
return // Ignore error from listener closing.
|
||||
}
|
||||
s.Logger.Error("Failed to accept connection: " + err.Error())
|
||||
s.Logger.Error("Failed to accept connection", "err", err)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -132,15 +139,15 @@ func (s *SocketServer) waitForClose(closeConn chan error, connID int) {
|
||||
case err == io.EOF:
|
||||
s.Logger.Error("Connection was closed by client")
|
||||
case err != nil:
|
||||
s.Logger.Error("Connection error", "error", err)
|
||||
s.Logger.Error("Connection error", "err", err)
|
||||
default:
|
||||
// never happens
|
||||
s.Logger.Error("Connection was closed.")
|
||||
s.Logger.Error("Connection was closed")
|
||||
}
|
||||
|
||||
// Close the connection
|
||||
if err := s.rmConn(connID); err != nil {
|
||||
s.Logger.Error("Error in closing connection", "error", err)
|
||||
s.Logger.Error("Error closing connection", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +160,14 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp
|
||||
// make sure to recover from any app-related panics to allow proper socket cleanup
|
||||
r := recover()
|
||||
if r != nil {
|
||||
closeConn <- fmt.Errorf("recovered from panic: %v", r)
|
||||
const size = 64 << 10
|
||||
buf := make([]byte, size)
|
||||
buf = buf[:runtime.Stack(buf, false)]
|
||||
err := fmt.Errorf("recovered from panic: %v\n%s", r, buf)
|
||||
if !s.isLoggerSet {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
closeConn <- err
|
||||
s.appMtx.Unlock()
|
||||
}
|
||||
}()
|
||||
@@ -166,7 +180,7 @@ func (s *SocketServer) handleRequests(closeConn chan error, conn io.Reader, resp
|
||||
if err == io.EOF {
|
||||
closeConn <- err
|
||||
} else {
|
||||
closeConn <- fmt.Errorf("error reading message: %v", err)
|
||||
closeConn <- fmt.Errorf("error reading message: %w", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -223,13 +237,13 @@ func (s *SocketServer) handleResponses(closeConn chan error, conn io.Writer, res
|
||||
var res = <-responses
|
||||
err := types.WriteMessage(res, bufWriter)
|
||||
if err != nil {
|
||||
closeConn <- fmt.Errorf("error writing message: %v", err.Error())
|
||||
closeConn <- fmt.Errorf("error writing message: %w", err)
|
||||
return
|
||||
}
|
||||
if _, ok := res.Value.(*types.Response_Flush); ok {
|
||||
err = bufWriter.Flush()
|
||||
if err != nil {
|
||||
closeConn <- fmt.Errorf("error flushing write buffer: %v", err.Error())
|
||||
closeConn <- fmt.Errorf("error flushing write buffer: %w", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ type blockStore interface {
|
||||
type BlockchainReactor struct {
|
||||
p2p.BaseReactor
|
||||
|
||||
fastSync bool // if true, enable fast sync on start
|
||||
events chan Event // XXX: Rename eventsFromPeers
|
||||
stopDemux chan struct{}
|
||||
scheduler *Routine
|
||||
processor *Routine
|
||||
logger log.Logger
|
||||
@@ -157,7 +157,7 @@ type blockApplier interface {
|
||||
// XXX: unify naming in this package around tmState
|
||||
// XXX: V1 stores a copy of state as initialState, which is never mutated. Is that nessesary?
|
||||
func newReactor(state state.State, store blockStore, reporter behaviour.Reporter,
|
||||
blockApplier blockApplier, bufferSize int) *BlockchainReactor {
|
||||
blockApplier blockApplier, bufferSize int, fastSync bool) *BlockchainReactor {
|
||||
scheduler := newScheduler(state.LastBlockHeight, time.Now())
|
||||
pContext := newProcessorContext(store, blockApplier, state)
|
||||
// TODO: Fix naming to just newProcesssor
|
||||
@@ -166,12 +166,12 @@ func newReactor(state state.State, store blockStore, reporter behaviour.Reporter
|
||||
|
||||
return &BlockchainReactor{
|
||||
events: make(chan Event, bufferSize),
|
||||
stopDemux: make(chan struct{}),
|
||||
scheduler: newRoutine("scheduler", scheduler.handle, bufferSize),
|
||||
processor: newRoutine("processor", processor.handle, bufferSize),
|
||||
store: store,
|
||||
reporter: reporter,
|
||||
logger: log.NewNopLogger(),
|
||||
fastSync: fastSync,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ func NewBlockchainReactor(
|
||||
store blockStore,
|
||||
fastSync bool) *BlockchainReactor {
|
||||
reporter := behaviour.NewMockReporter()
|
||||
return newReactor(state, store, reporter, blockApplier, 1000)
|
||||
return newReactor(state, store, reporter, blockApplier, 1000, fastSync)
|
||||
}
|
||||
|
||||
// SetSwitch implements Reactor interface.
|
||||
@@ -226,9 +226,11 @@ func (r *BlockchainReactor) SetLogger(logger log.Logger) {
|
||||
// Start implements cmn.Service interface
|
||||
func (r *BlockchainReactor) Start() error {
|
||||
r.reporter = behaviour.NewSwitchReporter(r.BaseReactor.Switch)
|
||||
go r.scheduler.start()
|
||||
go r.processor.start()
|
||||
go r.demux()
|
||||
if r.fastSync {
|
||||
go r.scheduler.start()
|
||||
go r.processor.start()
|
||||
go r.demux()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -306,19 +308,29 @@ func (r *BlockchainReactor) demux() {
|
||||
processBlockFreq = 20 * time.Millisecond
|
||||
doProcessBlockCh = make(chan struct{}, 1)
|
||||
doProcessBlockTk = time.NewTicker(processBlockFreq)
|
||||
)
|
||||
defer doProcessBlockTk.Stop()
|
||||
|
||||
var (
|
||||
prunePeerFreq = 1 * time.Second
|
||||
doPrunePeerCh = make(chan struct{}, 1)
|
||||
doPrunePeerTk = time.NewTicker(prunePeerFreq)
|
||||
)
|
||||
defer doPrunePeerTk.Stop()
|
||||
|
||||
var (
|
||||
scheduleFreq = 20 * time.Millisecond
|
||||
doScheduleCh = make(chan struct{}, 1)
|
||||
doScheduleTk = time.NewTicker(scheduleFreq)
|
||||
)
|
||||
defer doScheduleTk.Stop()
|
||||
|
||||
var (
|
||||
statusFreq = 10 * time.Second
|
||||
doStatusCh = make(chan struct{}, 1)
|
||||
doStatusTk = time.NewTicker(statusFreq)
|
||||
)
|
||||
defer doStatusTk.Stop()
|
||||
|
||||
// XXX: Extract timers to make testing atemporal
|
||||
for {
|
||||
@@ -355,14 +367,20 @@ func (r *BlockchainReactor) demux() {
|
||||
case <-doStatusCh:
|
||||
r.io.broadcastStatusRequest(r.store.Base(), r.SyncHeight())
|
||||
|
||||
// Events from peers
|
||||
case event := <-r.events:
|
||||
// Events from peers. Closing the channel signals event loop termination.
|
||||
case event, ok := <-r.events:
|
||||
if !ok {
|
||||
r.logger.Info("Stopping event processing")
|
||||
return
|
||||
}
|
||||
switch event := event.(type) {
|
||||
case bcStatusResponse:
|
||||
r.setMaxPeerHeight(event.height)
|
||||
r.scheduler.send(event)
|
||||
case bcAddNewPeer, bcRemovePeer, bcBlockResponse, bcNoBlockResponse:
|
||||
r.scheduler.send(event)
|
||||
default:
|
||||
r.logger.Error("Received unknown event", "event", fmt.Sprintf("%T", event))
|
||||
}
|
||||
|
||||
// Incremental events form scheduler
|
||||
@@ -378,6 +396,9 @@ func (r *BlockchainReactor) demux() {
|
||||
case scFinishedEv:
|
||||
r.processor.send(event)
|
||||
r.scheduler.stop()
|
||||
case noOpEvent:
|
||||
default:
|
||||
r.logger.Error("Received unknown scheduler event", "event", fmt.Sprintf("%T", event))
|
||||
}
|
||||
|
||||
// Incremental events from processor
|
||||
@@ -397,20 +418,28 @@ func (r *BlockchainReactor) demux() {
|
||||
case pcFinished:
|
||||
r.io.trySwitchToConsensus(event.tmState, event.blocksSynced)
|
||||
r.processor.stop()
|
||||
case noOpEvent:
|
||||
default:
|
||||
r.logger.Error("Received unknown processor event", "event", fmt.Sprintf("%T", event))
|
||||
}
|
||||
|
||||
// Terminal events from scheduler
|
||||
// Terminal event from scheduler
|
||||
case err := <-r.scheduler.final():
|
||||
r.logger.Info(fmt.Sprintf("scheduler final %s", err))
|
||||
// send the processor stop?
|
||||
switch err {
|
||||
case nil:
|
||||
r.logger.Info("Scheduler stopped")
|
||||
default:
|
||||
r.logger.Error("Scheduler aborted with error", "err", err)
|
||||
}
|
||||
|
||||
// Terminal event from processor
|
||||
case event := <-r.processor.final():
|
||||
r.logger.Info(fmt.Sprintf("processor final %s", event))
|
||||
|
||||
case <-r.stopDemux:
|
||||
r.logger.Info("demuxing stopped")
|
||||
return
|
||||
case err := <-r.processor.final():
|
||||
switch err {
|
||||
case nil:
|
||||
r.logger.Info("Processor stopped")
|
||||
default:
|
||||
r.logger.Error("Processor aborted with error", "err", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -421,7 +450,6 @@ func (r *BlockchainReactor) Stop() error {
|
||||
|
||||
r.scheduler.stop()
|
||||
r.processor.stop()
|
||||
close(r.stopDemux)
|
||||
close(r.events)
|
||||
|
||||
r.logger.Info("reactor stopped")
|
||||
|
||||
@@ -156,7 +156,7 @@ func newTestReactor(p testReactorParams) *BlockchainReactor {
|
||||
sm.SaveState(db, state)
|
||||
}
|
||||
|
||||
r := newReactor(state, store, reporter, appl, p.bufferSize)
|
||||
r := newReactor(state, store, reporter, appl, p.bufferSize, true)
|
||||
logger := log.TestingLogger()
|
||||
r.SetLogger(logger.With("module", "blockchain"))
|
||||
|
||||
|
||||
@@ -69,9 +69,11 @@ func (rt *Routine) start() {
|
||||
|
||||
for {
|
||||
events, err := rt.queue.Get(1)
|
||||
if err != nil {
|
||||
rt.logger.Info(fmt.Sprintf("%s: stopping\n", rt.name))
|
||||
rt.terminate(fmt.Errorf("stopped"))
|
||||
if err == queue.ErrDisposed {
|
||||
rt.terminate(nil)
|
||||
return
|
||||
} else if err != nil {
|
||||
rt.terminate(err)
|
||||
return
|
||||
}
|
||||
oEvent, err := rt.handle(events[0].(Event))
|
||||
@@ -131,6 +133,7 @@ func (rt *Routine) final() chan error {
|
||||
|
||||
// XXX: Maybe get rid of this
|
||||
func (rt *Routine) terminate(reason error) {
|
||||
close(rt.out)
|
||||
// We don't close the rt.out channel here, to avoid spinning on the closed channel
|
||||
// in the event loop.
|
||||
rt.fin <- reason
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
lrpc "github.com/tendermint/tendermint/lite2/rpc"
|
||||
dbs "github.com/tendermint/tendermint/lite2/store/db"
|
||||
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
|
||||
)
|
||||
|
||||
// LiteCmd represents the base command when called without any subcommands
|
||||
|
||||
@@ -263,12 +263,6 @@ func (cfg BaseConfig) PrivValidatorStateFile() string {
|
||||
return rootify(cfg.PrivValidatorState, cfg.RootDir)
|
||||
}
|
||||
|
||||
// OldPrivValidatorFile returns the full path of the priv_validator.json from pre v0.28.0.
|
||||
// TODO: eventually remove.
|
||||
func (cfg BaseConfig) OldPrivValidatorFile() string {
|
||||
return rootify(oldPrivValPath, cfg.RootDir)
|
||||
}
|
||||
|
||||
// NodeKeyFile returns the full path to the node_key.json file
|
||||
func (cfg BaseConfig) NodeKeyFile() string {
|
||||
return rootify(cfg.NodeKey, cfg.RootDir)
|
||||
|
||||
81
crypto/encoding/codec.go
Normal file
81
crypto/encoding/codec.go
Normal file
@@ -0,0 +1,81 @@
|
||||
package encoding
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
pc "github.com/tendermint/tendermint/proto/crypto/keys"
|
||||
)
|
||||
|
||||
// PubKeyToProto takes crypto.PubKey and transforms it to a protobuf Pubkey
|
||||
func PubKeyToProto(k crypto.PubKey) (pc.PublicKey, error) {
|
||||
if k == nil {
|
||||
return pc.PublicKey{}, errors.New("nil PublicKey")
|
||||
}
|
||||
var kp pc.PublicKey
|
||||
switch k := k.(type) {
|
||||
case ed25519.PubKeyEd25519:
|
||||
kp = pc.PublicKey{
|
||||
Sum: &pc.PublicKey_Ed25519{
|
||||
Ed25519: k[:],
|
||||
},
|
||||
}
|
||||
default:
|
||||
return kp, fmt.Errorf("toproto: key type %v is not supported", k)
|
||||
}
|
||||
return kp, nil
|
||||
}
|
||||
|
||||
// PubKeyFromProto takes a protobuf Pubkey and transforms it to a crypto.Pubkey
|
||||
func PubKeyFromProto(k *pc.PublicKey) (crypto.PubKey, error) {
|
||||
if k == nil {
|
||||
return nil, errors.New("nil PublicKey")
|
||||
}
|
||||
switch k := k.Sum.(type) {
|
||||
case *pc.PublicKey_Ed25519:
|
||||
if len(k.Ed25519) != ed25519.PubKeyEd25519Size {
|
||||
return nil, fmt.Errorf("invalid size for PubKeyEd25519. Got %d, expected %d",
|
||||
len(k.Ed25519), ed25519.PubKeyEd25519Size)
|
||||
}
|
||||
var pk ed25519.PubKeyEd25519
|
||||
copy(pk[:], k.Ed25519)
|
||||
return pk, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("fromproto: key type %v is not supported", k)
|
||||
}
|
||||
}
|
||||
|
||||
// PrivKeyToProto takes crypto.PrivKey and transforms it to a protobuf PrivKey
|
||||
func PrivKeyToProto(k crypto.PrivKey) (pc.PrivateKey, error) {
|
||||
var kp pc.PrivateKey
|
||||
switch k := k.(type) {
|
||||
case ed25519.PrivKeyEd25519:
|
||||
kp = pc.PrivateKey{
|
||||
Sum: &pc.PrivateKey_Ed25519{
|
||||
Ed25519: k[:],
|
||||
},
|
||||
}
|
||||
default:
|
||||
return kp, errors.New("toproto: key type is not supported")
|
||||
}
|
||||
return kp, nil
|
||||
}
|
||||
|
||||
// PrivKeyFromProto takes a protobuf PrivateKey and transforms it to a crypto.PrivKey
|
||||
func PrivKeyFromProto(k pc.PrivateKey) (crypto.PrivKey, error) {
|
||||
switch k := k.Sum.(type) {
|
||||
case *pc.PrivateKey_Ed25519:
|
||||
|
||||
if len(k.Ed25519) != ed25519.PubKeyEd25519Size {
|
||||
return nil, fmt.Errorf("invalid size for PubKeyEd25519. Got %d, expected %d",
|
||||
len(k.Ed25519), ed25519.PubKeyEd25519Size)
|
||||
}
|
||||
var pk ed25519.PrivKeyEd25519
|
||||
copy(pk[:], k.Ed25519)
|
||||
return pk, nil
|
||||
default:
|
||||
return nil, errors.New("fromproto: key type not supported")
|
||||
}
|
||||
}
|
||||
@@ -119,13 +119,13 @@ db_backend = "cleveldb"
|
||||
To install Tendermint, run:
|
||||
|
||||
```
|
||||
CGO_LDFLAGS="-lsnappy" make install_c
|
||||
CGO_LDFLAGS="-lsnappy" make install TENDERMINT_BUILD_OPTIONS=cleveldb
|
||||
```
|
||||
|
||||
or run:
|
||||
|
||||
```
|
||||
CGO_LDFLAGS="-lsnappy" make build_c
|
||||
CGO_LDFLAGS="-lsnappy" make build TENDERMINT_BUILD_OPTIONS=cleveldb
|
||||
```
|
||||
|
||||
which puts the binary in `./build`.
|
||||
|
||||
@@ -10,7 +10,7 @@ By default, Tendermint uses the `syndtr/goleveldb` package for its in-process
|
||||
key-value database. Unfortunately, this implementation of LevelDB seems to suffer under heavy load (see
|
||||
[#226](https://github.com/syndtr/goleveldb/issues/226)). It may be best to
|
||||
install the real C-implementation of LevelDB and compile Tendermint to use
|
||||
that using `make build_c`. See the [install instructions](../introduction/install.md) for details.
|
||||
that using `make build TENDERMINT_BUILD_OPTIONS=cleveldb`. See the [install instructions](../introduction/install.md) for details.
|
||||
|
||||
Tendermint keeps multiple distinct databases in the `$TMROOT/data`:
|
||||
|
||||
|
||||
1
go.mod
1
go.mod
@@ -16,6 +16,7 @@ require (
|
||||
github.com/gtank/merlin v0.1.1
|
||||
github.com/libp2p/go-buffer-pool v0.0.2
|
||||
github.com/magiconair/properties v1.8.1
|
||||
github.com/minio/highwayhash v1.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.5.1
|
||||
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
|
||||
|
||||
3
go.sum
3
go.sum
@@ -260,6 +260,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0=
|
||||
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
|
||||
github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2BA=
|
||||
github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
@@ -502,6 +504,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
tmprotobits "github.com/tendermint/tendermint/proto/libs/bits"
|
||||
)
|
||||
|
||||
// BitArray is a thread-safe implementation of a bit array.
|
||||
@@ -418,3 +419,28 @@ func (bA *BitArray) UnmarshalJSON(bz []byte) error {
|
||||
*bA = *bA2 //nolint:govet
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToProto converts BitArray to protobuf
|
||||
func (bA *BitArray) ToProto() *tmprotobits.BitArray {
|
||||
if bA == nil || len(bA.Elems) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &tmprotobits.BitArray{
|
||||
Bits: int64(bA.Bits),
|
||||
Elems: bA.Elems,
|
||||
}
|
||||
}
|
||||
|
||||
// FromProto sets a protobuf BitArray to the given pointer.
|
||||
func (bA *BitArray) FromProto(protoBitArray *tmprotobits.BitArray) {
|
||||
if protoBitArray == nil {
|
||||
bA = nil
|
||||
return
|
||||
}
|
||||
|
||||
bA.Bits = int(protoBitArray.Bits)
|
||||
if len(protoBitArray.Elems) > 0 {
|
||||
bA.Elems = protoBitArray.Elems
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,3 +265,26 @@ func TestJSONMarshalUnmarshal(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestBitArrayProtoBuf(t *testing.T) {
|
||||
testCases := []struct {
|
||||
msg string
|
||||
bA1 *BitArray
|
||||
expPass bool
|
||||
}{
|
||||
{"success empty", &BitArray{}, true},
|
||||
{"success", NewBitArray(1), true},
|
||||
{"success", NewBitArray(2), true},
|
||||
{"negative", NewBitArray(-1), false},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
protoBA := tc.bA1.ToProto()
|
||||
ba := new(BitArray)
|
||||
ba.FromProto(protoBA)
|
||||
if tc.expPass {
|
||||
require.Equal(t, tc.bA1, ba, tc.msg)
|
||||
} else {
|
||||
require.NotEqual(t, tc.bA1, ba, tc.msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func EnsureDir(dir string, mode os.FileMode) error {
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
err := os.MkdirAll(dir, mode)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not create directory %v. %v", dir, err)
|
||||
return fmt.Errorf("could not create directory %v: %w", dir, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -5,11 +5,15 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
lerr "github.com/tendermint/tendermint/lite/errors"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func TestBaseCert(t *testing.T) {
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
t.SkipNow()
|
||||
|
||||
assert := assert.New(t)
|
||||
|
||||
keys := genPrivKeys(4)
|
||||
@@ -41,8 +45,14 @@ func TestBaseCert(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
sh := tc.keys.GenSignedHeader(chainID, tc.height, nil, tc.vals, tc.vals,
|
||||
[]byte("foo"), []byte("params"), []byte("results"), tc.first, tc.last)
|
||||
sh := tc.keys.GenSignedHeader(
|
||||
chainID, tc.height, nil, tc.vals, tc.vals,
|
||||
tmhash.Sum([]byte("foo")),
|
||||
tmhash.Sum([]byte("params")),
|
||||
tmhash.Sum([]byte("results")),
|
||||
tc.first, tc.last,
|
||||
)
|
||||
|
||||
err := cert.Verify(sh)
|
||||
if tc.proper {
|
||||
assert.Nil(err, "%+v", err)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
log "github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
@@ -70,8 +71,10 @@ func TestInquirerValidPath(t *testing.T) {
|
||||
err := source.SaveFullCommit(fcz[i])
|
||||
require.Nil(err)
|
||||
}
|
||||
err = cert.Verify(sh)
|
||||
assert.Nil(err, "%+v", err)
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// err = cert.Verify(sh)
|
||||
// assert.Nil(err, "%+v", err)
|
||||
}
|
||||
|
||||
func TestDynamicVerify(t *testing.T) {
|
||||
@@ -118,24 +121,27 @@ func TestDynamicVerify(t *testing.T) {
|
||||
ver.SetLogger(log.TestingLogger())
|
||||
|
||||
// fetch the latest from the source
|
||||
latestFC, err := source.LatestFullCommit(chainID, 1, maxHeight)
|
||||
_, err = source.LatestFullCommit(chainID, 1, maxHeight)
|
||||
require.NoError(t, err)
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// try to update to the latest
|
||||
err = ver.Verify(latestFC.SignedHeader)
|
||||
require.NoError(t, err)
|
||||
|
||||
// err = ver.Verify(latestFC.SignedHeader)
|
||||
// require.NoError(t, err)
|
||||
}
|
||||
|
||||
func makeFullCommit(height int64, keys privKeys, vals, nextVals *types.ValidatorSet, chainID string) FullCommit {
|
||||
height++
|
||||
consHash := []byte("special-params")
|
||||
appHash := []byte(fmt.Sprintf("h=%d", height))
|
||||
resHash := []byte(fmt.Sprintf("res=%d", height))
|
||||
|
||||
consHash := tmhash.Sum([]byte("special-params"))
|
||||
appHash := tmhash.Sum([]byte(fmt.Sprintf("h=%d", height)))
|
||||
resHash := tmhash.Sum([]byte(fmt.Sprintf("res=%d", height)))
|
||||
|
||||
return keys.GenFullCommit(
|
||||
chainID, height, nil,
|
||||
vals, nextVals,
|
||||
appHash, consHash, resHash, 0, len(keys))
|
||||
appHash, consHash, resHash, 0, len(keys),
|
||||
)
|
||||
}
|
||||
|
||||
func TestInquirerVerifyHistorical(t *testing.T) {
|
||||
@@ -183,10 +189,13 @@ func TestInquirerVerifyHistorical(t *testing.T) {
|
||||
// Souce doesn't have fcz[9] so cert.LastTrustedHeight wont' change.
|
||||
err = source.SaveFullCommit(fcz[7])
|
||||
require.Nil(err, "%+v", err)
|
||||
sh := fcz[8].SignedHeader
|
||||
err = cert.Verify(sh)
|
||||
require.Nil(err, "%+v", err)
|
||||
assert.Equal(fcz[7].Height(), cert.LastTrustedHeight())
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// sh := fcz[8].SignedHeader
|
||||
// err = cert.Verify(sh)
|
||||
// require.Nil(err, "%+v", err)
|
||||
// assert.Equal(fcz[7].Height(), cert.LastTrustedHeight())
|
||||
|
||||
commit, err := trust.LatestFullCommit(chainID, fcz[8].Height(), fcz[8].Height())
|
||||
require.NotNil(err, "%+v", err)
|
||||
assert.Equal(commit, (FullCommit{}))
|
||||
@@ -194,13 +203,17 @@ func TestInquirerVerifyHistorical(t *testing.T) {
|
||||
// With fcz[9] Verify will update last trusted height.
|
||||
err = source.SaveFullCommit(fcz[9])
|
||||
require.Nil(err, "%+v", err)
|
||||
sh = fcz[8].SignedHeader
|
||||
err = cert.Verify(sh)
|
||||
require.Nil(err, "%+v", err)
|
||||
assert.Equal(fcz[8].Height(), cert.LastTrustedHeight())
|
||||
commit, err = trust.LatestFullCommit(chainID, fcz[8].Height(), fcz[8].Height())
|
||||
require.Nil(err, "%+v", err)
|
||||
assert.Equal(commit.Height(), fcz[8].Height())
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// sh = fcz[8].SignedHeader
|
||||
// err = cert.Verify(sh)
|
||||
// require.Nil(err, "%+v", err)
|
||||
// assert.Equal(fcz[8].Height(), cert.LastTrustedHeight())
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// commit, err = trust.LatestFullCommit(chainID, fcz[8].Height(), fcz[8].Height())
|
||||
// require.Nil(err, "%+v", err)
|
||||
// assert.Equal(commit.Height(), fcz[8].Height())
|
||||
|
||||
// Add access to all full commits via untrusted source.
|
||||
for i := 0; i < count; i++ {
|
||||
@@ -208,17 +221,19 @@ func TestInquirerVerifyHistorical(t *testing.T) {
|
||||
require.Nil(err)
|
||||
}
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// Try to check an unknown seed in the past.
|
||||
sh = fcz[3].SignedHeader
|
||||
err = cert.Verify(sh)
|
||||
require.Nil(err, "%+v", err)
|
||||
assert.Equal(fcz[8].Height(), cert.LastTrustedHeight())
|
||||
// sh = fcz[3].SignedHeader
|
||||
// err = cert.Verify(sh)
|
||||
// require.Nil(err, "%+v", err)
|
||||
// assert.Equal(fcz[8].Height(), cert.LastTrustedHeight())
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// Jump all the way forward again.
|
||||
sh = fcz[count-1].SignedHeader
|
||||
err = cert.Verify(sh)
|
||||
require.Nil(err, "%+v", err)
|
||||
assert.Equal(fcz[9].Height(), cert.LastTrustedHeight())
|
||||
// sh = fcz[count-1].SignedHeader
|
||||
// err = cert.Verify(sh)
|
||||
// require.Nil(err, "%+v", err)
|
||||
// assert.Equal(fcz[9].Height(), cert.LastTrustedHeight())
|
||||
}
|
||||
|
||||
func TestConcurrencyInquirerVerify(t *testing.T) {
|
||||
@@ -266,6 +281,7 @@ func TestConcurrencyInquirerVerify(t *testing.T) {
|
||||
var wg sync.WaitGroup
|
||||
count = 100
|
||||
errList := make([]error, count)
|
||||
|
||||
for i := 0; i < count; i++ {
|
||||
wg.Add(1)
|
||||
go func(index int) {
|
||||
@@ -273,8 +289,11 @@ func TestConcurrencyInquirerVerify(t *testing.T) {
|
||||
defer wg.Done()
|
||||
}(i)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
for _, err := range errList {
|
||||
require.Nil(err)
|
||||
}
|
||||
|
||||
// TODO: Requires proposer address to be set in header.
|
||||
// for _, err := range errList {
|
||||
// require.Nil(err)
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -10,10 +10,9 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/rpc/client"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
"github.com/tendermint/tendermint/rpc/core"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
@@ -46,7 +45,7 @@ func StartProxy(c rpcclient.Client, listenAddr string, logger log.Logger, maxOpe
|
||||
}
|
||||
wm := rpcserver.NewWebsocketManager(r, cdc, rpcserver.OnDisconnect(unsubscribeFromAllEvents))
|
||||
wm.SetLogger(logger)
|
||||
core.SetLogger(logger)
|
||||
// core.SetLogger(logger)
|
||||
mux.HandleFunc(wsEndpoint, wm.WebsocketHandler)
|
||||
|
||||
config := rpcserver.DefaultConfig()
|
||||
@@ -55,7 +54,7 @@ func StartProxy(c rpcclient.Client, listenAddr string, logger log.Logger, maxOpe
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return rpcserver.StartHTTPServer(l, mux, logger, config)
|
||||
return rpcserver.Serve(l, mux, logger, config)
|
||||
}
|
||||
|
||||
// RPCRoutes just routes everything to the given client, as if it were
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/tendermint/tendermint/lite"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
)
|
||||
|
||||
var _ rpcclient.Client = Wrapper{}
|
||||
|
||||
@@ -729,8 +729,8 @@ func (c *Client) bisection(
|
||||
case ErrNewValSetCantBeTrusted:
|
||||
// do add another header to the end of the cache
|
||||
if depth == len(headerCache)-1 {
|
||||
pivotHeight := (headerCache[depth].sh.Height + trustedHeader.
|
||||
Height) * bisectionNumerator / bisectionDenominator
|
||||
pivotHeight := trustedHeader.Height + (headerCache[depth].sh.Height-trustedHeader.
|
||||
Height)*bisectionNumerator/bisectionDenominator
|
||||
interimHeader, interimVals, err := c.fetchHeaderAndValsAtHeight(pivotHeight)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -27,13 +27,13 @@ var (
|
||||
vals = keys.ToValidators(20, 10)
|
||||
bTime, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
|
||||
h1 = keys.GenSignedHeader(chainID, 1, bTime, nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
// 3/3 signed
|
||||
h2 = keys.GenSignedHeaderLastBlockID(chainID, 2, bTime.Add(30*time.Minute), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys), types.BlockID{Hash: h1.Hash()})
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys), types.BlockID{Hash: h1.Hash()})
|
||||
// 3/3 signed
|
||||
h3 = keys.GenSignedHeaderLastBlockID(chainID, 3, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys), types.BlockID{Hash: h2.Hash()})
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys), types.BlockID{Hash: h2.Hash()})
|
||||
trustPeriod = 4 * time.Hour
|
||||
trustOptions = lite.TrustOptions{
|
||||
Period: 4 * time.Hour,
|
||||
@@ -85,7 +85,7 @@ func TestClient_SequentialVerification(t *testing.T) {
|
||||
map[int64]*types.SignedHeader{
|
||||
// different header
|
||||
1: keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
},
|
||||
map[int64]*types.ValidatorSet{
|
||||
1: vals,
|
||||
@@ -100,10 +100,10 @@ func TestClient_SequentialVerification(t *testing.T) {
|
||||
1: h1,
|
||||
// interim header (1/3 signed)
|
||||
2: keys.GenSignedHeader(chainID, 2, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), len(keys)-1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), len(keys)-1, len(keys)),
|
||||
// last header (3/3 signed)
|
||||
3: keys.GenSignedHeader(chainID, 3, bTime.Add(2*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
},
|
||||
valSet,
|
||||
false,
|
||||
@@ -116,10 +116,10 @@ func TestClient_SequentialVerification(t *testing.T) {
|
||||
1: h1,
|
||||
// interim header (3/3 signed)
|
||||
2: keys.GenSignedHeader(chainID, 2, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
// last header (1/3 signed)
|
||||
3: keys.GenSignedHeader(chainID, 3, bTime.Add(2*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), len(keys)-1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), len(keys)-1, len(keys)),
|
||||
},
|
||||
valSet,
|
||||
false,
|
||||
@@ -209,7 +209,7 @@ func TestClient_SkippingVerification(t *testing.T) {
|
||||
// trusted header
|
||||
1: h1,
|
||||
3: transitKeys.GenSignedHeader(chainID, 3, bTime.Add(2*time.Hour), nil, transitVals, transitVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(transitKeys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(transitKeys)),
|
||||
},
|
||||
map[int64]*types.ValidatorSet{
|
||||
1: vals,
|
||||
@@ -226,10 +226,10 @@ func TestClient_SkippingVerification(t *testing.T) {
|
||||
1: h1,
|
||||
// interim header (3/3 signed)
|
||||
2: keys.GenSignedHeader(chainID, 2, bTime.Add(1*time.Hour), nil, vals, newVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
// last header (0/4 of the original val set signed)
|
||||
3: newKeys.GenSignedHeader(chainID, 3, bTime.Add(2*time.Hour), nil, newVals, newVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(newKeys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(newKeys)),
|
||||
},
|
||||
map[int64]*types.ValidatorSet{
|
||||
1: vals,
|
||||
@@ -246,10 +246,10 @@ func TestClient_SkippingVerification(t *testing.T) {
|
||||
1: h1,
|
||||
// last header (0/4 of the original val set signed)
|
||||
2: keys.GenSignedHeader(chainID, 2, bTime.Add(1*time.Hour), nil, vals, newVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, 0),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, 0),
|
||||
// last header (0/4 of the original val set signed)
|
||||
3: newKeys.GenSignedHeader(chainID, 3, bTime.Add(2*time.Hour), nil, newVals, newVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(newKeys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(newKeys)),
|
||||
},
|
||||
map[int64]*types.ValidatorSet{
|
||||
1: vals,
|
||||
@@ -295,6 +295,30 @@ func TestClient_SkippingVerification(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// start from a large header to make sure that the pivot height doesn't select a height outside
|
||||
// the appropriate range
|
||||
veryLargeFullNode := mockp.New(GenMockNode(chainID, 100, 3, 1, bTime))
|
||||
h1, err := veryLargeFullNode.SignedHeader(90)
|
||||
require.NoError(t, err)
|
||||
c, err := lite.NewClient(
|
||||
chainID,
|
||||
lite.TrustOptions{
|
||||
Period: 4 * time.Hour,
|
||||
Height: 90,
|
||||
Hash: h1.Hash(),
|
||||
},
|
||||
veryLargeFullNode,
|
||||
[]provider.Provider{veryLargeFullNode},
|
||||
dbs.New(dbm.NewMemDB(), chainID),
|
||||
lite.SkippingVerification(lite.DefaultTrustLevel),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
h, err := c.Update(bTime.Add(100 * time.Minute))
|
||||
assert.NoError(t, err)
|
||||
h2, err := veryLargeFullNode.SignedHeader(100)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, h, h2)
|
||||
}
|
||||
|
||||
func TestClient_Cleanup(t *testing.T) {
|
||||
@@ -362,7 +386,7 @@ func TestClientRestoresTrustedHeaderAfterStartup1(t *testing.T) {
|
||||
|
||||
// header1 != header
|
||||
header1 := keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
|
||||
primary := mockp.New(
|
||||
chainID,
|
||||
@@ -447,10 +471,10 @@ func TestClientRestoresTrustedHeaderAfterStartup2(t *testing.T) {
|
||||
|
||||
// header1 != header
|
||||
diffHeader1 := keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
|
||||
diffHeader2 := keys.GenSignedHeader(chainID, 2, bTime.Add(2*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
|
||||
primary := mockp.New(
|
||||
chainID,
|
||||
@@ -541,10 +565,10 @@ func TestClientRestoresTrustedHeaderAfterStartup3(t *testing.T) {
|
||||
|
||||
// header1 != header
|
||||
header1 := keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
|
||||
header2 := keys.GenSignedHeader(chainID, 2, bTime.Add(2*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
err = trustedStore.SaveSignedHeaderAndValidatorSet(header2, vals)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -748,7 +772,7 @@ func TestClient_BackwardsVerification(t *testing.T) {
|
||||
map[int64]*types.SignedHeader{
|
||||
1: h1,
|
||||
2: keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
3: h3,
|
||||
},
|
||||
valSet,
|
||||
@@ -761,7 +785,7 @@ func TestClient_BackwardsVerification(t *testing.T) {
|
||||
map[int64]*types.SignedHeader{
|
||||
1: h1,
|
||||
2: keys.GenSignedHeader(chainID, 2, bTime.Add(30*time.Minute), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
3: h3,
|
||||
},
|
||||
valSet,
|
||||
@@ -841,7 +865,7 @@ func TestClientRemovesWitnessIfItSendsUsIncorrectHeader(t *testing.T) {
|
||||
map[int64]*types.SignedHeader{
|
||||
1: h1,
|
||||
2: keys.GenSignedHeaderLastBlockID(chainID, 2, bTime.Add(30*time.Minute), nil, vals, vals,
|
||||
[]byte("app_hash2"), []byte("cons_hash"), []byte("results_hash"),
|
||||
hash("app_hash2"), hash("cons_hash"), hash("results_hash"),
|
||||
len(keys), len(keys), types.BlockID{Hash: h1.Hash()}),
|
||||
},
|
||||
map[int64]*types.ValidatorSet{
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
tmtime "github.com/tendermint/tendermint/types/time"
|
||||
@@ -134,6 +135,7 @@ func genHeader(chainID string, height int64, bTime time.Time, txs types.Txs,
|
||||
AppHash: appHash,
|
||||
ConsensusHash: consHash,
|
||||
LastResultsHash: resHash,
|
||||
ProposerAddress: valset.Validators[0].Address,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,8 +196,8 @@ func GenMockNode(
|
||||
|
||||
// genesis header and vals
|
||||
lastHeader := keys.GenSignedHeader(chainID, 1, bTime.Add(1*time.Minute), nil,
|
||||
keys.ToValidators(2, 2), newKeys.ToValidators(2, 2), []byte("app_hash"), []byte("cons_hash"),
|
||||
[]byte("results_hash"), 0, len(keys))
|
||||
keys.ToValidators(2, 2), newKeys.ToValidators(2, 2), hash("app_hash"), hash("cons_hash"),
|
||||
hash("results_hash"), 0, len(keys))
|
||||
currentHeader := lastHeader
|
||||
headers[1] = currentHeader
|
||||
valset[1] = keys.ToValidators(2, 2)
|
||||
@@ -208,8 +210,8 @@ func GenMockNode(
|
||||
newKeys = keys.ChangeKeys(valVariationInt)
|
||||
currentHeader = keys.GenSignedHeaderLastBlockID(chainID, height, bTime.Add(time.Duration(height)*time.Minute),
|
||||
nil,
|
||||
keys.ToValidators(2, 2), newKeys.ToValidators(2, 2), []byte("app_hash"), []byte("cons_hash"),
|
||||
[]byte("results_hash"), 0, len(keys), types.BlockID{Hash: lastHeader.Hash()})
|
||||
keys.ToValidators(2, 2), newKeys.ToValidators(2, 2), hash("app_hash"), hash("cons_hash"),
|
||||
hash("results_hash"), 0, len(keys), types.BlockID{Hash: lastHeader.Hash()})
|
||||
headers[height] = currentHeader
|
||||
valset[height] = keys.ToValidators(2, 2)
|
||||
lastHeader = currentHeader
|
||||
@@ -218,3 +220,7 @@ func GenMockNode(
|
||||
|
||||
return chainID, headers, valset
|
||||
}
|
||||
|
||||
func hash(s string) []byte {
|
||||
return tmhash.Sum([]byte(s))
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package http
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/tendermint/tendermint/lite2/provider"
|
||||
@@ -11,6 +12,9 @@ import (
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// This is very brittle, see: https://github.com/tendermint/tendermint/issues/4740
|
||||
var regexpMissingHeight = regexp.MustCompile(`height \d+ (must be less than or equal to|is not available)`)
|
||||
|
||||
// SignStatusClient combines a SignClient and StatusClient.
|
||||
type SignStatusClient interface {
|
||||
rpcclient.SignClient
|
||||
@@ -70,7 +74,7 @@ func (p *http) SignedHeader(height int64) (*types.SignedHeader, error) {
|
||||
commit, err := p.SignStatusClient.Commit(h)
|
||||
if err != nil {
|
||||
// TODO: standartise errors on the RPC side
|
||||
if strings.Contains(err.Error(), "height must be less than or equal") {
|
||||
if regexpMissingHeight.MatchString(err.Error()) {
|
||||
return nil, provider.ErrSignedHeaderNotFound
|
||||
}
|
||||
return nil, err
|
||||
@@ -100,7 +104,7 @@ func (p *http) ValidatorSet(height int64) (*types.ValidatorSet, error) {
|
||||
res, err := p.SignStatusClient.Validators(h, 0, maxPerPage)
|
||||
if err != nil {
|
||||
// TODO: standartise errors on the RPC side
|
||||
if strings.Contains(err.Error(), "height must be less than or equal") {
|
||||
if regexpMissingHeight.MatchString(err.Error()) {
|
||||
return nil, provider.ErrValidatorSetNotFound
|
||||
}
|
||||
return nil, err
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/kvstore"
|
||||
"github.com/tendermint/tendermint/lite2/provider"
|
||||
"github.com/tendermint/tendermint/lite2/provider/http"
|
||||
litehttp "github.com/tendermint/tendermint/lite2/provider/http"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
@@ -32,6 +33,7 @@ func TestNewProvider(t *testing.T) {
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
app := kvstore.NewApplication()
|
||||
app.RetainBlocks = 5
|
||||
node := rpctest.StartTendermint(app)
|
||||
|
||||
code := m.Run()
|
||||
@@ -68,8 +70,25 @@ func TestProvider(t *testing.T) {
|
||||
assert.Nil(t, sh.ValidateBasic(chainID))
|
||||
|
||||
// historical queries now work :)
|
||||
lower := sh.Height - 5
|
||||
lower := sh.Height - 3
|
||||
sh, err = p.SignedHeader(lower)
|
||||
assert.Nil(t, err, "%+v", err)
|
||||
assert.Equal(t, lower, sh.Height)
|
||||
|
||||
// fetching missing heights (both future and pruned) should return appropriate errors
|
||||
_, err = p.SignedHeader(1000)
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, provider.ErrSignedHeaderNotFound, err)
|
||||
|
||||
_, err = p.ValidatorSet(1000)
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, provider.ErrValidatorSetNotFound, err)
|
||||
|
||||
_, err = p.SignedHeader(1)
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, provider.ErrSignedHeaderNotFound, err)
|
||||
|
||||
_, err = p.ValidatorSet(1)
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, provider.ErrValidatorSetNotFound, err)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
|
||||
lrpc "github.com/tendermint/tendermint/lite2/rpc"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
|
||||
)
|
||||
|
||||
// A Proxy defines parameters for running an HTTP server proxy.
|
||||
@@ -37,7 +37,7 @@ func (p *Proxy) ListenAndServe() error {
|
||||
}
|
||||
p.Listener = listener
|
||||
|
||||
return rpcserver.StartHTTPServer(
|
||||
return rpcserver.Serve(
|
||||
listener,
|
||||
mux,
|
||||
p.Logger,
|
||||
@@ -55,7 +55,7 @@ func (p *Proxy) ListenAndServeTLS(certFile, keyFile string) error {
|
||||
}
|
||||
p.Listener = listener
|
||||
|
||||
return rpcserver.StartHTTPAndTLSServer(
|
||||
return rpcserver.ServeTLS(
|
||||
listener,
|
||||
mux,
|
||||
certFile,
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/bytes"
|
||||
lrpc "github.com/tendermint/tendermint/lite2/rpc"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
lite "github.com/tendermint/tendermint/lite2"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
vals = keys.ToValidators(20, 10)
|
||||
bTime, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
|
||||
header = keys.GenSignedHeader(chainID, lastHeight, bTime, nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
)
|
||||
|
||||
testCases := []struct {
|
||||
@@ -52,18 +52,18 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// different chainID -> error
|
||||
1: {
|
||||
keys.GenSignedHeader("different-chainID", nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
nil,
|
||||
"untrustedHeader.ValidateBasic failed: signedHeader belongs to another chain 'different-chainID' not" +
|
||||
" 'TestVerifyAdjacentHeaders'",
|
||||
"untrustedHeader.ValidateBasic failed: header belongs to another chain \"different-chainID\", not" +
|
||||
" \"TestVerifyAdjacentHeaders\"",
|
||||
},
|
||||
// new header's time is before old header's time -> error
|
||||
2: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(-1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -73,7 +73,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// new header's time is from the future -> error
|
||||
3: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(3*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -84,7 +84,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
4: {
|
||||
keys.GenSignedHeader(chainID, nextHeight,
|
||||
bTime.Add(2*time.Hour).Add(maxClockDrift).Add(-1*time.Millisecond), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -94,7 +94,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// 3/3 signed -> no error
|
||||
5: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -104,7 +104,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// 2/3 signed -> no error
|
||||
6: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 1, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -114,7 +114,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// 1/3 signed -> error
|
||||
7: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), len(keys)-1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), len(keys)-1, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -124,7 +124,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// vals does not match with what we have -> error
|
||||
8: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, keys.ToValidators(10, 1), vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
keys.ToValidators(10, 1),
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -134,7 +134,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// vals are inconsistent with newHeader -> error
|
||||
9: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
keys.ToValidators(10, 1),
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -144,7 +144,7 @@ func TestVerifyAdjacentHeaders(t *testing.T) {
|
||||
// old header has expired -> error
|
||||
10: {
|
||||
keys.GenSignedHeader(chainID, nextHeight, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
keys.ToValidators(10, 1),
|
||||
1 * time.Hour,
|
||||
bTime.Add(1 * time.Hour),
|
||||
@@ -182,7 +182,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
vals = keys.ToValidators(20, 10)
|
||||
bTime, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
|
||||
header = keys.GenSignedHeader(chainID, lastHeight, bTime, nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
|
||||
// 30, 40, 50
|
||||
twoThirds = keys[1:]
|
||||
@@ -208,7 +208,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 3/3 new vals signed, 3/3 old vals present -> no error
|
||||
0: {
|
||||
keys.GenSignedHeader(chainID, 3, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -218,7 +218,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 2/3 new vals signed, 3/3 old vals present -> no error
|
||||
1: {
|
||||
keys.GenSignedHeader(chainID, 4, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 1, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -228,7 +228,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 1/3 new vals signed, 3/3 old vals present -> error
|
||||
2: {
|
||||
keys.GenSignedHeader(chainID, 5, bTime.Add(1*time.Hour), nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), len(keys)-1, len(keys)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), len(keys)-1, len(keys)),
|
||||
vals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -238,7 +238,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 3/3 new vals signed, 2/3 old vals present -> no error
|
||||
3: {
|
||||
twoThirds.GenSignedHeader(chainID, 5, bTime.Add(1*time.Hour), nil, twoThirdsVals, twoThirdsVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(twoThirds)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(twoThirds)),
|
||||
twoThirdsVals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -248,7 +248,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 3/3 new vals signed, 1/3 old vals present -> no error
|
||||
4: {
|
||||
oneThird.GenSignedHeader(chainID, 5, bTime.Add(1*time.Hour), nil, oneThirdVals, oneThirdVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(oneThird)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(oneThird)),
|
||||
oneThirdVals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -258,7 +258,7 @@ func TestVerifyNonAdjacentHeaders(t *testing.T) {
|
||||
// 3/3 new vals signed, less than 1/3 old vals present -> error
|
||||
5: {
|
||||
lessThanOneThird.GenSignedHeader(chainID, 5, bTime.Add(1*time.Hour), nil, lessThanOneThirdVals, lessThanOneThirdVals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(lessThanOneThird)),
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(lessThanOneThird)),
|
||||
lessThanOneThirdVals,
|
||||
3 * time.Hour,
|
||||
bTime.Add(2 * time.Hour),
|
||||
@@ -298,7 +298,7 @@ func TestVerifyReturnsErrorIfTrustLevelIsInvalid(t *testing.T) {
|
||||
vals = keys.ToValidators(20, 10)
|
||||
bTime, _ = time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
|
||||
header = keys.GenSignedHeader(chainID, lastHeight, bTime, nil, vals, vals,
|
||||
[]byte("app_hash"), []byte("cons_hash"), []byte("results_hash"), 0, len(keys))
|
||||
hash("app_hash"), hash("cons_hash"), hash("results_hash"), 0, len(keys))
|
||||
)
|
||||
|
||||
err := lite.Verify(chainID, header, vals, header, vals, 2*time.Hour, time.Now(), maxClockDrift,
|
||||
|
||||
@@ -7,9 +7,6 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
@@ -32,9 +29,8 @@ import (
|
||||
// be efficiently accessed by multiple concurrent readers.
|
||||
type CListMempool struct {
|
||||
// Atomic integers
|
||||
height int64 // the last block Update()'d to
|
||||
txsBytes int64 // total size of mempool, in bytes
|
||||
rechecking int32 // for re-checking filtered txs on Update()
|
||||
height int64 // the last block Update()'d to
|
||||
txsBytes int64 // total size of mempool, in bytes
|
||||
|
||||
// notify listeners (ie. consensus) when txs are available
|
||||
notifiedTxsAvailable bool
|
||||
@@ -42,15 +38,19 @@ type CListMempool struct {
|
||||
|
||||
config *cfg.MempoolConfig
|
||||
|
||||
proxyMtx sync.Mutex
|
||||
// Exclusive mutex for Update method to prevent concurrent execution of
|
||||
// CheckTx or ReapMaxBytesMaxGas(ReapMaxTxs) methods.
|
||||
updateMtx sync.RWMutex
|
||||
preCheck PreCheckFunc
|
||||
postCheck PostCheckFunc
|
||||
|
||||
wal *auto.AutoFile // a log of mempool txs
|
||||
txs *clist.CList // concurrent linked-list of good txs
|
||||
proxyAppConn proxy.AppConnMempool
|
||||
txs *clist.CList // concurrent linked-list of good txs
|
||||
preCheck PreCheckFunc
|
||||
postCheck PostCheckFunc
|
||||
|
||||
// Track whether we're rechecking txs.
|
||||
// These are not protected by a mutex and are expected to be mutated
|
||||
// in serial (ie. by abci responses which are called in serial).
|
||||
// These are not protected by a mutex and are expected to be mutated in
|
||||
// serial (ie. by abci responses which are called in serial).
|
||||
recheckCursor *clist.CElement // next expected response
|
||||
recheckEnd *clist.CElement // re-checking stops here
|
||||
|
||||
@@ -62,9 +62,6 @@ type CListMempool struct {
|
||||
// This reduces the pressure on the proxyApp.
|
||||
cache txCache
|
||||
|
||||
// A log of mempool txs
|
||||
wal *auto.AutoFile
|
||||
|
||||
logger log.Logger
|
||||
|
||||
metrics *Metrics
|
||||
@@ -87,7 +84,6 @@ func NewCListMempool(
|
||||
proxyAppConn: proxyAppConn,
|
||||
txs: clist.New(),
|
||||
height: height,
|
||||
rechecking: 0,
|
||||
recheckCursor: nil,
|
||||
recheckEnd: nil,
|
||||
logger: log.NewNopLogger(),
|
||||
@@ -132,55 +128,64 @@ func WithMetrics(metrics *Metrics) CListMempoolOption {
|
||||
return func(mem *CListMempool) { mem.metrics = metrics }
|
||||
}
|
||||
|
||||
// *panics* if can't create directory or open file.
|
||||
// *not thread safe*
|
||||
func (mem *CListMempool) InitWAL() {
|
||||
walDir := mem.config.WalDir()
|
||||
err := tmos.EnsureDir(walDir, 0700)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "Error ensuring WAL dir"))
|
||||
func (mem *CListMempool) InitWAL() error {
|
||||
var (
|
||||
walDir = mem.config.WalDir()
|
||||
walFile = walDir + "/wal"
|
||||
)
|
||||
|
||||
const perm = 0700
|
||||
if err := tmos.EnsureDir(walDir, perm); err != nil {
|
||||
return err
|
||||
}
|
||||
af, err := auto.OpenAutoFile(walDir + "/wal")
|
||||
|
||||
af, err := auto.OpenAutoFile(walFile)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "Error opening WAL file"))
|
||||
return fmt.Errorf("can't open autofile %s: %w", walFile, err)
|
||||
}
|
||||
|
||||
mem.wal = af
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mem *CListMempool) CloseWAL() {
|
||||
mem.proxyMtx.Lock()
|
||||
defer mem.proxyMtx.Unlock()
|
||||
|
||||
if err := mem.wal.Close(); err != nil {
|
||||
mem.logger.Error("Error closing WAL", "err", err)
|
||||
}
|
||||
mem.wal = nil
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) Lock() {
|
||||
mem.proxyMtx.Lock()
|
||||
mem.updateMtx.Lock()
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) Unlock() {
|
||||
mem.proxyMtx.Unlock()
|
||||
mem.updateMtx.Unlock()
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) Size() int {
|
||||
return mem.txs.Len()
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) TxsBytes() int64 {
|
||||
return atomic.LoadInt64(&mem.txsBytes)
|
||||
}
|
||||
|
||||
// Lock() must be help by the caller during execution.
|
||||
func (mem *CListMempool) FlushAppConn() error {
|
||||
return mem.proxyAppConn.FlushSync()
|
||||
}
|
||||
|
||||
// XXX: Unsafe! Calling Flush may leave mempool in inconsistent state.
|
||||
func (mem *CListMempool) Flush() {
|
||||
mem.proxyMtx.Lock()
|
||||
defer mem.proxyMtx.Unlock()
|
||||
mem.updateMtx.RLock()
|
||||
defer mem.updateMtx.RUnlock()
|
||||
|
||||
_ = atomic.SwapInt64(&mem.txsBytes, 0)
|
||||
mem.cache.Reset()
|
||||
|
||||
for e := mem.txs.Front(); e != nil; e = e.Next() {
|
||||
@@ -188,13 +193,17 @@ func (mem *CListMempool) Flush() {
|
||||
e.DetachPrev()
|
||||
}
|
||||
|
||||
mem.txsMap = sync.Map{}
|
||||
_ = atomic.SwapInt64(&mem.txsBytes, 0)
|
||||
mem.txsMap.Range(func(key, _ interface{}) bool {
|
||||
mem.txsMap.Delete(key)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
// TxsFront returns the first transaction in the ordered list for peer
|
||||
// goroutines to call .NextWait() on.
|
||||
// FIXME: leaking implementation details!
|
||||
//
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) TxsFront() *clist.CElement {
|
||||
return mem.txs.Front()
|
||||
}
|
||||
@@ -202,6 +211,8 @@ func (mem *CListMempool) TxsFront() *clist.CElement {
|
||||
// TxsWaitChan returns a channel to wait on transactions. It will be closed
|
||||
// once the mempool is not empty (ie. the internal `mem.txs` has at least one
|
||||
// element)
|
||||
//
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) TxsWaitChan() <-chan struct{} {
|
||||
return mem.txs.WaitChan()
|
||||
}
|
||||
@@ -210,21 +221,17 @@ func (mem *CListMempool) TxsWaitChan() <-chan struct{} {
|
||||
// cb: A callback from the CheckTx command.
|
||||
// It gets called from another goroutine.
|
||||
// CONTRACT: Either cb will get called, or err returned.
|
||||
func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo TxInfo) (err error) {
|
||||
mem.proxyMtx.Lock()
|
||||
//
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo TxInfo) error {
|
||||
mem.updateMtx.RLock()
|
||||
// use defer to unlock mutex because application (*local client*) might panic
|
||||
defer mem.proxyMtx.Unlock()
|
||||
defer mem.updateMtx.RUnlock()
|
||||
|
||||
var (
|
||||
memSize = mem.Size()
|
||||
txsBytes = mem.TxsBytes()
|
||||
txSize = len(tx)
|
||||
)
|
||||
if memSize >= mem.config.Size ||
|
||||
int64(txSize)+txsBytes > mem.config.MaxTxsBytes {
|
||||
return ErrMempoolIsFull{
|
||||
memSize, mem.config.Size,
|
||||
txsBytes, mem.config.MaxTxsBytes}
|
||||
txSize := len(tx)
|
||||
|
||||
if err := mem.isFull(txSize); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// The size of the corresponding amino-encoded TxMessage
|
||||
@@ -274,7 +281,7 @@ func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo Tx
|
||||
// END WAL
|
||||
|
||||
// NOTE: proxyAppConn may error if tx buffer is full
|
||||
if err = mem.proxyAppConn.Error(); err != nil {
|
||||
if err := mem.proxyAppConn.Error(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -290,7 +297,9 @@ func (mem *CListMempool) CheckTx(tx types.Tx, cb func(*abci.Response), txInfo Tx
|
||||
// and peerID is not included in the ABCI request, so we have to set request-specific callbacks that
|
||||
// include this information. If we're not in the midst of a recheck, this function will just return,
|
||||
// so the request specific callback can do the work.
|
||||
// When rechecking, we don't need the peerID, so the recheck callback happens here.
|
||||
//
|
||||
// When rechecking, we don't need the peerID, so the recheck callback happens
|
||||
// here.
|
||||
func (mem *CListMempool) globalCb(req *abci.Request, res *abci.Response) {
|
||||
if mem.recheckCursor == nil {
|
||||
return
|
||||
@@ -359,6 +368,22 @@ func (mem *CListMempool) removeTx(tx types.Tx, elem *clist.CElement, removeFromC
|
||||
}
|
||||
}
|
||||
|
||||
func (mem *CListMempool) isFull(txSize int) error {
|
||||
var (
|
||||
memSize = mem.Size()
|
||||
txsBytes = mem.TxsBytes()
|
||||
)
|
||||
|
||||
if memSize >= mem.config.Size || int64(txSize)+txsBytes > mem.config.MaxTxsBytes {
|
||||
return ErrMempoolIsFull{
|
||||
memSize, mem.config.Size,
|
||||
txsBytes, mem.config.MaxTxsBytes,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// callback, which is called after the app checked the tx for the first time.
|
||||
//
|
||||
// The case where the app checks the tx for the second and subsequent times is
|
||||
@@ -376,6 +401,15 @@ func (mem *CListMempool) resCbFirstTime(
|
||||
postCheckErr = mem.postCheck(tx, r.CheckTx)
|
||||
}
|
||||
if (r.CheckTx.Code == abci.CodeTypeOK) && postCheckErr == nil {
|
||||
// Check mempool isn't full again to reduce the chance of exceeding the
|
||||
// limits.
|
||||
if err := mem.isFull(len(tx)); err != nil {
|
||||
// remove from cache (mempool might have a space later)
|
||||
mem.cache.Remove(tx)
|
||||
mem.logger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
memTx := &mempoolTx{
|
||||
height: mem.height,
|
||||
gasWanted: r.CheckTx.GasWanted,
|
||||
@@ -437,7 +471,6 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
|
||||
}
|
||||
if mem.recheckCursor == nil {
|
||||
// Done!
|
||||
atomic.StoreInt32(&mem.rechecking, 0)
|
||||
mem.logger.Info("Done rechecking txs")
|
||||
|
||||
// incase the recheck removed all txs
|
||||
@@ -450,6 +483,7 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) TxsAvailable() <-chan struct{} {
|
||||
return mem.txsAvailable
|
||||
}
|
||||
@@ -468,17 +502,15 @@ func (mem *CListMempool) notifyTxsAvailable() {
|
||||
}
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) ReapMaxBytesMaxGas(maxBytes, maxGas int64) types.Txs {
|
||||
mem.proxyMtx.Lock()
|
||||
defer mem.proxyMtx.Unlock()
|
||||
mem.updateMtx.RLock()
|
||||
defer mem.updateMtx.RUnlock()
|
||||
|
||||
for atomic.LoadInt32(&mem.rechecking) > 0 {
|
||||
// TODO: Something better?
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
}
|
||||
|
||||
var totalBytes int64
|
||||
var totalGas int64
|
||||
var (
|
||||
totalBytes int64
|
||||
totalGas int64
|
||||
)
|
||||
// TODO: we will get a performance boost if we have a good estimate of avg
|
||||
// size per tx, and set the initial capacity based off of that.
|
||||
// txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max/mem.avgTxSize))
|
||||
@@ -505,19 +537,15 @@ func (mem *CListMempool) ReapMaxBytesMaxGas(maxBytes, maxGas int64) types.Txs {
|
||||
return txs
|
||||
}
|
||||
|
||||
// Safe for concurrent use by multiple goroutines.
|
||||
func (mem *CListMempool) ReapMaxTxs(max int) types.Txs {
|
||||
mem.proxyMtx.Lock()
|
||||
defer mem.proxyMtx.Unlock()
|
||||
mem.updateMtx.RLock()
|
||||
defer mem.updateMtx.RUnlock()
|
||||
|
||||
if max < 0 {
|
||||
max = mem.txs.Len()
|
||||
}
|
||||
|
||||
for atomic.LoadInt32(&mem.rechecking) > 0 {
|
||||
// TODO: Something better?
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
}
|
||||
|
||||
txs := make([]types.Tx, 0, tmmath.MinInt(mem.txs.Len(), max))
|
||||
for e := mem.txs.Front(); e != nil && len(txs) <= max; e = e.Next() {
|
||||
memTx := e.Value.(*mempoolTx)
|
||||
@@ -526,6 +554,7 @@ func (mem *CListMempool) ReapMaxTxs(max int) types.Txs {
|
||||
return txs
|
||||
}
|
||||
|
||||
// Lock() must be help by the caller during execution.
|
||||
func (mem *CListMempool) Update(
|
||||
height int64,
|
||||
txs types.Txs,
|
||||
@@ -593,7 +622,6 @@ func (mem *CListMempool) recheckTxs() {
|
||||
panic("recheckTxs is called, but the mempool is empty")
|
||||
}
|
||||
|
||||
atomic.StoreInt32(&mem.rechecking, 1)
|
||||
mem.recheckCursor = mem.txs.Front()
|
||||
mem.recheckEnd = mem.txs.Back()
|
||||
|
||||
|
||||
@@ -6,19 +6,18 @@
|
||||
// safely by calling .NextWait() on each element.
|
||||
|
||||
// So we have several go-routines:
|
||||
// 1. Consensus calling Update() and Reap() synchronously
|
||||
// 1. Consensus calling Update() and ReapMaxBytesMaxGas() synchronously
|
||||
// 2. Many mempool reactor's peer routines calling CheckTx()
|
||||
// 3. Many mempool reactor's peer routines traversing the txs linked list
|
||||
// 4. Another goroutine calling GarbageCollectTxs() periodically
|
||||
|
||||
// To manage these goroutines, there are three methods of locking.
|
||||
// 1. Mutations to the linked-list is protected by an internal mtx (CList is goroutine-safe)
|
||||
// 2. Mutations to the linked-list elements are atomic
|
||||
// 3. CheckTx() calls can be paused upon Update() and Reap(), protected by .proxyMtx
|
||||
// 3. CheckTx() and/or ReapMaxBytesMaxGas() calls can be paused upon Update(), protected by .updateMtx
|
||||
|
||||
// Garbage collection of old elements from mempool.txs is handlde via
|
||||
// the DetachPrev() call, which makes old elements not reachable by
|
||||
// peer broadcastTxRoutine() automatically garbage collected.
|
||||
// Garbage collection of old elements from mempool.txs is handlde via the
|
||||
// DetachPrev() call, which makes old elements not reachable by peer
|
||||
// broadcastTxRoutine().
|
||||
|
||||
// TODO: Better handle abci client errors. (make it automatically handle connection errors)
|
||||
package mempool
|
||||
|
||||
@@ -37,7 +37,7 @@ type Mempool interface {
|
||||
|
||||
// Update informs the mempool that the given txs were committed and can be discarded.
|
||||
// NOTE: this should be called *after* block is committed by consensus.
|
||||
// NOTE: unsafe; Lock/Unlock must be managed by caller
|
||||
// NOTE: Lock/Unlock must be managed by caller
|
||||
Update(
|
||||
blockHeight int64,
|
||||
blockTxs types.Txs,
|
||||
@@ -48,6 +48,7 @@ type Mempool interface {
|
||||
|
||||
// FlushAppConn flushes the mempool connection to ensure async reqResCb calls are
|
||||
// done. E.g. from CheckTx.
|
||||
// NOTE: Lock/Unlock must be managed by caller
|
||||
FlushAppConn() error
|
||||
|
||||
// Flush removes all transactions from the mempool and cache
|
||||
@@ -68,8 +69,9 @@ type Mempool interface {
|
||||
// TxsBytes returns the total size of all txs in the mempool.
|
||||
TxsBytes() int64
|
||||
|
||||
// InitWAL creates a directory for the WAL file and opens a file itself.
|
||||
InitWAL()
|
||||
// InitWAL creates a directory for the WAL file and opens a file itself. If
|
||||
// there is an error, it will be of type *PathError.
|
||||
InitWAL() error
|
||||
|
||||
// CloseWAL closes and discards the underlying WAL file.
|
||||
// Any further writes will not be relayed to disk.
|
||||
|
||||
@@ -38,5 +38,5 @@ func (Mempool) TxsBytes() int64 { return 0 }
|
||||
func (Mempool) TxsFront() *clist.CElement { return nil }
|
||||
func (Mempool) TxsWaitChan() <-chan struct{} { return nil }
|
||||
|
||||
func (Mempool) InitWAL() {}
|
||||
func (Mempool) CloseWAL() {}
|
||||
func (Mempool) InitWAL() error { return nil }
|
||||
func (Mempool) CloseWAL() {}
|
||||
|
||||
102
node/node.go
102
node/node.go
@@ -7,7 +7,6 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // nolint: gosec // securely exposed on separate, optional port
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -39,7 +38,7 @@ import (
|
||||
rpccore "github.com/tendermint/tendermint/rpc/core"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
grpccore "github.com/tendermint/tendermint/rpc/grpc"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
|
||||
rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/state/txindex"
|
||||
"github.com/tendermint/tendermint/state/txindex/kv"
|
||||
@@ -88,31 +87,13 @@ type Provider func(*cfg.Config, log.Logger) (*Node, error)
|
||||
// PrivValidator, ClientCreator, GenesisDoc, and DBProvider.
|
||||
// It implements NodeProvider.
|
||||
func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) {
|
||||
// Generate node PrivKey
|
||||
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Convert old PrivValidator if it exists.
|
||||
oldPrivVal := config.OldPrivValidatorFile()
|
||||
newPrivValKey := config.PrivValidatorKeyFile()
|
||||
newPrivValState := config.PrivValidatorStateFile()
|
||||
if _, err := os.Stat(oldPrivVal); !os.IsNotExist(err) {
|
||||
oldPV, err := privval.LoadOldFilePV(oldPrivVal)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading OldPrivValidator from %v: %v", oldPrivVal, err)
|
||||
}
|
||||
logger.Info("Upgrading PrivValidator file",
|
||||
"old", oldPrivVal,
|
||||
"newKey", newPrivValKey,
|
||||
"newState", newPrivValState,
|
||||
)
|
||||
oldPV.Upgrade(newPrivValKey, newPrivValState)
|
||||
return nil, fmt.Errorf("failed to load or gen node key %s: %w", config.NodeKeyFile(), err)
|
||||
}
|
||||
|
||||
return NewNode(config,
|
||||
privval.LoadOrGenFilePV(newPrivValKey, newPrivValState),
|
||||
privval.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()),
|
||||
nodeKey,
|
||||
proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()),
|
||||
DefaultGenesisDocProviderFunc(config),
|
||||
@@ -792,7 +773,10 @@ func (n *Node) OnStart() error {
|
||||
n.isListening = true
|
||||
|
||||
if n.config.Mempool.WalEnabled() {
|
||||
n.mempool.InitWAL() // no need to have the mempool wal during tests
|
||||
err = n.mempool.InitWAL()
|
||||
if err != nil {
|
||||
return fmt.Errorf("init mempool WAL: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Start the switch (the P2P server).
|
||||
@@ -854,32 +838,42 @@ func (n *Node) OnStop() {
|
||||
}
|
||||
}
|
||||
|
||||
// ConfigureRPC sets all variables in rpccore so they will serve
|
||||
// rpc calls from this node
|
||||
func (n *Node) ConfigureRPC() {
|
||||
rpccore.SetStateDB(n.stateDB)
|
||||
rpccore.SetBlockStore(n.blockStore)
|
||||
rpccore.SetConsensusState(n.consensusState)
|
||||
rpccore.SetMempool(n.mempool)
|
||||
rpccore.SetEvidencePool(n.evidencePool)
|
||||
rpccore.SetP2PPeers(n.sw)
|
||||
rpccore.SetP2PTransport(n)
|
||||
// ConfigureRPC makes sure RPC has all the objects it needs to operate.
|
||||
func (n *Node) ConfigureRPC() error {
|
||||
pubKey, err := n.privValidator.GetPubKey()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return fmt.Errorf("can't get pubkey: %w", err)
|
||||
}
|
||||
rpccore.SetPubKey(pubKey)
|
||||
rpccore.SetGenesisDoc(n.genesisDoc)
|
||||
rpccore.SetProxyAppQuery(n.proxyApp.Query())
|
||||
rpccore.SetTxIndexer(n.txIndexer)
|
||||
rpccore.SetConsensusReactor(n.consensusReactor)
|
||||
rpccore.SetEventBus(n.eventBus)
|
||||
rpccore.SetLogger(n.Logger.With("module", "rpc"))
|
||||
rpccore.SetConfig(*n.config.RPC)
|
||||
rpccore.SetEnvironment(&rpccore.Environment{
|
||||
ProxyAppQuery: n.proxyApp.Query(),
|
||||
|
||||
StateDB: n.stateDB,
|
||||
BlockStore: n.blockStore,
|
||||
EvidencePool: n.evidencePool,
|
||||
ConsensusState: n.consensusState,
|
||||
P2PPeers: n.sw,
|
||||
P2PTransport: n,
|
||||
|
||||
PubKey: pubKey,
|
||||
GenDoc: n.genesisDoc,
|
||||
TxIndexer: n.txIndexer,
|
||||
ConsensusReactor: n.consensusReactor,
|
||||
EventBus: n.eventBus,
|
||||
Mempool: n.mempool,
|
||||
|
||||
Logger: n.Logger.With("module", "rpc"),
|
||||
|
||||
Config: *n.config.RPC,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *Node) startRPC() ([]net.Listener, error) {
|
||||
n.ConfigureRPC()
|
||||
err := n.ConfigureRPC()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
listenAddrs := splitAndTrimEmpty(n.config.RPC.ListenAddress, ",", " ")
|
||||
coreCodec := amino.NewCodec()
|
||||
ctypes.RegisterAmino(coreCodec)
|
||||
@@ -935,7 +929,7 @@ func (n *Node) startRPC() ([]net.Listener, error) {
|
||||
rootHandler = corsMiddleware.Handler(mux)
|
||||
}
|
||||
if n.config.RPC.IsTLSEnabled() {
|
||||
go rpcserver.StartHTTPAndTLSServer(
|
||||
go rpcserver.ServeTLS(
|
||||
listener,
|
||||
rootHandler,
|
||||
n.config.RPC.CertFile(),
|
||||
@@ -944,7 +938,7 @@ func (n *Node) startRPC() ([]net.Listener, error) {
|
||||
config,
|
||||
)
|
||||
} else {
|
||||
go rpcserver.StartHTTPServer(
|
||||
go rpcserver.Serve(
|
||||
listener,
|
||||
rootHandler,
|
||||
rpcLogger,
|
||||
@@ -1210,15 +1204,27 @@ func createAndStartPrivValidatorSocketClient(
|
||||
) (types.PrivValidator, error) {
|
||||
pve, err := privval.NewSignerListener(listenAddr, logger)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to start private validator")
|
||||
return nil, fmt.Errorf("failed to start private validator: %w", err)
|
||||
}
|
||||
|
||||
pvsc, err := privval.NewSignerClient(pve)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to start private validator")
|
||||
return nil, fmt.Errorf("failed to start private validator: %w", err)
|
||||
}
|
||||
|
||||
return pvsc, nil
|
||||
// try to get a pubkey from private validate first time
|
||||
_, err = pvsc.GetPubKey()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't get pubkey: %w", err)
|
||||
}
|
||||
|
||||
const (
|
||||
retries = 50 // 50 * 100ms = 5s total
|
||||
timeout = 100 * time.Millisecond
|
||||
)
|
||||
pvscWithRetries := privval.NewRetrySignerClient(pvsc, retries, timeout)
|
||||
|
||||
return pvscWithRetries, nil
|
||||
}
|
||||
|
||||
// splitAndTrimEmpty slices s into all subslices separated by sep and returns a
|
||||
|
||||
@@ -159,7 +159,7 @@ func TestNodeSetPrivValTCP(t *testing.T) {
|
||||
|
||||
n, err := DefaultNewNode(config, log.TestingLogger())
|
||||
require.NoError(t, err)
|
||||
assert.IsType(t, &privval.SignerClient{}, n.PrivValidator())
|
||||
assert.IsType(t, &privval.RetrySignerClient{}, n.PrivValidator())
|
||||
}
|
||||
|
||||
// address without a protocol must result in error
|
||||
@@ -203,7 +203,7 @@ func TestNodeSetPrivValIPC(t *testing.T) {
|
||||
|
||||
n, err := DefaultNewNode(config, log.TestingLogger())
|
||||
require.NoError(t, err)
|
||||
assert.IsType(t, &privval.SignerClient{}, n.PrivValidator())
|
||||
assert.IsType(t, &privval.RetrySignerClient{}, n.PrivValidator())
|
||||
}
|
||||
|
||||
// testFreeAddr claims a free port so we don't block on listener being ready.
|
||||
|
||||
@@ -313,21 +313,43 @@ var rfc4862 = net.IPNet{IP: net.ParseIP("FE80::"), Mask: net.CIDRMask(64, 128)}
|
||||
var rfc6052 = net.IPNet{IP: net.ParseIP("64:FF9B::"), Mask: net.CIDRMask(96, 128)}
|
||||
var rfc6145 = net.IPNet{IP: net.ParseIP("::FFFF:0:0:0"), Mask: net.CIDRMask(96, 128)}
|
||||
var zero4 = net.IPNet{IP: net.ParseIP("0.0.0.0"), Mask: net.CIDRMask(8, 32)}
|
||||
var (
|
||||
// onionCatNet defines the IPv6 address block used to support Tor.
|
||||
// bitcoind encodes a .onion address as a 16 byte number by decoding the
|
||||
// address prior to the .onion (i.e. the key hash) base32 into a ten
|
||||
// byte number. It then stores the first 6 bytes of the address as
|
||||
// 0xfd, 0x87, 0xd8, 0x7e, 0xeb, 0x43.
|
||||
//
|
||||
// This is the same range used by OnionCat, which is part part of the
|
||||
// RFC4193 unique local IPv6 range.
|
||||
//
|
||||
// In summary the format is:
|
||||
// { magic 6 bytes, 10 bytes base32 decode of key hash }
|
||||
onionCatNet = ipNet("fd87:d87e:eb43::", 48, 128)
|
||||
)
|
||||
|
||||
// ipNet returns a net.IPNet struct given the passed IP address string, number
|
||||
// of one bits to include at the start of the mask, and the total number of bits
|
||||
// for the mask.
|
||||
func ipNet(ip string, ones, bits int) net.IPNet {
|
||||
return net.IPNet{IP: net.ParseIP(ip), Mask: net.CIDRMask(ones, bits)}
|
||||
}
|
||||
|
||||
func (na *NetAddress) RFC1918() bool {
|
||||
return rfc1918_10.Contains(na.IP) ||
|
||||
rfc1918_192.Contains(na.IP) ||
|
||||
rfc1918_172.Contains(na.IP)
|
||||
}
|
||||
func (na *NetAddress) RFC3849() bool { return rfc3849.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC3927() bool { return rfc3927.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC3964() bool { return rfc3964.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4193() bool { return rfc4193.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4380() bool { return rfc4380.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4843() bool { return rfc4843.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4862() bool { return rfc4862.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC6052() bool { return rfc6052.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC6145() bool { return rfc6145.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC3849() bool { return rfc3849.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC3927() bool { return rfc3927.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC3964() bool { return rfc3964.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4193() bool { return rfc4193.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4380() bool { return rfc4380.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4843() bool { return rfc4843.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC4862() bool { return rfc4862.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC6052() bool { return rfc6052.Contains(na.IP) }
|
||||
func (na *NetAddress) RFC6145() bool { return rfc6145.Contains(na.IP) }
|
||||
func (na *NetAddress) OnionCatTor() bool { return onionCatNet.Contains(na.IP) }
|
||||
|
||||
func removeProtocolIfDefined(addr string) string {
|
||||
if strings.Contains(addr, "://") {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package pex
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
crand "crypto/rand"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/minio/highwayhash"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
@@ -100,10 +101,17 @@ type addrBook struct {
|
||||
filePath string
|
||||
key string // random prefix for bucket placement
|
||||
routabilityStrict bool
|
||||
hashKey []byte
|
||||
|
||||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
func newHashKey() []byte {
|
||||
result := make([]byte, highwayhash.Size)
|
||||
crand.Read(result)
|
||||
return result
|
||||
}
|
||||
|
||||
// NewAddrBook creates a new address book.
|
||||
// Use Start to begin processing asynchronous address updates.
|
||||
func NewAddrBook(filePath string, routabilityStrict bool) AddrBook {
|
||||
@@ -115,6 +123,7 @@ func NewAddrBook(filePath string, routabilityStrict bool) AddrBook {
|
||||
badPeers: make(map[p2p.ID]*knownAddress),
|
||||
filePath: filePath,
|
||||
routabilityStrict: routabilityStrict,
|
||||
hashKey: newHashKey(),
|
||||
}
|
||||
am.init()
|
||||
am.BaseService = *service.NewBaseService(nil, "AddrBook", am)
|
||||
@@ -344,16 +353,28 @@ func (a *addrBook) MarkBad(addr *p2p.NetAddress, banTime time.Duration) {
|
||||
}
|
||||
}
|
||||
|
||||
// ReinstateBadPeers removes bad peers from ban list and places them into a new
|
||||
// bucket.
|
||||
func (a *addrBook) ReinstateBadPeers() {
|
||||
a.mtx.Lock()
|
||||
defer a.mtx.Unlock()
|
||||
|
||||
for _, ka := range a.badPeers {
|
||||
if !ka.isBanned() {
|
||||
bucket := a.calcNewBucket(ka.Addr, ka.Src)
|
||||
a.addToNewBucket(ka, bucket)
|
||||
delete(a.badPeers, ka.ID())
|
||||
a.Logger.Info("Reinstated address", "addr", ka.Addr)
|
||||
if ka.isBanned() {
|
||||
continue
|
||||
}
|
||||
|
||||
bucket, err := a.calcNewBucket(ka.Addr, ka.Src)
|
||||
if err != nil {
|
||||
a.Logger.Error("Failed to calculate new bucket (bad peer won't be reinstantiated)",
|
||||
"addr", ka.Addr, "err", err)
|
||||
continue
|
||||
}
|
||||
|
||||
a.addToNewBucket(ka, bucket)
|
||||
delete(a.badPeers, ka.ID())
|
||||
|
||||
a.Logger.Info("Reinstated address", "addr", ka.Addr)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,7 +680,10 @@ func (a *addrBook) addAddress(addr, src *p2p.NetAddress) error {
|
||||
ka = newKnownAddress(addr, src)
|
||||
}
|
||||
|
||||
bucket := a.calcNewBucket(addr, src)
|
||||
bucket, err := a.calcNewBucket(addr, src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a.addToNewBucket(ka, bucket)
|
||||
return nil
|
||||
}
|
||||
@@ -722,15 +746,15 @@ func (a *addrBook) expireNew(bucketIdx int) {
|
||||
// Promotes an address from new to old. If the destination bucket is full,
|
||||
// demote the oldest one to a "new" bucket.
|
||||
// TODO: Demote more probabilistically?
|
||||
func (a *addrBook) moveToOld(ka *knownAddress) {
|
||||
func (a *addrBook) moveToOld(ka *knownAddress) error {
|
||||
// Sanity check
|
||||
if ka.isOld() {
|
||||
a.Logger.Error(fmt.Sprintf("Cannot promote address that is already old %v", ka))
|
||||
return
|
||||
return nil
|
||||
}
|
||||
if len(ka.Buckets) == 0 {
|
||||
a.Logger.Error(fmt.Sprintf("Cannot promote address that isn't in any new buckets %v", ka))
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
// Remove from all (new) buckets.
|
||||
@@ -739,13 +763,19 @@ func (a *addrBook) moveToOld(ka *knownAddress) {
|
||||
ka.BucketType = bucketTypeOld
|
||||
|
||||
// Try to add it to its oldBucket destination.
|
||||
oldBucketIdx := a.calcOldBucket(ka.Addr)
|
||||
oldBucketIdx, err := a.calcOldBucket(ka.Addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
added := a.addToOldBucket(ka, oldBucketIdx)
|
||||
if !added {
|
||||
// No room; move the oldest to a new bucket
|
||||
oldest := a.pickOldest(bucketTypeOld, oldBucketIdx)
|
||||
a.removeFromBucket(oldest, bucketTypeOld, oldBucketIdx)
|
||||
newBucketIdx := a.calcNewBucket(oldest.Addr, oldest.Src)
|
||||
newBucketIdx, err := a.calcNewBucket(oldest.Addr, oldest.Src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a.addToNewBucket(oldest, newBucketIdx)
|
||||
|
||||
// Finally, add our ka to old bucket again.
|
||||
@@ -754,6 +784,7 @@ func (a *addrBook) moveToOld(ka *knownAddress) {
|
||||
a.Logger.Error(fmt.Sprintf("Could not re-add ka %v to oldBucketIdx %v", ka, oldBucketIdx))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *addrBook) removeAddress(addr *p2p.NetAddress) {
|
||||
@@ -785,14 +816,16 @@ func (a *addrBook) addBadPeer(addr *p2p.NetAddress, banTime time.Duration) bool
|
||||
//---------------------------------------------------------------------
|
||||
// calculate bucket placements
|
||||
|
||||
// doublesha256( key + sourcegroup +
|
||||
// int64(doublesha256(key + group + sourcegroup))%bucket_per_group ) % num_new_buckets
|
||||
func (a *addrBook) calcNewBucket(addr, src *p2p.NetAddress) int {
|
||||
// hash(key + sourcegroup + int64(hash(key + group + sourcegroup)) % bucket_per_group) % num_new_buckets
|
||||
func (a *addrBook) calcNewBucket(addr, src *p2p.NetAddress) (int, error) {
|
||||
data1 := []byte{}
|
||||
data1 = append(data1, []byte(a.key)...)
|
||||
data1 = append(data1, []byte(a.groupKey(addr))...)
|
||||
data1 = append(data1, []byte(a.groupKey(src))...)
|
||||
hash1 := doubleSha256(data1)
|
||||
hash1, err := a.hash(data1)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
hash64 := binary.BigEndian.Uint64(hash1)
|
||||
hash64 %= newBucketsPerGroup
|
||||
var hashbuf [8]byte
|
||||
@@ -802,17 +835,23 @@ func (a *addrBook) calcNewBucket(addr, src *p2p.NetAddress) int {
|
||||
data2 = append(data2, a.groupKey(src)...)
|
||||
data2 = append(data2, hashbuf[:]...)
|
||||
|
||||
hash2 := doubleSha256(data2)
|
||||
return int(binary.BigEndian.Uint64(hash2) % newBucketCount)
|
||||
hash2, err := a.hash(data2)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
result := int(binary.BigEndian.Uint64(hash2) % newBucketCount)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// doublesha256( key + group +
|
||||
// int64(doublesha256(key + addr))%buckets_per_group ) % num_old_buckets
|
||||
func (a *addrBook) calcOldBucket(addr *p2p.NetAddress) int {
|
||||
// hash(key + group + int64(hash(key + addr)) % buckets_per_group) % num_old_buckets
|
||||
func (a *addrBook) calcOldBucket(addr *p2p.NetAddress) (int, error) {
|
||||
data1 := []byte{}
|
||||
data1 = append(data1, []byte(a.key)...)
|
||||
data1 = append(data1, []byte(addr.String())...)
|
||||
hash1 := doubleSha256(data1)
|
||||
hash1, err := a.hash(data1)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
hash64 := binary.BigEndian.Uint64(hash1)
|
||||
hash64 %= oldBucketsPerGroup
|
||||
var hashbuf [8]byte
|
||||
@@ -822,36 +861,45 @@ func (a *addrBook) calcOldBucket(addr *p2p.NetAddress) int {
|
||||
data2 = append(data2, a.groupKey(addr)...)
|
||||
data2 = append(data2, hashbuf[:]...)
|
||||
|
||||
hash2 := doubleSha256(data2)
|
||||
return int(binary.BigEndian.Uint64(hash2) % oldBucketCount)
|
||||
hash2, err := a.hash(data2)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
result := int(binary.BigEndian.Uint64(hash2) % oldBucketCount)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Return a string representing the network group of this address.
|
||||
// This is the /16 for IPv4, the /32 (/36 for he.net) for IPv6, the string
|
||||
// This is the /16 for IPv4 (e.g. 1.2.0.0), the /32 (/36 for he.net) for IPv6, the string
|
||||
// "local" for a local address and the string "unroutable" for an unroutable
|
||||
// address.
|
||||
func (a *addrBook) groupKey(na *p2p.NetAddress) string {
|
||||
if a.routabilityStrict && na.Local() {
|
||||
return groupKeyFor(na, a.routabilityStrict)
|
||||
}
|
||||
|
||||
func groupKeyFor(na *p2p.NetAddress, routabilityStrict bool) string {
|
||||
if routabilityStrict && na.Local() {
|
||||
return "local"
|
||||
}
|
||||
if a.routabilityStrict && !na.Routable() {
|
||||
if routabilityStrict && !na.Routable() {
|
||||
return "unroutable"
|
||||
}
|
||||
|
||||
if ipv4 := na.IP.To4(); ipv4 != nil {
|
||||
return (&net.IPNet{IP: na.IP, Mask: net.CIDRMask(16, 32)}).String()
|
||||
return na.IP.Mask(net.CIDRMask(16, 32)).String()
|
||||
}
|
||||
|
||||
if na.RFC6145() || na.RFC6052() {
|
||||
// last four bytes are the ip address
|
||||
ip := na.IP[12:16]
|
||||
return (&net.IPNet{IP: ip, Mask: net.CIDRMask(16, 32)}).String()
|
||||
return ip.Mask(net.CIDRMask(16, 32)).String()
|
||||
}
|
||||
|
||||
if na.RFC3964() {
|
||||
ip := na.IP[2:7]
|
||||
return (&net.IPNet{IP: ip, Mask: net.CIDRMask(16, 32)}).String()
|
||||
|
||||
ip := na.IP[2:6]
|
||||
return ip.Mask(net.CIDRMask(16, 32)).String()
|
||||
}
|
||||
|
||||
if na.RFC4380() {
|
||||
// teredo tunnels have the last 4 bytes as the v4 address XOR
|
||||
// 0xff.
|
||||
@@ -859,28 +907,31 @@ func (a *addrBook) groupKey(na *p2p.NetAddress) string {
|
||||
for i, byte := range na.IP[12:16] {
|
||||
ip[i] = byte ^ 0xff
|
||||
}
|
||||
return (&net.IPNet{IP: ip, Mask: net.CIDRMask(16, 32)}).String()
|
||||
return ip.Mask(net.CIDRMask(16, 32)).String()
|
||||
}
|
||||
|
||||
if na.OnionCatTor() {
|
||||
// group is keyed off the first 4 bits of the actual onion key.
|
||||
return fmt.Sprintf("tor:%d", na.IP[6]&((1<<4)-1))
|
||||
}
|
||||
|
||||
// OK, so now we know ourselves to be a IPv6 address.
|
||||
// bitcoind uses /32 for everything, except for Hurricane Electric's
|
||||
// (he.net) IP range, which it uses /36 for.
|
||||
bits := 32
|
||||
heNet := &net.IPNet{IP: net.ParseIP("2001:470::"),
|
||||
Mask: net.CIDRMask(32, 128)}
|
||||
heNet := &net.IPNet{IP: net.ParseIP("2001:470::"), Mask: net.CIDRMask(32, 128)}
|
||||
if heNet.Contains(na.IP) {
|
||||
bits = 36
|
||||
}
|
||||
|
||||
return (&net.IPNet{IP: na.IP, Mask: net.CIDRMask(bits, 128)}).String()
|
||||
ipv6Mask := net.CIDRMask(bits, 128)
|
||||
return na.IP.Mask(ipv6Mask).String()
|
||||
}
|
||||
|
||||
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
||||
func doubleSha256(b []byte) []byte {
|
||||
hasher := sha256.New()
|
||||
hasher.Write(b) // nolint:errcheck
|
||||
sum := hasher.Sum(nil)
|
||||
hasher.Reset()
|
||||
hasher.Write(sum) // nolint:errcheck
|
||||
return hasher.Sum(nil)
|
||||
func (a *addrBook) hash(b []byte) ([]byte, error) {
|
||||
hasher, err := highwayhash.New64(a.hashKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hasher.Write(b)
|
||||
return hasher.Sum(nil), nil
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -572,6 +573,73 @@ func TestMultipleAddrBookAddressSelection(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddrBookGroupKey(t *testing.T) {
|
||||
// non-strict routability
|
||||
testCases := []struct {
|
||||
name string
|
||||
ip string
|
||||
expKey string
|
||||
}{
|
||||
// IPv4 normal.
|
||||
{"ipv4 normal class a", "12.1.2.3", "12.1.0.0"},
|
||||
{"ipv4 normal class b", "173.1.2.3", "173.1.0.0"},
|
||||
{"ipv4 normal class c", "196.1.2.3", "196.1.0.0"},
|
||||
|
||||
// IPv6/IPv4 translations.
|
||||
{"ipv6 rfc3964 with ipv4 encap", "2002:0c01:0203::", "12.1.0.0"},
|
||||
{"ipv6 rfc4380 toredo ipv4", "2001:0:1234::f3fe:fdfc", "12.1.0.0"},
|
||||
{"ipv6 rfc6052 well-known prefix with ipv4", "64:ff9b::0c01:0203", "12.1.0.0"},
|
||||
{"ipv6 rfc6145 translated ipv4", "::ffff:0:0c01:0203", "12.1.0.0"},
|
||||
|
||||
// Tor.
|
||||
{"ipv6 tor onioncat", "fd87:d87e:eb43:1234::5678", "tor:2"},
|
||||
{"ipv6 tor onioncat 2", "fd87:d87e:eb43:1245::6789", "tor:2"},
|
||||
{"ipv6 tor onioncat 3", "fd87:d87e:eb43:1345::6789", "tor:3"},
|
||||
|
||||
// IPv6 normal.
|
||||
{"ipv6 normal", "2602:100::1", "2602:100::"},
|
||||
{"ipv6 normal 2", "2602:0100::1234", "2602:100::"},
|
||||
{"ipv6 hurricane electric", "2001:470:1f10:a1::2", "2001:470:1000::"},
|
||||
{"ipv6 hurricane electric 2", "2001:0470:1f10:a1::2", "2001:470:1000::"},
|
||||
}
|
||||
|
||||
for i, tc := range testCases {
|
||||
nip := net.ParseIP(tc.ip)
|
||||
key := groupKeyFor(p2p.NewNetAddressIPPort(nip, 26656), false)
|
||||
assert.Equal(t, tc.expKey, key, "#%d", i)
|
||||
}
|
||||
|
||||
// strict routability
|
||||
testCases = []struct {
|
||||
name string
|
||||
ip string
|
||||
expKey string
|
||||
}{
|
||||
// Local addresses.
|
||||
{"ipv4 localhost", "127.0.0.1", "local"},
|
||||
{"ipv6 localhost", "::1", "local"},
|
||||
{"ipv4 zero", "0.0.0.0", "local"},
|
||||
{"ipv4 first octet zero", "0.1.2.3", "local"},
|
||||
|
||||
// Unroutable addresses.
|
||||
{"ipv4 invalid bcast", "255.255.255.255", "unroutable"},
|
||||
{"ipv4 rfc1918 10/8", "10.1.2.3", "unroutable"},
|
||||
{"ipv4 rfc1918 172.16/12", "172.16.1.2", "unroutable"},
|
||||
{"ipv4 rfc1918 192.168/16", "192.168.1.2", "unroutable"},
|
||||
{"ipv6 rfc3849 2001:db8::/32", "2001:db8::1234", "unroutable"},
|
||||
{"ipv4 rfc3927 169.254/16", "169.254.1.2", "unroutable"},
|
||||
{"ipv6 rfc4193 fc00::/7", "fc00::1234", "unroutable"},
|
||||
{"ipv6 rfc4843 2001:10::/28", "2001:10::1234", "unroutable"},
|
||||
{"ipv6 rfc4862 fe80::/64", "fe80::1234", "unroutable"},
|
||||
}
|
||||
|
||||
for i, tc := range testCases {
|
||||
nip := net.ParseIP(tc.ip)
|
||||
key := groupKeyFor(p2p.NewNetAddressIPPort(nip, 26656), true)
|
||||
assert.Equal(t, tc.expKey, key, "#%d", i)
|
||||
}
|
||||
}
|
||||
|
||||
func assertMOldAndNNewAddrsInSelection(t *testing.T, m, n int, addrs []*p2p.NetAddress, book *addrBook) {
|
||||
nOld, nNew := countOldAndNewAddrsInSelection(addrs, book)
|
||||
assert.Equal(t, m, nOld, "old addresses")
|
||||
|
||||
@@ -19,5 +19,11 @@ SignerDialerEndpoint
|
||||
|
||||
SignerDialerEndpoint is a simple wrapper around a net.Conn. It's used by both IPCVal and TCPVal.
|
||||
|
||||
SignerClient
|
||||
|
||||
SignerClient handles remote validator connections that provide signing services.
|
||||
In production, it's recommended to wrap it with RetrySignerClient to avoid
|
||||
termination in case of temporary errors.
|
||||
|
||||
*/
|
||||
package privval
|
||||
|
||||
@@ -32,7 +32,7 @@ func voteToStep(vote *types.Vote) int8 {
|
||||
case types.PrecommitType:
|
||||
return stepPrecommit
|
||||
default:
|
||||
panic("Unknown vote type")
|
||||
panic(fmt.Sprintf("Unknown vote type: %v", vote.Type))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
package privval
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/libs/bytes"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// OldFilePV is the old version of the FilePV, pre v0.28.0.
|
||||
// Deprecated: Use FilePV instead.
|
||||
type OldFilePV struct {
|
||||
Address types.Address `json:"address"`
|
||||
PubKey crypto.PubKey `json:"pub_key"`
|
||||
LastHeight int64 `json:"last_height"`
|
||||
LastRound int `json:"last_round"`
|
||||
LastStep int8 `json:"last_step"`
|
||||
LastSignature []byte `json:"last_signature,omitempty"`
|
||||
LastSignBytes bytes.HexBytes `json:"last_signbytes,omitempty"`
|
||||
PrivKey crypto.PrivKey `json:"priv_key"`
|
||||
|
||||
filePath string
|
||||
}
|
||||
|
||||
// LoadOldFilePV loads an OldFilePV from the filePath.
|
||||
func LoadOldFilePV(filePath string) (*OldFilePV, error) {
|
||||
pvJSONBytes, err := ioutil.ReadFile(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pv := &OldFilePV{}
|
||||
err = cdc.UnmarshalJSON(pvJSONBytes, &pv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// overwrite pubkey and address for convenience
|
||||
pv.PubKey = pv.PrivKey.PubKey()
|
||||
pv.Address = pv.PubKey.Address()
|
||||
|
||||
pv.filePath = filePath
|
||||
return pv, nil
|
||||
}
|
||||
|
||||
// Upgrade convets the OldFilePV to the new FilePV, separating the immutable and mutable components,
|
||||
// and persisting them to the keyFilePath and stateFilePath, respectively.
|
||||
// It renames the original file by adding ".bak".
|
||||
func (oldFilePV *OldFilePV) Upgrade(keyFilePath, stateFilePath string) *FilePV {
|
||||
privKey := oldFilePV.PrivKey
|
||||
pvKey := FilePVKey{
|
||||
PrivKey: privKey,
|
||||
PubKey: privKey.PubKey(),
|
||||
Address: privKey.PubKey().Address(),
|
||||
filePath: keyFilePath,
|
||||
}
|
||||
|
||||
pvState := FilePVLastSignState{
|
||||
Height: oldFilePV.LastHeight,
|
||||
Round: oldFilePV.LastRound,
|
||||
Step: oldFilePV.LastStep,
|
||||
Signature: oldFilePV.LastSignature,
|
||||
SignBytes: oldFilePV.LastSignBytes,
|
||||
filePath: stateFilePath,
|
||||
}
|
||||
|
||||
// Save the new PV files
|
||||
pv := &FilePV{
|
||||
Key: pvKey,
|
||||
LastSignState: pvState,
|
||||
}
|
||||
pv.Save()
|
||||
|
||||
// Rename the old PV file
|
||||
err := os.Rename(oldFilePV.filePath, oldFilePV.filePath+".bak")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return pv
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package privval_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
)
|
||||
|
||||
const lastSignBytes = "750802110500000000000000220B08B398F3E00510F48DA6402A480A20F" +
|
||||
"C258973076512999C3E6839A22E9FBDB1B77CF993E8A9955412A41A59D4" +
|
||||
"CAD312240A20C971B286ACB8AAA6FCA0365EB0A660B189EDC08B46B5AF2" +
|
||||
"995DEFA51A28D215B10013211746573742D636861696E2D533245415533"
|
||||
|
||||
const oldPrivvalContent = `{
|
||||
"address": "1D8089FAFDFAE4A637F3D616E17B92905FA2D91D",
|
||||
"pub_key": {
|
||||
"type": "tendermint/PubKeyEd25519",
|
||||
"value": "r3Yg2AhDZ745CNTpavsGU+mRZ8WpRXqoJuyqjN8mJq0="
|
||||
},
|
||||
"last_height": "5",
|
||||
"last_round": "0",
|
||||
"last_step": 3,
|
||||
"last_signature": "CTr7b9ZQlrJJf+12rPl5t/YSCUc/KqV7jQogCfFJA24e7hof69X6OMT7eFLVQHyodPjD/QTA298XHV5ejxInDQ==",
|
||||
"last_signbytes": "` + lastSignBytes + `",
|
||||
"priv_key": {
|
||||
"type": "tendermint/PrivKeyEd25519",
|
||||
"value": "7MwvTGEWWjsYwjn2IpRb+GYsWi9nnFsw8jPLLY1UtP6vdiDYCENnvjkI1Olq+wZT6ZFnxalFeqgm7KqM3yYmrQ=="
|
||||
}
|
||||
}`
|
||||
|
||||
func TestLoadAndUpgrade(t *testing.T) {
|
||||
|
||||
oldFilePath := initTmpOldFile(t)
|
||||
defer os.Remove(oldFilePath)
|
||||
newStateFile, err := ioutil.TempFile("", "priv_validator_state*.json")
|
||||
defer os.Remove(newStateFile.Name())
|
||||
require.NoError(t, err)
|
||||
newKeyFile, err := ioutil.TempFile("", "priv_validator_key*.json")
|
||||
defer os.Remove(newKeyFile.Name())
|
||||
require.NoError(t, err)
|
||||
|
||||
oldPV, err := privval.LoadOldFilePV(oldFilePath)
|
||||
assert.NoError(t, err)
|
||||
newPV := oldPV.Upgrade(newKeyFile.Name(), newStateFile.Name())
|
||||
|
||||
assertEqualPV(t, oldPV, newPV)
|
||||
assert.NoError(t, err)
|
||||
upgradedPV := privval.LoadFilePV(newKeyFile.Name(), newStateFile.Name())
|
||||
assertEqualPV(t, oldPV, upgradedPV)
|
||||
oldPV, err = privval.LoadOldFilePV(oldFilePath + ".bak")
|
||||
require.NoError(t, err)
|
||||
assertEqualPV(t, oldPV, upgradedPV)
|
||||
}
|
||||
|
||||
func assertEqualPV(t *testing.T, oldPV *privval.OldFilePV, newPV *privval.FilePV) {
|
||||
assert.Equal(t, oldPV.Address, newPV.Key.Address)
|
||||
assert.Equal(t, oldPV.Address, newPV.GetAddress())
|
||||
assert.Equal(t, oldPV.PubKey, newPV.Key.PubKey)
|
||||
npv, err := newPV.GetPubKey()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, oldPV.PubKey, npv)
|
||||
assert.Equal(t, oldPV.PrivKey, newPV.Key.PrivKey)
|
||||
|
||||
assert.Equal(t, oldPV.LastHeight, newPV.LastSignState.Height)
|
||||
assert.Equal(t, oldPV.LastRound, newPV.LastSignState.Round)
|
||||
assert.Equal(t, oldPV.LastSignature, newPV.LastSignState.Signature)
|
||||
assert.Equal(t, oldPV.LastSignBytes, newPV.LastSignState.SignBytes)
|
||||
assert.Equal(t, oldPV.LastStep, newPV.LastSignState.Step)
|
||||
}
|
||||
|
||||
func initTmpOldFile(t *testing.T) string {
|
||||
tmpFile, err := ioutil.TempFile("", "priv_validator_*.json")
|
||||
require.NoError(t, err)
|
||||
t.Logf("created test file %s", tmpFile.Name())
|
||||
_, err = tmpFile.WriteString(oldPrivvalContent)
|
||||
require.NoError(t, err)
|
||||
|
||||
return tmpFile.Name()
|
||||
}
|
||||
83
privval/retry_signer_client.go
Normal file
83
privval/retry_signer_client.go
Normal file
@@ -0,0 +1,83 @@
|
||||
package privval
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// RetrySignerClient wraps SignerClient adding retry for each operation (except
|
||||
// Ping) w/ a timeout.
|
||||
type RetrySignerClient struct {
|
||||
next *SignerClient
|
||||
retries int
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
// NewRetrySignerClient returns RetrySignerClient. If +retries+ is 0, the
|
||||
// client will be retrying each operation indefinitely.
|
||||
func NewRetrySignerClient(sc *SignerClient, retries int, timeout time.Duration) *RetrySignerClient {
|
||||
return &RetrySignerClient{sc, retries, timeout}
|
||||
}
|
||||
|
||||
var _ types.PrivValidator = (*RetrySignerClient)(nil)
|
||||
|
||||
func (sc *RetrySignerClient) Close() error {
|
||||
return sc.next.Close()
|
||||
}
|
||||
|
||||
func (sc *RetrySignerClient) IsConnected() bool {
|
||||
return sc.next.IsConnected()
|
||||
}
|
||||
|
||||
func (sc *RetrySignerClient) WaitForConnection(maxWait time.Duration) error {
|
||||
return sc.next.WaitForConnection(maxWait)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// Implement PrivValidator
|
||||
|
||||
func (sc *RetrySignerClient) Ping() error {
|
||||
return sc.next.Ping()
|
||||
}
|
||||
|
||||
func (sc *RetrySignerClient) GetPubKey() (crypto.PubKey, error) {
|
||||
var (
|
||||
pk crypto.PubKey
|
||||
err error
|
||||
)
|
||||
for i := 0; i < sc.retries || sc.retries == 0; i++ {
|
||||
pk, err = sc.next.GetPubKey()
|
||||
if err == nil {
|
||||
return pk, nil
|
||||
}
|
||||
time.Sleep(sc.timeout)
|
||||
}
|
||||
return nil, fmt.Errorf("exhausted all attempts to get pubkey: %w", err)
|
||||
}
|
||||
|
||||
func (sc *RetrySignerClient) SignVote(chainID string, vote *types.Vote) error {
|
||||
var err error
|
||||
for i := 0; i < sc.retries || sc.retries == 0; i++ {
|
||||
err = sc.next.SignVote(chainID, vote)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
time.Sleep(sc.timeout)
|
||||
}
|
||||
return fmt.Errorf("exhausted all attempts to sign vote: %w", err)
|
||||
}
|
||||
|
||||
func (sc *RetrySignerClient) SignProposal(chainID string, proposal *types.Proposal) error {
|
||||
var err error
|
||||
for i := 0; i < sc.retries || sc.retries == 0; i++ {
|
||||
err = sc.next.SignProposal(chainID, proposal)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
time.Sleep(sc.timeout)
|
||||
}
|
||||
return fmt.Errorf("exhausted all attempts to sign proposal: %w", err)
|
||||
}
|
||||
389
proto/blockchain/msgs.pb.go
Normal file
389
proto/blockchain/msgs.pb.go
Normal file
@@ -0,0 +1,389 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/blockchain/msgs.proto
|
||||
|
||||
package blockchain
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
types "github.com/tendermint/tendermint/proto/types"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// BlockRequest requests a block for a specific height
|
||||
type BlockRequest struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockRequest) Reset() { *m = BlockRequest{} }
|
||||
func (m *BlockRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockRequest) ProtoMessage() {}
|
||||
func (*BlockRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{0}
|
||||
}
|
||||
func (m *BlockRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockRequest.Merge(m, src)
|
||||
}
|
||||
func (m *BlockRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockRequest.Size(m)
|
||||
}
|
||||
func (m *BlockRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockRequest) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// NoBlockResponse informs the node that the peer does not have block at the requested height
|
||||
type NoBlockResponse struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NoBlockResponse) Reset() { *m = NoBlockResponse{} }
|
||||
func (m *NoBlockResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*NoBlockResponse) ProtoMessage() {}
|
||||
func (*NoBlockResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{1}
|
||||
}
|
||||
func (m *NoBlockResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NoBlockResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NoBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NoBlockResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NoBlockResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NoBlockResponse.Merge(m, src)
|
||||
}
|
||||
func (m *NoBlockResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_NoBlockResponse.Size(m)
|
||||
}
|
||||
func (m *NoBlockResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NoBlockResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NoBlockResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *NoBlockResponse) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// BlockResponse returns block to the requested
|
||||
type BlockResponse struct {
|
||||
Block types.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockResponse) Reset() { *m = BlockResponse{} }
|
||||
func (m *BlockResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockResponse) ProtoMessage() {}
|
||||
func (*BlockResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{2}
|
||||
}
|
||||
func (m *BlockResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockResponse.Merge(m, src)
|
||||
}
|
||||
func (m *BlockResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockResponse.Size(m)
|
||||
}
|
||||
func (m *BlockResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockResponse) GetBlock() types.Block {
|
||||
if m != nil {
|
||||
return m.Block
|
||||
}
|
||||
return types.Block{}
|
||||
}
|
||||
|
||||
// StatusRequest requests the status of a node (Height & Base)
|
||||
type StatusRequest struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Base int64 `protobuf:"varint,2,opt,name=base,proto3" json:"base,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StatusRequest) Reset() { *m = StatusRequest{} }
|
||||
func (m *StatusRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusRequest) ProtoMessage() {}
|
||||
func (*StatusRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{3}
|
||||
}
|
||||
func (m *StatusRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatusRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *StatusRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StatusRequest.Merge(m, src)
|
||||
}
|
||||
func (m *StatusRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_StatusRequest.Size(m)
|
||||
}
|
||||
func (m *StatusRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StatusRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StatusRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *StatusRequest) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StatusRequest) GetBase() int64 {
|
||||
if m != nil {
|
||||
return m.Base
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// StatusResponse is a peer response to infrom their status
|
||||
type StatusResponse struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Base int64 `protobuf:"varint,2,opt,name=base,proto3" json:"base,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StatusResponse) Reset() { *m = StatusResponse{} }
|
||||
func (m *StatusResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatusResponse) ProtoMessage() {}
|
||||
func (*StatusResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{4}
|
||||
}
|
||||
func (m *StatusResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatusResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *StatusResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StatusResponse.Merge(m, src)
|
||||
}
|
||||
func (m *StatusResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_StatusResponse.Size(m)
|
||||
}
|
||||
func (m *StatusResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StatusResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StatusResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *StatusResponse) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StatusResponse) GetBase() int64 {
|
||||
if m != nil {
|
||||
return m.Base
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Message_BlockRequest
|
||||
// *Message_NoBlockResponse
|
||||
// *Message_BlockResponse
|
||||
// *Message_StatusRequest
|
||||
// *Message_StatusResponse
|
||||
Sum isMessage_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecf660069f8bb334, []int{5}
|
||||
}
|
||||
func (m *Message) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Message.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Message) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Message.Merge(m, src)
|
||||
}
|
||||
func (m *Message) XXX_Size() int {
|
||||
return xxx_messageInfo_Message.Size(m)
|
||||
}
|
||||
func (m *Message) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Message.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Message proto.InternalMessageInfo
|
||||
|
||||
type isMessage_Sum interface {
|
||||
isMessage_Sum()
|
||||
}
|
||||
|
||||
type Message_BlockRequest struct {
|
||||
BlockRequest *BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"`
|
||||
}
|
||||
type Message_NoBlockResponse struct {
|
||||
NoBlockResponse *NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"`
|
||||
}
|
||||
type Message_BlockResponse struct {
|
||||
BlockResponse *BlockResponse `protobuf:"bytes,3,opt,name=block_response,json=blockResponse,proto3,oneof" json:"block_response,omitempty"`
|
||||
}
|
||||
type Message_StatusRequest struct {
|
||||
StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"`
|
||||
}
|
||||
type Message_StatusResponse struct {
|
||||
StatusResponse *StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"`
|
||||
}
|
||||
|
||||
func (*Message_BlockRequest) isMessage_Sum() {}
|
||||
func (*Message_NoBlockResponse) isMessage_Sum() {}
|
||||
func (*Message_BlockResponse) isMessage_Sum() {}
|
||||
func (*Message_StatusRequest) isMessage_Sum() {}
|
||||
func (*Message_StatusResponse) isMessage_Sum() {}
|
||||
|
||||
func (m *Message) GetSum() isMessage_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetBlockRequest() *BlockRequest {
|
||||
if x, ok := m.GetSum().(*Message_BlockRequest); ok {
|
||||
return x.BlockRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetNoBlockResponse() *NoBlockResponse {
|
||||
if x, ok := m.GetSum().(*Message_NoBlockResponse); ok {
|
||||
return x.NoBlockResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetBlockResponse() *BlockResponse {
|
||||
if x, ok := m.GetSum().(*Message_BlockResponse); ok {
|
||||
return x.BlockResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetStatusRequest() *StatusRequest {
|
||||
if x, ok := m.GetSum().(*Message_StatusRequest); ok {
|
||||
return x.StatusRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetStatusResponse() *StatusResponse {
|
||||
if x, ok := m.GetSum().(*Message_StatusResponse); ok {
|
||||
return x.StatusResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Message) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Message_BlockRequest)(nil),
|
||||
(*Message_NoBlockResponse)(nil),
|
||||
(*Message_BlockResponse)(nil),
|
||||
(*Message_StatusRequest)(nil),
|
||||
(*Message_StatusResponse)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*BlockRequest)(nil), "tendermint.proto.blockchain.BlockRequest")
|
||||
proto.RegisterType((*NoBlockResponse)(nil), "tendermint.proto.blockchain.NoBlockResponse")
|
||||
proto.RegisterType((*BlockResponse)(nil), "tendermint.proto.blockchain.BlockResponse")
|
||||
proto.RegisterType((*StatusRequest)(nil), "tendermint.proto.blockchain.StatusRequest")
|
||||
proto.RegisterType((*StatusResponse)(nil), "tendermint.proto.blockchain.StatusResponse")
|
||||
proto.RegisterType((*Message)(nil), "tendermint.proto.blockchain.Message")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/blockchain/msgs.proto", fileDescriptor_ecf660069f8bb334) }
|
||||
|
||||
var fileDescriptor_ecf660069f8bb334 = []byte{
|
||||
// 369 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x4e, 0xc2, 0x40,
|
||||
0x10, 0x86, 0xc1, 0x02, 0x26, 0x03, 0x85, 0xd8, 0x83, 0x12, 0x88, 0xd1, 0xf4, 0x40, 0x44, 0xcd,
|
||||
0x36, 0xc2, 0xc9, 0xe8, 0xa9, 0x27, 0x62, 0xa2, 0x31, 0x25, 0xf1, 0xc0, 0x85, 0xb4, 0xb0, 0x69,
|
||||
0x1b, 0x6d, 0xb7, 0x76, 0xb6, 0x07, 0xde, 0xce, 0xa3, 0x4f, 0xe1, 0xb3, 0x18, 0x76, 0x4b, 0xa1,
|
||||
0x55, 0xb1, 0xb7, 0xdd, 0xbf, 0x33, 0xdf, 0xfc, 0x3b, 0x7f, 0x0a, 0xfd, 0x28, 0x66, 0x9c, 0x19,
|
||||
0xce, 0x1b, 0x5b, 0xbc, 0x2e, 0x3c, 0xdb, 0x0f, 0x8d, 0x00, 0x5d, 0x24, 0x42, 0xd5, 0xfa, 0x9c,
|
||||
0x86, 0x4b, 0x1a, 0x07, 0x7e, 0xc8, 0xa5, 0x42, 0xb6, 0x75, 0xbd, 0x01, 0xf7, 0xfc, 0x78, 0x39,
|
||||
0x8f, 0xec, 0x98, 0xaf, 0x0c, 0x49, 0x71, 0x99, 0xcb, 0xb6, 0x27, 0xd9, 0xd2, 0x3b, 0x91, 0x0a,
|
||||
0x5f, 0x45, 0x14, 0xe5, 0x1c, 0xf9, 0x41, 0x1f, 0x40, 0xcb, 0x5c, 0x5f, 0x2d, 0xfa, 0x9e, 0x50,
|
||||
0xe4, 0xda, 0x31, 0x34, 0x3c, 0xea, 0xbb, 0x1e, 0xef, 0x56, 0xcf, 0xab, 0x17, 0x8a, 0x95, 0xde,
|
||||
0xf4, 0x21, 0x74, 0x9e, 0x58, 0x5a, 0x89, 0x11, 0x0b, 0x91, 0xfe, 0x59, 0xfa, 0x00, 0x6a, 0xbe,
|
||||
0xf0, 0x16, 0xea, 0x62, 0xa4, 0xa8, 0x6b, 0x8e, 0x4e, 0xc9, 0x8f, 0x17, 0x09, 0x5f, 0x44, 0x74,
|
||||
0x99, 0xb5, 0xcf, 0xaf, 0xb3, 0x8a, 0x25, 0x3b, 0xf4, 0x3b, 0x50, 0xa7, 0xdc, 0xe6, 0x09, 0xfe,
|
||||
0xe3, 0x4f, 0xd3, 0xa0, 0xe6, 0xd8, 0x48, 0xbb, 0x07, 0x42, 0x15, 0x67, 0xfd, 0x1e, 0xda, 0x9b,
|
||||
0xe6, 0xfd, 0x96, 0x7f, 0xed, 0xfe, 0x50, 0xe0, 0xf0, 0x91, 0x22, 0xda, 0x2e, 0xd5, 0x9e, 0x41,
|
||||
0x15, 0x7e, 0xe6, 0xb1, 0xb4, 0x91, 0xbe, 0x64, 0x48, 0xf6, 0x64, 0x43, 0x76, 0xf7, 0x3a, 0xa9,
|
||||
0x58, 0x2d, 0x67, 0x77, 0xcf, 0x33, 0x38, 0x0a, 0xd9, 0x7c, 0x03, 0x95, 0xf6, 0xc4, 0xf8, 0xe6,
|
||||
0xe8, 0x7a, 0x2f, 0xb5, 0x90, 0xc2, 0xa4, 0x62, 0x75, 0xc2, 0x42, 0x30, 0x53, 0x68, 0x17, 0xc0,
|
||||
0x8a, 0x00, 0x5f, 0x96, 0xb1, 0x9b, 0x61, 0x55, 0xa7, 0x08, 0x45, 0xb1, 0xcc, 0x6c, 0x07, 0xb5,
|
||||
0x12, 0xd0, 0x5c, 0x78, 0x6b, 0x28, 0xe6, 0xd2, 0x7c, 0x81, 0x4e, 0x06, 0x4d, 0xad, 0xd6, 0x05,
|
||||
0xf5, 0xaa, 0x14, 0x35, 0xf3, 0xda, 0xc6, 0x9c, 0x62, 0xd6, 0x41, 0xc1, 0x24, 0x30, 0xc7, 0xb3,
|
||||
0x1b, 0xd7, 0xe7, 0x5e, 0xe2, 0x90, 0x05, 0x0b, 0x8c, 0x2d, 0x71, 0xf7, 0x58, 0xfc, 0xf5, 0x9c,
|
||||
0x86, 0x50, 0xc6, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb8, 0xb9, 0x72, 0x28, 0x95, 0x03, 0x00,
|
||||
0x00,
|
||||
}
|
||||
44
proto/blockchain/msgs.proto
Normal file
44
proto/blockchain/msgs.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.blockchain;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/blockchain";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/types/block.proto";
|
||||
|
||||
// BlockRequest requests a block for a specific height
|
||||
message BlockRequest {
|
||||
int64 height = 1;
|
||||
}
|
||||
|
||||
// NoBlockResponse informs the node that the peer does not have block at the requested height
|
||||
message NoBlockResponse {
|
||||
int64 height = 1;
|
||||
}
|
||||
|
||||
// BlockResponse returns block to the requested
|
||||
message BlockResponse {
|
||||
tendermint.proto.types.Block block = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// StatusRequest requests the status of a node (Height & Base)
|
||||
message StatusRequest {
|
||||
int64 height = 1;
|
||||
int64 base = 2;
|
||||
}
|
||||
|
||||
// StatusResponse is a peer response to infrom their status
|
||||
message StatusResponse {
|
||||
int64 height = 1;
|
||||
int64 base = 2;
|
||||
}
|
||||
|
||||
message Message {
|
||||
oneof sum {
|
||||
BlockRequest block_request = 1;
|
||||
NoBlockResponse no_block_response = 2;
|
||||
BlockResponse block_response = 3;
|
||||
StatusRequest status_request = 4;
|
||||
StatusResponse status_response = 5;
|
||||
}
|
||||
}
|
||||
794
proto/consensus/msgs.pb.go
Normal file
794
proto/consensus/msgs.pb.go
Normal file
@@ -0,0 +1,794 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/consensus/msgs.proto
|
||||
|
||||
package consensus
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
bits "github.com/tendermint/tendermint/proto/libs/bits"
|
||||
types "github.com/tendermint/tendermint/proto/types"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// NewRoundStepMessage is sent for every step taken in the ConsensusState.
|
||||
// For every height/round/step transition
|
||||
type NewRoundStep struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Step uint32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"`
|
||||
SecondsSinceStartTime int64 `protobuf:"varint,4,opt,name=seconds_since_start_time,json=secondsSinceStartTime,proto3" json:"seconds_since_start_time,omitempty"`
|
||||
LastCommitRound int32 `protobuf:"varint,5,opt,name=last_commit_round,json=lastCommitRound,proto3" json:"last_commit_round,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NewRoundStep) Reset() { *m = NewRoundStep{} }
|
||||
func (m *NewRoundStep) String() string { return proto.CompactTextString(m) }
|
||||
func (*NewRoundStep) ProtoMessage() {}
|
||||
func (*NewRoundStep) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{0}
|
||||
}
|
||||
func (m *NewRoundStep) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NewRoundStep.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NewRoundStep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NewRoundStep.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NewRoundStep) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NewRoundStep.Merge(m, src)
|
||||
}
|
||||
func (m *NewRoundStep) XXX_Size() int {
|
||||
return xxx_messageInfo_NewRoundStep.Size(m)
|
||||
}
|
||||
func (m *NewRoundStep) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NewRoundStep.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NewRoundStep proto.InternalMessageInfo
|
||||
|
||||
func (m *NewRoundStep) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewRoundStep) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewRoundStep) GetStep() uint32 {
|
||||
if m != nil {
|
||||
return m.Step
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewRoundStep) GetSecondsSinceStartTime() int64 {
|
||||
if m != nil {
|
||||
return m.SecondsSinceStartTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewRoundStep) GetLastCommitRound() int32 {
|
||||
if m != nil {
|
||||
return m.LastCommitRound
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// NewValidBlockMessage is sent when a validator observes a valid block B in some round r,
|
||||
//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
|
||||
// In case the block is also committed, then IsCommit flag is set to true.
|
||||
type NewValidBlock struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
BlockPartsHeader types.PartSetHeader `protobuf:"bytes,3,opt,name=block_parts_header,json=blockPartsHeader,proto3" json:"block_parts_header"`
|
||||
BlockParts *bits.BitArray `protobuf:"bytes,4,opt,name=block_parts,json=blockParts,proto3" json:"block_parts,omitempty"`
|
||||
IsCommit bool `protobuf:"varint,5,opt,name=is_commit,json=isCommit,proto3" json:"is_commit,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NewValidBlock) Reset() { *m = NewValidBlock{} }
|
||||
func (m *NewValidBlock) String() string { return proto.CompactTextString(m) }
|
||||
func (*NewValidBlock) ProtoMessage() {}
|
||||
func (*NewValidBlock) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{1}
|
||||
}
|
||||
func (m *NewValidBlock) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NewValidBlock.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NewValidBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NewValidBlock.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NewValidBlock) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NewValidBlock.Merge(m, src)
|
||||
}
|
||||
func (m *NewValidBlock) XXX_Size() int {
|
||||
return xxx_messageInfo_NewValidBlock.Size(m)
|
||||
}
|
||||
func (m *NewValidBlock) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NewValidBlock.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NewValidBlock proto.InternalMessageInfo
|
||||
|
||||
func (m *NewValidBlock) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewValidBlock) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NewValidBlock) GetBlockPartsHeader() types.PartSetHeader {
|
||||
if m != nil {
|
||||
return m.BlockPartsHeader
|
||||
}
|
||||
return types.PartSetHeader{}
|
||||
}
|
||||
|
||||
func (m *NewValidBlock) GetBlockParts() *bits.BitArray {
|
||||
if m != nil {
|
||||
return m.BlockParts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *NewValidBlock) GetIsCommit() bool {
|
||||
if m != nil {
|
||||
return m.IsCommit
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ProposalMessage is sent when a new block is proposed.
|
||||
type Proposal struct {
|
||||
Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Proposal) Reset() { *m = Proposal{} }
|
||||
func (m *Proposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*Proposal) ProtoMessage() {}
|
||||
func (*Proposal) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{2}
|
||||
}
|
||||
func (m *Proposal) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Proposal.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Proposal.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Proposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Proposal.Merge(m, src)
|
||||
}
|
||||
func (m *Proposal) XXX_Size() int {
|
||||
return xxx_messageInfo_Proposal.Size(m)
|
||||
}
|
||||
func (m *Proposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Proposal.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Proposal proto.InternalMessageInfo
|
||||
|
||||
func (m *Proposal) GetProposal() types.Proposal {
|
||||
if m != nil {
|
||||
return m.Proposal
|
||||
}
|
||||
return types.Proposal{}
|
||||
}
|
||||
|
||||
// ProposalPOLMessage is sent when a previous proposal is re-proposed.
|
||||
type ProposalPOL struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
ProposalPolRound int32 `protobuf:"varint,2,opt,name=proposal_pol_round,json=proposalPolRound,proto3" json:"proposal_pol_round,omitempty"`
|
||||
ProposalPol bits.BitArray `protobuf:"bytes,3,opt,name=proposal_pol,json=proposalPol,proto3" json:"proposal_pol"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ProposalPOL) Reset() { *m = ProposalPOL{} }
|
||||
func (m *ProposalPOL) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProposalPOL) ProtoMessage() {}
|
||||
func (*ProposalPOL) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{3}
|
||||
}
|
||||
func (m *ProposalPOL) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ProposalPOL.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ProposalPOL) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ProposalPOL.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ProposalPOL) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ProposalPOL.Merge(m, src)
|
||||
}
|
||||
func (m *ProposalPOL) XXX_Size() int {
|
||||
return xxx_messageInfo_ProposalPOL.Size(m)
|
||||
}
|
||||
func (m *ProposalPOL) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ProposalPOL.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ProposalPOL proto.InternalMessageInfo
|
||||
|
||||
func (m *ProposalPOL) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProposalPOL) GetProposalPolRound() int32 {
|
||||
if m != nil {
|
||||
return m.ProposalPolRound
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProposalPOL) GetProposalPol() bits.BitArray {
|
||||
if m != nil {
|
||||
return m.ProposalPol
|
||||
}
|
||||
return bits.BitArray{}
|
||||
}
|
||||
|
||||
// BlockPartMessage is sent when gossipping a piece of the proposed block.
|
||||
type BlockPart struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Part types.Part `protobuf:"bytes,3,opt,name=part,proto3" json:"part"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockPart) Reset() { *m = BlockPart{} }
|
||||
func (m *BlockPart) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockPart) ProtoMessage() {}
|
||||
func (*BlockPart) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{4}
|
||||
}
|
||||
func (m *BlockPart) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockPart.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockPart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockPart.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockPart) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockPart.Merge(m, src)
|
||||
}
|
||||
func (m *BlockPart) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockPart.Size(m)
|
||||
}
|
||||
func (m *BlockPart) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockPart.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockPart proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockPart) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockPart) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockPart) GetPart() types.Part {
|
||||
if m != nil {
|
||||
return m.Part
|
||||
}
|
||||
return types.Part{}
|
||||
}
|
||||
|
||||
// VoteMessage is sent when voting for a proposal (or lack thereof).
|
||||
type Vote struct {
|
||||
Vote *types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Vote) Reset() { *m = Vote{} }
|
||||
func (m *Vote) String() string { return proto.CompactTextString(m) }
|
||||
func (*Vote) ProtoMessage() {}
|
||||
func (*Vote) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{5}
|
||||
}
|
||||
func (m *Vote) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Vote.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Vote) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Vote.Merge(m, src)
|
||||
}
|
||||
func (m *Vote) XXX_Size() int {
|
||||
return xxx_messageInfo_Vote.Size(m)
|
||||
}
|
||||
func (m *Vote) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Vote.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Vote proto.InternalMessageInfo
|
||||
|
||||
func (m *Vote) GetVote() *types.Vote {
|
||||
if m != nil {
|
||||
return m.Vote
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// HasVoteMessage is sent to indicate that a particular vote has been received.
|
||||
type HasVote struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.proto.types.SignedMsgType" json:"type,omitempty"`
|
||||
Index uint32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *HasVote) Reset() { *m = HasVote{} }
|
||||
func (m *HasVote) String() string { return proto.CompactTextString(m) }
|
||||
func (*HasVote) ProtoMessage() {}
|
||||
func (*HasVote) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{6}
|
||||
}
|
||||
func (m *HasVote) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_HasVote.Unmarshal(m, b)
|
||||
}
|
||||
func (m *HasVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_HasVote.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *HasVote) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_HasVote.Merge(m, src)
|
||||
}
|
||||
func (m *HasVote) XXX_Size() int {
|
||||
return xxx_messageInfo_HasVote.Size(m)
|
||||
}
|
||||
func (m *HasVote) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_HasVote.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_HasVote proto.InternalMessageInfo
|
||||
|
||||
func (m *HasVote) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *HasVote) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *HasVote) GetType() types.SignedMsgType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return types.SIGNED_MSG_TYPE_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *HasVote) GetIndex() uint32 {
|
||||
if m != nil {
|
||||
return m.Index
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// VoteSetMaj23Message is sent to indicate that a given BlockID has seen +2/3 votes.
|
||||
type VoteSetMaj23 struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.proto.types.SignedMsgType" json:"type,omitempty"`
|
||||
BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *VoteSetMaj23) Reset() { *m = VoteSetMaj23{} }
|
||||
func (m *VoteSetMaj23) String() string { return proto.CompactTextString(m) }
|
||||
func (*VoteSetMaj23) ProtoMessage() {}
|
||||
func (*VoteSetMaj23) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{7}
|
||||
}
|
||||
func (m *VoteSetMaj23) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_VoteSetMaj23.Unmarshal(m, b)
|
||||
}
|
||||
func (m *VoteSetMaj23) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_VoteSetMaj23.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *VoteSetMaj23) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_VoteSetMaj23.Merge(m, src)
|
||||
}
|
||||
func (m *VoteSetMaj23) XXX_Size() int {
|
||||
return xxx_messageInfo_VoteSetMaj23.Size(m)
|
||||
}
|
||||
func (m *VoteSetMaj23) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_VoteSetMaj23.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_VoteSetMaj23 proto.InternalMessageInfo
|
||||
|
||||
func (m *VoteSetMaj23) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *VoteSetMaj23) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *VoteSetMaj23) GetType() types.SignedMsgType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return types.SIGNED_MSG_TYPE_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *VoteSetMaj23) GetBlockID() types.BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return types.BlockID{}
|
||||
}
|
||||
|
||||
// VoteSetBitsMessage is sent to communicate the bit-array of votes seen for the BlockID.
|
||||
type VoteSetBits struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.proto.types.SignedMsgType" json:"type,omitempty"`
|
||||
BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
Votes bits.BitArray `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *VoteSetBits) Reset() { *m = VoteSetBits{} }
|
||||
func (m *VoteSetBits) String() string { return proto.CompactTextString(m) }
|
||||
func (*VoteSetBits) ProtoMessage() {}
|
||||
func (*VoteSetBits) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{8}
|
||||
}
|
||||
func (m *VoteSetBits) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_VoteSetBits.Unmarshal(m, b)
|
||||
}
|
||||
func (m *VoteSetBits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_VoteSetBits.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *VoteSetBits) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_VoteSetBits.Merge(m, src)
|
||||
}
|
||||
func (m *VoteSetBits) XXX_Size() int {
|
||||
return xxx_messageInfo_VoteSetBits.Size(m)
|
||||
}
|
||||
func (m *VoteSetBits) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_VoteSetBits.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_VoteSetBits proto.InternalMessageInfo
|
||||
|
||||
func (m *VoteSetBits) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *VoteSetBits) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *VoteSetBits) GetType() types.SignedMsgType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return types.SIGNED_MSG_TYPE_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *VoteSetBits) GetBlockID() types.BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return types.BlockID{}
|
||||
}
|
||||
|
||||
func (m *VoteSetBits) GetVotes() bits.BitArray {
|
||||
if m != nil {
|
||||
return m.Votes
|
||||
}
|
||||
return bits.BitArray{}
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Message_NewRoundStep
|
||||
// *Message_NewValidBlock
|
||||
// *Message_Proposal
|
||||
// *Message_ProposalPol
|
||||
// *Message_BlockPart
|
||||
// *Message_Vote
|
||||
// *Message_HasVote
|
||||
// *Message_VoteSetMaj23
|
||||
// *Message_VoteSetBits
|
||||
Sum isMessage_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9de64017f8b3fc88, []int{9}
|
||||
}
|
||||
func (m *Message) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Message.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Message) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Message.Merge(m, src)
|
||||
}
|
||||
func (m *Message) XXX_Size() int {
|
||||
return xxx_messageInfo_Message.Size(m)
|
||||
}
|
||||
func (m *Message) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Message.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Message proto.InternalMessageInfo
|
||||
|
||||
type isMessage_Sum interface {
|
||||
isMessage_Sum()
|
||||
}
|
||||
|
||||
type Message_NewRoundStep struct {
|
||||
NewRoundStep *NewRoundStep `protobuf:"bytes,1,opt,name=new_round_step,json=newRoundStep,proto3,oneof" json:"new_round_step,omitempty"`
|
||||
}
|
||||
type Message_NewValidBlock struct {
|
||||
NewValidBlock *NewValidBlock `protobuf:"bytes,2,opt,name=new_valid_block,json=newValidBlock,proto3,oneof" json:"new_valid_block,omitempty"`
|
||||
}
|
||||
type Message_Proposal struct {
|
||||
Proposal *Proposal `protobuf:"bytes,3,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"`
|
||||
}
|
||||
type Message_ProposalPol struct {
|
||||
ProposalPol *ProposalPOL `protobuf:"bytes,4,opt,name=proposal_pol,json=proposalPol,proto3,oneof" json:"proposal_pol,omitempty"`
|
||||
}
|
||||
type Message_BlockPart struct {
|
||||
BlockPart *BlockPart `protobuf:"bytes,5,opt,name=block_part,json=blockPart,proto3,oneof" json:"block_part,omitempty"`
|
||||
}
|
||||
type Message_Vote struct {
|
||||
Vote *Vote `protobuf:"bytes,6,opt,name=vote,proto3,oneof" json:"vote,omitempty"`
|
||||
}
|
||||
type Message_HasVote struct {
|
||||
HasVote *HasVote `protobuf:"bytes,7,opt,name=has_vote,json=hasVote,proto3,oneof" json:"has_vote,omitempty"`
|
||||
}
|
||||
type Message_VoteSetMaj23 struct {
|
||||
VoteSetMaj23 *VoteSetMaj23 `protobuf:"bytes,8,opt,name=vote_set_maj23,json=voteSetMaj23,proto3,oneof" json:"vote_set_maj23,omitempty"`
|
||||
}
|
||||
type Message_VoteSetBits struct {
|
||||
VoteSetBits *VoteSetBits `protobuf:"bytes,9,opt,name=vote_set_bits,json=voteSetBits,proto3,oneof" json:"vote_set_bits,omitempty"`
|
||||
}
|
||||
|
||||
func (*Message_NewRoundStep) isMessage_Sum() {}
|
||||
func (*Message_NewValidBlock) isMessage_Sum() {}
|
||||
func (*Message_Proposal) isMessage_Sum() {}
|
||||
func (*Message_ProposalPol) isMessage_Sum() {}
|
||||
func (*Message_BlockPart) isMessage_Sum() {}
|
||||
func (*Message_Vote) isMessage_Sum() {}
|
||||
func (*Message_HasVote) isMessage_Sum() {}
|
||||
func (*Message_VoteSetMaj23) isMessage_Sum() {}
|
||||
func (*Message_VoteSetBits) isMessage_Sum() {}
|
||||
|
||||
func (m *Message) GetSum() isMessage_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetNewRoundStep() *NewRoundStep {
|
||||
if x, ok := m.GetSum().(*Message_NewRoundStep); ok {
|
||||
return x.NewRoundStep
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetNewValidBlock() *NewValidBlock {
|
||||
if x, ok := m.GetSum().(*Message_NewValidBlock); ok {
|
||||
return x.NewValidBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetProposal() *Proposal {
|
||||
if x, ok := m.GetSum().(*Message_Proposal); ok {
|
||||
return x.Proposal
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetProposalPol() *ProposalPOL {
|
||||
if x, ok := m.GetSum().(*Message_ProposalPol); ok {
|
||||
return x.ProposalPol
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetBlockPart() *BlockPart {
|
||||
if x, ok := m.GetSum().(*Message_BlockPart); ok {
|
||||
return x.BlockPart
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetVote() *Vote {
|
||||
if x, ok := m.GetSum().(*Message_Vote); ok {
|
||||
return x.Vote
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetHasVote() *HasVote {
|
||||
if x, ok := m.GetSum().(*Message_HasVote); ok {
|
||||
return x.HasVote
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetVoteSetMaj23() *VoteSetMaj23 {
|
||||
if x, ok := m.GetSum().(*Message_VoteSetMaj23); ok {
|
||||
return x.VoteSetMaj23
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetVoteSetBits() *VoteSetBits {
|
||||
if x, ok := m.GetSum().(*Message_VoteSetBits); ok {
|
||||
return x.VoteSetBits
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Message) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Message_NewRoundStep)(nil),
|
||||
(*Message_NewValidBlock)(nil),
|
||||
(*Message_Proposal)(nil),
|
||||
(*Message_ProposalPol)(nil),
|
||||
(*Message_BlockPart)(nil),
|
||||
(*Message_Vote)(nil),
|
||||
(*Message_HasVote)(nil),
|
||||
(*Message_VoteSetMaj23)(nil),
|
||||
(*Message_VoteSetBits)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*NewRoundStep)(nil), "tendermint.proto.consensus.NewRoundStep")
|
||||
proto.RegisterType((*NewValidBlock)(nil), "tendermint.proto.consensus.NewValidBlock")
|
||||
proto.RegisterType((*Proposal)(nil), "tendermint.proto.consensus.Proposal")
|
||||
proto.RegisterType((*ProposalPOL)(nil), "tendermint.proto.consensus.ProposalPOL")
|
||||
proto.RegisterType((*BlockPart)(nil), "tendermint.proto.consensus.BlockPart")
|
||||
proto.RegisterType((*Vote)(nil), "tendermint.proto.consensus.Vote")
|
||||
proto.RegisterType((*HasVote)(nil), "tendermint.proto.consensus.HasVote")
|
||||
proto.RegisterType((*VoteSetMaj23)(nil), "tendermint.proto.consensus.VoteSetMaj23")
|
||||
proto.RegisterType((*VoteSetBits)(nil), "tendermint.proto.consensus.VoteSetBits")
|
||||
proto.RegisterType((*Message)(nil), "tendermint.proto.consensus.Message")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/consensus/msgs.proto", fileDescriptor_9de64017f8b3fc88) }
|
||||
|
||||
var fileDescriptor_9de64017f8b3fc88 = []byte{
|
||||
// 833 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x6e, 0xeb, 0x44,
|
||||
0x14, 0x8e, 0x6f, 0x93, 0x26, 0x39, 0x4e, 0xda, 0xcb, 0x88, 0x9f, 0x28, 0x17, 0xa9, 0x91, 0xe1,
|
||||
0x42, 0x40, 0xc8, 0xb9, 0x4a, 0x25, 0x7e, 0x76, 0xc5, 0xfc, 0xc8, 0x15, 0x4d, 0x1b, 0x39, 0x55,
|
||||
0x25, 0xd8, 0x58, 0x4e, 0x3c, 0x72, 0x06, 0x62, 0x8f, 0xf1, 0x4c, 0x52, 0xf2, 0x00, 0x48, 0x3c,
|
||||
0x07, 0x6b, 0xb6, 0xbc, 0x01, 0x0b, 0x9e, 0xa2, 0x0b, 0x9e, 0x83, 0x05, 0x9a, 0x9f, 0xc4, 0x6e,
|
||||
0x2b, 0xb7, 0xcd, 0x06, 0xe9, 0x6e, 0xaa, 0x99, 0x39, 0xe7, 0xfb, 0x7c, 0xe6, 0x3b, 0x73, 0xbe,
|
||||
0x06, 0xba, 0x69, 0x46, 0x39, 0x1d, 0xcc, 0x68, 0xc2, 0x70, 0xc2, 0x96, 0x6c, 0x10, 0xb3, 0x88,
|
||||
0xd9, 0xf2, 0x10, 0x75, 0x39, 0x4e, 0x42, 0x9c, 0xc5, 0x24, 0xe1, 0xea, 0xc4, 0xde, 0xa6, 0x75,
|
||||
0x3f, 0xe0, 0x73, 0x92, 0x85, 0x7e, 0x1a, 0x64, 0x7c, 0x3d, 0x50, 0x1c, 0x11, 0x8d, 0x68, 0xbe,
|
||||
0x52, 0x88, 0xee, 0x3b, 0xea, 0x84, 0xaf, 0x53, 0xcc, 0xd4, 0x5f, 0x1d, 0x78, 0xa1, 0x02, 0x0b,
|
||||
0x32, 0x65, 0x83, 0x29, 0xe1, 0xb7, 0x82, 0xd6, 0x9f, 0x06, 0xb4, 0xce, 0xf1, 0xb5, 0x47, 0x97,
|
||||
0x49, 0x38, 0xe1, 0x38, 0x45, 0x6f, 0xc3, 0xfe, 0x1c, 0x93, 0x68, 0xce, 0x3b, 0x46, 0xcf, 0xe8,
|
||||
0xef, 0x79, 0x7a, 0x87, 0xde, 0x84, 0x5a, 0x26, 0x92, 0x3a, 0xcf, 0x7a, 0x46, 0xbf, 0xe6, 0xa9,
|
||||
0x0d, 0x42, 0x50, 0x65, 0x1c, 0xa7, 0x9d, 0xbd, 0x9e, 0xd1, 0x6f, 0x7b, 0x72, 0x8d, 0x3e, 0x83,
|
||||
0x0e, 0xc3, 0x33, 0x9a, 0x84, 0xcc, 0x67, 0x24, 0x99, 0x61, 0x9f, 0xf1, 0x20, 0xe3, 0x3e, 0x27,
|
||||
0x31, 0xee, 0x54, 0x25, 0xe7, 0x5b, 0x3a, 0x3e, 0x11, 0xe1, 0x89, 0x88, 0x5e, 0x92, 0x18, 0xa3,
|
||||
0x8f, 0xe1, 0x8d, 0x45, 0xc0, 0xb8, 0x3f, 0xa3, 0x71, 0x4c, 0xb8, 0xaf, 0x3e, 0x57, 0x93, 0x9f,
|
||||
0x3b, 0x14, 0x81, 0xaf, 0xe4, 0xb9, 0x2c, 0xd5, 0xfa, 0xd7, 0x80, 0xf6, 0x39, 0xbe, 0xbe, 0x0a,
|
||||
0x16, 0x24, 0x74, 0x16, 0x74, 0xf6, 0xd3, 0x8e, 0x85, 0x7f, 0x0f, 0x68, 0x2a, 0x60, 0x52, 0x57,
|
||||
0xe6, 0xcf, 0x71, 0x10, 0xe2, 0x4c, 0x5e, 0xc3, 0x1c, 0xbe, 0xb4, 0xef, 0xb5, 0x43, 0x49, 0x36,
|
||||
0x0e, 0x32, 0x3e, 0xc1, 0xdc, 0x95, 0xc9, 0x4e, 0xf5, 0xef, 0x9b, 0xa3, 0x8a, 0xf7, 0x5c, 0xd2,
|
||||
0x88, 0x08, 0x53, 0xe7, 0xe8, 0x1b, 0x30, 0x0b, 0xd4, 0xf2, 0xca, 0xe6, 0xf0, 0xfd, 0xfb, 0x9c,
|
||||
0xa2, 0x21, 0xb6, 0x68, 0x88, 0xed, 0x10, 0xfe, 0x65, 0x96, 0x05, 0x6b, 0x0f, 0x72, 0x32, 0xf4,
|
||||
0x02, 0x9a, 0x84, 0x69, 0x2d, 0xa4, 0x0a, 0x0d, 0xaf, 0x41, 0x98, 0xd2, 0xc0, 0x3a, 0x87, 0xc6,
|
||||
0x38, 0xa3, 0x29, 0x65, 0xc1, 0x02, 0x39, 0xd0, 0x48, 0xf5, 0x5a, 0x5e, 0xdd, 0x1c, 0xf6, 0x4a,
|
||||
0x2f, 0xa0, 0xf3, 0x74, 0xed, 0x5b, 0x9c, 0xf5, 0xbb, 0x01, 0xe6, 0x26, 0x38, 0xbe, 0x38, 0x2b,
|
||||
0x15, 0xf3, 0x13, 0x40, 0x1b, 0x8c, 0x9f, 0xd2, 0x85, 0x5f, 0x54, 0xf6, 0xf9, 0x26, 0x32, 0xa6,
|
||||
0x0b, 0xd9, 0x24, 0x34, 0x82, 0x56, 0x31, 0x5b, 0xcb, 0xfb, 0x24, 0x29, 0x74, 0x85, 0x66, 0x81,
|
||||
0xd3, 0xfa, 0x19, 0x9a, 0xce, 0x46, 0x9f, 0x1d, 0xdb, 0xfd, 0x29, 0x54, 0x45, 0x37, 0x74, 0x05,
|
||||
0xef, 0x3e, 0xd4, 0x60, 0xfd, 0x65, 0x99, 0x6f, 0x7d, 0x0e, 0xd5, 0x2b, 0xca, 0x31, 0x7a, 0x05,
|
||||
0xd5, 0x15, 0xe5, 0x58, 0xeb, 0x5b, 0x8a, 0x17, 0xb9, 0x9e, 0xcc, 0xb4, 0x7e, 0x33, 0xa0, 0xee,
|
||||
0x06, 0x4c, 0xa2, 0x77, 0xab, 0xf5, 0x0b, 0xa8, 0x0a, 0x36, 0x59, 0xeb, 0x41, 0xf9, 0x63, 0x9c,
|
||||
0x90, 0x28, 0xc1, 0xe1, 0x88, 0x45, 0x97, 0xeb, 0x14, 0x7b, 0x12, 0x22, 0x08, 0x49, 0x12, 0xe2,
|
||||
0x5f, 0xe4, 0xa3, 0x6b, 0x7b, 0x6a, 0x63, 0xfd, 0x65, 0x40, 0x4b, 0xd4, 0x31, 0xc1, 0x7c, 0x14,
|
||||
0xfc, 0x38, 0x3c, 0xfe, 0xff, 0xea, 0xf9, 0x0e, 0x1a, 0x6a, 0x14, 0x48, 0xa8, 0xe7, 0xe0, 0xa8,
|
||||
0x0c, 0x2e, 0x3b, 0x7b, 0xfa, 0xb5, 0x73, 0x28, 0xd4, 0xff, 0xe7, 0xe6, 0xa8, 0xae, 0x0f, 0xbc,
|
||||
0xba, 0x64, 0x38, 0x0d, 0xad, 0x5f, 0x9f, 0x81, 0xa9, 0xaf, 0xe1, 0x10, 0xce, 0x5e, 0xcf, 0x5b,
|
||||
0xa0, 0x13, 0xa8, 0x89, 0xf7, 0xc1, 0xe4, 0x48, 0xef, 0x36, 0x0c, 0x0a, 0x68, 0xfd, 0x51, 0x83,
|
||||
0xfa, 0x08, 0x33, 0x16, 0x44, 0x18, 0x8d, 0xe1, 0x20, 0xc1, 0xd7, 0x6a, 0x0c, 0x7d, 0xe9, 0xc4,
|
||||
0xea, 0x85, 0xf6, 0xed, 0xf2, 0xff, 0x28, 0x76, 0xd1, 0xef, 0xdd, 0x8a, 0xd7, 0x4a, 0x8a, 0xfe,
|
||||
0x3f, 0x81, 0x43, 0xc1, 0xb8, 0x12, 0xc6, 0xea, 0xcb, 0xa2, 0xa5, 0x8e, 0xe6, 0xf0, 0xa3, 0x47,
|
||||
0x28, 0x73, 0x2b, 0x76, 0x2b, 0x5e, 0x3b, 0xb9, 0xe5, 0xcd, 0x45, 0x8b, 0x2a, 0x35, 0x81, 0x9c,
|
||||
0x6d, 0xe3, 0x44, 0x6e, 0xc1, 0xa2, 0xd0, 0xd9, 0x1d, 0x33, 0x51, 0x9d, 0xf8, 0xf0, 0x29, 0x3c,
|
||||
0xe3, 0x8b, 0x33, 0xf7, 0xb6, 0x97, 0xa0, 0x6f, 0x01, 0x72, 0x93, 0xd6, 0xbd, 0x78, 0xf9, 0x10,
|
||||
0xd7, 0xd6, 0x79, 0xdc, 0x8a, 0xd7, 0xdc, 0xda, 0xb4, 0x30, 0x16, 0x69, 0x0c, 0xfb, 0x65, 0xc6,
|
||||
0x9b, 0x33, 0x88, 0xb7, 0xeb, 0x56, 0x94, 0x3d, 0xa0, 0x13, 0x68, 0xcc, 0x03, 0xe6, 0x4b, 0x6c,
|
||||
0x5d, 0x62, 0xdf, 0x7b, 0x08, 0xab, 0x9d, 0xc4, 0xad, 0x78, 0xf5, 0xb9, 0x36, 0x95, 0x31, 0x1c,
|
||||
0x08, 0xb4, 0xcf, 0x30, 0xf7, 0x63, 0x31, 0xd6, 0x9d, 0xc6, 0xe3, 0xad, 0x2f, 0xda, 0x80, 0x68,
|
||||
0xfd, 0xaa, 0x68, 0x0b, 0x23, 0x68, 0x6f, 0x19, 0xc5, 0xfb, 0xeb, 0x34, 0x1f, 0x97, 0xb8, 0x30,
|
||||
0x90, 0x42, 0xe2, 0x55, 0xbe, 0x75, 0x6a, 0xb0, 0xc7, 0x96, 0xb1, 0x33, 0xfc, 0xe1, 0x55, 0x44,
|
||||
0xf8, 0x7c, 0x39, 0xb5, 0x67, 0x34, 0x1e, 0xe4, 0x54, 0xc5, 0xe5, 0x9d, 0x9f, 0x46, 0xd3, 0x7d,
|
||||
0x79, 0x70, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x4b, 0x4c, 0x2a, 0x34, 0x09, 0x00,
|
||||
0x00,
|
||||
}
|
||||
92
proto/consensus/msgs.proto
Normal file
92
proto/consensus/msgs.proto
Normal file
@@ -0,0 +1,92 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.consensus;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/consensus";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/types/types.proto";
|
||||
import "proto/libs/bits/types.proto";
|
||||
|
||||
// NewRoundStepMessage is sent for every step taken in the ConsensusState.
|
||||
// For every height/round/step transition
|
||||
message NewRoundStep {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
uint32 step = 3;
|
||||
int64 seconds_since_start_time = 4;
|
||||
int32 last_commit_round = 5;
|
||||
}
|
||||
|
||||
// NewValidBlockMessage is sent when a validator observes a valid block B in some round r,
|
||||
//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
|
||||
// In case the block is also committed, then IsCommit flag is set to true.
|
||||
message NewValidBlock {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
tendermint.proto.types.PartSetHeader block_parts_header = 3 [(gogoproto.nullable) = false];
|
||||
tendermint.proto.libs.bits.BitArray block_parts = 4;
|
||||
bool is_commit = 5;
|
||||
}
|
||||
|
||||
// ProposalMessage is sent when a new block is proposed.
|
||||
message Proposal {
|
||||
tendermint.proto.types.Proposal proposal = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// ProposalPOLMessage is sent when a previous proposal is re-proposed.
|
||||
message ProposalPOL {
|
||||
int64 height = 1;
|
||||
int32 proposal_pol_round = 2;
|
||||
tendermint.proto.libs.bits.BitArray proposal_pol = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// BlockPartMessage is sent when gossipping a piece of the proposed block.
|
||||
message BlockPart {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
tendermint.proto.types.Part part = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// VoteMessage is sent when voting for a proposal (or lack thereof).
|
||||
message Vote {
|
||||
tendermint.proto.types.Vote vote = 1;
|
||||
}
|
||||
|
||||
// HasVoteMessage is sent to indicate that a particular vote has been received.
|
||||
message HasVote {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
tendermint.proto.types.SignedMsgType type = 3;
|
||||
uint32 index = 4;
|
||||
}
|
||||
|
||||
// VoteSetMaj23Message is sent to indicate that a given BlockID has seen +2/3 votes.
|
||||
message VoteSetMaj23 {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
tendermint.proto.types.SignedMsgType type = 3;
|
||||
tendermint.proto.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// VoteSetBitsMessage is sent to communicate the bit-array of votes seen for the BlockID.
|
||||
message VoteSetBits {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
tendermint.proto.types.SignedMsgType type = 3;
|
||||
tendermint.proto.types.BlockID block_id = 4 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
|
||||
tendermint.proto.libs.bits.BitArray votes = 5 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
message Message {
|
||||
oneof sum {
|
||||
NewRoundStep new_round_step = 1;
|
||||
NewValidBlock new_valid_block = 2;
|
||||
Proposal proposal = 3;
|
||||
ProposalPOL proposal_pol = 4;
|
||||
BlockPart block_part = 5;
|
||||
Vote vote = 6;
|
||||
HasVote has_vote = 7;
|
||||
VoteSetMaj23 vote_set_maj23 = 8;
|
||||
VoteSetBits vote_set_bits = 9;
|
||||
}
|
||||
}
|
||||
374
proto/consensus/walmsgs.pb.go
Normal file
374
proto/consensus/walmsgs.pb.go
Normal file
@@ -0,0 +1,374 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/consensus/walmsgs.proto
|
||||
|
||||
package consensus
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/duration"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
types "github.com/tendermint/tendermint/proto/types"
|
||||
math "math"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var _ = time.Kitchen
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// MsgInfo are msgs from the reactor which may update the state
|
||||
type MsgInfo struct {
|
||||
Msg Message `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"`
|
||||
PeerID string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MsgInfo) Reset() { *m = MsgInfo{} }
|
||||
func (m *MsgInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgInfo) ProtoMessage() {}
|
||||
func (*MsgInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_60ad80fa14e37285, []int{0}
|
||||
}
|
||||
func (m *MsgInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MsgInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *MsgInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_MsgInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *MsgInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgInfo.Merge(m, src)
|
||||
}
|
||||
func (m *MsgInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_MsgInfo.Size(m)
|
||||
}
|
||||
func (m *MsgInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgInfo) GetMsg() Message {
|
||||
if m != nil {
|
||||
return m.Msg
|
||||
}
|
||||
return Message{}
|
||||
}
|
||||
|
||||
func (m *MsgInfo) GetPeerID() string {
|
||||
if m != nil {
|
||||
return m.PeerID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// TimeoutInfo internally generated messages which may update the state
|
||||
type TimeoutInfo struct {
|
||||
Duration time.Duration `protobuf:"bytes,1,opt,name=duration,proto3,stdduration" json:"duration"`
|
||||
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Step uint32 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *TimeoutInfo) Reset() { *m = TimeoutInfo{} }
|
||||
func (m *TimeoutInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*TimeoutInfo) ProtoMessage() {}
|
||||
func (*TimeoutInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_60ad80fa14e37285, []int{1}
|
||||
}
|
||||
func (m *TimeoutInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_TimeoutInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *TimeoutInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_TimeoutInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *TimeoutInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_TimeoutInfo.Merge(m, src)
|
||||
}
|
||||
func (m *TimeoutInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_TimeoutInfo.Size(m)
|
||||
}
|
||||
func (m *TimeoutInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_TimeoutInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_TimeoutInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *TimeoutInfo) GetDuration() time.Duration {
|
||||
if m != nil {
|
||||
return m.Duration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *TimeoutInfo) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *TimeoutInfo) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *TimeoutInfo) GetStep() uint32 {
|
||||
if m != nil {
|
||||
return m.Step
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// EndHeightMessage marks the end of the given height inside WAL.
|
||||
// @internal used by scripts/wal2json util.
|
||||
type EndHeight struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *EndHeight) Reset() { *m = EndHeight{} }
|
||||
func (m *EndHeight) String() string { return proto.CompactTextString(m) }
|
||||
func (*EndHeight) ProtoMessage() {}
|
||||
func (*EndHeight) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_60ad80fa14e37285, []int{2}
|
||||
}
|
||||
func (m *EndHeight) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_EndHeight.Unmarshal(m, b)
|
||||
}
|
||||
func (m *EndHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_EndHeight.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *EndHeight) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EndHeight.Merge(m, src)
|
||||
}
|
||||
func (m *EndHeight) XXX_Size() int {
|
||||
return xxx_messageInfo_EndHeight.Size(m)
|
||||
}
|
||||
func (m *EndHeight) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EndHeight.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EndHeight proto.InternalMessageInfo
|
||||
|
||||
func (m *EndHeight) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type WALMessage struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *WALMessage_EventDataRoundState
|
||||
// *WALMessage_MsgInfo
|
||||
// *WALMessage_TimeoutInfo
|
||||
// *WALMessage_EndHeight
|
||||
Sum isWALMessage_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *WALMessage) Reset() { *m = WALMessage{} }
|
||||
func (m *WALMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*WALMessage) ProtoMessage() {}
|
||||
func (*WALMessage) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_60ad80fa14e37285, []int{3}
|
||||
}
|
||||
func (m *WALMessage) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_WALMessage.Unmarshal(m, b)
|
||||
}
|
||||
func (m *WALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_WALMessage.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *WALMessage) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_WALMessage.Merge(m, src)
|
||||
}
|
||||
func (m *WALMessage) XXX_Size() int {
|
||||
return xxx_messageInfo_WALMessage.Size(m)
|
||||
}
|
||||
func (m *WALMessage) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_WALMessage.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_WALMessage proto.InternalMessageInfo
|
||||
|
||||
type isWALMessage_Sum interface {
|
||||
isWALMessage_Sum()
|
||||
}
|
||||
|
||||
type WALMessage_EventDataRoundState struct {
|
||||
EventDataRoundState *types.EventDataRoundState `protobuf:"bytes,1,opt,name=event_data_round_state,json=eventDataRoundState,proto3,oneof" json:"event_data_round_state,omitempty"`
|
||||
}
|
||||
type WALMessage_MsgInfo struct {
|
||||
MsgInfo *MsgInfo `protobuf:"bytes,2,opt,name=msg_info,json=msgInfo,proto3,oneof" json:"msg_info,omitempty"`
|
||||
}
|
||||
type WALMessage_TimeoutInfo struct {
|
||||
TimeoutInfo *TimeoutInfo `protobuf:"bytes,3,opt,name=timeout_info,json=timeoutInfo,proto3,oneof" json:"timeout_info,omitempty"`
|
||||
}
|
||||
type WALMessage_EndHeight struct {
|
||||
EndHeight *EndHeight `protobuf:"bytes,4,opt,name=end_height,json=endHeight,proto3,oneof" json:"end_height,omitempty"`
|
||||
}
|
||||
|
||||
func (*WALMessage_EventDataRoundState) isWALMessage_Sum() {}
|
||||
func (*WALMessage_MsgInfo) isWALMessage_Sum() {}
|
||||
func (*WALMessage_TimeoutInfo) isWALMessage_Sum() {}
|
||||
func (*WALMessage_EndHeight) isWALMessage_Sum() {}
|
||||
|
||||
func (m *WALMessage) GetSum() isWALMessage_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *WALMessage) GetEventDataRoundState() *types.EventDataRoundState {
|
||||
if x, ok := m.GetSum().(*WALMessage_EventDataRoundState); ok {
|
||||
return x.EventDataRoundState
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *WALMessage) GetMsgInfo() *MsgInfo {
|
||||
if x, ok := m.GetSum().(*WALMessage_MsgInfo); ok {
|
||||
return x.MsgInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *WALMessage) GetTimeoutInfo() *TimeoutInfo {
|
||||
if x, ok := m.GetSum().(*WALMessage_TimeoutInfo); ok {
|
||||
return x.TimeoutInfo
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *WALMessage) GetEndHeight() *EndHeight {
|
||||
if x, ok := m.GetSum().(*WALMessage_EndHeight); ok {
|
||||
return x.EndHeight
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*WALMessage) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*WALMessage_EventDataRoundState)(nil),
|
||||
(*WALMessage_MsgInfo)(nil),
|
||||
(*WALMessage_TimeoutInfo)(nil),
|
||||
(*WALMessage_EndHeight)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
|
||||
type TimedWALMessage struct {
|
||||
Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"`
|
||||
Msg *WALMessage `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *TimedWALMessage) Reset() { *m = TimedWALMessage{} }
|
||||
func (m *TimedWALMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*TimedWALMessage) ProtoMessage() {}
|
||||
func (*TimedWALMessage) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_60ad80fa14e37285, []int{4}
|
||||
}
|
||||
func (m *TimedWALMessage) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_TimedWALMessage.Unmarshal(m, b)
|
||||
}
|
||||
func (m *TimedWALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_TimedWALMessage.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *TimedWALMessage) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_TimedWALMessage.Merge(m, src)
|
||||
}
|
||||
func (m *TimedWALMessage) XXX_Size() int {
|
||||
return xxx_messageInfo_TimedWALMessage.Size(m)
|
||||
}
|
||||
func (m *TimedWALMessage) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_TimedWALMessage.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_TimedWALMessage proto.InternalMessageInfo
|
||||
|
||||
func (m *TimedWALMessage) GetTime() time.Time {
|
||||
if m != nil {
|
||||
return m.Time
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *TimedWALMessage) GetMsg() *WALMessage {
|
||||
if m != nil {
|
||||
return m.Msg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgInfo)(nil), "tendermint.proto.consensus.MsgInfo")
|
||||
proto.RegisterType((*TimeoutInfo)(nil), "tendermint.proto.consensus.TimeoutInfo")
|
||||
proto.RegisterType((*EndHeight)(nil), "tendermint.proto.consensus.EndHeight")
|
||||
proto.RegisterType((*WALMessage)(nil), "tendermint.proto.consensus.WALMessage")
|
||||
proto.RegisterType((*TimedWALMessage)(nil), "tendermint.proto.consensus.TimedWALMessage")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/consensus/walmsgs.proto", fileDescriptor_60ad80fa14e37285) }
|
||||
|
||||
var fileDescriptor_60ad80fa14e37285 = []byte{
|
||||
// 528 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcd, 0x8a, 0x13, 0x41,
|
||||
0x10, 0xce, 0x6c, 0xb2, 0xf9, 0xa9, 0x28, 0xc2, 0x28, 0x4b, 0x1c, 0xd0, 0x84, 0x04, 0xd7, 0x80,
|
||||
0x30, 0x23, 0xeb, 0x65, 0xc1, 0x83, 0x1a, 0xb2, 0x92, 0xc0, 0x2e, 0x48, 0xbb, 0x20, 0x78, 0x19,
|
||||
0x26, 0x3b, 0x95, 0xce, 0xe0, 0x76, 0xf7, 0x30, 0x5d, 0xa3, 0xec, 0x03, 0x78, 0xdf, 0xa3, 0x8f,
|
||||
0xe4, 0xcd, 0x37, 0x58, 0xc1, 0x27, 0x91, 0xe9, 0x9e, 0xfc, 0x90, 0x60, 0xbc, 0x75, 0x57, 0xf5,
|
||||
0xf7, 0x7d, 0x55, 0xf5, 0x55, 0xc3, 0x93, 0x34, 0x53, 0xa4, 0x82, 0x2b, 0x25, 0x35, 0x4a, 0x9d,
|
||||
0xeb, 0xe0, 0x5b, 0x74, 0x2d, 0x34, 0xd7, 0xbe, 0x89, 0xbb, 0x1e, 0xa1, 0x8c, 0x31, 0x13, 0x89,
|
||||
0x24, 0x1b, 0xf1, 0x57, 0x2f, 0xbd, 0x63, 0x5a, 0x24, 0x59, 0x1c, 0xa6, 0x51, 0x46, 0x37, 0x81,
|
||||
0xa5, 0xe1, 0x8a, 0xab, 0xf5, 0xc9, 0x22, 0x3c, 0x6f, 0x5b, 0x62, 0xcd, 0xef, 0x75, 0x6c, 0x8e,
|
||||
0x6e, 0x52, 0xd4, 0x01, 0x7e, 0x45, 0x49, 0xcb, 0xcc, 0x53, 0xae, 0x14, 0xbf, 0x46, 0x4b, 0x3c,
|
||||
0xcb, 0xe7, 0x41, 0x9c, 0x67, 0x11, 0x25, 0x4a, 0x96, 0xf9, 0xee, 0x76, 0x9e, 0x12, 0x81, 0x9a,
|
||||
0x22, 0x91, 0xda, 0x07, 0xfd, 0x2f, 0xd0, 0xb8, 0xd0, 0x7c, 0x2a, 0xe7, 0xca, 0x7d, 0x0d, 0x55,
|
||||
0xa1, 0x79, 0xc7, 0xe9, 0x39, 0xc3, 0xf6, 0xc9, 0xc0, 0xff, 0x77, 0x4f, 0xfe, 0x05, 0x6a, 0x1d,
|
||||
0x71, 0x1c, 0xd5, 0x7e, 0xde, 0x75, 0x2b, 0xac, 0x40, 0xb9, 0x03, 0x68, 0xa4, 0x88, 0x59, 0x98,
|
||||
0xc4, 0x9d, 0x83, 0x9e, 0x33, 0x6c, 0x8d, 0xe0, 0xcf, 0x5d, 0xb7, 0xfe, 0x01, 0x31, 0x9b, 0x8e,
|
||||
0x59, 0xbd, 0x48, 0x4d, 0xe3, 0xfe, 0xad, 0x03, 0xed, 0xcb, 0x44, 0xa0, 0xca, 0xc9, 0x28, 0xbe,
|
||||
0x81, 0xe6, 0xb2, 0xde, 0x52, 0xf6, 0xb1, 0x6f, 0x0b, 0xf6, 0x97, 0x05, 0xfb, 0xe3, 0xf2, 0xc1,
|
||||
0xa8, 0x59, 0x88, 0xfd, 0xf8, 0xdd, 0x75, 0xd8, 0x0a, 0xe4, 0x1e, 0x41, 0x7d, 0x81, 0x09, 0x5f,
|
||||
0x90, 0x11, 0xad, 0xb2, 0xf2, 0xe6, 0x3e, 0x82, 0xc3, 0x4c, 0xe5, 0x32, 0xee, 0x54, 0x7b, 0xce,
|
||||
0xf0, 0x90, 0xd9, 0x8b, 0xeb, 0x42, 0x4d, 0x13, 0xa6, 0x9d, 0x5a, 0xcf, 0x19, 0xde, 0x67, 0xe6,
|
||||
0xdc, 0x1f, 0x40, 0xeb, 0x4c, 0xc6, 0x13, 0x0b, 0x5b, 0xd3, 0x39, 0x9b, 0x74, 0xfd, 0x5f, 0x07,
|
||||
0x00, 0x9f, 0xde, 0x9d, 0x97, 0x6d, 0xbb, 0x33, 0x38, 0x32, 0x26, 0x84, 0x71, 0x44, 0x51, 0x68,
|
||||
0xb8, 0x43, 0x4d, 0x11, 0x61, 0xd9, 0xc4, 0x8b, 0xdd, 0xd9, 0x19, 0xeb, 0xfc, 0xb3, 0x02, 0x35,
|
||||
0x8e, 0x28, 0x62, 0x05, 0xe6, 0x63, 0x01, 0x99, 0x54, 0xd8, 0x43, 0xdc, 0x0d, 0xbb, 0x6f, 0xa1,
|
||||
0x29, 0x34, 0x0f, 0x13, 0x39, 0x57, 0xa6, 0xb7, 0xff, 0x39, 0x62, 0x3d, 0x9c, 0x54, 0x58, 0x43,
|
||||
0x94, 0x76, 0x9e, 0xc3, 0x3d, 0xb2, 0xb3, 0xb6, 0x2c, 0x55, 0xc3, 0xf2, 0x7c, 0x1f, 0xcb, 0x86,
|
||||
0x37, 0x93, 0x0a, 0x6b, 0xd3, 0x86, 0x55, 0xef, 0x01, 0x50, 0xc6, 0x61, 0x39, 0x9e, 0x9a, 0xe1,
|
||||
0x7a, 0xb6, 0x8f, 0x6b, 0x35, 0xd5, 0x49, 0x85, 0xb5, 0x70, 0x79, 0x19, 0x1d, 0x42, 0x55, 0xe7,
|
||||
0xa2, 0xff, 0xdd, 0x81, 0x07, 0x85, 0x5a, 0xbc, 0x31, 0xd6, 0x53, 0xa8, 0x15, 0x8a, 0xe5, 0x10,
|
||||
0xbd, 0x9d, 0x4d, 0xb8, 0x5c, 0xae, 0xae, 0x5d, 0x85, 0xdb, 0x62, 0x15, 0x0c, 0xc2, 0x3d, 0xb5,
|
||||
0x9b, 0x6b, 0xe7, 0x74, 0xbc, 0xaf, 0xaa, 0xb5, 0x9c, 0x59, 0xdb, 0xd1, 0xc9, 0xe7, 0x97, 0x3c,
|
||||
0xa1, 0x45, 0x3e, 0xf3, 0xaf, 0x94, 0x08, 0xd6, 0xc0, 0xcd, 0xe3, 0xd6, 0xc7, 0x9c, 0xd5, 0x4d,
|
||||
0xe0, 0xd5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0x7e, 0x02, 0x98, 0x15, 0x04, 0x00, 0x00,
|
||||
}
|
||||
46
proto/consensus/walmsgs.proto
Normal file
46
proto/consensus/walmsgs.proto
Normal file
@@ -0,0 +1,46 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.consensus;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/consensus";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/consensus/msgs.proto";
|
||||
import "proto/types/events.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// MsgInfo are msgs from the reactor which may update the state
|
||||
message MsgInfo {
|
||||
Message msg = 1 [(gogoproto.nullable) = false];
|
||||
string peer_id = 2 [(gogoproto.customname) = "PeerID"];
|
||||
}
|
||||
|
||||
// TimeoutInfo internally generated messages which may update the state
|
||||
message TimeoutInfo {
|
||||
google.protobuf.Duration duration = 1
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
|
||||
int64 height = 2;
|
||||
int32 round = 3;
|
||||
uint32 step = 4;
|
||||
}
|
||||
|
||||
// EndHeightMessage marks the end of the given height inside WAL.
|
||||
// @internal used by scripts/wal2json util.
|
||||
message EndHeight {
|
||||
int64 height = 1;
|
||||
}
|
||||
|
||||
message WALMessage {
|
||||
oneof sum {
|
||||
tendermint.proto.types.EventDataRoundState event_data_round_state = 1;
|
||||
MsgInfo msg_info = 2;
|
||||
TimeoutInfo timeout_info = 3;
|
||||
EndHeight end_height = 4;
|
||||
}
|
||||
}
|
||||
|
||||
// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
|
||||
message TimedWALMessage {
|
||||
google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
WALMessage msg = 2;
|
||||
}
|
||||
328
proto/crypto/keys/types.pb.go
Normal file
328
proto/crypto/keys/types.pb.go
Normal file
@@ -0,0 +1,328 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/crypto/keys/types.proto
|
||||
|
||||
package keys
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// PublicKey defines the keys available for use with Tendermint Validators
|
||||
type PublicKey struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *PublicKey_Ed25519
|
||||
Sum isPublicKey_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PublicKey) Reset() { *m = PublicKey{} }
|
||||
func (m *PublicKey) String() string { return proto.CompactTextString(m) }
|
||||
func (*PublicKey) ProtoMessage() {}
|
||||
func (*PublicKey) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_943d79b57ec0188f, []int{0}
|
||||
}
|
||||
func (m *PublicKey) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PublicKey.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PublicKey.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PublicKey) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PublicKey.Merge(m, src)
|
||||
}
|
||||
func (m *PublicKey) XXX_Size() int {
|
||||
return xxx_messageInfo_PublicKey.Size(m)
|
||||
}
|
||||
func (m *PublicKey) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PublicKey.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PublicKey proto.InternalMessageInfo
|
||||
|
||||
type isPublicKey_Sum interface {
|
||||
isPublicKey_Sum()
|
||||
Equal(interface{}) bool
|
||||
Compare(interface{}) int
|
||||
}
|
||||
|
||||
type PublicKey_Ed25519 struct {
|
||||
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"`
|
||||
}
|
||||
|
||||
func (*PublicKey_Ed25519) isPublicKey_Sum() {}
|
||||
|
||||
func (m *PublicKey) GetSum() isPublicKey_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicKey) GetEd25519() []byte {
|
||||
if x, ok := m.GetSum().(*PublicKey_Ed25519); ok {
|
||||
return x.Ed25519
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*PublicKey) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*PublicKey_Ed25519)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
// PrivateKey defines the keys available for use with Tendermint Validators
|
||||
// WARNING PrivateKey is used for internal purposes only
|
||||
type PrivateKey struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *PrivateKey_Ed25519
|
||||
Sum isPrivateKey_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PrivateKey) Reset() { *m = PrivateKey{} }
|
||||
func (m *PrivateKey) String() string { return proto.CompactTextString(m) }
|
||||
func (*PrivateKey) ProtoMessage() {}
|
||||
func (*PrivateKey) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_943d79b57ec0188f, []int{1}
|
||||
}
|
||||
func (m *PrivateKey) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PrivateKey.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PrivateKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PrivateKey.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PrivateKey) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PrivateKey.Merge(m, src)
|
||||
}
|
||||
func (m *PrivateKey) XXX_Size() int {
|
||||
return xxx_messageInfo_PrivateKey.Size(m)
|
||||
}
|
||||
func (m *PrivateKey) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PrivateKey.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PrivateKey proto.InternalMessageInfo
|
||||
|
||||
type isPrivateKey_Sum interface {
|
||||
isPrivateKey_Sum()
|
||||
}
|
||||
|
||||
type PrivateKey_Ed25519 struct {
|
||||
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"`
|
||||
}
|
||||
|
||||
func (*PrivateKey_Ed25519) isPrivateKey_Sum() {}
|
||||
|
||||
func (m *PrivateKey) GetSum() isPrivateKey_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PrivateKey) GetEd25519() []byte {
|
||||
if x, ok := m.GetSum().(*PrivateKey_Ed25519); ok {
|
||||
return x.Ed25519
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*PrivateKey) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*PrivateKey_Ed25519)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*PublicKey)(nil), "tendermint.proto.crypto.keys.PublicKey")
|
||||
proto.RegisterType((*PrivateKey)(nil), "tendermint.proto.crypto.keys.PrivateKey")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/crypto/keys/types.proto", fileDescriptor_943d79b57ec0188f) }
|
||||
|
||||
var fileDescriptor_943d79b57ec0188f = []byte{
|
||||
// 190 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2f, 0xa9,
|
||||
0x2c, 0x48, 0x2d, 0xd6, 0x03, 0x8b, 0x0b, 0xc9, 0x94, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66,
|
||||
0xe6, 0x95, 0x40, 0x44, 0xf4, 0x20, 0x2a, 0xf5, 0x40, 0x2a, 0xa5, 0xd4, 0x4a, 0x32, 0x32, 0x8b,
|
||||
0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a, 0xf5, 0x21, 0x06, 0xa5, 0xe7, 0xa7, 0xe7, 0x23, 0x58,
|
||||
0x10, 0x3d, 0x4a, 0x16, 0x5c, 0x9c, 0x01, 0xa5, 0x49, 0x39, 0x99, 0xc9, 0xde, 0xa9, 0x95, 0x42,
|
||||
0x52, 0x5c, 0xec, 0xa9, 0x29, 0x46, 0xa6, 0xa6, 0x86, 0x96, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c,
|
||||
0x1e, 0x0c, 0x41, 0x30, 0x01, 0x2b, 0x8e, 0x17, 0x0b, 0xe4, 0x19, 0x5f, 0x2c, 0x94, 0x67, 0x74,
|
||||
0x62, 0xe5, 0x62, 0x2e, 0x2e, 0xcd, 0x55, 0xd2, 0xe7, 0xe2, 0x0a, 0x28, 0xca, 0x2c, 0x4b, 0x2c,
|
||||
0x49, 0x25, 0xa0, 0x15, 0xaa, 0xc1, 0xc9, 0x24, 0xca, 0x28, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49,
|
||||
0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe1, 0x7a, 0x64, 0x26, 0x86, 0x97, 0x93, 0xd8, 0xc0, 0x42, 0xc6,
|
||||
0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0xcf, 0x02, 0x32, 0x0e, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *PublicKey) Compare(that interface{}) int {
|
||||
if that == nil {
|
||||
if this == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
that1, ok := that.(*PublicKey)
|
||||
if !ok {
|
||||
that2, ok := that.(PublicKey)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
if this == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
} else if this == nil {
|
||||
return -1
|
||||
}
|
||||
if that1.Sum == nil {
|
||||
if this.Sum != nil {
|
||||
return 1
|
||||
}
|
||||
} else if this.Sum == nil {
|
||||
return -1
|
||||
} else {
|
||||
thisType := -1
|
||||
switch this.Sum.(type) {
|
||||
case *PublicKey_Ed25519:
|
||||
thisType = 0
|
||||
default:
|
||||
panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum))
|
||||
}
|
||||
that1Type := -1
|
||||
switch that1.Sum.(type) {
|
||||
case *PublicKey_Ed25519:
|
||||
that1Type = 0
|
||||
default:
|
||||
panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum))
|
||||
}
|
||||
if thisType == that1Type {
|
||||
if c := this.Sum.Compare(that1.Sum); c != 0 {
|
||||
return c
|
||||
}
|
||||
} else if thisType < that1Type {
|
||||
return -1
|
||||
} else if thisType > that1Type {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||
return c
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (this *PublicKey_Ed25519) Compare(that interface{}) int {
|
||||
if that == nil {
|
||||
if this == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
that1, ok := that.(*PublicKey_Ed25519)
|
||||
if !ok {
|
||||
that2, ok := that.(PublicKey_Ed25519)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
if this == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
} else if this == nil {
|
||||
return -1
|
||||
}
|
||||
if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 {
|
||||
return c
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (this *PublicKey) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*PublicKey)
|
||||
if !ok {
|
||||
that2, ok := that.(PublicKey)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if that1.Sum == nil {
|
||||
if this.Sum != nil {
|
||||
return false
|
||||
}
|
||||
} else if this.Sum == nil {
|
||||
return false
|
||||
} else if !this.Sum.Equal(that1.Sum) {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *PublicKey_Ed25519) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*PublicKey_Ed25519)
|
||||
if !ok {
|
||||
that2, ok := that.(PublicKey_Ed25519)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.Ed25519, that1.Ed25519) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
24
proto/crypto/keys/types.proto
Normal file
24
proto/crypto/keys/types.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.crypto.keys;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/crypto/keys";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
|
||||
// PublicKey defines the keys available for use with Tendermint Validators
|
||||
message PublicKey {
|
||||
option (gogoproto.compare) = true;
|
||||
option (gogoproto.equal) = true;
|
||||
|
||||
oneof sum {
|
||||
bytes ed25519 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// PrivateKey defines the keys available for use with Tendermint Validators
|
||||
// WARNING PrivateKey is used for internal purposes only
|
||||
message PrivateKey {
|
||||
oneof sum {
|
||||
bytes ed25519 = 1;
|
||||
}
|
||||
}
|
||||
105
proto/crypto/merkle/types.pb.go
Normal file
105
proto/crypto/merkle/types.pb.go
Normal file
@@ -0,0 +1,105 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/crypto/merkle/types.proto
|
||||
|
||||
package merkle
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type SimpleProof struct {
|
||||
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
||||
Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
|
||||
LeafHash []byte `protobuf:"bytes,3,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"`
|
||||
Aunts [][]byte `protobuf:"bytes,4,rep,name=aunts,proto3" json:"aunts,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SimpleProof) Reset() { *m = SimpleProof{} }
|
||||
func (m *SimpleProof) String() string { return proto.CompactTextString(m) }
|
||||
func (*SimpleProof) ProtoMessage() {}
|
||||
func (*SimpleProof) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_57e39eefdaf7ae96, []int{0}
|
||||
}
|
||||
func (m *SimpleProof) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SimpleProof.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SimpleProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SimpleProof.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SimpleProof) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SimpleProof.Merge(m, src)
|
||||
}
|
||||
func (m *SimpleProof) XXX_Size() int {
|
||||
return xxx_messageInfo_SimpleProof.Size(m)
|
||||
}
|
||||
func (m *SimpleProof) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SimpleProof.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SimpleProof proto.InternalMessageInfo
|
||||
|
||||
func (m *SimpleProof) GetTotal() int64 {
|
||||
if m != nil {
|
||||
return m.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SimpleProof) GetIndex() int64 {
|
||||
if m != nil {
|
||||
return m.Index
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SimpleProof) GetLeafHash() []byte {
|
||||
if m != nil {
|
||||
return m.LeafHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SimpleProof) GetAunts() [][]byte {
|
||||
if m != nil {
|
||||
return m.Aunts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SimpleProof)(nil), "tendermint.proto.crypto.merkle.SimpleProof")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/crypto/merkle/types.proto", fileDescriptor_57e39eefdaf7ae96) }
|
||||
|
||||
var fileDescriptor_57e39eefdaf7ae96 = []byte{
|
||||
// 188 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x4d, 0x2d, 0xca, 0xce, 0x49, 0xd5,
|
||||
0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x03, 0xcb, 0x08, 0xc9, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16,
|
||||
0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4, 0x20, 0x6a, 0xf5, 0x20, 0x6a, 0x95, 0x72, 0xb8, 0xb8,
|
||||
0x83, 0x33, 0x73, 0x0b, 0x72, 0x52, 0x03, 0x8a, 0xf2, 0xf3, 0xd3, 0x84, 0x44, 0xb8, 0x58, 0x4b,
|
||||
0xf2, 0x4b, 0x12, 0x73, 0x24, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0x20, 0x1c, 0x90, 0x68, 0x66,
|
||||
0x5e, 0x4a, 0x6a, 0x85, 0x04, 0x13, 0x44, 0x14, 0xcc, 0x11, 0x92, 0xe6, 0xe2, 0xcc, 0x49, 0x4d,
|
||||
0x4c, 0x8b, 0xcf, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0xe2, 0x00, 0x09,
|
||||
0x78, 0x24, 0x16, 0x67, 0x80, 0xb4, 0x24, 0x96, 0xe6, 0x95, 0x14, 0x4b, 0xb0, 0x28, 0x30, 0x6b,
|
||||
0xf0, 0x04, 0x41, 0x38, 0x4e, 0x66, 0x51, 0x26, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9,
|
||||
0xf9, 0xb9, 0xfa, 0x08, 0xa7, 0x21, 0x33, 0xb1, 0xf8, 0x28, 0x89, 0x0d, 0x2c, 0x68, 0x0c, 0x08,
|
||||
0x00, 0x00, 0xff, 0xff, 0x4f, 0x08, 0x9a, 0xf1, 0xef, 0x00, 0x00, 0x00,
|
||||
}
|
||||
11
proto/crypto/merkle/types.proto
Normal file
11
proto/crypto/merkle/types.proto
Normal file
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.crypto.merkle;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/crypto/merkle";
|
||||
|
||||
message SimpleProof {
|
||||
int64 total = 1;
|
||||
int64 index = 2;
|
||||
bytes leaf_hash = 3;
|
||||
repeated bytes aunts = 4;
|
||||
}
|
||||
86
proto/libs/bits/types.pb.go
Normal file
86
proto/libs/bits/types.pb.go
Normal file
@@ -0,0 +1,86 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/libs/bits/types.proto
|
||||
|
||||
package bits
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type BitArray struct {
|
||||
Bits int64 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"`
|
||||
Elems []uint64 `protobuf:"varint,2,rep,packed,name=elems,proto3" json:"elems,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BitArray) Reset() { *m = BitArray{} }
|
||||
func (m *BitArray) String() string { return proto.CompactTextString(m) }
|
||||
func (*BitArray) ProtoMessage() {}
|
||||
func (*BitArray) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3f1fbe70d7999e09, []int{0}
|
||||
}
|
||||
func (m *BitArray) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BitArray.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BitArray.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BitArray) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BitArray.Merge(m, src)
|
||||
}
|
||||
func (m *BitArray) XXX_Size() int {
|
||||
return xxx_messageInfo_BitArray.Size(m)
|
||||
}
|
||||
func (m *BitArray) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BitArray.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BitArray proto.InternalMessageInfo
|
||||
|
||||
func (m *BitArray) GetBits() int64 {
|
||||
if m != nil {
|
||||
return m.Bits
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BitArray) GetElems() []uint64 {
|
||||
if m != nil {
|
||||
return m.Elems
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*BitArray)(nil), "tendermint.proto.libs.bits.BitArray")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/libs/bits/types.proto", fileDescriptor_3f1fbe70d7999e09) }
|
||||
|
||||
var fileDescriptor_3f1fbe70d7999e09 = []byte{
|
||||
// 140 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xca, 0x2c, 0x29, 0xd6, 0x2f, 0xa9, 0x2c, 0x48,
|
||||
0x2d, 0xd6, 0x03, 0x8b, 0x0a, 0x49, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95,
|
||||
0x40, 0x44, 0xf4, 0x40, 0xea, 0xf4, 0x40, 0xea, 0x94, 0x4c, 0xb8, 0x38, 0x9c, 0x32, 0x4b, 0x1c,
|
||||
0x8b, 0x8a, 0x12, 0x2b, 0x85, 0x84, 0xb8, 0x58, 0x40, 0x62, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc,
|
||||
0x41, 0x60, 0xb6, 0x90, 0x08, 0x17, 0x6b, 0x6a, 0x4e, 0x6a, 0x6e, 0xb1, 0x04, 0x93, 0x02, 0xb3,
|
||||
0x06, 0x4b, 0x10, 0x84, 0xe3, 0x64, 0x14, 0x65, 0x90, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97,
|
||||
0x9c, 0x9f, 0xab, 0x8f, 0x30, 0x1e, 0x99, 0x89, 0xe6, 0xa2, 0x24, 0x36, 0xb0, 0x80, 0x31, 0x20,
|
||||
0x00, 0x00, 0xff, 0xff, 0x49, 0xc4, 0x52, 0x81, 0xab, 0x00, 0x00, 0x00,
|
||||
}
|
||||
9
proto/libs/bits/types.proto
Normal file
9
proto/libs/bits/types.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.libs.bits;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/libs/bits";
|
||||
|
||||
message BitArray {
|
||||
int64 bits = 1;
|
||||
repeated uint64 elems = 2;
|
||||
}
|
||||
258
proto/p2p/conn_msgs.pb.go
Normal file
258
proto/p2p/conn_msgs.pb.go
Normal file
@@ -0,0 +1,258 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/p2p/conn_msgs.proto
|
||||
|
||||
package p2p
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type PacketPing struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PacketPing) Reset() { *m = PacketPing{} }
|
||||
func (m *PacketPing) String() string { return proto.CompactTextString(m) }
|
||||
func (*PacketPing) ProtoMessage() {}
|
||||
func (*PacketPing) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8c680f0b24d73fe7, []int{0}
|
||||
}
|
||||
func (m *PacketPing) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PacketPing.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PacketPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PacketPing.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PacketPing) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PacketPing.Merge(m, src)
|
||||
}
|
||||
func (m *PacketPing) XXX_Size() int {
|
||||
return xxx_messageInfo_PacketPing.Size(m)
|
||||
}
|
||||
func (m *PacketPing) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PacketPing.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PacketPing proto.InternalMessageInfo
|
||||
|
||||
type PacketPong struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PacketPong) Reset() { *m = PacketPong{} }
|
||||
func (m *PacketPong) String() string { return proto.CompactTextString(m) }
|
||||
func (*PacketPong) ProtoMessage() {}
|
||||
func (*PacketPong) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8c680f0b24d73fe7, []int{1}
|
||||
}
|
||||
func (m *PacketPong) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PacketPong.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PacketPong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PacketPong.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PacketPong) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PacketPong.Merge(m, src)
|
||||
}
|
||||
func (m *PacketPong) XXX_Size() int {
|
||||
return xxx_messageInfo_PacketPong.Size(m)
|
||||
}
|
||||
func (m *PacketPong) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PacketPong.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PacketPong proto.InternalMessageInfo
|
||||
|
||||
type PacketMsg struct {
|
||||
ChannelID int32 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
|
||||
EOF int32 `protobuf:"varint,2,opt,name=eof,proto3" json:"eof,omitempty"`
|
||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PacketMsg) Reset() { *m = PacketMsg{} }
|
||||
func (m *PacketMsg) String() string { return proto.CompactTextString(m) }
|
||||
func (*PacketMsg) ProtoMessage() {}
|
||||
func (*PacketMsg) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8c680f0b24d73fe7, []int{2}
|
||||
}
|
||||
func (m *PacketMsg) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PacketMsg.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PacketMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PacketMsg.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PacketMsg) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PacketMsg.Merge(m, src)
|
||||
}
|
||||
func (m *PacketMsg) XXX_Size() int {
|
||||
return xxx_messageInfo_PacketMsg.Size(m)
|
||||
}
|
||||
func (m *PacketMsg) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PacketMsg.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PacketMsg proto.InternalMessageInfo
|
||||
|
||||
func (m *PacketMsg) GetChannelID() int32 {
|
||||
if m != nil {
|
||||
return m.ChannelID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *PacketMsg) GetEOF() int32 {
|
||||
if m != nil {
|
||||
return m.EOF
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *PacketMsg) GetData() []byte {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Packet struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Packet_PacketPing
|
||||
// *Packet_PacketPong
|
||||
// *Packet_PacketMsg
|
||||
Sum isPacket_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Packet) Reset() { *m = Packet{} }
|
||||
func (m *Packet) String() string { return proto.CompactTextString(m) }
|
||||
func (*Packet) ProtoMessage() {}
|
||||
func (*Packet) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8c680f0b24d73fe7, []int{3}
|
||||
}
|
||||
func (m *Packet) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Packet.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Packet.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Packet) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Packet.Merge(m, src)
|
||||
}
|
||||
func (m *Packet) XXX_Size() int {
|
||||
return xxx_messageInfo_Packet.Size(m)
|
||||
}
|
||||
func (m *Packet) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Packet.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Packet proto.InternalMessageInfo
|
||||
|
||||
type isPacket_Sum interface {
|
||||
isPacket_Sum()
|
||||
}
|
||||
|
||||
type Packet_PacketPing struct {
|
||||
PacketPing *PacketPing `protobuf:"bytes,1,opt,name=packet_ping,json=packetPing,proto3,oneof" json:"packet_ping,omitempty"`
|
||||
}
|
||||
type Packet_PacketPong struct {
|
||||
PacketPong *PacketPong `protobuf:"bytes,2,opt,name=packet_pong,json=packetPong,proto3,oneof" json:"packet_pong,omitempty"`
|
||||
}
|
||||
type Packet_PacketMsg struct {
|
||||
PacketMsg *PacketMsg `protobuf:"bytes,3,opt,name=packet_msg,json=packetMsg,proto3,oneof" json:"packet_msg,omitempty"`
|
||||
}
|
||||
|
||||
func (*Packet_PacketPing) isPacket_Sum() {}
|
||||
func (*Packet_PacketPong) isPacket_Sum() {}
|
||||
func (*Packet_PacketMsg) isPacket_Sum() {}
|
||||
|
||||
func (m *Packet) GetSum() isPacket_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Packet) GetPacketPing() *PacketPing {
|
||||
if x, ok := m.GetSum().(*Packet_PacketPing); ok {
|
||||
return x.PacketPing
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Packet) GetPacketPong() *PacketPong {
|
||||
if x, ok := m.GetSum().(*Packet_PacketPong); ok {
|
||||
return x.PacketPong
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Packet) GetPacketMsg() *PacketMsg {
|
||||
if x, ok := m.GetSum().(*Packet_PacketMsg); ok {
|
||||
return x.PacketMsg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Packet) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Packet_PacketPing)(nil),
|
||||
(*Packet_PacketPong)(nil),
|
||||
(*Packet_PacketMsg)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*PacketPing)(nil), "tendermint.proto.p2p.PacketPing")
|
||||
proto.RegisterType((*PacketPong)(nil), "tendermint.proto.p2p.PacketPong")
|
||||
proto.RegisterType((*PacketMsg)(nil), "tendermint.proto.p2p.PacketMsg")
|
||||
proto.RegisterType((*Packet)(nil), "tendermint.proto.p2p.Packet")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/p2p/conn_msgs.proto", fileDescriptor_8c680f0b24d73fe7) }
|
||||
|
||||
var fileDescriptor_8c680f0b24d73fe7 = []byte{
|
||||
// 295 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xc1, 0x4f, 0x83, 0x30,
|
||||
0x14, 0xc6, 0x45, 0xdc, 0x0c, 0x8f, 0x79, 0x69, 0x3c, 0x30, 0x2f, 0x10, 0x0e, 0x66, 0x31, 0x0b,
|
||||
0x24, 0xf8, 0x0f, 0x18, 0xa6, 0xc6, 0x1d, 0x16, 0x17, 0x8e, 0x5e, 0x08, 0x03, 0x2c, 0x8d, 0xd2,
|
||||
0xd7, 0x40, 0x77, 0xf0, 0x6f, 0x35, 0xd9, 0x61, 0x7f, 0x89, 0xa1, 0x9d, 0x03, 0x13, 0xa3, 0xb7,
|
||||
0xef, 0xfb, 0xf2, 0xfa, 0x7b, 0x5f, 0x5b, 0x98, 0x8a, 0x06, 0x25, 0x86, 0x22, 0x12, 0x61, 0x8e,
|
||||
0x9c, 0xa7, 0x75, 0x4b, 0xdb, 0x40, 0x65, 0xe4, 0x52, 0x96, 0xbc, 0x28, 0x9b, 0x9a, 0x71, 0xa9,
|
||||
0x93, 0x40, 0x44, 0xe2, 0xea, 0x5a, 0x56, 0xac, 0x29, 0x52, 0x91, 0x35, 0xf2, 0x23, 0xd4, 0x87,
|
||||
0x29, 0x52, 0xec, 0x95, 0x9e, 0xf5, 0x27, 0x00, 0xeb, 0x2c, 0x7f, 0x2b, 0xe5, 0x9a, 0x71, 0x3a,
|
||||
0x70, 0xc8, 0xa9, 0x5f, 0x81, 0xa5, 0xdd, 0xaa, 0xa5, 0x64, 0x0e, 0x90, 0x57, 0x19, 0xe7, 0xe5,
|
||||
0x7b, 0xca, 0x0a, 0xc7, 0xf0, 0x8c, 0xd9, 0x28, 0xbe, 0xd8, 0xef, 0x5c, 0x6b, 0xa1, 0xd3, 0xe5,
|
||||
0x7d, 0x62, 0x1d, 0x06, 0x96, 0x05, 0x99, 0x82, 0x59, 0xe2, 0xab, 0x73, 0xaa, 0xc6, 0xce, 0xf7,
|
||||
0x3b, 0xd7, 0x7c, 0x78, 0x7e, 0x4c, 0xba, 0x8c, 0x10, 0x38, 0x2b, 0x32, 0x99, 0x39, 0xa6, 0x67,
|
||||
0xcc, 0x26, 0x89, 0xd2, 0xfe, 0xa7, 0x01, 0x63, 0xbd, 0x8a, 0x2c, 0xc0, 0x16, 0x4a, 0xa5, 0x82,
|
||||
0x71, 0xaa, 0x16, 0xd9, 0x91, 0x17, 0xfc, 0x76, 0xc9, 0xa0, 0x6f, 0xfe, 0x74, 0x92, 0x80, 0x38,
|
||||
0xba, 0x21, 0x04, 0x39, 0x55, 0x35, 0xfe, 0x83, 0xe0, 0x0f, 0x08, 0x72, 0x4a, 0xee, 0xe0, 0xe0,
|
||||
0xba, 0xd7, 0x56, 0x75, 0xed, 0xc8, 0xfd, 0x8b, 0xb1, 0x6a, 0x3b, 0x84, 0x25, 0xbe, 0x4d, 0x3c,
|
||||
0x02, 0xb3, 0xdd, 0xd6, 0xf1, 0xfc, 0xe5, 0x86, 0x32, 0x59, 0x6d, 0x37, 0x41, 0x8e, 0x75, 0xd8,
|
||||
0x03, 0x86, 0xf2, 0xf8, 0xbf, 0x9b, 0xb1, 0x92, 0xb7, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x87,
|
||||
0x8c, 0x0a, 0x5f, 0xf3, 0x01, 0x00, 0x00,
|
||||
}
|
||||
24
proto/p2p/conn_msgs.proto
Normal file
24
proto/p2p/conn_msgs.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/p2p";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
|
||||
message PacketPing {}
|
||||
|
||||
message PacketPong {}
|
||||
|
||||
message PacketMsg {
|
||||
int32 channel_id = 1 [(gogoproto.customname) = "ChannelID"];
|
||||
int32 eof = 2 [(gogoproto.customname) = "EOF"];
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
message Packet {
|
||||
oneof sum {
|
||||
PacketPing packet_ping = 1;
|
||||
PacketPong packet_pong = 2;
|
||||
PacketMsg packet_msg = 3;
|
||||
}
|
||||
}
|
||||
195
proto/p2p/pex_msgs.pb.go
Normal file
195
proto/p2p/pex_msgs.pb.go
Normal file
@@ -0,0 +1,195 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/p2p/pex_msgs.proto
|
||||
|
||||
package p2p
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type PexRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PexRequest) Reset() { *m = PexRequest{} }
|
||||
func (m *PexRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PexRequest) ProtoMessage() {}
|
||||
func (*PexRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b4d6fe6b009e47d8, []int{0}
|
||||
}
|
||||
func (m *PexRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PexRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PexRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PexRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PexRequest.Merge(m, src)
|
||||
}
|
||||
func (m *PexRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_PexRequest.Size(m)
|
||||
}
|
||||
func (m *PexRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PexRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PexRequest proto.InternalMessageInfo
|
||||
|
||||
type PexAddrs struct {
|
||||
Addrs []NetAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PexAddrs) Reset() { *m = PexAddrs{} }
|
||||
func (m *PexAddrs) String() string { return proto.CompactTextString(m) }
|
||||
func (*PexAddrs) ProtoMessage() {}
|
||||
func (*PexAddrs) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b4d6fe6b009e47d8, []int{1}
|
||||
}
|
||||
func (m *PexAddrs) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PexAddrs.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PexAddrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PexAddrs.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PexAddrs) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PexAddrs.Merge(m, src)
|
||||
}
|
||||
func (m *PexAddrs) XXX_Size() int {
|
||||
return xxx_messageInfo_PexAddrs.Size(m)
|
||||
}
|
||||
func (m *PexAddrs) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PexAddrs.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PexAddrs proto.InternalMessageInfo
|
||||
|
||||
func (m *PexAddrs) GetAddrs() []NetAddress {
|
||||
if m != nil {
|
||||
return m.Addrs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Message_PexRequest
|
||||
// *Message_PexAddrs
|
||||
Sum isMessage_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_b4d6fe6b009e47d8, []int{2}
|
||||
}
|
||||
func (m *Message) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Message.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Message) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Message.Merge(m, src)
|
||||
}
|
||||
func (m *Message) XXX_Size() int {
|
||||
return xxx_messageInfo_Message.Size(m)
|
||||
}
|
||||
func (m *Message) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Message.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Message proto.InternalMessageInfo
|
||||
|
||||
type isMessage_Sum interface {
|
||||
isMessage_Sum()
|
||||
}
|
||||
|
||||
type Message_PexRequest struct {
|
||||
PexRequest *PexRequest `protobuf:"bytes,1,opt,name=pex_request,json=pexRequest,proto3,oneof" json:"pex_request,omitempty"`
|
||||
}
|
||||
type Message_PexAddrs struct {
|
||||
PexAddrs *PexAddrs `protobuf:"bytes,2,opt,name=pex_addrs,json=pexAddrs,proto3,oneof" json:"pex_addrs,omitempty"`
|
||||
}
|
||||
|
||||
func (*Message_PexRequest) isMessage_Sum() {}
|
||||
func (*Message_PexAddrs) isMessage_Sum() {}
|
||||
|
||||
func (m *Message) GetSum() isMessage_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetPexRequest() *PexRequest {
|
||||
if x, ok := m.GetSum().(*Message_PexRequest); ok {
|
||||
return x.PexRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetPexAddrs() *PexAddrs {
|
||||
if x, ok := m.GetSum().(*Message_PexAddrs); ok {
|
||||
return x.PexAddrs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Message) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Message_PexRequest)(nil),
|
||||
(*Message_PexAddrs)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*PexRequest)(nil), "tendermint.proto.p2p.PexRequest")
|
||||
proto.RegisterType((*PexAddrs)(nil), "tendermint.proto.p2p.PexAddrs")
|
||||
proto.RegisterType((*Message)(nil), "tendermint.proto.p2p.Message")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/p2p/pex_msgs.proto", fileDescriptor_b4d6fe6b009e47d8) }
|
||||
|
||||
var fileDescriptor_b4d6fe6b009e47d8 = []byte{
|
||||
// 255 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x2f, 0x30, 0x2a, 0xd0, 0x2f, 0x48, 0xad, 0x88, 0xcf, 0x2d, 0x4e, 0x2f, 0xd6, 0x03,
|
||||
0x0b, 0x09, 0x89, 0x94, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4,
|
||||
0x0a, 0x8c, 0x0a, 0xa4, 0x44, 0x11, 0xea, 0x4b, 0x2a, 0x0b, 0x52, 0xa1, 0x8a, 0xa5, 0xd4, 0x4a,
|
||||
0x32, 0x32, 0x8b, 0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a, 0xf5, 0x21, 0x4a, 0xd2, 0xf3, 0xd3,
|
||||
0xf3, 0x11, 0x2c, 0x88, 0x3a, 0x25, 0x1e, 0x2e, 0xae, 0x80, 0xd4, 0x8a, 0xa0, 0xd4, 0xc2, 0xd2,
|
||||
0xd4, 0xe2, 0x12, 0x25, 0x0f, 0x2e, 0x8e, 0x80, 0xd4, 0x0a, 0xc7, 0x94, 0x94, 0xa2, 0x62, 0x21,
|
||||
0x1b, 0x2e, 0xd6, 0x44, 0x10, 0x43, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x41, 0x0f, 0x9b,
|
||||
0xf5, 0x7a, 0x7e, 0xa9, 0x25, 0x20, 0xe5, 0xa9, 0xc5, 0xc5, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33,
|
||||
0x04, 0x41, 0x34, 0x29, 0x4d, 0x61, 0xe4, 0x62, 0xf7, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x15,
|
||||
0x72, 0xe6, 0xe2, 0x06, 0x79, 0xa5, 0x08, 0x62, 0x89, 0x04, 0xa3, 0x02, 0x23, 0x6e, 0xf3, 0x10,
|
||||
0x8e, 0xf1, 0x60, 0x08, 0xe2, 0x2a, 0x80, 0xf3, 0x84, 0x6c, 0xb9, 0x38, 0x41, 0x86, 0x40, 0x9c,
|
||||
0xc4, 0x04, 0x36, 0x42, 0x0e, 0xa7, 0x11, 0x60, 0x1f, 0x78, 0x30, 0x04, 0x71, 0x14, 0x40, 0xd9,
|
||||
0x4e, 0xac, 0x5c, 0xcc, 0xc5, 0xa5, 0xb9, 0x4e, 0x3a, 0x51, 0x5a, 0xe9, 0x99, 0x25, 0x19, 0xa5,
|
||||
0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x08, 0xed, 0xc8, 0x4c, 0x78, 0x80, 0x26, 0xb1, 0x81, 0x99,
|
||||
0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73, 0x54, 0xb6, 0xcc, 0x94, 0x01, 0x00, 0x00,
|
||||
}
|
||||
20
proto/p2p/pex_msgs.proto
Normal file
20
proto/p2p/pex_msgs.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/p2p";
|
||||
|
||||
import "proto/p2p/types.proto";
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
|
||||
message PexRequest {}
|
||||
|
||||
message PexAddrs {
|
||||
repeated NetAddress addrs = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
message Message {
|
||||
oneof sum {
|
||||
PexRequest pex_request = 1;
|
||||
PexAddrs pex_addrs = 2;
|
||||
}
|
||||
}
|
||||
321
proto/p2p/types.pb.go
Normal file
321
proto/p2p/types.pb.go
Normal file
@@ -0,0 +1,321 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/p2p/types.proto
|
||||
|
||||
package p2p
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type NetAddress struct {
|
||||
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
IP string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
|
||||
Str string `protobuf:"bytes,4,opt,name=str,proto3" json:"str,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *NetAddress) Reset() { *m = NetAddress{} }
|
||||
func (m *NetAddress) String() string { return proto.CompactTextString(m) }
|
||||
func (*NetAddress) ProtoMessage() {}
|
||||
func (*NetAddress) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_5c4320c1810ca85c, []int{0}
|
||||
}
|
||||
func (m *NetAddress) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_NetAddress.Unmarshal(m, b)
|
||||
}
|
||||
func (m *NetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_NetAddress.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *NetAddress) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_NetAddress.Merge(m, src)
|
||||
}
|
||||
func (m *NetAddress) XXX_Size() int {
|
||||
return xxx_messageInfo_NetAddress.Size(m)
|
||||
}
|
||||
func (m *NetAddress) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_NetAddress.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_NetAddress proto.InternalMessageInfo
|
||||
|
||||
func (m *NetAddress) GetID() string {
|
||||
if m != nil {
|
||||
return m.ID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *NetAddress) GetIP() string {
|
||||
if m != nil {
|
||||
return m.IP
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *NetAddress) GetPort() uint32 {
|
||||
if m != nil {
|
||||
return m.Port
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *NetAddress) GetStr() string {
|
||||
if m != nil {
|
||||
return m.Str
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ProtocolVersion struct {
|
||||
P2P uint64 `protobuf:"varint,1,opt,name=p2p,proto3" json:"p2p,omitempty"`
|
||||
Block uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
|
||||
App uint64 `protobuf:"varint,3,opt,name=app,proto3" json:"app,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ProtocolVersion) Reset() { *m = ProtocolVersion{} }
|
||||
func (m *ProtocolVersion) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProtocolVersion) ProtoMessage() {}
|
||||
func (*ProtocolVersion) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_5c4320c1810ca85c, []int{1}
|
||||
}
|
||||
func (m *ProtocolVersion) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ProtocolVersion.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ProtocolVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ProtocolVersion.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ProtocolVersion) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ProtocolVersion.Merge(m, src)
|
||||
}
|
||||
func (m *ProtocolVersion) XXX_Size() int {
|
||||
return xxx_messageInfo_ProtocolVersion.Size(m)
|
||||
}
|
||||
func (m *ProtocolVersion) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ProtocolVersion.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ProtocolVersion proto.InternalMessageInfo
|
||||
|
||||
func (m *ProtocolVersion) GetP2P() uint64 {
|
||||
if m != nil {
|
||||
return m.P2P
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtocolVersion) GetBlock() uint64 {
|
||||
if m != nil {
|
||||
return m.Block
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtocolVersion) GetApp() uint64 {
|
||||
if m != nil {
|
||||
return m.App
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DefaultNodeInfo struct {
|
||||
ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"`
|
||||
DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"`
|
||||
ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"`
|
||||
Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
|
||||
Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Channels []byte `protobuf:"bytes,6,opt,name=channels,proto3" json:"channels,omitempty"`
|
||||
Moniker string `protobuf:"bytes,7,opt,name=moniker,proto3" json:"moniker,omitempty"`
|
||||
Other DefaultNodeInfoOther `protobuf:"bytes,8,opt,name=other,proto3" json:"other"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) Reset() { *m = DefaultNodeInfo{} }
|
||||
func (m *DefaultNodeInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*DefaultNodeInfo) ProtoMessage() {}
|
||||
func (*DefaultNodeInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_5c4320c1810ca85c, []int{2}
|
||||
}
|
||||
func (m *DefaultNodeInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DefaultNodeInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *DefaultNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_DefaultNodeInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *DefaultNodeInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DefaultNodeInfo.Merge(m, src)
|
||||
}
|
||||
func (m *DefaultNodeInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_DefaultNodeInfo.Size(m)
|
||||
}
|
||||
func (m *DefaultNodeInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DefaultNodeInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DefaultNodeInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *DefaultNodeInfo) GetProtocolVersion() ProtocolVersion {
|
||||
if m != nil {
|
||||
return m.ProtocolVersion
|
||||
}
|
||||
return ProtocolVersion{}
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetDefaultNodeID() string {
|
||||
if m != nil {
|
||||
return m.DefaultNodeID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetListenAddr() string {
|
||||
if m != nil {
|
||||
return m.ListenAddr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetNetwork() string {
|
||||
if m != nil {
|
||||
return m.Network
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetVersion() string {
|
||||
if m != nil {
|
||||
return m.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetChannels() []byte {
|
||||
if m != nil {
|
||||
return m.Channels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetMoniker() string {
|
||||
if m != nil {
|
||||
return m.Moniker
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfo) GetOther() DefaultNodeInfoOther {
|
||||
if m != nil {
|
||||
return m.Other
|
||||
}
|
||||
return DefaultNodeInfoOther{}
|
||||
}
|
||||
|
||||
type DefaultNodeInfoOther struct {
|
||||
TxIndex string `protobuf:"bytes,1,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
|
||||
RPCAdddress string `protobuf:"bytes,2,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfoOther) Reset() { *m = DefaultNodeInfoOther{} }
|
||||
func (m *DefaultNodeInfoOther) String() string { return proto.CompactTextString(m) }
|
||||
func (*DefaultNodeInfoOther) ProtoMessage() {}
|
||||
func (*DefaultNodeInfoOther) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_5c4320c1810ca85c, []int{3}
|
||||
}
|
||||
func (m *DefaultNodeInfoOther) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DefaultNodeInfoOther.Unmarshal(m, b)
|
||||
}
|
||||
func (m *DefaultNodeInfoOther) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_DefaultNodeInfoOther.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *DefaultNodeInfoOther) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DefaultNodeInfoOther.Merge(m, src)
|
||||
}
|
||||
func (m *DefaultNodeInfoOther) XXX_Size() int {
|
||||
return xxx_messageInfo_DefaultNodeInfoOther.Size(m)
|
||||
}
|
||||
func (m *DefaultNodeInfoOther) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DefaultNodeInfoOther.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DefaultNodeInfoOther proto.InternalMessageInfo
|
||||
|
||||
func (m *DefaultNodeInfoOther) GetTxIndex() string {
|
||||
if m != nil {
|
||||
return m.TxIndex
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DefaultNodeInfoOther) GetRPCAdddress() string {
|
||||
if m != nil {
|
||||
return m.RPCAdddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*NetAddress)(nil), "tendermint.proto.p2p.NetAddress")
|
||||
proto.RegisterType((*ProtocolVersion)(nil), "tendermint.proto.p2p.ProtocolVersion")
|
||||
proto.RegisterType((*DefaultNodeInfo)(nil), "tendermint.proto.p2p.DefaultNodeInfo")
|
||||
proto.RegisterType((*DefaultNodeInfoOther)(nil), "tendermint.proto.p2p.DefaultNodeInfoOther")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/p2p/types.proto", fileDescriptor_5c4320c1810ca85c) }
|
||||
|
||||
var fileDescriptor_5c4320c1810ca85c = []byte{
|
||||
// 471 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0xcf, 0x8a, 0xdb, 0x3e,
|
||||
0x18, 0xfc, 0xc5, 0x71, 0xfe, 0xec, 0x97, 0x5f, 0xf0, 0x56, 0xa4, 0xc5, 0xbb, 0x17, 0x87, 0x40,
|
||||
0x4b, 0x58, 0x8a, 0x53, 0xdc, 0x53, 0x8f, 0x9b, 0x86, 0x42, 0x2e, 0x5b, 0x23, 0xca, 0x1e, 0x7a,
|
||||
0x31, 0x8e, 0xa5, 0x4d, 0x44, 0x1c, 0x49, 0xc8, 0xda, 0x36, 0xfb, 0x86, 0x7d, 0x0a, 0x1f, 0xf2,
|
||||
0x12, 0xbd, 0x16, 0x49, 0xde, 0xdd, 0x10, 0x72, 0x9b, 0x19, 0x7d, 0xe3, 0xf9, 0x34, 0xc8, 0xf0,
|
||||
0x56, 0x2a, 0xa1, 0xc5, 0x4c, 0x26, 0x72, 0xa6, 0x9f, 0x24, 0xad, 0x62, 0xcb, 0xd1, 0x48, 0x53,
|
||||
0x4e, 0xa8, 0xda, 0x31, 0xae, 0x9d, 0x12, 0xcb, 0x44, 0x5e, 0x7f, 0xd0, 0x1b, 0xa6, 0x48, 0x26,
|
||||
0x73, 0xa5, 0x9f, 0x66, 0xce, 0xb8, 0x16, 0x6b, 0xf1, 0x8a, 0xdc, 0xec, 0x64, 0x05, 0x70, 0x47,
|
||||
0xf5, 0x2d, 0x21, 0x8a, 0x56, 0x15, 0x7a, 0x07, 0x1e, 0x23, 0x61, 0x6b, 0xdc, 0x9a, 0x5e, 0xcc,
|
||||
0xbb, 0x87, 0x3a, 0xf2, 0x96, 0x0b, 0xec, 0x31, 0x62, 0x75, 0x19, 0x7a, 0x47, 0x7a, 0x8a, 0x3d,
|
||||
0x26, 0x11, 0x02, 0x5f, 0x0a, 0xa5, 0xc3, 0xf6, 0xb8, 0x35, 0x1d, 0x62, 0x8b, 0xd1, 0x25, 0xb4,
|
||||
0x2b, 0xad, 0x42, 0xdf, 0x0c, 0x63, 0x03, 0x27, 0x3f, 0x20, 0x48, 0x4d, 0x58, 0x21, 0xca, 0x7b,
|
||||
0xaa, 0x2a, 0x26, 0x38, 0xba, 0x82, 0xb6, 0x4c, 0xa4, 0x4d, 0xf2, 0xe7, 0xbd, 0x43, 0x1d, 0xb5,
|
||||
0xd3, 0x24, 0xc5, 0x46, 0x43, 0x23, 0xe8, 0xac, 0x4a, 0x51, 0x6c, 0x6d, 0x9c, 0x8f, 0x1d, 0x31,
|
||||
0x5f, 0xcd, 0xa5, 0xb4, 0x41, 0x3e, 0x36, 0x70, 0xf2, 0xd7, 0x83, 0x60, 0x41, 0x1f, 0xf2, 0xc7,
|
||||
0x52, 0xdf, 0x09, 0x42, 0x97, 0xfc, 0x41, 0xa0, 0x7b, 0xb8, 0x94, 0x4d, 0x52, 0xf6, 0xcb, 0x45,
|
||||
0xd9, 0x8c, 0x41, 0xf2, 0x3e, 0x3e, 0x57, 0x53, 0x7c, 0xb2, 0xd7, 0xdc, 0xff, 0x53, 0x47, 0xff,
|
||||
0xe1, 0x40, 0x9e, 0xac, 0xfb, 0x05, 0x02, 0xe2, 0xa2, 0x32, 0x2e, 0x08, 0xcd, 0x18, 0x69, 0xca,
|
||||
0x78, 0x73, 0xa8, 0xa3, 0xe1, 0xf1, 0x16, 0x0b, 0x3c, 0x24, 0x47, 0x94, 0xa0, 0x08, 0x06, 0x25,
|
||||
0xab, 0x34, 0xe5, 0x59, 0x4e, 0x88, 0xb2, 0x17, 0xb8, 0xc0, 0xe0, 0x24, 0x53, 0x3b, 0x0a, 0xa1,
|
||||
0xc7, 0xa9, 0xfe, 0x2d, 0xd4, 0xb6, 0xe9, 0xec, 0x99, 0x9a, 0x93, 0xe7, 0x4b, 0x74, 0xdc, 0x49,
|
||||
0x43, 0xd1, 0x35, 0xf4, 0x8b, 0x4d, 0xce, 0x39, 0x2d, 0xab, 0xb0, 0x3b, 0x6e, 0x4d, 0xff, 0xc7,
|
||||
0x2f, 0xdc, 0xb8, 0x76, 0x82, 0xb3, 0x2d, 0x55, 0x61, 0xcf, 0xb9, 0x1a, 0x8a, 0xbe, 0x41, 0x47,
|
||||
0xe8, 0x0d, 0x55, 0x61, 0xdf, 0x56, 0x72, 0x73, 0xbe, 0x92, 0x93, 0x4e, 0xbf, 0x1b, 0x47, 0xd3,
|
||||
0x8b, 0xb3, 0x4f, 0x0a, 0x18, 0x9d, 0x1b, 0x42, 0x57, 0xd0, 0xd7, 0xfb, 0x8c, 0x71, 0x42, 0xf7,
|
||||
0xee, 0x0d, 0xe1, 0x9e, 0xde, 0x2f, 0x0d, 0x45, 0x9f, 0x60, 0xa0, 0x64, 0x61, 0x2b, 0xa0, 0x55,
|
||||
0xd5, 0x94, 0x17, 0x1c, 0xea, 0x68, 0x80, 0xd3, 0xaf, 0xb7, 0xc4, 0xc9, 0x18, 0x94, 0x2c, 0x9a,
|
||||
0xa7, 0x38, 0xff, 0xf8, 0xf3, 0x66, 0xcd, 0xf4, 0xe6, 0x71, 0x15, 0x17, 0x62, 0x37, 0x7b, 0xdd,
|
||||
0xf4, 0x18, 0xbe, 0xfc, 0x10, 0xab, 0xae, 0x85, 0x9f, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xa2,
|
||||
0x36, 0x05, 0x66, 0x24, 0x03, 0x00, 0x00,
|
||||
}
|
||||
35
proto/p2p/types.proto
Normal file
35
proto/p2p/types.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.p2p;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/p2p";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
|
||||
message NetAddress {
|
||||
string id = 1 [(gogoproto.customname) = "ID"];
|
||||
string ip = 2 [(gogoproto.customname) = "IP"];
|
||||
uint32 port = 3;
|
||||
string str = 4;
|
||||
}
|
||||
|
||||
message ProtocolVersion {
|
||||
uint64 p2p = 1 [(gogoproto.customname) = "P2P"];
|
||||
uint64 block = 2;
|
||||
uint64 app = 3;
|
||||
}
|
||||
|
||||
message DefaultNodeInfo {
|
||||
ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false];
|
||||
string default_node_id = 2 [(gogoproto.customname) = "DefaultNodeID"];
|
||||
string listen_addr = 3;
|
||||
string network = 4;
|
||||
string version = 5;
|
||||
bytes channels = 6;
|
||||
string moniker = 7;
|
||||
DefaultNodeInfoOther other = 8 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
message DefaultNodeInfoOther {
|
||||
string tx_index = 1;
|
||||
string rpc_address = 2 [(gogoproto.customname) = "RPCAdddress"];
|
||||
}
|
||||
426
proto/privval/msgs.pb.go
Normal file
426
proto/privval/msgs.pb.go
Normal file
@@ -0,0 +1,426 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/privval/msgs.proto
|
||||
|
||||
package privval
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
keys "github.com/tendermint/tendermint/proto/crypto/keys"
|
||||
types "github.com/tendermint/tendermint/proto/types"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type RemoteSignerError struct {
|
||||
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *RemoteSignerError) Reset() { *m = RemoteSignerError{} }
|
||||
func (m *RemoteSignerError) String() string { return proto.CompactTextString(m) }
|
||||
func (*RemoteSignerError) ProtoMessage() {}
|
||||
func (*RemoteSignerError) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{0}
|
||||
}
|
||||
func (m *RemoteSignerError) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_RemoteSignerError.Unmarshal(m, b)
|
||||
}
|
||||
func (m *RemoteSignerError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_RemoteSignerError.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *RemoteSignerError) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_RemoteSignerError.Merge(m, src)
|
||||
}
|
||||
func (m *RemoteSignerError) XXX_Size() int {
|
||||
return xxx_messageInfo_RemoteSignerError.Size(m)
|
||||
}
|
||||
func (m *RemoteSignerError) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_RemoteSignerError.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_RemoteSignerError proto.InternalMessageInfo
|
||||
|
||||
func (m *RemoteSignerError) GetCode() int32 {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *RemoteSignerError) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// PubKeyRequest requests the consensus public key from the remote signer.
|
||||
type PubKeyRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PubKeyRequest) Reset() { *m = PubKeyRequest{} }
|
||||
func (m *PubKeyRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PubKeyRequest) ProtoMessage() {}
|
||||
func (*PubKeyRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{1}
|
||||
}
|
||||
func (m *PubKeyRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PubKeyRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PubKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PubKeyRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PubKeyRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PubKeyRequest.Merge(m, src)
|
||||
}
|
||||
func (m *PubKeyRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_PubKeyRequest.Size(m)
|
||||
}
|
||||
func (m *PubKeyRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PubKeyRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PubKeyRequest proto.InternalMessageInfo
|
||||
|
||||
// PubKeyResponse is a response message containing the public key.
|
||||
type PubKeyResponse struct {
|
||||
PubKey keys.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
|
||||
Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PubKeyResponse) Reset() { *m = PubKeyResponse{} }
|
||||
func (m *PubKeyResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PubKeyResponse) ProtoMessage() {}
|
||||
func (*PubKeyResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{2}
|
||||
}
|
||||
func (m *PubKeyResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PubKeyResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PubKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PubKeyResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PubKeyResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PubKeyResponse.Merge(m, src)
|
||||
}
|
||||
func (m *PubKeyResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_PubKeyResponse.Size(m)
|
||||
}
|
||||
func (m *PubKeyResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PubKeyResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PubKeyResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *PubKeyResponse) GetPubKey() keys.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return keys.PublicKey{}
|
||||
}
|
||||
|
||||
func (m *PubKeyResponse) GetError() *RemoteSignerError {
|
||||
if m != nil {
|
||||
return m.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SignVoteRequest is a request to sign a vote
|
||||
type SignVoteRequest struct {
|
||||
Vote types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SignVoteRequest) Reset() { *m = SignVoteRequest{} }
|
||||
func (m *SignVoteRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignVoteRequest) ProtoMessage() {}
|
||||
func (*SignVoteRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{3}
|
||||
}
|
||||
func (m *SignVoteRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignVoteRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SignVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SignVoteRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SignVoteRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SignVoteRequest.Merge(m, src)
|
||||
}
|
||||
func (m *SignVoteRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_SignVoteRequest.Size(m)
|
||||
}
|
||||
func (m *SignVoteRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SignVoteRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SignVoteRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *SignVoteRequest) GetVote() types.Vote {
|
||||
if m != nil {
|
||||
return m.Vote
|
||||
}
|
||||
return types.Vote{}
|
||||
}
|
||||
|
||||
// SignedVoteResponse is a response containing a signed vote or an error
|
||||
type SignVoteResponse struct {
|
||||
Vote types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"`
|
||||
Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SignVoteResponse) Reset() { *m = SignVoteResponse{} }
|
||||
func (m *SignVoteResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignVoteResponse) ProtoMessage() {}
|
||||
func (*SignVoteResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{4}
|
||||
}
|
||||
func (m *SignVoteResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignVoteResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SignVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SignVoteResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SignVoteResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SignVoteResponse.Merge(m, src)
|
||||
}
|
||||
func (m *SignVoteResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_SignVoteResponse.Size(m)
|
||||
}
|
||||
func (m *SignVoteResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SignVoteResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SignVoteResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *SignVoteResponse) GetVote() types.Vote {
|
||||
if m != nil {
|
||||
return m.Vote
|
||||
}
|
||||
return types.Vote{}
|
||||
}
|
||||
|
||||
func (m *SignVoteResponse) GetError() *RemoteSignerError {
|
||||
if m != nil {
|
||||
return m.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SignProposalRequest is a request to sign a proposal
|
||||
type SignProposalRequest struct {
|
||||
Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SignProposalRequest) Reset() { *m = SignProposalRequest{} }
|
||||
func (m *SignProposalRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignProposalRequest) ProtoMessage() {}
|
||||
func (*SignProposalRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{5}
|
||||
}
|
||||
func (m *SignProposalRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignProposalRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SignProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SignProposalRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SignProposalRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SignProposalRequest.Merge(m, src)
|
||||
}
|
||||
func (m *SignProposalRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_SignProposalRequest.Size(m)
|
||||
}
|
||||
func (m *SignProposalRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SignProposalRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SignProposalRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *SignProposalRequest) GetProposal() types.Proposal {
|
||||
if m != nil {
|
||||
return m.Proposal
|
||||
}
|
||||
return types.Proposal{}
|
||||
}
|
||||
|
||||
// SignedProposalResponse is response containing a signed proposal or an error
|
||||
type SignedProposalResponse struct {
|
||||
Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"`
|
||||
Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SignedProposalResponse) Reset() { *m = SignedProposalResponse{} }
|
||||
func (m *SignedProposalResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignedProposalResponse) ProtoMessage() {}
|
||||
func (*SignedProposalResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{6}
|
||||
}
|
||||
func (m *SignedProposalResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignedProposalResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SignedProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SignedProposalResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SignedProposalResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SignedProposalResponse.Merge(m, src)
|
||||
}
|
||||
func (m *SignedProposalResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_SignedProposalResponse.Size(m)
|
||||
}
|
||||
func (m *SignedProposalResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SignedProposalResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SignedProposalResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *SignedProposalResponse) GetProposal() types.Proposal {
|
||||
if m != nil {
|
||||
return m.Proposal
|
||||
}
|
||||
return types.Proposal{}
|
||||
}
|
||||
|
||||
func (m *SignedProposalResponse) GetError() *RemoteSignerError {
|
||||
if m != nil {
|
||||
return m.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// PingRequest is a request to confirm that the connection is alive.
|
||||
type PingRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PingRequest) Reset() { *m = PingRequest{} }
|
||||
func (m *PingRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingRequest) ProtoMessage() {}
|
||||
func (*PingRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{7}
|
||||
}
|
||||
func (m *PingRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PingRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PingRequest.Merge(m, src)
|
||||
}
|
||||
func (m *PingRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_PingRequest.Size(m)
|
||||
}
|
||||
func (m *PingRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PingRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PingRequest proto.InternalMessageInfo
|
||||
|
||||
// PingResponse is a response to confirm that the connection is alive.
|
||||
type PingResponse struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PingResponse) Reset() { *m = PingResponse{} }
|
||||
func (m *PingResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PingResponse) ProtoMessage() {}
|
||||
func (*PingResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_9ec52cc5e378f9a4, []int{8}
|
||||
}
|
||||
func (m *PingResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PingResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PingResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PingResponse.Merge(m, src)
|
||||
}
|
||||
func (m *PingResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_PingResponse.Size(m)
|
||||
}
|
||||
func (m *PingResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PingResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PingResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*RemoteSignerError)(nil), "tendermint.proto.privval.RemoteSignerError")
|
||||
proto.RegisterType((*PubKeyRequest)(nil), "tendermint.proto.privval.PubKeyRequest")
|
||||
proto.RegisterType((*PubKeyResponse)(nil), "tendermint.proto.privval.PubKeyResponse")
|
||||
proto.RegisterType((*SignVoteRequest)(nil), "tendermint.proto.privval.SignVoteRequest")
|
||||
proto.RegisterType((*SignVoteResponse)(nil), "tendermint.proto.privval.SignVoteResponse")
|
||||
proto.RegisterType((*SignProposalRequest)(nil), "tendermint.proto.privval.SignProposalRequest")
|
||||
proto.RegisterType((*SignedProposalResponse)(nil), "tendermint.proto.privval.SignedProposalResponse")
|
||||
proto.RegisterType((*PingRequest)(nil), "tendermint.proto.privval.PingRequest")
|
||||
proto.RegisterType((*PingResponse)(nil), "tendermint.proto.privval.PingResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/privval/msgs.proto", fileDescriptor_9ec52cc5e378f9a4) }
|
||||
|
||||
var fileDescriptor_9ec52cc5e378f9a4 = []byte{
|
||||
// 401 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xd1, 0xca, 0xd3, 0x30,
|
||||
0x1c, 0xc5, 0xad, 0x6c, 0x53, 0xff, 0x75, 0x9b, 0x56, 0xd0, 0x32, 0x14, 0x4b, 0x2f, 0x74, 0x20,
|
||||
0xa4, 0x32, 0xc1, 0x7b, 0x07, 0x0a, 0x63, 0x37, 0xa5, 0x82, 0xa0, 0x37, 0x63, 0x6d, 0xff, 0x74,
|
||||
0x61, 0x6b, 0x13, 0x93, 0x74, 0xd0, 0x87, 0xf0, 0x09, 0xbc, 0xf0, 0x75, 0x7c, 0x0a, 0x9f, 0x45,
|
||||
0x9a, 0xa4, 0x5f, 0xf7, 0x31, 0x76, 0xf3, 0xb1, 0xbb, 0xe4, 0xe4, 0x7f, 0x4e, 0xce, 0x2f, 0xb4,
|
||||
0xe0, 0x73, 0xc1, 0x14, 0x8b, 0xb8, 0xa0, 0xc7, 0xe3, 0xf6, 0x10, 0x95, 0xb2, 0x90, 0x44, 0x4b,
|
||||
0x9e, 0xaf, 0xb0, 0xca, 0x51, 0x94, 0xb4, 0x52, 0x46, 0x21, 0x76, 0x68, 0xf6, 0x46, 0xed, 0xa8,
|
||||
0xc8, 0x37, 0x7c, 0x2b, 0x54, 0x13, 0x19, 0x7f, 0xc1, 0x0a, 0xd6, 0xaf, 0xcc, 0xfc, 0xec, 0x95,
|
||||
0x51, 0x32, 0xd1, 0x70, 0xc5, 0xa2, 0x3d, 0x36, 0x32, 0x52, 0x0d, 0x47, 0x7b, 0xc1, 0xec, 0x85,
|
||||
0x39, 0xd6, 0xd2, 0xe9, 0x41, 0xb8, 0x82, 0xa7, 0x09, 0x96, 0x4c, 0xe1, 0x57, 0x5a, 0x54, 0x28,
|
||||
0x3e, 0x0b, 0xc1, 0x84, 0xe7, 0xc1, 0x20, 0x63, 0x39, 0xfa, 0x4e, 0xe0, 0xcc, 0x87, 0x89, 0x5e,
|
||||
0x7b, 0x01, 0xb8, 0x39, 0xca, 0x4c, 0x50, 0xae, 0x28, 0xab, 0xfc, 0xfb, 0x81, 0x33, 0x7f, 0x94,
|
||||
0x9c, 0x4a, 0xe1, 0x14, 0xc6, 0x71, 0x9d, 0xae, 0xb1, 0x49, 0xf0, 0x67, 0x8d, 0x52, 0x85, 0xbf,
|
||||
0x1d, 0x98, 0x74, 0x8a, 0xe4, 0xac, 0x92, 0xe8, 0x7d, 0x81, 0x07, 0xbc, 0x4e, 0x37, 0x7b, 0x6c,
|
||||
0x74, 0xb8, 0xbb, 0x78, 0x4b, 0xce, 0xd0, 0x0d, 0x03, 0x69, 0x19, 0x48, 0x5c, 0xa7, 0x07, 0x9a,
|
||||
0xad, 0xb1, 0x59, 0x0e, 0xfe, 0xfe, 0x7b, 0x7d, 0x2f, 0x19, 0x71, 0x9d, 0xe7, 0x7d, 0x82, 0x21,
|
||||
0xb6, 0x55, 0x75, 0x0f, 0x77, 0xf1, 0x8e, 0x5c, 0x7a, 0x40, 0x72, 0x46, 0x97, 0x18, 0x67, 0xb8,
|
||||
0x82, 0x69, 0xab, 0x7e, 0x63, 0x0a, 0x6d, 0x61, 0xef, 0x23, 0x0c, 0x8e, 0x4c, 0xa1, 0xad, 0xf6,
|
||||
0xf2, 0x3c, 0xd4, 0xbc, 0x5c, 0x6b, 0xb1, 0x7d, 0xf4, 0x7c, 0xf8, 0xcb, 0x81, 0x27, 0x7d, 0x96,
|
||||
0x45, 0xbd, 0x63, 0xd8, 0x35, 0xd0, 0xbe, 0xc3, 0xb3, 0x56, 0x8d, 0x05, 0xe3, 0x4c, 0x6e, 0x0f,
|
||||
0x1d, 0xde, 0x12, 0x1e, 0x72, 0x2b, 0xd9, 0x56, 0xc1, 0xa5, 0x56, 0x9d, 0xd5, 0x36, 0xbb, 0xf1,
|
||||
0x85, 0x7f, 0x1c, 0x78, 0xae, 0x6f, 0xcc, 0xfb, 0x74, 0x0b, 0x7c, 0x85, 0xf8, 0x6b, 0xc0, 0x8f,
|
||||
0xc1, 0x8d, 0x69, 0x55, 0x74, 0x1f, 0xe1, 0x04, 0x1e, 0x9b, 0xad, 0x69, 0xb9, 0x7c, 0xff, 0x83,
|
||||
0x14, 0x54, 0xed, 0xea, 0x94, 0x64, 0xac, 0x8c, 0xfa, 0xf8, 0xd3, 0xe5, 0xad, 0xff, 0x34, 0x1d,
|
||||
0xe9, 0xed, 0x87, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x00, 0x13, 0x1c, 0xbf, 0x03, 0x00,
|
||||
0x00,
|
||||
}
|
||||
50
proto/privval/msgs.proto
Normal file
50
proto/privval/msgs.proto
Normal file
@@ -0,0 +1,50 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.privval;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/privval";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/crypto/keys/types.proto";
|
||||
import "proto/types/types.proto";
|
||||
|
||||
message RemoteSignerError {
|
||||
int32 code = 1;
|
||||
string description = 2;
|
||||
}
|
||||
|
||||
// PubKeyRequest requests the consensus public key from the remote signer.
|
||||
message PubKeyRequest {}
|
||||
|
||||
// PubKeyResponse is a response message containing the public key.
|
||||
message PubKeyResponse {
|
||||
tendermint.proto.crypto.keys.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
|
||||
RemoteSignerError error = 2;
|
||||
}
|
||||
|
||||
// SignVoteRequest is a request to sign a vote
|
||||
message SignVoteRequest {
|
||||
tendermint.proto.types.Vote vote = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// SignedVoteResponse is a response containing a signed vote or an error
|
||||
message SignVoteResponse {
|
||||
tendermint.proto.types.Vote vote = 1 [(gogoproto.nullable) = false];
|
||||
RemoteSignerError error = 2;
|
||||
}
|
||||
|
||||
// SignProposalRequest is a request to sign a proposal
|
||||
message SignProposalRequest {
|
||||
tendermint.proto.types.Proposal proposal = 1 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// SignedProposalResponse is response containing a signed proposal or an error
|
||||
message SignedProposalResponse {
|
||||
tendermint.proto.types.Proposal proposal = 1 [(gogoproto.nullable) = false];
|
||||
RemoteSignerError error = 2;
|
||||
}
|
||||
|
||||
// PingRequest is a request to confirm that the connection is alive.
|
||||
message PingRequest {}
|
||||
|
||||
// PingResponse is a response to confirm that the connection is alive.
|
||||
message PingResponse {}
|
||||
199
proto/privval/types.pb.go
Normal file
199
proto/privval/types.pb.go
Normal file
@@ -0,0 +1,199 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/privval/types.proto
|
||||
|
||||
package privval
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
keys "github.com/tendermint/tendermint/proto/crypto/keys"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// FilePVKey stores the immutable part of PrivValidator.
|
||||
type FilePVKey struct {
|
||||
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||
PubKey keys.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
|
||||
PrivKey keys.PrivateKey `protobuf:"bytes,3,opt,name=priv_key,json=privKey,proto3" json:"priv_key"`
|
||||
FilePath string `protobuf:"bytes,4,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *FilePVKey) Reset() { *m = FilePVKey{} }
|
||||
func (m *FilePVKey) String() string { return proto.CompactTextString(m) }
|
||||
func (*FilePVKey) ProtoMessage() {}
|
||||
func (*FilePVKey) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_a9d74c406df3ad93, []int{0}
|
||||
}
|
||||
func (m *FilePVKey) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FilePVKey.Unmarshal(m, b)
|
||||
}
|
||||
func (m *FilePVKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_FilePVKey.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *FilePVKey) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_FilePVKey.Merge(m, src)
|
||||
}
|
||||
func (m *FilePVKey) XXX_Size() int {
|
||||
return xxx_messageInfo_FilePVKey.Size(m)
|
||||
}
|
||||
func (m *FilePVKey) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_FilePVKey.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_FilePVKey proto.InternalMessageInfo
|
||||
|
||||
func (m *FilePVKey) GetAddress() []byte {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *FilePVKey) GetPubKey() keys.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return keys.PublicKey{}
|
||||
}
|
||||
|
||||
func (m *FilePVKey) GetPrivKey() keys.PrivateKey {
|
||||
if m != nil {
|
||||
return m.PrivKey
|
||||
}
|
||||
return keys.PrivateKey{}
|
||||
}
|
||||
|
||||
func (m *FilePVKey) GetFilePath() string {
|
||||
if m != nil {
|
||||
return m.FilePath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// FilePVLastSignState stores the mutable part of PrivValidator.
|
||||
type FilePVLastSignState struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int64 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Step int32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"`
|
||||
Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
|
||||
SignBytes []byte `protobuf:"bytes,5,opt,name=sign_bytes,json=signBytes,proto3" json:"sign_bytes,omitempty"`
|
||||
FilePath string `protobuf:"bytes,6,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) Reset() { *m = FilePVLastSignState{} }
|
||||
func (m *FilePVLastSignState) String() string { return proto.CompactTextString(m) }
|
||||
func (*FilePVLastSignState) ProtoMessage() {}
|
||||
func (*FilePVLastSignState) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_a9d74c406df3ad93, []int{1}
|
||||
}
|
||||
func (m *FilePVLastSignState) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_FilePVLastSignState.Unmarshal(m, b)
|
||||
}
|
||||
func (m *FilePVLastSignState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_FilePVLastSignState.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *FilePVLastSignState) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_FilePVLastSignState.Merge(m, src)
|
||||
}
|
||||
func (m *FilePVLastSignState) XXX_Size() int {
|
||||
return xxx_messageInfo_FilePVLastSignState.Size(m)
|
||||
}
|
||||
func (m *FilePVLastSignState) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_FilePVLastSignState.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_FilePVLastSignState proto.InternalMessageInfo
|
||||
|
||||
func (m *FilePVLastSignState) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) GetRound() int64 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) GetStep() int32 {
|
||||
if m != nil {
|
||||
return m.Step
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) GetSignature() []byte {
|
||||
if m != nil {
|
||||
return m.Signature
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) GetSignBytes() []byte {
|
||||
if m != nil {
|
||||
return m.SignBytes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *FilePVLastSignState) GetFilePath() string {
|
||||
if m != nil {
|
||||
return m.FilePath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*FilePVKey)(nil), "tendermint.proto.privval.FilePVKey")
|
||||
proto.RegisterType((*FilePVLastSignState)(nil), "tendermint.proto.privval.FilePVLastSignState")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/privval/types.proto", fileDescriptor_a9d74c406df3ad93) }
|
||||
|
||||
var fileDescriptor_a9d74c406df3ad93 = []byte{
|
||||
// 357 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4d, 0x6e, 0xe2, 0x30,
|
||||
0x14, 0x9e, 0x0c, 0x10, 0x88, 0x87, 0x95, 0x67, 0x34, 0xca, 0x30, 0x45, 0x45, 0x2c, 0xda, 0xac,
|
||||
0x92, 0xaa, 0xbd, 0x01, 0x0b, 0xa4, 0x8a, 0x2e, 0x50, 0x90, 0xba, 0xe8, 0x26, 0x72, 0xc8, 0x6b,
|
||||
0x62, 0x11, 0x12, 0xcb, 0x7e, 0x41, 0xf2, 0xb1, 0x7a, 0x8b, 0x5e, 0xa0, 0xdb, 0x9e, 0xa5, 0xb2,
|
||||
0x43, 0x15, 0x50, 0x17, 0xdd, 0xbd, 0xef, 0xf3, 0xf3, 0xf7, 0x63, 0x99, 0xfc, 0x13, 0xb2, 0xc6,
|
||||
0x3a, 0x12, 0x92, 0x1f, 0x0e, 0xac, 0x8c, 0x50, 0x0b, 0x50, 0xa1, 0xe5, 0xa8, 0x8f, 0x50, 0x65,
|
||||
0x20, 0xf7, 0xbc, 0xc2, 0x96, 0x09, 0x8f, 0x5b, 0x93, 0x2b, 0x2c, 0xb8, 0xcc, 0x12, 0xc1, 0x24,
|
||||
0xea, 0xa8, 0x15, 0xc8, 0xeb, 0xbc, 0xee, 0xa6, 0x76, 0x7f, 0x32, 0x6d, 0x99, 0xad, 0xd4, 0x02,
|
||||
0xeb, 0x68, 0x07, 0x5a, 0x9d, 0x1a, 0xcc, 0xdf, 0x1c, 0xe2, 0x2d, 0x79, 0x09, 0xeb, 0xc7, 0x15,
|
||||
0x68, 0xea, 0x93, 0x21, 0xcb, 0x32, 0x09, 0x4a, 0xf9, 0xce, 0xcc, 0x09, 0xc6, 0xf1, 0x27, 0xa4,
|
||||
0x4b, 0x32, 0x14, 0x4d, 0x9a, 0xec, 0x40, 0xfb, 0x3f, 0x67, 0x4e, 0xf0, 0xeb, 0xf6, 0x3a, 0xfc,
|
||||
0x12, 0xad, 0xf5, 0x08, 0x8d, 0x47, 0xb8, 0x6e, 0xd2, 0x92, 0x6f, 0x57, 0xa0, 0x17, 0xfd, 0xd7,
|
||||
0xf7, 0xcb, 0x1f, 0xb1, 0x2b, 0x9a, 0xd4, 0x38, 0xdc, 0x93, 0x91, 0x69, 0x60, 0x85, 0x7a, 0x56,
|
||||
0x28, 0xf8, 0x46, 0x48, 0xf2, 0x03, 0x43, 0xe8, 0x94, 0x86, 0xe6, 0xbe, 0x91, 0xfa, 0x4f, 0xbc,
|
||||
0x67, 0x5e, 0x42, 0x22, 0x18, 0x16, 0x7e, 0x7f, 0xe6, 0x04, 0x5e, 0x3c, 0x32, 0xc4, 0x9a, 0x61,
|
||||
0x31, 0x7f, 0x71, 0xc8, 0xef, 0xb6, 0xd7, 0x03, 0x53, 0xb8, 0xe1, 0x79, 0xb5, 0x41, 0x86, 0x40,
|
||||
0xff, 0x12, 0xb7, 0x00, 0x9e, 0x17, 0x68, 0x0b, 0xf6, 0xe2, 0x23, 0xa2, 0x7f, 0xc8, 0x40, 0xd6,
|
||||
0x4d, 0x95, 0xd9, 0x76, 0xbd, 0xb8, 0x05, 0x94, 0x92, 0xbe, 0x42, 0x10, 0x36, 0xe9, 0x20, 0xb6,
|
||||
0x33, 0xbd, 0x20, 0x9e, 0xe2, 0x79, 0xc5, 0xb0, 0x91, 0x60, 0x6d, 0xc7, 0x71, 0x47, 0xd0, 0x29,
|
||||
0x21, 0x06, 0x24, 0xa9, 0x46, 0x50, 0xfe, 0xa0, 0x3b, 0x5e, 0x18, 0xe2, 0x3c, 0xb3, 0x7b, 0x9e,
|
||||
0x79, 0x71, 0xf3, 0x14, 0xe6, 0x1c, 0x8b, 0x26, 0x0d, 0xb7, 0xf5, 0x3e, 0xea, 0x5e, 0xe5, 0x74,
|
||||
0x3c, 0xfb, 0x2a, 0xa9, 0x6b, 0xe1, 0xdd, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xa3, 0x78,
|
||||
0xe9, 0x42, 0x02, 0x00, 0x00,
|
||||
}
|
||||
27
proto/privval/types.proto
Normal file
27
proto/privval/types.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.privval;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/privval";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/crypto/keys/types.proto";
|
||||
|
||||
// FilePVKey stores the immutable part of PrivValidator.
|
||||
message FilePVKey {
|
||||
bytes address = 1;
|
||||
tendermint.proto.crypto.keys.PublicKey pub_key = 2 [(gogoproto.nullable) = false];
|
||||
tendermint.proto.crypto.keys.PrivateKey priv_key = 3 [(gogoproto.nullable) = false];
|
||||
|
||||
string file_path = 4;
|
||||
}
|
||||
|
||||
// FilePVLastSignState stores the mutable part of PrivValidator.
|
||||
message FilePVLastSignState {
|
||||
int64 height = 1;
|
||||
int64 round = 2;
|
||||
int32 step = 3;
|
||||
bytes signature = 4;
|
||||
bytes sign_bytes = 5;
|
||||
|
||||
string file_path = 6;
|
||||
}
|
||||
431
proto/state/types.pb.go
Normal file
431
proto/state/types.pb.go
Normal file
@@ -0,0 +1,431 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/state/types.proto
|
||||
|
||||
package state
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
types "github.com/tendermint/tendermint/abci/types"
|
||||
types1 "github.com/tendermint/tendermint/proto/types"
|
||||
version "github.com/tendermint/tendermint/proto/version"
|
||||
math "math"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var _ = time.Kitchen
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// ABCIResponses retains the responses
|
||||
// of the various ABCI calls during block processing.
|
||||
// It is persisted to disk for each height before calling Commit.
|
||||
type ABCIResponses struct {
|
||||
DeliverTxs []*types.ResponseDeliverTx `protobuf:"bytes,1,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"`
|
||||
EndBlock *types.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"`
|
||||
BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,3,opt,name=begin_block,json=beginBlock,proto3" json:"begin_block,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ABCIResponses) Reset() { *m = ABCIResponses{} }
|
||||
func (m *ABCIResponses) String() string { return proto.CompactTextString(m) }
|
||||
func (*ABCIResponses) ProtoMessage() {}
|
||||
func (*ABCIResponses) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_00e69fef8162ea9b, []int{0}
|
||||
}
|
||||
func (m *ABCIResponses) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ABCIResponses.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ABCIResponses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ABCIResponses.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ABCIResponses) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ABCIResponses.Merge(m, src)
|
||||
}
|
||||
func (m *ABCIResponses) XXX_Size() int {
|
||||
return xxx_messageInfo_ABCIResponses.Size(m)
|
||||
}
|
||||
func (m *ABCIResponses) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ABCIResponses.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ABCIResponses proto.InternalMessageInfo
|
||||
|
||||
func (m *ABCIResponses) GetDeliverTxs() []*types.ResponseDeliverTx {
|
||||
if m != nil {
|
||||
return m.DeliverTxs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ABCIResponses) GetEndBlock() *types.ResponseEndBlock {
|
||||
if m != nil {
|
||||
return m.EndBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ABCIResponses) GetBeginBlock() *types.ResponseBeginBlock {
|
||||
if m != nil {
|
||||
return m.BeginBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidatorsInfo represents the latest validator set, or the last height it changed
|
||||
type ValidatorsInfo struct {
|
||||
ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"`
|
||||
LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ValidatorsInfo) Reset() { *m = ValidatorsInfo{} }
|
||||
func (m *ValidatorsInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*ValidatorsInfo) ProtoMessage() {}
|
||||
func (*ValidatorsInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_00e69fef8162ea9b, []int{1}
|
||||
}
|
||||
func (m *ValidatorsInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ValidatorsInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ValidatorsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ValidatorsInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ValidatorsInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ValidatorsInfo.Merge(m, src)
|
||||
}
|
||||
func (m *ValidatorsInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_ValidatorsInfo.Size(m)
|
||||
}
|
||||
func (m *ValidatorsInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ValidatorsInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ValidatorsInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *ValidatorsInfo) GetValidatorSet() *types1.ValidatorSet {
|
||||
if m != nil {
|
||||
return m.ValidatorSet
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ValidatorsInfo) GetLastHeightChanged() int64 {
|
||||
if m != nil {
|
||||
return m.LastHeightChanged
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
|
||||
type ConsensusParamsInfo struct {
|
||||
ConsensusParams types1.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"`
|
||||
LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ConsensusParamsInfo) Reset() { *m = ConsensusParamsInfo{} }
|
||||
func (m *ConsensusParamsInfo) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConsensusParamsInfo) ProtoMessage() {}
|
||||
func (*ConsensusParamsInfo) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_00e69fef8162ea9b, []int{2}
|
||||
}
|
||||
func (m *ConsensusParamsInfo) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ConsensusParamsInfo.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ConsensusParamsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ConsensusParamsInfo.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ConsensusParamsInfo) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ConsensusParamsInfo.Merge(m, src)
|
||||
}
|
||||
func (m *ConsensusParamsInfo) XXX_Size() int {
|
||||
return xxx_messageInfo_ConsensusParamsInfo.Size(m)
|
||||
}
|
||||
func (m *ConsensusParamsInfo) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ConsensusParamsInfo.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ConsensusParamsInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *ConsensusParamsInfo) GetConsensusParams() types1.ConsensusParams {
|
||||
if m != nil {
|
||||
return m.ConsensusParams
|
||||
}
|
||||
return types1.ConsensusParams{}
|
||||
}
|
||||
|
||||
func (m *ConsensusParamsInfo) GetLastHeightChanged() int64 {
|
||||
if m != nil {
|
||||
return m.LastHeightChanged
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Version struct {
|
||||
Consensus version.Consensus `protobuf:"bytes,1,opt,name=consensus,proto3" json:"consensus"`
|
||||
Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Version) Reset() { *m = Version{} }
|
||||
func (m *Version) String() string { return proto.CompactTextString(m) }
|
||||
func (*Version) ProtoMessage() {}
|
||||
func (*Version) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_00e69fef8162ea9b, []int{3}
|
||||
}
|
||||
func (m *Version) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Version.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Version.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Version) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Version.Merge(m, src)
|
||||
}
|
||||
func (m *Version) XXX_Size() int {
|
||||
return xxx_messageInfo_Version.Size(m)
|
||||
}
|
||||
func (m *Version) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Version.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Version proto.InternalMessageInfo
|
||||
|
||||
func (m *Version) GetConsensus() version.Consensus {
|
||||
if m != nil {
|
||||
return m.Consensus
|
||||
}
|
||||
return version.Consensus{}
|
||||
}
|
||||
|
||||
func (m *Version) GetSoftware() string {
|
||||
if m != nil {
|
||||
return m.Software
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type State struct {
|
||||
Version Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"`
|
||||
// immutable
|
||||
ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
|
||||
// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
|
||||
LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"`
|
||||
LastBlockID types1.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"`
|
||||
LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"`
|
||||
// LastValidators is used to validate block.LastCommit.
|
||||
// Validators are persisted to the database separately every time they change,
|
||||
// so we can query for historical validator sets.
|
||||
// Note that if s.LastBlockHeight causes a valset change,
|
||||
// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
|
||||
// Extra +1 due to nextValSet delay.
|
||||
NextValidators *types1.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"`
|
||||
Validators *types1.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"`
|
||||
LastValidators *types1.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"`
|
||||
LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"`
|
||||
// Consensus parameters used for validating blocks.
|
||||
// Changes returned by EndBlock and updated after Commit.
|
||||
ConsensusParams types1.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"`
|
||||
LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"`
|
||||
// Merkle root of the results from executing prev block
|
||||
LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"`
|
||||
// the latest AppHash we've received from calling abci.Commit()
|
||||
AppHash []byte `protobuf:"bytes,13,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *State) Reset() { *m = State{} }
|
||||
func (m *State) String() string { return proto.CompactTextString(m) }
|
||||
func (*State) ProtoMessage() {}
|
||||
func (*State) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_00e69fef8162ea9b, []int{4}
|
||||
}
|
||||
func (m *State) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_State.Unmarshal(m, b)
|
||||
}
|
||||
func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_State.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *State) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_State.Merge(m, src)
|
||||
}
|
||||
func (m *State) XXX_Size() int {
|
||||
return xxx_messageInfo_State.Size(m)
|
||||
}
|
||||
func (m *State) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_State.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_State proto.InternalMessageInfo
|
||||
|
||||
func (m *State) GetVersion() Version {
|
||||
if m != nil {
|
||||
return m.Version
|
||||
}
|
||||
return Version{}
|
||||
}
|
||||
|
||||
func (m *State) GetChainID() string {
|
||||
if m != nil {
|
||||
return m.ChainID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *State) GetLastBlockHeight() int64 {
|
||||
if m != nil {
|
||||
return m.LastBlockHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *State) GetLastBlockID() types1.BlockID {
|
||||
if m != nil {
|
||||
return m.LastBlockID
|
||||
}
|
||||
return types1.BlockID{}
|
||||
}
|
||||
|
||||
func (m *State) GetLastBlockTime() time.Time {
|
||||
if m != nil {
|
||||
return m.LastBlockTime
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *State) GetNextValidators() *types1.ValidatorSet {
|
||||
if m != nil {
|
||||
return m.NextValidators
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *State) GetValidators() *types1.ValidatorSet {
|
||||
if m != nil {
|
||||
return m.Validators
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *State) GetLastValidators() *types1.ValidatorSet {
|
||||
if m != nil {
|
||||
return m.LastValidators
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *State) GetLastHeightValidatorsChanged() int64 {
|
||||
if m != nil {
|
||||
return m.LastHeightValidatorsChanged
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *State) GetConsensusParams() types1.ConsensusParams {
|
||||
if m != nil {
|
||||
return m.ConsensusParams
|
||||
}
|
||||
return types1.ConsensusParams{}
|
||||
}
|
||||
|
||||
func (m *State) GetLastHeightConsensusParamsChanged() int64 {
|
||||
if m != nil {
|
||||
return m.LastHeightConsensusParamsChanged
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *State) GetLastResultsHash() []byte {
|
||||
if m != nil {
|
||||
return m.LastResultsHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *State) GetAppHash() []byte {
|
||||
if m != nil {
|
||||
return m.AppHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ABCIResponses)(nil), "tendermint.proto.state.ABCIResponses")
|
||||
proto.RegisterType((*ValidatorsInfo)(nil), "tendermint.proto.state.ValidatorsInfo")
|
||||
proto.RegisterType((*ConsensusParamsInfo)(nil), "tendermint.proto.state.ConsensusParamsInfo")
|
||||
proto.RegisterType((*Version)(nil), "tendermint.proto.state.Version")
|
||||
proto.RegisterType((*State)(nil), "tendermint.proto.state.State")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/state/types.proto", fileDescriptor_00e69fef8162ea9b) }
|
||||
|
||||
var fileDescriptor_00e69fef8162ea9b = []byte{
|
||||
// 729 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5d, 0x6a, 0xdb, 0x4a,
|
||||
0x18, 0xbd, 0xba, 0x4e, 0x62, 0xfb, 0x53, 0x1c, 0xdf, 0x3b, 0x81, 0x5c, 0x5d, 0x07, 0x6a, 0xe3,
|
||||
0x86, 0xc4, 0x2d, 0x45, 0x86, 0x74, 0x01, 0xa5, 0xb2, 0x4b, 0xa3, 0x92, 0x96, 0xa2, 0x84, 0x10,
|
||||
0xfa, 0x22, 0xc6, 0xd6, 0x44, 0x12, 0xb5, 0x25, 0xa1, 0x19, 0xbb, 0xc9, 0x1a, 0xfa, 0xd2, 0x1d,
|
||||
0x74, 0x3b, 0x5d, 0x85, 0x0b, 0x79, 0xee, 0x22, 0xca, 0xfc, 0x48, 0x9e, 0xfc, 0x11, 0x0c, 0x7d,
|
||||
0xf2, 0x68, 0xce, 0x77, 0xce, 0x77, 0x66, 0xe6, 0x7c, 0x18, 0xfe, 0xcb, 0xf2, 0x94, 0xa5, 0x7d,
|
||||
0xca, 0x30, 0x23, 0x7d, 0x76, 0x95, 0x11, 0x6a, 0x8b, 0x1d, 0xb4, 0xc3, 0x48, 0x12, 0x90, 0x7c,
|
||||
0x1a, 0x27, 0x4c, 0xee, 0xd8, 0xa2, 0xa6, 0xb5, 0xcf, 0xa2, 0x38, 0x0f, 0xfc, 0x0c, 0xe7, 0xec,
|
||||
0xaa, 0x2f, 0xc9, 0x61, 0x1a, 0xa6, 0xcb, 0x95, 0xac, 0x6e, 0xed, 0xe0, 0xd1, 0x38, 0x96, 0x8a,
|
||||
0xba, 0x6e, 0x4b, 0x35, 0xbc, 0x0b, 0xec, 0xea, 0xc0, 0x1c, 0x4f, 0xe2, 0x00, 0xb3, 0x34, 0x57,
|
||||
0xa0, 0xa5, 0x83, 0x19, 0xce, 0xf1, 0xf4, 0x16, 0x6d, 0x4e, 0x72, 0x1a, 0xa7, 0x49, 0xf1, 0xab,
|
||||
0xc0, 0x76, 0x98, 0xa6, 0xe1, 0x84, 0x48, 0x9f, 0xa3, 0xd9, 0x45, 0x9f, 0xc5, 0x53, 0x42, 0x19,
|
||||
0x9e, 0x66, 0xb2, 0xa0, 0xfb, 0xcb, 0x80, 0xc6, 0x6b, 0x67, 0xe0, 0x7a, 0x84, 0x66, 0x69, 0x42,
|
||||
0x09, 0x45, 0x2e, 0x98, 0x01, 0x99, 0xc4, 0x73, 0x92, 0xfb, 0xec, 0x92, 0x5a, 0x46, 0xa7, 0xd2,
|
||||
0x33, 0x0f, 0x7b, 0xb6, 0x76, 0x1b, 0xfc, 0x60, 0xb6, 0x74, 0x5e, 0xd0, 0x86, 0x92, 0x71, 0x7a,
|
||||
0xe9, 0x41, 0x50, 0x2c, 0x29, 0x1a, 0x42, 0x9d, 0x24, 0x81, 0x3f, 0x9a, 0xa4, 0xe3, 0xcf, 0xd6,
|
||||
0xdf, 0x1d, 0xa3, 0x67, 0x1e, 0x1e, 0x3c, 0x22, 0xf4, 0x26, 0x09, 0x1c, 0x5e, 0xee, 0xd5, 0x88,
|
||||
0x5a, 0xa1, 0x77, 0x60, 0x8e, 0x48, 0x18, 0x27, 0x4a, 0xa7, 0x22, 0x74, 0x9e, 0x3d, 0xa2, 0xe3,
|
||||
0x70, 0x86, 0x54, 0x82, 0x51, 0xb9, 0xee, 0x7e, 0x35, 0x60, 0xeb, 0xac, 0xb8, 0x5a, 0xea, 0x26,
|
||||
0x17, 0x29, 0x72, 0xa1, 0x51, 0x5e, 0xb6, 0x4f, 0x09, 0xb3, 0x0c, 0xd1, 0x60, 0xcf, 0xbe, 0xf3,
|
||||
0xfe, 0xb2, 0x43, 0x49, 0x3f, 0x21, 0xcc, 0xdb, 0x9c, 0x6b, 0x5f, 0xc8, 0x86, 0xed, 0x09, 0xa6,
|
||||
0xcc, 0x8f, 0x48, 0x1c, 0x46, 0xcc, 0x1f, 0x47, 0x38, 0x09, 0x49, 0x20, 0x4e, 0x5e, 0xf1, 0xfe,
|
||||
0xe5, 0xd0, 0x91, 0x40, 0x06, 0x12, 0xe8, 0x7e, 0x37, 0x60, 0x7b, 0xc0, 0xdd, 0x26, 0x74, 0x46,
|
||||
0x3f, 0x8a, 0x47, 0x15, 0x96, 0xce, 0xe1, 0x9f, 0x71, 0xb1, 0xed, 0xcb, 0xc7, 0x56, 0xae, 0x0e,
|
||||
0x1e, 0x72, 0x75, 0x4b, 0xc6, 0x59, 0xfb, 0xb1, 0x68, 0xff, 0xe5, 0x35, 0xc7, 0x37, 0xb7, 0x57,
|
||||
0x76, 0x98, 0x40, 0xf5, 0x4c, 0x06, 0x0a, 0xbd, 0x85, 0x7a, 0xa9, 0xa6, 0xdc, 0x3c, 0xbd, 0xeb,
|
||||
0xa6, 0x88, 0x5f, 0xe9, 0x47, 0x39, 0x59, 0x72, 0x51, 0x0b, 0x6a, 0x34, 0xbd, 0x60, 0x5f, 0x70,
|
||||
0x4e, 0x44, 0xe3, 0xba, 0x57, 0x7e, 0x77, 0x17, 0x1b, 0xb0, 0x7e, 0xc2, 0xc7, 0x0c, 0xbd, 0x82,
|
||||
0xaa, 0xd2, 0x52, 0xcd, 0xda, 0xf6, 0xfd, 0x03, 0x69, 0x2b, 0x83, 0xaa, 0x51, 0xc1, 0x42, 0xfb,
|
||||
0x50, 0x1b, 0x47, 0x38, 0x4e, 0xfc, 0x58, 0x9e, 0xaf, 0xee, 0x98, 0xd7, 0x8b, 0x76, 0x75, 0xc0,
|
||||
0xf7, 0xdc, 0xa1, 0x57, 0x15, 0xa0, 0x1b, 0xa0, 0xe7, 0x20, 0xce, 0x2d, 0xd3, 0xa5, 0x2e, 0x46,
|
||||
0x84, 0xac, 0xe2, 0x35, 0x39, 0x20, 0x82, 0x23, 0x6f, 0x05, 0x9d, 0x43, 0x43, 0xab, 0x8d, 0x03,
|
||||
0x6b, 0xed, 0x21, 0x6b, 0xf2, 0x55, 0x04, 0xd7, 0x1d, 0x3a, 0xdb, 0xdc, 0xda, 0xf5, 0xa2, 0x6d,
|
||||
0x1e, 0x17, 0x82, 0xee, 0xd0, 0x33, 0x4b, 0x75, 0x37, 0x40, 0xc7, 0xd0, 0xd4, 0x94, 0xf9, 0x94,
|
||||
0x5a, 0xeb, 0x42, 0xbb, 0x65, 0xcb, 0x11, 0xb6, 0x8b, 0x11, 0xb6, 0x4f, 0x8b, 0x11, 0x76, 0x6a,
|
||||
0x5c, 0xf6, 0xdb, 0xcf, 0xb6, 0xe1, 0x35, 0x4a, 0x2d, 0x8e, 0xa2, 0xf7, 0xd0, 0x4c, 0xc8, 0x25,
|
||||
0xf3, 0xcb, 0x74, 0x52, 0x6b, 0x63, 0x85, 0x54, 0x6f, 0x71, 0xf2, 0x72, 0x4c, 0xd0, 0x10, 0x40,
|
||||
0x53, 0xaa, 0xae, 0xa0, 0xa4, 0xf1, 0xb8, 0x29, 0x71, 0x44, 0x4d, 0xaa, 0xb6, 0x8a, 0x29, 0x4e,
|
||||
0xd6, 0x4c, 0x0d, 0xe0, 0x89, 0x1e, 0xe5, 0xa5, 0x6a, 0x99, 0xea, 0xba, 0x78, 0xc4, 0xdd, 0x65,
|
||||
0xaa, 0x97, 0x6c, 0x95, 0xef, 0x7b, 0x27, 0x0d, 0xfe, 0xc8, 0xa4, 0x7d, 0x80, 0xbd, 0x1b, 0x93,
|
||||
0x76, 0xab, 0x4b, 0x69, 0xd2, 0x14, 0x26, 0x3b, 0xda, 0xe8, 0xdd, 0x14, 0x2a, 0x9c, 0x16, 0x31,
|
||||
0xcd, 0x09, 0x9d, 0x4d, 0x18, 0xf5, 0x23, 0x4c, 0x23, 0x6b, 0xb3, 0x63, 0xf4, 0x36, 0x65, 0x4c,
|
||||
0x3d, 0xb9, 0x7f, 0x84, 0x69, 0x84, 0xfe, 0x87, 0x1a, 0xce, 0x32, 0x59, 0xd2, 0x10, 0x25, 0x55,
|
||||
0x9c, 0x65, 0x1c, 0x72, 0xec, 0x4f, 0x2f, 0xc2, 0x98, 0x45, 0xb3, 0x91, 0x3d, 0x4e, 0xa7, 0xfd,
|
||||
0xe5, 0x11, 0xf5, 0xa5, 0xf6, 0x8f, 0x38, 0xda, 0x10, 0x1f, 0x2f, 0x7f, 0x07, 0x00, 0x00, 0xff,
|
||||
0xff, 0x93, 0x33, 0x0f, 0xa0, 0x27, 0x07, 0x00, 0x00,
|
||||
}
|
||||
74
proto/state/types.proto
Normal file
74
proto/state/types.proto
Normal file
@@ -0,0 +1,74 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.state;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/state";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "abci/types/types.proto";
|
||||
import "proto/types/types.proto";
|
||||
import "proto/types/validator.proto";
|
||||
import "proto/types/params.proto";
|
||||
import "proto/version/version.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
// ABCIResponses retains the responses
|
||||
// of the various ABCI calls during block processing.
|
||||
// It is persisted to disk for each height before calling Commit.
|
||||
message ABCIResponses {
|
||||
repeated tendermint.abci.types.ResponseDeliverTx deliver_txs = 1;
|
||||
tendermint.abci.types.ResponseEndBlock end_block = 2;
|
||||
tendermint.abci.types.ResponseBeginBlock begin_block = 3;
|
||||
}
|
||||
|
||||
// ValidatorsInfo represents the latest validator set, or the last height it changed
|
||||
message ValidatorsInfo {
|
||||
tendermint.proto.types.ValidatorSet validator_set = 1;
|
||||
int64 last_height_changed = 2;
|
||||
}
|
||||
|
||||
// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
|
||||
message ConsensusParamsInfo {
|
||||
tendermint.proto.types.ConsensusParams consensus_params = 1 [(gogoproto.nullable) = false];
|
||||
int64 last_height_changed = 2;
|
||||
}
|
||||
|
||||
message Version {
|
||||
tendermint.proto.version.Consensus consensus = 1 [(gogoproto.nullable) = false];
|
||||
string software = 2;
|
||||
}
|
||||
|
||||
message State {
|
||||
Version version = 1 [(gogoproto.nullable) = false];
|
||||
|
||||
// immutable
|
||||
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
|
||||
|
||||
// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
|
||||
int64 last_block_height = 3;
|
||||
tendermint.proto.types.BlockID last_block_id = 4
|
||||
[(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"];
|
||||
google.protobuf.Timestamp last_block_time = 5
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
|
||||
// LastValidators is used to validate block.LastCommit.
|
||||
// Validators are persisted to the database separately every time they change,
|
||||
// so we can query for historical validator sets.
|
||||
// Note that if s.LastBlockHeight causes a valset change,
|
||||
// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
|
||||
// Extra +1 due to nextValSet delay.
|
||||
tendermint.proto.types.ValidatorSet next_validators = 6;
|
||||
tendermint.proto.types.ValidatorSet validators = 7;
|
||||
tendermint.proto.types.ValidatorSet last_validators = 8;
|
||||
int64 last_height_validators_changed = 9;
|
||||
|
||||
// Consensus parameters used for validating blocks.
|
||||
// Changes returned by EndBlock and updated after Commit.
|
||||
tendermint.proto.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false];
|
||||
int64 last_height_consensus_params_changed = 11;
|
||||
|
||||
// Merkle root of the results from executing prev block
|
||||
bytes last_results_hash = 12;
|
||||
|
||||
// the latest AppHash we've received from calling abci.Commit()
|
||||
bytes app_hash = 13;
|
||||
}
|
||||
385
proto/statesync/types.pb.go
Normal file
385
proto/statesync/types.pb.go
Normal file
@@ -0,0 +1,385 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/statesync/types.proto
|
||||
|
||||
package statesync
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type Message struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Message_SnapshotsRequest
|
||||
// *Message_SnapshotsResponse
|
||||
// *Message_ChunkRequest
|
||||
// *Message_ChunkResponse
|
||||
Sum isMessage_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Message) Reset() { *m = Message{} }
|
||||
func (m *Message) String() string { return proto.CompactTextString(m) }
|
||||
func (*Message) ProtoMessage() {}
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bef273312884335b, []int{0}
|
||||
}
|
||||
func (m *Message) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Message.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Message) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Message.Merge(m, src)
|
||||
}
|
||||
func (m *Message) XXX_Size() int {
|
||||
return xxx_messageInfo_Message.Size(m)
|
||||
}
|
||||
func (m *Message) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Message.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Message proto.InternalMessageInfo
|
||||
|
||||
type isMessage_Sum interface {
|
||||
isMessage_Sum()
|
||||
}
|
||||
|
||||
type Message_SnapshotsRequest struct {
|
||||
SnapshotsRequest *SnapshotsRequest `protobuf:"bytes,1,opt,name=snapshots_request,json=snapshotsRequest,proto3,oneof" json:"snapshots_request,omitempty"`
|
||||
}
|
||||
type Message_SnapshotsResponse struct {
|
||||
SnapshotsResponse *SnapshotsResponse `protobuf:"bytes,2,opt,name=snapshots_response,json=snapshotsResponse,proto3,oneof" json:"snapshots_response,omitempty"`
|
||||
}
|
||||
type Message_ChunkRequest struct {
|
||||
ChunkRequest *ChunkRequest `protobuf:"bytes,3,opt,name=chunk_request,json=chunkRequest,proto3,oneof" json:"chunk_request,omitempty"`
|
||||
}
|
||||
type Message_ChunkResponse struct {
|
||||
ChunkResponse *ChunkResponse `protobuf:"bytes,4,opt,name=chunk_response,json=chunkResponse,proto3,oneof" json:"chunk_response,omitempty"`
|
||||
}
|
||||
|
||||
func (*Message_SnapshotsRequest) isMessage_Sum() {}
|
||||
func (*Message_SnapshotsResponse) isMessage_Sum() {}
|
||||
func (*Message_ChunkRequest) isMessage_Sum() {}
|
||||
func (*Message_ChunkResponse) isMessage_Sum() {}
|
||||
|
||||
func (m *Message) GetSum() isMessage_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetSnapshotsRequest() *SnapshotsRequest {
|
||||
if x, ok := m.GetSum().(*Message_SnapshotsRequest); ok {
|
||||
return x.SnapshotsRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetSnapshotsResponse() *SnapshotsResponse {
|
||||
if x, ok := m.GetSum().(*Message_SnapshotsResponse); ok {
|
||||
return x.SnapshotsResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetChunkRequest() *ChunkRequest {
|
||||
if x, ok := m.GetSum().(*Message_ChunkRequest); ok {
|
||||
return x.ChunkRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Message) GetChunkResponse() *ChunkResponse {
|
||||
if x, ok := m.GetSum().(*Message_ChunkResponse); ok {
|
||||
return x.ChunkResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Message) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Message_SnapshotsRequest)(nil),
|
||||
(*Message_SnapshotsResponse)(nil),
|
||||
(*Message_ChunkRequest)(nil),
|
||||
(*Message_ChunkResponse)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
type SnapshotsRequest struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SnapshotsRequest) Reset() { *m = SnapshotsRequest{} }
|
||||
func (m *SnapshotsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SnapshotsRequest) ProtoMessage() {}
|
||||
func (*SnapshotsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bef273312884335b, []int{1}
|
||||
}
|
||||
func (m *SnapshotsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SnapshotsRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SnapshotsRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SnapshotsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SnapshotsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *SnapshotsRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_SnapshotsRequest.Size(m)
|
||||
}
|
||||
func (m *SnapshotsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SnapshotsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SnapshotsRequest proto.InternalMessageInfo
|
||||
|
||||
type SnapshotsResponse struct {
|
||||
Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"`
|
||||
Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"`
|
||||
Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SnapshotsResponse) Reset() { *m = SnapshotsResponse{} }
|
||||
func (m *SnapshotsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SnapshotsResponse) ProtoMessage() {}
|
||||
func (*SnapshotsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bef273312884335b, []int{2}
|
||||
}
|
||||
func (m *SnapshotsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SnapshotsResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SnapshotsResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SnapshotsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SnapshotsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *SnapshotsResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_SnapshotsResponse.Size(m)
|
||||
}
|
||||
func (m *SnapshotsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SnapshotsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SnapshotsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *SnapshotsResponse) GetHeight() uint64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SnapshotsResponse) GetFormat() uint32 {
|
||||
if m != nil {
|
||||
return m.Format
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SnapshotsResponse) GetChunks() uint32 {
|
||||
if m != nil {
|
||||
return m.Chunks
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SnapshotsResponse) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SnapshotsResponse) GetMetadata() []byte {
|
||||
if m != nil {
|
||||
return m.Metadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ChunkRequest struct {
|
||||
Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"`
|
||||
Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ChunkRequest) Reset() { *m = ChunkRequest{} }
|
||||
func (m *ChunkRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ChunkRequest) ProtoMessage() {}
|
||||
func (*ChunkRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bef273312884335b, []int{3}
|
||||
}
|
||||
func (m *ChunkRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ChunkRequest.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ChunkRequest.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ChunkRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ChunkRequest.Merge(m, src)
|
||||
}
|
||||
func (m *ChunkRequest) XXX_Size() int {
|
||||
return xxx_messageInfo_ChunkRequest.Size(m)
|
||||
}
|
||||
func (m *ChunkRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ChunkRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ChunkRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *ChunkRequest) GetHeight() uint64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ChunkRequest) GetFormat() uint32 {
|
||||
if m != nil {
|
||||
return m.Format
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ChunkRequest) GetIndex() uint32 {
|
||||
if m != nil {
|
||||
return m.Index
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ChunkResponse struct {
|
||||
Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"`
|
||||
Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
|
||||
Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"`
|
||||
Missing bool `protobuf:"varint,5,opt,name=missing,proto3" json:"missing,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ChunkResponse) Reset() { *m = ChunkResponse{} }
|
||||
func (m *ChunkResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ChunkResponse) ProtoMessage() {}
|
||||
func (*ChunkResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_bef273312884335b, []int{4}
|
||||
}
|
||||
func (m *ChunkResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ChunkResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ChunkResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ChunkResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ChunkResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ChunkResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ChunkResponse.Size(m)
|
||||
}
|
||||
func (m *ChunkResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ChunkResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ChunkResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *ChunkResponse) GetHeight() uint64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ChunkResponse) GetFormat() uint32 {
|
||||
if m != nil {
|
||||
return m.Format
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ChunkResponse) GetIndex() uint32 {
|
||||
if m != nil {
|
||||
return m.Index
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ChunkResponse) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ChunkResponse) GetMissing() bool {
|
||||
if m != nil {
|
||||
return m.Missing
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Message)(nil), "tendermint.proto.statesync.Message")
|
||||
proto.RegisterType((*SnapshotsRequest)(nil), "tendermint.proto.statesync.SnapshotsRequest")
|
||||
proto.RegisterType((*SnapshotsResponse)(nil), "tendermint.proto.statesync.SnapshotsResponse")
|
||||
proto.RegisterType((*ChunkRequest)(nil), "tendermint.proto.statesync.ChunkRequest")
|
||||
proto.RegisterType((*ChunkResponse)(nil), "tendermint.proto.statesync.ChunkResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/statesync/types.proto", fileDescriptor_bef273312884335b) }
|
||||
|
||||
var fileDescriptor_bef273312884335b = []byte{
|
||||
// 357 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcd, 0x4a, 0xc3, 0x40,
|
||||
0x14, 0x85, 0x9b, 0xfe, 0x73, 0x6d, 0xa4, 0x1d, 0x44, 0x42, 0xdd, 0x48, 0x56, 0x15, 0x34, 0x95,
|
||||
0xfa, 0x06, 0x75, 0xd3, 0x8d, 0x08, 0xa3, 0x2b, 0x05, 0x65, 0x9a, 0x8e, 0x49, 0x90, 0x4c, 0x62,
|
||||
0xee, 0x04, 0xec, 0x03, 0xb8, 0xf2, 0x6d, 0x7d, 0x02, 0xc9, 0x4d, 0x9a, 0xc6, 0x88, 0x52, 0xc1,
|
||||
0xdd, 0x9c, 0x43, 0xee, 0x97, 0x73, 0xee, 0x30, 0x70, 0x14, 0x27, 0x91, 0x8e, 0xa6, 0xa8, 0x85,
|
||||
0x96, 0xb8, 0x56, 0xee, 0x54, 0xaf, 0x63, 0x89, 0x0e, 0xb9, 0x6c, 0xac, 0xa5, 0x5a, 0xc9, 0x24,
|
||||
0x0c, 0x94, 0xce, 0x1d, 0xa7, 0xfc, 0xce, 0xfe, 0x68, 0x42, 0xef, 0x4a, 0x22, 0x0a, 0x4f, 0xb2,
|
||||
0x7b, 0x18, 0xa1, 0x12, 0x31, 0xfa, 0x91, 0xc6, 0xc7, 0x44, 0xbe, 0xa4, 0x12, 0xb5, 0x65, 0x1c,
|
||||
0x1b, 0x93, 0xbd, 0xd9, 0xa9, 0xf3, 0x33, 0xc3, 0xb9, 0xd9, 0x0c, 0xf1, 0x7c, 0x66, 0xd1, 0xe0,
|
||||
0x43, 0xac, 0x79, 0xec, 0x01, 0x58, 0x15, 0x8e, 0x71, 0xa4, 0x50, 0x5a, 0x4d, 0xa2, 0x9f, 0xed,
|
||||
0x48, 0xcf, 0x87, 0x16, 0x0d, 0x3e, 0xc2, 0xba, 0xc9, 0xae, 0xc1, 0x74, 0xfd, 0x54, 0x3d, 0x97,
|
||||
0xc1, 0x5b, 0x84, 0x9e, 0xfc, 0x86, 0xbe, 0xcc, 0x06, 0xb6, 0xa1, 0x07, 0x6e, 0x45, 0x33, 0x0e,
|
||||
0xfb, 0x1b, 0x60, 0x11, 0xb6, 0x4d, 0xc4, 0x93, 0x1d, 0x88, 0x65, 0x50, 0xd3, 0xad, 0x1a, 0xf3,
|
||||
0x0e, 0xb4, 0x30, 0x0d, 0x6d, 0x06, 0xc3, 0xfa, 0xce, 0xec, 0x77, 0x03, 0x46, 0xdf, 0xaa, 0xb2,
|
||||
0x43, 0xe8, 0xfa, 0x32, 0xf0, 0xfc, 0xfc, 0x1e, 0xda, 0xbc, 0x50, 0x99, 0xff, 0x14, 0x25, 0xa1,
|
||||
0xd0, 0xb4, 0x41, 0x93, 0x17, 0x2a, 0xf3, 0xe9, 0x8f, 0x48, 0xf5, 0x4d, 0x5e, 0x28, 0xc6, 0xa0,
|
||||
0xed, 0x0b, 0xf4, 0xa9, 0xc2, 0x80, 0xd3, 0x99, 0x8d, 0xa1, 0x1f, 0x4a, 0x2d, 0x56, 0x42, 0x0b,
|
||||
0xab, 0x43, 0x7e, 0xa9, 0xed, 0x5b, 0x18, 0x54, 0x97, 0xf3, 0xe7, 0x1c, 0x07, 0xd0, 0x09, 0xd4,
|
||||
0x4a, 0xbe, 0x16, 0x31, 0x72, 0x61, 0xbf, 0x19, 0x60, 0x7e, 0xd9, 0xd0, 0xff, 0x70, 0x33, 0x97,
|
||||
0x7a, 0x16, 0xf5, 0x72, 0xc1, 0x2c, 0xe8, 0x85, 0x01, 0x62, 0xa0, 0x3c, 0xaa, 0xd7, 0xe7, 0x1b,
|
||||
0x39, 0x9f, 0xdd, 0x9d, 0x7b, 0x81, 0xf6, 0xd3, 0xa5, 0xe3, 0x46, 0xe1, 0x74, 0x7b, 0x9d, 0xd5,
|
||||
0x63, 0xed, 0x41, 0x2d, 0xbb, 0x64, 0x5c, 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, 0x79, 0xd0, 0x53,
|
||||
0x2f, 0x6a, 0x03, 0x00, 0x00,
|
||||
}
|
||||
37
proto/statesync/types.proto
Normal file
37
proto/statesync/types.proto
Normal file
@@ -0,0 +1,37 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.statesync;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/statesync";
|
||||
|
||||
message Message {
|
||||
oneof sum {
|
||||
SnapshotsRequest snapshots_request = 1;
|
||||
SnapshotsResponse snapshots_response = 2;
|
||||
ChunkRequest chunk_request = 3;
|
||||
ChunkResponse chunk_response = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message SnapshotsRequest {}
|
||||
|
||||
message SnapshotsResponse {
|
||||
uint64 height = 1;
|
||||
uint32 format = 2;
|
||||
uint32 chunks = 3;
|
||||
bytes hash = 4;
|
||||
bytes metadata = 5;
|
||||
}
|
||||
|
||||
message ChunkRequest {
|
||||
uint64 height = 1;
|
||||
uint32 format = 2;
|
||||
uint32 index = 3;
|
||||
}
|
||||
|
||||
message ChunkResponse {
|
||||
uint64 height = 1;
|
||||
uint32 format = 2;
|
||||
uint32 index = 3;
|
||||
bytes chunk = 4;
|
||||
bool missing = 5;
|
||||
}
|
||||
86
proto/store/types.pb.go
Normal file
86
proto/store/types.pb.go
Normal file
@@ -0,0 +1,86 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/store/types.proto
|
||||
|
||||
package store
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type BlockStoreState struct {
|
||||
Base int64 `protobuf:"varint,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockStoreState) Reset() { *m = BlockStoreState{} }
|
||||
func (m *BlockStoreState) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockStoreState) ProtoMessage() {}
|
||||
func (*BlockStoreState) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_45a8553e38baf31c, []int{0}
|
||||
}
|
||||
func (m *BlockStoreState) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockStoreState.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockStoreState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockStoreState.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockStoreState) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockStoreState.Merge(m, src)
|
||||
}
|
||||
func (m *BlockStoreState) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockStoreState.Size(m)
|
||||
}
|
||||
func (m *BlockStoreState) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockStoreState.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockStoreState proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockStoreState) GetBase() int64 {
|
||||
if m != nil {
|
||||
return m.Base
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockStoreState) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*BlockStoreState)(nil), "tendermint.proto.store.BlockStoreState")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/store/types.proto", fileDescriptor_45a8553e38baf31c) }
|
||||
|
||||
var fileDescriptor_45a8553e38baf31c = []byte{
|
||||
// 138 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x03, 0x8b,
|
||||
0x08, 0x89, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4, 0xc0,
|
||||
0x6a, 0x94, 0x6c, 0xb9, 0xf8, 0x9d, 0x72, 0xf2, 0x93, 0xb3, 0x83, 0x41, 0xbc, 0xe0, 0x92, 0xc4,
|
||||
0x92, 0x54, 0x21, 0x21, 0x2e, 0x96, 0xa4, 0xc4, 0xe2, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xe6,
|
||||
0x20, 0x30, 0x5b, 0x48, 0x8c, 0x8b, 0x2d, 0x23, 0x35, 0x33, 0x3d, 0xa3, 0x44, 0x82, 0x09, 0x2c,
|
||||
0x0a, 0xe5, 0x39, 0xe9, 0x45, 0xe9, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7,
|
||||
0xea, 0x23, 0xec, 0x40, 0x66, 0x22, 0x39, 0x29, 0x89, 0x0d, 0xcc, 0x31, 0x06, 0x04, 0x00, 0x00,
|
||||
0xff, 0xff, 0xb2, 0x6b, 0x69, 0x83, 0xa8, 0x00, 0x00, 0x00,
|
||||
}
|
||||
9
proto/store/types.proto
Normal file
9
proto/store/types.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.store;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/store";
|
||||
|
||||
message BlockStoreState {
|
||||
int64 base = 1;
|
||||
int64 height = 2;
|
||||
}
|
||||
110
proto/types/block.pb.go
Normal file
110
proto/types/block.pb.go
Normal file
@@ -0,0 +1,110 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/block.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type Block struct {
|
||||
Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
|
||||
Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
|
||||
Evidence EvidenceData `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"`
|
||||
LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Block) Reset() { *m = Block{} }
|
||||
func (m *Block) String() string { return proto.CompactTextString(m) }
|
||||
func (*Block) ProtoMessage() {}
|
||||
func (*Block) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_3aa007336dea920d, []int{0}
|
||||
}
|
||||
func (m *Block) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Block.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Block.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Block) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Block.Merge(m, src)
|
||||
}
|
||||
func (m *Block) XXX_Size() int {
|
||||
return xxx_messageInfo_Block.Size(m)
|
||||
}
|
||||
func (m *Block) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Block.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Block proto.InternalMessageInfo
|
||||
|
||||
func (m *Block) GetHeader() Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return Header{}
|
||||
}
|
||||
|
||||
func (m *Block) GetData() Data {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
}
|
||||
return Data{}
|
||||
}
|
||||
|
||||
func (m *Block) GetEvidence() EvidenceData {
|
||||
if m != nil {
|
||||
return m.Evidence
|
||||
}
|
||||
return EvidenceData{}
|
||||
}
|
||||
|
||||
func (m *Block) GetLastCommit() *Commit {
|
||||
if m != nil {
|
||||
return m.LastCommit
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Block)(nil), "tendermint.proto.types.Block")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/block.proto", fileDescriptor_3aa007336dea920d) }
|
||||
|
||||
var fileDescriptor_3aa007336dea920d = []byte{
|
||||
// 248 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0xd6, 0x03, 0x8b,
|
||||
0x08, 0x89, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4, 0xc0,
|
||||
0x6a, 0xa4, 0xd4, 0x4a, 0x32, 0x32, 0x8b, 0x52, 0xe2, 0x0b, 0x12, 0x8b, 0x4a, 0x2a, 0xf5, 0x21,
|
||||
0x9a, 0xd3, 0xf3, 0xd3, 0xf3, 0x11, 0x2c, 0x88, 0x6a, 0x29, 0x14, 0x83, 0xc1, 0x24, 0x54, 0x42,
|
||||
0x0a, 0x59, 0x22, 0xb5, 0x2c, 0x33, 0x25, 0x35, 0x2f, 0x39, 0x15, 0x22, 0xa7, 0xd4, 0xc6, 0xc4,
|
||||
0xc5, 0xea, 0x04, 0x72, 0x84, 0x90, 0x0d, 0x17, 0x5b, 0x46, 0x6a, 0x62, 0x4a, 0x6a, 0x91, 0x04,
|
||||
0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x9c, 0x1e, 0x76, 0xf7, 0xe8, 0x79, 0x80, 0x55, 0x39, 0xb1,
|
||||
0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd5, 0x23, 0x64, 0xc6, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28,
|
||||
0xc1, 0x04, 0xd6, 0x2b, 0x83, 0x4b, 0xaf, 0x4b, 0x62, 0x49, 0x22, 0x54, 0x27, 0x58, 0xbd, 0x90,
|
||||
0x1b, 0x17, 0x07, 0xcc, 0x45, 0x12, 0xcc, 0x60, 0xbd, 0x2a, 0xb8, 0xf4, 0xba, 0x42, 0xd5, 0x21,
|
||||
0x99, 0x01, 0xd7, 0x2b, 0x64, 0xcf, 0xc5, 0x9d, 0x93, 0x58, 0x5c, 0x12, 0x9f, 0x9c, 0x9f, 0x9b,
|
||||
0x9b, 0x59, 0x22, 0xc1, 0x82, 0xdf, 0x0b, 0xce, 0x60, 0x55, 0x41, 0x5c, 0x20, 0x2d, 0x10, 0xb6,
|
||||
0x93, 0x5e, 0x94, 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x42,
|
||||
0x1f, 0x32, 0x13, 0x29, 0x1c, 0x93, 0xd8, 0xc0, 0x1c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x46, 0x9a, 0x1b, 0xf7, 0xcf, 0x01, 0x00, 0x00,
|
||||
}
|
||||
15
proto/types/block.proto
Normal file
15
proto/types/block.proto
Normal file
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/types/types.proto";
|
||||
import "proto/types/evidence.proto";
|
||||
|
||||
message Block {
|
||||
Header header = 1 [(gogoproto.nullable) = false];
|
||||
Data data = 2 [(gogoproto.nullable) = false];
|
||||
tendermint.proto.types.EvidenceData evidence = 3 [(gogoproto.nullable) = false];
|
||||
Commit last_commit = 4;
|
||||
}
|
||||
96
proto/types/events.pb.go
Normal file
96
proto/types/events.pb.go
Normal file
@@ -0,0 +1,96 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/events.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type EventDataRoundState struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
Step string `protobuf:"bytes,3,opt,name=step,proto3" json:"step,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *EventDataRoundState) Reset() { *m = EventDataRoundState{} }
|
||||
func (m *EventDataRoundState) String() string { return proto.CompactTextString(m) }
|
||||
func (*EventDataRoundState) ProtoMessage() {}
|
||||
func (*EventDataRoundState) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1bb9bdae76a076d6, []int{0}
|
||||
}
|
||||
func (m *EventDataRoundState) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_EventDataRoundState.Unmarshal(m, b)
|
||||
}
|
||||
func (m *EventDataRoundState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_EventDataRoundState.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *EventDataRoundState) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EventDataRoundState.Merge(m, src)
|
||||
}
|
||||
func (m *EventDataRoundState) XXX_Size() int {
|
||||
return xxx_messageInfo_EventDataRoundState.Size(m)
|
||||
}
|
||||
func (m *EventDataRoundState) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EventDataRoundState.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EventDataRoundState proto.InternalMessageInfo
|
||||
|
||||
func (m *EventDataRoundState) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EventDataRoundState) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EventDataRoundState) GetStep() string {
|
||||
if m != nil {
|
||||
return m.Step
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*EventDataRoundState)(nil), "tendermint.proto.types.EventDataRoundState")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/events.proto", fileDescriptor_1bb9bdae76a076d6) }
|
||||
|
||||
var fileDescriptor_1bb9bdae76a076d6 = []byte{
|
||||
// 162 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x03,
|
||||
0x0b, 0x09, 0x89, 0x95, 0xa4, 0xe6, 0xa5, 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x95, 0x40, 0x44, 0xf4,
|
||||
0xc0, 0x8a, 0x94, 0xc2, 0xb9, 0x84, 0x5d, 0x41, 0xea, 0x5c, 0x12, 0x4b, 0x12, 0x83, 0xf2, 0x4b,
|
||||
0xf3, 0x52, 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0xc4, 0xb8, 0xd8, 0x32, 0x52, 0x33, 0xd3, 0x33,
|
||||
0x4a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xa0, 0x3c, 0x21, 0x11, 0x2e, 0xd6, 0x22, 0x90,
|
||||
0x2a, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xd6, 0x20, 0x08, 0x47, 0x48, 0x88, 0x8b, 0xa5, 0xb8, 0x24,
|
||||
0xb5, 0x40, 0x82, 0x59, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, 0x76, 0xd2, 0x8b, 0xd2, 0x49, 0xcf,
|
||||
0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0xd8, 0x8e, 0xcc, 0x44, 0x72, 0x6d,
|
||||
0x12, 0x1b, 0x98, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x3c, 0x7d, 0xad, 0xc3, 0x00,
|
||||
0x00, 0x00,
|
||||
}
|
||||
10
proto/types/events.proto
Normal file
10
proto/types/events.proto
Normal file
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
message EventDataRoundState {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
string step = 3;
|
||||
}
|
||||
634
proto/types/evidence.pb.go
Normal file
634
proto/types/evidence.pb.go
Normal file
@@ -0,0 +1,634 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/evidence.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
keys "github.com/tendermint/tendermint/proto/crypto/keys"
|
||||
math "math"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var _ = time.Kitchen
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// DuplicateVoteEvidence contains evidence a validator signed two conflicting
|
||||
// votes.
|
||||
type DuplicateVoteEvidence struct {
|
||||
PubKey *keys.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
|
||||
VoteA *Vote `protobuf:"bytes,2,opt,name=vote_a,json=voteA,proto3" json:"vote_a,omitempty"`
|
||||
VoteB *Vote `protobuf:"bytes,3,opt,name=vote_b,json=voteB,proto3" json:"vote_b,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DuplicateVoteEvidence) Reset() { *m = DuplicateVoteEvidence{} }
|
||||
func (m *DuplicateVoteEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*DuplicateVoteEvidence) ProtoMessage() {}
|
||||
func (*DuplicateVoteEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{0}
|
||||
}
|
||||
func (m *DuplicateVoteEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_DuplicateVoteEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *DuplicateVoteEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_DuplicateVoteEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *DuplicateVoteEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DuplicateVoteEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *DuplicateVoteEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_DuplicateVoteEvidence.Size(m)
|
||||
}
|
||||
func (m *DuplicateVoteEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DuplicateVoteEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DuplicateVoteEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *DuplicateVoteEvidence) GetPubKey() *keys.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DuplicateVoteEvidence) GetVoteA() *Vote {
|
||||
if m != nil {
|
||||
return m.VoteA
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DuplicateVoteEvidence) GetVoteB() *Vote {
|
||||
if m != nil {
|
||||
return m.VoteB
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type PotentialAmnesiaEvidence struct {
|
||||
VoteA *Vote `protobuf:"bytes,1,opt,name=vote_a,json=voteA,proto3" json:"vote_a,omitempty"`
|
||||
VoteB *Vote `protobuf:"bytes,2,opt,name=vote_b,json=voteB,proto3" json:"vote_b,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PotentialAmnesiaEvidence) Reset() { *m = PotentialAmnesiaEvidence{} }
|
||||
func (m *PotentialAmnesiaEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*PotentialAmnesiaEvidence) ProtoMessage() {}
|
||||
func (*PotentialAmnesiaEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{1}
|
||||
}
|
||||
func (m *PotentialAmnesiaEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PotentialAmnesiaEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PotentialAmnesiaEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PotentialAmnesiaEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PotentialAmnesiaEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PotentialAmnesiaEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *PotentialAmnesiaEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_PotentialAmnesiaEvidence.Size(m)
|
||||
}
|
||||
func (m *PotentialAmnesiaEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PotentialAmnesiaEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PotentialAmnesiaEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *PotentialAmnesiaEvidence) GetVoteA() *Vote {
|
||||
if m != nil {
|
||||
return m.VoteA
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PotentialAmnesiaEvidence) GetVoteB() *Vote {
|
||||
if m != nil {
|
||||
return m.VoteB
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MockEvidence is used for testing pruposes
|
||||
type MockEvidence struct {
|
||||
EvidenceHeight int64 `protobuf:"varint,1,opt,name=evidence_height,json=evidenceHeight,proto3" json:"evidence_height,omitempty"`
|
||||
EvidenceTime time.Time `protobuf:"bytes,2,opt,name=evidence_time,json=evidenceTime,proto3,stdtime" json:"evidence_time"`
|
||||
EvidenceAddress []byte `protobuf:"bytes,3,opt,name=evidence_address,json=evidenceAddress,proto3" json:"evidence_address,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MockEvidence) Reset() { *m = MockEvidence{} }
|
||||
func (m *MockEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*MockEvidence) ProtoMessage() {}
|
||||
func (*MockEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{2}
|
||||
}
|
||||
func (m *MockEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MockEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *MockEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_MockEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *MockEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MockEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *MockEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_MockEvidence.Size(m)
|
||||
}
|
||||
func (m *MockEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MockEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MockEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *MockEvidence) GetEvidenceHeight() int64 {
|
||||
if m != nil {
|
||||
return m.EvidenceHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MockEvidence) GetEvidenceTime() time.Time {
|
||||
if m != nil {
|
||||
return m.EvidenceTime
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *MockEvidence) GetEvidenceAddress() []byte {
|
||||
if m != nil {
|
||||
return m.EvidenceAddress
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MockRandomEvidence struct {
|
||||
EvidenceHeight int64 `protobuf:"varint,1,opt,name=evidence_height,json=evidenceHeight,proto3" json:"evidence_height,omitempty"`
|
||||
EvidenceTime time.Time `protobuf:"bytes,2,opt,name=evidence_time,json=evidenceTime,proto3,stdtime" json:"evidence_time"`
|
||||
EvidenceAddress []byte `protobuf:"bytes,3,opt,name=evidence_address,json=evidenceAddress,proto3" json:"evidence_address,omitempty"`
|
||||
RandBytes []byte `protobuf:"bytes,4,opt,name=rand_bytes,json=randBytes,proto3" json:"rand_bytes,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MockRandomEvidence) Reset() { *m = MockRandomEvidence{} }
|
||||
func (m *MockRandomEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*MockRandomEvidence) ProtoMessage() {}
|
||||
func (*MockRandomEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{3}
|
||||
}
|
||||
func (m *MockRandomEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_MockRandomEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *MockRandomEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_MockRandomEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *MockRandomEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MockRandomEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *MockRandomEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_MockRandomEvidence.Size(m)
|
||||
}
|
||||
func (m *MockRandomEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MockRandomEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MockRandomEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *MockRandomEvidence) GetEvidenceHeight() int64 {
|
||||
if m != nil {
|
||||
return m.EvidenceHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MockRandomEvidence) GetEvidenceTime() time.Time {
|
||||
if m != nil {
|
||||
return m.EvidenceTime
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *MockRandomEvidence) GetEvidenceAddress() []byte {
|
||||
if m != nil {
|
||||
return m.EvidenceAddress
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockRandomEvidence) GetRandBytes() []byte {
|
||||
if m != nil {
|
||||
return m.RandBytes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ConflictingHeadersEvidence struct {
|
||||
H1 *SignedHeader `protobuf:"bytes,1,opt,name=h1,proto3" json:"h1,omitempty"`
|
||||
H2 *SignedHeader `protobuf:"bytes,2,opt,name=h2,proto3" json:"h2,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ConflictingHeadersEvidence) Reset() { *m = ConflictingHeadersEvidence{} }
|
||||
func (m *ConflictingHeadersEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConflictingHeadersEvidence) ProtoMessage() {}
|
||||
func (*ConflictingHeadersEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{4}
|
||||
}
|
||||
func (m *ConflictingHeadersEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ConflictingHeadersEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ConflictingHeadersEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ConflictingHeadersEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ConflictingHeadersEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ConflictingHeadersEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *ConflictingHeadersEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_ConflictingHeadersEvidence.Size(m)
|
||||
}
|
||||
func (m *ConflictingHeadersEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ConflictingHeadersEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ConflictingHeadersEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *ConflictingHeadersEvidence) GetH1() *SignedHeader {
|
||||
if m != nil {
|
||||
return m.H1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ConflictingHeadersEvidence) GetH2() *SignedHeader {
|
||||
if m != nil {
|
||||
return m.H2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type LunaticValidatorEvidence struct {
|
||||
Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
|
||||
Vote *Vote `protobuf:"bytes,2,opt,name=vote,proto3" json:"vote,omitempty"`
|
||||
InvalidHeaderField string `protobuf:"bytes,3,opt,name=invalid_header_field,json=invalidHeaderField,proto3" json:"invalid_header_field,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *LunaticValidatorEvidence) Reset() { *m = LunaticValidatorEvidence{} }
|
||||
func (m *LunaticValidatorEvidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*LunaticValidatorEvidence) ProtoMessage() {}
|
||||
func (*LunaticValidatorEvidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{5}
|
||||
}
|
||||
func (m *LunaticValidatorEvidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LunaticValidatorEvidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *LunaticValidatorEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_LunaticValidatorEvidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *LunaticValidatorEvidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LunaticValidatorEvidence.Merge(m, src)
|
||||
}
|
||||
func (m *LunaticValidatorEvidence) XXX_Size() int {
|
||||
return xxx_messageInfo_LunaticValidatorEvidence.Size(m)
|
||||
}
|
||||
func (m *LunaticValidatorEvidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LunaticValidatorEvidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LunaticValidatorEvidence proto.InternalMessageInfo
|
||||
|
||||
func (m *LunaticValidatorEvidence) GetHeader() *Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LunaticValidatorEvidence) GetVote() *Vote {
|
||||
if m != nil {
|
||||
return m.Vote
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LunaticValidatorEvidence) GetInvalidHeaderField() string {
|
||||
if m != nil {
|
||||
return m.InvalidHeaderField
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Evidence struct {
|
||||
// Types that are valid to be assigned to Sum:
|
||||
// *Evidence_DuplicateVoteEvidence
|
||||
// *Evidence_ConflictingHeadersEvidence
|
||||
// *Evidence_LunaticValidatorEvidence
|
||||
// *Evidence_PotentialAmnesiaEvidence
|
||||
// *Evidence_MockEvidence
|
||||
// *Evidence_MockRandomEvidence
|
||||
Sum isEvidence_Sum `protobuf_oneof:"sum"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Evidence) Reset() { *m = Evidence{} }
|
||||
func (m *Evidence) String() string { return proto.CompactTextString(m) }
|
||||
func (*Evidence) ProtoMessage() {}
|
||||
func (*Evidence) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{6}
|
||||
}
|
||||
func (m *Evidence) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Evidence.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Evidence.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Evidence) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Evidence.Merge(m, src)
|
||||
}
|
||||
func (m *Evidence) XXX_Size() int {
|
||||
return xxx_messageInfo_Evidence.Size(m)
|
||||
}
|
||||
func (m *Evidence) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Evidence.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Evidence proto.InternalMessageInfo
|
||||
|
||||
type isEvidence_Sum interface {
|
||||
isEvidence_Sum()
|
||||
}
|
||||
|
||||
type Evidence_DuplicateVoteEvidence struct {
|
||||
DuplicateVoteEvidence *DuplicateVoteEvidence `protobuf:"bytes,1,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3,oneof" json:"duplicate_vote_evidence,omitempty"`
|
||||
}
|
||||
type Evidence_ConflictingHeadersEvidence struct {
|
||||
ConflictingHeadersEvidence *ConflictingHeadersEvidence `protobuf:"bytes,2,opt,name=conflicting_headers_evidence,json=conflictingHeadersEvidence,proto3,oneof" json:"conflicting_headers_evidence,omitempty"`
|
||||
}
|
||||
type Evidence_LunaticValidatorEvidence struct {
|
||||
LunaticValidatorEvidence *LunaticValidatorEvidence `protobuf:"bytes,3,opt,name=lunatic_validator_evidence,json=lunaticValidatorEvidence,proto3,oneof" json:"lunatic_validator_evidence,omitempty"`
|
||||
}
|
||||
type Evidence_PotentialAmnesiaEvidence struct {
|
||||
PotentialAmnesiaEvidence *PotentialAmnesiaEvidence `protobuf:"bytes,4,opt,name=potential_amnesia_evidence,json=potentialAmnesiaEvidence,proto3,oneof" json:"potential_amnesia_evidence,omitempty"`
|
||||
}
|
||||
type Evidence_MockEvidence struct {
|
||||
MockEvidence *MockEvidence `protobuf:"bytes,5,opt,name=mock_evidence,json=mockEvidence,proto3,oneof" json:"mock_evidence,omitempty"`
|
||||
}
|
||||
type Evidence_MockRandomEvidence struct {
|
||||
MockRandomEvidence *MockRandomEvidence `protobuf:"bytes,6,opt,name=mock_random_evidence,json=mockRandomEvidence,proto3,oneof" json:"mock_random_evidence,omitempty"`
|
||||
}
|
||||
|
||||
func (*Evidence_DuplicateVoteEvidence) isEvidence_Sum() {}
|
||||
func (*Evidence_ConflictingHeadersEvidence) isEvidence_Sum() {}
|
||||
func (*Evidence_LunaticValidatorEvidence) isEvidence_Sum() {}
|
||||
func (*Evidence_PotentialAmnesiaEvidence) isEvidence_Sum() {}
|
||||
func (*Evidence_MockEvidence) isEvidence_Sum() {}
|
||||
func (*Evidence_MockRandomEvidence) isEvidence_Sum() {}
|
||||
|
||||
func (m *Evidence) GetSum() isEvidence_Sum {
|
||||
if m != nil {
|
||||
return m.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetDuplicateVoteEvidence() *DuplicateVoteEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_DuplicateVoteEvidence); ok {
|
||||
return x.DuplicateVoteEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetConflictingHeadersEvidence() *ConflictingHeadersEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_ConflictingHeadersEvidence); ok {
|
||||
return x.ConflictingHeadersEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetLunaticValidatorEvidence() *LunaticValidatorEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_LunaticValidatorEvidence); ok {
|
||||
return x.LunaticValidatorEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetPotentialAmnesiaEvidence() *PotentialAmnesiaEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_PotentialAmnesiaEvidence); ok {
|
||||
return x.PotentialAmnesiaEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetMockEvidence() *MockEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_MockEvidence); ok {
|
||||
return x.MockEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Evidence) GetMockRandomEvidence() *MockRandomEvidence {
|
||||
if x, ok := m.GetSum().(*Evidence_MockRandomEvidence); ok {
|
||||
return x.MockRandomEvidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||
func (*Evidence) XXX_OneofWrappers() []interface{} {
|
||||
return []interface{}{
|
||||
(*Evidence_DuplicateVoteEvidence)(nil),
|
||||
(*Evidence_ConflictingHeadersEvidence)(nil),
|
||||
(*Evidence_LunaticValidatorEvidence)(nil),
|
||||
(*Evidence_PotentialAmnesiaEvidence)(nil),
|
||||
(*Evidence_MockEvidence)(nil),
|
||||
(*Evidence_MockRandomEvidence)(nil),
|
||||
}
|
||||
}
|
||||
|
||||
// EvidenceData contains any evidence of malicious wrong-doing by validators
|
||||
type EvidenceData struct {
|
||||
Evidence []Evidence `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence"`
|
||||
Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *EvidenceData) Reset() { *m = EvidenceData{} }
|
||||
func (m *EvidenceData) String() string { return proto.CompactTextString(m) }
|
||||
func (*EvidenceData) ProtoMessage() {}
|
||||
func (*EvidenceData) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{7}
|
||||
}
|
||||
func (m *EvidenceData) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_EvidenceData.Unmarshal(m, b)
|
||||
}
|
||||
func (m *EvidenceData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_EvidenceData.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *EvidenceData) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EvidenceData.Merge(m, src)
|
||||
}
|
||||
func (m *EvidenceData) XXX_Size() int {
|
||||
return xxx_messageInfo_EvidenceData.Size(m)
|
||||
}
|
||||
func (m *EvidenceData) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EvidenceData.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EvidenceData proto.InternalMessageInfo
|
||||
|
||||
func (m *EvidenceData) GetEvidence() []Evidence {
|
||||
if m != nil {
|
||||
return m.Evidence
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *EvidenceData) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProofOfLockChange struct {
|
||||
Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"`
|
||||
PubKey keys.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ProofOfLockChange) Reset() { *m = ProofOfLockChange{} }
|
||||
func (m *ProofOfLockChange) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProofOfLockChange) ProtoMessage() {}
|
||||
func (*ProofOfLockChange) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_86495eef24aeacc0, []int{8}
|
||||
}
|
||||
func (m *ProofOfLockChange) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ProofOfLockChange.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ProofOfLockChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ProofOfLockChange.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ProofOfLockChange) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ProofOfLockChange.Merge(m, src)
|
||||
}
|
||||
func (m *ProofOfLockChange) XXX_Size() int {
|
||||
return xxx_messageInfo_ProofOfLockChange.Size(m)
|
||||
}
|
||||
func (m *ProofOfLockChange) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ProofOfLockChange.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ProofOfLockChange proto.InternalMessageInfo
|
||||
|
||||
func (m *ProofOfLockChange) GetVotes() []Vote {
|
||||
if m != nil {
|
||||
return m.Votes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProofOfLockChange) GetPubKey() keys.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return keys.PublicKey{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*DuplicateVoteEvidence)(nil), "tendermint.proto.types.DuplicateVoteEvidence")
|
||||
proto.RegisterType((*PotentialAmnesiaEvidence)(nil), "tendermint.proto.types.PotentialAmnesiaEvidence")
|
||||
proto.RegisterType((*MockEvidence)(nil), "tendermint.proto.types.MockEvidence")
|
||||
proto.RegisterType((*MockRandomEvidence)(nil), "tendermint.proto.types.MockRandomEvidence")
|
||||
proto.RegisterType((*ConflictingHeadersEvidence)(nil), "tendermint.proto.types.ConflictingHeadersEvidence")
|
||||
proto.RegisterType((*LunaticValidatorEvidence)(nil), "tendermint.proto.types.LunaticValidatorEvidence")
|
||||
proto.RegisterType((*Evidence)(nil), "tendermint.proto.types.Evidence")
|
||||
proto.RegisterType((*EvidenceData)(nil), "tendermint.proto.types.EvidenceData")
|
||||
proto.RegisterType((*ProofOfLockChange)(nil), "tendermint.proto.types.ProofOfLockChange")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/evidence.proto", fileDescriptor_86495eef24aeacc0) }
|
||||
|
||||
var fileDescriptor_86495eef24aeacc0 = []byte{
|
||||
// 784 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcb, 0x6e, 0xdb, 0x38,
|
||||
0x14, 0xb5, 0xfc, 0x9a, 0x84, 0x71, 0xe6, 0x41, 0x24, 0x13, 0x43, 0x48, 0x26, 0x81, 0x30, 0x98,
|
||||
0x64, 0x06, 0x33, 0x72, 0xe2, 0x0c, 0x8a, 0x2e, 0x1b, 0x27, 0x0d, 0x5c, 0x24, 0x45, 0x03, 0xb5,
|
||||
0xc8, 0xa2, 0x8b, 0x0a, 0x94, 0x44, 0x4b, 0x84, 0x25, 0x51, 0x90, 0x28, 0x03, 0x5a, 0xb7, 0x8b,
|
||||
0x2e, 0xbb, 0xe9, 0x67, 0x74, 0xdb, 0x1f, 0xe8, 0xa6, 0xeb, 0x7e, 0x40, 0xfb, 0x2b, 0x85, 0x48,
|
||||
0x4a, 0x72, 0x90, 0xc8, 0x70, 0xbb, 0xeb, 0x26, 0x60, 0x2e, 0xef, 0x3d, 0xe7, 0x90, 0xf7, 0xea,
|
||||
0xd0, 0x40, 0x8d, 0x62, 0xca, 0xe8, 0x80, 0x65, 0x11, 0x4e, 0x06, 0x78, 0x46, 0x1c, 0x1c, 0xda,
|
||||
0x58, 0xe7, 0x41, 0xf8, 0x3b, 0xc3, 0xa1, 0x83, 0xe3, 0x80, 0x84, 0x4c, 0x44, 0x74, 0x9e, 0xa6,
|
||||
0xfe, 0xc5, 0x3c, 0x12, 0x3b, 0x66, 0x84, 0x62, 0x96, 0x0d, 0x44, 0xbd, 0x4b, 0x5d, 0x5a, 0xad,
|
||||
0x44, 0xb6, 0xba, 0x35, 0x8f, 0xcd, 0xff, 0xca, 0x8d, 0x5d, 0x97, 0x52, 0xd7, 0xc7, 0xa2, 0xd6,
|
||||
0x4a, 0x27, 0x03, 0x46, 0x02, 0x9c, 0x30, 0x14, 0x44, 0x32, 0x61, 0x47, 0x54, 0xda, 0x71, 0x16,
|
||||
0x31, 0x3a, 0x98, 0xe2, 0xec, 0x46, 0xbd, 0xf6, 0x41, 0x01, 0x9b, 0x67, 0x69, 0xe4, 0x13, 0x1b,
|
||||
0x31, 0x7c, 0x4d, 0x19, 0x7e, 0x28, 0x85, 0xc3, 0x07, 0xe0, 0xa7, 0x28, 0xb5, 0xcc, 0x29, 0xce,
|
||||
0xfa, 0xca, 0x9e, 0x72, 0xb0, 0x36, 0xdc, 0xd7, 0x6f, 0x1d, 0x42, 0xa0, 0xea, 0x39, 0xaa, 0x7e,
|
||||
0x95, 0x5a, 0x3e, 0xb1, 0x2f, 0x70, 0x66, 0x74, 0xa3, 0xd4, 0xba, 0xc0, 0x19, 0x3c, 0x06, 0xdd,
|
||||
0x19, 0x65, 0xd8, 0x44, 0xfd, 0x26, 0x07, 0xd8, 0xd6, 0xef, 0xbe, 0x05, 0x3d, 0xe7, 0x35, 0x3a,
|
||||
0x79, 0xee, 0x49, 0x59, 0x64, 0xf5, 0x5b, 0xcb, 0x16, 0x8d, 0xb4, 0x57, 0x0a, 0xe8, 0x5f, 0x51,
|
||||
0x86, 0x43, 0x46, 0x90, 0x7f, 0x12, 0x84, 0x38, 0x21, 0xa8, 0x3c, 0x48, 0x25, 0x43, 0xf9, 0x1e,
|
||||
0x19, 0xcd, 0xe5, 0x65, 0xbc, 0x53, 0x40, 0xef, 0x31, 0xb5, 0xa7, 0x25, 0xf5, 0x3e, 0xf8, 0xa5,
|
||||
0x18, 0x04, 0xd3, 0xc3, 0xc4, 0xf5, 0x18, 0xd7, 0xd0, 0x32, 0x7e, 0x2e, 0xc2, 0x63, 0x1e, 0x85,
|
||||
0x8f, 0xc0, 0x7a, 0x99, 0x98, 0x77, 0x50, 0xb2, 0xaa, 0xba, 0x68, 0xaf, 0x5e, 0xb4, 0x57, 0x7f,
|
||||
0x56, 0xb4, 0x77, 0xb4, 0xf2, 0xf1, 0xf3, 0x6e, 0xe3, 0xcd, 0x97, 0x5d, 0xc5, 0xe8, 0x15, 0xa5,
|
||||
0xf9, 0x26, 0xfc, 0x1b, 0xfc, 0x5a, 0x42, 0x21, 0xc7, 0x89, 0x71, 0x92, 0xf0, 0xab, 0xec, 0x19,
|
||||
0xa5, 0x96, 0x13, 0x11, 0xd6, 0x3e, 0x29, 0x00, 0xe6, 0x7a, 0x0d, 0x14, 0x3a, 0x34, 0xf8, 0x41,
|
||||
0x54, 0xc3, 0x1d, 0x00, 0x62, 0x14, 0x3a, 0xa6, 0x95, 0x31, 0x9c, 0xf4, 0xdb, 0x3c, 0x69, 0x35,
|
||||
0x8f, 0x8c, 0xf2, 0x80, 0xf6, 0x5a, 0x01, 0xea, 0x29, 0x0d, 0x27, 0x3e, 0xb1, 0x19, 0x09, 0xdd,
|
||||
0x31, 0x46, 0x0e, 0x8e, 0x93, 0xf2, 0x70, 0xff, 0x83, 0xa6, 0x77, 0x24, 0x27, 0xe1, 0xcf, 0xba,
|
||||
0xa6, 0x3e, 0x25, 0x6e, 0x88, 0x1d, 0x51, 0x6a, 0x34, 0xbd, 0x23, 0x5e, 0x35, 0x94, 0xc7, 0x5b,
|
||||
0xb6, 0x6a, 0xa8, 0xbd, 0x57, 0x40, 0xff, 0x32, 0x0d, 0x11, 0x23, 0xf6, 0x35, 0xf2, 0x89, 0x83,
|
||||
0x18, 0x8d, 0x4b, 0x21, 0xf7, 0x40, 0xd7, 0xe3, 0xa9, 0x52, 0xcc, 0x1f, 0x75, 0xb0, 0x12, 0x50,
|
||||
0x66, 0xc3, 0x43, 0xd0, 0xce, 0xa7, 0x6d, 0xa9, 0xb9, 0xe4, 0x99, 0xf0, 0x10, 0x6c, 0x90, 0x70,
|
||||
0x96, 0x0b, 0x30, 0x05, 0x86, 0x39, 0x21, 0xd8, 0x77, 0xf8, 0xfd, 0xae, 0x1a, 0x50, 0xee, 0x09,
|
||||
0x9a, 0xf3, 0x7c, 0x47, 0x7b, 0xd9, 0x01, 0x2b, 0xa5, 0x50, 0x17, 0x6c, 0x39, 0x85, 0x43, 0x98,
|
||||
0xfc, 0xa3, 0x28, 0x3a, 0x22, 0x95, 0xff, 0x57, 0xa7, 0xe1, 0x4e, 0x63, 0x19, 0x37, 0x8c, 0x4d,
|
||||
0xe7, 0x4e, 0xc7, 0x99, 0x81, 0x6d, 0xbb, 0x6a, 0x9c, 0xd4, 0x9a, 0x54, 0x6c, 0xe2, 0xc4, 0xc3,
|
||||
0x3a, 0xb6, 0xfa, 0xa6, 0x8f, 0x1b, 0x86, 0x6a, 0xd7, 0x8f, 0x44, 0x04, 0x54, 0x5f, 0x74, 0xc9,
|
||||
0x9c, 0x15, 0x6d, 0xaa, 0x58, 0x85, 0x0d, 0x1d, 0xd6, 0xb1, 0xd6, 0xf5, 0x77, 0xdc, 0x30, 0xfa,
|
||||
0x7e, 0x5d, 0xef, 0x23, 0xa0, 0x46, 0x85, 0x5d, 0x99, 0x48, 0xf8, 0x55, 0xc5, 0xd8, 0x5e, 0xcc,
|
||||
0x58, 0x67, 0x74, 0x39, 0x63, 0x54, 0x67, 0x82, 0x17, 0x60, 0x3d, 0xa0, 0xf6, 0xb4, 0x22, 0xe9,
|
||||
0x2c, 0x9e, 0xe5, 0x79, 0x1b, 0x1b, 0x37, 0x8c, 0x5e, 0x30, 0x6f, 0x6b, 0x2f, 0xc0, 0x06, 0x07,
|
||||
0x8b, 0xb9, 0x6f, 0x54, 0x98, 0x5d, 0x8e, 0xf9, 0xcf, 0x22, 0xcc, 0x9b, 0x56, 0x33, 0x6e, 0x18,
|
||||
0x30, 0xb8, 0x15, 0x1d, 0x75, 0x40, 0x2b, 0x49, 0x03, 0x6d, 0x02, 0x7a, 0x45, 0xe8, 0x0c, 0x31,
|
||||
0x04, 0x47, 0x60, 0x65, 0x6e, 0xf2, 0x5a, 0x07, 0x6b, 0xc3, 0xbd, 0x3a, 0xaa, 0x12, 0xaa, 0x9d,
|
||||
0xfb, 0x8d, 0x51, 0xd6, 0x41, 0x08, 0xda, 0x1e, 0x4a, 0x3c, 0x3e, 0x4b, 0x3d, 0x83, 0xaf, 0xb5,
|
||||
0xb7, 0x0a, 0xf8, 0xed, 0x2a, 0xa6, 0x74, 0xf2, 0x64, 0x72, 0x49, 0xed, 0xe9, 0xa9, 0x87, 0x42,
|
||||
0x17, 0xc3, 0xfb, 0x80, 0xbb, 0x7a, 0x22, 0xa9, 0x16, 0x7e, 0x68, 0x92, 0x46, 0x14, 0xc0, 0xf3,
|
||||
0xea, 0xe5, 0x6c, 0x7e, 0xd3, 0xcb, 0x29, 0x61, 0xe4, 0xfb, 0x39, 0xd2, 0x9f, 0xff, 0xeb, 0x12,
|
||||
0xe6, 0xa5, 0x96, 0x6e, 0xd3, 0x60, 0x50, 0x41, 0xcc, 0x2f, 0xe7, 0x7e, 0x17, 0x58, 0x5d, 0xfe,
|
||||
0xcf, 0xf1, 0xd7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x06, 0x2d, 0xa0, 0x89, 0x08, 0x00, 0x00,
|
||||
}
|
||||
71
proto/types/evidence.proto
Normal file
71
proto/types/evidence.proto
Normal file
@@ -0,0 +1,71 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/types/types.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "proto/crypto/keys/types.proto";
|
||||
|
||||
// DuplicateVoteEvidence contains evidence a validator signed two conflicting
|
||||
// votes.
|
||||
message DuplicateVoteEvidence {
|
||||
tendermint.proto.crypto.keys.PublicKey pub_key = 1;
|
||||
Vote vote_a = 2;
|
||||
Vote vote_b = 3;
|
||||
}
|
||||
|
||||
message PotentialAmnesiaEvidence {
|
||||
Vote vote_a = 1;
|
||||
Vote vote_b = 2;
|
||||
}
|
||||
|
||||
// MockEvidence is used for testing pruposes
|
||||
message MockEvidence {
|
||||
int64 evidence_height = 1;
|
||||
google.protobuf.Timestamp evidence_time = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes evidence_address = 3;
|
||||
}
|
||||
message MockRandomEvidence {
|
||||
int64 evidence_height = 1;
|
||||
google.protobuf.Timestamp evidence_time = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes evidence_address = 3;
|
||||
bytes rand_bytes = 4;
|
||||
}
|
||||
|
||||
message ConflictingHeadersEvidence {
|
||||
SignedHeader h1 = 1;
|
||||
SignedHeader h2 = 2;
|
||||
}
|
||||
|
||||
message LunaticValidatorEvidence {
|
||||
Header header = 1;
|
||||
Vote vote = 2;
|
||||
string invalid_header_field = 3;
|
||||
}
|
||||
|
||||
message Evidence {
|
||||
oneof sum {
|
||||
DuplicateVoteEvidence duplicate_vote_evidence = 1;
|
||||
ConflictingHeadersEvidence conflicting_headers_evidence = 2;
|
||||
LunaticValidatorEvidence lunatic_validator_evidence = 3;
|
||||
PotentialAmnesiaEvidence potential_amnesia_evidence = 4;
|
||||
|
||||
MockEvidence mock_evidence = 5;
|
||||
MockRandomEvidence mock_random_evidence = 6;
|
||||
}
|
||||
}
|
||||
|
||||
// EvidenceData contains any evidence of malicious wrong-doing by validators
|
||||
message EvidenceData {
|
||||
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
|
||||
bytes hash = 2;
|
||||
}
|
||||
|
||||
message ProofOfLockChange {
|
||||
repeated Vote votes = 1 [(gogoproto.nullable) = false];
|
||||
tendermint.proto.crypto.keys.PublicKey pub_key = 2 [(gogoproto.nullable) = false];
|
||||
}
|
||||
504
proto/types/params.pb.go
Normal file
504
proto/types/params.pb.go
Normal file
@@ -0,0 +1,504 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/params.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/duration"
|
||||
math "math"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var _ = time.Kitchen
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// ConsensusParams contains consensus critical parameters that determine the
|
||||
// validity of blocks.
|
||||
type ConsensusParams struct {
|
||||
Block BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block"`
|
||||
Evidence EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence"`
|
||||
Validator ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ConsensusParams) Reset() { *m = ConsensusParams{} }
|
||||
func (m *ConsensusParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*ConsensusParams) ProtoMessage() {}
|
||||
func (*ConsensusParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_95a9f934fa6f056c, []int{0}
|
||||
}
|
||||
func (m *ConsensusParams) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ConsensusParams.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ConsensusParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ConsensusParams.Merge(m, src)
|
||||
}
|
||||
func (m *ConsensusParams) XXX_Size() int {
|
||||
return xxx_messageInfo_ConsensusParams.Size(m)
|
||||
}
|
||||
func (m *ConsensusParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ConsensusParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo
|
||||
|
||||
func (m *ConsensusParams) GetBlock() BlockParams {
|
||||
if m != nil {
|
||||
return m.Block
|
||||
}
|
||||
return BlockParams{}
|
||||
}
|
||||
|
||||
func (m *ConsensusParams) GetEvidence() EvidenceParams {
|
||||
if m != nil {
|
||||
return m.Evidence
|
||||
}
|
||||
return EvidenceParams{}
|
||||
}
|
||||
|
||||
func (m *ConsensusParams) GetValidator() ValidatorParams {
|
||||
if m != nil {
|
||||
return m.Validator
|
||||
}
|
||||
return ValidatorParams{}
|
||||
}
|
||||
|
||||
// BlockParams contains limits on the block size.
|
||||
type BlockParams struct {
|
||||
// Note: must be greater than 0
|
||||
MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"`
|
||||
// Note: must be greater or equal to -1
|
||||
MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"`
|
||||
// Minimum time increment between consecutive blocks (in milliseconds)
|
||||
// Not exposed to the application.
|
||||
TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockParams) Reset() { *m = BlockParams{} }
|
||||
func (m *BlockParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockParams) ProtoMessage() {}
|
||||
func (*BlockParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_95a9f934fa6f056c, []int{1}
|
||||
}
|
||||
func (m *BlockParams) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockParams.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockParams.Merge(m, src)
|
||||
}
|
||||
func (m *BlockParams) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockParams.Size(m)
|
||||
}
|
||||
func (m *BlockParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockParams proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockParams) GetMaxBytes() int64 {
|
||||
if m != nil {
|
||||
return m.MaxBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockParams) GetMaxGas() int64 {
|
||||
if m != nil {
|
||||
return m.MaxGas
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockParams) GetTimeIotaMs() int64 {
|
||||
if m != nil {
|
||||
return m.TimeIotaMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// EvidenceParams determine how we handle evidence of malfeasance.
|
||||
type EvidenceParams struct {
|
||||
// Max age of evidence, in blocks.
|
||||
//
|
||||
// The basic formula for calculating this is: MaxAgeDuration / {average block
|
||||
// time}.
|
||||
MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"`
|
||||
// Max age of evidence, in time.
|
||||
//
|
||||
// It should correspond with an app's "unbonding period" or other similar
|
||||
// mechanism for handling [Nothing-At-Stake
|
||||
// attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
|
||||
MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"`
|
||||
// This sets the maximum number of evidence that can be committed in a single block.
|
||||
// and should fall comfortably under the max block bytes when we consider the size of
|
||||
// each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
|
||||
// Default is 50
|
||||
MaxNum uint32 `protobuf:"varint,3,opt,name=max_num,json=maxNum,proto3" json:"max_num,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *EvidenceParams) Reset() { *m = EvidenceParams{} }
|
||||
func (m *EvidenceParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*EvidenceParams) ProtoMessage() {}
|
||||
func (*EvidenceParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_95a9f934fa6f056c, []int{2}
|
||||
}
|
||||
func (m *EvidenceParams) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_EvidenceParams.Unmarshal(m, b)
|
||||
}
|
||||
func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *EvidenceParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_EvidenceParams.Merge(m, src)
|
||||
}
|
||||
func (m *EvidenceParams) XXX_Size() int {
|
||||
return xxx_messageInfo_EvidenceParams.Size(m)
|
||||
}
|
||||
func (m *EvidenceParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_EvidenceParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo
|
||||
|
||||
func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 {
|
||||
if m != nil {
|
||||
return m.MaxAgeNumBlocks
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EvidenceParams) GetMaxAgeDuration() time.Duration {
|
||||
if m != nil {
|
||||
return m.MaxAgeDuration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EvidenceParams) GetMaxNum() uint32 {
|
||||
if m != nil {
|
||||
return m.MaxNum
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// ValidatorParams restrict the public key types validators can use.
|
||||
// NOTE: uses ABCI pubkey naming, not Amino names.
|
||||
type ValidatorParams struct {
|
||||
PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ValidatorParams) Reset() { *m = ValidatorParams{} }
|
||||
func (m *ValidatorParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*ValidatorParams) ProtoMessage() {}
|
||||
func (*ValidatorParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_95a9f934fa6f056c, []int{3}
|
||||
}
|
||||
func (m *ValidatorParams) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ValidatorParams.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ValidatorParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ValidatorParams.Merge(m, src)
|
||||
}
|
||||
func (m *ValidatorParams) XXX_Size() int {
|
||||
return xxx_messageInfo_ValidatorParams.Size(m)
|
||||
}
|
||||
func (m *ValidatorParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ValidatorParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo
|
||||
|
||||
func (m *ValidatorParams) GetPubKeyTypes() []string {
|
||||
if m != nil {
|
||||
return m.PubKeyTypes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// HashedParams is a subset of ConsensusParams.
|
||||
// It is amino encoded and hashed into
|
||||
// the Header.ConsensusHash.
|
||||
type HashedParams struct {
|
||||
BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"`
|
||||
BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *HashedParams) Reset() { *m = HashedParams{} }
|
||||
func (m *HashedParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*HashedParams) ProtoMessage() {}
|
||||
func (*HashedParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_95a9f934fa6f056c, []int{4}
|
||||
}
|
||||
func (m *HashedParams) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_HashedParams.Unmarshal(m, b)
|
||||
}
|
||||
func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *HashedParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_HashedParams.Merge(m, src)
|
||||
}
|
||||
func (m *HashedParams) XXX_Size() int {
|
||||
return xxx_messageInfo_HashedParams.Size(m)
|
||||
}
|
||||
func (m *HashedParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_HashedParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_HashedParams proto.InternalMessageInfo
|
||||
|
||||
func (m *HashedParams) GetBlockMaxBytes() int64 {
|
||||
if m != nil {
|
||||
return m.BlockMaxBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *HashedParams) GetBlockMaxGas() int64 {
|
||||
if m != nil {
|
||||
return m.BlockMaxGas
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ConsensusParams)(nil), "tendermint.proto.types.ConsensusParams")
|
||||
proto.RegisterType((*BlockParams)(nil), "tendermint.proto.types.BlockParams")
|
||||
proto.RegisterType((*EvidenceParams)(nil), "tendermint.proto.types.EvidenceParams")
|
||||
proto.RegisterType((*ValidatorParams)(nil), "tendermint.proto.types.ValidatorParams")
|
||||
proto.RegisterType((*HashedParams)(nil), "tendermint.proto.types.HashedParams")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/params.proto", fileDescriptor_95a9f934fa6f056c) }
|
||||
|
||||
var fileDescriptor_95a9f934fa6f056c = []byte{
|
||||
// 469 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xd1, 0x6a, 0xd4, 0x40,
|
||||
0x14, 0x35, 0xae, 0xd6, 0xdd, 0xbb, 0xdd, 0xae, 0xcc, 0x83, 0xc6, 0x0a, 0xed, 0x12, 0x61, 0x2d,
|
||||
0x28, 0x09, 0x54, 0x7c, 0x16, 0xa3, 0xd2, 0x4a, 0xd9, 0x22, 0x41, 0x7c, 0xe8, 0xcb, 0x70, 0xb3,
|
||||
0x19, 0xb3, 0xa1, 0x3b, 0x99, 0x90, 0x99, 0x29, 0x9b, 0x3f, 0xf1, 0x07, 0x04, 0x3f, 0xc5, 0xaf,
|
||||
0x50, 0xf0, 0xcd, 0xbf, 0x90, 0xcc, 0xec, 0x98, 0xdd, 0xd2, 0xbe, 0xcd, 0xdc, 0x7b, 0xce, 0x99,
|
||||
0x7b, 0xce, 0x65, 0xc0, 0xaf, 0x6a, 0xa1, 0x44, 0xa4, 0x9a, 0x8a, 0xc9, 0xa8, 0xc2, 0x1a, 0xb9,
|
||||
0x0c, 0x4d, 0x89, 0x3c, 0x52, 0xac, 0xcc, 0x58, 0xcd, 0x8b, 0x52, 0xd9, 0x4a, 0x68, 0x40, 0xfb,
|
||||
0x53, 0xb5, 0x28, 0xea, 0x8c, 0x56, 0x58, 0xab, 0x26, 0xb2, 0xec, 0x5c, 0xe4, 0xa2, 0x3b, 0x59,
|
||||
0xf4, 0xfe, 0x41, 0x2e, 0x44, 0xbe, 0x64, 0x16, 0x92, 0xea, 0xaf, 0x51, 0xa6, 0x6b, 0x54, 0x85,
|
||||
0x28, 0x6d, 0x3f, 0xf8, 0xeb, 0xc1, 0xf8, 0x9d, 0x28, 0x25, 0x2b, 0xa5, 0x96, 0x9f, 0xcc, 0xcb,
|
||||
0xe4, 0x0d, 0xdc, 0x4f, 0x97, 0x62, 0x7e, 0xe9, 0x7b, 0x13, 0xef, 0x68, 0x78, 0xfc, 0x2c, 0xbc,
|
||||
0x79, 0x86, 0x30, 0x6e, 0x41, 0x96, 0x13, 0xdf, 0xfb, 0xf9, 0xeb, 0xf0, 0x4e, 0x62, 0x79, 0xe4,
|
||||
0x14, 0xfa, 0xec, 0xaa, 0xc8, 0x58, 0x39, 0x67, 0xfe, 0x5d, 0xa3, 0x31, 0xbd, 0x4d, 0xe3, 0xc3,
|
||||
0x1a, 0xb7, 0x25, 0xf3, 0x9f, 0x4d, 0xce, 0x60, 0x70, 0x85, 0xcb, 0x22, 0x43, 0x25, 0x6a, 0xbf,
|
||||
0x67, 0xa4, 0x9e, 0xdf, 0x26, 0xf5, 0xc5, 0x01, 0xb7, 0xb4, 0x3a, 0x7e, 0xc0, 0x60, 0xb8, 0x31,
|
||||
0x32, 0x79, 0x0a, 0x03, 0x8e, 0x2b, 0x9a, 0x36, 0x8a, 0x49, 0x63, 0xb5, 0x97, 0xf4, 0x39, 0xae,
|
||||
0xe2, 0xf6, 0x4e, 0x1e, 0xc3, 0x83, 0xb6, 0x99, 0xa3, 0x34, 0x0e, 0x7a, 0xc9, 0x0e, 0xc7, 0xd5,
|
||||
0x09, 0x4a, 0x32, 0x81, 0x5d, 0x55, 0x70, 0x46, 0x0b, 0xa1, 0x90, 0x72, 0x69, 0x86, 0xea, 0x25,
|
||||
0xd0, 0xd6, 0x3e, 0x0a, 0x85, 0x33, 0x19, 0x7c, 0xf7, 0x60, 0x6f, 0xdb, 0x16, 0x79, 0x01, 0xa4,
|
||||
0x55, 0xc3, 0x9c, 0xd1, 0x52, 0x73, 0x6a, 0x52, 0x72, 0x6f, 0x8e, 0x39, 0xae, 0xde, 0xe6, 0xec,
|
||||
0x5c, 0x73, 0x33, 0x9c, 0x24, 0x33, 0x78, 0xe8, 0xc0, 0x6e, 0x59, 0xeb, 0x14, 0x9f, 0x84, 0x76,
|
||||
0x9b, 0xa1, 0xdb, 0x66, 0xf8, 0x7e, 0x0d, 0x88, 0xfb, 0xad, 0xd9, 0x6f, 0xbf, 0x0f, 0xbd, 0x64,
|
||||
0xcf, 0xea, 0xb9, 0x8e, 0x73, 0x52, 0x6a, 0x6e, 0x66, 0x1d, 0x19, 0x27, 0xe7, 0x9a, 0x07, 0xaf,
|
||||
0x61, 0x7c, 0x2d, 0x32, 0x12, 0xc0, 0xa8, 0xd2, 0x29, 0xbd, 0x64, 0x0d, 0x35, 0x99, 0xfa, 0xde,
|
||||
0xa4, 0x77, 0x34, 0x48, 0x86, 0x95, 0x4e, 0xcf, 0x58, 0xf3, 0xb9, 0x2d, 0x05, 0x17, 0xb0, 0x7b,
|
||||
0x8a, 0x72, 0xc1, 0xb2, 0x35, 0x67, 0x0a, 0x63, 0xe3, 0x87, 0x5e, 0x0f, 0x73, 0x64, 0xca, 0x33,
|
||||
0x97, 0x68, 0x00, 0xa3, 0x0e, 0xd7, 0xe5, 0x3a, 0x74, 0xa8, 0x13, 0x94, 0xf1, 0xf1, 0x8f, 0x3f,
|
||||
0x07, 0xde, 0xc5, 0xcb, 0xbc, 0x50, 0x0b, 0x9d, 0x86, 0x73, 0xc1, 0xa3, 0x6e, 0xd7, 0x9b, 0xc7,
|
||||
0x8d, 0xef, 0x92, 0xee, 0x98, 0xcb, 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x3c, 0x66,
|
||||
0x44, 0x44, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *ConsensusParams) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*ConsensusParams)
|
||||
if !ok {
|
||||
that2, ok := that.(ConsensusParams)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if !this.Block.Equal(&that1.Block) {
|
||||
return false
|
||||
}
|
||||
if !this.Evidence.Equal(&that1.Evidence) {
|
||||
return false
|
||||
}
|
||||
if !this.Validator.Equal(&that1.Validator) {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *BlockParams) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*BlockParams)
|
||||
if !ok {
|
||||
that2, ok := that.(BlockParams)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.MaxBytes != that1.MaxBytes {
|
||||
return false
|
||||
}
|
||||
if this.MaxGas != that1.MaxGas {
|
||||
return false
|
||||
}
|
||||
if this.TimeIotaMs != that1.TimeIotaMs {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *EvidenceParams) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*EvidenceParams)
|
||||
if !ok {
|
||||
that2, ok := that.(EvidenceParams)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.MaxAgeNumBlocks != that1.MaxAgeNumBlocks {
|
||||
return false
|
||||
}
|
||||
if this.MaxAgeDuration != that1.MaxAgeDuration {
|
||||
return false
|
||||
}
|
||||
if this.MaxNum != that1.MaxNum {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *ValidatorParams) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*ValidatorParams)
|
||||
if !ok {
|
||||
that2, ok := that.(ValidatorParams)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if len(this.PubKeyTypes) != len(that1.PubKeyTypes) {
|
||||
return false
|
||||
}
|
||||
for i := range this.PubKeyTypes {
|
||||
if this.PubKeyTypes[i] != that1.PubKeyTypes[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *HashedParams) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*HashedParams)
|
||||
if !ok {
|
||||
that2, ok := that.(HashedParams)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.BlockMaxBytes != that1.BlockMaxBytes {
|
||||
return false
|
||||
}
|
||||
if this.BlockMaxGas != that1.BlockMaxGas {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
65
proto/types/params.proto
Normal file
65
proto/types/params.proto
Normal file
@@ -0,0 +1,65 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
|
||||
option (gogoproto.equal_all) = true;
|
||||
|
||||
// ConsensusParams contains consensus critical parameters that determine the
|
||||
// validity of blocks.
|
||||
message ConsensusParams {
|
||||
BlockParams block = 1 [(gogoproto.nullable) = false];
|
||||
EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
|
||||
ValidatorParams validator = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// BlockParams contains limits on the block size.
|
||||
message BlockParams {
|
||||
// Note: must be greater than 0
|
||||
int64 max_bytes = 1;
|
||||
// Note: must be greater or equal to -1
|
||||
int64 max_gas = 2;
|
||||
// Minimum time increment between consecutive blocks (in milliseconds)
|
||||
// Not exposed to the application.
|
||||
int64 time_iota_ms = 3;
|
||||
}
|
||||
|
||||
// EvidenceParams determine how we handle evidence of malfeasance.
|
||||
message EvidenceParams {
|
||||
// Max age of evidence, in blocks.
|
||||
//
|
||||
// The basic formula for calculating this is: MaxAgeDuration / {average block
|
||||
// time}.
|
||||
int64 max_age_num_blocks = 1;
|
||||
|
||||
// Max age of evidence, in time.
|
||||
//
|
||||
// It should correspond with an app's "unbonding period" or other similar
|
||||
// mechanism for handling [Nothing-At-Stake
|
||||
// attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
|
||||
google.protobuf.Duration max_age_duration = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
|
||||
|
||||
// This sets the maximum number of evidence that can be committed in a single block.
|
||||
// and should fall comfortably under the max block bytes when we consider the size of
|
||||
// each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
|
||||
// Default is 50
|
||||
uint32 max_num = 3;
|
||||
}
|
||||
|
||||
// ValidatorParams restrict the public key types validators can use.
|
||||
// NOTE: uses ABCI pubkey naming, not Amino names.
|
||||
message ValidatorParams {
|
||||
repeated string pub_key_types = 1;
|
||||
}
|
||||
|
||||
// HashedParams is a subset of ConsensusParams.
|
||||
// It is amino encoded and hashed into
|
||||
// the Header.ConsensusHash.
|
||||
message HashedParams {
|
||||
int64 block_max_bytes = 1;
|
||||
int64 block_max_gas = 2;
|
||||
}
|
||||
965
proto/types/types.pb.go
Normal file
965
proto/types/types.pb.go
Normal file
@@ -0,0 +1,965 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/types.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
merkle "github.com/tendermint/tendermint/proto/crypto/merkle"
|
||||
bits "github.com/tendermint/tendermint/proto/libs/bits"
|
||||
version "github.com/tendermint/tendermint/proto/version"
|
||||
math "math"
|
||||
time "time"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
var _ = time.Kitchen
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// BlockIdFlag indicates which BlcokID the signature is for
|
||||
type BlockIDFlag int32
|
||||
|
||||
const (
|
||||
BLOCKD_ID_FLAG_UNKNOWN BlockIDFlag = 0
|
||||
BlockIDFlagAbsent BlockIDFlag = 1
|
||||
BlockIDFlagCommit BlockIDFlag = 2
|
||||
BlockIDFlagNil BlockIDFlag = 3
|
||||
)
|
||||
|
||||
var BlockIDFlag_name = map[int32]string{
|
||||
0: "BLOCKD_ID_FLAG_UNKNOWN",
|
||||
1: "BLOCK_ID_FLAG_ABSENT",
|
||||
2: "BLOCK_ID_FLAG_COMMIT",
|
||||
3: "BLOCK_ID_FLAG_NIL",
|
||||
}
|
||||
|
||||
var BlockIDFlag_value = map[string]int32{
|
||||
"BLOCKD_ID_FLAG_UNKNOWN": 0,
|
||||
"BLOCK_ID_FLAG_ABSENT": 1,
|
||||
"BLOCK_ID_FLAG_COMMIT": 2,
|
||||
"BLOCK_ID_FLAG_NIL": 3,
|
||||
}
|
||||
|
||||
func (BlockIDFlag) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{0}
|
||||
}
|
||||
|
||||
// SignedMsgType is a type of signed message in the consensus.
|
||||
type SignedMsgType int32
|
||||
|
||||
const (
|
||||
SIGNED_MSG_TYPE_UNKNOWN SignedMsgType = 0
|
||||
PrevoteType SignedMsgType = 1
|
||||
PrecommitType SignedMsgType = 2
|
||||
ProposalType SignedMsgType = 3
|
||||
)
|
||||
|
||||
var SignedMsgType_name = map[int32]string{
|
||||
0: "SIGNED_MSG_TYPE_UNKNOWN",
|
||||
1: "PREVOTE_TYPE",
|
||||
2: "PRECOMMIT_TYPE",
|
||||
3: "PROPOSAL_TYPE",
|
||||
}
|
||||
|
||||
var SignedMsgType_value = map[string]int32{
|
||||
"SIGNED_MSG_TYPE_UNKNOWN": 0,
|
||||
"PREVOTE_TYPE": 1,
|
||||
"PRECOMMIT_TYPE": 2,
|
||||
"PROPOSAL_TYPE": 3,
|
||||
}
|
||||
|
||||
func (SignedMsgType) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{1}
|
||||
}
|
||||
|
||||
// PartsetHeader
|
||||
type PartSetHeader struct {
|
||||
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
||||
Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PartSetHeader) Reset() { *m = PartSetHeader{} }
|
||||
func (m *PartSetHeader) String() string { return proto.CompactTextString(m) }
|
||||
func (*PartSetHeader) ProtoMessage() {}
|
||||
func (*PartSetHeader) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{0}
|
||||
}
|
||||
func (m *PartSetHeader) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_PartSetHeader.Unmarshal(m, b)
|
||||
}
|
||||
func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *PartSetHeader) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_PartSetHeader.Merge(m, src)
|
||||
}
|
||||
func (m *PartSetHeader) XXX_Size() int {
|
||||
return xxx_messageInfo_PartSetHeader.Size(m)
|
||||
}
|
||||
func (m *PartSetHeader) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_PartSetHeader.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo
|
||||
|
||||
func (m *PartSetHeader) GetTotal() int64 {
|
||||
if m != nil {
|
||||
return m.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *PartSetHeader) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Part struct {
|
||||
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
|
||||
Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"`
|
||||
Proof merkle.SimpleProof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Part) Reset() { *m = Part{} }
|
||||
func (m *Part) String() string { return proto.CompactTextString(m) }
|
||||
func (*Part) ProtoMessage() {}
|
||||
func (*Part) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{1}
|
||||
}
|
||||
func (m *Part) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Part.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Part) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Part.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Part) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Part.Merge(m, src)
|
||||
}
|
||||
func (m *Part) XXX_Size() int {
|
||||
return xxx_messageInfo_Part.Size(m)
|
||||
}
|
||||
func (m *Part) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Part.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Part proto.InternalMessageInfo
|
||||
|
||||
func (m *Part) GetIndex() uint32 {
|
||||
if m != nil {
|
||||
return m.Index
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Part) GetBytes() []byte {
|
||||
if m != nil {
|
||||
return m.Bytes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Part) GetProof() merkle.SimpleProof {
|
||||
if m != nil {
|
||||
return m.Proof
|
||||
}
|
||||
return merkle.SimpleProof{}
|
||||
}
|
||||
|
||||
// BlockID
|
||||
type BlockID struct {
|
||||
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader,proto3" json:"parts_header"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockID) Reset() { *m = BlockID{} }
|
||||
func (m *BlockID) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockID) ProtoMessage() {}
|
||||
func (*BlockID) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{2}
|
||||
}
|
||||
func (m *BlockID) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockID.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockID.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockID) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockID.Merge(m, src)
|
||||
}
|
||||
func (m *BlockID) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockID.Size(m)
|
||||
}
|
||||
func (m *BlockID) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockID.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockID proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockID) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BlockID) GetPartsHeader() PartSetHeader {
|
||||
if m != nil {
|
||||
return m.PartsHeader
|
||||
}
|
||||
return PartSetHeader{}
|
||||
}
|
||||
|
||||
// Header defines the structure of a Tendermint block header.
|
||||
type Header struct {
|
||||
// basic block info
|
||||
Version version.Consensus `protobuf:"bytes,1,opt,name=version,proto3" json:"version"`
|
||||
ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
|
||||
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"`
|
||||
// prev block info
|
||||
LastBlockID BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"`
|
||||
// hashes of block data
|
||||
LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"`
|
||||
DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"`
|
||||
// hashes from the app output from the prev block
|
||||
ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"`
|
||||
NextValidatorsHash []byte `protobuf:"bytes,9,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"`
|
||||
ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"`
|
||||
AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"`
|
||||
LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"`
|
||||
// consensus info
|
||||
EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"`
|
||||
ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Header) Reset() { *m = Header{} }
|
||||
func (m *Header) String() string { return proto.CompactTextString(m) }
|
||||
func (*Header) ProtoMessage() {}
|
||||
func (*Header) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{3}
|
||||
}
|
||||
func (m *Header) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Header.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Header.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Header) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Header.Merge(m, src)
|
||||
}
|
||||
func (m *Header) XXX_Size() int {
|
||||
return xxx_messageInfo_Header.Size(m)
|
||||
}
|
||||
func (m *Header) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Header.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Header proto.InternalMessageInfo
|
||||
|
||||
func (m *Header) GetVersion() version.Consensus {
|
||||
if m != nil {
|
||||
return m.Version
|
||||
}
|
||||
return version.Consensus{}
|
||||
}
|
||||
|
||||
func (m *Header) GetChainID() string {
|
||||
if m != nil {
|
||||
return m.ChainID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Header) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Header) GetTime() time.Time {
|
||||
if m != nil {
|
||||
return m.Time
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *Header) GetLastBlockID() BlockID {
|
||||
if m != nil {
|
||||
return m.LastBlockID
|
||||
}
|
||||
return BlockID{}
|
||||
}
|
||||
|
||||
func (m *Header) GetLastCommitHash() []byte {
|
||||
if m != nil {
|
||||
return m.LastCommitHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetDataHash() []byte {
|
||||
if m != nil {
|
||||
return m.DataHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetValidatorsHash() []byte {
|
||||
if m != nil {
|
||||
return m.ValidatorsHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetNextValidatorsHash() []byte {
|
||||
if m != nil {
|
||||
return m.NextValidatorsHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetConsensusHash() []byte {
|
||||
if m != nil {
|
||||
return m.ConsensusHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetAppHash() []byte {
|
||||
if m != nil {
|
||||
return m.AppHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetLastResultsHash() []byte {
|
||||
if m != nil {
|
||||
return m.LastResultsHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetEvidenceHash() []byte {
|
||||
if m != nil {
|
||||
return m.EvidenceHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Header) GetProposerAddress() []byte {
|
||||
if m != nil {
|
||||
return m.ProposerAddress
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Data contains the set of transactions included in the block
|
||||
type Data struct {
|
||||
// Txs that will be applied by state @ block.Height+1.
|
||||
// NOTE: not all txs here are valid. We're just agreeing on the order first.
|
||||
// This means that block.AppHash does not include these txs.
|
||||
Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"`
|
||||
// Volatile
|
||||
Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Data) Reset() { *m = Data{} }
|
||||
func (m *Data) String() string { return proto.CompactTextString(m) }
|
||||
func (*Data) ProtoMessage() {}
|
||||
func (*Data) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{4}
|
||||
}
|
||||
func (m *Data) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Data.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Data.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Data) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Data.Merge(m, src)
|
||||
}
|
||||
func (m *Data) XXX_Size() int {
|
||||
return xxx_messageInfo_Data.Size(m)
|
||||
}
|
||||
func (m *Data) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Data.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Data proto.InternalMessageInfo
|
||||
|
||||
func (m *Data) GetTxs() [][]byte {
|
||||
if m != nil {
|
||||
return m.Txs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Data) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Vote represents a prevote, precommit, or commit vote from validators for
|
||||
// consensus.
|
||||
type Vote struct {
|
||||
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.proto.types.SignedMsgType" json:"type,omitempty"`
|
||||
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int64 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
|
||||
BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
|
||||
ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
|
||||
ValidatorIndex int64 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"`
|
||||
Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Vote) Reset() { *m = Vote{} }
|
||||
func (m *Vote) String() string { return proto.CompactTextString(m) }
|
||||
func (*Vote) ProtoMessage() {}
|
||||
func (*Vote) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{5}
|
||||
}
|
||||
func (m *Vote) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Vote.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Vote) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Vote.Merge(m, src)
|
||||
}
|
||||
func (m *Vote) XXX_Size() int {
|
||||
return xxx_messageInfo_Vote.Size(m)
|
||||
}
|
||||
func (m *Vote) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Vote.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Vote proto.InternalMessageInfo
|
||||
|
||||
func (m *Vote) GetType() SignedMsgType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return SIGNED_MSG_TYPE_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *Vote) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Vote) GetRound() int64 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Vote) GetBlockID() BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return BlockID{}
|
||||
}
|
||||
|
||||
func (m *Vote) GetTimestamp() time.Time {
|
||||
if m != nil {
|
||||
return m.Timestamp
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *Vote) GetValidatorAddress() []byte {
|
||||
if m != nil {
|
||||
return m.ValidatorAddress
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Vote) GetValidatorIndex() int64 {
|
||||
if m != nil {
|
||||
return m.ValidatorIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Vote) GetSignature() []byte {
|
||||
if m != nil {
|
||||
return m.Signature
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Commit contains the evidence that a block was committed by a set of validators.
|
||||
type Commit struct {
|
||||
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
|
||||
BlockID BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
Signatures []CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"`
|
||||
Hash []byte `protobuf:"bytes,5,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
BitArray *bits.BitArray `protobuf:"bytes,6,opt,name=bit_array,json=bitArray,proto3" json:"bit_array,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Commit) Reset() { *m = Commit{} }
|
||||
func (m *Commit) String() string { return proto.CompactTextString(m) }
|
||||
func (*Commit) ProtoMessage() {}
|
||||
func (*Commit) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{6}
|
||||
}
|
||||
func (m *Commit) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Commit.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Commit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Commit.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Commit) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Commit.Merge(m, src)
|
||||
}
|
||||
func (m *Commit) XXX_Size() int {
|
||||
return xxx_messageInfo_Commit.Size(m)
|
||||
}
|
||||
func (m *Commit) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Commit.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Commit proto.InternalMessageInfo
|
||||
|
||||
func (m *Commit) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Commit) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Commit) GetBlockID() BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return BlockID{}
|
||||
}
|
||||
|
||||
func (m *Commit) GetSignatures() []CommitSig {
|
||||
if m != nil {
|
||||
return m.Signatures
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Commit) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Commit) GetBitArray() *bits.BitArray {
|
||||
if m != nil {
|
||||
return m.BitArray
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommitSig is a part of the Vote included in a Commit.
|
||||
type CommitSig struct {
|
||||
BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.proto.types.BlockIDFlag" json:"block_id_flag,omitempty"`
|
||||
ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
|
||||
Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
|
||||
Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CommitSig) Reset() { *m = CommitSig{} }
|
||||
func (m *CommitSig) String() string { return proto.CompactTextString(m) }
|
||||
func (*CommitSig) ProtoMessage() {}
|
||||
func (*CommitSig) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{7}
|
||||
}
|
||||
func (m *CommitSig) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CommitSig.Unmarshal(m, b)
|
||||
}
|
||||
func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_CommitSig.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *CommitSig) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_CommitSig.Merge(m, src)
|
||||
}
|
||||
func (m *CommitSig) XXX_Size() int {
|
||||
return xxx_messageInfo_CommitSig.Size(m)
|
||||
}
|
||||
func (m *CommitSig) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_CommitSig.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_CommitSig proto.InternalMessageInfo
|
||||
|
||||
func (m *CommitSig) GetBlockIdFlag() BlockIDFlag {
|
||||
if m != nil {
|
||||
return m.BlockIdFlag
|
||||
}
|
||||
return BLOCKD_ID_FLAG_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *CommitSig) GetValidatorAddress() []byte {
|
||||
if m != nil {
|
||||
return m.ValidatorAddress
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CommitSig) GetTimestamp() time.Time {
|
||||
if m != nil {
|
||||
return m.Timestamp
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *CommitSig) GetSignature() []byte {
|
||||
if m != nil {
|
||||
return m.Signature
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Proposal struct {
|
||||
Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.proto.types.SignedMsgType" json:"type,omitempty"`
|
||||
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"`
|
||||
PolRound int32 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"`
|
||||
BlockID BlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
|
||||
Signature []byte `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Proposal) Reset() { *m = Proposal{} }
|
||||
func (m *Proposal) String() string { return proto.CompactTextString(m) }
|
||||
func (*Proposal) ProtoMessage() {}
|
||||
func (*Proposal) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{8}
|
||||
}
|
||||
func (m *Proposal) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Proposal.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Proposal.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Proposal) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Proposal.Merge(m, src)
|
||||
}
|
||||
func (m *Proposal) XXX_Size() int {
|
||||
return xxx_messageInfo_Proposal.Size(m)
|
||||
}
|
||||
func (m *Proposal) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Proposal.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Proposal proto.InternalMessageInfo
|
||||
|
||||
func (m *Proposal) GetType() SignedMsgType {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return SIGNED_MSG_TYPE_UNKNOWN
|
||||
}
|
||||
|
||||
func (m *Proposal) GetHeight() int64 {
|
||||
if m != nil {
|
||||
return m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Proposal) GetRound() int32 {
|
||||
if m != nil {
|
||||
return m.Round
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Proposal) GetPolRound() int32 {
|
||||
if m != nil {
|
||||
return m.PolRound
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Proposal) GetBlockID() BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return BlockID{}
|
||||
}
|
||||
|
||||
func (m *Proposal) GetTimestamp() time.Time {
|
||||
if m != nil {
|
||||
return m.Timestamp
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (m *Proposal) GetSignature() []byte {
|
||||
if m != nil {
|
||||
return m.Signature
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SignedHeader struct {
|
||||
Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
|
||||
Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SignedHeader) Reset() { *m = SignedHeader{} }
|
||||
func (m *SignedHeader) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignedHeader) ProtoMessage() {}
|
||||
func (*SignedHeader) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{9}
|
||||
}
|
||||
func (m *SignedHeader) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignedHeader.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *SignedHeader) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SignedHeader.Merge(m, src)
|
||||
}
|
||||
func (m *SignedHeader) XXX_Size() int {
|
||||
return xxx_messageInfo_SignedHeader.Size(m)
|
||||
}
|
||||
func (m *SignedHeader) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SignedHeader.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SignedHeader proto.InternalMessageInfo
|
||||
|
||||
func (m *SignedHeader) GetHeader() *Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *SignedHeader) GetCommit() *Commit {
|
||||
if m != nil {
|
||||
return m.Commit
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BlockMeta struct {
|
||||
BlockID BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id"`
|
||||
BlockSize int64 `protobuf:"varint,2,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"`
|
||||
Header Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header"`
|
||||
NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlockMeta) Reset() { *m = BlockMeta{} }
|
||||
func (m *BlockMeta) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockMeta) ProtoMessage() {}
|
||||
func (*BlockMeta) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ff06f8095857fb18, []int{10}
|
||||
}
|
||||
func (m *BlockMeta) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_BlockMeta.Unmarshal(m, b)
|
||||
}
|
||||
func (m *BlockMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BlockMeta.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *BlockMeta) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockMeta.Merge(m, src)
|
||||
}
|
||||
func (m *BlockMeta) XXX_Size() int {
|
||||
return xxx_messageInfo_BlockMeta.Size(m)
|
||||
}
|
||||
func (m *BlockMeta) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockMeta.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_BlockMeta proto.InternalMessageInfo
|
||||
|
||||
func (m *BlockMeta) GetBlockID() BlockID {
|
||||
if m != nil {
|
||||
return m.BlockID
|
||||
}
|
||||
return BlockID{}
|
||||
}
|
||||
|
||||
func (m *BlockMeta) GetBlockSize() int64 {
|
||||
if m != nil {
|
||||
return m.BlockSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *BlockMeta) GetHeader() Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return Header{}
|
||||
}
|
||||
|
||||
func (m *BlockMeta) GetNumTxs() int64 {
|
||||
if m != nil {
|
||||
return m.NumTxs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("tendermint.proto.types.BlockIDFlag", BlockIDFlag_name, BlockIDFlag_value)
|
||||
proto.RegisterEnum("tendermint.proto.types.SignedMsgType", SignedMsgType_name, SignedMsgType_value)
|
||||
proto.RegisterType((*PartSetHeader)(nil), "tendermint.proto.types.PartSetHeader")
|
||||
proto.RegisterType((*Part)(nil), "tendermint.proto.types.Part")
|
||||
proto.RegisterType((*BlockID)(nil), "tendermint.proto.types.BlockID")
|
||||
proto.RegisterType((*Header)(nil), "tendermint.proto.types.Header")
|
||||
proto.RegisterType((*Data)(nil), "tendermint.proto.types.Data")
|
||||
proto.RegisterType((*Vote)(nil), "tendermint.proto.types.Vote")
|
||||
proto.RegisterType((*Commit)(nil), "tendermint.proto.types.Commit")
|
||||
proto.RegisterType((*CommitSig)(nil), "tendermint.proto.types.CommitSig")
|
||||
proto.RegisterType((*Proposal)(nil), "tendermint.proto.types.Proposal")
|
||||
proto.RegisterType((*SignedHeader)(nil), "tendermint.proto.types.SignedHeader")
|
||||
proto.RegisterType((*BlockMeta)(nil), "tendermint.proto.types.BlockMeta")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/types.proto", fileDescriptor_ff06f8095857fb18) }
|
||||
|
||||
var fileDescriptor_ff06f8095857fb18 = []byte{
|
||||
// 1274 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6e, 0xdb, 0xc6,
|
||||
0x13, 0x37, 0x25, 0xca, 0x92, 0x86, 0x92, 0x2d, 0xf3, 0xef, 0x7f, 0xa2, 0xca, 0xad, 0xa5, 0xc8,
|
||||
0x4d, 0xea, 0x7c, 0x80, 0x2a, 0x5c, 0xa0, 0x68, 0x80, 0x5e, 0x24, 0xdb, 0x71, 0x84, 0xd8, 0xb2,
|
||||
0x40, 0xa9, 0xe9, 0xc7, 0x85, 0x58, 0x89, 0x1b, 0x8a, 0x08, 0x45, 0x12, 0xdc, 0x95, 0x61, 0xa7,
|
||||
0x40, 0x81, 0xde, 0x0a, 0x9f, 0xfa, 0x02, 0x3e, 0xa5, 0x05, 0xfa, 0x16, 0xed, 0xb1, 0xa7, 0x3e,
|
||||
0x42, 0x0a, 0xa4, 0xaf, 0xd0, 0x07, 0x28, 0xf6, 0x83, 0x94, 0x14, 0xd9, 0x6d, 0xd0, 0xa4, 0x17,
|
||||
0x9b, 0x3b, 0xf3, 0x9b, 0xd9, 0x9d, 0xdf, 0xfc, 0x66, 0xd7, 0x86, 0xeb, 0x61, 0x14, 0xd0, 0xa0,
|
||||
0x41, 0xcf, 0x42, 0x4c, 0xc4, 0x4f, 0x83, 0x5b, 0xf4, 0x6b, 0x14, 0xfb, 0x36, 0x8e, 0xc6, 0xae,
|
||||
0x4f, 0x85, 0xc5, 0xe0, 0xde, 0xca, 0x2d, 0x3a, 0x72, 0x23, 0xdb, 0x0a, 0x51, 0x44, 0xcf, 0x1a,
|
||||
0x22, 0xd8, 0x09, 0x9c, 0x60, 0xfa, 0x25, 0xd0, 0x95, 0xaa, 0x13, 0x04, 0x8e, 0x87, 0x05, 0x64,
|
||||
0x30, 0x79, 0xd2, 0xa0, 0xee, 0x18, 0x13, 0x8a, 0xc6, 0xa1, 0x04, 0x6c, 0x88, 0x10, 0xcf, 0x1d,
|
||||
0x90, 0xc6, 0xc0, 0xa5, 0x73, 0xbb, 0x57, 0xaa, 0xc2, 0x39, 0x8c, 0xce, 0x42, 0x1a, 0x34, 0xc6,
|
||||
0x38, 0x7a, 0xea, 0xe1, 0x39, 0x80, 0x8c, 0x3e, 0xc1, 0x11, 0x71, 0x03, 0x3f, 0xfe, 0x2d, 0x9c,
|
||||
0xf5, 0xfb, 0x50, 0xec, 0xa2, 0x88, 0xf6, 0x30, 0x7d, 0x88, 0x91, 0x8d, 0x23, 0x7d, 0x1d, 0x32,
|
||||
0x34, 0xa0, 0xc8, 0x2b, 0x2b, 0x35, 0x65, 0x3b, 0x6d, 0x8a, 0x85, 0xae, 0x83, 0x3a, 0x42, 0x64,
|
||||
0x54, 0x4e, 0xd5, 0x94, 0xed, 0x82, 0xc9, 0xbf, 0xeb, 0x5f, 0x83, 0xca, 0x42, 0x59, 0x84, 0xeb,
|
||||
0xdb, 0xf8, 0x94, 0x47, 0x14, 0x4d, 0xb1, 0x60, 0xd6, 0xc1, 0x19, 0xc5, 0x44, 0x86, 0x88, 0x85,
|
||||
0x7e, 0x00, 0x99, 0x30, 0x0a, 0x82, 0x27, 0xe5, 0x74, 0x4d, 0xd9, 0xd6, 0x76, 0xee, 0x1a, 0x0b,
|
||||
0xd4, 0x89, 0x3a, 0x0c, 0x51, 0x87, 0xd1, 0x73, 0xc7, 0xa1, 0x87, 0xbb, 0x2c, 0xa4, 0xa5, 0xfe,
|
||||
0xfa, 0xa2, 0xba, 0x64, 0x8a, 0xf8, 0xfa, 0x18, 0xb2, 0x2d, 0x2f, 0x18, 0x3e, 0x6d, 0xef, 0x25,
|
||||
0x67, 0x53, 0xa6, 0x67, 0xd3, 0x3b, 0x50, 0x60, 0xb4, 0x13, 0x6b, 0xc4, 0xab, 0xe2, 0x87, 0xd0,
|
||||
0x76, 0x6e, 0x1a, 0x97, 0x77, 0xca, 0x98, 0xa3, 0x40, 0x6e, 0xa4, 0xf1, 0x04, 0xc2, 0x54, 0xff,
|
||||
0x36, 0x03, 0xcb, 0x92, 0xa0, 0x5d, 0xc8, 0x4a, 0x0a, 0xf9, 0x8e, 0xda, 0xce, 0xd6, 0x62, 0xd6,
|
||||
0x98, 0xe3, 0xdd, 0xc0, 0x27, 0xd8, 0x27, 0x13, 0x22, 0x73, 0xc6, 0x91, 0xfa, 0x2d, 0xc8, 0x0d,
|
||||
0x47, 0xc8, 0xf5, 0x2d, 0xd7, 0xe6, 0x67, 0xcb, 0xb7, 0xb4, 0x97, 0x2f, 0xaa, 0xd9, 0x5d, 0x66,
|
||||
0x6b, 0xef, 0x99, 0x59, 0xee, 0x6c, 0xdb, 0xfa, 0x35, 0x58, 0x1e, 0x61, 0xd7, 0x19, 0x51, 0x4e,
|
||||
0x58, 0xda, 0x94, 0x2b, 0xfd, 0x13, 0x50, 0x99, 0x48, 0xca, 0x2a, 0x3f, 0x41, 0xc5, 0x10, 0x0a,
|
||||
0x32, 0x62, 0x05, 0x19, 0xfd, 0x58, 0x41, 0xad, 0x1c, 0xdb, 0xf8, 0xfb, 0xdf, 0xab, 0x8a, 0xc9,
|
||||
0x23, 0xf4, 0x2f, 0xa0, 0xe8, 0x21, 0x42, 0xad, 0x01, 0x63, 0x8f, 0x6d, 0x9f, 0xe1, 0x29, 0xaa,
|
||||
0x57, 0x51, 0x23, 0x59, 0x6e, 0xfd, 0x8f, 0xe5, 0x79, 0xf9, 0xa2, 0xaa, 0x1d, 0x22, 0x42, 0xa5,
|
||||
0xd1, 0xd4, 0xbc, 0x64, 0x61, 0xeb, 0xdb, 0x50, 0xe2, 0x99, 0x87, 0xc1, 0x78, 0xec, 0x52, 0x8b,
|
||||
0xf7, 0x64, 0x99, 0xf7, 0x64, 0x85, 0xd9, 0x77, 0xb9, 0xf9, 0x21, 0xeb, 0xce, 0x06, 0xe4, 0x6d,
|
||||
0x44, 0x91, 0x80, 0x64, 0x39, 0x24, 0xc7, 0x0c, 0xdc, 0xf9, 0x01, 0xac, 0x9e, 0x20, 0xcf, 0xb5,
|
||||
0x11, 0x0d, 0x22, 0x22, 0x20, 0x39, 0x91, 0x65, 0x6a, 0xe6, 0xc0, 0x0f, 0x61, 0xdd, 0xc7, 0xa7,
|
||||
0xd4, 0x7a, 0x15, 0x9d, 0xe7, 0x68, 0x9d, 0xf9, 0x1e, 0xcf, 0x47, 0xdc, 0x84, 0x95, 0x61, 0xdc,
|
||||
0x11, 0x81, 0x05, 0x8e, 0x2d, 0x26, 0x56, 0x0e, 0x7b, 0x07, 0x72, 0x28, 0x0c, 0x05, 0x40, 0xe3,
|
||||
0x80, 0x2c, 0x0a, 0x43, 0xee, 0xba, 0x03, 0x6b, 0xbc, 0xc6, 0x08, 0x93, 0x89, 0x47, 0x65, 0x92,
|
||||
0x02, 0xc7, 0xac, 0x32, 0x87, 0x29, 0xec, 0x1c, 0xbb, 0x05, 0x45, 0x7c, 0xe2, 0xda, 0xd8, 0x1f,
|
||||
0x62, 0x81, 0x2b, 0x72, 0x5c, 0x21, 0x36, 0x72, 0xd0, 0x6d, 0x28, 0x85, 0x51, 0x10, 0x06, 0x04,
|
||||
0x47, 0x16, 0xb2, 0xed, 0x08, 0x13, 0x52, 0x5e, 0x11, 0xf9, 0x62, 0x7b, 0x53, 0x98, 0xeb, 0xf7,
|
||||
0x40, 0xdd, 0x43, 0x14, 0xe9, 0x25, 0x48, 0xd3, 0x53, 0x52, 0x56, 0x6a, 0xe9, 0xed, 0x82, 0xc9,
|
||||
0x3e, 0x2f, 0x9d, 0xce, 0x3f, 0x53, 0xa0, 0x3e, 0x0e, 0x28, 0xd6, 0xef, 0x83, 0xca, 0x3a, 0xc9,
|
||||
0xc5, 0xba, 0x72, 0xf5, 0x08, 0xf4, 0x5c, 0xc7, 0xc7, 0xf6, 0x11, 0x71, 0xfa, 0x67, 0x21, 0x36,
|
||||
0x79, 0xc8, 0x8c, 0xfa, 0x52, 0x73, 0xea, 0x5b, 0x87, 0x4c, 0x14, 0x4c, 0x7c, 0x5b, 0x8a, 0x52,
|
||||
0x2c, 0xf4, 0x47, 0x90, 0x4b, 0x44, 0xa5, 0xbe, 0x9e, 0xa8, 0x56, 0xa5, 0xa8, 0xe2, 0x59, 0x36,
|
||||
0xb3, 0x03, 0x29, 0xa6, 0x16, 0xe4, 0x93, 0x5b, 0x50, 0x4a, 0xf4, 0xf5, 0x54, 0x3e, 0x0d, 0xd3,
|
||||
0xef, 0xc2, 0x5a, 0xa2, 0x8d, 0x84, 0x5c, 0xa1, 0xc8, 0x52, 0xe2, 0x90, 0xec, 0xce, 0xc9, 0xce,
|
||||
0x12, 0xf7, 0x59, 0x96, 0x57, 0x37, 0x95, 0x5d, 0x9b, 0x5f, 0x6c, 0xef, 0x42, 0x9e, 0xb8, 0x8e,
|
||||
0x8f, 0xe8, 0x24, 0xc2, 0x52, 0x99, 0x53, 0x43, 0xfd, 0x79, 0x0a, 0x96, 0x85, 0xd2, 0x67, 0xd8,
|
||||
0x53, 0x2e, 0x67, 0x8f, 0x91, 0x9a, 0xb9, 0x8c, 0xbd, 0xf4, 0x9b, 0xb2, 0x77, 0x00, 0x90, 0x1c,
|
||||
0x89, 0x94, 0xd5, 0x5a, 0x7a, 0x5b, 0xdb, 0xb9, 0x71, 0x55, 0x3a, 0x71, 0xdc, 0x9e, 0xeb, 0xc8,
|
||||
0x4b, 0x6a, 0x26, 0x34, 0x51, 0x56, 0x66, 0xe6, 0x6e, 0x6d, 0x42, 0x7e, 0xe0, 0x52, 0x0b, 0x45,
|
||||
0x11, 0x3a, 0xe3, 0x74, 0x6a, 0x3b, 0xef, 0x2f, 0xe6, 0x66, 0x8f, 0x95, 0xc1, 0x1e, 0x2b, 0xa3,
|
||||
0xe5, 0xd2, 0x26, 0xc3, 0x9a, 0xb9, 0x81, 0xfc, 0xaa, 0xff, 0xa1, 0x40, 0x3e, 0xd9, 0x56, 0x3f,
|
||||
0x80, 0x62, 0x5c, 0xba, 0xf5, 0xc4, 0x43, 0x8e, 0x94, 0xea, 0xd6, 0x3f, 0xd4, 0xff, 0xc0, 0x43,
|
||||
0x8e, 0xa9, 0xc9, 0x92, 0xd9, 0xe2, 0xf2, 0x86, 0xa7, 0xae, 0x68, 0xf8, 0x9c, 0xc2, 0xd2, 0xff,
|
||||
0x4e, 0x61, 0x73, 0x5a, 0x50, 0x5f, 0xd5, 0xc2, 0xcf, 0x29, 0xc8, 0x75, 0xf9, 0x10, 0x23, 0xef,
|
||||
0x3f, 0x1f, 0xc3, 0x44, 0x48, 0x1b, 0x90, 0x0f, 0x03, 0xcf, 0x12, 0x1e, 0x95, 0x7b, 0x72, 0x61,
|
||||
0xe0, 0x99, 0x0b, 0x2a, 0xcb, 0xbc, 0xd5, 0x19, 0x5d, 0x7e, 0x0b, 0x0c, 0x66, 0x5f, 0x65, 0xf0,
|
||||
0x1b, 0x28, 0x08, 0x42, 0xe4, 0xdb, 0xfb, 0x31, 0x63, 0x82, 0x3f, 0xe8, 0xe2, 0xe9, 0xdd, 0xbc,
|
||||
0xea, 0xf0, 0x02, 0x6f, 0x4a, 0x34, 0x8b, 0x13, 0xaf, 0x92, 0xfc, 0x43, 0x60, 0xf3, 0xef, 0x67,
|
||||
0xc1, 0x94, 0xe8, 0xfa, 0x6f, 0x0a, 0xe4, 0x79, 0xd9, 0x47, 0x98, 0xa2, 0x39, 0xf2, 0x94, 0x37,
|
||||
0x25, 0xef, 0x3d, 0x00, 0x91, 0x8c, 0xb8, 0xcf, 0xb0, 0x6c, 0x6c, 0x9e, 0x5b, 0x7a, 0xee, 0x33,
|
||||
0xac, 0x7f, 0x9a, 0x54, 0x9a, 0x7e, 0x9d, 0x4a, 0xe5, 0xe8, 0xc6, 0xf5, 0x5e, 0x87, 0xac, 0x3f,
|
||||
0x19, 0x5b, 0xec, 0x99, 0x50, 0x85, 0x64, 0xfc, 0xc9, 0xb8, 0x7f, 0x4a, 0xee, 0xfc, 0xa2, 0x80,
|
||||
0x36, 0x33, 0x3e, 0x7a, 0x05, 0xae, 0xb5, 0x0e, 0x8f, 0x77, 0x1f, 0xed, 0x59, 0xed, 0x3d, 0xeb,
|
||||
0xc1, 0x61, 0xf3, 0xc0, 0xfa, 0xac, 0xf3, 0xa8, 0x73, 0xfc, 0x79, 0xa7, 0xb4, 0xa4, 0x37, 0x60,
|
||||
0x9d, 0xfb, 0x12, 0x57, 0xb3, 0xd5, 0xdb, 0xef, 0xf4, 0x4b, 0x4a, 0xe5, 0xff, 0xe7, 0x17, 0xb5,
|
||||
0xb5, 0x99, 0x34, 0xcd, 0x01, 0xc1, 0x3e, 0x5d, 0x0c, 0xd8, 0x3d, 0x3e, 0x3a, 0x6a, 0xf7, 0x4b,
|
||||
0xa9, 0x85, 0x00, 0x79, 0x43, 0xde, 0x86, 0xb5, 0xf9, 0x80, 0x4e, 0xfb, 0xb0, 0x94, 0xae, 0xe8,
|
||||
0xe7, 0x17, 0xb5, 0x95, 0x19, 0x74, 0xc7, 0xf5, 0x2a, 0xb9, 0xef, 0x9e, 0x6f, 0x2e, 0xfd, 0xf4,
|
||||
0xc3, 0xe6, 0xd2, 0x9d, 0x1f, 0x15, 0x28, 0xce, 0x4d, 0x89, 0xbe, 0x01, 0xd7, 0x7b, 0xed, 0x83,
|
||||
0xce, 0xfe, 0x9e, 0x75, 0xd4, 0x3b, 0xb0, 0xfa, 0x5f, 0x76, 0xf7, 0x67, 0xaa, 0xb8, 0x01, 0x85,
|
||||
0xae, 0xb9, 0xff, 0xf8, 0xb8, 0xbf, 0xcf, 0x3d, 0x25, 0xa5, 0xb2, 0x7a, 0x7e, 0x51, 0xd3, 0xba,
|
||||
0x11, 0x3e, 0x09, 0x28, 0xe6, 0xf1, 0x37, 0x61, 0xa5, 0x6b, 0xee, 0x8b, 0xc3, 0x0a, 0x50, 0xaa,
|
||||
0xb2, 0x76, 0x7e, 0x51, 0x2b, 0x76, 0x23, 0x2c, 0x84, 0xc0, 0x61, 0x5b, 0x50, 0xec, 0x9a, 0xc7,
|
||||
0xdd, 0xe3, 0x5e, 0xf3, 0x50, 0xa0, 0xd2, 0x95, 0xd2, 0xf9, 0x45, 0xad, 0x10, 0x8f, 0x38, 0x03,
|
||||
0x4d, 0xcf, 0xd9, 0x32, 0xbe, 0xba, 0xe7, 0xb8, 0x74, 0x34, 0x19, 0x18, 0xc3, 0x60, 0xdc, 0x98,
|
||||
0x76, 0x6f, 0xf6, 0x73, 0xe6, 0x3f, 0x8a, 0xc1, 0x32, 0x5f, 0x7c, 0xf4, 0x57, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xfb, 0xb3, 0xf9, 0x43, 0x67, 0x0c, 0x00, 0x00,
|
||||
}
|
||||
146
proto/types/types.proto
Normal file
146
proto/types/types.proto
Normal file
@@ -0,0 +1,146 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "proto/libs/bits/types.proto";
|
||||
import "proto/crypto/merkle/types.proto";
|
||||
import "proto/version/version.proto";
|
||||
|
||||
// BlockIdFlag indicates which BlcokID the signature is for
|
||||
enum BlockIDFlag {
|
||||
option (gogoproto.goproto_enum_stringer) = false;
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
BLOCKD_ID_FLAG_UNKNOWN = 0;
|
||||
BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
|
||||
BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
|
||||
BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
|
||||
}
|
||||
|
||||
// SignedMsgType is a type of signed message in the consensus.
|
||||
enum SignedMsgType {
|
||||
option (gogoproto.goproto_enum_stringer) = false;
|
||||
option (gogoproto.goproto_enum_prefix) = false;
|
||||
|
||||
SIGNED_MSG_TYPE_UNKNOWN = 0;
|
||||
PREVOTE_TYPE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
|
||||
PRECOMMIT_TYPE = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];
|
||||
PROPOSAL_TYPE = 3 [(gogoproto.enumvalue_customname) = "ProposalType"];
|
||||
}
|
||||
|
||||
// PartsetHeader
|
||||
message PartSetHeader {
|
||||
int64 total = 1;
|
||||
bytes hash = 2;
|
||||
}
|
||||
|
||||
message Part {
|
||||
uint32 index = 1;
|
||||
bytes bytes = 2;
|
||||
tendermint.proto.crypto.merkle.SimpleProof proof = 3 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// BlockID
|
||||
message BlockID {
|
||||
bytes hash = 1;
|
||||
PartSetHeader parts_header = 2 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
// Header defines the structure of a Tendermint block header.
|
||||
message Header {
|
||||
// basic block info
|
||||
tendermint.proto.version.Consensus version = 1 [(gogoproto.nullable) = false];
|
||||
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
|
||||
int64 height = 3;
|
||||
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
|
||||
// prev block info
|
||||
BlockID last_block_id = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"];
|
||||
|
||||
// hashes of block data
|
||||
bytes last_commit_hash = 6; // commit from validators from the last block
|
||||
bytes data_hash = 7; // transactions
|
||||
|
||||
// hashes from the app output from the prev block
|
||||
bytes validators_hash = 8; // validators for the current block
|
||||
bytes next_validators_hash = 9; // validators for the next block
|
||||
bytes consensus_hash = 10; // consensus params for current block
|
||||
bytes app_hash = 11; // state after txs from the previous block
|
||||
bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
|
||||
|
||||
// consensus info
|
||||
bytes evidence_hash = 13; // evidence included in the block
|
||||
bytes proposer_address = 14; // original proposer of the block
|
||||
}
|
||||
|
||||
// Data contains the set of transactions included in the block
|
||||
message Data {
|
||||
// Txs that will be applied by state @ block.Height+1.
|
||||
// NOTE: not all txs here are valid. We're just agreeing on the order first.
|
||||
// This means that block.AppHash does not include these txs.
|
||||
repeated bytes txs = 1;
|
||||
// Volatile
|
||||
bytes hash = 2;
|
||||
}
|
||||
|
||||
// Vote represents a prevote, precommit, or commit vote from validators for
|
||||
// consensus.
|
||||
message Vote {
|
||||
SignedMsgType type = 1;
|
||||
int64 height = 2;
|
||||
int64 round = 3;
|
||||
BlockID block_id = 4
|
||||
[(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil.
|
||||
google.protobuf.Timestamp timestamp = 5
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes validator_address = 6;
|
||||
int64 validator_index = 7;
|
||||
bytes signature = 8;
|
||||
}
|
||||
|
||||
// Commit contains the evidence that a block was committed by a set of validators.
|
||||
message Commit {
|
||||
int64 height = 1;
|
||||
int32 round = 2;
|
||||
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
|
||||
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
|
||||
bytes hash = 5;
|
||||
tendermint.proto.libs.bits.BitArray bit_array = 6;
|
||||
}
|
||||
|
||||
// CommitSig is a part of the Vote included in a Commit.
|
||||
message CommitSig {
|
||||
BlockIDFlag block_id_flag = 1;
|
||||
bytes validator_address = 2;
|
||||
google.protobuf.Timestamp timestamp = 3
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes signature = 4;
|
||||
}
|
||||
|
||||
message Proposal {
|
||||
SignedMsgType type = 1;
|
||||
int64 height = 2;
|
||||
int32 round = 3;
|
||||
int32 pol_round = 4;
|
||||
BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
|
||||
google.protobuf.Timestamp timestamp = 6
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
|
||||
bytes signature = 7;
|
||||
}
|
||||
|
||||
message SignedHeader {
|
||||
Header header = 1;
|
||||
Commit commit = 2;
|
||||
}
|
||||
|
||||
message BlockMeta {
|
||||
BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
|
||||
int64 block_size = 2;
|
||||
Header header = 3 [(gogoproto.nullable) = false];
|
||||
int64 num_txs = 4;
|
||||
}
|
||||
171
proto/types/validator.pb.go
Normal file
171
proto/types/validator.pb.go
Normal file
@@ -0,0 +1,171 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/types/validator.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
keys "github.com/tendermint/tendermint/proto/crypto/keys"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type ValidatorSet struct {
|
||||
Validators []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"`
|
||||
Proposer *Validator `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"`
|
||||
TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ValidatorSet) Reset() { *m = ValidatorSet{} }
|
||||
func (m *ValidatorSet) String() string { return proto.CompactTextString(m) }
|
||||
func (*ValidatorSet) ProtoMessage() {}
|
||||
func (*ValidatorSet) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2e7c6b38c20e5406, []int{0}
|
||||
}
|
||||
func (m *ValidatorSet) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ValidatorSet.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ValidatorSet) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ValidatorSet.Merge(m, src)
|
||||
}
|
||||
func (m *ValidatorSet) XXX_Size() int {
|
||||
return xxx_messageInfo_ValidatorSet.Size(m)
|
||||
}
|
||||
func (m *ValidatorSet) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ValidatorSet.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo
|
||||
|
||||
func (m *ValidatorSet) GetValidators() []*Validator {
|
||||
if m != nil {
|
||||
return m.Validators
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ValidatorSet) GetProposer() *Validator {
|
||||
if m != nil {
|
||||
return m.Proposer
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ValidatorSet) GetTotalVotingPower() int64 {
|
||||
if m != nil {
|
||||
return m.TotalVotingPower
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Validator struct {
|
||||
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||
PubKey keys.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
|
||||
VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
|
||||
ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Validator) Reset() { *m = Validator{} }
|
||||
func (m *Validator) String() string { return proto.CompactTextString(m) }
|
||||
func (*Validator) ProtoMessage() {}
|
||||
func (*Validator) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2e7c6b38c20e5406, []int{1}
|
||||
}
|
||||
func (m *Validator) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Validator.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Validator.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Validator) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Validator.Merge(m, src)
|
||||
}
|
||||
func (m *Validator) XXX_Size() int {
|
||||
return xxx_messageInfo_Validator.Size(m)
|
||||
}
|
||||
func (m *Validator) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Validator.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Validator proto.InternalMessageInfo
|
||||
|
||||
func (m *Validator) GetAddress() []byte {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Validator) GetPubKey() keys.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return keys.PublicKey{}
|
||||
}
|
||||
|
||||
func (m *Validator) GetVotingPower() int64 {
|
||||
if m != nil {
|
||||
return m.VotingPower
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Validator) GetProposerPriority() int64 {
|
||||
if m != nil {
|
||||
return m.ProposerPriority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ValidatorSet)(nil), "tendermint.proto.types.ValidatorSet")
|
||||
proto.RegisterType((*Validator)(nil), "tendermint.proto.types.Validator")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/types/validator.proto", fileDescriptor_2e7c6b38c20e5406) }
|
||||
|
||||
var fileDescriptor_2e7c6b38c20e5406 = []byte{
|
||||
// 325 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbd, 0x4e, 0x02, 0x41,
|
||||
0x10, 0xc7, 0x5d, 0x21, 0xa0, 0x0b, 0x85, 0x6e, 0x61, 0x2e, 0x18, 0x23, 0x50, 0x28, 0x89, 0x64,
|
||||
0x2f, 0xd1, 0xda, 0x42, 0x0a, 0x1b, 0x1a, 0x72, 0x26, 0x14, 0x36, 0x97, 0x3b, 0x6e, 0x73, 0x6c,
|
||||
0xf8, 0x98, 0xcd, 0xdc, 0x1c, 0x66, 0x1f, 0x4e, 0x6b, 0x9f, 0xc2, 0x67, 0x31, 0xdc, 0x72, 0x07,
|
||||
0x89, 0x14, 0x76, 0x33, 0xff, 0xff, 0x7c, 0xfc, 0x76, 0xb2, 0xfc, 0xda, 0x20, 0x10, 0xf8, 0x64,
|
||||
0x8d, 0xca, 0xfc, 0x4d, 0xb4, 0xd4, 0x49, 0x44, 0x80, 0xb2, 0x50, 0xc5, 0x15, 0xa9, 0x75, 0xa2,
|
||||
0x70, 0xa5, 0xd7, 0xe4, 0x14, 0x59, 0xd4, 0x75, 0xee, 0x68, 0xae, 0x31, 0x09, 0x4d, 0x84, 0x64,
|
||||
0x7d, 0x37, 0x20, 0x85, 0x14, 0xf6, 0x91, 0xab, 0xee, 0xdc, 0x38, 0x65, 0x86, 0xd6, 0x10, 0xf8,
|
||||
0x0b, 0x65, 0x33, 0xb7, 0xc8, 0xd9, 0xfd, 0x2f, 0xc6, 0xdb, 0xd3, 0x72, 0xe5, 0x9b, 0x22, 0xf1,
|
||||
0xc2, 0x79, 0x85, 0x90, 0x79, 0xac, 0x5b, 0x1b, 0xb4, 0x1e, 0x7b, 0xf2, 0x38, 0x84, 0xac, 0x3a,
|
||||
0x83, 0x83, 0x26, 0xf1, 0xcc, 0xcf, 0x0c, 0x82, 0x81, 0x4c, 0xa1, 0x77, 0xda, 0x65, 0xff, 0x1b,
|
||||
0x50, 0xb5, 0x88, 0x21, 0x17, 0x04, 0x14, 0x2d, 0xc3, 0x0d, 0x90, 0x5e, 0xa7, 0xa1, 0x81, 0x0f,
|
||||
0x85, 0x5e, 0xad, 0xcb, 0x06, 0xb5, 0xe0, 0xa2, 0x70, 0xa6, 0x85, 0x31, 0xd9, 0xea, 0xfd, 0x4f,
|
||||
0xc6, 0xcf, 0xab, 0x29, 0xc2, 0xe3, 0xcd, 0x28, 0x49, 0x50, 0x65, 0x5b, 0x74, 0x36, 0x68, 0x07,
|
||||
0x65, 0x2a, 0x5e, 0x79, 0xd3, 0xe4, 0x71, 0xb8, 0x50, 0x76, 0xc7, 0x74, 0xff, 0x97, 0xc9, 0x1d,
|
||||
0x49, 0x6e, 0x8f, 0x24, 0x27, 0x79, 0xbc, 0xd4, 0xb3, 0xb1, 0xb2, 0xa3, 0xfa, 0xf7, 0xcf, 0xed,
|
||||
0x49, 0xd0, 0x30, 0x79, 0x3c, 0x56, 0x56, 0xf4, 0x78, 0xfb, 0x08, 0x57, 0x6b, 0xb3, 0x47, 0x12,
|
||||
0x0f, 0xfc, 0xb2, 0x7c, 0x4c, 0x68, 0x50, 0x03, 0x6a, 0xb2, 0x5e, 0xdd, 0xf1, 0x97, 0xc6, 0x64,
|
||||
0xa7, 0x8f, 0xe4, 0xfb, 0x30, 0xd5, 0x34, 0xcf, 0x63, 0x39, 0x83, 0x95, 0xbf, 0x47, 0x3a, 0x0c,
|
||||
0x0f, 0xfe, 0x47, 0xdc, 0x28, 0x92, 0xa7, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x28, 0xeb,
|
||||
0x40, 0x35, 0x02, 0x00, 0x00,
|
||||
}
|
||||
20
proto/types/validator.proto
Normal file
20
proto/types/validator.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.types;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/types";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "proto/crypto/keys/types.proto";
|
||||
|
||||
message ValidatorSet {
|
||||
repeated Validator validators = 1;
|
||||
Validator proposer = 2;
|
||||
int64 total_voting_power = 3;
|
||||
}
|
||||
|
||||
message Validator {
|
||||
bytes address = 1;
|
||||
tendermint.proto.crypto.keys.PublicKey pub_key = 2 [(gogoproto.nullable) = false];
|
||||
int64 voting_power = 3;
|
||||
int64 proposer_priority = 4;
|
||||
}
|
||||
176
proto/version/version.pb.go
Normal file
176
proto/version/version.pb.go
Normal file
@@ -0,0 +1,176 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/version/version.proto
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
fmt "fmt"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// App includes the protocol and software version for the application.
|
||||
// This information is included in ResponseInfo. The App.Protocol can be
|
||||
// updated in ResponseEndBlock.
|
||||
type App struct {
|
||||
Protocol uint64 `protobuf:"varint,1,opt,name=protocol,proto3" json:"protocol,omitempty"`
|
||||
Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *App) Reset() { *m = App{} }
|
||||
func (m *App) String() string { return proto.CompactTextString(m) }
|
||||
func (*App) ProtoMessage() {}
|
||||
func (*App) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_14aa2353622f11e1, []int{0}
|
||||
}
|
||||
func (m *App) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_App.Unmarshal(m, b)
|
||||
}
|
||||
func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_App.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *App) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_App.Merge(m, src)
|
||||
}
|
||||
func (m *App) XXX_Size() int {
|
||||
return xxx_messageInfo_App.Size(m)
|
||||
}
|
||||
func (m *App) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_App.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_App proto.InternalMessageInfo
|
||||
|
||||
func (m *App) GetProtocol() uint64 {
|
||||
if m != nil {
|
||||
return m.Protocol
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *App) GetSoftware() string {
|
||||
if m != nil {
|
||||
return m.Software
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Consensus captures the consensus rules for processing a block in the blockchain,
|
||||
// including all blockchain data structures and the rules of the application's
|
||||
// state transition machine.
|
||||
type Consensus struct {
|
||||
Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"`
|
||||
App uint64 `protobuf:"varint,2,opt,name=app,proto3" json:"app,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Consensus) Reset() { *m = Consensus{} }
|
||||
func (m *Consensus) String() string { return proto.CompactTextString(m) }
|
||||
func (*Consensus) ProtoMessage() {}
|
||||
func (*Consensus) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_14aa2353622f11e1, []int{1}
|
||||
}
|
||||
func (m *Consensus) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Consensus.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Consensus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Consensus.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Consensus) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Consensus.Merge(m, src)
|
||||
}
|
||||
func (m *Consensus) XXX_Size() int {
|
||||
return xxx_messageInfo_Consensus.Size(m)
|
||||
}
|
||||
func (m *Consensus) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Consensus.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Consensus proto.InternalMessageInfo
|
||||
|
||||
func (m *Consensus) GetBlock() uint64 {
|
||||
if m != nil {
|
||||
return m.Block
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Consensus) GetApp() uint64 {
|
||||
if m != nil {
|
||||
return m.App
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*App)(nil), "tendermint.proto.version.App")
|
||||
proto.RegisterType((*Consensus)(nil), "tendermint.proto.version.Consensus")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("proto/version/version.proto", fileDescriptor_14aa2353622f11e1) }
|
||||
|
||||
var fileDescriptor_14aa2353622f11e1 = []byte{
|
||||
// 198 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x2f, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x83, 0xd1, 0x7a, 0x60, 0x51, 0x21, 0x89,
|
||||
0x92, 0xd4, 0xbc, 0x94, 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0x88, 0x88, 0x1e, 0x54, 0x5e, 0x4a,
|
||||
0xad, 0x24, 0x23, 0xb3, 0x28, 0x25, 0xbe, 0x20, 0xb1, 0xa8, 0xa4, 0x52, 0x1f, 0x62, 0x44, 0x7a,
|
||||
0x7e, 0x7a, 0x3e, 0x82, 0x05, 0x51, 0xaf, 0x64, 0xcb, 0xc5, 0xec, 0x58, 0x50, 0x20, 0x24, 0xc5,
|
||||
0xc5, 0x01, 0xe6, 0x27, 0xe7, 0xe7, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xf9, 0x20,
|
||||
0xb9, 0xe2, 0xfc, 0xb4, 0x92, 0xf2, 0xc4, 0xa2, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20,
|
||||
0x38, 0x5f, 0xc9, 0x92, 0x8b, 0xd3, 0x39, 0x3f, 0xaf, 0x38, 0x35, 0xaf, 0xb8, 0xb4, 0x58, 0x48,
|
||||
0x84, 0x8b, 0x35, 0x29, 0x27, 0x3f, 0x39, 0x1b, 0x6a, 0x02, 0x84, 0x23, 0x24, 0xc0, 0xc5, 0x9c,
|
||||
0x58, 0x50, 0x00, 0xd6, 0xc9, 0x12, 0x04, 0x62, 0x5a, 0xb1, 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0x64,
|
||||
0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0xf0, 0x08,
|
||||
0x32, 0x13, 0xc5, 0xef, 0x49, 0x6c, 0x60, 0xae, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xd3,
|
||||
0x5b, 0xf2, 0x13, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *Consensus) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*Consensus)
|
||||
if !ok {
|
||||
that2, ok := that.(Consensus)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.Block != that1.Block {
|
||||
return false
|
||||
}
|
||||
if this.App != that1.App {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
24
proto/version/version.proto
Normal file
24
proto/version/version.proto
Normal file
@@ -0,0 +1,24 @@
|
||||
syntax = "proto3";
|
||||
package tendermint.proto.version;
|
||||
|
||||
option go_package = "github.com/tendermint/tendermint/proto/version";
|
||||
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
|
||||
// App includes the protocol and software version for the application.
|
||||
// This information is included in ResponseInfo. The App.Protocol can be
|
||||
// updated in ResponseEndBlock.
|
||||
message App {
|
||||
uint64 protocol = 1;
|
||||
string software = 2;
|
||||
}
|
||||
|
||||
// Consensus captures the consensus rules for processing a block in the blockchain,
|
||||
// including all blockchain data structures and the rules of the application's
|
||||
// state transition machine.
|
||||
message Consensus {
|
||||
option (gogoproto.equal) = true;
|
||||
|
||||
uint64 block = 1;
|
||||
uint64 app = 2;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/service"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpcclientlib "github.com/tendermint/tendermint/rpc/lib/client"
|
||||
jsonrpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
@@ -62,7 +62,7 @@ Example:
|
||||
*/
|
||||
type HTTP struct {
|
||||
remote string
|
||||
rpc *rpcclientlib.JSONRPCClient
|
||||
rpc *jsonrpcclient.Client
|
||||
|
||||
*baseRPCClient
|
||||
*WSEvents
|
||||
@@ -79,7 +79,7 @@ type HTTP struct {
|
||||
// batch, but ordering of transactions in the batch cannot be guaranteed in such
|
||||
// an example.
|
||||
type BatchHTTP struct {
|
||||
rpcBatch *rpcclientlib.JSONRPCRequestBatch
|
||||
rpcBatch *jsonrpcclient.RequestBatch
|
||||
*baseRPCClient
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ type rpcClient interface {
|
||||
// baseRPCClient implements the basic RPC method logic without the actual
|
||||
// underlying RPC call functionality, which is provided by `caller`.
|
||||
type baseRPCClient struct {
|
||||
caller rpcclientlib.JSONRPCCaller
|
||||
caller jsonrpcclient.Caller
|
||||
}
|
||||
|
||||
var _ rpcClient = (*HTTP)(nil)
|
||||
@@ -111,7 +111,7 @@ var _ rpcClient = (*baseRPCClient)(nil)
|
||||
// the websocket path (which always seems to be "/websocket")
|
||||
// An error is returned on invalid remote. The function panics when remote is nil.
|
||||
func New(remote, wsEndpoint string) (*HTTP, error) {
|
||||
httpClient, err := rpcclientlib.DefaultHTTPClient(remote)
|
||||
httpClient, err := jsonrpcclient.DefaultHTTPClient(remote)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func New(remote, wsEndpoint string) (*HTTP, error) {
|
||||
|
||||
// Create timeout enabled http client
|
||||
func NewWithTimeout(remote, wsEndpoint string, timeout uint) (*HTTP, error) {
|
||||
httpClient, err := rpcclientlib.DefaultHTTPClient(remote)
|
||||
httpClient, err := jsonrpcclient.DefaultHTTPClient(remote)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func NewWithClient(remote, wsEndpoint string, client *http.Client) (*HTTP, error
|
||||
panic("nil http.Client provided")
|
||||
}
|
||||
|
||||
rc, err := rpcclientlib.NewJSONRPCClientWithHTTPClient(remote, client)
|
||||
rc, err := jsonrpcclient.NewWithHTTPClient(remote, client)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -441,7 +441,7 @@ type WSEvents struct {
|
||||
cdc *amino.Codec
|
||||
remote string
|
||||
endpoint string
|
||||
ws *rpcclientlib.WSClient
|
||||
ws *jsonrpcclient.WSClient
|
||||
|
||||
mtx sync.RWMutex
|
||||
subscriptions map[string]chan ctypes.ResultEvent // query -> chan
|
||||
@@ -457,7 +457,7 @@ func newWSEvents(cdc *amino.Codec, remote, endpoint string) (*WSEvents, error) {
|
||||
w.BaseService = *service.NewBaseService(nil, "WSEvents", w)
|
||||
|
||||
var err error
|
||||
w.ws, err = rpcclientlib.NewWSClient(w.remote, w.endpoint, rpcclientlib.OnReconnect(func() {
|
||||
w.ws, err = jsonrpcclient.NewWS(w.remote, w.endpoint, jsonrpcclient.OnReconnect(func() {
|
||||
// resubscribe immediately
|
||||
w.redoSubscriptionsAfter(0 * time.Second)
|
||||
}))
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
"github.com/tendermint/tendermint/rpc/core"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/tendermint/tendermint/rpc/client"
|
||||
"github.com/tendermint/tendermint/rpc/core"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
|
||||
rpclocal "github.com/tendermint/tendermint/rpc/client/local"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/lib/client"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client"
|
||||
rpctest "github.com/tendermint/tendermint/rpc/test"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
@@ -68,7 +68,7 @@ func TestNilCustomHTTPClient(t *testing.T) {
|
||||
_, _ = rpchttp.NewWithClient("http://example.com", "/websocket", nil)
|
||||
})
|
||||
require.Panics(t, func() {
|
||||
_, _ = rpcclient.NewJSONRPCClientWithHTTPClient("http://example.com", nil)
|
||||
_, _ = rpcclient.NewWithHTTPClient("http://example.com", nil)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -771,14 +771,14 @@ func TestBatchedJSONRPCCallsCancellation(t *testing.T) {
|
||||
require.Equal(t, 0, batch.Count())
|
||||
}
|
||||
|
||||
func TestSendingEmptyJSONRPCRequestBatch(t *testing.T) {
|
||||
func TestSendingEmptyRequestBatch(t *testing.T) {
|
||||
c := getHTTPClient()
|
||||
batch := c.NewBatch()
|
||||
_, err := batch.Send()
|
||||
require.Error(t, err, "sending an empty batch of JSON RPC requests should result in an error")
|
||||
}
|
||||
|
||||
func TestClearingEmptyJSONRPCRequestBatch(t *testing.T) {
|
||||
func TestClearingEmptyRequestBatch(t *testing.T) {
|
||||
c := getHTTPClient()
|
||||
batch := c.NewBatch()
|
||||
require.Zero(t, batch.Clear(), "clearing an empty batch of JSON RPC requests should result in a 0 result")
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/bytes"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
)
|
||||
|
||||
// ABCIQuery queries the application for some information.
|
||||
@@ -17,7 +17,7 @@ func ABCIQuery(
|
||||
height int64,
|
||||
prove bool,
|
||||
) (*ctypes.ResultABCIQuery, error) {
|
||||
resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{
|
||||
resQuery, err := env.ProxyAppQuery.QuerySync(abci.RequestQuery{
|
||||
Path: path,
|
||||
Data: data,
|
||||
Height: height,
|
||||
@@ -26,14 +26,14 @@ func ABCIQuery(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery)
|
||||
env.Logger.Info("ABCIQuery", "path", path, "data", data, "result", resQuery)
|
||||
return &ctypes.ResultABCIQuery{Response: *resQuery}, nil
|
||||
}
|
||||
|
||||
// ABCIInfo gets some info about the application.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_info
|
||||
func ABCIInfo(ctx *rpctypes.Context) (*ctypes.ResultABCIInfo, error) {
|
||||
resInfo, err := proxyAppQuery.InfoSync(proxy.RequestInfo)
|
||||
resInfo, err := env.ProxyAppQuery.InfoSync(proxy.RequestInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
@@ -17,20 +17,25 @@ func BlockchainInfo(ctx *rpctypes.Context, minHeight, maxHeight int64) (*ctypes.
|
||||
// maximum 20 block metas
|
||||
const limit int64 = 20
|
||||
var err error
|
||||
minHeight, maxHeight, err = filterMinMax(blockStore.Base(), blockStore.Height(), minHeight, maxHeight, limit)
|
||||
minHeight, maxHeight, err = filterMinMax(
|
||||
env.BlockStore.Base(),
|
||||
env.BlockStore.Height(),
|
||||
minHeight,
|
||||
maxHeight,
|
||||
limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
logger.Debug("BlockchainInfoHandler", "maxHeight", maxHeight, "minHeight", minHeight)
|
||||
env.Logger.Debug("BlockchainInfoHandler", "maxHeight", maxHeight, "minHeight", minHeight)
|
||||
|
||||
blockMetas := []*types.BlockMeta{}
|
||||
for height := maxHeight; height >= minHeight; height-- {
|
||||
blockMeta := blockStore.LoadBlockMeta(height)
|
||||
blockMeta := env.BlockStore.LoadBlockMeta(height)
|
||||
blockMetas = append(blockMetas, blockMeta)
|
||||
}
|
||||
|
||||
return &ctypes.ResultBlockchainInfo{
|
||||
LastHeight: blockStore.Height(),
|
||||
LastHeight: env.BlockStore.Height(),
|
||||
BlockMetas: blockMetas}, nil
|
||||
}
|
||||
|
||||
@@ -71,13 +76,13 @@ func filterMinMax(base, height, min, max, limit int64) (int64, int64, error) {
|
||||
// If no height is provided, it will fetch the latest block.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block
|
||||
func Block(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlock, error) {
|
||||
height, err := getHeight(blockStore.Base(), blockStore.Height(), heightPtr)
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
block := blockStore.LoadBlock(height)
|
||||
blockMeta := blockStore.LoadBlockMeta(height)
|
||||
block := env.BlockStore.LoadBlock(height)
|
||||
blockMeta := env.BlockStore.LoadBlockMeta(height)
|
||||
if blockMeta == nil {
|
||||
return &ctypes.ResultBlock{BlockID: types.BlockID{}, Block: block}, nil
|
||||
}
|
||||
@@ -87,12 +92,12 @@ func Block(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlock, error)
|
||||
// BlockByHash gets block by hash.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block_by_hash
|
||||
func BlockByHash(ctx *rpctypes.Context, hash []byte) (*ctypes.ResultBlock, error) {
|
||||
block := blockStore.LoadBlockByHash(hash)
|
||||
block := env.BlockStore.LoadBlockByHash(hash)
|
||||
if block == nil {
|
||||
return &ctypes.ResultBlock{BlockID: types.BlockID{}, Block: nil}, nil
|
||||
}
|
||||
// If block is not nil, then blockMeta can't be nil.
|
||||
blockMeta := blockStore.LoadBlockMeta(block.Height)
|
||||
blockMeta := env.BlockStore.LoadBlockMeta(block.Height)
|
||||
return &ctypes.ResultBlock{BlockID: blockMeta.BlockID, Block: block}, nil
|
||||
}
|
||||
|
||||
@@ -100,12 +105,12 @@ func BlockByHash(ctx *rpctypes.Context, hash []byte) (*ctypes.ResultBlock, error
|
||||
// If no height is provided, it will fetch the commit for the latest block.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/commit
|
||||
func Commit(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, error) {
|
||||
height, err := getHeight(blockStore.Base(), blockStore.Height(), heightPtr)
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
blockMeta := blockStore.LoadBlockMeta(height)
|
||||
blockMeta := env.BlockStore.LoadBlockMeta(height)
|
||||
if blockMeta == nil {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -113,13 +118,13 @@ func Commit(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, erro
|
||||
|
||||
// If the next block has not been committed yet,
|
||||
// use a non-canonical commit
|
||||
if height == blockStore.Height() {
|
||||
commit := blockStore.LoadSeenCommit(height)
|
||||
if height == env.BlockStore.Height() {
|
||||
commit := env.BlockStore.LoadSeenCommit(height)
|
||||
return ctypes.NewResultCommit(&header, commit, false), nil
|
||||
}
|
||||
|
||||
// Return the canonical commit (comes from the block at height+1)
|
||||
commit := blockStore.LoadBlockCommit(height)
|
||||
commit := env.BlockStore.LoadBlockCommit(height)
|
||||
return ctypes.NewResultCommit(&header, commit, true), nil
|
||||
}
|
||||
|
||||
@@ -131,12 +136,12 @@ func Commit(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, erro
|
||||
// getBlock(h).Txs[5]
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block_results
|
||||
func BlockResults(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlockResults, error) {
|
||||
height, err := getHeight(blockStore.Base(), blockStore.Height(), heightPtr)
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
results, err := sm.LoadABCIResponses(stateDB, height)
|
||||
results, err := sm.LoadABCIResponses(env.StateDB, height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -150,21 +155,3 @@ func BlockResults(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlockR
|
||||
ConsensusParamUpdates: results.EndBlock.ConsensusParamUpdates,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func getHeight(currentBase int64, currentHeight int64, heightPtr *int64) (int64, error) {
|
||||
if heightPtr != nil {
|
||||
height := *heightPtr
|
||||
if height <= 0 {
|
||||
return 0, fmt.Errorf("height must be greater than 0")
|
||||
}
|
||||
if height > currentHeight {
|
||||
return 0, fmt.Errorf("height must be less than or equal to the current blockchain height")
|
||||
}
|
||||
if height < currentBase {
|
||||
return 0, fmt.Errorf("height %v is not available, blocks pruned at height %v",
|
||||
height, currentBase)
|
||||
}
|
||||
return height, nil
|
||||
}
|
||||
return currentHeight, nil
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
@@ -79,9 +79,10 @@ func TestBlockResults(t *testing.T) {
|
||||
BeginBlock: &abci.ResponseBeginBlock{},
|
||||
}
|
||||
|
||||
stateDB = dbm.NewMemDB()
|
||||
sm.SaveABCIResponses(stateDB, 100, results)
|
||||
blockStore = mockBlockStore{height: 100}
|
||||
env = &Environment{}
|
||||
env.StateDB = dbm.NewMemDB()
|
||||
sm.SaveABCIResponses(env.StateDB, 100, results)
|
||||
env.BlockStore = mockBlockStore{height: 100}
|
||||
|
||||
testCases := []struct {
|
||||
height int64
|
||||
|
||||
@@ -4,28 +4,26 @@ import (
|
||||
cm "github.com/tendermint/tendermint/consensus"
|
||||
tmmath "github.com/tendermint/tendermint/libs/math"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// Validators gets the validator set at the given block height.
|
||||
//
|
||||
// If no height is provided, it will fetch the current validator set. Note the
|
||||
// validators are sorted by their address - this is the canonical order for the
|
||||
// validators in the set as used in computing their Merkle root.
|
||||
// If no height is provided, it will fetch the latest validator set. Note the
|
||||
// validators are sorted by their voting power - this is the canonical order
|
||||
// for the validators in the set as used in computing their Merkle root.
|
||||
//
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/validators
|
||||
func Validators(ctx *rpctypes.Context, heightPtr *int64, page, perPage int) (*ctypes.ResultValidators, error) {
|
||||
// The latest validator that we know is the
|
||||
// NextValidator of the last block.
|
||||
height := consensusState.GetState().LastBlockHeight + 1
|
||||
height, err := getHeight(blockStore.Base(), height, heightPtr)
|
||||
// The latest validator that we know is the NextValidator of the last block.
|
||||
height, err := getHeight(latestUncommittedHeight(), heightPtr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
validators, err := sm.LoadValidators(stateDB, height)
|
||||
validators, err := sm.LoadValidators(env.StateDB, height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -53,7 +51,7 @@ func Validators(ctx *rpctypes.Context, heightPtr *int64, page, perPage int) (*ct
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/dump_consensus_state
|
||||
func DumpConsensusState(ctx *rpctypes.Context) (*ctypes.ResultDumpConsensusState, error) {
|
||||
// Get Peer consensus states.
|
||||
peers := p2pPeers.Peers().List()
|
||||
peers := env.P2PPeers.Peers().List()
|
||||
peerStates := make([]ctypes.PeerStateInfo, len(peers))
|
||||
for i, peer := range peers {
|
||||
peerState, ok := peer.Get(types.PeerStateKey).(*cm.PeerState)
|
||||
@@ -72,7 +70,7 @@ func DumpConsensusState(ctx *rpctypes.Context) (*ctypes.ResultDumpConsensusState
|
||||
}
|
||||
}
|
||||
// Get self round state.
|
||||
roundState, err := consensusState.GetRoundStateJSON()
|
||||
roundState, err := env.ConsensusState.GetRoundStateJSON()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -86,25 +84,26 @@ func DumpConsensusState(ctx *rpctypes.Context) (*ctypes.ResultDumpConsensusState
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/consensus_state
|
||||
func ConsensusState(ctx *rpctypes.Context) (*ctypes.ResultConsensusState, error) {
|
||||
// Get self round state.
|
||||
bz, err := consensusState.GetRoundStateSimpleJSON()
|
||||
bz, err := env.ConsensusState.GetRoundStateSimpleJSON()
|
||||
return &ctypes.ResultConsensusState{RoundState: bz}, err
|
||||
}
|
||||
|
||||
// ConsensusParams gets the consensus parameters at the given block height.
|
||||
// If no height is provided, it will fetch the current consensus params.
|
||||
// ConsensusParams gets the consensus parameters at the given block height.
|
||||
// If no height is provided, it will fetch the latest consensus params.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/consensus_params
|
||||
func ConsensusParams(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultConsensusParams, error) {
|
||||
height := consensusState.GetState().LastBlockHeight + 1
|
||||
height, err := getHeight(blockStore.Base(), height, heightPtr)
|
||||
// The latest consensus params that we know is the consensus params after the
|
||||
// last block.
|
||||
height, err := getHeight(latestUncommittedHeight(), heightPtr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
consensusparams, err := sm.LoadConsensusParams(stateDB, height)
|
||||
consensusParams, err := sm.LoadConsensusParams(env.StateDB, height)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ctypes.ResultConsensusParams{
|
||||
BlockHeight: height,
|
||||
ConsensusParams: consensusparams}, nil
|
||||
ConsensusParams: consensusParams}, nil
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ import (
|
||||
"runtime/pprof"
|
||||
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
|
||||
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
|
||||
)
|
||||
|
||||
// UnsafeFlushMempool removes all transactions from the mempool.
|
||||
func UnsafeFlushMempool(ctx *rpctypes.Context) (*ctypes.ResultUnsafeFlushMempool, error) {
|
||||
mempool.Flush()
|
||||
env.Mempool.Flush()
|
||||
return &ctypes.ResultUnsafeFlushMempool{}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,17 @@ const (
|
||||
SubscribeTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
// set by Node
|
||||
env *Environment
|
||||
)
|
||||
|
||||
// SetEnvironment sets up the given Environment.
|
||||
// It will race if multiple Node call SetEnvironment.
|
||||
func SetEnvironment(e *Environment) {
|
||||
env = e
|
||||
}
|
||||
|
||||
//----------------------------------------------
|
||||
// These interfaces are used by RPC and must be thread safe
|
||||
|
||||
@@ -52,94 +63,34 @@ type peers interface {
|
||||
}
|
||||
|
||||
//----------------------------------------------
|
||||
// These package level globals come with setters
|
||||
// that are expected to be called only once, on startup
|
||||
|
||||
var (
|
||||
// Environment contains objects and interfaces used by the RPC. It is expected
|
||||
// to be setup once during startup.
|
||||
type Environment struct {
|
||||
// external, thread safe interfaces
|
||||
proxyAppQuery proxy.AppConnQuery
|
||||
ProxyAppQuery proxy.AppConnQuery
|
||||
|
||||
// interfaces defined in types and above
|
||||
stateDB dbm.DB
|
||||
blockStore sm.BlockStore
|
||||
evidencePool sm.EvidencePool
|
||||
consensusState Consensus
|
||||
p2pPeers peers
|
||||
p2pTransport transport
|
||||
StateDB dbm.DB
|
||||
BlockStore sm.BlockStore
|
||||
EvidencePool sm.EvidencePool
|
||||
ConsensusState Consensus
|
||||
P2PPeers peers
|
||||
P2PTransport transport
|
||||
|
||||
// objects
|
||||
pubKey crypto.PubKey
|
||||
genDoc *types.GenesisDoc // cache the genesis structure
|
||||
txIndexer txindex.TxIndexer
|
||||
consensusReactor *consensus.Reactor
|
||||
eventBus *types.EventBus // thread safe
|
||||
mempool mempl.Mempool
|
||||
PubKey crypto.PubKey
|
||||
GenDoc *types.GenesisDoc // cache the genesis structure
|
||||
TxIndexer txindex.TxIndexer
|
||||
ConsensusReactor *consensus.Reactor
|
||||
EventBus *types.EventBus // thread safe
|
||||
Mempool mempl.Mempool
|
||||
|
||||
logger log.Logger
|
||||
Logger log.Logger
|
||||
|
||||
config cfg.RPCConfig
|
||||
)
|
||||
|
||||
func SetStateDB(db dbm.DB) {
|
||||
stateDB = db
|
||||
Config cfg.RPCConfig
|
||||
}
|
||||
|
||||
func SetBlockStore(bs sm.BlockStore) {
|
||||
blockStore = bs
|
||||
}
|
||||
|
||||
func SetMempool(mem mempl.Mempool) {
|
||||
mempool = mem
|
||||
}
|
||||
|
||||
func SetEvidencePool(evpool sm.EvidencePool) {
|
||||
evidencePool = evpool
|
||||
}
|
||||
|
||||
func SetConsensusState(cs Consensus) {
|
||||
consensusState = cs
|
||||
}
|
||||
|
||||
func SetP2PPeers(p peers) {
|
||||
p2pPeers = p
|
||||
}
|
||||
|
||||
func SetP2PTransport(t transport) {
|
||||
p2pTransport = t
|
||||
}
|
||||
|
||||
func SetPubKey(pk crypto.PubKey) {
|
||||
pubKey = pk
|
||||
}
|
||||
|
||||
func SetGenesisDoc(doc *types.GenesisDoc) {
|
||||
genDoc = doc
|
||||
}
|
||||
|
||||
func SetProxyAppQuery(appConn proxy.AppConnQuery) {
|
||||
proxyAppQuery = appConn
|
||||
}
|
||||
|
||||
func SetTxIndexer(indexer txindex.TxIndexer) {
|
||||
txIndexer = indexer
|
||||
}
|
||||
|
||||
func SetConsensusReactor(conR *consensus.Reactor) {
|
||||
consensusReactor = conR
|
||||
}
|
||||
|
||||
func SetLogger(l log.Logger) {
|
||||
logger = l
|
||||
}
|
||||
|
||||
func SetEventBus(b *types.EventBus) {
|
||||
eventBus = b
|
||||
}
|
||||
|
||||
// SetConfig sets an RPCConfig.
|
||||
func SetConfig(c cfg.RPCConfig) {
|
||||
config = c
|
||||
}
|
||||
//----------------------------------------------
|
||||
|
||||
func validatePage(page, perPage, totalCount int) (int, error) {
|
||||
if perPage < 1 {
|
||||
@@ -178,3 +129,32 @@ func validateSkipCount(page, perPage int) int {
|
||||
|
||||
return skipCount
|
||||
}
|
||||
|
||||
// latestHeight can be either latest committed or uncommitted (+1) height.
|
||||
func getHeight(latestHeight int64, heightPtr *int64) (int64, error) {
|
||||
if heightPtr != nil {
|
||||
height := *heightPtr
|
||||
if height <= 0 {
|
||||
return 0, fmt.Errorf("height must be greater than 0, but got %d", height)
|
||||
}
|
||||
if height > latestHeight {
|
||||
return 0, fmt.Errorf("height %d must be less than or equal to the current blockchain height %d",
|
||||
height, latestHeight)
|
||||
}
|
||||
base := env.BlockStore.Base()
|
||||
if height < base {
|
||||
return 0, fmt.Errorf("height %v is not available, blocks pruned at height %v",
|
||||
height, base)
|
||||
}
|
||||
return height, nil
|
||||
}
|
||||
return latestHeight, nil
|
||||
}
|
||||
|
||||
func latestUncommittedHeight() int64 {
|
||||
nodeIsSyncing := env.ConsensusReactor.FastSync()
|
||||
if nodeIsSyncing {
|
||||
return env.BlockStore.Height()
|
||||
}
|
||||
return env.BlockStore.Height() + 1
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
)
|
||||
|
||||
func TestPaginationPage(t *testing.T) {
|
||||
|
||||
cases := []struct {
|
||||
totalCount int
|
||||
perPage int
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user