mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-07 08:36:38 +00:00
Merge branch 'master' into alessio/use-go-testing-t-utils
This commit is contained in:
@@ -1,168 +0,0 @@
|
||||
version: 2.1
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: tendermintdev/docker-tendermint-build
|
||||
working_directory: /go/src/github.com/tendermint/tendermint
|
||||
environment:
|
||||
GOBIN: /tmp/bin
|
||||
release:
|
||||
machine: true
|
||||
docs:
|
||||
docker:
|
||||
- image: tendermintdev/docker-website-deployment
|
||||
environment:
|
||||
AWS_REGION: us-east-1
|
||||
|
||||
commands:
|
||||
run_test:
|
||||
parameters:
|
||||
script_path:
|
||||
type: string
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: /tmp/bin
|
||||
- restore_cache:
|
||||
name: "Restore source code cache"
|
||||
keys:
|
||||
- go-src-v1-{{ .Revision }}
|
||||
- checkout
|
||||
- restore_cache:
|
||||
name: "Restore go modules cache"
|
||||
keys:
|
||||
- go-mod-v1-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
name: "Running test"
|
||||
command: |
|
||||
bash << parameters.script_path >>
|
||||
jobs:
|
||||
setup_dependencies:
|
||||
executor: golang
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
name: "Restore go modules cache"
|
||||
keys:
|
||||
- go-mod-v1-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
command: |
|
||||
mkdir -p /tmp/bin
|
||||
- run:
|
||||
name: Cache go modules
|
||||
command: make go-mod-cache
|
||||
- run:
|
||||
name: tools
|
||||
command: make tools
|
||||
- run:
|
||||
name: "Build binaries"
|
||||
command: make install install_abci
|
||||
- save_cache:
|
||||
name: "Save go modules cache"
|
||||
key: go-mod-v1-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- "/go/pkg/mod"
|
||||
- save_cache:
|
||||
name: "Save source code cache"
|
||||
key: go-src-v1-{{ .Revision }}
|
||||
paths:
|
||||
- ".git"
|
||||
- persist_to_workspace:
|
||||
root: "/tmp/bin"
|
||||
paths:
|
||||
- "."
|
||||
|
||||
deploy_docs:
|
||||
executor: docs
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull versions"
|
||||
command: git fetch origin v0.32 v0.33
|
||||
- run:
|
||||
name: "Build docs"
|
||||
command: make build-docs
|
||||
- run:
|
||||
name: "Sync to S3"
|
||||
command: make sync-docs
|
||||
|
||||
prepare_build:
|
||||
executor: golang
|
||||
steps:
|
||||
- restore_cache:
|
||||
name: "Restore source code cache"
|
||||
keys:
|
||||
- go-src-v1-{{ .Revision }}
|
||||
- checkout
|
||||
- run:
|
||||
name: Get next release number
|
||||
command: |
|
||||
export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
|
||||
echo "Last tag: ${LAST_TAG}"
|
||||
if [ -z "${LAST_TAG}" ]; then
|
||||
export LAST_TAG="${CIRCLE_BRANCH}"
|
||||
echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
|
||||
fi
|
||||
export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
|
||||
echo "Next tag: ${NEXT_TAG}"
|
||||
echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
|
||||
- run:
|
||||
name: Build dependencies
|
||||
command: make tools
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- "release-version.source"
|
||||
- save_cache:
|
||||
key: v2-release-deps-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- "/go/pkg/mod"
|
||||
|
||||
# # Test RPC implementation against the swagger documented specs
|
||||
# contract_tests:
|
||||
# working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
|
||||
# machine:
|
||||
# image: circleci/classic:latest
|
||||
# environment:
|
||||
# GOBIN: /home/circleci/.go_workspace/bin
|
||||
# GOPATH: /home/circleci/.go_workspace/
|
||||
# GOOS: linux
|
||||
# GOARCH: amd64
|
||||
# parallelism: 1
|
||||
# steps:
|
||||
# - checkout
|
||||
# - run:
|
||||
# name: Test RPC endpoints against swagger documentation
|
||||
# command: |
|
||||
# set -x
|
||||
# export PATH=~/.local/bin:$PATH
|
||||
# # install node and dredd
|
||||
# ./scripts/get_nodejs.sh
|
||||
# # build the binaries with a proper version of Go
|
||||
# docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks
|
||||
# # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
|
||||
# go get github.com/snikch/goodman/cmd/goodman
|
||||
# make contract-tests
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
docs:
|
||||
jobs:
|
||||
- deploy_docs:
|
||||
context: tendermint-docs
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
tags:
|
||||
only:
|
||||
- /^v.*/
|
||||
- deploy_docs:
|
||||
context: tendermint-docs-staging
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- docs-staging
|
||||
# - contract_tests:
|
||||
# requires:
|
||||
# - setup_dependencies
|
||||
+3
-3
@@ -2,9 +2,6 @@ coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
@@ -12,6 +9,9 @@ coverage:
|
||||
patch: on
|
||||
changes: off
|
||||
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
||||
comment:
|
||||
layout: "diff, files"
|
||||
behavior: default
|
||||
|
||||
@@ -33,6 +33,29 @@ jobs:
|
||||
name: "${{ github.sha }}-03"
|
||||
path: ./pkgs.txt.part.03
|
||||
|
||||
build-linux:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
goarch: ["arm", "amd64"]
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
PATTERNS: |
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- name: install
|
||||
run: GOOS=linux GOARCH=${{ matrix.goarch }} make build
|
||||
if: "env.GIT_DIFF != ''"
|
||||
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: split-test-files
|
||||
@@ -41,6 +64,9 @@ jobs:
|
||||
matrix:
|
||||
part: ["00", "01", "02", "03"]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
@@ -95,7 +121,7 @@ jobs:
|
||||
- run: |
|
||||
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
|
||||
if: env.GIT_DIFF
|
||||
- uses: codecov/codecov-action@v1.0.14
|
||||
- uses: codecov/codecov-action@v1.0.15
|
||||
with:
|
||||
file: ./coverage.txt
|
||||
if: env.GIT_DIFF
|
||||
|
||||
@@ -2,6 +2,7 @@ name: Build & Push
|
||||
# Build & Push rebuilds the tendermint docker image on every push to master and creation of tags
|
||||
# and pushes the image to https://hub.docker.com/r/interchainio/simapp/tags
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@@ -13,6 +14,9 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@master
|
||||
- name: Prepare
|
||||
id: prep
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Install and Build 🔧
|
||||
run: |
|
||||
apk add rsync
|
||||
make build-gh-docs
|
||||
make build-docs
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@3.7.1
|
||||
|
||||
@@ -16,6 +16,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.15.4'
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
@@ -38,7 +42,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Notify Slack on failure
|
||||
uses: rtCamp/action-slack-notify@e9db0ef
|
||||
uses: rtCamp/action-slack-notify@ecc1353ce30ef086ce3fc3d1ea9ac2e32e150402
|
||||
env:
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
SLACK_CHANNEL: tendermint-internal
|
||||
|
||||
@@ -13,6 +13,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.15.4'
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
|
||||
@@ -14,10 +14,9 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.15
|
||||
go-version: '^1.15.4'
|
||||
|
||||
- run: echo https://github.com/tendermint/tendermint/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
|
||||
|
||||
|
||||
+15
-15
@@ -23,6 +23,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
@@ -30,9 +33,6 @@ jobs:
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- name: Set GOBIN
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
- name: install
|
||||
run: make install install_abci
|
||||
if: "env.GIT_DIFF != ''"
|
||||
@@ -52,9 +52,12 @@ jobs:
|
||||
|
||||
test_abci_apps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
needs: build
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
@@ -62,9 +65,6 @@ jobs:
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- name: Set GOBIN
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
- uses: actions/cache@v2.1.3
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
@@ -84,9 +84,12 @@ jobs:
|
||||
|
||||
test_abci_cli:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
needs: build
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
@@ -94,9 +97,6 @@ jobs:
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- name: Set GOBIN
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
- uses: actions/cache@v2.1.3
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
@@ -115,9 +115,12 @@ jobs:
|
||||
|
||||
test_apps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
needs: build
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.15.4"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v4
|
||||
with:
|
||||
@@ -125,9 +128,6 @@ jobs:
|
||||
**/**.go
|
||||
go.mod
|
||||
go.sum
|
||||
- name: Set GOBIN
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
- uses: actions/cache@v2.1.3
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
|
||||
+29
-36
@@ -1,50 +1,43 @@
|
||||
*.swp
|
||||
*.swo
|
||||
.bak
|
||||
*.bak
|
||||
*.iml
|
||||
*.log
|
||||
*.swo
|
||||
*.swp
|
||||
*/.glide
|
||||
*/vendor
|
||||
.DS_Store
|
||||
build/*
|
||||
artifacts/*
|
||||
rpc/test/.tendermint
|
||||
.tendermint
|
||||
remote_dump
|
||||
.bak
|
||||
.idea/
|
||||
.revision
|
||||
vendor
|
||||
.tendermint
|
||||
.tendermint-lite
|
||||
.terraform
|
||||
.vagrant
|
||||
test/e2e/build
|
||||
test/maverick/maverick
|
||||
test/e2e/networks/*/
|
||||
test/p2p/data/
|
||||
test/logs
|
||||
.vendor-new/
|
||||
.vscode/
|
||||
abci-cli
|
||||
addrbook.json
|
||||
artifacts/*
|
||||
build/*
|
||||
coverage.txt
|
||||
docs/.vuepress/dist
|
||||
docs/_build
|
||||
docs/dist
|
||||
docs/.vuepress/dist
|
||||
*.log
|
||||
abci-cli
|
||||
docs/node_modules/
|
||||
index.html.md
|
||||
|
||||
scripts/wal2json/wal2json
|
||||
scripts/cutWALUntil/cutWALUntil
|
||||
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
.vscode/
|
||||
|
||||
libs/pubsub/query/fuzz_test/output
|
||||
profile\.out
|
||||
remote_dump
|
||||
rpc/test/.tendermint
|
||||
scripts/cutWALUntil/cutWALUntil
|
||||
scripts/wal2json/wal2json
|
||||
shunit2
|
||||
|
||||
.tendermint-lite
|
||||
addrbook.json
|
||||
|
||||
*/vendor
|
||||
.vendor-new/
|
||||
*/.glide
|
||||
.terraform
|
||||
terraform.tfstate
|
||||
terraform.tfstate.backup
|
||||
terraform.tfstate.d
|
||||
|
||||
profile\.out
|
||||
test/e2e/build
|
||||
test/e2e/networks/*/
|
||||
test/logs
|
||||
test/maverick/maverick
|
||||
test/p2p/data/
|
||||
vendor
|
||||
+2
-1
@@ -8,12 +8,13 @@ builds:
|
||||
- id: "Tendermint"
|
||||
main: ./cmd/tendermint/main.go
|
||||
ldflags:
|
||||
- -s -w -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Version }}
|
||||
- -s -w -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Version }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"protoc": {
|
||||
"options": [
|
||||
"--proto_path=${workspaceRoot}/proto",
|
||||
"--proto_path=${workspaceRoot}/third_party/proto"
|
||||
]
|
||||
}
|
||||
}
|
||||
+118
-236
@@ -1,302 +1,184 @@
|
||||
# Changelog
|
||||
|
||||
## v0.34.0-rc6
|
||||
## v0.34.0
|
||||
|
||||
*November 5, 2020*
|
||||
*November 19, 2020*
|
||||
|
||||
Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- [evidence] [\#5610](https://github.com/tendermint/tendermint/issues/5610) Make it possible for abci evidence to be formed from tm evidence (@cmwaters)
|
||||
- This makes breaking changes to `DuplicateVoteEvidence` and `LightClientAttackEvidence`
|
||||
such that ABCI evidence can be reconstructed from these types, and is necessary for nodes
|
||||
to successfully sync to block heights with recorded evidence
|
||||
- [version] [\#5527](https://github.com/tendermint/tendermint/pull/5527) We've updated our release tooling, and `version.Version` is now `version.TMCoreSemVer` (@marbar3778)
|
||||
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [statesync] [\#5516](https://github.com/tendermint/tendermint/issues/5516) Check that all heights necessary to rebuild state for a snapshot exist before adding the snapshot to the pool. (@erikgrinaker)
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
- [blockchain/v2] [\#5499](https://github.com/tendermint/tendermint/issues/5499) Fix "duplicate block enqueued by processor" panic (@melekes)
|
||||
- [abci/grpc] [\#5520](https://github.com/tendermint/tendermint/issues/5520) Return async responses in order, to avoid mempool panics. (@erikgrinaker)
|
||||
- [blockchain/v2] [\#5530](https://github.com/tendermint/tendermint/issues/5530) Fix "processed height 4541 but expected height 4540" panic (@melekes)
|
||||
- [consensus/wal] Fix WAL autorepair by opening target WAL in read/write mode (@erikgrinaker)
|
||||
- [block] [\#5567](https://github.com/tendermint/tendermint/issues/5567) Fix MaxCommitSigBytes (@cmwaters)
|
||||
- [blockchain/v2] [\#5553](https://github.com/tendermint/tendermint/issues/5553) Make the removal of an already removed peer a noop (@melekes)
|
||||
- [evidence] [\#5574](https://github.com/tendermint/tendermint/issues/5574) Fix bug where node sends committed evidence to peer (@cmwaters)
|
||||
- [privval] [\#5583](https://github.com/tendermint/tendermint/issues/5583) Make `Vote`, `Proposal` & `PubKey` non-nullable in Responses (@marbar3778)
|
||||
- [light] [\#5392](https://github.com/tendermint/tendermint/issues/5392) Make light client home directory same as the full node default (@cmwaters)
|
||||
|
||||
|
||||
## v0.34.0-rc5
|
||||
|
||||
*October 13, 2020*
|
||||
|
||||
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- CLI/RPC/Config
|
||||
|
||||
- Apps
|
||||
- [ABCI] \#5447 Remove `SetOption` method from `ABCI.Client` interface
|
||||
|
||||
- P2P Protocol
|
||||
|
||||
- Go API
|
||||
- [evidence] [\#5499](https://github.com/tendermint/tendermint/pull/5449) `MaxNum` evidence consensus parameter has been changed to `MaxBytes` (@cmwaters)
|
||||
|
||||
- Blockchain Protocol
|
||||
|
||||
### FEATURES
|
||||
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [privval] \#5434 `NewSignerDialerEndpoint` can now be given `SignerServiceEndpointOption` (@erikgrinaker)
|
||||
|
||||
- [config] \#5433 `statesync.rpc_servers` is now properly set when writing the configuration file (@erikgrinaker)
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
- [privval] \#5441 Fix faulty ping message encoding causing nil message errors in logs (@erikgrinaker)
|
||||
|
||||
## v0.34.0-rc4
|
||||
|
||||
*September 24, 2020*
|
||||
|
||||
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- CLI/RPC/Config
|
||||
- [config] [\#5315](https://github.com/tendermint/tendermint/issues/5315) Rename `prof_laddr` to `pprof_laddr` and move it to `rpc` section (@melekes)
|
||||
- [rpc] [\#5315](https://github.com/tendermint/tendermint/issues/5315) Remove `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler` and `/unsafe_write_heap_profile`. Please use pprof functionality instead (@melekes)
|
||||
- [rpc/client, rpc/jsonrpc/client] [\#5347](https://github.com/tendermint/tendermint/issues/5347) All client methods now accept `context.Context` as 1st param (@melekes)
|
||||
|
||||
- Apps
|
||||
- [abci] [\#5324](https://github.com/tendermint/tendermint/pull/5324) abci evidence type is an enum with two types of possible evidence (@cmwaters)
|
||||
|
||||
- P2P Protocol
|
||||
- [mempool] [\#5321](https://github.com/tendermint/tendermint/issues/5321) Batch transactions when broadcasting them to peers (@melekes) `MaxBatchBytes` new config setting defines the max size of one batch.
|
||||
|
||||
- Go API
|
||||
- [evidence] [\#5317](https://github.com/tendermint/tendermint/issues/5317) Remove ConflictingHeaders evidence type & CompositeEvidence Interface. (@marbar3778)
|
||||
- [evidence] [\#5318](https://github.com/tendermint/tendermint/issues/5318) Remove LunaticValidator evidence type. (@marbar3778)
|
||||
- [evidence] [\#5319](https://github.com/tendermint/tendermint/issues/5319) Remove Amnesia & potentialAmnesia evidence types and removed POLC. (@marbar3778)
|
||||
- [evidence] [\#5361](https://github.com/tendermint/tendermint/pull/5361) Add LightClientAttackEvidence and change evidence interface (@cmwaters)
|
||||
- [params] [\#5319](https://github.com/tendermint/tendermint/issues/5319) Remove `ProofofTrialPeriod` from evidence params (@marbar3778)
|
||||
- [light] [\#5347](https://github.com/tendermint/tendermint/issues/5347) `NewClient`, `NewHTTPClient`, `VerifyHeader` and `VerifyLightBlockAtHeight` now accept `context.Context` as 1st param (@melekes)
|
||||
- [state] [\#5348](https://github.com/tendermint/tendermint/issues/5348) Define an Interface for the state store. (@marbar3778)
|
||||
|
||||
### FEATURES
|
||||
|
||||
- [privval] [\#5239](https://github.com/tendermint/tendermint/issues/5239) Add `chainID` to requests from client. (@marbar3778)
|
||||
- [config] [\#5147](https://github.com/tendermint/tendermint/issues/5147) Add `--consensus.double_sign_check_height` flag and `DoubleSignCheckHeight` config variable. See [ADR-51](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-051-double-signing-risk-reduction.md)
|
||||
- [light] [\#5298](https://github.com/tendermint/tendermint/pull/5298) Morph validator set and signed header into light block (@cmwaters)
|
||||
- [evidence] [\#5361](https://github.com/tendermint/tendermint/pull/5361) Add LightClientAttackEvidence and refactor evidence lifecycle (@cmwaters)
|
||||
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [blockchain] [\#5278](https://github.com/tendermint/tendermint/issues/5278) Verify only +2/3 of the signatures in a block when fast syncing. (@marbar3778)
|
||||
- [rpc] [\#5293](https://github.com/tendermint/tendermint/issues/5293) `/dial_peers` has added `private` and `unconditional` as parameters. (@marbar3778)
|
||||
- [types] [\#5340](https://github.com/tendermint/tendermint/issues/5340) Add check in `Header.ValidateBasic()` for block protocol version (@marbar3778)
|
||||
- [statesync] [\#5399](https://github.com/tendermint/tendermint/issues/5399) Add `discovery_time` configuration setting, and reduce default to 15s. (@erikgrinaker)
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
- [blockchain] [\#5249](https://github.com/tendermint/tendermint/issues/5249) Fix fast sync halt with initial height > 1 (@erikgrinaker)
|
||||
- [statesync] [\#5302](https://github.com/tendermint/tendermint/issues/5302) Fix genesis state propagation to state sync routine (@erikgrinaker)
|
||||
- [statesync] [\#5320](https://github.com/tendermint/tendermint/issues/5320) Broadcast snapshot request to all pre-connected peers on start (@erikgrinaker)
|
||||
- [consensus] [\#5329](https://github.com/tendermint/tendermint/issues/5329) Fix wrong proposer schedule for validators returned by `InitChain` (@erikgrinaker)
|
||||
- [store] [\#5382](https://github.com/tendermint/tendermint/issues/5382) Fix race conditions when loading/saving/pruning blocks (@erikgrinaker)
|
||||
- [light] [\#5307](https://github.com/tendermint/tendermint/pull/5307) Persist correct proposer priority in light client validator sets (@cmwaters)
|
||||
- [docker] [\#5385](https://github.com/tendermint/tendermint/issues/5385) Fix incorrect `time_iota_ms` default setting causing block timestamp drift (@erikgrinaker)
|
||||
- [abci] [\#5395](https://github.com/tendermint/tendermint/issues/5395) Fix socket client error for state sync responses (@erikgrinaker)
|
||||
|
||||
|
||||
## v0.34.0-rc3
|
||||
|
||||
*August 13, 2020*
|
||||
|
||||
Special thanks to external contributors on this release: @SadPencil
|
||||
|
||||
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES:
|
||||
|
||||
- Blockchain Protocol
|
||||
- [\#5193](https://github.com/tendermint/tendermint/pull/5193) Header hashes are no longer empty for empty inputs, notably `DataHash`, `EvidenceHash`, and `LastResultsHash` (@erikgrinaker)
|
||||
|
||||
- Go API
|
||||
- [evidence] [\#5181](https://github.com/tendermint/tendermint/pull/5181) Phantom validator evidence was removed (@cmwaters)
|
||||
- [merkle] [\#5193](https://github.com/tendermint/tendermint/pull/5193) `HashFromByteSlices` and `ProofsFromByteSlices` now return a hash for empty inputs, following RFC6962 (@erikgrinaker)
|
||||
- [crypto] [\#5214](https://github.com/tendermint/tendermint/issues/5214) Change `GenPrivKeySecp256k1` to `GenPrivKeyFromSecret` to be consistent with other keys (@marbar3778)
|
||||
- [state] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `State.InitialHeight` field to record initial block height, must be `1` (not `0`) to start from 1 (@erikgrinaker)
|
||||
- [state] [\#5231](https://github.com/tendermint/tendermint/issues/5231) `LoadStateFromDBOrGenesisFile()` and `LoadStateFromDBOrGenesisDoc()` no longer saves the state in the database if not found, the genesis state is simply returned (@erikgrinaker)
|
||||
- [crypto] [\#5236](https://github.com/tendermint/tendermint/issues/5236) `VerifyBytes` is now `VerifySignature` on the `crypto.PubKey` interface (@marbar3778)
|
||||
|
||||
### FEATURES:
|
||||
|
||||
- [abci] [\#5174](https://github.com/tendermint/tendermint/pull/5174) Add amnesia evidence and remove mock and potential amnesia evidence from abci (@cmwaters)
|
||||
- [abci] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `InitChain.InitialHeight` field giving the initial block height (@erikgrinaker)
|
||||
- [abci] [\#5227](https://github.com/tendermint/tendermint/pull/5227) Add `ResponseInitChain.app_hash` which is recorded in genesis block (@erikgrinaker)
|
||||
- [genesis] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `initial_height` field to specify the initial chain height (defaults to `1`) (@erikgrinaker)
|
||||
- [db] [\#5233](https://github.com/tendermint/tendermint/issues/5233) Add support for `badgerdb` database backend (@erikgrinaker)
|
||||
|
||||
### IMPROVEMENTS:
|
||||
|
||||
- [evidence] [\#5219](https://github.com/tendermint/tendermint/pull/5219) Change the source of evidence time to block time (@cmwaters)
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [evidence] [\#5170](https://github.com/tendermint/tendermint/pull/5170) change abci evidence time to the time the infraction happened not the time the evidence was committed on the block (@cmwaters)
|
||||
- [node] [\#5211](https://github.com/tendermint/tendermint/issues/5211) Don't attempt fast sync when the ABCI application specifies ourself as the only validator via `InitChain` (@erikgrinaker)
|
||||
- [libs/rand] [\#5215](https://github.com/tendermint/tendermint/pull/5215) Fix out-of-memory error on unexpected argument of Str() (@SadPencil)
|
||||
|
||||
|
||||
## v0.34.0-rc2
|
||||
|
||||
*July 30, 2020*
|
||||
Holy smokes, this is a big one! For a more reader-friendly overview of the changes in 0.34.0
|
||||
(and of the changes you need to accommodate as a user), check out [UPGRADING.md](UPGRADING.md).
|
||||
|
||||
Special thanks to external contributors on this release: @james-ray, @fedekunze, @favadi, @alessio,
|
||||
@joe-bowman, @cuonglm
|
||||
@joe-bowman, @cuonglm, @SadPencil and @dongsam.
|
||||
|
||||
Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
And as always, friendly reminder, that we have a [bug bounty program](https://hackerone.com/tendermint).
|
||||
|
||||
### BREAKING CHANGES:
|
||||
### BREAKING CHANGES
|
||||
|
||||
- CLI/RPC/Config
|
||||
|
||||
- [evidence] [\#4959](https://github.com/tendermint/tendermint/issues/4959) Add json tags to `DuplicateVoteEvidence`
|
||||
- [light] [\#4946](https://github.com/tendermint/tendermint/issues/4946) `tendermint lite` cmd has been renamed to `tendermint light`
|
||||
- [privval] [\#4582](https://github.com/tendermint/tendermint/issues/4582) `round` in private_validator_state.json is no longer a string in json it is now a number
|
||||
- [config] [\#5315](https://github.com/tendermint/tendermint/pull/5315) Rename `prof_laddr` to `pprof_laddr` and move it to `rpc` section (@melekes)
|
||||
- [evidence] [\#4959](https://github.com/tendermint/tendermint/pull/4959) Add JSON tags to `DuplicateVoteEvidence` (@marbar3778)
|
||||
- [light] [\#4946](https://github.com/tendermint/tendermint/pull/4946) `tendermint lite` command has been renamed to `tendermint light` (@marbar3778)
|
||||
- [privval] [\#4582](https://github.com/tendermint/tendermint/pull/4582) `round` in private_validator_state.json is no longer JSON string; instead it is a number (@marbar3778)
|
||||
- [rpc] [\#4792](https://github.com/tendermint/tendermint/pull/4792) `/validators` are now sorted by voting power (@melekes)
|
||||
- [rpc] [\#4937](https://github.com/tendermint/tendermint/issues/4937) Return an error when `page` pagination param is 0 in `/validators`, `tx_search` (@melekes)
|
||||
- [rpc] [\#5137](https://github.com/tendermint/tendermint/issues/5137) The json tags of `gasWanted` & `gasUsed` in `ResponseCheckTx` & `ResponseDeliverTx` have been made snake_case. (`gas_wanted` & `gas_used`)
|
||||
- [rpc] [\#4947](https://github.com/tendermint/tendermint/pull/4947) Return an error when `page` pagination param is 0 in `/validators`, `tx_search` (@melekes)
|
||||
- [rpc] [\#5137](https://github.com/tendermint/tendermint/pull/5137) JSON tags of `gasWanted` and `gasUsed` in `ResponseCheckTx` and `ResponseDeliverTx` have been made snake_case (`gas_wanted` and `gas_used`) (@marbar3778)
|
||||
- [rpc] [\#5315](https://github.com/tendermint/tendermint/pull/5315) Remove `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler` and `/unsafe_write_heap_profile`. Please use pprof functionality instead (@melekes)
|
||||
- [rpc/client, rpc/jsonrpc/client] [\#5347](https://github.com/tendermint/tendermint/pull/5347) All client methods now accept `context.Context` as 1st param (@melekes)
|
||||
|
||||
- Apps
|
||||
|
||||
- [abci] [\#4704](https://github.com/tendermint/tendermint/pull/4704) Add ABCI methods `ListSnapshots`, `LoadSnapshotChunk`, `OfferSnapshot`, and `ApplySnapshotChunk` for state sync snapshots. `ABCIVersion` bumped to 0.17.0.
|
||||
- [abci] [\#4989](https://github.com/tendermint/tendermint/issues/4989) `Proof` within `ResponseQuery` has been renamed to `ProofOps`
|
||||
- [abci] `CheckTxType` Protobuf enum names are now uppercase, to follow Protobuf style guide
|
||||
- [abci] [\#4704](https://github.com/tendermint/tendermint/pull/4704) Add ABCI methods `ListSnapshots`, `LoadSnapshotChunk`, `OfferSnapshot`, and `ApplySnapshotChunk` for state sync snapshots. `ABCIVersion` bumped to 0.17.0. (@erikgrinaker)
|
||||
- [abci] [\#4989](https://github.com/tendermint/tendermint/pull/4989) `Proof` within `ResponseQuery` has been renamed to `ProofOps` (@marbar3778)
|
||||
- [abci] [\#5096](https://github.com/tendermint/tendermint/pull/5096) `CheckTxType` Protobuf enum names are now uppercase, to follow Protobuf style guide (@erikgrinaker)
|
||||
- [abci] [\#5324](https://github.com/tendermint/tendermint/pull/5324) ABCI evidence type is now an enum with two types of possible evidence (@cmwaters)
|
||||
|
||||
- P2P Protocol
|
||||
|
||||
- [blockchain] [\#4637](https://github.com/tendermint/tendermint/issues/4637) Migrate blockchain reactor(s) to Protobuf encoding
|
||||
- [evidence] [\#4949](https://github.com/tendermint/tendermint/issues/4949) Migrate evidence reactor to Protobuf encoding
|
||||
- [mempool] [\#4940](https://github.com/tendermint/tendermint/issues/4940) Migrate mempool from to Protobuf encoding
|
||||
- [p2p/pex] [\#4973](https://github.com/tendermint/tendermint/issues/4973) Migrate `p2p/pex` reactor to Protobuf encoding
|
||||
- [statesync] [\#4943](https://github.com/tendermint/tendermint/issues/4943) Migrate state sync reactor to Protobuf encoding
|
||||
- [blockchain] [\#4637](https://github.com/tendermint/tendermint/pull/4637) Migrate blockchain reactor(s) to Protobuf encoding (@marbar3778)
|
||||
- [evidence] [\#4949](https://github.com/tendermint/tendermint/pull/4949) Migrate evidence reactor to Protobuf encoding (@marbar3778)
|
||||
- [mempool] [\#4940](https://github.com/tendermint/tendermint/pull/4940) Migrate mempool from to Protobuf encoding (@marbar3778)
|
||||
- [mempool] [\#5321](https://github.com/tendermint/tendermint/pull/5321) Batch transactions when broadcasting them to peers (@melekes)
|
||||
- `MaxBatchBytes` new config setting defines the max size of one batch.
|
||||
- [p2p/pex] [\#4973](https://github.com/tendermint/tendermint/pull/4973) Migrate `p2p/pex` reactor to Protobuf encoding (@marbar3778)
|
||||
- [statesync] [\#4943](https://github.com/tendermint/tendermint/pull/4943) Migrate state sync reactor to Protobuf encoding (@marbar3778)
|
||||
|
||||
- Blockchain Protocol
|
||||
|
||||
- [evidence] [\#4780](https://github.com/tendermint/tendermint/pull/4780) Cap evidence to an absolute number (@cmwaters)
|
||||
- Add `max_num` to consensus evidence parameters (default: 50 items).
|
||||
- [evidence] [\#4725](https://github.com/tendermint/tendermint/issues/4725) Remove `Pubkey` from `DuplicateVoteEvidence`
|
||||
- [state] [\#4845](https://github.com/tendermint/tendermint/issues/4845) Include `GasWanted` and `GasUsed` into `LastResultsHash` (@melekes)
|
||||
- [evidence] [\#4725](https://github.com/tendermint/tendermint/pull/4725) Remove `Pubkey` from `DuplicateVoteEvidence` (@marbar3778)
|
||||
- [evidence] [\#5499](https://github.com/tendermint/tendermint/pull/5449) Cap evidence to a maximum number of bytes (supercedes [\#4780](https://github.com/tendermint/tendermint/pull/4780)) (@cmwaters)
|
||||
- [merkle] [\#5193](https://github.com/tendermint/tendermint/pull/5193) Header hashes are no longer empty for empty inputs, notably `DataHash`, `EvidenceHash`, and `LastResultsHash` (@erikgrinaker)
|
||||
- [state] [\#4845](https://github.com/tendermint/tendermint/pull/4845) Include `GasWanted` and `GasUsed` into `LastResultsHash` (@melekes)
|
||||
- [types] [\#4792](https://github.com/tendermint/tendermint/pull/4792) Sort validators by voting power to enable faster commit verification (@melekes)
|
||||
|
||||
- On-disk serialization
|
||||
|
||||
- [state] [\#4679](https://github.com/tendermint/tendermint/issues/4679) Migrate state module to Protobuf encoding
|
||||
- [state] [\#4679](https://github.com/tendermint/tendermint/pull/4679) Migrate state module to Protobuf encoding (@marbar3778)
|
||||
- `BlockStoreStateJSON` is now `BlockStoreState` and is encoded as binary in the database
|
||||
- [store] [\#4778](https://github.com/tendermint/tendermint/issues/4778) Migrate store module to Protobuf encoding
|
||||
- [store] [\#4778](https://github.com/tendermint/tendermint/pull/4778) Migrate store module to Protobuf encoding (@marbar3778)
|
||||
|
||||
- Light client, private validator
|
||||
|
||||
- [light] [\#4964](https://github.com/tendermint/tendermint/issues/4964) Migrate light module migration to Protobuf encoding
|
||||
- [privval] [\#4985](https://github.com/tendermint/tendermint/issues/4985) Migrate `privval` module to Protobuf encoding
|
||||
- [light] [\#4964](https://github.com/tendermint/tendermint/pull/4964) Migrate light module migration to Protobuf encoding (@marbar3778)
|
||||
- [privval] [\#4985](https://github.com/tendermint/tendermint/pull/4985) Migrate `privval` module to Protobuf encoding (@marbar3778)
|
||||
|
||||
- Go API
|
||||
|
||||
- [light] [\#4946](https://github.com/tendermint/tendermint/issues/4946) Rename `lite2` pkg to `light`. Remove `lite` implementation.
|
||||
- [consensus] [\#4582](https://github.com/tendermint/tendermint/pull/4582) RoundState: `Round`, `LockedRound` & `CommitRound` are now `int32` (@marbar3778)
|
||||
- [consensus] [\#4582](https://github.com/tendermint/tendermint/pull/4582) HeightVoteSet: `round` is now `int32` (@marbar3778)
|
||||
- [crypto] [\#4721](https://github.com/tendermint/tendermint/pull/4721) Remove `SimpleHashFromMap()` and `SimpleProofsFromMap()` (@erikgrinaker)
|
||||
- [crypto] [\#4940](https://github.com/tendermint/tendermint/issues/4940) All keys have become `[]byte` instead of `[<size>]byte`. The byte method no longer returns the marshaled value but just the `[]byte` form of the data.
|
||||
- [crypto] \4988 Removal of key type multisig
|
||||
- [crypto] [\#4940](https://github.com/tendermint/tendermint/pull/4940) All keys have become `[]byte` instead of `[<size>]byte`. The byte method no longer returns the marshaled value but just the `[]byte` form of the data. (@marbar3778)
|
||||
- [crypto] [\#4988](https://github.com/tendermint/tendermint/pull/4988) Removal of key type multisig (@marbar3778)
|
||||
- The key has been moved to the [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk/blob/master/crypto/types/multisig/multisignature.go)
|
||||
- [crypto] [\#4989](https://github.com/tendermint/tendermint/issues/4989) Remove `Simple` prefixes from `SimpleProof`, `SimpleValueOp` & `SimpleProofNode`.
|
||||
- [crypto] [\#4989](https://github.com/tendermint/tendermint/pull/4989) Remove `Simple` prefixes from `SimpleProof`, `SimpleValueOp` & `SimpleProofNode`. (@marbar3778)
|
||||
- `merkle.Proof` has been renamed to `ProofOps`.
|
||||
- Protobuf messages `Proof` & `ProofOp` has been moved to `proto/crypto/merkle`
|
||||
- `SimpleHashFromByteSlices` has been renamed to `HashFromByteSlices`
|
||||
- `SimpleHashFromByteSlicesIterative` has been renamed to `HashFromByteSlicesIterative`
|
||||
- `SimpleProofsFromByteSlices` has been renamed to `ProofsFromByteSlices`
|
||||
- [crypto] [\#4941](https://github.com/tendermint/tendermint/issues/4941) Remove suffixes from all keys.
|
||||
- [crypto] [\#4941](https://github.com/tendermint/tendermint/pull/4941) Remove suffixes from all keys. (@marbar3778)
|
||||
- ed25519: type `PrivKeyEd25519` is now `PrivKey`
|
||||
- ed25519: type `PubKeyEd25519` is now `PubKey`
|
||||
- secp256k1: type`PrivKeySecp256k1` is now `PrivKey`
|
||||
- secp256k1: type`PubKeySecp256k1` is now `PubKey`
|
||||
- sr25519: type `PrivKeySr25519` is now `PrivKey`
|
||||
- sr25519: type `PubKeySr25519` is now `PubKey`
|
||||
- multisig: type `PubKeyMultisigThreshold` is now `PubKey`
|
||||
- [libs] [\#4831](https://github.com/tendermint/tendermint/issues/4831) Remove `Bech32` pkg from Tendermint. This pkg now lives in the [cosmos-sdk](https://github.com/cosmos/cosmos-sdk/tree/4173ea5ebad906dd9b45325bed69b9c655504867/types/bech32)
|
||||
- [rpc/client] [\#4947](https://github.com/tendermint/tendermint/issues/4947) `Validators`, `TxSearch` `page`/`per_page` params become pointers (@melekes)
|
||||
- `UnconfirmedTxs` `limit` param is a pointer
|
||||
- [proto] [\#5025](https://github.com/tendermint/tendermint/issues/5025) All proto files have been moved to `/proto` directory.
|
||||
- [crypto] [\#5214](https://github.com/tendermint/tendermint/pull/5214) Change `GenPrivKeySecp256k1` to `GenPrivKeyFromSecret` to be consistent with other keys (@marbar3778)
|
||||
- [crypto] [\#5236](https://github.com/tendermint/tendermint/pull/5236) `VerifyBytes` is now `VerifySignature` on the `crypto.PubKey` interface (@marbar3778)
|
||||
- [evidence] [\#5361](https://github.com/tendermint/tendermint/pull/5361) Add LightClientAttackEvidence and change evidence interface (@cmwaters)
|
||||
- [libs] [\#4831](https://github.com/tendermint/tendermint/pull/4831) Remove `Bech32` pkg from Tendermint. This pkg now lives in the [cosmos-sdk](https://github.com/cosmos/cosmos-sdk/tree/4173ea5ebad906dd9b45325bed69b9c655504867/types/bech32) (@marbar3778)
|
||||
- [light] [\#4946](https://github.com/tendermint/tendermint/pull/4946) Rename `lite2` pkg to `light`. Remove `lite` implementation. (@marbar3778)
|
||||
- [light] [\#5347](https://github.com/tendermint/tendermint/pull/5347) `NewClient`, `NewHTTPClient`, `VerifyHeader` and `VerifyLightBlockAtHeight` now accept `context.Context` as 1st param (@melekes)
|
||||
- [merkle] [\#5193](https://github.com/tendermint/tendermint/pull/5193) `HashFromByteSlices` and `ProofsFromByteSlices` now return a hash for empty inputs, following RFC6962 (@erikgrinaker)
|
||||
- [proto] [\#5025](https://github.com/tendermint/tendermint/pull/5025) All proto files have been moved to `/proto` directory. (@marbar3778)
|
||||
- Using the recommended the file layout from buf, [see here for more info](https://buf.build/docs/lint-checkers#file_layout)
|
||||
- [state] [\#4679](https://github.com/tendermint/tendermint/issues/4679) `TxResult` is a Protobuf type defined in `abci` types directory
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/issues/4939) `SignedMsgType` has moved to a Protobuf enum types
|
||||
- [types] [\#4962](https://github.com/tendermint/tendermint/issues/4962) `ConsensusParams`, `BlockParams`, `EvidenceParams`, `ValidatorParams` & `HashedParams` are now Protobuf types
|
||||
- [types] [\#4852](https://github.com/tendermint/tendermint/issues/4852) Vote & Proposal `SignBytes` is now func `VoteSignBytes` & `ProposalSignBytes`
|
||||
- [types] [\#4798](https://github.com/tendermint/tendermint/issues/4798) Simplify `VerifyCommitTrusting` func + remove extra validation (@melekes)
|
||||
- [types] [\#4845](https://github.com/tendermint/tendermint/issues/4845) Remove `ABCIResult`
|
||||
- [types] [\#5029](https://github.com/tendermint/tendermint/issues/5029) Rename all values from `PartsHeader` to `PartSetHeader` to have consistency
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/issues/4939) `Total` in `Parts` & `PartSetHeader` has been changed from a `int` to a `uint32`
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/issues/4939) Vote: `ValidatorIndex` & `Round` are now `int32`
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/issues/4939) Proposal: `POLRound` & `Round` are now `int32`
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/issues/4939) Block: `Round` is now `int32`
|
||||
- [consensus] [\#4582](https://github.com/tendermint/tendermint/issues/4582) RoundState: `Round`, `LockedRound` & `CommitRound` are now `int32`
|
||||
- [consensus] [\#4582](https://github.com/tendermint/tendermint/issues/4582) HeightVoteSet: `round` is now `int32`
|
||||
- [rpc/jsonrpc/server] [\#5141](https://github.com/tendermint/tendermint/issues/5141) Remove `WriteRPCResponseArrayHTTP` (use `WriteRPCResponseHTTP` instead) (@melekes)
|
||||
- [rpc/client] [\#4947](https://github.com/tendermint/tendermint/pull/4947) `Validators`, `TxSearch` `page`/`per_page` params become pointers (@melekes)
|
||||
- `UnconfirmedTxs` `limit` param is a pointer
|
||||
- [rpc/jsonrpc/server] [\#5141](https://github.com/tendermint/tendermint/pull/5141) Remove `WriteRPCResponseArrayHTTP` (use `WriteRPCResponseHTTP` instead) (@melekes)
|
||||
- [state] [\#4679](https://github.com/tendermint/tendermint/pull/4679) `TxResult` is a Protobuf type defined in `abci` types directory (@marbar3778)
|
||||
- [state] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `State.InitialHeight` field to record initial block height, must be `1` (not `0`) to start from 1 (@erikgrinaker)
|
||||
- [state] [\#5231](https://github.com/tendermint/tendermint/pull/5231) `LoadStateFromDBOrGenesisFile()` and `LoadStateFromDBOrGenesisDoc()` no longer saves the state in the database if not found, the genesis state is simply returned (@erikgrinaker)
|
||||
- [state] [\#5348](https://github.com/tendermint/tendermint/pull/5348) Define an Interface for the state store. (@marbar3778)
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/pull/4939) `SignedMsgType` has moved to a Protobuf enum types (@marbar3778)
|
||||
- [types] [\#4962](https://github.com/tendermint/tendermint/pull/4962) `ConsensusParams`, `BlockParams`, `EvidenceParams`, `ValidatorParams` & `HashedParams` are now Protobuf types (@marbar3778)
|
||||
- [types] [\#4852](https://github.com/tendermint/tendermint/pull/4852) Vote & Proposal `SignBytes` is now func `VoteSignBytes` & `ProposalSignBytes` (@marbar3778)
|
||||
- [types] [\#4798](https://github.com/tendermint/tendermint/pull/4798) Simplify `VerifyCommitTrusting` func + remove extra validation (@melekes)
|
||||
- [types] [\#4845](https://github.com/tendermint/tendermint/pull/4845) Remove `ABCIResult` (@melekes)
|
||||
- [types] [\#5029](https://github.com/tendermint/tendermint/pull/5029) Rename all values from `PartsHeader` to `PartSetHeader` to have consistency (@marbar3778)
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/pull/4939) `Total` in `Parts` & `PartSetHeader` has been changed from a `int` to a `uint32` (@marbar3778)
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/pull/4939) Vote: `ValidatorIndex` & `Round` are now `int32` (@marbar3778)
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/pull/4939) Proposal: `POLRound` & `Round` are now `int32` (@marbar3778)
|
||||
- [types] [\#4939](https://github.com/tendermint/tendermint/pull/4939) Block: `Round` is now `int32` (@marbar3778)
|
||||
|
||||
### FEATURES:
|
||||
### FEATURES
|
||||
|
||||
- [abci] [\#5031](https://github.com/tendermint/tendermint/issues/5031) Add `AppVersion` to consensus parameters (@james-ray)
|
||||
- ... making it possible to update your ABCI application version via `EndBlock` response
|
||||
- [abci] [\#5031](https://github.com/tendermint/tendermint/pull/5031) Add `AppVersion` to consensus parameters (@james-ray)
|
||||
- This makes it possible to update your ABCI application version via `EndBlock` response
|
||||
- [abci] [\#5174](https://github.com/tendermint/tendermint/pull/5174) Remove `MockEvidence` in favor of testing with actual evidence types (`DuplicateVoteEvidence` & `LightClientAttackEvidence`) (@cmwaters)
|
||||
- [abci] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `InitChain.InitialHeight` field giving the initial block height (@erikgrinaker)
|
||||
- [abci] [\#5227](https://github.com/tendermint/tendermint/pull/5227) Add `ResponseInitChain.app_hash` which is recorded in genesis block (@erikgrinaker)
|
||||
- [config] [\#5147](https://github.com/tendermint/tendermint/pull/5147) Add `--consensus.double_sign_check_height` flag and `DoubleSignCheckHeight` config variable. See [ADR-51](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-051-double-signing-risk-reduction.md) (@dongsam)
|
||||
- [db] [\#5233](https://github.com/tendermint/tendermint/pull/5233) Add support for `badgerdb` database backend (@erikgrinaker)
|
||||
- [evidence] [\#4532](https://github.com/tendermint/tendermint/pull/4532) Handle evidence from light clients (@melekes)
|
||||
- [evidence] [#4821](https://github.com/tendermint/tendermint/pull/4821) Amnesia evidence can be detected, verified and committed (@cmwaters)
|
||||
- [light] [\#4532](https://github.com/tendermint/tendermint/pull/4532) Submit conflicting headers, if any, to a full node & all witnesses (@melekes)
|
||||
- [p2p] [\#4981](https://github.com/tendermint/tendermint/issues/4981) Expose `SaveAs` func on NodeKey (@melekes)
|
||||
- [evidence] [#4821](https://github.com/tendermint/tendermint/pull/4821) Amnesia (light client attack) evidence can be detected, verified and committed (@cmwaters)
|
||||
- [genesis] [\#5191](https://github.com/tendermint/tendermint/pull/5191) Add `initial_height` field to specify the initial chain height (defaults to `1`) (@erikgrinaker)
|
||||
- [libs/math] [\#5665](https://github.com/tendermint/tendermint/pull/5665) Make fractions unsigned integers (uint64) (@cmwaters)
|
||||
- [light] [\#5298](https://github.com/tendermint/tendermint/pull/5298) Morph validator set and signed header into light block (@cmwaters)
|
||||
- [p2p] [\#4981](https://github.com/tendermint/tendermint/pull/4981) Expose `SaveAs` func on NodeKey (@melekes)
|
||||
- [privval] [\#5239](https://github.com/tendermint/tendermint/pull/5239) Add `chainID` to requests from client. (@marbar3778)
|
||||
- [rpc] [\#4532](https://github.com/tendermint/tendermint/pull/4923) Support `BlockByHash` query (@fedekunze)
|
||||
- [rpc] [\#4979](https://github.com/tendermint/tendermint/issues/4979) Support EXISTS operator in `/tx_search` query (@melekes)
|
||||
- [rpc] [\#5017](https://github.com/tendermint/tendermint/issues/5017) Add `/check_tx` endpoint to check transactions without executing them or adding them to the mempool (@melekes)
|
||||
- [statesync] Add state sync support, where a new node can be rapidly bootstrapped by fetching state snapshots from peers instead of replaying blocks. See the `[statesync]` config section.
|
||||
- [rpc] [\#4979](https://github.com/tendermint/tendermint/pull/4979) Support EXISTS operator in `/tx_search` query (@melekes)
|
||||
- [rpc] [\#5017](https://github.com/tendermint/tendermint/pull/5017) Add `/check_tx` endpoint to check transactions without executing them or adding them to the mempool (@melekes)
|
||||
- [rpc] [\#5108](https://github.com/tendermint/tendermint/pull/5108) Subscribe using the websocket for new evidence events (@cmwaters)
|
||||
- [statesync] Add state sync support, where a new node can be rapidly bootstrapped by fetching state snapshots from peers instead of replaying blocks. See the `[statesync]` config section.
|
||||
- [evidence] [\#5361](https://github.com/tendermint/tendermint/pull/5361) Add LightClientAttackEvidence and refactor evidence lifecycle - for more information see [ADR-059](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-059-evidence-composition-and-lifecycle.md) (@cmwaters)
|
||||
|
||||
### IMPROVEMENTS:
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [consensus] [\#4578](https://github.com/tendermint/tendermint/issues/4578) Attempt to repair the consensus WAL file (`data/cs.wal/wal`) automatically in case of corruption (@alessio)
|
||||
- [blockchain] [\#5278](https://github.com/tendermint/tendermint/pull/5278) Verify only +2/3 of the signatures in a block when fast syncing. (@marbar3778)
|
||||
- [consensus] [\#4578](https://github.com/tendermint/tendermint/pull/4578) Attempt to repair the consensus WAL file (`data/cs.wal/wal`) automatically in case of corruption (@alessio)
|
||||
- The original WAL file will be backed up to `data/cs.wal/wal.CORRUPTED`.
|
||||
- [evidence] [\#4722](https://github.com/tendermint/tendermint/pull/4722) Improved evidence db (@cmwaters)
|
||||
- [consensus] [\#5143](https://github.com/tendermint/tendermint/pull/5143) Only call `privValidator.GetPubKey` once per block (@melekes)
|
||||
- [evidence] [\#4722](https://github.com/tendermint/tendermint/pull/4722) Consolidate evidence store and pool types to improve evidence DB (@cmwaters)
|
||||
- [evidence] [\#4839](https://github.com/tendermint/tendermint/pull/4839) Reject duplicate evidence from being proposed (@cmwaters)
|
||||
- [evidence] [\#4892](https://github.com/tendermint/tendermint/pull/4892) Remove redundant header from phantom validator evidence (@cmwaters)
|
||||
- [evidence] [\#5219](https://github.com/tendermint/tendermint/pull/5219) Change the source of evidence time to block time (@cmwaters)
|
||||
- [libs] [\#5126](https://github.com/tendermint/tendermint/pull/5126) Add a sync package which wraps sync.(RW)Mutex & deadlock.(RW)Mutex and use a build flag (deadlock) in order to enable deadlock checking (@marbar3778)
|
||||
- [light] [\#4935](https://github.com/tendermint/tendermint/pull/4935) Fetch and compare a new header with witnesses in parallel (@melekes)
|
||||
- [light] [\#4929](https://github.com/tendermint/tendermint/pull/4929) compare header w/ witnesses only when doing bisection (@melekes)
|
||||
- [light] [\#4916](https://github.com/tendermint/tendermint/pull/4916) validate basic for inbound validator sets and headers before further processing them (@cmwaters)
|
||||
- [p2p/conn] [\#4795](https://github.com/tendermint/tendermint/issues/4795) Return err on `signChallenge()` instead of panic
|
||||
- [light] [\#4929](https://github.com/tendermint/tendermint/pull/4929) Compare header with witnesses only when doing bisection (@melekes)
|
||||
- [light] [\#4916](https://github.com/tendermint/tendermint/pull/4916) Validate basic for inbound validator sets and headers before further processing them (@cmwaters)
|
||||
- [mempool] Add RemoveTxByKey() exported function for custom mempool cleaning (@p4u)
|
||||
- [p2p/conn] [\#4795](https://github.com/tendermint/tendermint/pull/4795) Return err on `signChallenge()` instead of panic
|
||||
- [privval] [\#5437](https://github.com/tendermint/tendermint/pull/5437) `NewSignerDialerEndpoint` can now be given `SignerServiceEndpointOption` (@erikgrinaker)
|
||||
- [rpc] [\#4968](https://github.com/tendermint/tendermint/pull/4968) JSON encoding is now handled by `libs/json`, not Amino (@erikgrinaker)
|
||||
- [rpc] [\#5293](https://github.com/tendermint/tendermint/pull/5293) `/dial_peers` has added `private` and `unconditional` as parameters. (@marbar3778)
|
||||
- [state] [\#4781](https://github.com/tendermint/tendermint/pull/4781) Export `InitStateVersion` for the initial state version (@erikgrinaker)
|
||||
- [txindex] [\#4466](https://github.com/tendermint/tendermint/pull/4466) Allow to index an event at runtime (@favadi)
|
||||
- `abci.EventAttribute` replaces `KV.Pair`
|
||||
- [libs] [\#5126](https://github.com/tendermint/tendermint/issues/5126) Add a sync package which wraps sync.(RW)Mutex & deadlock.(RW)Mutex and use a build flag (deadlock) in order to enable deadlock checking
|
||||
- [types] [\#4905](https://github.com/tendermint/tendermint/pull/4905) Add `ValidateBasic` to validator and validator set (@cmwaters)
|
||||
- [rpc] [\#4968](https://github.com/tendermint/tendermint/issues/4968) JSON encoding is now handled by `libs/json`, not Amino
|
||||
- [mempool] Add RemoveTxByKey() exported function for custom mempool cleaning (@p4u)
|
||||
- [consensus] [\#5143](https://github.com/tendermint/tendermint/issues/5143) Only call `privValidator.GetPubKey` once per block (@melekes)
|
||||
- [types] [\#5340](https://github.com/tendermint/tendermint/pull/5340) Add check in `Header.ValidateBasic()` for block protocol version (@marbar3778)
|
||||
- [types] [\#5490](https://github.com/tendermint/tendermint/pull/5490) Use `Commit` and `CommitSig` max sizes instead of vote max size to calculate the maximum block size. (@cmwaters)
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
- [blockchain/v2] Correctly set block store base in status responses (@erikgrinaker)
|
||||
### BUG FIXES
|
||||
|
||||
- [abci/grpc] [\#5520](https://github.com/tendermint/tendermint/pull/5520) Return async responses in order, to avoid mempool panics. (@erikgrinaker)
|
||||
- [blockchain/v2] [\#4971](https://github.com/tendermint/tendermint/pull/4971) Correctly set block store base in status responses (@erikgrinaker)
|
||||
- [blockchain/v2] [\#5499](https://github.com/tendermint/tendermint/pull/5499) Fix "duplicate block enqueued by processor" panic (@melekes)
|
||||
- [blockchain/v2] [\#5530](https://github.com/tendermint/tendermint/pull/5530) Fix out of order block processing panic (@melekes)
|
||||
- [blockchain/v2] [\#5553](https://github.com/tendermint/tendermint/pull/5553) Make the removal of an already removed peer a noop (@melekes)
|
||||
- [consensus] [\#4895](https://github.com/tendermint/tendermint/pull/4895) Cache the address of the validator to reduce querying a remote KMS (@joe-bowman)
|
||||
- [consensus] [\#4970](https://github.com/tendermint/tendermint/issues/4970) Stricter on `LastCommitRound` check (@cuonglm)
|
||||
- [p2p][\#5136](https://github.com/tendermint/tendermint/pull/5136) Fix error for peer with the same ID but different IPs (@valardragon)
|
||||
- [proxy] [\#5078](https://github.com/tendermint/tendermint/issues/5078) Fix a bug, where TM does not exit when ABCI app crashes (@melekes)
|
||||
|
||||
|
||||
## v0.34.0-rc1
|
||||
|
||||
This release was removed, as a premature GitHub tag was recorded on sum.golang.org causing checksum errors.
|
||||
- [consensus] [\#4970](https://github.com/tendermint/tendermint/pull/4970) Don't allow `LastCommitRound` to be negative (@cuonglm)
|
||||
- [consensus] [\#5329](https://github.com/tendermint/tendermint/pull/5329) Fix wrong proposer schedule for validators returned by `InitChain` (@erikgrinaker)
|
||||
- [docker] [\#5385](https://github.com/tendermint/tendermint/pull/5385) Fix incorrect `time_iota_ms` default setting causing block timestamp drift (@erikgrinaker)
|
||||
- [evidence] [\#5170](https://github.com/tendermint/tendermint/pull/5170) Change ABCI evidence time to the time the infraction happened not the time the evidence was committed on the block (@cmwaters)
|
||||
- [evidence] [\#5610](https://github.com/tendermint/tendermint/pull/5610) Make it possible for ABCI evidence to be formed from Tendermint evidence (@cmwaters)
|
||||
- [libs/rand] [\#5215](https://github.com/tendermint/tendermint/pull/5215) Fix out-of-memory error on unexpected argument of Str() (@SadPencil)
|
||||
- [light] [\#5307](https://github.com/tendermint/tendermint/pull/5307) Persist correct proposer priority in light client validator sets (@cmwaters)
|
||||
- [p2p] [\#5136](https://github.com/tendermint/tendermint/pull/5136) Fix error for peer with the same ID but different IPs (@valardragon)
|
||||
- [privval] [\#5638](https://github.com/tendermint/tendermint/pull/5638) Increase read/write timeout to 5s and calculate ping interval based on it (@JoeKash)
|
||||
- [proxy] [\#5078](https://github.com/tendermint/tendermint/pull/5078) Force Tendermint to exit when ABCI app crashes (@melekes)
|
||||
- [rpc] [\#5660](https://github.com/tendermint/tendermint/pull/5660) Set `application/json` as the `Content-Type` header in RPC responses. (@alexanderbez)
|
||||
- [store] [\#5382](https://github.com/tendermint/tendermint/pull/5382) Fix race conditions when loading/saving/pruning blocks (@erikgrinaker)
|
||||
|
||||
## v0.33.8
|
||||
|
||||
|
||||
+11
-2
@@ -9,14 +9,16 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
|
||||
### BREAKING CHANGES
|
||||
|
||||
- CLI/RPC/Config
|
||||
|
||||
- [config] \#5598 The `test_fuzz` and `test_fuzz_config` P2P settings have been removed. (@erikgrinaker)
|
||||
- [config] \#5598 The `test_fuzz` and `test_fuzz_config` P2P settings have been removed. (@erikgrinaker)
|
||||
|
||||
- Apps
|
||||
|
||||
- P2P Protocol
|
||||
|
||||
- Go API
|
||||
- [p2p] Removed unused function `MakePoWTarget`. (@erikgrinaker)
|
||||
|
||||
- [libs/os] Kill() and {Must,}{Read,Write}File() functions have been removed. (@alessio)
|
||||
|
||||
- Blockchain Protocol
|
||||
|
||||
@@ -24,6 +26,13 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
|
||||
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [crypto/ed25519] \#5632 Adopt zip215 `ed25519` verification. (@marbar3778)
|
||||
- [privval] \#5603 Add `--key` to `init`, `gen_validator`, `testnet` & `unsafe_reset_priv_validator` for use in generating `secp256k1` keys.
|
||||
- [abci] \#5706 Added `AbciVersion` to `RequestInfo` allowing applications to check ABCI version when connecting to Tendermint. (@marbar3778)
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
- [types] \#5523 Change json naming of `PartSetHeader` within `BlockID` from `parts` to `part_set_header` (@marbar3778)
|
||||
- [privval] \#5638 Increase read/write timeout to 5s and calculate ping interval based on it (@JoeKash)
|
||||
- [blockchain/v1] [\#5701](https://github.com/tendermint/tendermint/pull/5701) Handle peers without blocks (@melekes)
|
||||
- [crypto] \#5707 Fix infinite recursion in string formatting of Secp256k1 keys (@erikgrinaker)
|
||||
|
||||
+44
-13
@@ -106,12 +106,12 @@ specify exactly the dependency you want to update, eg.
|
||||
|
||||
We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use across Tendermint Core.
|
||||
|
||||
For linting and checking breaking changes, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will need to have docker running locally. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`.
|
||||
For linting, checking breaking changes and generating proto stubs, we use [buf](https://buf.build/). If you would like to run linting and check if the changes you have made are breaking then you will need to have docker running locally. Then the linting cmd will be `make proto-lint` and the breaking changes check will be `make proto-check-breaking`.
|
||||
|
||||
There are two ways to generate your proto stubs.
|
||||
|
||||
1. Use Docker, pull an image that will generate your proto stubs with no need to install anything. `make proto-gen-docker`
|
||||
2. Run `make proto-gen` after installing `protoc` and gogoproto, you can do this by running `make protobuf`.
|
||||
2. Run `make proto-gen` after installing `buf` and `gogoproto`, you can do this by running `make protobuf`.
|
||||
|
||||
### Installation Instructions
|
||||
|
||||
@@ -127,18 +127,19 @@ make install
|
||||
|
||||
You should now be able to run `make proto-gen` from inside the root Tendermint directory to generate new files from proto files.
|
||||
|
||||
## Vagrant
|
||||
### Visual Studio Code
|
||||
|
||||
If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started
|
||||
hacking Tendermint with the commands below.
|
||||
If you are a VS Code user, you may want to add the following to your `.vscode/settings.json`:
|
||||
|
||||
NOTE: In case you installed Vagrant in 2017, you might need to run
|
||||
`vagrant box update` to upgrade to the latest `ubuntu/xenial64`.
|
||||
|
||||
```sh
|
||||
vagrant up
|
||||
vagrant ssh
|
||||
make test
|
||||
```json
|
||||
{
|
||||
"protoc": {
|
||||
"options": [
|
||||
"--proto_path=${workspaceRoot}/proto",
|
||||
"--proto_path=${workspaceRoot}/third_party/proto"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Changelog
|
||||
@@ -246,6 +247,36 @@ Each PR should have one commit once it lands on `master`; this can be accomplish
|
||||
|
||||
#### Major Release
|
||||
|
||||
This major release process assumes that this release was preceded by release candidates.
|
||||
If there were no release candidates, and you'd like to cut a major release directly from master, see below.
|
||||
|
||||
1. Start on the latest RC branch (`RCx/vX.X.0`).
|
||||
2. Run integration tests.
|
||||
3. Branch off of the RC branch (`git checkout -b release-prep`) and prepare the release:
|
||||
- "Squash" changes from the changelog entries for the RCs into a single entry,
|
||||
and add all changes included in `CHANGELOG_PENDING.md`.
|
||||
(Squashing includes both combining all entries, as well as removing or simplifying
|
||||
any intra-RC changes. It may also help to alphabetize the entries by package name.)
|
||||
- Run `python ./scripts/linkify_changelog.py CHANGELOG.md` to add links for
|
||||
all PRs
|
||||
- Ensure that UPGRADING.md is up-to-date and includes notes on any breaking changes
|
||||
or other upgrading flows.
|
||||
- Bump P2P and block protocol versions in `version.go`, if necessary
|
||||
- Bump ABCI protocol version in `version.go`, if necessary
|
||||
- Add any release notes you would like to be added to the body of the release to `release_notes.md`.
|
||||
4. Open a PR with these changes against the RC branch (`RCx/vX.X.0`).
|
||||
5. Once these changes are on the RC branch, branch off of the RC branch again to create a release branch:
|
||||
- `git checkout RCx/vX.X.0`
|
||||
- `git checkout -b release/vX.X.0`
|
||||
6. Push a tag with prepared release details. This will trigger the actual release `vX.X.0`.
|
||||
- `git tag -a vX.X.0 -m 'Release vX.X.0'`
|
||||
- `git push origin vX.X.0`
|
||||
7. Make sure that `master` is updated with the latest `CHANGELOG.md`, `CHANGELOG_PENDING.md`, and `UPGRADING.md`.
|
||||
8. Create the long-lived minor release branch `RC0/vX.X.1` for the next point release on this
|
||||
new major release series.
|
||||
|
||||
##### Major Release (from `master`)
|
||||
|
||||
1. Start on `master`
|
||||
2. Run integration tests (see `test_integrations` in Makefile)
|
||||
3. Prepare release in a pull request against `master` (to be squash merged):
|
||||
@@ -264,7 +295,7 @@ Each PR should have one commit once it lands on `master`; this can be accomplish
|
||||
4. Push a tag with prepared release details (this will trigger the release `vX.X.0`)
|
||||
- `git tag -a vX.X.x -m 'Release vX.X.x'`
|
||||
- `git push origin vX.X.x`
|
||||
5. Update the changelog.md file on master with the releases changelog.
|
||||
5. Update the `CHANGELOG.md` file on master with the releases changelog.
|
||||
6. Delete any RC branches and tags for this release (if applicable)
|
||||
|
||||
#### Minor Release
|
||||
|
||||
@@ -52,8 +52,8 @@ all: check build test install
|
||||
.PHONY: all
|
||||
|
||||
# The below include contains the tools.
|
||||
include tools.mk
|
||||
include tests.mk
|
||||
include tools/Makefile
|
||||
include test/Makefile
|
||||
|
||||
###############################################################################
|
||||
### Build Tendermint ###
|
||||
@@ -203,25 +203,6 @@ build-docs:
|
||||
done < versions ;
|
||||
.PHONY: build-docs
|
||||
|
||||
build-gh-docs:
|
||||
@cd docs && \
|
||||
while read -r branch path_prefix; do \
|
||||
(git checkout $${branch} && npm install && VUEPRESS_BASE="/tendermint/$${path_prefix}/" npm run build) ; \
|
||||
mkdir -p ~/output/$${path_prefix} ; \
|
||||
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
|
||||
cp ~/output/$${path_prefix}/index.html ~/output ; \
|
||||
done < versions ;
|
||||
.PHONY: build-docs
|
||||
|
||||
# todo remove once tendermint.com DNS is solved
|
||||
sync-docs:
|
||||
cd ~/output && \
|
||||
echo "role_arn = ${DEPLOYMENT_ROLE_ARN}" >> /root/.aws/config ; \
|
||||
echo "CI job = ${CIRCLE_BUILD_URL}" >> version.html ; \
|
||||
aws s3 sync . s3://${WEBSITE_BUCKET} --profile terraform --delete ; \
|
||||
aws cloudfront create-invalidation --distribution-id ${CF_DISTRIBUTION_ID} --profile terraform --path "/*" ;
|
||||
.PHONY: sync-docs
|
||||
|
||||
###############################################################################
|
||||
### Docker image ###
|
||||
###############################################################################
|
||||
|
||||
@@ -8,7 +8,7 @@ Or [Blockchain](<https://en.wikipedia.org/wiki/Blockchain_(database)>), for shor
|
||||
|
||||
[](https://github.com/tendermint/tendermint/releases/latest)
|
||||
[](https://pkg.go.dev/github.com/tendermint/tendermint)
|
||||
[](https://github.com/moovweb/gvm)
|
||||
[](https://github.com/moovweb/gvm)
|
||||
[](https://discord.gg/AzefAFd)
|
||||
[](https://github.com/tendermint/tendermint/blob/master/LICENSE)
|
||||
[](https://github.com/tendermint/tendermint)
|
||||
@@ -42,13 +42,13 @@ contact us [over email](mailto:hello@interchain.berlin) or [join the chat](https
|
||||
|
||||
To report a security vulnerability, see our [bug bounty
|
||||
program](https://hackerone.com/tendermint).
|
||||
For examples of the kinds of bugs we're looking for, see [our security policy](SECURITY.md)
|
||||
For examples of the kinds of bugs we're looking for, see [our security policy](SECURITY.md).
|
||||
|
||||
## Minimum requirements
|
||||
|
||||
| Requirement | Notes |
|
||||
| ----------- | ---------------- |
|
||||
| Go version | Go1.14 or higher |
|
||||
| Go version | Go1.15 or higher |
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -155,4 +155,5 @@ Additional tooling can be found in [/docs/tools](/docs/tools).
|
||||
- [The latest gossip on BFT consensus](https://arxiv.org/abs/1807.04938)
|
||||
- [Master's Thesis on Tendermint](https://atrium.lib.uoguelph.ca/xmlui/handle/10214/9769)
|
||||
- [Original Whitepaper: "Tendermint: Consensus Without Mining"](https://tendermint.com/static/docs/tendermint.pdf)
|
||||
- [Blog](https://blog.cosmos.network/tendermint/home)
|
||||
- [Tendermint Core Blog](https://medium.com/tendermint/tagged/tendermint-core)
|
||||
- [Cosmos Blog](https://blog.cosmos.network/tendermint/home)
|
||||
|
||||
+34
-9
@@ -2,14 +2,24 @@
|
||||
|
||||
This guide provides instructions for upgrading to specific versions of Tendermint Core.
|
||||
|
||||
## Unreleased
|
||||
|
||||
### ABCI Changes
|
||||
|
||||
* Added `AbciVersion` to `RequestInfo`. Applications should check that the ABCI version they expect is being used in order to avoid unimplemented changes errors.
|
||||
|
||||
## v0.34.0
|
||||
|
||||
**Upgrading to Tendermint 0.34 requires a blockchain restart.**
|
||||
This release is not compatible with previous blockchains due to changes to
|
||||
the encoding format (see "Protocol Buffers," below) and the block header (see "Blockchain Protocol").
|
||||
|
||||
Note also that Tendermint 0.34 also requires Go 1.15 or higher.
|
||||
|
||||
### ABCI Changes
|
||||
|
||||
* The `ABCIVersion` is now `0.17.0`.
|
||||
|
||||
* New ABCI methods (`ListSnapshots`, `LoadSnapshotChunk`, `OfferSnapshot`, and `ApplySnapshotChunk`)
|
||||
were added to support the new State Sync feature.
|
||||
Previously, syncing a new node to a preexisting network could take days; but with State Sync,
|
||||
@@ -61,7 +71,7 @@ fields.
|
||||
|
||||
Tendermint now relies on the application to tell it which transactions to index. This means that
|
||||
in the `config.toml`, generated by Tendermint, there is no longer a way to specify which
|
||||
transactions to index. `tx.height` & `tx.hash` will always be indexed when using the `kv` indexer.
|
||||
transactions to index. `tx.height` and `tx.hash` will always be indexed when using the `kv` indexer.
|
||||
|
||||
Applications must now choose to either a) enable indexing for all transactions, or
|
||||
b) allow node operators to decide which transactions to index.
|
||||
@@ -107,7 +117,7 @@ Tendermint 0.34 includes new and updated consensus parameters.
|
||||
|
||||
#### Evidence Parameters
|
||||
|
||||
* `MaxNum`, which caps the total amount of evidence by a absolute number. The default is 50.
|
||||
* `MaxBytes`, which caps the total amount of evidence. The default is 1048576 (1 MB).
|
||||
|
||||
### Crypto
|
||||
|
||||
@@ -168,16 +178,31 @@ Other user-relevant changes include:
|
||||
### `privval` Package
|
||||
|
||||
All requests are now accompanied by the chain ID from the network.
|
||||
This is a optional field and can be ignored by key management systems.
|
||||
It is recommended to check the chain ID if using the same key management system for multiple chains.
|
||||
This is a optional field and can be ignored by key management systems;
|
||||
however, if you are using the same key management system for multiple different
|
||||
blockchains, we recommend that you check the chain ID.
|
||||
|
||||
|
||||
### RPC
|
||||
|
||||
`/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler` and
|
||||
`/unsafe_write_heap_profile` were removed.
|
||||
For profiling, please use the pprof server, which can
|
||||
be enabled through `--rpc.pprof_laddr=X` flag or `pprof_laddr=X` config setting
|
||||
in the rpc section.
|
||||
* `/unsafe_start_cpu_profiler`, `/unsafe_stop_cpu_profiler` and
|
||||
`/unsafe_write_heap_profile` were removed.
|
||||
For profiling, please use the pprof server, which can
|
||||
be enabled through `--rpc.pprof_laddr=X` flag or `pprof_laddr=X` config setting
|
||||
in the rpc section.
|
||||
* The `Content-Type` header returned on RPC calls is now (correctly) set as `application/json`.
|
||||
|
||||
### Version
|
||||
|
||||
Version is now set through Go linker flags `ld_flags`. Applications that are using tendermint as a library should set this at compile time.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
go install -mod=readonly -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(go list -m github.com/tendermint/tendermint | sed 's/ /\@/g') -s -w " -trimpath ./cmd
|
||||
```
|
||||
|
||||
Additionally, the exported constant `version.Version` is now `version.TMCoreSemVer`.
|
||||
|
||||
## v0.33.4
|
||||
|
||||
|
||||
Vendored
-66
@@ -1,66 +0,0 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "ubuntu/focal64"
|
||||
|
||||
config.vm.provider "virtualbox" do |v|
|
||||
v.memory = 4096
|
||||
v.cpus = 2
|
||||
end
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
apt-get update
|
||||
|
||||
# install base requirements
|
||||
apt-get install -y --no-install-recommends wget curl jq zip \
|
||||
make shellcheck bsdmainutils psmisc
|
||||
apt-get install -y language-pack-en
|
||||
|
||||
# install docker
|
||||
apt-get install -y --no-install-recommends apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||
add-apt-repository \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
apt-get update
|
||||
apt-get install -y docker-ce
|
||||
usermod -aG docker vagrant
|
||||
|
||||
# install go
|
||||
wget -q https://dl.google.com/go/go1.14.linux-amd64.tar.gz
|
||||
tar -xvf go1.14.linux-amd64.tar.gz
|
||||
mv go /usr/local
|
||||
rm -f go1.14.linux-amd64.tar.gz
|
||||
|
||||
# install nodejs (for docs)
|
||||
curl -sL https://deb.nodesource.com/setup_11.x | bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
# cleanup
|
||||
apt-get autoremove -y
|
||||
|
||||
# set env variables
|
||||
echo 'export GOROOT=/usr/local/go' >> /home/vagrant/.bash_profile
|
||||
echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile
|
||||
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/vagrant/.bash_profile
|
||||
echo 'export LC_ALL=en_US.UTF-8' >> /home/vagrant/.bash_profile
|
||||
echo 'cd go/src/github.com/tendermint/tendermint' >> /home/vagrant/.bash_profile
|
||||
|
||||
mkdir -p /home/vagrant/go/bin
|
||||
mkdir -p /home/vagrant/go/src/github.com/tendermint
|
||||
ln -s /vagrant /home/vagrant/go/src/github.com/tendermint/tendermint
|
||||
|
||||
chown -R vagrant:vagrant /home/vagrant/go
|
||||
chown vagrant:vagrant /home/vagrant/.bash_profile
|
||||
|
||||
# get all deps and tools, ready to install/test
|
||||
su - vagrant -c 'source /home/vagrant/.bash_profile'
|
||||
su - vagrant -c 'cd /home/vagrant/go/src/github.com/tendermint/tendermint && make tools'
|
||||
SHELL
|
||||
end
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func RandVal(i int) types.ValidatorUpdate {
|
||||
pubkey := tmrand.Bytes(32)
|
||||
power := tmrand.Uint16() + 1
|
||||
v := types.Ed25519ValidatorUpdate(pubkey, int64(power))
|
||||
v := types.UpdateValidator(pubkey, int64(power), "")
|
||||
return v
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon
|
||||
}
|
||||
|
||||
// update
|
||||
return app.updateValidator(types.Ed25519ValidatorUpdate(pubkey, power))
|
||||
return app.updateValidator(types.UpdateValidator(pubkey, power, ""))
|
||||
}
|
||||
|
||||
// add, update, or remove a validator
|
||||
|
||||
@@ -16,7 +16,7 @@ func InitChain(client abcicli.Client) error {
|
||||
for i := 0; i < total; i++ {
|
||||
pubkey := tmrand.Bytes(33)
|
||||
power := tmrand.Int()
|
||||
vals[i] = types.Ed25519ValidatorUpdate(pubkey, int64(power))
|
||||
vals[i] = types.UpdateValidator(pubkey, int64(power), "")
|
||||
}
|
||||
_, err := client.InitChainSync(types.RequestInitChain{
|
||||
Validators: vals,
|
||||
|
||||
+24
-4
@@ -1,16 +1,16 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
cryptoenc "github.com/tendermint/tendermint/crypto/encoding"
|
||||
)
|
||||
|
||||
const (
|
||||
PubKeyEd25519 = "ed25519"
|
||||
"github.com/tendermint/tendermint/crypto/secp256k1"
|
||||
)
|
||||
|
||||
func Ed25519ValidatorUpdate(pk []byte, power int64) ValidatorUpdate {
|
||||
pke := ed25519.PubKey(pk)
|
||||
|
||||
pkp, err := cryptoenc.PubKeyToProto(pke)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -22,3 +22,23 @@ func Ed25519ValidatorUpdate(pk []byte, power int64) ValidatorUpdate {
|
||||
Power: power,
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateValidator(pk []byte, power int64, keyType string) ValidatorUpdate {
|
||||
switch keyType {
|
||||
case "", ed25519.KeyType:
|
||||
return Ed25519ValidatorUpdate(pk, power)
|
||||
case secp256k1.KeyType:
|
||||
pke := secp256k1.PubKey(pk)
|
||||
pkp, err := cryptoenc.PubKeyToProto(pke)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return ValidatorUpdate{
|
||||
// Address:
|
||||
PubKey: pkp,
|
||||
Power: power,
|
||||
}
|
||||
default:
|
||||
panic(fmt.Sprintf("key type %s not supported", keyType))
|
||||
}
|
||||
}
|
||||
|
||||
+222
-169
@@ -485,6 +485,7 @@ type RequestInfo struct {
|
||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
BlockVersion uint64 `protobuf:"varint,2,opt,name=block_version,json=blockVersion,proto3" json:"block_version,omitempty"`
|
||||
P2PVersion uint64 `protobuf:"varint,3,opt,name=p2p_version,json=p2pVersion,proto3" json:"p2p_version,omitempty"`
|
||||
AbciVersion string `protobuf:"bytes,4,opt,name=abci_version,json=abciVersion,proto3" json:"abci_version,omitempty"`
|
||||
}
|
||||
|
||||
func (m *RequestInfo) Reset() { *m = RequestInfo{} }
|
||||
@@ -541,6 +542,13 @@ func (m *RequestInfo) GetP2PVersion() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *RequestInfo) GetAbciVersion() string {
|
||||
if m != nil {
|
||||
return m.AbciVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RequestInitChain struct {
|
||||
Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"`
|
||||
ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
|
||||
@@ -1529,7 +1537,8 @@ func (m *ResponseFlush) XXX_DiscardUnknown() {
|
||||
var xxx_messageInfo_ResponseFlush proto.InternalMessageInfo
|
||||
|
||||
type ResponseInfo struct {
|
||||
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
// this is the software version of the application. TODO: remove?
|
||||
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
|
||||
AppVersion uint64 `protobuf:"varint,3,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"`
|
||||
LastBlockHeight int64 `protobuf:"varint,4,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"`
|
||||
@@ -3056,175 +3065,176 @@ func init() {
|
||||
func init() { proto.RegisterFile("tendermint/abci/types.proto", fileDescriptor_252557cfdd89a31a) }
|
||||
|
||||
var fileDescriptor_252557cfdd89a31a = []byte{
|
||||
// 2677 bytes of a gzipped FileDescriptorProto
|
||||
// 2691 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0x4b, 0x73, 0x1b, 0xc7,
|
||||
0x11, 0xc6, 0x1b, 0xd8, 0x26, 0xf1, 0xe0, 0x88, 0x96, 0x61, 0x58, 0x26, 0xe5, 0x75, 0xd9, 0xb1,
|
||||
0x64, 0x9b, 0x8c, 0xa9, 0x92, 0x22, 0x95, 0x9d, 0xd8, 0x04, 0x04, 0x19, 0x34, 0x19, 0x92, 0x59,
|
||||
0x42, 0x72, 0x5e, 0xd6, 0x7a, 0x80, 0x1d, 0x02, 0x6b, 0x01, 0xbb, 0x6b, 0xec, 0x80, 0x22, 0x7d,
|
||||
0xcc, 0xe3, 0xa2, 0x5c, 0x7c, 0xcc, 0xc5, 0x55, 0xf9, 0x07, 0xb9, 0xe6, 0x94, 0x4b, 0x2e, 0xae,
|
||||
0x4a, 0xa5, 0xca, 0xc7, 0x9c, 0x9c, 0x94, 0x74, 0xcb, 0x1f, 0xc8, 0x29, 0x95, 0xd4, 0x3c, 0xf6,
|
||||
0x05, 0x60, 0x09, 0x30, 0xce, 0x2d, 0xb7, 0x9d, 0xde, 0xee, 0xc6, 0x4c, 0xef, 0xf4, 0xd7, 0xdf,
|
||||
0xf4, 0x00, 0x5e, 0xa4, 0xc4, 0x32, 0xc8, 0x68, 0x68, 0x5a, 0x74, 0x13, 0x77, 0xba, 0xe6, 0x26,
|
||||
0x3d, 0x73, 0x88, 0xbb, 0xe1, 0x8c, 0x6c, 0x6a, 0xa3, 0x72, 0xf0, 0x72, 0x83, 0xbd, 0xac, 0xbd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xb4, 0x7a, 0xe1, 0xab, 0x6f, 0xd6, 0x13, 0x5f, 0xfc, 0x6d, 0x3d,
|
||||
0xa9, 0x71, 0x0b, 0xf4, 0x02, 0xcb, 0x2c, 0x6c, 0x5a, 0xba, 0x69, 0xf0, 0xf9, 0x28, 0x2c, 0x6d,
|
||||
0xb0, 0x69, 0xed, 0x18, 0x68, 0x17, 0x2a, 0x5d, 0xdb, 0x72, 0x89, 0xe5, 0x8e, 0x5d, 0x5d, 0x40,
|
||||
0xa6, 0x84, 0x9d, 0xe9, 0x9d, 0xdf, 0xf0, 0x14, 0x0f, 0xb9, 0x9e, 0x56, 0xee, 0x46, 0x05, 0xe8,
|
||||
0x1e, 0xc0, 0x09, 0x1e, 0x98, 0x06, 0xa6, 0xf6, 0xc8, 0xad, 0x66, 0xae, 0xa6, 0x67, 0xba, 0x79,
|
||||
0xe0, 0xa9, 0xdc, 0x77, 0x0c, 0x4c, 0x49, 0x3d, 0xc3, 0x66, 0xab, 0x85, 0x2c, 0xd1, 0x6b, 0x50,
|
||||
0xc6, 0x8e, 0xa3, 0xbb, 0x14, 0x53, 0xa2, 0x77, 0xce, 0x28, 0x71, 0x39, 0x22, 0x2d, 0x6b, 0x45,
|
||||
0xec, 0x38, 0x47, 0x4c, 0x5a, 0x67, 0x42, 0xf4, 0x2a, 0x94, 0x18, 0x78, 0x99, 0x78, 0xa0, 0xf7,
|
||||
0x89, 0xd9, 0xeb, 0x53, 0x8e, 0x3d, 0x69, 0xad, 0x28, 0xa5, 0x2d, 0x2e, 0x54, 0x0d, 0xff, 0x63,
|
||||
0x72, 0xe0, 0x42, 0x08, 0x32, 0x06, 0xa6, 0x98, 0x07, 0x72, 0x59, 0xe3, 0xcf, 0x4c, 0xe6, 0x60,
|
||||
0xda, 0x97, 0xe1, 0xe1, 0xcf, 0xe8, 0x32, 0xe4, 0xa4, 0xdb, 0x34, 0x77, 0x2b, 0x47, 0x68, 0x15,
|
||||
0xb2, 0xce, 0xc8, 0x3e, 0x21, 0x1c, 0x65, 0x0b, 0x9a, 0x18, 0xa8, 0xbf, 0x4a, 0xc1, 0xca, 0x14,
|
||||
0xc4, 0x31, 0xbf, 0x7d, 0xec, 0xf6, 0xbd, 0xdf, 0x62, 0xcf, 0xe8, 0x16, 0xf3, 0x8b, 0x0d, 0x32,
|
||||
0x92, 0x65, 0xa1, 0x1a, 0x0e, 0x91, 0x28, 0x79, 0x2d, 0xfe, 0x5e, 0x86, 0x46, 0x6a, 0xa3, 0x03,
|
||||
0xa8, 0x0c, 0xb0, 0x4b, 0x75, 0x01, 0x19, 0x7a, 0xa8, 0x44, 0x4c, 0x03, 0xe5, 0x1e, 0xf6, 0x40,
|
||||
0x86, 0x6d, 0x58, 0xe9, 0xa8, 0x34, 0x88, 0x48, 0x91, 0x06, 0xab, 0x9d, 0xb3, 0xcf, 0xb1, 0x45,
|
||||
0x4d, 0x8b, 0xe8, 0x53, 0x5f, 0xee, 0x85, 0x29, 0xa7, 0xcd, 0x13, 0xd3, 0x20, 0x56, 0xd7, 0xfb,
|
||||
0x64, 0x97, 0x7c, 0x63, 0xff, 0x93, 0xba, 0xaa, 0x06, 0xa5, 0x28, 0x48, 0xa3, 0x12, 0xa4, 0xe8,
|
||||
0xa9, 0x0c, 0x40, 0x8a, 0x9e, 0xa2, 0xef, 0x42, 0x86, 0x2d, 0x92, 0x2f, 0xbe, 0x34, 0xa3, 0xba,
|
||||
0x49, 0xbb, 0xf6, 0x99, 0x43, 0x34, 0xae, 0xa9, 0xaa, 0x7e, 0x36, 0xf8, 0xc0, 0x3d, 0xe9, 0x55,
|
||||
0xbd, 0x06, 0xe5, 0x09, 0x64, 0x0e, 0x7d, 0xbf, 0x64, 0xf8, 0xfb, 0xa9, 0x65, 0x28, 0x46, 0x60,
|
||||
0x58, 0xbd, 0x0c, 0xab, 0xb3, 0x50, 0x55, 0xed, 0xfb, 0xf2, 0x08, 0x3a, 0xa2, 0x9b, 0x50, 0xf0,
|
||||
0x61, 0x55, 0x64, 0xe3, 0x74, 0xac, 0x3c, 0x65, 0xcd, 0x57, 0x65, 0x69, 0xc8, 0xb6, 0x35, 0xdf,
|
||||
0x0f, 0x29, 0x3e, 0xf1, 0x3c, 0x76, 0x9c, 0x16, 0x76, 0xfb, 0xea, 0x27, 0x50, 0x8d, 0x83, 0xcc,
|
||||
0x89, 0x65, 0x64, 0xfc, 0x6d, 0x78, 0x19, 0x72, 0xc7, 0xf6, 0x68, 0x88, 0x29, 0x77, 0x56, 0xd4,
|
||||
0xe4, 0x88, 0x6d, 0x4f, 0x01, 0x9f, 0x69, 0x2e, 0x16, 0x03, 0x55, 0x87, 0x17, 0x62, 0x61, 0x93,
|
||||
0x99, 0x98, 0x96, 0x41, 0x44, 0x3c, 0x8b, 0x9a, 0x18, 0x04, 0x8e, 0xc4, 0x64, 0xc5, 0x80, 0xfd,
|
||||
0xac, 0xcb, 0xd7, 0xca, 0xfd, 0x2b, 0x9a, 0x1c, 0xa9, 0xbf, 0x2b, 0x40, 0x41, 0x23, 0xae, 0xc3,
|
||||
0x30, 0x01, 0xd5, 0x41, 0x21, 0xa7, 0x5d, 0xe2, 0x50, 0x0f, 0x22, 0x67, 0x13, 0x02, 0xa1, 0xdd,
|
||||
0xf4, 0x34, 0x59, 0x35, 0xf6, 0xcd, 0xd0, 0x0d, 0x49, 0xb8, 0xe2, 0xb9, 0x93, 0x34, 0x0f, 0x33,
|
||||
0xae, 0x5b, 0x1e, 0xe3, 0x4a, 0xc7, 0x16, 0x60, 0x61, 0x35, 0x41, 0xb9, 0x6e, 0x48, 0xca, 0x95,
|
||||
0x99, 0xf3, 0x63, 0x11, 0xce, 0xd5, 0x88, 0x70, 0xae, 0xec, 0x9c, 0x65, 0xc6, 0x90, 0xae, 0x5b,
|
||||
0x1e, 0xe9, 0xca, 0xcd, 0x99, 0xf1, 0x04, 0xeb, 0xba, 0x17, 0x65, 0x5d, 0x82, 0x31, 0xbd, 0x12,
|
||||
0x6b, 0x1d, 0x4b, 0xbb, 0xbe, 0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x1d, 0x7a, 0xa6, 0x49, 0x7b, 0xf5, 0x97, 0x29, 0xc6, 0x72, 0x22, 0x58, 0x3c, 0x33, 0xb6, 0xde,
|
||||
0x8e, 0x4f, 0x85, 0x18, 0xee, 0x62, 0xf1, 0x5e, 0x03, 0xe8, 0x61, 0x57, 0x7f, 0x8c, 0x2d, 0x4a,
|
||||
0x0c, 0x19, 0xf4, 0x90, 0x04, 0xd5, 0xa0, 0xc0, 0x46, 0x63, 0x97, 0x18, 0x92, 0x6c, 0xfb, 0xe3,
|
||||
0xd0, 0x3a, 0xf3, 0xdf, 0x6e, 0x9d, 0xd1, 0x28, 0x17, 0x26, 0xa3, 0xfc, 0xeb, 0x54, 0x90, 0x25,
|
||||
0x01, 0x21, 0xfc, 0xff, 0x8b, 0xc3, 0x6f, 0xf8, 0x29, 0x31, 0x5a, 0x14, 0xd1, 0x11, 0xac, 0xf8,
|
||||
0x59, 0xaa, 0x8f, 0x79, 0xf6, 0x7a, 0xfb, 0x6e, 0xd1, 0x34, 0xaf, 0x9c, 0x44, 0xc5, 0x2e, 0xfa,
|
||||
0x31, 0x3c, 0x3f, 0x81, 0x40, 0xbe, 0xeb, 0xd4, 0x82, 0x40, 0xf4, 0x5c, 0x14, 0x88, 0x3c, 0xcf,
|
||||
0x41, 0xac, 0xd2, 0xdf, 0x32, 0x37, 0x76, 0xd8, 0xc1, 0x23, 0x5c, 0xe2, 0x67, 0x7e, 0xfd, 0x57,
|
||||
0xa0, 0x38, 0x22, 0x94, 0x9d, 0x85, 0x23, 0x47, 0xbb, 0x65, 0x21, 0x94, 0x07, 0xc6, 0x43, 0x78,
|
||||
0x6e, 0x66, 0xa9, 0x47, 0xdf, 0x03, 0x25, 0x60, 0x09, 0xc9, 0x98, 0x53, 0x92, 0xcf, 0xfc, 0x03,
|
||||
0x5d, 0xf5, 0x8f, 0xc9, 0xc0, 0x65, 0xf4, 0x2c, 0xd1, 0x84, 0xdc, 0x88, 0xb8, 0xe3, 0x81, 0x60,
|
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f2, 0x12,
|
||||
0x94, 0xbd, 0x58, 0x7a, 0xc2, 0xac, 0xfa, 0xef, 0x24, 0x94, 0x27, 0x12, 0x04, 0x6d, 0x41, 0x56,
|
||||
0xf0, 0xdf, 0xb8, 0x06, 0x33, 0xcf, 0x6f, 0x99, 0x4d, 0x42, 0x15, 0xbd, 0x0b, 0x05, 0x22, 0xcf,
|
||||
0xe4, 0xb3, 0x12, 0x51, 0xf4, 0x12, 0xbc, 0x53, 0xbb, 0x34, 0xf5, 0x2d, 0xd0, 0x7b, 0xa0, 0xf8,
|
||||
0x99, 0x2e, 0xcf, 0x4b, 0x2f, 0x4f, 0x9b, 0xfb, 0x18, 0x21, 0xed, 0x03, 0x1b, 0x74, 0x27, 0x20,
|
||||
0x51, 0x99, 0x69, 0xd6, 0x2d, 0xcd, 0x85, 0x82, 0x34, 0xf6, 0xf4, 0xd5, 0x06, 0x2c, 0x85, 0xd6,
|
||||
0x83, 0x5e, 0x04, 0x65, 0x88, 0x4f, 0x65, 0xaf, 0x47, 0x9c, 0xd6, 0x0b, 0x43, 0x7c, 0x2a, 0xda,
|
||||
0x3c, 0xcf, 0x43, 0x9e, 0xbd, 0xec, 0x61, 0x81, 0x36, 0x69, 0x2d, 0x37, 0xc4, 0xa7, 0x1f, 0x60,
|
||||
0x57, 0xfd, 0x18, 0x4a, 0xd1, 0x3e, 0x07, 0xdb, 0x89, 0x23, 0x7b, 0x6c, 0x19, 0xdc, 0x47, 0x56,
|
||||
0x13, 0x03, 0x74, 0x13, 0xb2, 0x27, 0xb6, 0x00, 0xab, 0xd9, 0x29, 0xfb, 0xc0, 0xa6, 0x24, 0xd4,
|
||||
0x27, 0x11, 0xda, 0xea, 0xe7, 0x90, 0xe5, 0xe0, 0xc3, 0x80, 0x84, 0x77, 0x2c, 0x24, 0x81, 0x64,
|
||||
0xcf, 0xe8, 0x63, 0x00, 0x4c, 0xe9, 0xc8, 0xec, 0x8c, 0x03, 0xc7, 0xeb, 0xb3, 0xc1, 0x6b, 0xdb,
|
||||
0xd3, 0xab, 0x5f, 0x91, 0x28, 0xb6, 0x1a, 0x98, 0x86, 0x90, 0x2c, 0xe4, 0x50, 0xdd, 0x87, 0x52,
|
||||
0xd4, 0xd6, 0xe3, 0x3c, 0xc9, 0x19, 0x9c, 0x27, 0x15, 0xe6, 0x3c, 0x3e, 0x63, 0x4a, 0x8b, 0xee,
|
||||
0x14, 0x1f, 0xa8, 0x4f, 0x92, 0x50, 0x68, 0x9f, 0xca, 0x6d, 0x1d, 0xd3, 0x18, 0x09, 0x4c, 0x53,
|
||||
0xe1, 0x36, 0x80, 0xe8, 0xb4, 0xa4, 0xfd, 0xfe, 0xcd, 0xfb, 0x7e, 0xe2, 0x66, 0x16, 0x3d, 0xed,
|
||||
0x79, 0x8d, 0x2c, 0x09, 0x56, 0xef, 0x80, 0xe2, 0xef, 0x2a, 0xc6, 0xc4, 0xb1, 0x61, 0x8c, 0x88,
|
||||
0xeb, 0xca, 0xb5, 0x79, 0x43, 0xde, 0x67, 0xb3, 0x1f, 0xcb, 0x46, 0x43, 0x5a, 0x13, 0x03, 0xd5,
|
||||
0x80, 0xf2, 0x44, 0xd9, 0x42, 0xef, 0x40, 0xde, 0x19, 0x77, 0x74, 0x2f, 0x3c, 0x13, 0xc9, 0xe3,
|
||||
0x91, 0xbc, 0x71, 0x67, 0x60, 0x76, 0x77, 0xc9, 0x99, 0x37, 0x19, 0x67, 0xdc, 0xd9, 0x15, 0x51,
|
||||
0x14, 0xbf, 0x92, 0x0a, 0xff, 0xca, 0x09, 0x14, 0xbc, 0x4d, 0x81, 0x7e, 0x10, 0xce, 0x13, 0xaf,
|
||||
0xfb, 0x1a, 0x5b, 0x4a, 0xa5, 0xfb, 0x50, 0x9a, 0x5c, 0x87, 0x15, 0xd7, 0xec, 0x59, 0xc4, 0xd0,
|
||||
0x83, 0xb3, 0x00, 0xff, 0xb5, 0x82, 0x56, 0x16, 0x2f, 0xf6, 0xbc, 0x83, 0x80, 0xfa, 0xaf,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a, 0x69, 0x75, 0x89, 0x09, 0x1f, 0x0a, 0xa5,
|
||||
0x35, 0x28, 0x38, 0x9b, 0x8e, 0xaf, 0x92, 0x62, 0x2a, 0xe0, 0x6c, 0x3a, 0x9e, 0xc2, 0x15, 0x58,
|
||||
0xa2, 0x2b, 0xf5, 0x35, 0xd2, 0xec, 0x47, 0x0a, 0x54, 0x26, 0x54, 0x94, 0x3f, 0x27, 0xa1, 0x32,
|
||||
0x99, 0xce, 0xe8, 0x0e, 0xa4, 0x29, 0xb2, 0x09, 0x90, 0xaa, 0xad, 0x73, 0xd8, 0x5b, 0xf7, 0x60,
|
||||
0x6f, 0xbd, 0xed, 0xc1, 0x5e, 0x3d, 0xff, 0xd5, 0x37, 0x6b, 0x89, 0x67, 0x7f, 0x5b, 0x93, 0x54,
|
||||
0x66, 0x81, 0x5e, 0xa1, 0xd9, 0xa7, 0x9b, 0x96, 0x66, 0x1a, 0x6c, 0xca, 0x32, 0x4d, 0x2d, 0xdd,
|
||||
0xb4, 0xb6, 0x0d, 0xb4, 0x03, 0x95, 0xae, 0x6d, 0xb9, 0xd8, 0x72, 0xc7, 0xae, 0xc6, 0x61, 0x55,
|
||||
0x40, 0xd3, 0x74, 0x76, 0x34, 0x3c, 0xc5, 0x03, 0xa6, 0xa7, 0x96, 0xbb, 0x51, 0x01, 0xba, 0x0f,
|
||||
0x70, 0xac, 0x0f, 0x4c, 0x43, 0x27, 0xf6, 0xc8, 0xad, 0xa6, 0x2f, 0xa7, 0x66, 0xba, 0x79, 0xe8,
|
||||
0xa9, 0x3c, 0x70, 0x0c, 0x9d, 0xe0, 0x7a, 0x9a, 0xce, 0x56, 0x0d, 0x59, 0xa2, 0xd7, 0xa1, 0xac,
|
||||
0x3b, 0x8e, 0xe6, 0x12, 0x9d, 0x60, 0xad, 0x73, 0x4a, 0xb0, 0xcb, 0x50, 0x6b, 0x49, 0x2d, 0xea,
|
||||
0x8e, 0x73, 0x48, 0xa5, 0x75, 0x2a, 0x44, 0xd7, 0xa0, 0x44, 0x01, 0xce, 0xd4, 0x07, 0x5a, 0x1f,
|
||||
0x9b, 0xbd, 0x3e, 0x61, 0xf8, 0x94, 0x52, 0x8b, 0x42, 0xda, 0x62, 0x42, 0xc5, 0xf0, 0x3f, 0x38,
|
||||
0x03, 0x37, 0x84, 0x20, 0x6d, 0xe8, 0x44, 0x67, 0x81, 0x5c, 0x52, 0xd9, 0x33, 0x95, 0x39, 0x3a,
|
||||
0xe9, 0x8b, 0xf0, 0xb0, 0x67, 0x74, 0x11, 0xb2, 0xc2, 0x6d, 0x8a, 0xb9, 0x15, 0x23, 0xb4, 0x02,
|
||||
0x19, 0x67, 0x64, 0x1f, 0x63, 0xf6, 0xe5, 0xf2, 0x2a, 0x1f, 0x28, 0xbf, 0x4a, 0xc2, 0xf2, 0x14,
|
||||
0x0c, 0x52, 0xbf, 0x7d, 0xdd, 0xed, 0x7b, 0xbf, 0x45, 0x9f, 0xd1, 0x6d, 0xea, 0x57, 0x37, 0xf0,
|
||||
0x48, 0x94, 0x8e, 0x6a, 0x38, 0x44, 0xbc, 0x2c, 0xb6, 0xd8, 0x7b, 0x11, 0x1a, 0xa1, 0x8d, 0xf6,
|
||||
0xa1, 0x32, 0xd0, 0x5d, 0xa2, 0x71, 0x58, 0xd1, 0x42, 0x65, 0x64, 0x1a, 0x4c, 0x77, 0x75, 0x0f,
|
||||
0x88, 0xe8, 0x9e, 0x16, 0x8e, 0x4a, 0x83, 0x88, 0x14, 0xa9, 0xb0, 0xd2, 0x39, 0xfd, 0x42, 0xb7,
|
||||
0x88, 0x69, 0x61, 0x6d, 0xea, 0xcb, 0xbd, 0x32, 0xe5, 0xb4, 0x79, 0x6c, 0x1a, 0xd8, 0xea, 0x7a,
|
||||
0x9f, 0xec, 0x82, 0x6f, 0xec, 0x7f, 0x52, 0x57, 0x51, 0xa1, 0x14, 0x05, 0x72, 0x54, 0x82, 0x24,
|
||||
0x39, 0x11, 0x01, 0x48, 0x92, 0x13, 0xf4, 0x5d, 0x48, 0xd3, 0x45, 0xb2, 0xc5, 0x97, 0x66, 0x54,
|
||||
0x40, 0x61, 0xd7, 0x3e, 0x75, 0xb0, 0xca, 0x34, 0x15, 0xc5, 0xcf, 0x06, 0x1f, 0xdc, 0x27, 0xbd,
|
||||
0x2a, 0xd7, 0xa1, 0x3c, 0x81, 0xde, 0xa1, 0xef, 0x27, 0x85, 0xbf, 0x9f, 0x52, 0x86, 0x62, 0x04,
|
||||
0xaa, 0x95, 0x8b, 0xb0, 0x32, 0x0b, 0x79, 0x95, 0xbe, 0x2f, 0x8f, 0x20, 0x28, 0xba, 0x05, 0x79,
|
||||
0x1f, 0x7a, 0x79, 0x36, 0x4e, 0xc7, 0xca, 0x53, 0x56, 0x7d, 0x55, 0x9a, 0x86, 0x74, 0x5b, 0xb3,
|
||||
0xfd, 0x90, 0x64, 0x13, 0xcf, 0xe9, 0x8e, 0xd3, 0xd2, 0xdd, 0xbe, 0xf2, 0x29, 0x54, 0xe3, 0x60,
|
||||
0x75, 0x62, 0x19, 0x69, 0x7f, 0x1b, 0x5e, 0x84, 0xec, 0x91, 0x3d, 0x1a, 0xea, 0x84, 0x39, 0x2b,
|
||||
0xaa, 0x62, 0x44, 0xb7, 0x27, 0x87, 0xd8, 0x14, 0x13, 0xf3, 0x81, 0xa2, 0xc1, 0x2b, 0xb1, 0xd0,
|
||||
0x4a, 0x4d, 0x4c, 0xcb, 0xc0, 0x3c, 0x9e, 0x45, 0x95, 0x0f, 0x02, 0x47, 0x7c, 0xb2, 0x7c, 0x40,
|
||||
0x7f, 0xd6, 0x65, 0x6b, 0x65, 0xfe, 0x65, 0x55, 0x8c, 0x94, 0xdf, 0xe5, 0x21, 0xaf, 0x62, 0xd7,
|
||||
0xa1, 0x98, 0x80, 0xea, 0x20, 0xe3, 0x93, 0x2e, 0x76, 0x88, 0x87, 0xa2, 0xb3, 0x49, 0x03, 0xd7,
|
||||
0x6e, 0x7a, 0x9a, 0xb4, 0x62, 0xfb, 0x66, 0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f, 0x41, 0xe7, 0x18, 0x9a, 0x87, 0x72, 0x5a, 0xf9, 0x83, 0x14,
|
||||
0xd8, 0xb2, 0x32, 0x17, 0xae, 0xf7, 0xb2, 0xa8, 0xf7, 0x21, 0x92, 0x97, 0x8c, 0x92, 0xbc, 0x35,
|
||||
0x28, 0x50, 0x94, 0x9e, 0xe0, 0x6f, 0xba, 0xe3, 0xf3, 0xb7, 0x1b, 0xb0, 0xcc, 0xca, 0x30, 0xa7,
|
||||
0x82, 0x02, 0x9a, 0xd3, 0xac, 0xc2, 0x94, 0xe9, 0x0b, 0xbe, 0x39, 0x39, 0x46, 0xbf, 0x0d, 0x17,
|
||||
0x42, 0xba, 0x3e, 0xfa, 0x73, 0x36, 0x53, 0xf1, 0xb5, 0xb7, 0x44, 0x19, 0xf8, 0x93, 0x14, 0x44,
|
||||
0x28, 0x20, 0x7e, 0xb3, 0x38, 0x9a, 0xf4, 0xbf, 0xe1, 0x68, 0xc9, 0xff, 0x9a, 0xa3, 0x85, 0x8b,
|
||||
0x59, 0x2a, 0x5a, 0xcc, 0xfe, 0x29, 0x05, 0x9f, 0xc4, 0x67, 0x5c, 0x5d, 0xdb, 0xc0, 0xa2, 0xbc,
|
||||
0xb0, 0x67, 0x54, 0x81, 0xd4, 0xc0, 0xee, 0x89, 0x22, 0x42, 0x1f, 0xa9, 0x96, 0x8f, 0xc1, 0xb2,
|
||||
0x80, 0x58, 0xbf, 0x32, 0x65, 0x58, 0x80, 0x45, 0x65, 0xaa, 0x40, 0xea, 0x31, 0xe6, 0x88, 0xb9,
|
||||
0xa4, 0xd2, 0x47, 0xaa, 0xc7, 0xf6, 0x18, 0xc3, 0xc1, 0x25, 0x95, 0x0f, 0xd0, 0x1d, 0x90, 0x59,
|
||||
0x13, 0x42, 0xb3, 0x1d, 0x57, 0x80, 0xdb, 0xab, 0xe1, 0xb5, 0xf2, 0x5e, 0xc3, 0xfa, 0x01, 0xd5,
|
||||
0xd9, 0x77, 0x5c, 0x35, 0xef, 0x88, 0xa7, 0x50, 0xd1, 0x95, 0x23, 0xdc, 0xef, 0x12, 0xc8, 0x74,
|
||||
0xf6, 0xae, 0xa3, 0x77, 0x31, 0x43, 0x2a, 0x59, 0x0d, 0x04, 0xca, 0x23, 0x40, 0xd3, 0x78, 0x8b,
|
||||
0x5a, 0x90, 0xc5, 0xc7, 0xd8, 0x22, 0xf4, 0xab, 0xd1, 0x70, 0x5f, 0x9c, 0x41, 0xac, 0xb0, 0x45,
|
||||
0xea, 0x55, 0x1a, 0xe4, 0x7f, 0x7c, 0xb3, 0x56, 0xe1, 0xda, 0x6f, 0xd9, 0x43, 0x93, 0xe0, 0xa1,
|
||||
0x43, 0x4e, 0x55, 0x61, 0xaf, 0xfc, 0x32, 0x49, 0x59, 0x4e, 0x04, 0x8b, 0x67, 0xc6, 0xd6, 0xdb,
|
||||
0xf1, 0xc9, 0x10, 0xc3, 0x5d, 0x2c, 0xde, 0xab, 0x00, 0x3d, 0xdd, 0xd5, 0x9e, 0xe8, 0x16, 0xc1,
|
||||
0x86, 0x08, 0x7a, 0x48, 0x82, 0x6a, 0x90, 0xa7, 0xa3, 0xb1, 0x8b, 0x0d, 0x41, 0xb6, 0xfd, 0x71,
|
||||
0x68, 0x9d, 0xb9, 0x6f, 0xb7, 0xce, 0x68, 0x94, 0xf3, 0x93, 0x51, 0xfe, 0x75, 0x32, 0xc8, 0x92,
|
||||
0x80, 0x10, 0xfe, 0xff, 0xc5, 0xe1, 0x37, 0xec, 0x94, 0x18, 0x2d, 0x8a, 0xe8, 0x10, 0x96, 0xfd,
|
||||
0x2c, 0xd5, 0xc6, 0x2c, 0x7b, 0xbd, 0x7d, 0xb7, 0x68, 0x9a, 0x57, 0x8e, 0xa3, 0x62, 0x17, 0xfd,
|
||||
0x18, 0x5e, 0x9e, 0x40, 0x20, 0xdf, 0x75, 0x72, 0x41, 0x20, 0x7a, 0x29, 0x0a, 0x44, 0x9e, 0xe7,
|
||||
0x20, 0x56, 0xa9, 0x6f, 0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||
0xe5, 0x13, 0x28, 0x45, 0xfb, 0x1c, 0x74, 0x27, 0x8e, 0xec, 0xb1, 0x65, 0x30, 0x1f, 0x19, 0x95,
|
||||
0x0f, 0xd0, 0x2d, 0xc8, 0x1c, 0xdb, 0x1c, 0xac, 0x66, 0xa7, 0xec, 0x43, 0x9b, 0xe0, 0x50, 0x9f,
|
||||
0x84, 0x6b, 0x2b, 0x5f, 0x40, 0x86, 0x81, 0x0f, 0x05, 0x12, 0xd6, 0xb1, 0x10, 0x04, 0x92, 0x3e,
|
||||
0xa3, 0x4f, 0x00, 0x74, 0x42, 0x46, 0x66, 0x67, 0x1c, 0x38, 0x5e, 0x9b, 0x0d, 0x5e, 0x5b, 0x9e,
|
||||
0x5e, 0xfd, 0x92, 0x40, 0xb1, 0x95, 0xc0, 0x34, 0x84, 0x64, 0x21, 0x87, 0xca, 0x1e, 0x94, 0xa2,
|
||||
0xb6, 0x1e, 0xe7, 0x91, 0x66, 0x70, 0x9e, 0x64, 0x98, 0xf3, 0xf8, 0x8c, 0x29, 0xc5, 0xbb, 0x53,
|
||||
0x6c, 0xa0, 0x3c, 0x95, 0x20, 0xdf, 0x3e, 0x11, 0xdb, 0x3a, 0xa6, 0x31, 0x12, 0x98, 0x26, 0xc3,
|
||||
0x6d, 0x00, 0xde, 0x69, 0x49, 0xf9, 0xfd, 0x9b, 0x0f, 0xfc, 0xc4, 0x4d, 0x2f, 0x7a, 0xda, 0xf3,
|
||||
0x1a, 0x59, 0x02, 0xac, 0xde, 0x05, 0xd9, 0xdf, 0x55, 0x94, 0x89, 0xeb, 0x86, 0x31, 0xc2, 0xae,
|
||||
0x2b, 0xd6, 0xe6, 0x0d, 0x59, 0x9f, 0xcd, 0x7e, 0x22, 0x1a, 0x0d, 0x29, 0x95, 0x0f, 0x14, 0x03,
|
||||
0xca, 0x13, 0x65, 0x0b, 0xbd, 0x0b, 0x39, 0x67, 0xdc, 0xd1, 0xbc, 0xf0, 0x4c, 0x24, 0x8f, 0x47,
|
||||
0xf2, 0xc6, 0x9d, 0x81, 0xd9, 0xdd, 0xc1, 0xa7, 0xde, 0x64, 0x9c, 0x71, 0x67, 0x87, 0x47, 0x91,
|
||||
0xff, 0x4a, 0x32, 0xfc, 0x2b, 0xc7, 0x90, 0xf7, 0x36, 0x05, 0xfa, 0x41, 0x38, 0x4f, 0xbc, 0xee,
|
||||
0x6b, 0x6c, 0x29, 0x15, 0xee, 0x43, 0x69, 0x72, 0x03, 0x96, 0x5d, 0xb3, 0x67, 0x61, 0x43, 0x0b,
|
||||
0xce, 0x02, 0xec, 0xd7, 0xf2, 0x6a, 0x99, 0xbf, 0xd8, 0xf5, 0x0e, 0x02, 0xca, 0xbf, 0x24, 0xc8,
|
||||
0x7b, 0x09, 0x8b, 0xde, 0x09, 0xed, 0xbb, 0xd2, 0x8c, 0xa6, 0x84, 0xa7, 0x18, 0xb4, 0xca, 0xa2,
|
||||
0x73, 0x4d, 0x9e, 0x7f, 0xae, 0x71, 0x3d, 0x4f, 0xaf, 0xf9, 0x9c, 0x3e, 0x77, 0xf3, 0xf9, 0x2d,
|
||||
0x40, 0xc4, 0x26, 0xfa, 0x40, 0x3b, 0xb6, 0x89, 0x69, 0xf5, 0x34, 0x1e, 0x6c, 0xce, 0xa8, 0x2a,
|
||||
0xec, 0xcd, 0x43, 0xf6, 0xe2, 0x80, 0xc5, 0xfd, 0x17, 0x12, 0xe4, 0xfd, 0xda, 0x78, 0xde, 0xce,
|
||||
0xd7, 0x45, 0xc8, 0x0a, 0xf8, 0xe7, 0xad, 0x2f, 0x31, 0xf2, 0x9b, 0xb0, 0xe9, 0x50, 0x13, 0xb6,
|
||||
0x06, 0xf9, 0x21, 0x26, 0x3a, 0x23, 0x08, 0xfc, 0x38, 0xe6, 0x8f, 0x6f, 0xdc, 0x85, 0x42, 0xa8,
|
||||
0x09, 0x49, 0x33, 0x6f, 0xaf, 0xf9, 0x71, 0x25, 0x51, 0xcb, 0x3d, 0xfd, 0xf2, 0x72, 0x6a, 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xba, 0x03, 0xf3,
|
||||
0x2f, 0x82, 0x6b, 0x0b, 0xf4, 0x24, 0xd1, 0x03, 0x80, 0xd0, 0x91, 0x75, 0x81, 0x1b, 0xde, 0xda,
|
||||
0x22, 0xbd, 0x46, 0xb4, 0x0f, 0x79, 0xff, 0x68, 0x32, 0xf7, 0xbe, 0xb5, 0x36, 0xbf, 0xe9, 0x87,
|
||||
0x1e, 0x41, 0x31, 0xca, 0xc9, 0x17, 0xbb, 0x45, 0xad, 0x2d, 0xd8, 0xcd, 0xa3, 0xfe, 0xa3, 0x04,
|
||||
0x7d, 0xb1, 0x5b, 0xd5, 0xda, 0x82, 0xcd, 0x3d, 0xf4, 0x19, 0x2c, 0x4f, 0x13, 0xe8, 0xc5, 0x2f,
|
||||
0x59, 0x6b, 0xe7, 0x68, 0xf7, 0xa1, 0x21, 0xa0, 0x19, 0xc4, 0xfb, 0x1c, 0x77, 0xae, 0xb5, 0xf3,
|
||||
0x74, 0xff, 0xea, 0xcd, 0xaf, 0x9e, 0xaf, 0x4a, 0x5f, 0x3f, 0x5f, 0x95, 0xfe, 0xfe, 0x7c, 0x55,
|
||||
0x7a, 0xf6, 0x62, 0x35, 0xf1, 0xf5, 0x8b, 0xd5, 0xc4, 0x5f, 0x5f, 0xac, 0x26, 0x7e, 0xfa, 0x66,
|
||||
0xcf, 0x24, 0xfd, 0x71, 0x67, 0xbd, 0x6b, 0x0f, 0x37, 0xc2, 0x7f, 0xe6, 0x98, 0xf5, 0x07, 0x93,
|
||||
0x4e, 0x96, 0x15, 0x95, 0x9b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x1b, 0xc1, 0x1e, 0x80,
|
||||
0x22, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -4174,6 +4184,13 @@ func (m *RequestInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.AbciVersion) > 0 {
|
||||
i -= len(m.AbciVersion)
|
||||
copy(dAtA[i:], m.AbciVersion)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.AbciVersion)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.P2PVersion != 0 {
|
||||
i = encodeVarintTypes(dAtA, i, uint64(m.P2PVersion))
|
||||
i--
|
||||
@@ -6457,6 +6474,10 @@ func (m *RequestInfo) Size() (n int) {
|
||||
if m.P2PVersion != 0 {
|
||||
n += 1 + sovTypes(uint64(m.P2PVersion))
|
||||
}
|
||||
l = len(m.AbciVersion)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -8168,6 +8189,38 @@ func (m *RequestInfo) Unmarshal(dAtA []byte) error {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AbciVersion", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.AbciVersion = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
|
||||
@@ -204,6 +204,8 @@ func (bcR *BlockchainReactor) respondToPeer(msg *bcproto.BlockRequest,
|
||||
}
|
||||
|
||||
// Receive implements Reactor by handling 4 types of messages (look below).
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
msg, err := bc.DecodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
+22
-7
@@ -31,6 +31,7 @@ type BpPeer struct {
|
||||
Height int64 // the peer reported height
|
||||
NumPendingBlockRequests int // number of requests still waiting for block responses
|
||||
blocks map[int64]*types.Block // blocks received or expected to be received from this peer
|
||||
noBlocks map[int64]struct{} // heights for which the peer does not have blocks
|
||||
blockResponseTimer *time.Timer
|
||||
recvMonitor *flow.Monitor
|
||||
params *BpPeerParams // parameters for timer and monitor
|
||||
@@ -46,13 +47,14 @@ func NewBpPeer(peerID p2p.ID, base int64, height int64,
|
||||
params = BpPeerDefaultParams()
|
||||
}
|
||||
return &BpPeer{
|
||||
ID: peerID,
|
||||
Base: base,
|
||||
Height: height,
|
||||
blocks: make(map[int64]*types.Block, maxRequestsPerPeer),
|
||||
logger: log.NewNopLogger(),
|
||||
onErr: onErr,
|
||||
params: params,
|
||||
ID: peerID,
|
||||
Base: base,
|
||||
Height: height,
|
||||
blocks: make(map[int64]*types.Block, maxRequestsPerPeer),
|
||||
noBlocks: make(map[int64]struct{}),
|
||||
logger: log.NewNopLogger(),
|
||||
onErr: onErr,
|
||||
params: params,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +133,19 @@ func (peer *BpPeer) RemoveBlock(height int64) {
|
||||
delete(peer.blocks, height)
|
||||
}
|
||||
|
||||
// SetNoBlock records that the peer does not have a block for height.
|
||||
func (peer *BpPeer) SetNoBlock(height int64) {
|
||||
peer.noBlocks[height] = struct{}{}
|
||||
}
|
||||
|
||||
// NoBlock returns true if the peer does not have a block for height.
|
||||
func (peer *BpPeer) NoBlock(height int64) bool {
|
||||
if _, ok := peer.noBlocks[height]; ok {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// RequestSent records that a request was sent, and starts the peer timer and monitor if needed.
|
||||
func (peer *BpPeer) RequestSent(height int64) {
|
||||
peer.blocks[height] = nil
|
||||
|
||||
+13
-1
@@ -100,6 +100,18 @@ func (pool *BlockPool) UpdatePeer(peerID p2p.ID, base int64, height int64) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetNoBlock records that the peer does not have a block for height and
|
||||
// schedules a new request for that height from another peer.
|
||||
func (pool *BlockPool) SetNoBlock(peerID p2p.ID, height int64) {
|
||||
peer := pool.peers[peerID]
|
||||
if peer == nil {
|
||||
return
|
||||
}
|
||||
peer.SetNoBlock(height)
|
||||
|
||||
pool.rescheduleRequest(peerID, height)
|
||||
}
|
||||
|
||||
// Cleans and deletes the peer. Recomputes the max peer height.
|
||||
func (pool *BlockPool) deletePeer(peer *BpPeer) {
|
||||
if peer == nil {
|
||||
@@ -214,7 +226,7 @@ func (pool *BlockPool) sendRequest(height int64) bool {
|
||||
if peer.NumPendingBlockRequests >= maxRequestsPerPeer {
|
||||
continue
|
||||
}
|
||||
if peer.Base > height || peer.Height < height {
|
||||
if peer.Base > height || peer.Height < height || peer.NoBlock(height) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -250,6 +250,8 @@ func (bcR *BlockchainReactor) RemovePeer(peer p2p.Peer, reason interface{}) {
|
||||
}
|
||||
|
||||
// Receive implements Reactor by handling 4 types of messages (look below).
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
msg, err := bc.DecodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
@@ -277,6 +277,7 @@ func init() {
|
||||
return waitForBlock, err
|
||||
case noBlockResponseEv:
|
||||
fsm.logger.Error("peer does not have requested block", "peer", data.peerID)
|
||||
fsm.pool.SetNoBlock(data.peerID, data.height)
|
||||
|
||||
return waitForBlock, nil
|
||||
case processedBlockEv:
|
||||
|
||||
@@ -102,6 +102,19 @@ func sProcessedBlockEv(current, expected string, reactorError error) fsmStepTest
|
||||
}
|
||||
}
|
||||
|
||||
func sNoBlockResponseEv(current, expected string, peerID p2p.ID, height int64, err error) fsmStepTestValues {
|
||||
return fsmStepTestValues{
|
||||
currentState: current,
|
||||
event: noBlockResponseEv,
|
||||
data: bReactorEventData{
|
||||
peerID: peerID,
|
||||
height: height,
|
||||
},
|
||||
wantState: expected,
|
||||
wantErr: err,
|
||||
}
|
||||
}
|
||||
|
||||
func sStatusEv(current, expected string, peerID p2p.ID, height int64, err error) fsmStepTestValues {
|
||||
return fsmStepTestValues{
|
||||
currentState: current,
|
||||
@@ -354,6 +367,46 @@ func TestFSMBlockVerificationFailure(t *testing.T) {
|
||||
executeFSMTests(t, tests, false)
|
||||
}
|
||||
|
||||
func TestFSMNoBlockResponse(t *testing.T) {
|
||||
tests := []testFields{
|
||||
{
|
||||
name: "no block response",
|
||||
startingHeight: 1,
|
||||
maxRequestsPerPeer: 3,
|
||||
steps: []fsmStepTestValues{
|
||||
sStartFSMEv(),
|
||||
|
||||
// add P1 and get blocks 1-3 from it
|
||||
sStatusEv("waitForPeer", "waitForBlock", "P1", 3, nil),
|
||||
sMakeRequestsEv("waitForBlock", "waitForBlock", maxNumRequests),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P1", 1, []int64{}),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P1", 2, []int64{1}),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P1", 3, []int64{1, 2}),
|
||||
|
||||
// add P2
|
||||
sStatusEv("waitForBlock", "waitForBlock", "P2", 3, nil),
|
||||
|
||||
// process block failure, should remove P1 and all blocks
|
||||
sNoBlockResponseEv("waitForBlock", "waitForBlock", "P1", 1, nil),
|
||||
sNoBlockResponseEv("waitForBlock", "waitForBlock", "P1", 2, nil),
|
||||
sNoBlockResponseEv("waitForBlock", "waitForBlock", "P1", 3, nil),
|
||||
|
||||
// get blocks 1-3 from P2
|
||||
sMakeRequestsEv("waitForBlock", "waitForBlock", maxNumRequests),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P2", 1, []int64{}),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P2", 2, []int64{1}),
|
||||
sBlockRespEv("waitForBlock", "waitForBlock", "P2", 3, []int64{1, 2}),
|
||||
|
||||
// finish after processing blocks 1 and 2
|
||||
sProcessedBlockEv("waitForBlock", "waitForBlock", nil),
|
||||
sProcessedBlockEv("waitForBlock", "finished", nil),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
executeFSMTests(t, tests, false)
|
||||
}
|
||||
|
||||
func TestFSMBadBlockFromPeer(t *testing.T) {
|
||||
tests := []testFields{
|
||||
{
|
||||
|
||||
@@ -455,6 +455,8 @@ func (r *BlockchainReactor) Stop() error {
|
||||
}
|
||||
|
||||
// Receive implements Reactor by handling different message types.
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (r *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
msg, err := bc.DecodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# The version of the generation template.
|
||||
# Required.
|
||||
# The only currently-valid value is v1beta1.
|
||||
version: v1beta1
|
||||
|
||||
# The plugins to run.
|
||||
plugins:
|
||||
# The name of the plugin.
|
||||
- name: gogofaster
|
||||
# The the relative output directory.
|
||||
out: proto
|
||||
# Any options to provide to the plugin.
|
||||
opt: Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
tmjson "github.com/tendermint/tendermint/libs/json"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// GenValidatorCmd allows the generation of a keypair for a
|
||||
@@ -17,8 +18,16 @@ var GenValidatorCmd = &cobra.Command{
|
||||
Run: genValidator,
|
||||
}
|
||||
|
||||
func init() {
|
||||
GenValidatorCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
|
||||
"Key type to generate privval file with. Options: ed25519, secp256k1")
|
||||
}
|
||||
|
||||
func genValidator(cmd *cobra.Command, args []string) {
|
||||
pv := privval.GenFilePV("", "")
|
||||
pv, err := privval.GenFilePV("", "", keyType)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
jsbz, err := tmjson.Marshal(pv)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
tmtime "github.com/tendermint/tendermint/types/time"
|
||||
)
|
||||
@@ -21,6 +22,15 @@ var InitFilesCmd = &cobra.Command{
|
||||
RunE: initFiles,
|
||||
}
|
||||
|
||||
var (
|
||||
keyType string
|
||||
)
|
||||
|
||||
func init() {
|
||||
InitFilesCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
|
||||
"Key type to generate privval file with. Options: ed25519, secp256k1")
|
||||
}
|
||||
|
||||
func initFiles(cmd *cobra.Command, args []string) error {
|
||||
return initFilesWithConfig(config)
|
||||
}
|
||||
@@ -29,13 +39,19 @@ func initFilesWithConfig(config *cfg.Config) error {
|
||||
// private validator
|
||||
privValKeyFile := config.PrivValidatorKeyFile()
|
||||
privValStateFile := config.PrivValidatorStateFile()
|
||||
var pv *privval.FilePV
|
||||
var (
|
||||
pv *privval.FilePV
|
||||
err error
|
||||
)
|
||||
if tmos.FileExists(privValKeyFile) {
|
||||
pv = privval.LoadFilePV(privValKeyFile, privValStateFile)
|
||||
logger.Info("Found private validator", "keyFile", privValKeyFile,
|
||||
"stateFile", privValStateFile)
|
||||
} else {
|
||||
pv = privval.GenFilePV(privValKeyFile, privValStateFile)
|
||||
pv, err = privval.GenFilePV(privValKeyFile, privValStateFile, keyType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pv.Save()
|
||||
logger.Info("Generated private validator", "keyFile", privValKeyFile,
|
||||
"stateFile", privValStateFile)
|
||||
@@ -56,11 +72,17 @@ func initFilesWithConfig(config *cfg.Config) error {
|
||||
if tmos.FileExists(genFile) {
|
||||
logger.Info("Found genesis file", "path", genFile)
|
||||
} else {
|
||||
|
||||
genDoc := types.GenesisDoc{
|
||||
ChainID: fmt.Sprintf("test-chain-%v", tmrand.Str(6)),
|
||||
GenesisTime: tmtime.Now(),
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
}
|
||||
if keyType == "secp256k1" {
|
||||
genDoc.ConsensusParams.Validator = tmproto.ValidatorParams{
|
||||
PubKeyTypes: []string{types.ABCIPubKeyTypeSecp256k1},
|
||||
}
|
||||
}
|
||||
pubKey, err := pv.GetPubKey()
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't get pubkey: %w", err)
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// ResetAllCmd removes the database of this Tendermint core
|
||||
@@ -22,6 +23,8 @@ var keepAddrBook bool
|
||||
|
||||
func init() {
|
||||
ResetAllCmd.Flags().BoolVar(&keepAddrBook, "keep-addr-book", false, "keep the address book intact")
|
||||
ResetPrivValidatorCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
|
||||
"Key type to generate privval file with. Options: ed25519, secp256k1")
|
||||
}
|
||||
|
||||
// ResetPrivValidatorCmd resets the private validator files.
|
||||
@@ -71,7 +74,10 @@ func resetFilePV(privValKeyFile, privValStateFile string, logger log.Logger) {
|
||||
logger.Info("Reset private validator file to genesis state", "keyFile", privValKeyFile,
|
||||
"stateFile", privValStateFile)
|
||||
} else {
|
||||
pv := privval.GenFilePV(privValKeyFile, privValStateFile)
|
||||
pv, err := privval.GenFilePV(privValKeyFile, privValStateFile, keyType)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
pv.Save()
|
||||
logger.Info("Generated private validator file", "keyFile", privValKeyFile,
|
||||
"stateFile", privValStateFile)
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
tmtime "github.com/tendermint/tendermint/types/time"
|
||||
)
|
||||
@@ -74,6 +75,8 @@ func init() {
|
||||
"P2P Port")
|
||||
TestnetFilesCmd.Flags().BoolVar(&randomMonikers, "random-monikers", false,
|
||||
"randomize the moniker for each generated node")
|
||||
TestnetFilesCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
|
||||
"Key type to generate privval file with. Options: ed25519, secp256k1")
|
||||
}
|
||||
|
||||
// TestnetFilesCmd allows initialisation of files for a Tendermint testnet.
|
||||
@@ -180,10 +183,15 @@ func testnetFiles(cmd *cobra.Command, args []string) error {
|
||||
// Generate genesis doc from generated validators
|
||||
genDoc := &types.GenesisDoc{
|
||||
ChainID: "chain-" + tmrand.Str(6),
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
GenesisTime: tmtime.Now(),
|
||||
InitialHeight: initialHeight,
|
||||
Validators: genVals,
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
}
|
||||
if keyType == "secp256k1" {
|
||||
genDoc.ConsensusParams.Validator = tmproto.ValidatorParams{
|
||||
PubKeyTypes: []string{types.ABCIPubKeyTypeSecp256k1},
|
||||
}
|
||||
}
|
||||
|
||||
// Write genesis file.
|
||||
|
||||
+11
-4
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
@@ -63,7 +64,7 @@ func WriteConfigFile(configFilePath string, config *Config) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
tmos.MustWriteFile(configFilePath, buffer.Bytes(), 0644)
|
||||
mustWriteFile(configFilePath, buffer.Bytes(), 0644)
|
||||
}
|
||||
|
||||
// Note: any changes to the comments/variables/mapstructure
|
||||
@@ -492,16 +493,22 @@ func ResetTestRootWithChainID(testName string, chainID string) *Config {
|
||||
chainID = "tendermint_test"
|
||||
}
|
||||
testGenesis := fmt.Sprintf(testGenesisFmt, chainID)
|
||||
tmos.MustWriteFile(genesisFilePath, []byte(testGenesis), 0644)
|
||||
mustWriteFile(genesisFilePath, []byte(testGenesis), 0644)
|
||||
}
|
||||
// we always overwrite the priv val
|
||||
tmos.MustWriteFile(privKeyFilePath, []byte(testPrivValidatorKey), 0644)
|
||||
tmos.MustWriteFile(privStateFilePath, []byte(testPrivValidatorState), 0644)
|
||||
mustWriteFile(privKeyFilePath, []byte(testPrivValidatorKey), 0644)
|
||||
mustWriteFile(privStateFilePath, []byte(testPrivValidatorState), 0644)
|
||||
|
||||
config := TestConfig().SetRoot(rootDir)
|
||||
return config
|
||||
}
|
||||
|
||||
func mustWriteFile(filePath string, contents []byte, mode os.FileMode) {
|
||||
if err := ioutil.WriteFile(filePath, contents, mode); err != nil {
|
||||
tmos.Exit(fmt.Sprintf("failed to write file: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
var testGenesisFmt = `{
|
||||
"genesis_time": "2018-10-10T08:20:13.695936996Z",
|
||||
"chain_id": "%s",
|
||||
|
||||
+12
-11
@@ -108,7 +108,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
eventBuses[i] = css[i].eventBus
|
||||
reactors[i].SetEventBus(eventBuses[i])
|
||||
|
||||
blocksSub, err := eventBuses[i].Subscribe(context.Background(), testSubscriber, types.EventQueryNewBlock)
|
||||
blocksSub, err := eventBuses[i].Subscribe(context.Background(), testSubscriber, types.EventQueryNewBlock, 100)
|
||||
require.NoError(t, err)
|
||||
blocksSubs = append(blocksSubs, blocksSub)
|
||||
|
||||
@@ -167,17 +167,17 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
|
||||
wg := new(sync.WaitGroup)
|
||||
wg.Add(4)
|
||||
for height := 1; height < 6; height++ {
|
||||
for i := 0; i < nValidators; i++ {
|
||||
go func(j int) {
|
||||
msg := <-blocksSubs[j].Out()
|
||||
for i := 0; i < nValidators; i++ {
|
||||
go func(i int) {
|
||||
for msg := range blocksSubs[i].Out() {
|
||||
block := msg.Data().(types.EventDataNewBlock).Block
|
||||
if len(block.Evidence.Evidence) != 0 {
|
||||
evidenceFromEachValidator[j] = block.Evidence.Evidence[0]
|
||||
evidenceFromEachValidator[i] = block.Evidence.Evidence[0]
|
||||
wg.Done()
|
||||
return
|
||||
}
|
||||
}(i)
|
||||
}
|
||||
}
|
||||
}(i)
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
@@ -186,7 +186,8 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
close(done)
|
||||
}()
|
||||
|
||||
pubkey, _ := bcs.privValidator.GetPubKey()
|
||||
pubkey, err := bcs.privValidator.GetPubKey()
|
||||
require.NoError(t, err)
|
||||
|
||||
select {
|
||||
case <-done:
|
||||
@@ -198,11 +199,11 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
assert.Equal(t, prevoteHeight, ev.Height())
|
||||
}
|
||||
}
|
||||
case <-time.After(10 * time.Second):
|
||||
case <-time.After(20 * time.Second):
|
||||
for i, reactor := range reactors {
|
||||
t.Logf("Consensus Reactor %d\n%v", i, reactor)
|
||||
}
|
||||
t.Fatalf("Timed out waiting for all validators to commit first block")
|
||||
t.Fatalf("Timed out waiting for validators to commit evidence")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -414,7 +414,10 @@ func loadPrivValidator(config *cfg.Config) *privval.FilePV {
|
||||
privValidatorKeyFile := config.PrivValidatorKeyFile()
|
||||
ensureDir(filepath.Dir(privValidatorKeyFile), 0700)
|
||||
privValidatorStateFile := config.PrivValidatorStateFile()
|
||||
privValidator := privval.LoadOrGenFilePV(privValidatorKeyFile, privValidatorStateFile)
|
||||
privValidator, err := privval.LoadOrGenFilePV(privValidatorKeyFile, privValidatorStateFile)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
privValidator.Reset()
|
||||
return privValidator
|
||||
}
|
||||
@@ -739,7 +742,10 @@ func randConsensusNetWithPeers(
|
||||
panic(err)
|
||||
}
|
||||
|
||||
privVal = privval.GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err = privval.GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
app := appFunc(path.Join(config.DBDir(), fmt.Sprintf("%s_%d", testName, i)))
|
||||
|
||||
@@ -220,6 +220,8 @@ func (conR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) {
|
||||
// Peer state updates can happen in parallel, but processing of
|
||||
// proposals, block parts, and votes are ordered by the receiveRoutine
|
||||
// NOTE: blocks on consensus state for proposals, block parts, and votes
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (conR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
if !conR.IsRunning() {
|
||||
conR.Logger.Debug("Receive", "src", src, "chId", chID, "bytes", msgBytes)
|
||||
|
||||
@@ -40,7 +40,10 @@ func WALGenerateNBlocks(t *testing.T, wr io.Writer, numBlocks int) (err error) {
|
||||
// NOTE: we don't do handshake so need to set state.Version.Consensus.App directly.
|
||||
privValidatorKeyFile := config.PrivValidatorKeyFile()
|
||||
privValidatorStateFile := config.PrivValidatorStateFile()
|
||||
privValidator := privval.LoadOrGenFilePV(privValidatorKeyFile, privValidatorStateFile)
|
||||
privValidator, err := privval.LoadOrGenFilePV(privValidatorKeyFile, privValidatorStateFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
genDoc, err := types.GenesisDocFromFile(config.GenesisFile())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read genesis file: %w", err)
|
||||
|
||||
@@ -2,11 +2,12 @@ package ed25519
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/ed25519"
|
||||
"crypto/subtle"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"golang.org/x/crypto/ed25519"
|
||||
"github.com/hdevalence/ed25519consensus"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
@@ -151,7 +152,7 @@ func (pubKey PubKey) VerifySignature(msg []byte, sig []byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
return ed25519.Verify(ed25519.PublicKey(pubKey), msg, sig)
|
||||
return ed25519consensus.Verify(ed25519.PublicKey(pubKey), msg, sig)
|
||||
}
|
||||
|
||||
func (pubKey PubKey) String() string {
|
||||
|
||||
@@ -51,7 +51,7 @@ func PubKeyFromProto(k pc.PublicKey) (crypto.PubKey, error) {
|
||||
return pk, nil
|
||||
case *pc.PublicKey_Secp256K1:
|
||||
if len(k.Secp256K1) != secp256k1.PubKeySize {
|
||||
return nil, fmt.Errorf("invalid size for PubKeyEd25519. Got %d, expected %d",
|
||||
return nil, fmt.Errorf("invalid size for PubKeySecp256k1. Got %d, expected %d",
|
||||
len(k.Secp256K1), secp256k1.PubKeySize)
|
||||
}
|
||||
pk := make(secp256k1.PubKey, secp256k1.PubKeySize)
|
||||
|
||||
@@ -158,7 +158,7 @@ func (pubKey PubKey) Bytes() []byte {
|
||||
}
|
||||
|
||||
func (pubKey PubKey) String() string {
|
||||
return fmt.Sprintf("PubKeySecp256k1{%X}", pubKey[:])
|
||||
return fmt.Sprintf("PubKeySecp256k1{%X}", []byte(pubKey))
|
||||
}
|
||||
|
||||
func (pubKey PubKey) Equals(other crypto.PubKey) bool {
|
||||
|
||||
@@ -63,7 +63,7 @@ Note the context/background should be written in the present tense.
|
||||
- [ADR-034-Priv-Validator-File-Structure](./adr-034-priv-validator-file-structure.md)
|
||||
- [ADR-035-Documentation](./adr-035-documentation.md)
|
||||
- [ADR-037-Deliver-Block](./adr-037-deliver-block.md)
|
||||
- [ADR-038-non-zero-start-height](./adr-038-non-zero-start-height.md)
|
||||
- [ADR-038-Non-Zero-Start-Height](./adr-038-non-zero-start-height.md)
|
||||
- [ADR-039-Peer-Behaviour](./adr-039-peer-behaviour.md)
|
||||
- [ADR-041-Proposer-Selection-via-ABCI](./adr-041-proposer-selection-via-abci.md)
|
||||
- [ADR-043-Blockchain-RiRi-Org](./adr-043-blockchain-riri-org.md)
|
||||
@@ -74,8 +74,12 @@ Note the context/background should be written in the present tense.
|
||||
- [ADR-051-Double-Signing-Risk-Reduction](./adr-051-double-signing-risk-reduction.md)
|
||||
- [ADR-052-Tendermint-Mode](./adr-052-tendermint-mode.md)
|
||||
- [ADR-053-State-Sync-Prototype](./adr-053-state-sync-prototype.md)
|
||||
- [ADR-054-crypto-encoding-2](./adr-054-crypto-encoding-2.md)
|
||||
- [ADR-055-protobuf-design](./adr-055-protobuf-design.md)
|
||||
- [ADR-056-light-client-amnesia-attacks](./adr-056-light-client-amnesia-attacks)
|
||||
- [ADR-054-Crypto-Encoding-2](./adr-054-crypto-encoding-2.md)
|
||||
- [ADR-055-Protobuf-Design](./adr-055-protobuf-design.md)
|
||||
- [ADR-056-Light-Client-Amnesia-Attacks](./adr-056-light-client-amnesia-attacks)
|
||||
- [ADR-057-RPC](./adr-057-RPC.md)
|
||||
- [ADR-058-event-hashing](./adr-058-event-hashing.md)
|
||||
- [ADR-058-Event-Hashing](./adr-058-event-hashing.md)
|
||||
- [ADR-059-Evidence-Composition-and-Lifecycle](./adr-059-evidence-composition-and-lifecycle.md)
|
||||
- [ADR-060-Go-API-Stability](./adr-060-go-api-stability.md)
|
||||
- [ADR-061-P2P-Refactor-Scope](./adr-061-p2p-refactor-scope.md)
|
||||
- [ADR-062-P2P-Architecture](./adr-062-p2p-architecture.md)
|
||||
|
||||
@@ -57,7 +57,7 @@ What we need to do next is changing the methods of `FilePV`.
|
||||
|
||||
## Status
|
||||
|
||||
Draft.
|
||||
Accepted and implemented in [#2870](https://github.com/tendermint/tendermint/pull/2870).
|
||||
|
||||
## Consequences
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ When, `state.LastBlockHeight > PotentialAmnesiaEvidence.timestamp + ProofTrialPe
|
||||
*NOTE: Even before the evidence is proposed and committed, the off-chain process of gossiping valid evidence could be
|
||||
enough for honest nodes to recognize the fork and halt.*
|
||||
|
||||
Other validators will vote <nil> if:
|
||||
Other validators will vote `nil` if:
|
||||
|
||||
- The Amnesia Evidence is not valid
|
||||
- The Amensia Evidence is not within their own trial period i.e. too soon.
|
||||
|
||||
@@ -0,0 +1,531 @@
|
||||
# ADR 062: P2P Architecture and Abstractions
|
||||
|
||||
## Changelog
|
||||
|
||||
- 2020-11-09: Initial version (@erikgrinaker)
|
||||
|
||||
- 2020-11-13: Remove stream IDs, move peer errors onto channel, note on moving PEX into core (@erikgrinaker)
|
||||
|
||||
- 2020-11-16: Notes on recommended reactor implementation patterns, approve ADR (@erikgrinaker)
|
||||
|
||||
## Context
|
||||
|
||||
In [ADR 061](adr-061-p2p-refactor-scope.md) we decided to refactor the peer-to-peer (P2P) networking stack. The first phase is to redesign and refactor the internal P2P architecture, while retaining protocol compatibility as far as possible.
|
||||
|
||||
## Alternative Approaches
|
||||
|
||||
Several variations of the proposed design were considered, including e.g. calling interface methods instead of passing messages (like the current architecture), merging channels with streams, exposing the internal peer data structure to reactors, being message format-agnostic via arbitrary codecs, and so on. This design was chosen because it has very loose coupling, is simpler to reason about and more convenient to use, avoids race conditions and lock contention for internal data structures, gives reactors better control of message ordering and processing semantics, and allows for QoS scheduling and backpressure in a very natural way.
|
||||
|
||||
[multiaddr](https://github.com/multiformats/multiaddr) was considered as a transport-agnostic peer address format over regular URLs, but it does not appear to have very widespread adoption, and advanced features like protocol encapsulation and tunneling do not appear to be immediately useful to us.
|
||||
|
||||
There were also proposals to use LibP2P instead of maintaining our own P2P stack, which were rejected (for now) in [ADR 061](adr-061-p2p-refactor-scope.md).
|
||||
|
||||
## Decision
|
||||
|
||||
The P2P stack will be redesigned as a message-oriented architecture, primarily relying on Go channels for communication and scheduling. It will use IO stream transports to exchange raw bytes with individual peers, bidirectional peer-addressable channels to send and receive Protobuf messages, and a router to route messages between reactors and peers. Message passing is asynchronous with at-most-once delivery.
|
||||
|
||||
## Detailed Design
|
||||
|
||||
This ADR is primarily concerned with the architecture and interfaces of the P2P stack, not implementation details. Separate ADRs may be submitted for individual components, since implementation may be non-trivial. The interfaces described here should therefore be considered a rough architecture outline, not a complete and final design.
|
||||
|
||||
Primary design objectives have been:
|
||||
|
||||
* Loose coupling between components, for a simpler, more robust, and test-friendly architecture.
|
||||
* Pluggable transports (not necessarily networked).
|
||||
* Better scheduling of messages, with improved prioritization, backpressure, and performance.
|
||||
* Centralized peer lifecycle and connection management.
|
||||
* Better peer address detection, advertisement, and exchange.
|
||||
* Wire-level backwards compatibility with current P2P network protocols, except where it proves too obstructive.
|
||||
|
||||
The main abstractions in the new stack are:
|
||||
|
||||
* `peer`: A node in the network, uniquely identified by a `PeerID` and stored in a `peerStore`.
|
||||
* `Transport`: An arbitrary mechanism to exchange bytes with a peer using IO `Stream`s across a `Connection`.
|
||||
* `Channel`: A bidirectional channel to asynchronously exchange Protobuf messages with peers addressed with `PeerID`.
|
||||
* `Router`: Maintains transport connections to relevant peers and routes channel messages.
|
||||
* Reactor: A design pattern loosely defined as "something which listens on a channel and reacts to messages".
|
||||
|
||||
These abstractions are illustrated in the following diagram (representing the internals of node A) and described in detail below.
|
||||
|
||||

|
||||
|
||||
### Transports
|
||||
|
||||
Transports are arbitrary mechanisms for exchanging raw bytes with a peer. For example, a gRPC transport would connect to a peer over TCP/IP and send data using the gRPC protocol, while an in-memory transport might communicate with a peer running in another goroutine using internal byte buffers. Note that transports don't have a notion of a `peer` as such - instead, they communicate with an arbitrary endpoint address (e.g. IP address and port number), to decouple them from the rest of the P2P stack.
|
||||
|
||||
Transports must satisfy the following requirements:
|
||||
|
||||
* Be connection-oriented, and support both listening for inbound connections and making outbound connections using endpoint addresses.
|
||||
|
||||
* Support multiple logical IO streams within a single connection, to take full advantage of protocols with native stream support. For example, QUIC supports multiple independent streams, while HTTP/2 and MConn multiplex logical streams onto a single TCP connection.
|
||||
|
||||
* Provide the public key of the peer, and possibly encrypt or sign the traffic as appropriate. This should be compared with known data (e.g. the peer ID) to authenticate the peer and avoid man-in-the-middle attacks.
|
||||
|
||||
The initial transport implementation will be a port of the current MConn protocol currently used by Tendermint, and should be backwards-compatible at the wire level as far as possible. This will be followed by an in-memory transport for testing, and a QUIC transport that may eventually replace MConn.
|
||||
|
||||
The `Transport` interface is:
|
||||
|
||||
```go
|
||||
// Transport is an arbitrary mechanism for exchanging bytes with a peer.
|
||||
type Transport interface {
|
||||
// Accept waits for the next inbound connection on a listening endpoint.
|
||||
Accept(context.Context) (Connection, error)
|
||||
|
||||
// Dial creates an outbound connection to an endpoint.
|
||||
Dial(context.Context, Endpoint) (Connection, error)
|
||||
|
||||
// Endpoints lists endpoints the transport is listening on. Any endpoint IP
|
||||
// addresses do not need to be normalized in any way (e.g. 0.0.0.0 is
|
||||
// valid), as they should be preprocessed before being advertised.
|
||||
Endpoints() []Endpoint
|
||||
}
|
||||
```
|
||||
|
||||
How the transport configures listening is transport-dependent, and not covered by the interface. This typically happens during transport construction, where a single instance of the transport is created and set to listen on an appropriate network interface before being passed to the router.
|
||||
|
||||
#### Endpoints
|
||||
|
||||
`Endpoint` represents a transport endpoint (e.g. an IP address and port). A connection always has two endpoints: one at the local node and one at the remote peer. Outbound connections to remote endpoints are made via `Dial()`, and inbound connections to listening endpoints are returned via `Accept()`.
|
||||
|
||||
The `Endpoint` struct is:
|
||||
|
||||
```go
|
||||
// Endpoint represents a transport connection endpoint, either local or remote.
|
||||
type Endpoint struct {
|
||||
// Protocol specifies the transport protocol, used by the router to pick a
|
||||
// transport for an endpoint.
|
||||
Protocol Protocol
|
||||
|
||||
// Path is an optional, arbitrary transport-specific path or identifier.
|
||||
Path string
|
||||
|
||||
// IP is an IP address (v4 or v6) to connect to. If set, this defines the
|
||||
// endpoint as a networked endpoint.
|
||||
IP net.IP
|
||||
|
||||
// Port is a network port (either TCP or UDP). If not set, a default port
|
||||
// may be used depending on the protocol.
|
||||
Port uint16
|
||||
}
|
||||
|
||||
// Protocol identifies a transport protocol.
|
||||
type Protocol string
|
||||
```
|
||||
|
||||
Endpoints are arbitrary transport-specific addresses, but if they are networked they must use IP addresses and thus rely on IP as a fundamental packet routing protocol. This enables policies for address discovery, advertisement, and exchange - for example, a private `192.168.0.0/24` IP address should only be advertised to peers on that IP network, while the public address `8.8.8.8` may be advertised to all peers. Similarly, any port numbers if given must represent TCP and/or UDP port numbers, in order to use [UPnP](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) to autoconfigure e.g. NAT gateways.
|
||||
|
||||
Non-networked endpoints (without an IP address) are considered local, and will only be advertised to other peers connecting via the same protocol. For example, an in-memory transport used for testing might have `Endpoint{Protocol: "memory", Path: "foo"}` as an address for the node "foo", and this should only be advertised to other nodes using `Protocol: "memory"`.
|
||||
|
||||
#### Connections and Streams
|
||||
|
||||
A connection represents an established transport connection between two endpoints (and thus two nodes), which can be used to exchange bytes via logically distinct IO streams. Connections are set up either via `Transport.Dial()` (outbound) or `Transport.Accept()` (inbound). The caller is responsible for verifying the remote peer's public key as returned by the connection, following the current MConn protocol behavior for now.
|
||||
|
||||
Data is exchanged over IO streams created with `Connection.Stream()`. These implement the standard Go `io.Reader` and `io.Writer` interfaces to read and write bytes. Transports are free to choose how to implement such streams, e.g. by taking advantage of native stream support in the underlying protocol or through multiplexing.
|
||||
|
||||
`Connection` and the related `Stream` interfaces are:
|
||||
|
||||
```go
|
||||
// Connection represents an established connection between two endpoints.
|
||||
type Connection interface {
|
||||
// Stream creates a new logically distinct IO stream within the connection.
|
||||
Stream() (Stream, error)
|
||||
|
||||
// LocalEndpoint returns the local endpoint for the connection.
|
||||
LocalEndpoint() Endpoint
|
||||
|
||||
// RemoteEndpoint returns the remote endpoint for the connection.
|
||||
RemoteEndpoint() Endpoint
|
||||
|
||||
// PubKey returns the public key of the remote peer.
|
||||
PubKey() crypto.PubKey
|
||||
|
||||
// Close closes the connection.
|
||||
Close() error
|
||||
}
|
||||
|
||||
// Stream represents a single logical IO stream within a connection.
|
||||
type Stream interface {
|
||||
io.Reader // Read([]byte) (int, error)
|
||||
io.Writer // Write([]byte) (int, error)
|
||||
io.Closer // Close() error
|
||||
}
|
||||
```
|
||||
|
||||
### Peers
|
||||
|
||||
Peers are other Tendermint network nodes. Each peer is identified by a unique `PeerID`, and has a set of `PeerAddress` addresses expressed as URLs that they can be reached at. Examples of peer addresses might be e.g.:
|
||||
|
||||
* `mconn://b10c@host.domain.com:25567/path`
|
||||
* `unix:///var/run/tendermint/peer.sock`
|
||||
* `memory:testpeer`
|
||||
|
||||
Addresses are resolved into one or more transport endpoints, e.g. by resolving DNS hostnames into IP addresses (which should be refreshed periodically). Peers should always be expressed as address URLs, and never as endpoints which are a lower-level construct.
|
||||
|
||||
```go
|
||||
// PeerID is a unique peer ID, generally expressed in hex form.
|
||||
type PeerID []byte
|
||||
|
||||
// PeerAddress is a peer address URL. The User field, if set, gives the
|
||||
// hex-encoded remote PeerID, which should be verified with the remote peer's
|
||||
// public key as returned by the connection.
|
||||
type PeerAddress url.URL
|
||||
|
||||
// Resolve resolves a PeerAddress into a set of Endpoints, typically by
|
||||
// expanding out a DNS name in Host to its IP addresses. Field mapping:
|
||||
//
|
||||
// Scheme → Endpoint.Protocol
|
||||
// Host → Endpoint.IP
|
||||
// Port → Endpoint.Port
|
||||
// Path+Query+Fragment,Opaque → Endpoint.Path
|
||||
//
|
||||
func (a PeerAddress) Resolve(ctx context.Context) []Endpoint { return nil }
|
||||
```
|
||||
|
||||
The P2P stack needs to track a lot of internal information about peers, such as endpoints, status, priorities, and so on. This is done in an internal `peer` struct, which should not be exposed outside of the `p2p` package (e.g. to reactors) in order to avoid race conditions and lock contention - other packages should use `PeerID`.
|
||||
|
||||
The `peer` struct might look like the following, but is intentionally underspecified and will depend on implementation requirements (for example, it will almost certainly have to track statistics about connection failures and retries):
|
||||
|
||||
```go
|
||||
// peer tracks internal status information about a peer.
|
||||
type peer struct {
|
||||
ID PeerID
|
||||
Status PeerStatus
|
||||
Priority PeerPriority
|
||||
Endpoints map[PeerAddress][]Endpoint // Resolved endpoints by address.
|
||||
}
|
||||
|
||||
// PeerStatus specifies peer statuses.
|
||||
type PeerStatus string
|
||||
|
||||
const (
|
||||
PeerStatusNew = "new" // New peer which we haven't tried to contact yet.
|
||||
PeerStatusUp = "up" // Peer which we have an active connection to.
|
||||
PeerStatusDown = "down" // Peer which we're temporarily disconnected from.
|
||||
PeerStatusRemoved = "removed" // Peer which has been removed.
|
||||
PeerStatusBanned = "banned" // Peer which is banned for misbehavior.
|
||||
)
|
||||
|
||||
// PeerPriority specifies peer priorities.
|
||||
type PeerPriority int
|
||||
|
||||
const (
|
||||
PeerPriorityNormal PeerPriority = iota + 1
|
||||
PeerPriorityValidator
|
||||
PeerPriorityPersistent
|
||||
)
|
||||
```
|
||||
|
||||
Peer information is stored in a `peerStore`, which may be persisted in an underlying database, and will replace the current address book either partially or in full. It is kept internal to avoid race conditions and tight coupling, and should at the very least contain basic CRUD functionality as outlined below, but will likely need additional functionality and is intentionally underspecified:
|
||||
|
||||
```go
|
||||
// peerStore contains information about peers, possibly persisted to disk.
|
||||
type peerStore struct {
|
||||
peers map[string]*peer // Entire set in memory, with PeerID.String() keys.
|
||||
db dbm.DB // Database for persistence, if non-nil.
|
||||
}
|
||||
|
||||
func (p *peerStore) Delete(id PeerID) error { return nil }
|
||||
func (p *peerStore) Get(id PeerID) (peer, bool) { return peer{}, false }
|
||||
func (p *peerStore) List() []peer { return nil }
|
||||
func (p *peerStore) Set(peer peer) error { return nil }
|
||||
```
|
||||
|
||||
Peer address detection, advertisement and exchange (including detection of externally-reachable addresses via e.g. NAT gateways) is out of scope for this ADR, but may be covered in a separate ADR. The current PEX reactor should probably be absorbed into the core P2P stack and protocol instead of running as a separate reactor, since this needs to mutate the core peer data structures and will thus be tightly coupled with the router.
|
||||
|
||||
### Channels
|
||||
|
||||
While low-level data exchange happens via transport IO streams, the high-level API is based on a bidirectional `Channel` that can send and receive Protobuf messages addressed by `PeerID`. A channel is identified by an arbitrary `ChannelID` identifier, and can exchange Protobuf messages of one specific type (since the type to unmarshal into must be known). Message delivery is asynchronous and at-most-once.
|
||||
|
||||
The channel can also be used to report peer errors, e.g. when receiving an invalid or malignant message. This may cause the peer to be disconnected or banned depending on the router's policy.
|
||||
|
||||
A `Channel` has this interface:
|
||||
|
||||
```go
|
||||
// Channel is a bidirectional channel for Protobuf message exchange with peers.
|
||||
type Channel struct {
|
||||
// ID contains the channel ID.
|
||||
ID ChannelID
|
||||
|
||||
// messageType specifies the type of messages exchanged via the channel, and
|
||||
// is used e.g. for automatic unmarshaling.
|
||||
messageType proto.Message
|
||||
|
||||
// In is a channel for receiving inbound messages. Envelope.From is always
|
||||
// set.
|
||||
In <-chan Envelope
|
||||
|
||||
// Out is a channel for sending outbound messages. Envelope.To or Broadcast
|
||||
// must be set, otherwise the message is discarded.
|
||||
Out chan<- Envelope
|
||||
|
||||
// Error is a channel for reporting peer errors to the router, typically used
|
||||
// when peers send an invalid or malignant message.
|
||||
Error chan<- PeerError
|
||||
}
|
||||
|
||||
// Close closes the channel, and is equivalent to close(Channel.Out). This will
|
||||
// cause Channel.In to be closed when appropriate. The ID can then be reused.
|
||||
func (c *Channel) Close() error { return nil }
|
||||
|
||||
// ChannelID is an arbitrary channel ID.
|
||||
type ChannelID uint16
|
||||
|
||||
// Envelope specifies the message receiver and sender.
|
||||
type Envelope struct {
|
||||
From PeerID // Message sender, or empty for outbound messages.
|
||||
To PeerID // Message receiver, or empty for inbound messages.
|
||||
Broadcast bool // Send message to all connected peers, ignoring To.
|
||||
Message proto.Message // Payload.
|
||||
}
|
||||
|
||||
// PeerError is a peer error reported by a reactor via the Error channel. The
|
||||
// severity may cause the peer to be disconnected or banned depending on policy.
|
||||
type PeerError struct {
|
||||
PeerID PeerID
|
||||
Err error
|
||||
Severity PeerErrorSeverity
|
||||
}
|
||||
|
||||
// PeerErrorSeverity determines the severity of a peer error.
|
||||
type PeerErrorSeverity string
|
||||
|
||||
const (
|
||||
PeerErrorSeverityLow PeerErrorSeverity = "low" // Mostly ignored.
|
||||
PeerErrorSeverityHigh PeerErrorSeverity = "high" // May disconnect.
|
||||
PeerErrorSeverityCritical PeerErrorSeverity = "critical" // Ban.
|
||||
)
|
||||
```
|
||||
|
||||
A channel can reach any connected peer, and is implemented using transport streams against each individual peer, with an initial handshake to exchange the channel ID and any other metadata. The channel will automatically (un)marshal Protobuf to byte slices and use length-prefixed framing (the de facto standard for Protobuf streams) when writing them to the stream.
|
||||
|
||||
Message scheduling and queueing is left as an implementation detail, and can use any number of algorithms such as FIFO, round-robin, priority queues, etc. Since message delivery is not guaranteed, both inbound and outbound messages may be dropped, buffered, or blocked as appropriate.
|
||||
|
||||
Since a channel can only exchange messages of a single type, it is often useful to use a wrapper message type with e.g. a Protobuf `oneof` field that specifies a set of inner message types that it can contain. The channel can automatically perform this (un)wrapping if the outer message type implements the `Wrapper` interface (see [Reactor Example](#reactor-example) for an example):
|
||||
|
||||
```go
|
||||
// Wrapper is a Protobuf message that can contain a variety of inner messages.
|
||||
// If a Channel's message type implements Wrapper, the channel will
|
||||
// automatically (un)wrap passed messages using the container type, such that
|
||||
// the channel can transparently support multiple message types.
|
||||
type Wrapper interface {
|
||||
// Wrap will take a message and wrap it in this one.
|
||||
Wrap(proto.Message) error
|
||||
|
||||
// Unwrap will unwrap the inner message contained in this message.
|
||||
Unwrap() (proto.Message, error)
|
||||
}
|
||||
```
|
||||
|
||||
### Routers
|
||||
|
||||
The router manages all P2P networking for a node, and is responsible for keeping track of network peers, maintaining transport connections, and routing channel messages. As such, it must do e.g. connection retries and backoff, message QoS scheduling and backpressure, peer quality assessments, and endpoint detection and advertisement. In addition, the router provides a mechanism to subscribe to peer updates (e.g. peers connecting or disconnecting), and handles reported peer errors from reactors.
|
||||
|
||||
The implementation of the router is likely to be non-trivial, and is intentionally unspecified here. A separate ADR will likely be submitted for this. It is unclear whether message routing/scheduling and peer lifecycle management can be split into two separate components, or if these need to be tightly coupled.
|
||||
|
||||
The `Router` API is as follows:
|
||||
|
||||
```go
|
||||
// Router manages connections to peers and routes Protobuf messages between them
|
||||
// and local reactors. It also provides peer status updates and error reporting.
|
||||
type Router struct{}
|
||||
|
||||
// NewRouter creates a new router, using the given peer store to track peers.
|
||||
// Transports must be pre-initialized to listen on appropriate endpoints.
|
||||
func NewRouter(peerStore *peerStore, transports map[Protocol]Transport) *Router { return nil }
|
||||
|
||||
// Channel opens a new channel with the given ID. messageType should be an empty
|
||||
// Protobuf message of the type that will be passed through the channel. The
|
||||
// message can implement Wrapper for automatic message (un)wrapping.
|
||||
func (r *Router) Channel(id ChannelID, messageType proto.Message) (*Channel, error) { return nil, nil }
|
||||
|
||||
// PeerUpdates returns a channel with peer updates. The caller must cancel the
|
||||
// context to end the subscription, and keep consuming messages in a timely
|
||||
// fashion until the channel is closed to avoid blocking updates.
|
||||
func (r *Router) PeerUpdates(ctx context.Context) PeerUpdates { return nil }
|
||||
|
||||
// PeerUpdates is a channel for receiving peer updates.
|
||||
type PeerUpdates <-chan PeerUpdate
|
||||
|
||||
// PeerUpdate is a peer status update for reactors.
|
||||
type PeerUpdate struct {
|
||||
PeerID PeerID
|
||||
Status PeerStatus
|
||||
}
|
||||
```
|
||||
|
||||
### Reactor Example
|
||||
|
||||
While reactors are a first-class concept in the current P2P stack (i.e. there is an explicit `p2p.Reactor` interface), they will simply be a design pattern in the new stack, loosely defined as "something which listens on a channel and reacts to messages".
|
||||
|
||||
Since reactors have very few formal constraints, they can be implemented in a variety of ways. There is currently no recommended pattern for implementing reactors, to avoid overspecification and scope creep in this ADR. However, prototyping and developing a reactor pattern should be done early during implementation, to make sure reactors built using the `Channel` interface can satisfy the needs for convenience, deterministic tests, and reliability.
|
||||
|
||||
Below is a trivial example of a simple echo reactor implemented as a function. The reactor will exchange the following Protobuf messages:
|
||||
|
||||
```protobuf
|
||||
message EchoMessage {
|
||||
oneof inner {
|
||||
PingMessage ping = 1;
|
||||
PongMessage pong = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message PingMessage {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message PongMessage {
|
||||
string content = 1;
|
||||
}
|
||||
```
|
||||
|
||||
Implementing the `Wrapper` interface for `EchoMessage` allows transparently passing `PingMessage` and `PongMessage` through the channel, where it will automatically be (un)wrapped in an `EchoMessage`:
|
||||
|
||||
```go
|
||||
func (m *EchoMessage) Wrap(inner proto.Message) error {
|
||||
switch inner := inner.(type) {
|
||||
case *PingMessage:
|
||||
m.Inner = &EchoMessage_PingMessage{Ping: inner}
|
||||
case *PongMessage:
|
||||
m.Inner = &EchoMessage_PongMessage{Pong: inner}
|
||||
default:
|
||||
return fmt.Errorf("unknown message %T", inner)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *EchoMessage) Unwrap() (proto.Message, error) {
|
||||
switch inner := m.Inner.(type) {
|
||||
case *EchoMessage_PingMessage:
|
||||
return inner.Ping, nil
|
||||
case *EchoMessage_PongMessage:
|
||||
return inner.Pong, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown message %T", inner)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The reactor itself would be implemented e.g. like this:
|
||||
|
||||
```go
|
||||
// RunEchoReactor wires up an echo reactor to a router and runs it.
|
||||
func RunEchoReactor(router *p2p.Router) error {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
channel, err := router.Channel(1, &EchoMessage{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer channel.Close()
|
||||
|
||||
return EchoReactor(ctx, channel, router.PeerUpdates(ctx))
|
||||
}
|
||||
|
||||
// EchoReactor provides an echo service, pinging all known peers until cancelled.
|
||||
func EchoReactor(ctx context.Context, channel *p2p.Channel, peerUpdates p2p.PeerUpdates) error {
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
// Send ping message to all known peers every 5 seconds.
|
||||
case <-ticker.C:
|
||||
channel.Out <- Envelope{
|
||||
Broadcast: true,
|
||||
Message: &PingMessage{Content: "👋"},
|
||||
}
|
||||
|
||||
// When we receive a message from a peer, either respond to ping, output
|
||||
// pong, or report peer error on unknown message type.
|
||||
case envelope := <-channel.In:
|
||||
switch msg := envelope.Message.(type) {
|
||||
case *PingMessage:
|
||||
channel.Out <- Envelope{
|
||||
To: envelope.From,
|
||||
Message: &PongMessage{Content: msg.Content},
|
||||
}
|
||||
|
||||
case *PongMessage:
|
||||
fmt.Printf("%q replied with %q\n", envelope.From, msg.Content)
|
||||
|
||||
default:
|
||||
channel.Error <- PeerError{
|
||||
PeerID: envelope.From,
|
||||
Err: fmt.Errorf("unexpected message %T", msg),
|
||||
Severity: PeerErrorSeverityLow,
|
||||
}
|
||||
}
|
||||
|
||||
// Output info about any peer status changes.
|
||||
case peerUpdate := <-peerUpdates:
|
||||
fmt.Printf("Peer %q changed status to %q", peerUpdate.PeerID, peerUpdate.Status)
|
||||
|
||||
// Exit when context is cancelled.
|
||||
case <-ctx.Done():
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Implementation Plan
|
||||
|
||||
The existing P2P stack should be gradually migrated towards this design. The easiest path would likely be:
|
||||
|
||||
1. Implement the `Channel` and `PeerUpdates` APIs as shims on top of the current `Switch` and `Peer` APIs, and rewrite all reactors to use them instead.
|
||||
|
||||
2. Port the `privval` package to no longer use `SecretConnection` (e.g. by using gRPC instead), or temporarily duplicate its functionality.
|
||||
|
||||
3. Rewrite the current MConn connection and transport code to use the new `Transport` API, and migrate existing code to use it instead.
|
||||
|
||||
4. Implement the new `peer` and `peerStore` APIs, and either make the current address book a shim on top of these or replace it.
|
||||
|
||||
5. Replace the existing `Switch` abstraction with the new `Router`.
|
||||
|
||||
6. Move the PEX reactor and other address advertisement/exchange into the P2P core, possibly the `Router`.
|
||||
|
||||
7. Consider rewriting and/or cleaning up reactors and other P2P-related code to make better use of the new abstractions.
|
||||
|
||||
A note on backwards-compatibility: the current MConn protocol takes whole messages expressed as byte slices and splits them up into `PacketMsg` messages, where the final packet of a message has `PacketMsg.EOF` set. In order to maintain wire-compatibility with this protocol, the MConn transport needs to be aware of message boundaries, even though it does not care what the messages actually are. One way to handle this is to break abstraction boundaries and have the transport decode the input's length-prefixed message framing and use this to determine message boundaries, unless we accept breaking the protocol here.
|
||||
|
||||
Similarly, implementing channel handshakes with the current MConn protocol would require doing an initial connection handshake as today and use that information to "fake" the local channel handshake without it hitting the wire.
|
||||
|
||||
## Status
|
||||
|
||||
Accepted
|
||||
|
||||
## Consequences
|
||||
|
||||
### Positive
|
||||
|
||||
* Reduced coupling and simplified interfaces should lead to better understandability, increased reliability, and more testing.
|
||||
|
||||
* Using message passing via Go channels gives better control of backpressure and quality-of-service scheduling.
|
||||
|
||||
* Peer lifecycle and connection management is centralized in a single entity, making it easier to reason about.
|
||||
|
||||
* Detection, advertisement, and exchange of node addresses will be improved.
|
||||
|
||||
* Additional transports (e.g. QUIC) can be implemented and used in parallel with the existing MConn protocol.
|
||||
|
||||
* The P2P protocol will not be broken in the initial version, if possible.
|
||||
|
||||
### Negative
|
||||
|
||||
* Fully implementing the new design as indended is likely to require breaking changes to the P2P protocol at some point, although the initial implementation shouldn't.
|
||||
|
||||
* Gradually migrating the existing stack and maintaining backwards-compatibility will be more labor-intensive than simply replacing the entire stack.
|
||||
|
||||
* A complete overhaul of P2P internals is likely to cause temporary performance regressions and bugs as the implementation matures.
|
||||
|
||||
* Hiding peer management information inside the `p2p` package may prevent certain functionality or require additional deliberate interfaces for information exchange, as a tradeoff to simplify the design, reduce coupling, and avoid race conditions and lock contention.
|
||||
|
||||
### Neutral
|
||||
|
||||
* Implementation details around e.g. peer management, message scheduling, and peer and endpoint advertisement are not yet determined.
|
||||
|
||||
## References
|
||||
|
||||
* [ADR 061: P2P Refactor Scope](adr-061-p2p-refactor-scope.md)
|
||||
* [#5670 p2p: internal refactor and architecture redesign](https://github.com/tendermint/tendermint/issues/5670)
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 370 KiB |
@@ -0,0 +1,43 @@
|
||||
---
|
||||
order: 1
|
||||
parent:
|
||||
title: Nodes
|
||||
order: 4
|
||||
---
|
||||
|
||||
This section will focus on how to operate full nodes, validators and light clients.
|
||||
|
||||
- [Node Types](#node-types)
|
||||
- [Configuration](./configuration.md)
|
||||
- [Configure State sync](./state_sync.md)
|
||||
- [Validator Guides](./validators.md)
|
||||
- [How to secure your keys](./validators.md#validator_keys)
|
||||
- [Light Client guides](./light-client.md)
|
||||
- [How to sync a light client](./light-client.md#)
|
||||
- [Metrics](./metrics.md)
|
||||
|
||||
## Node Types
|
||||
|
||||
We will cover the various types of node types within Tendermint.
|
||||
|
||||
### Full Node
|
||||
|
||||
A full node is a node that participates in the network but will not help secure it. Full nodes can be used to store the entire state of a blockchain. For Tendermint there are two forms of state. First, blockchain state, this represents the blocks of a blockchain. Secondly, there is Application state, this represents the state that transactions modify. The knowledge of how a transaction can modify state is not held by Tendermint but rather the application on the other side of the ABCI boundary.
|
||||
|
||||
> Note: If you have not read about the seperation of consensus and application please take a few minutes to read up on it as it will provide a better understanding to many of the terms we use throughout the documentation. You can find more information on the ABCI [here](../app-dev/app-architecture.md).
|
||||
|
||||
As a full node operator you are providing services to the network that helps it come to consensus and others catch up to the current block. Even though a full node only helps the network come to consensus it is important to secure your node from adversarial actors. We recommend using a firewall and a proxy if possible. Running a full node can be easy, but it varies from network to network. Verify your applications documentation prior running a node.
|
||||
|
||||
### Seed Nodes
|
||||
|
||||
A seed node provides a node with a list of peers which a node can connect to. When starting a node you must provide at least one type of node to be able to connect to the desired network. By providing a seed node you will be able to populate your address quickly. A seed node will not be kept as a peer but will disconnect from your node after it has provided a list of peers.
|
||||
|
||||
### Sentry Node
|
||||
|
||||
A sentry node is similar to a full node in almost every way. The difference is a sentry node will have one or more private peers. These peers may be validators or other full nodes in the network. A sentry node is meant to provide a layer of security for your validator, similar to how a firewall works with a computer.
|
||||
|
||||
### Validators
|
||||
|
||||
Validators are nodes that participate in the security of a network. Validators have an associated power in Tendermint, this power can represent stake in a [proof of stake](https://en.wikipedia.org/wiki/Proof_of_stake) system, reputation in [proof of authority](https://en.wikipedia.org/wiki/Proof_of_authority) or any sort of measurable unit. Running a secure and consistently online validator is crucial to a networks health. A validator must be secure and fault tolerant, it is recommended to run your validator with 2 or more sentry nodes.
|
||||
|
||||
As a validator there is the potential to have your weight reduced, this is defined by the application. Tendermint is notified by the application if a validator should have there weight increased or reduced. Application have different types of malicious behavior which lead to slashing of the validators power. Please check the documentation of the application you will be running in order to find more information.
|
||||
@@ -0,0 +1,492 @@
|
||||
---
|
||||
order: 3
|
||||
---
|
||||
|
||||
# Configuration
|
||||
|
||||
Tendermint Core can be configured via a TOML file in
|
||||
`$TMHOME/config/config.toml`. Some of these parameters can be overridden by
|
||||
command-line flags. For most users, the options in the `##### main base configuration options #####` are intended to be modified while config options
|
||||
further below are intended for advance power users.
|
||||
|
||||
## Options
|
||||
|
||||
The default configuration file create by `tendermint init` has all
|
||||
the parameters set with their default values. It will look something
|
||||
like the file below, however, double check by inspecting the
|
||||
`config.toml` created with your version of `tendermint` installed:
|
||||
|
||||
```toml
|
||||
# This is a TOML config file.
|
||||
# For more information, see https://github.com/toml-lang/toml
|
||||
|
||||
# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or
|
||||
# relative to the home directory (e.g. "data"). The home directory is
|
||||
# "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable
|
||||
# or --home cmd flag.
|
||||
|
||||
#######################################################################
|
||||
### Main Base Config Options ###
|
||||
#######################################################################
|
||||
|
||||
# TCP or UNIX socket address of the ABCI application,
|
||||
# or the name of an ABCI application compiled in with the Tendermint binary
|
||||
proxy_app = "tcp://127.0.0.1:26658"
|
||||
|
||||
# A custom human readable name for this node
|
||||
moniker = "anonymous"
|
||||
|
||||
# If this node is many blocks behind the tip of the chain, FastSync
|
||||
# allows them to catchup quickly by downloading blocks in parallel
|
||||
# and verifying their commits
|
||||
fast_sync = true
|
||||
|
||||
# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb
|
||||
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
|
||||
# - pure go
|
||||
# - stable
|
||||
# * cleveldb (uses levigo wrapper)
|
||||
# - fast
|
||||
# - requires gcc
|
||||
# - use cleveldb build tag (go build -tags cleveldb)
|
||||
# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
|
||||
# - EXPERIMENTAL
|
||||
# - may be faster is some use-cases (random reads - indexer)
|
||||
# - use boltdb build tag (go build -tags boltdb)
|
||||
# * rocksdb (uses github.com/tecbot/gorocksdb)
|
||||
# - EXPERIMENTAL
|
||||
# - requires gcc
|
||||
# - use rocksdb build tag (go build -tags rocksdb)
|
||||
# * badgerdb (uses github.com/dgraph-io/badger)
|
||||
# - EXPERIMENTAL
|
||||
# - use badgerdb build tag (go build -tags badgerdb)
|
||||
db_backend = "goleveldb"
|
||||
|
||||
# Database directory
|
||||
db_dir = "data"
|
||||
|
||||
# Output level for logging, including package level options
|
||||
log_level = "main:info,state:info,statesync:info,*:error"
|
||||
|
||||
# Output format: 'plain' (colored text) or 'json'
|
||||
log_format = "plain"
|
||||
|
||||
##### additional base config options #####
|
||||
|
||||
# Path to the JSON file containing the initial validator set and other meta data
|
||||
genesis_file = "config/genesis.json"
|
||||
|
||||
# Path to the JSON file containing the private key to use as a validator in the consensus protocol
|
||||
priv_validator_key_file = "config/priv_validator_key.json"
|
||||
|
||||
# Path to the JSON file containing the last sign state of a validator
|
||||
priv_validator_state_file = "data/priv_validator_state.json"
|
||||
|
||||
# TCP or UNIX socket address for Tendermint to listen on for
|
||||
# connections from an external PrivValidator process
|
||||
priv_validator_laddr = ""
|
||||
|
||||
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
|
||||
node_key_file = "config/node_key.json"
|
||||
|
||||
# Mechanism to connect to the ABCI application: socket | grpc
|
||||
abci = "socket"
|
||||
|
||||
# If true, query the ABCI app on connecting to a new peer
|
||||
# so the app can decide if we should keep the connection or not
|
||||
filter_peers = false
|
||||
|
||||
|
||||
#######################################################################
|
||||
### Advanced Configuration Options ###
|
||||
#######################################################################
|
||||
|
||||
#######################################################
|
||||
### RPC Server Configuration Options ###
|
||||
#######################################################
|
||||
[rpc]
|
||||
|
||||
# TCP or UNIX socket address for the RPC server to listen on
|
||||
laddr = "tcp://127.0.0.1:26657"
|
||||
|
||||
# A list of origins a cross-domain request can be executed from
|
||||
# Default value '[]' disables cors support
|
||||
# Use '["*"]' to allow any origin
|
||||
cors_allowed_origins = []
|
||||
|
||||
# A list of methods the client is allowed to use with cross-domain requests
|
||||
cors_allowed_methods = ["HEAD", "GET", "POST", ]
|
||||
|
||||
# A list of non simple headers the client is allowed to use with cross-domain requests
|
||||
cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ]
|
||||
|
||||
# TCP or UNIX socket address for the gRPC server to listen on
|
||||
# NOTE: This server only supports /broadcast_tx_commit
|
||||
grpc_laddr = ""
|
||||
|
||||
# Maximum number of simultaneous connections.
|
||||
# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
|
||||
# 1024 - 40 - 10 - 50 = 924 = ~900
|
||||
grpc_max_open_connections = 900
|
||||
|
||||
# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
|
||||
unsafe = false
|
||||
|
||||
# Maximum number of simultaneous connections (including WebSocket).
|
||||
# Does not include gRPC connections. See grpc_max_open_connections
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
|
||||
# 1024 - 40 - 10 - 50 = 924 = ~900
|
||||
max_open_connections = 900
|
||||
|
||||
# Maximum number of unique clientIDs that can /subscribe
|
||||
# If you're using /broadcast_tx_commit, set to the estimated maximum number
|
||||
# of broadcast_tx_commit calls per block.
|
||||
max_subscription_clients = 100
|
||||
|
||||
# Maximum number of unique queries a given client can /subscribe to
|
||||
# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
|
||||
# the estimated # maximum number of broadcast_tx_commit calls per block.
|
||||
max_subscriptions_per_client = 5
|
||||
|
||||
# How long to wait for a tx to be committed during /broadcast_tx_commit.
|
||||
# WARNING: Using a value larger than 10s will result in increasing the
|
||||
# global HTTP write timeout, which applies to all connections and endpoints.
|
||||
# See https://github.com/tendermint/tendermint/issues/3435
|
||||
timeout_broadcast_tx_commit = "10s"
|
||||
|
||||
# Maximum size of request body, in bytes
|
||||
max_body_bytes = 1000000
|
||||
|
||||
# Maximum size of request header, in bytes
|
||||
max_header_bytes = 1048576
|
||||
|
||||
# The path to a file containing certificate that is used to create the HTTPS server.
|
||||
# Migth be either absolute path or path related to tendermint's config directory.
|
||||
# If the certificate is signed by a certificate authority,
|
||||
# the certFile should be the concatenation of the server's certificate, any intermediates,
|
||||
# and the CA's certificate.
|
||||
# NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
|
||||
# Otherwise, HTTP server is run.
|
||||
tls_cert_file = ""
|
||||
|
||||
# The path to a file containing matching private key that is used to create the HTTPS server.
|
||||
# Migth be either absolute path or path related to tendermint's config directory.
|
||||
# NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
|
||||
# Otherwise, HTTP server is run.
|
||||
tls_key_file = ""
|
||||
|
||||
# pprof listen address (https://golang.org/pkg/net/http/pprof)
|
||||
pprof_laddr = ""
|
||||
|
||||
#######################################################
|
||||
### P2P Configuration Options ###
|
||||
#######################################################
|
||||
[p2p]
|
||||
|
||||
# Address to listen for incoming connections
|
||||
laddr = "tcp://0.0.0.0:26656"
|
||||
|
||||
# Address to advertise to peers for them to dial
|
||||
# If empty, will use the same port as the laddr,
|
||||
# and will introspect on the listener or use UPnP
|
||||
# to figure out the address.
|
||||
external_address = ""
|
||||
|
||||
# Comma separated list of seed nodes to connect to
|
||||
seeds = ""
|
||||
|
||||
# Comma separated list of nodes to keep persistent connections to
|
||||
persistent_peers = ""
|
||||
|
||||
# UPNP port forwarding
|
||||
upnp = false
|
||||
|
||||
# Path to address book
|
||||
addr_book_file = "config/addrbook.json"
|
||||
|
||||
# Set true for strict address routability rules
|
||||
# Set false for private or local networks
|
||||
addr_book_strict = true
|
||||
|
||||
# Maximum number of inbound peers
|
||||
max_num_inbound_peers = 40
|
||||
|
||||
# Maximum number of outbound peers to connect to, excluding persistent peers
|
||||
max_num_outbound_peers = 10
|
||||
|
||||
# List of node IDs, to which a connection will be (re)established ignoring any existing limits
|
||||
unconditional_peer_ids = ""
|
||||
|
||||
# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
|
||||
persistent_peers_max_dial_period = "0s"
|
||||
|
||||
# Time to wait before flushing messages out on the connection
|
||||
flush_throttle_timeout = "100ms"
|
||||
|
||||
# Maximum size of a message packet payload, in bytes
|
||||
max_packet_msg_payload_size = 1024
|
||||
|
||||
# Rate at which packets can be sent, in bytes/second
|
||||
send_rate = 5120000
|
||||
|
||||
# Rate at which packets can be received, in bytes/second
|
||||
recv_rate = 5120000
|
||||
|
||||
# Set true to enable the peer-exchange reactor
|
||||
pex = true
|
||||
|
||||
# Seed mode, in which node constantly crawls the network and looks for
|
||||
# peers. If another node asks it for addresses, it responds and disconnects.
|
||||
#
|
||||
# Does not work if the peer-exchange reactor is disabled.
|
||||
seed_mode = false
|
||||
|
||||
# Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
|
||||
private_peer_ids = ""
|
||||
|
||||
# Toggle to disable guard against peers connecting from the same ip.
|
||||
allow_duplicate_ip = false
|
||||
|
||||
# Peer connection configuration.
|
||||
handshake_timeout = "20s"
|
||||
dial_timeout = "3s"
|
||||
|
||||
#######################################################
|
||||
### Mempool Configurattion Option ###
|
||||
#######################################################
|
||||
[mempool]
|
||||
|
||||
recheck = true
|
||||
broadcast = true
|
||||
wal_dir = ""
|
||||
|
||||
# Maximum number of transactions in the mempool
|
||||
size = 5000
|
||||
|
||||
# Limit the total size of all txs in the mempool.
|
||||
# This only accounts for raw transactions (e.g. given 1MB transactions and
|
||||
# max_txs_bytes=5MB, mempool will only accept 5 transactions).
|
||||
max_txs_bytes = 1073741824
|
||||
|
||||
# Size of the cache (used to filter transactions we saw earlier) in transactions
|
||||
cache_size = 10000
|
||||
|
||||
# Maximum size of a single transaction.
|
||||
# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}.
|
||||
max_tx_bytes = 1048576
|
||||
|
||||
# Maximum size of a batch of transactions to send to a peer
|
||||
# Including space needed by encoding (one varint per transaction).
|
||||
max_batch_bytes = 10485760
|
||||
|
||||
#######################################################
|
||||
### State Sync Configuration Options ###
|
||||
#######################################################
|
||||
[statesync]
|
||||
# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
|
||||
# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
|
||||
# the network to take and serve state machine snapshots. State sync is not attempted if the node
|
||||
# has any local state (LastBlockHeight > 0). The node will have a truncated block history,
|
||||
# starting from the height of the snapshot.
|
||||
enable = false
|
||||
|
||||
# RPC servers (comma-separated) for light client verification of the synced state machine and
|
||||
# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
|
||||
# header hash obtained from a trusted source, and a period during which validators can be trusted.
|
||||
#
|
||||
# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2
|
||||
# weeks) during which they can be financially punished (slashed) for misbehavior.
|
||||
rpc_servers = ""
|
||||
trust_height = 0
|
||||
trust_hash = ""
|
||||
trust_period = "168h0m0s"
|
||||
|
||||
# Time to spend discovering snapshots before initiating a restore.
|
||||
discovery_time = "15s"
|
||||
|
||||
# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp).
|
||||
# Will create a new, randomly named directory within, and remove it when done.
|
||||
temp_dir = ""
|
||||
|
||||
#######################################################
|
||||
### Fast Sync Configuration Connections ###
|
||||
#######################################################
|
||||
[fastsync]
|
||||
|
||||
# Fast Sync version to use:
|
||||
# 1) "v0" (default) - the legacy fast sync implementation
|
||||
# 2) "v1" - refactor of v0 version for better testability
|
||||
# 2) "v2" - complete redesign of v0, optimized for testability & readability
|
||||
version = "v0"
|
||||
|
||||
#######################################################
|
||||
### Consensus Configuration Options ###
|
||||
#######################################################
|
||||
[consensus]
|
||||
|
||||
wal_file = "data/cs.wal/wal"
|
||||
|
||||
# How long we wait for a proposal block before prevoting nil
|
||||
timeout_propose = "3s"
|
||||
# How much timeout_propose increases with each round
|
||||
timeout_propose_delta = "500ms"
|
||||
# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
|
||||
timeout_prevote = "1s"
|
||||
# How much the timeout_prevote increases with each round
|
||||
timeout_prevote_delta = "500ms"
|
||||
# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
|
||||
timeout_precommit = "1s"
|
||||
# How much the timeout_precommit increases with each round
|
||||
timeout_precommit_delta = "500ms"
|
||||
# How long we wait after committing a block, before starting on the new
|
||||
# height (this gives us a chance to receive some more precommits, even
|
||||
# though we already have +2/3).
|
||||
timeout_commit = "1s"
|
||||
|
||||
# How many blocks to look back to check existence of the node's consensus votes before joining consensus
|
||||
# When non-zero, the node will panic upon restart
|
||||
# if the same consensus key was used to sign {double_sign_check_height} last blocks.
|
||||
# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
|
||||
double_sign_check_height = 0
|
||||
|
||||
# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
|
||||
skip_timeout_commit = false
|
||||
|
||||
# EmptyBlocks mode and possible interval between empty blocks
|
||||
create_empty_blocks = true
|
||||
create_empty_blocks_interval = "0s"
|
||||
|
||||
# Reactor sleep duration parameters
|
||||
peer_gossip_sleep_duration = "100ms"
|
||||
peer_query_maj23_sleep_duration = "2s"
|
||||
|
||||
#######################################################
|
||||
### Transaction Indexer Configuration Options ###
|
||||
#######################################################
|
||||
[tx_index]
|
||||
|
||||
# What indexer to use for transactions
|
||||
#
|
||||
# The application will set which txs to index. In some cases a node operator will be able
|
||||
# to decide which txs to index based on configuration set in the application.
|
||||
#
|
||||
# Options:
|
||||
# 1) "null"
|
||||
# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
|
||||
# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
|
||||
indexer = "kv"
|
||||
|
||||
#######################################################
|
||||
### Instrumentation Configuration Options ###
|
||||
#######################################################
|
||||
[instrumentation]
|
||||
|
||||
# When true, Prometheus metrics are served under /metrics on
|
||||
# PrometheusListenAddr.
|
||||
# Check out the documentation for the list of available metrics.
|
||||
prometheus = false
|
||||
|
||||
# Address to listen for Prometheus collector(s) connections
|
||||
prometheus_listen_addr = ":26660"
|
||||
|
||||
# Maximum number of simultaneous connections.
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
max_open_connections = 3
|
||||
|
||||
# Instrumentation namespace
|
||||
namespace = "tendermint"
|
||||
|
||||
```
|
||||
|
||||
## Empty blocks VS no empty blocks
|
||||
|
||||
### create_empty_blocks = true
|
||||
|
||||
If `create_empty_blocks` is set to `true` in your config, blocks will be
|
||||
created ~ every second (with default consensus parameters). You can regulate
|
||||
the delay between blocks by changing the `timeout_commit`. E.g. `timeout_commit = "10s"` should result in ~ 10 second blocks.
|
||||
|
||||
### create_empty_blocks = false
|
||||
|
||||
In this setting, blocks are created when transactions received.
|
||||
|
||||
Note after the block H, Tendermint creates something we call a "proof block"
|
||||
(only if the application hash changed) H+1. The reason for this is to support
|
||||
proofs. If you have a transaction in block H that changes the state to X, the
|
||||
new application hash will only be included in block H+1. If after your
|
||||
transaction is committed, you want to get a light-client proof for the new state
|
||||
(X), you need the new block to be committed in order to do that because the new
|
||||
block has the new application hash for the state X. That's why we make a new
|
||||
(empty) block if the application hash changes. Otherwise, you won't be able to
|
||||
make a proof for the new state.
|
||||
|
||||
Plus, if you set `create_empty_blocks_interval` to something other than the
|
||||
default (`0`), Tendermint will be creating empty blocks even in the absence of
|
||||
transactions every `create_empty_blocks_interval`. For instance, with
|
||||
`create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`,
|
||||
Tendermint will only create blocks if there are transactions, or after waiting
|
||||
30 seconds without receiving any transactions.
|
||||
|
||||
## Consensus timeouts explained
|
||||
|
||||
There's a variety of information about timeouts in [Running in
|
||||
production](./running-in-production.md)
|
||||
|
||||
You can also find more detailed technical explanation in the spec: [The latest
|
||||
gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
|
||||
|
||||
```toml
|
||||
[consensus]
|
||||
...
|
||||
|
||||
timeout_propose = "3s"
|
||||
timeout_propose_delta = "500ms"
|
||||
timeout_prevote = "1s"
|
||||
timeout_prevote_delta = "500ms"
|
||||
timeout_precommit = "1s"
|
||||
timeout_precommit_delta = "500ms"
|
||||
timeout_commit = "1s"
|
||||
```
|
||||
|
||||
Note that in a successful round, the only timeout that we absolutely wait no
|
||||
matter what is `timeout_commit`.
|
||||
|
||||
Here's a brief summary of the timeouts:
|
||||
|
||||
- `timeout_propose` = how long we wait for a proposal block before prevoting
|
||||
nil
|
||||
- `timeout_propose_delta` = how much timeout_propose increases with each round
|
||||
- `timeout_prevote` = how long we wait after receiving +2/3 prevotes for
|
||||
anything (ie. not a single block or nil)
|
||||
- `timeout_prevote_delta` = how much the timeout_prevote increases with each
|
||||
round
|
||||
- `timeout_precommit` = how long we wait after receiving +2/3 precommits for
|
||||
anything (ie. not a single block or nil)
|
||||
- `timeout_precommit_delta` = how much the timeout_precommit increases with
|
||||
each round
|
||||
- `timeout_commit` = how long we wait after committing a block, before starting
|
||||
on the new height (this gives us a chance to receive some more precommits,
|
||||
even though we already have +2/3)
|
||||
|
||||
## P2P settings
|
||||
|
||||
This section will cover settings within the p2p section of the `config.toml`.
|
||||
|
||||
- `external_address` = is the address that will be advertised for other nodes to use. We recommend setting this field with your public IP and p2p port.
|
||||
- `seeds` = is a list of comma separated seed nodes that you will connect upon a start and ask for peers. A seed node is a node that does not participate in consensus but only helps propagate peers to nodes in the networks
|
||||
- `persistent_peers` = is a list of comma separated peers that you will always want to be connected to. If you're already connected to the maximum number of peers, persistent peers will not be added.
|
||||
- `max_num_inbound_peers` = is the maximum number of peers you will accept inbound connections from at one time (where they dial your address and initiate the connection).
|
||||
- `max_num_outbound_peers` = is the maximum number of peers you will initiate outbound connects to at one time (where you dial their address and initiate the connection).
|
||||
- `unconditional_peer_ids` = is similar to `persistent_peers` except that these peers will be connected to even if you are already connected to the maximum number of peers. This can be a validator node ID on your sentry node.
|
||||
- `pex` = turns the peer exchange reactor on or off. Validator node will want the `pex` turned off so it would not begin gossiping to unknown peers on the network. PeX can also be turned off for statically configured networks with fixed network connectivity. For full nodes on open, dynamic networks, it should be turned on.
|
||||
- `seed_mode` = is used for when node operators want to run their node as a seed node. Seed node's run a variation of the PeX protocol that disconnects from peers after sending them a list of peers to connect to. To minimize the servers usage, it is recommended to set the mempool's size to 0.
|
||||
- `private_peer_ids` = is a comma separated list of node ids that you would not like exposed to other peers (ie. you will not tell other peers about the private_peer_ids). This can be filled with a validators node id.
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
order: 6
|
||||
---
|
||||
|
||||
# Configure a Light Client
|
||||
|
||||
Tendermint comes with a built-in `tendermint light` command, which can be used
|
||||
to run a light client proxy server, verifying Tendermint RPC. All calls that
|
||||
can be tracked back to a block header by a proof will be verified before
|
||||
passing them back to the caller. Other than that, it will present the same
|
||||
interface as a full Tendermint node.
|
||||
|
||||
You can start the light client proxy server by running `tendermint light <chainID>`,
|
||||
with a variety of flags to specify the primary node, the witness nodes (which cross-check
|
||||
the information provided by the primary), the hash and height of the trusted header,
|
||||
and more.
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ tendermint light supernova -p tcp://233.123.0.140:26657 \
|
||||
-w tcp://179.63.29.15:26657,tcp://144.165.223.135:26657 \
|
||||
--height=10 --hash=37E9A6DD3FA25E83B22C18835401E8E56088D0D7ABC6FD99FCDC920DD76C1C57
|
||||
```
|
||||
|
||||
For additional options, run `tendermint light --help`.
|
||||
|
||||
## Where to obtain trusted height & hash
|
||||
|
||||
One way to obtain a semi-trusted hash & height is to query multiple full nodes
|
||||
and compare their hashes:
|
||||
|
||||
```bash
|
||||
$ curl -s https://233.123.0.140:26657:26657/commit | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"
|
||||
{
|
||||
"height": "273",
|
||||
"hash": "188F4F36CBCD2C91B57509BBF231C777E79B52EE3E0D90D06B1A25EB16E6E23D"
|
||||
}
|
||||
```
|
||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
@@ -0,0 +1,60 @@
|
||||
---
|
||||
order: 4
|
||||
---
|
||||
|
||||
# Metrics
|
||||
|
||||
Tendermint can report and serve the Prometheus metrics, which in their turn can
|
||||
be consumed by Prometheus collector(s).
|
||||
|
||||
This functionality is disabled by default.
|
||||
|
||||
To enable the Prometheus metrics, set `instrumentation.prometheus=true` if your
|
||||
config file. Metrics will be served under `/metrics` on 26660 port by default.
|
||||
Listen address can be changed in the config file (see
|
||||
`instrumentation.prometheus\_listen\_addr`).
|
||||
|
||||
## List of available metrics
|
||||
|
||||
The following metrics are available:
|
||||
|
||||
| **Name** | **Type** | **Tags** | **Description** |
|
||||
| -------------------------------------- | --------- | ------------- | ---------------------------------------------------------------------- |
|
||||
| consensus_height | Gauge | | Height of the chain |
|
||||
| consensus_validators | Gauge | | Number of validators |
|
||||
| consensus_validators_power | Gauge | | Total voting power of all validators |
|
||||
| consensus_validator_power | Gauge | | Voting power of the node if in the validator set |
|
||||
| consensus_validator_last_signed_height | Gauge | | Last height the node signed a block, if the node is a validator |
|
||||
| consensus_validator_missed_blocks | Gauge | | Total amount of blocks missed for the node, if the node is a validator |
|
||||
| consensus_missing_validators | Gauge | | Number of validators who did not sign |
|
||||
| consensus_missing_validators_power | Gauge | | Total voting power of the missing validators |
|
||||
| consensus_byzantine_validators | Gauge | | Number of validators who tried to double sign |
|
||||
| consensus_byzantine_validators_power | Gauge | | Total voting power of the byzantine validators |
|
||||
| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds |
|
||||
| consensus_rounds | Gauge | | Number of rounds |
|
||||
| consensus_num_txs | Gauge | | Number of transactions |
|
||||
| consensus_total_txs | Gauge | | Total number of transactions committed |
|
||||
| consensus_block_parts | counter | peer_id | number of blockparts transmitted by peer |
|
||||
| consensus_latest_block_height | gauge | | /status sync_info number |
|
||||
| consensus_fast_syncing | gauge | | either 0 (not fast syncing) or 1 (syncing) |
|
||||
| consensus_state_syncing | gauge | | either 0 (not state syncing) or 1 (syncing) |
|
||||
| consensus_block_size_bytes | Gauge | | Block size in bytes |
|
||||
| p2p_peers | Gauge | | Number of peers node's connected to |
|
||||
| p2p_peer_receive_bytes_total | counter | peer_id, chID | number of bytes per channel received from a given peer |
|
||||
| p2p_peer_send_bytes_total | counter | peer_id, chID | number of bytes per channel sent to a given peer |
|
||||
| p2p_peer_pending_send_bytes | gauge | peer_id | number of pending bytes to be sent to a given peer |
|
||||
| p2p_num_txs | gauge | peer_id | number of transactions submitted by each peer_id |
|
||||
| p2p_pending_send_bytes | gauge | peer_id | amount of data pending to be sent to peer |
|
||||
| mempool_size | Gauge | | Number of uncommitted transactions |
|
||||
| mempool_tx_size_bytes | histogram | | transaction sizes in bytes |
|
||||
| mempool_failed_txs | counter | | number of failed transactions |
|
||||
| mempool_recheck_times | counter | | number of transactions rechecked in the mempool |
|
||||
| state_block_processing_time | histogram | | time between BeginBlock and EndBlock in ms |
|
||||
|
||||
## Useful queries
|
||||
|
||||
Percentage of missing + byzantine validators:
|
||||
|
||||
```md
|
||||
((consensus\_byzantine\_validators\_power + consensus\_missing\_validators\_power) / consensus\_validators\_power) * 100
|
||||
```
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,42 @@
|
||||
---
|
||||
order: 5
|
||||
---
|
||||
|
||||
# Configure State-Sync
|
||||
|
||||
State sync will continuously work in the background to supply nodes with chunked data when bootstrapping.
|
||||
|
||||
> NOTE: Before trying to use state sync, see if the application you are operating a node for supports it.
|
||||
|
||||
Under the state sync section in `config.toml` you will find multiple settings that need to be configured in order for your node to use state sync.
|
||||
|
||||
Lets breakdown the settings:
|
||||
|
||||
- `enable`: Enable is to inform the node that you will be using state sync to bootstrap your node.
|
||||
- `rpc_servers`: RPC servers are needed because state sync utilizes the light client for verification.
|
||||
- 2 servers are required, more is always helpful.
|
||||
- `temp_dir`: Temporary directory is store the chunks in the machines local storage, If nothing is set it will create a directory in `/tmp`
|
||||
|
||||
The next information you will need to acquire it through publicly exposed RPC's or a block explorer which you trust.
|
||||
|
||||
- `trust_height`: Trusted height defines at which height your node should trust the chain.
|
||||
- `trust_hash`: Trusted hash is the hash in the `BlockID` corresponding to the trusted height.
|
||||
- `trust_period`: Trust period is the period in which headers can be verified.
|
||||
> :warning: This value should be significantly smaller than the unbonding period.
|
||||
|
||||
If you are relying on publicly exposed RPC's to get the need information, you can use `curl`.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
curl -s https://233.123.0.140:26657:26657/commit | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"
|
||||
```
|
||||
|
||||
The response will be:
|
||||
|
||||
```json
|
||||
{
|
||||
"height": "273",
|
||||
"hash": "188F4F36CBCD2C91B57509BBF231C777E79B52EE3E0D90D06B1A25EB16E6E23D"
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,114 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# Validators
|
||||
|
||||
Validators are responsible for committing new blocks in the blockchain.
|
||||
These validators participate in the consensus protocol by broadcasting
|
||||
_votes_ which contain cryptographic signatures signed by each
|
||||
validator's private key.
|
||||
|
||||
Some Proof-of-Stake consensus algorithms aim to create a "completely"
|
||||
decentralized system where all stakeholders (even those who are not
|
||||
always available online) participate in the committing of blocks.
|
||||
Tendermint has a different approach to block creation. Validators are
|
||||
expected to be online, and the set of validators is permissioned/curated
|
||||
by some external process. Proof-of-stake is not required, but can be
|
||||
implemented on top of Tendermint consensus. That is, validators may be
|
||||
required to post collateral on-chain, off-chain, or may not be required
|
||||
to post any collateral at all.
|
||||
|
||||
Validators have a cryptographic key-pair and an associated amount of
|
||||
"voting power". Voting power need not be the same.
|
||||
|
||||
## Becoming a Validator
|
||||
|
||||
There are two ways to become validator.
|
||||
|
||||
1. They can be pre-established in the [genesis state](./using-tendermint.md#genesis)
|
||||
2. The ABCI app responds to the EndBlock message with changes to the
|
||||
existing validator set.
|
||||
|
||||
## Setting up a Validator
|
||||
|
||||
When setting up a validator there are countless ways to configure your setup. This guide is aimed at showing one of them, the sentry node design. This design is mainly for DDOS prevention.
|
||||
|
||||
### Network Layout
|
||||
|
||||

|
||||
|
||||
The diagram is based on AWS, other cloud providers will have similar solutions to design a solution. Running nodes is not limited to cloud providers, you can run nodes on bare metal systems as well. The architecture will be the same no matter which setup you decide to go with.
|
||||
|
||||
The proposed network diagram is similar to the classical backend/frontend separation of services in a corporate environment. The “backend” in this case is the private network of the validator in the data center. The data center network might involve multiple subnets, firewalls and redundancy devices, which is not detailed on this diagram. The important point is that the data center allows direct connectivity to the chosen cloud environment. Amazon AWS has “Direct Connect”, while Google Cloud has “Partner Interconnect”. This is a dedicated connection to the cloud provider (usually directly to your virtual private cloud instance in one of the regions).
|
||||
|
||||
All sentry nodes (the “frontend”) connect to the validator using this private connection. The validator does not have a public IP address to provide its services.
|
||||
|
||||
Amazon has multiple availability zones within a region. One can install sentry nodes in other regions too. In this case the second, third and further regions need to have a private connection to the validator node. This can be achieved by VPC Peering (“VPC Network Peering” in Google Cloud). In this case, the second, third and further region sentry nodes will be directed to the first region and through the direct connect to the data center, arriving to the validator.
|
||||
|
||||
A more persistent solution (not detailed on the diagram) is to have multiple direct connections to different regions from the data center. This way VPC Peering is not mandatory, although still beneficial for the sentry nodes. This overcomes the risk of depending on one region. It is more costly.
|
||||
|
||||
### Local Configuration
|
||||
|
||||

|
||||
|
||||
The validator will only talk to the sentry that are provided, the sentry nodes will communicate to the validator via a secret connection and the rest of the network through a normal connection. The sentry nodes do have the option of communicating with each other as well.
|
||||
|
||||
When initializing nodes there are five parameters in the `config.toml` that may need to be altered.
|
||||
|
||||
- `pex:` boolean. This turns the peer exchange reactor on or off for a node. When `pex=false`, only the `persistent_peers` list is available for connection.
|
||||
- `persistent_peers:` a comma separated list of `nodeID@ip:port` values that define a list of peers that are expected to be online at all times. This is necessary at first startup because by setting `pex=false` the node will not be able to join the network.
|
||||
- `unconditional_peer_ids:` comma separated list of nodeID's. These nodes will be connected to no matter the limits of inbound and outbound peers. This is useful for when sentry nodes have full address books.
|
||||
- `private_peer_ids:` comma separated list of nodeID's. These nodes will not be gossiped to the network. This is an important field as you do not want your validator IP gossiped to the network.
|
||||
- `addr_book_strict:` boolean. By default nodes with a routable address will be considered for connection. If this setting is turned off (false), non-routable IP addresses, like addresses in a private network can be added to the address book.
|
||||
- `double_sign_check_height` int64 height. How many blocks to look back to check existence of the node's consensus votes before joining consensus When non-zero, the node will panic upon restart if the same consensus key was used to sign {double_sign_check_height} last blocks. So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
|
||||
|
||||
#### Validator Node Configuration
|
||||
|
||||
| Config Option | Setting |
|
||||
| ------------------------ | -------------------------- |
|
||||
| pex | false |
|
||||
| persistent_peers | list of sentry nodes |
|
||||
| private_peer_ids | none |
|
||||
| unconditional_peer_ids | optionally sentry node IDs |
|
||||
| addr_book_strict | false |
|
||||
| double_sign_check_height | 10 |
|
||||
|
||||
The validator node should have `pex=false` so it does not gossip to the entire network. The persistent peers will be your sentry nodes. Private peers can be left empty as the validator is not trying to hide who it is communicating with. Setting unconditional peers is optional for a validator because they will not have a full address books.
|
||||
|
||||
#### Sentry Node Configuration
|
||||
|
||||
| Config Option | Setting |
|
||||
| ---------------------- | --------------------------------------------- |
|
||||
| pex | true |
|
||||
| persistent_peers | validator node, optionally other sentry nodes |
|
||||
| private_peer_ids | validator node ID |
|
||||
| unconditional_peer_ids | validator node ID, optionally sentry node IDs |
|
||||
| addr_book_strict | false |
|
||||
|
||||
The sentry nodes should be able to talk to the entire network hence why `pex=true`. The persistent peers of a sentry node will be the validator, and optionally other sentry nodes. The sentry nodes should make sure that they do not gossip the validator's ip, to do this you must put the validators nodeID as a private peer. The unconditional peer IDs will be the validator ID and optionally other sentry nodes.
|
||||
|
||||
> Note: Do not forget to secure your node's firewalls when setting them up.
|
||||
|
||||
More Information can be found at these links:
|
||||
|
||||
- <https://kb.certus.one/>
|
||||
- <https://forum.cosmos.network/t/sentry-node-architecture-overview/454>
|
||||
|
||||
### Validator keys
|
||||
|
||||
Protecting a validator's consensus key is the most important factor to take in when designing your setup. The key that a validator is given upon creation of the node is called a consensus key, it has to be online at all times in order to vote on blocks. It is **not recommended** to merely hold your private key in the default json file (`priv_validator_key.json`). Fortunately, the [Interchain Foundation](https://interchain.io/) has worked with a team to build a key management server for validators. You can find documentation on how to use it [here](https://github.com/iqlusioninc/tmkms), it is used extensively in production. You are not limited to using this tool, there are also [HSMs](https://safenet.gemalto.com/data-encryption/hardware-security-modules-hsms/), there is not a recommended HSM.
|
||||
|
||||
Currently Tendermint uses [Ed25519](https://ed25519.cr.yp.to/) keys which are widely supported across the security sector and HSMs.
|
||||
|
||||
## Committing a Block
|
||||
|
||||
> **+2/3 is short for "more than 2/3"**
|
||||
|
||||
A block is committed when +2/3 of the validator set sign [precommit
|
||||
votes](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#vote) for that block at the same `round`.
|
||||
The +2/3 set of precommit votes is called a
|
||||
[_commit_](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#commit). While any +2/3 set of
|
||||
precommits for the same block at the same height&round can serve as
|
||||
validation, the canonical commit is included in the next block (see
|
||||
[LastCommit](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#lastcommit)).
|
||||
Generated
+14059
-678
File diff suppressed because it is too large
Load Diff
@@ -7,13 +7,10 @@ parent:
|
||||
|
||||
# Overview
|
||||
|
||||
This section dives into the internals of Tendermint the implementation.
|
||||
This section dives into the internals of Go-Tendermint.
|
||||
|
||||
- [Using Tendermint](./using-tendermint.md)
|
||||
- [Configuration](./configuration.md)
|
||||
- [Running in Production](./running-in-production.md)
|
||||
- [Metrics](./metrics.md)
|
||||
- [Validators](./validators.md)
|
||||
- [Subscribing to events](./subscription.md)
|
||||
- [Block Structure](./block-structure.md)
|
||||
- [RPC](./rpc.md)
|
||||
|
||||
@@ -1,492 +1,7 @@
|
||||
---
|
||||
order: 3
|
||||
order: false
|
||||
---
|
||||
|
||||
# Configuration
|
||||
|
||||
Tendermint Core can be configured via a TOML file in
|
||||
`$TMHOME/config/config.toml`. Some of these parameters can be overridden by
|
||||
command-line flags. For most users, the options in the `##### main base configuration options #####` are intended to be modified while config options
|
||||
further below are intended for advance power users.
|
||||
|
||||
## Options
|
||||
|
||||
The default configuration file create by `tendermint init` has all
|
||||
the parameters set with their default values. It will look something
|
||||
like the file below, however, double check by inspecting the
|
||||
`config.toml` created with your version of `tendermint` installed:
|
||||
|
||||
```toml
|
||||
# This is a TOML config file.
|
||||
# For more information, see https://github.com/toml-lang/toml
|
||||
|
||||
# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or
|
||||
# relative to the home directory (e.g. "data"). The home directory is
|
||||
# "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable
|
||||
# or --home cmd flag.
|
||||
|
||||
#######################################################################
|
||||
### Main Base Config Options ###
|
||||
#######################################################################
|
||||
|
||||
# TCP or UNIX socket address of the ABCI application,
|
||||
# or the name of an ABCI application compiled in with the Tendermint binary
|
||||
proxy_app = "tcp://127.0.0.1:26658"
|
||||
|
||||
# A custom human readable name for this node
|
||||
moniker = "anonymous"
|
||||
|
||||
# If this node is many blocks behind the tip of the chain, FastSync
|
||||
# allows them to catchup quickly by downloading blocks in parallel
|
||||
# and verifying their commits
|
||||
fast_sync = true
|
||||
|
||||
# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb
|
||||
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
|
||||
# - pure go
|
||||
# - stable
|
||||
# * cleveldb (uses levigo wrapper)
|
||||
# - fast
|
||||
# - requires gcc
|
||||
# - use cleveldb build tag (go build -tags cleveldb)
|
||||
# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
|
||||
# - EXPERIMENTAL
|
||||
# - may be faster is some use-cases (random reads - indexer)
|
||||
# - use boltdb build tag (go build -tags boltdb)
|
||||
# * rocksdb (uses github.com/tecbot/gorocksdb)
|
||||
# - EXPERIMENTAL
|
||||
# - requires gcc
|
||||
# - use rocksdb build tag (go build -tags rocksdb)
|
||||
# * badgerdb (uses github.com/dgraph-io/badger)
|
||||
# - EXPERIMENTAL
|
||||
# - use badgerdb build tag (go build -tags badgerdb)
|
||||
db_backend = "goleveldb"
|
||||
|
||||
# Database directory
|
||||
db_dir = "data"
|
||||
|
||||
# Output level for logging, including package level options
|
||||
log_level = "main:info,state:info,statesync:info,*:error"
|
||||
|
||||
# Output format: 'plain' (colored text) or 'json'
|
||||
log_format = "plain"
|
||||
|
||||
##### additional base config options #####
|
||||
|
||||
# Path to the JSON file containing the initial validator set and other meta data
|
||||
genesis_file = "config/genesis.json"
|
||||
|
||||
# Path to the JSON file containing the private key to use as a validator in the consensus protocol
|
||||
priv_validator_key_file = "config/priv_validator_key.json"
|
||||
|
||||
# Path to the JSON file containing the last sign state of a validator
|
||||
priv_validator_state_file = "data/priv_validator_state.json"
|
||||
|
||||
# TCP or UNIX socket address for Tendermint to listen on for
|
||||
# connections from an external PrivValidator process
|
||||
priv_validator_laddr = ""
|
||||
|
||||
# Path to the JSON file containing the private key to use for node authentication in the p2p protocol
|
||||
node_key_file = "config/node_key.json"
|
||||
|
||||
# Mechanism to connect to the ABCI application: socket | grpc
|
||||
abci = "socket"
|
||||
|
||||
# If true, query the ABCI app on connecting to a new peer
|
||||
# so the app can decide if we should keep the connection or not
|
||||
filter_peers = false
|
||||
|
||||
|
||||
#######################################################################
|
||||
### Advanced Configuration Options ###
|
||||
#######################################################################
|
||||
|
||||
#######################################################
|
||||
### RPC Server Configuration Options ###
|
||||
#######################################################
|
||||
[rpc]
|
||||
|
||||
# TCP or UNIX socket address for the RPC server to listen on
|
||||
laddr = "tcp://127.0.0.1:26657"
|
||||
|
||||
# A list of origins a cross-domain request can be executed from
|
||||
# Default value '[]' disables cors support
|
||||
# Use '["*"]' to allow any origin
|
||||
cors_allowed_origins = []
|
||||
|
||||
# A list of methods the client is allowed to use with cross-domain requests
|
||||
cors_allowed_methods = ["HEAD", "GET", "POST", ]
|
||||
|
||||
# A list of non simple headers the client is allowed to use with cross-domain requests
|
||||
cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ]
|
||||
|
||||
# TCP or UNIX socket address for the gRPC server to listen on
|
||||
# NOTE: This server only supports /broadcast_tx_commit
|
||||
grpc_laddr = ""
|
||||
|
||||
# Maximum number of simultaneous connections.
|
||||
# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
|
||||
# 1024 - 40 - 10 - 50 = 924 = ~900
|
||||
grpc_max_open_connections = 900
|
||||
|
||||
# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
|
||||
unsafe = false
|
||||
|
||||
# Maximum number of simultaneous connections (including WebSocket).
|
||||
# Does not include gRPC connections. See grpc_max_open_connections
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
|
||||
# 1024 - 40 - 10 - 50 = 924 = ~900
|
||||
max_open_connections = 900
|
||||
|
||||
# Maximum number of unique clientIDs that can /subscribe
|
||||
# If you're using /broadcast_tx_commit, set to the estimated maximum number
|
||||
# of broadcast_tx_commit calls per block.
|
||||
max_subscription_clients = 100
|
||||
|
||||
# Maximum number of unique queries a given client can /subscribe to
|
||||
# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
|
||||
# the estimated # maximum number of broadcast_tx_commit calls per block.
|
||||
max_subscriptions_per_client = 5
|
||||
|
||||
# How long to wait for a tx to be committed during /broadcast_tx_commit.
|
||||
# WARNING: Using a value larger than 10s will result in increasing the
|
||||
# global HTTP write timeout, which applies to all connections and endpoints.
|
||||
# See https://github.com/tendermint/tendermint/issues/3435
|
||||
timeout_broadcast_tx_commit = "10s"
|
||||
|
||||
# Maximum size of request body, in bytes
|
||||
max_body_bytes = 1000000
|
||||
|
||||
# Maximum size of request header, in bytes
|
||||
max_header_bytes = 1048576
|
||||
|
||||
# The path to a file containing certificate that is used to create the HTTPS server.
|
||||
# Migth be either absolute path or path related to tendermint's config directory.
|
||||
# If the certificate is signed by a certificate authority,
|
||||
# the certFile should be the concatenation of the server's certificate, any intermediates,
|
||||
# and the CA's certificate.
|
||||
# NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
|
||||
# Otherwise, HTTP server is run.
|
||||
tls_cert_file = ""
|
||||
|
||||
# The path to a file containing matching private key that is used to create the HTTPS server.
|
||||
# Migth be either absolute path or path related to tendermint's config directory.
|
||||
# NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
|
||||
# Otherwise, HTTP server is run.
|
||||
tls_key_file = ""
|
||||
|
||||
# pprof listen address (https://golang.org/pkg/net/http/pprof)
|
||||
pprof_laddr = ""
|
||||
|
||||
#######################################################
|
||||
### P2P Configuration Options ###
|
||||
#######################################################
|
||||
[p2p]
|
||||
|
||||
# Address to listen for incoming connections
|
||||
laddr = "tcp://0.0.0.0:26656"
|
||||
|
||||
# Address to advertise to peers for them to dial
|
||||
# If empty, will use the same port as the laddr,
|
||||
# and will introspect on the listener or use UPnP
|
||||
# to figure out the address.
|
||||
external_address = ""
|
||||
|
||||
# Comma separated list of seed nodes to connect to
|
||||
seeds = ""
|
||||
|
||||
# Comma separated list of nodes to keep persistent connections to
|
||||
persistent_peers = ""
|
||||
|
||||
# UPNP port forwarding
|
||||
upnp = false
|
||||
|
||||
# Path to address book
|
||||
addr_book_file = "config/addrbook.json"
|
||||
|
||||
# Set true for strict address routability rules
|
||||
# Set false for private or local networks
|
||||
addr_book_strict = true
|
||||
|
||||
# Maximum number of inbound peers
|
||||
max_num_inbound_peers = 40
|
||||
|
||||
# Maximum number of outbound peers to connect to, excluding persistent peers
|
||||
max_num_outbound_peers = 10
|
||||
|
||||
# List of node IDs, to which a connection will be (re)established ignoring any existing limits
|
||||
unconditional_peer_ids = ""
|
||||
|
||||
# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
|
||||
persistent_peers_max_dial_period = "0s"
|
||||
|
||||
# Time to wait before flushing messages out on the connection
|
||||
flush_throttle_timeout = "100ms"
|
||||
|
||||
# Maximum size of a message packet payload, in bytes
|
||||
max_packet_msg_payload_size = 1024
|
||||
|
||||
# Rate at which packets can be sent, in bytes/second
|
||||
send_rate = 5120000
|
||||
|
||||
# Rate at which packets can be received, in bytes/second
|
||||
recv_rate = 5120000
|
||||
|
||||
# Set true to enable the peer-exchange reactor
|
||||
pex = true
|
||||
|
||||
# Seed mode, in which node constantly crawls the network and looks for
|
||||
# peers. If another node asks it for addresses, it responds and disconnects.
|
||||
#
|
||||
# Does not work if the peer-exchange reactor is disabled.
|
||||
seed_mode = false
|
||||
|
||||
# Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
|
||||
private_peer_ids = ""
|
||||
|
||||
# Toggle to disable guard against peers connecting from the same ip.
|
||||
allow_duplicate_ip = false
|
||||
|
||||
# Peer connection configuration.
|
||||
handshake_timeout = "20s"
|
||||
dial_timeout = "3s"
|
||||
|
||||
#######################################################
|
||||
### Mempool Configurattion Option ###
|
||||
#######################################################
|
||||
[mempool]
|
||||
|
||||
recheck = true
|
||||
broadcast = true
|
||||
wal_dir = ""
|
||||
|
||||
# Maximum number of transactions in the mempool
|
||||
size = 5000
|
||||
|
||||
# Limit the total size of all txs in the mempool.
|
||||
# This only accounts for raw transactions (e.g. given 1MB transactions and
|
||||
# max_txs_bytes=5MB, mempool will only accept 5 transactions).
|
||||
max_txs_bytes = 1073741824
|
||||
|
||||
# Size of the cache (used to filter transactions we saw earlier) in transactions
|
||||
cache_size = 10000
|
||||
|
||||
# Maximum size of a single transaction.
|
||||
# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}.
|
||||
max_tx_bytes = 1048576
|
||||
|
||||
# Maximum size of a batch of transactions to send to a peer
|
||||
# Including space needed by encoding (one varint per transaction).
|
||||
max_batch_bytes = 10485760
|
||||
|
||||
#######################################################
|
||||
### State Sync Configuration Options ###
|
||||
#######################################################
|
||||
[statesync]
|
||||
# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
|
||||
# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
|
||||
# the network to take and serve state machine snapshots. State sync is not attempted if the node
|
||||
# has any local state (LastBlockHeight > 0). The node will have a truncated block history,
|
||||
# starting from the height of the snapshot.
|
||||
enable = false
|
||||
|
||||
# RPC servers (comma-separated) for light client verification of the synced state machine and
|
||||
# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
|
||||
# header hash obtained from a trusted source, and a period during which validators can be trusted.
|
||||
#
|
||||
# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2
|
||||
# weeks) during which they can be financially punished (slashed) for misbehavior.
|
||||
rpc_servers = ""
|
||||
trust_height = 0
|
||||
trust_hash = ""
|
||||
trust_period = "168h0m0s"
|
||||
|
||||
# Time to spend discovering snapshots before initiating a restore.
|
||||
discovery_time = "15s"
|
||||
|
||||
# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp).
|
||||
# Will create a new, randomly named directory within, and remove it when done.
|
||||
temp_dir = ""
|
||||
|
||||
#######################################################
|
||||
### Fast Sync Configuration Connections ###
|
||||
#######################################################
|
||||
[fastsync]
|
||||
|
||||
# Fast Sync version to use:
|
||||
# 1) "v0" (default) - the legacy fast sync implementation
|
||||
# 2) "v1" - refactor of v0 version for better testability
|
||||
# 2) "v2" - complete redesign of v0, optimized for testability & readability
|
||||
version = "v0"
|
||||
|
||||
#######################################################
|
||||
### Consensus Configuration Options ###
|
||||
#######################################################
|
||||
[consensus]
|
||||
|
||||
wal_file = "data/cs.wal/wal"
|
||||
|
||||
# How long we wait for a proposal block before prevoting nil
|
||||
timeout_propose = "3s"
|
||||
# How much timeout_propose increases with each round
|
||||
timeout_propose_delta = "500ms"
|
||||
# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
|
||||
timeout_prevote = "1s"
|
||||
# How much the timeout_prevote increases with each round
|
||||
timeout_prevote_delta = "500ms"
|
||||
# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
|
||||
timeout_precommit = "1s"
|
||||
# How much the timeout_precommit increases with each round
|
||||
timeout_precommit_delta = "500ms"
|
||||
# How long we wait after committing a block, before starting on the new
|
||||
# height (this gives us a chance to receive some more precommits, even
|
||||
# though we already have +2/3).
|
||||
timeout_commit = "1s"
|
||||
|
||||
# How many blocks to look back to check existence of the node's consensus votes before joining consensus
|
||||
# When non-zero, the node will panic upon restart
|
||||
# if the same consensus key was used to sign {double_sign_check_height} last blocks.
|
||||
# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
|
||||
double_sign_check_height = 0
|
||||
|
||||
# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
|
||||
skip_timeout_commit = false
|
||||
|
||||
# EmptyBlocks mode and possible interval between empty blocks
|
||||
create_empty_blocks = true
|
||||
create_empty_blocks_interval = "0s"
|
||||
|
||||
# Reactor sleep duration parameters
|
||||
peer_gossip_sleep_duration = "100ms"
|
||||
peer_query_maj23_sleep_duration = "2s"
|
||||
|
||||
#######################################################
|
||||
### Transaction Indexer Configuration Options ###
|
||||
#######################################################
|
||||
[tx_index]
|
||||
|
||||
# What indexer to use for transactions
|
||||
#
|
||||
# The application will set which txs to index. In some cases a node operator will be able
|
||||
# to decide which txs to index based on configuration set in the application.
|
||||
#
|
||||
# Options:
|
||||
# 1) "null"
|
||||
# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
|
||||
# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
|
||||
indexer = "kv"
|
||||
|
||||
#######################################################
|
||||
### Instrumentation Configuration Options ###
|
||||
#######################################################
|
||||
[instrumentation]
|
||||
|
||||
# When true, Prometheus metrics are served under /metrics on
|
||||
# PrometheusListenAddr.
|
||||
# Check out the documentation for the list of available metrics.
|
||||
prometheus = false
|
||||
|
||||
# Address to listen for Prometheus collector(s) connections
|
||||
prometheus_listen_addr = ":26660"
|
||||
|
||||
# Maximum number of simultaneous connections.
|
||||
# If you want to accept a larger number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
max_open_connections = 3
|
||||
|
||||
# Instrumentation namespace
|
||||
namespace = "tendermint"
|
||||
|
||||
```
|
||||
|
||||
## Empty blocks VS no empty blocks
|
||||
|
||||
### create_empty_blocks = true
|
||||
|
||||
If `create_empty_blocks` is set to `true` in your config, blocks will be
|
||||
created ~ every second (with default consensus parameters). You can regulate
|
||||
the delay between blocks by changing the `timeout_commit`. E.g. `timeout_commit = "10s"` should result in ~ 10 second blocks.
|
||||
|
||||
### create_empty_blocks = false
|
||||
|
||||
In this setting, blocks are created when transactions received.
|
||||
|
||||
Note after the block H, Tendermint creates something we call a "proof block"
|
||||
(only if the application hash changed) H+1. The reason for this is to support
|
||||
proofs. If you have a transaction in block H that changes the state to X, the
|
||||
new application hash will only be included in block H+1. If after your
|
||||
transaction is committed, you want to get a light-client proof for the new state
|
||||
(X), you need the new block to be committed in order to do that because the new
|
||||
block has the new application hash for the state X. That's why we make a new
|
||||
(empty) block if the application hash changes. Otherwise, you won't be able to
|
||||
make a proof for the new state.
|
||||
|
||||
Plus, if you set `create_empty_blocks_interval` to something other than the
|
||||
default (`0`), Tendermint will be creating empty blocks even in the absence of
|
||||
transactions every `create_empty_blocks_interval`. For instance, with
|
||||
`create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`,
|
||||
Tendermint will only create blocks if there are transactions, or after waiting
|
||||
30 seconds without receiving any transactions.
|
||||
|
||||
## Consensus timeouts explained
|
||||
|
||||
There's a variety of information about timeouts in [Running in
|
||||
production](./running-in-production.md)
|
||||
|
||||
You can also find more detailed technical explanation in the spec: [The latest
|
||||
gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
|
||||
|
||||
```toml
|
||||
[consensus]
|
||||
...
|
||||
|
||||
timeout_propose = "3s"
|
||||
timeout_propose_delta = "500ms"
|
||||
timeout_prevote = "1s"
|
||||
timeout_prevote_delta = "500ms"
|
||||
timeout_precommit = "1s"
|
||||
timeout_precommit_delta = "500ms"
|
||||
timeout_commit = "1s"
|
||||
```
|
||||
|
||||
Note that in a successful round, the only timeout that we absolutely wait no
|
||||
matter what is `timeout_commit`.
|
||||
|
||||
Here's a brief summary of the timeouts:
|
||||
|
||||
- `timeout_propose` = how long we wait for a proposal block before prevoting
|
||||
nil
|
||||
- `timeout_propose_delta` = how much timeout_propose increases with each round
|
||||
- `timeout_prevote` = how long we wait after receiving +2/3 prevotes for
|
||||
anything (ie. not a single block or nil)
|
||||
- `timeout_prevote_delta` = how much the timeout_prevote increases with each
|
||||
round
|
||||
- `timeout_precommit` = how long we wait after receiving +2/3 precommits for
|
||||
anything (ie. not a single block or nil)
|
||||
- `timeout_precommit_delta` = how much the timeout_precommit increases with
|
||||
each round
|
||||
- `timeout_commit` = how long we wait after committing a block, before starting
|
||||
on the new height (this gives us a chance to receive some more precommits,
|
||||
even though we already have +2/3)
|
||||
|
||||
## P2P settings
|
||||
|
||||
This section will cover settings within the p2p section of the `config.toml`.
|
||||
|
||||
- `external_address` = is the address that will be advertised for other nodes to use. We recommend setting this field with your public IP and p2p port.
|
||||
- `seeds` = is a list of comma separated seed nodes that you will connect upon a start and ask for peers. A seed node is a node that does not participate in consensus but only helps propagate peers to nodes in the networks
|
||||
- `persistent_peers` = is a list of comma separated peers that you will always want to be connected to. If you're already connected to the maximum number of peers, persistent peers will not be added.
|
||||
- `max_num_inbound_peers` = is the maximum number of peers you will accept inbound connections from at one time (where they dial your address and initiate the connection).
|
||||
- `max_num_outbound_peers` = is the maximum number of peers you will initiate outbound connects to at one time (where you dial their address and initiate the connection).
|
||||
- `unconditional_peer_ids` = is similar to `persistent_peers` except that these peers will be connected to even if you are already connected to the maximum number of peers. This can be a validator node ID on your sentry node.
|
||||
- `pex` = turns the peer exchange reactor on or off. Validator node will want the `pex` turned off so it would not begin gossiping to unknown peers on the network. PeX can also be turned off for statically configured networks with fixed network connectivity. For full nodes on open, dynamic networks, it should be turned on.
|
||||
- `seed_mode` = is used for when node operators want to run their node as a seed node. Seed node's run a variation of the PeX protocol that disconnects from peers after sending them a list of peers to connect to. To minimize the servers usage, it is recommended to set the mempool's size to 0.
|
||||
- `private_peer_ids` = is a comma separated list of node ids that you would not like exposed to other peers (ie. you will not tell other peers about the private_peer_ids). This can be filled with a validators node id.
|
||||
This file has moved to the [node_operators section](../node_operators/configuration.md).
|
||||
|
||||
@@ -51,38 +51,4 @@ and return an error.
|
||||
In summary, the light client is not safe when a) more than the trust level of
|
||||
validators are malicious and b) all witnesses are malicious.
|
||||
|
||||
## Where to obtain trusted height & hash
|
||||
|
||||
One way to obtain a semi-trusted hash & height is to query multiple full nodes
|
||||
and compare their hashes:
|
||||
|
||||
```bash
|
||||
$ curl -s https://233.123.0.140:26657:26657/commit | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"
|
||||
{
|
||||
"height": "273",
|
||||
"hash": "188F4F36CBCD2C91B57509BBF231C777E79B52EE3E0D90D06B1A25EB16E6E23D"
|
||||
}
|
||||
```
|
||||
|
||||
## Running a light client as an HTTP proxy server
|
||||
|
||||
Tendermint comes with a built-in `tendermint light` command, which can be used
|
||||
to run a light client proxy server, verifying Tendermint RPC. All calls that
|
||||
can be tracked back to a block header by a proof will be verified before
|
||||
passing them back to the caller. Other than that, it will present the same
|
||||
interface as a full Tendermint node.
|
||||
|
||||
You can start the light client proxy server by running `tendermint light <chainID>`,
|
||||
with a variety of flags to specify the primary node, the witness nodes (which cross-check
|
||||
the information provided by the primary), the hash and height of the trusted header,
|
||||
and more.
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ tendermint light supernova -p tcp://233.123.0.140:26657 \
|
||||
-w tcp://179.63.29.15:26657,tcp://144.165.223.135:26657 \
|
||||
--height=10 --hash=37E9A6DD3FA25E83B22C18835401E8E56088D0D7ABC6FD99FCDC920DD76C1C57
|
||||
```
|
||||
|
||||
For additional options, run `tendermint light --help`.
|
||||
Information on how to run a light client is located in the [nodes section](../nodes/light-client.md).
|
||||
|
||||
@@ -1,60 +1,7 @@
|
||||
---
|
||||
order: 5
|
||||
order: false
|
||||
---
|
||||
|
||||
# Metrics
|
||||
|
||||
Tendermint can report and serve the Prometheus metrics, which in their turn can
|
||||
be consumed by Prometheus collector(s).
|
||||
|
||||
This functionality is disabled by default.
|
||||
|
||||
To enable the Prometheus metrics, set `instrumentation.prometheus=true` if your
|
||||
config file. Metrics will be served under `/metrics` on 26660 port by default.
|
||||
Listen address can be changed in the config file (see
|
||||
`instrumentation.prometheus\_listen\_addr`).
|
||||
|
||||
## List of available metrics
|
||||
|
||||
The following metrics are available:
|
||||
|
||||
| **Name** | **Type** | **Tags** | **Description** |
|
||||
| -------------------------------------- | --------- | ------------- | ---------------------------------------------------------------------- |
|
||||
| consensus_height | Gauge | | Height of the chain |
|
||||
| consensus_validators | Gauge | | Number of validators |
|
||||
| consensus_validators_power | Gauge | | Total voting power of all validators |
|
||||
| consensus_validator_power | Gauge | | Voting power of the node if in the validator set |
|
||||
| consensus_validator_last_signed_height | Gauge | | Last height the node signed a block, if the node is a validator |
|
||||
| consensus_validator_missed_blocks | Gauge | | Total amount of blocks missed for the node, if the node is a validator |
|
||||
| consensus_missing_validators | Gauge | | Number of validators who did not sign |
|
||||
| consensus_missing_validators_power | Gauge | | Total voting power of the missing validators |
|
||||
| consensus_byzantine_validators | Gauge | | Number of validators who tried to double sign |
|
||||
| consensus_byzantine_validators_power | Gauge | | Total voting power of the byzantine validators |
|
||||
| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds |
|
||||
| consensus_rounds | Gauge | | Number of rounds |
|
||||
| consensus_num_txs | Gauge | | Number of transactions |
|
||||
| consensus_total_txs | Gauge | | Total number of transactions committed |
|
||||
| consensus_block_parts | counter | peer_id | number of blockparts transmitted by peer |
|
||||
| consensus_latest_block_height | gauge | | /status sync_info number |
|
||||
| consensus_fast_syncing | gauge | | either 0 (not fast syncing) or 1 (syncing) |
|
||||
| consensus_state_syncing | gauge | | either 0 (not state syncing) or 1 (syncing) |
|
||||
| consensus_block_size_bytes | Gauge | | Block size in bytes |
|
||||
| p2p_peers | Gauge | | Number of peers node's connected to |
|
||||
| p2p_peer_receive_bytes_total | counter | peer_id, chID | number of bytes per channel received from a given peer |
|
||||
| p2p_peer_send_bytes_total | counter | peer_id, chID | number of bytes per channel sent to a given peer |
|
||||
| p2p_peer_pending_send_bytes | gauge | peer_id | number of pending bytes to be sent to a given peer |
|
||||
| p2p_num_txs | gauge | peer_id | number of transactions submitted by each peer_id |
|
||||
| p2p_pending_send_bytes | gauge | peer_id | amount of data pending to be sent to peer |
|
||||
| mempool_size | Gauge | | Number of uncommitted transactions |
|
||||
| mempool_tx_size_bytes | histogram | | transaction sizes in bytes |
|
||||
| mempool_failed_txs | counter | | number of failed transactions |
|
||||
| mempool_recheck_times | counter | | number of transactions rechecked in the mempool |
|
||||
| state_block_processing_time | histogram | | time between BeginBlock and EndBlock in ms |
|
||||
|
||||
## Useful queries
|
||||
|
||||
Percentage of missing + byzantine validators:
|
||||
|
||||
```md
|
||||
((consensus\_byzantine\_validators\_power + consensus\_missing\_validators\_power) / consensus\_validators\_power) * 100
|
||||
```
|
||||
This file has moved to the [node_operators section](../node_operators/metrics.md).
|
||||
|
||||
@@ -8,41 +8,4 @@ With fast sync a node is downloading all of the data of an application from gene
|
||||
With state sync your node will download data related to the head or near the head of the chain and verify the data.
|
||||
This leads to drastically shorter times for joining a network.
|
||||
|
||||
## Using State Sync
|
||||
|
||||
State sync will continuously work in the background to supply nodes with chunked data when bootstrapping.
|
||||
|
||||
> NOTE: Before trying to use state sync, see if the application you are operating a node for supports it.
|
||||
|
||||
Under the state sync section in `config.toml` you will find multiple settings that need to be configured in order for your node to use state sync.
|
||||
|
||||
Lets breakdown the settings:
|
||||
|
||||
- `enable`: Enable is to inform the node that you will be using state sync to bootstrap your node.
|
||||
- `rpc_servers`: RPC servers are needed because state sync utilizes the light client for verification.
|
||||
- 2 servers are required, more is always helpful.
|
||||
- `temp_dir`: Temporary directory is store the chunks in the machines local storage, If nothing is set it will create a directory in `/tmp`
|
||||
|
||||
The next information you will need to acquire it through publicly exposed RPC's or a block explorer which you trust.
|
||||
|
||||
- `trust_height`: Trusted height defines at which height your node should trust the chain.
|
||||
- `trust_hash`: Trusted hash is the hash in the `BlockID` corresponding to the trusted height.
|
||||
- `trust_period`: Trust period is the period in which headers can be verified.
|
||||
> :warning: This value should be significantly smaller than the unbonding period.
|
||||
|
||||
If you are relying on publicly exposed RPC's to get the need information, you can use `curl`.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
curl -s https://233.123.0.140:26657:26657/commit | jq "{height: .result.signed_header.header.height, hash: .result.signed_header.commit.block_id.hash}"
|
||||
```
|
||||
|
||||
The response will be:
|
||||
|
||||
```json
|
||||
{
|
||||
"height": "273",
|
||||
"hash": "188F4F36CBCD2C91B57509BBF231C777E79B52EE3E0D90D06B1A25EB16E6E23D"
|
||||
}
|
||||
```
|
||||
Information on how to configure state sync is located in the [nodes section](../nodes/state-sync.md)
|
||||
|
||||
@@ -1,114 +1,7 @@
|
||||
---
|
||||
order: 6
|
||||
order: false
|
||||
---
|
||||
|
||||
# Validators
|
||||
|
||||
Validators are responsible for committing new blocks in the blockchain.
|
||||
These validators participate in the consensus protocol by broadcasting
|
||||
_votes_ which contain cryptographic signatures signed by each
|
||||
validator's private key.
|
||||
|
||||
Some Proof-of-Stake consensus algorithms aim to create a "completely"
|
||||
decentralized system where all stakeholders (even those who are not
|
||||
always available online) participate in the committing of blocks.
|
||||
Tendermint has a different approach to block creation. Validators are
|
||||
expected to be online, and the set of validators is permissioned/curated
|
||||
by some external process. Proof-of-stake is not required, but can be
|
||||
implemented on top of Tendermint consensus. That is, validators may be
|
||||
required to post collateral on-chain, off-chain, or may not be required
|
||||
to post any collateral at all.
|
||||
|
||||
Validators have a cryptographic key-pair and an associated amount of
|
||||
"voting power". Voting power need not be the same.
|
||||
|
||||
## Becoming a Validator
|
||||
|
||||
There are two ways to become validator.
|
||||
|
||||
1. They can be pre-established in the [genesis state](./using-tendermint.md#genesis)
|
||||
2. The ABCI app responds to the EndBlock message with changes to the
|
||||
existing validator set.
|
||||
|
||||
## Setting up a Validator
|
||||
|
||||
When setting up a validator there are countless ways to configure your setup. This guide is aimed at showing one of them, the sentry node design. This design is mainly for DDOS prevention.
|
||||
|
||||
### Network Layout
|
||||
|
||||

|
||||
|
||||
The diagram is based on AWS, other cloud providers will have similar solutions to design a solution. Running nodes is not limited to cloud providers, you can run nodes on bare metal systems as well. The architecture will be the same no matter which setup you decide to go with.
|
||||
|
||||
The proposed network diagram is similar to the classical backend/frontend separation of services in a corporate environment. The “backend” in this case is the private network of the validator in the data center. The data center network might involve multiple subnets, firewalls and redundancy devices, which is not detailed on this diagram. The important point is that the data center allows direct connectivity to the chosen cloud environment. Amazon AWS has “Direct Connect”, while Google Cloud has “Partner Interconnect”. This is a dedicated connection to the cloud provider (usually directly to your virtual private cloud instance in one of the regions).
|
||||
|
||||
All sentry nodes (the “frontend”) connect to the validator using this private connection. The validator does not have a public IP address to provide its services.
|
||||
|
||||
Amazon has multiple availability zones within a region. One can install sentry nodes in other regions too. In this case the second, third and further regions need to have a private connection to the validator node. This can be achieved by VPC Peering (“VPC Network Peering” in Google Cloud). In this case, the second, third and further region sentry nodes will be directed to the first region and through the direct connect to the data center, arriving to the validator.
|
||||
|
||||
A more persistent solution (not detailed on the diagram) is to have multiple direct connections to different regions from the data center. This way VPC Peering is not mandatory, although still beneficial for the sentry nodes. This overcomes the risk of depending on one region. It is more costly.
|
||||
|
||||
### Local Configuration
|
||||
|
||||

|
||||
|
||||
The validator will only talk to the sentry that are provided, the sentry nodes will communicate to the validator via a secret connection and the rest of the network through a normal connection. The sentry nodes do have the option of communicating with each other as well.
|
||||
|
||||
When initializing nodes there are five parameters in the `config.toml` that may need to be altered.
|
||||
|
||||
- `pex:` boolean. This turns the peer exchange reactor on or off for a node. When `pex=false`, only the `persistent_peers` list is available for connection.
|
||||
- `persistent_peers:` a comma separated list of `nodeID@ip:port` values that define a list of peers that are expected to be online at all times. This is necessary at first startup because by setting `pex=false` the node will not be able to join the network.
|
||||
- `unconditional_peer_ids:` comma separated list of nodeID's. These nodes will be connected to no matter the limits of inbound and outbound peers. This is useful for when sentry nodes have full address books.
|
||||
- `private_peer_ids:` comma separated list of nodeID's. These nodes will not be gossiped to the network. This is an important field as you do not want your validator IP gossiped to the network.
|
||||
- `addr_book_strict:` boolean. By default nodes with a routable address will be considered for connection. If this setting is turned off (false), non-routable IP addresses, like addresses in a private network can be added to the address book.
|
||||
- `double_sign_check_height` int64 height. How many blocks to look back to check existence of the node's consensus votes before joining consensus When non-zero, the node will panic upon restart if the same consensus key was used to sign {double_sign_check_height} last blocks. So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
|
||||
|
||||
#### Validator Node Configuration
|
||||
|
||||
| Config Option | Setting |
|
||||
| ------------------------ | -------------------------- |
|
||||
| pex | false |
|
||||
| persistent_peers | list of sentry nodes |
|
||||
| private_peer_ids | none |
|
||||
| unconditional_peer_ids | optionally sentry node IDs |
|
||||
| addr_book_strict | false |
|
||||
| double_sign_check_height | 10 |
|
||||
|
||||
The validator node should have `pex=false` so it does not gossip to the entire network. The persistent peers will be your sentry nodes. Private peers can be left empty as the validator is not trying to hide who it is communicating with. Setting unconditional peers is optional for a validator because they will not have a full address books.
|
||||
|
||||
#### Sentry Node Configuration
|
||||
|
||||
| Config Option | Setting |
|
||||
| ---------------------- | --------------------------------------------- |
|
||||
| pex | true |
|
||||
| persistent_peers | validator node, optionally other sentry nodes |
|
||||
| private_peer_ids | validator node ID |
|
||||
| unconditional_peer_ids | validator node ID, optionally sentry node IDs |
|
||||
| addr_book_strict | false |
|
||||
|
||||
The sentry nodes should be able to talk to the entire network hence why `pex=true`. The persistent peers of a sentry node will be the validator, and optionally other sentry nodes. The sentry nodes should make sure that they do not gossip the validator's ip, to do this you must put the validators nodeID as a private peer. The unconditional peer IDs will be the validator ID and optionally other sentry nodes.
|
||||
|
||||
> Note: Do not forget to secure your node's firewalls when setting them up.
|
||||
|
||||
More Information can be found at these links:
|
||||
|
||||
- <https://kb.certus.one/>
|
||||
- <https://forum.cosmos.network/t/sentry-node-architecture-overview/454>
|
||||
|
||||
### Validator keys
|
||||
|
||||
Protecting a validator's consensus key is the most important factor to take in when designing your setup. The key that a validator is given upon creation of the node is called a consensus key, it has to be online at all times in order to vote on blocks. It is **not recommended** to merely hold your private key in the default json file (`priv_validator_key.json`). Fortunately, the [Interchain Foundation](https://interchain.io/) has worked with a team to build a key management server for validators. You can find documentation on how to use it [here](https://github.com/iqlusioninc/tmkms), it is used extensively in production. You are not limited to using this tool, there are also [HSMs](https://safenet.gemalto.com/data-encryption/hardware-security-modules-hsms/), there is not a recommended HSM.
|
||||
|
||||
Currently Tendermint uses [Ed25519](https://ed25519.cr.yp.to/) keys which are widely supported across the security sector and HSMs.
|
||||
|
||||
## Committing a Block
|
||||
|
||||
> **+2/3 is short for "more than 2/3"**
|
||||
|
||||
A block is committed when +2/3 of the validator set sign [precommit
|
||||
votes](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#vote) for that block at the same `round`.
|
||||
The +2/3 set of precommit votes is called a
|
||||
[_commit_](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#commit). While any +2/3 set of
|
||||
precommits for the same block at the same height&round can serve as
|
||||
validation, the canonical commit is included in the next block (see
|
||||
[LastCommit](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md#lastcommit)).
|
||||
This file has moved to the [node_operators section](../node_operators/validators.md).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
order: 1
|
||||
parent:
|
||||
title: Tools
|
||||
title: Tooling
|
||||
order: 6
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
---
|
||||
order: 1
|
||||
parent:
|
||||
title: Debugging
|
||||
order: 1
|
||||
---
|
||||
|
||||
# Debugging
|
||||
|
||||
## tendermint debug kill
|
||||
## Tendermint debug kill
|
||||
|
||||
Tendermint comes with a `debug` sub-command that allows you to kill a live
|
||||
Tendermint process while collecting useful information in a compressed archive.
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# Debug Like A Pro
|
||||
|
||||
## Intro
|
||||
|
||||
Tendermint Core is a fairly robust BFT replication engine. Unfortunately, as with other software, failures sometimes do happen. The question is then “what do you do” when the system deviates from the expected behavior.
|
||||
|
||||
The first response is usually to take a look at the logs. By default, Tendermint writes logs to standard output ¹.
|
||||
|
||||
```sh
|
||||
I[2020-05-29|03:03:16.145] Committed state module=state height=2282 txs=0 appHash=0A27BC6B0477A8A50431704D2FB90DB99CBFCB67A2924B5FBF6D4E78538B67C1I[2020-05-29|03:03:21.690] Executed block module=state height=2283 validTxs=0 invalidTxs=0I[2020-05-29|03:03:21.698] Committed state module=state height=2283 txs=0 appHash=EB4E409D3AF4095A0757C806BF160B3DE4047AC0416F584BFF78FC0D44C44BF3I[2020-05-29|03:03:27.994] Executed block module=state height=2284 validTxs=0 invalidTxs=0I[2020-05-29|03:03:28.003] Committed state module=state height=2284 txs=0 appHash=3FC9237718243A2CAEE3A8B03AE05E1FC3CA28AEFE8DF0D3D3DCE00D87462866E[2020-05-29|03:03:32.975] enterPrevote: ProposalBlock is invalid module=consensus height=2285 round=0 err="wrong signature (#35): C683341000384EA00A345F9DB9608292F65EE83B51752C0A375A9FCFC2BD895E0792A0727925845DC13BA0E208C38B7B12B2218B2FE29B6D9135C53D7F253D05"
|
||||
```
|
||||
|
||||
If you’re running a validator in production, it might be a good idea to forward the logs for analysis using filebeat or similar tools. Also, you can set up a notification in case of any errors.
|
||||
|
||||
The logs should give you the basic idea of what has happened. In the worst-case scenario, the node has stalled and does not produce any logs (or simply panicked).
|
||||
|
||||
The next step is to call /status, /net_info, /consensus_state and /dump_consensus_state RPC endpoints.
|
||||
|
||||
```sh
|
||||
curl http://<server>:26657/status$ curl http://<server>:26657/net_info$ curl http://<server>:26657/consensus_state$ curl http://<server>:26657/dump_consensus_state
|
||||
```
|
||||
|
||||
Please note that /consensus_state and /dump_consensus_state may not return a result if the node has stalled (since they try to get a hold of the consensus mutex).
|
||||
|
||||
The output of these endpoints contains all the information needed for developers to understand the state of the node. It will give you an idea if the node is lagging behind the network, how many peers it’s connected to, and what the latest consensus state is.
|
||||
|
||||
At this point, if the node is stalled and you want to restart it, the best thing you can do is to kill it with -6 signal:
|
||||
|
||||
```sh
|
||||
kill -6 <PID>
|
||||
```
|
||||
|
||||
which will dump the list of the currently running goroutines. The list is super useful when debugging a deadlock.
|
||||
|
||||
`PID` is the Tendermint’s process ID. You can find it out by running `ps -a | grep tendermint | awk ‘{print $1}’`
|
||||
|
||||
## Tendermint debug kill
|
||||
|
||||
To ease the burden of collecting different pieces of data Tendermint Core (since v0.33 version) provides the Tendermint debug kill tool, which will do all of the above steps for you, wrapping everything into a nice archive file.
|
||||
|
||||
```sh
|
||||
tendermint debug kill <pid> </path/to/out.zip> — home=</path/to/app.d>
|
||||
```
|
||||
|
||||
Here’s the official documentation page — <https://docs.tendermint.com/master/tools/debugging.html>
|
||||
|
||||
If you’re using a process supervisor, like systemd, it will restart the Tendermint automatically. We strongly advise you to have one in production. If not, you will need to restart the node by hand.
|
||||
|
||||
Another advantage of using Tendermint debug is that the same archive file can be given to Tendermint Core developers, in cases where you think there’s a software issue.
|
||||
|
||||
## Tendermint debug dump
|
||||
|
||||
Okay, but what if the node has not stalled, but its state is degrading over time? Tendermint debug dump to the rescue!
|
||||
|
||||
```sh
|
||||
tendermint debug dump </path/to/out> — home=</path/to/app.d>
|
||||
```
|
||||
|
||||
It won’t kill the node, but it will gather all of the above data and package it into an archive file. Plus, it will also make a heap dump, which should help if Tendermint is leaking memory.
|
||||
|
||||
At this point, depending on how severe the degradation is, you may want to restart the process.
|
||||
|
||||
## Outro
|
||||
|
||||
We’re hoping that the `tendermint debug` subcommand will become de facto the first response to any accidents.
|
||||
|
||||
Let us know what your experience has been so far! Have you had a chance to try `tendermint debug` yet?
|
||||
|
||||
Join our chat, where we discuss the current issues and future improvements.
|
||||
|
||||
—
|
||||
|
||||
[1]: Of course, you’re free to redirect the Tendermint’s output to a file or forward it to another server.
|
||||
@@ -66,6 +66,8 @@ func (evR *Reactor) AddPeer(peer p2p.Peer) {
|
||||
|
||||
// Receive implements Reactor.
|
||||
// It adds any received evidence to the evpool.
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (evR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
evis, err := decodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/tendermint/tendermint
|
||||
|
||||
go 1.14
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1
|
||||
@@ -8,8 +8,8 @@ require (
|
||||
github.com/Workiva/go-datastructures v1.0.52
|
||||
github.com/btcsuite/btcd v0.21.0-beta
|
||||
github.com/btcsuite/btcutil v1.0.2
|
||||
github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb
|
||||
github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd
|
||||
github.com/confio/ics23/go v0.6.3
|
||||
github.com/cosmos/iavl v0.15.0
|
||||
github.com/fortytw2/leaktest v1.3.0
|
||||
github.com/go-kit/kit v0.10.0
|
||||
github.com/go-logfmt/logfmt v0.5.0
|
||||
@@ -17,6 +17,7 @@ require (
|
||||
github.com/golang/protobuf v1.4.3
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/gtank/merlin v0.1.1
|
||||
github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a
|
||||
github.com/libp2p/go-buffer-pool v0.0.2
|
||||
github.com/minio/highwayhash v1.0.1
|
||||
github.com/pkg/errors v0.9.1
|
||||
@@ -28,8 +29,8 @@ require (
|
||||
github.com/spf13/cobra v1.1.1
|
||||
github.com/spf13/viper v1.7.1
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/tendermint/tm-db v0.6.2
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc
|
||||
google.golang.org/grpc v1.33.1
|
||||
github.com/tendermint/tm-db v0.6.3
|
||||
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202
|
||||
google.golang.org/grpc v1.33.2
|
||||
)
|
||||
|
||||
@@ -82,6 +82,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb h1:+7FsS1gZ1Km5LRjGV2hztpier/5i6ngNjvNpxbWP5I0=
|
||||
github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
|
||||
github.com/confio/ics23/go v0.6.3 h1:PuGK2V1NJWZ8sSkNDq91jgT/cahFEW9RGp4Y5jxulf0=
|
||||
github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=
|
||||
@@ -97,6 +99,10 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fj
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd h1:K3bmPkMDnd2KVQ7xoGmgp+pxoXcBW58vMWaMl9ZWx3c=
|
||||
github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE=
|
||||
github.com/cosmos/iavl v0.15.0-rc5 h1:AMKgaAjXwGANWv56NL4q4hV+a0puSkLYD6cCQAv3i44=
|
||||
github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I=
|
||||
github.com/cosmos/iavl v0.15.0 h1:MKIZlwRuls9mUXnMCtqHRDsiZXeevUvDcVrxa1cw+8A=
|
||||
github.com/cosmos/iavl v0.15.0/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
@@ -108,6 +114,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
||||
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.1 h1:t36VcBCpo4SsmAD5M8wVv1ieVzcALyGfaJ92z4ccULM=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k=
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE=
|
||||
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA=
|
||||
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
@@ -204,6 +212,8 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
@@ -227,12 +237,15 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.14.7 h1:Nk5kuHrnWUTf/0GL1a/vchH/om9Ap2/HnVna+jYZgTY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f h1:8N8XWLZelZNibkhM1FuF+3Ad3YIbgirjdMiVA0eUkaM=
|
||||
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
|
||||
@@ -263,6 +276,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a h1:H7I/CTwAupJEX4g8AesPYRKQY0wbGZxQBlg842dGK3k=
|
||||
github.com/hdevalence/ed25519consensus v0.0.0-20200813231810-1694d75e712a/go.mod h1:V0zo781scjlo5OzNQb2GI8wMt6CD4vs7y1beXtxZEhM=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
|
||||
@@ -511,8 +526,12 @@ github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKk
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
|
||||
github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4=
|
||||
github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg=
|
||||
github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ=
|
||||
github.com/tendermint/tm-db v0.6.2 h1:DOn8jwCdjJblrCFJbtonEIPD1IuJWpbRUUdR8GWE4RM=
|
||||
github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI=
|
||||
github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg=
|
||||
github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
@@ -559,6 +578,10 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnk
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o=
|
||||
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -608,6 +631,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=
|
||||
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -644,6 +669,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o=
|
||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -660,6 +686,7 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm
|
||||
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88=
|
||||
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -729,6 +756,10 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6 h1:iRN4+t0lvZX/l9gH14ARF9i58tsVa5a97k6aH95rC3Y=
|
||||
google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0=
|
||||
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
@@ -749,8 +780,9 @@ google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs=
|
||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0=
|
||||
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.1 h1:DGeFlSan2f+WEtCERJ4J9GJWk15TxUi8QGagfI87Xyc=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -763,6 +795,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@@ -772,6 +806,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
)
|
||||
|
||||
func TestSIGHUP(t *testing.T) {
|
||||
@@ -27,10 +25,9 @@ func TestSIGHUP(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "sighup_test")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
os.RemoveAll(dir)
|
||||
_ = os.RemoveAll(dir)
|
||||
})
|
||||
err = os.Chdir(dir)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, os.Chdir(dir))
|
||||
|
||||
// Create an AutoFile in the temporary directory
|
||||
name := "sighup_test"
|
||||
@@ -45,19 +42,16 @@ func TestSIGHUP(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Move the file over
|
||||
err = os.Rename(name, name+"_old")
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, os.Rename(name, name+"_old"))
|
||||
|
||||
// Move into a different temporary directory
|
||||
otherDir, err := ioutil.TempDir("", "sighup_test_other")
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(otherDir)
|
||||
err = os.Chdir(otherDir)
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { os.RemoveAll(otherDir) })
|
||||
require.NoError(t, os.Chdir(otherDir))
|
||||
|
||||
// Send SIGHUP to self.
|
||||
err = syscall.Kill(syscall.Getpid(), syscall.SIGHUP)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, syscall.Kill(syscall.Getpid(), syscall.SIGHUP))
|
||||
|
||||
// Wait a bit... signals are not handled synchronously.
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
@@ -67,14 +61,13 @@ func TestSIGHUP(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
_, err = af.Write([]byte("Line 4\n"))
|
||||
require.NoError(t, err)
|
||||
err = af.Close()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, af.Close())
|
||||
|
||||
// Both files should exist
|
||||
if body := tmos.MustReadFile(filepath.Join(dir, name+"_old")); string(body) != "Line 1\nLine 2\n" {
|
||||
if body := mustReadFile(t, filepath.Join(dir, name+"_old")); string(body) != "Line 1\nLine 2\n" {
|
||||
t.Errorf("unexpected body %s", body)
|
||||
}
|
||||
if body := tmos.MustReadFile(filepath.Join(dir, name)); string(body) != "Line 3\nLine 4\n" {
|
||||
if body := mustReadFile(t, filepath.Join(dir, name)); string(body) != "Line 3\nLine 4\n" {
|
||||
t.Errorf("unexpected body %s", body)
|
||||
}
|
||||
|
||||
@@ -115,8 +108,7 @@ func TestAutoFileSize(t *testing.T) {
|
||||
// First, create an AutoFile writing to a tempfile dir
|
||||
f, err := ioutil.TempFile("", "sighup_test")
|
||||
require.NoError(t, err)
|
||||
err = f.Close()
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, f.Close())
|
||||
|
||||
// Here is the actual AutoFile.
|
||||
af, err := OpenAutoFile(f.Name())
|
||||
@@ -136,14 +128,19 @@ func TestAutoFileSize(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// 3. Not existing file
|
||||
err = af.Close()
|
||||
require.NoError(t, err)
|
||||
err = os.Remove(f.Name())
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, af.Close())
|
||||
require.NoError(t, os.Remove(f.Name()))
|
||||
size, err = af.Size()
|
||||
require.EqualValues(t, 0, size, "Expected a new file to be empty")
|
||||
require.NoError(t, err)
|
||||
|
||||
// Cleanup
|
||||
_ = os.Remove(f.Name())
|
||||
t.Cleanup(func() { os.Remove(f.Name()) })
|
||||
}
|
||||
|
||||
func mustReadFile(t *testing.T, filePath string) []byte {
|
||||
fileBytes, err := ioutil.ReadFile(filePath)
|
||||
require.NoError(t, err)
|
||||
|
||||
return fileBytes
|
||||
}
|
||||
|
||||
+2
-9
@@ -32,16 +32,9 @@ func Fail() {
|
||||
}
|
||||
|
||||
if callIndex == callIndexToFail {
|
||||
Exit()
|
||||
fmt.Printf("*** fail-test %d ***\n", callIndex)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
callIndex++
|
||||
}
|
||||
|
||||
func Exit() {
|
||||
fmt.Printf("*** fail-test %d ***\n", callIndex)
|
||||
os.Exit(1)
|
||||
// proc, _ := os.FindProcess(os.Getpid())
|
||||
// proc.Signal(os.Interrupt)
|
||||
// panic(fmt.Sprintf("*** fail-test %d ***", callIndex))
|
||||
}
|
||||
|
||||
+15
-9
@@ -3,18 +3,18 @@ package math
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Fraction defined in terms of a numerator divided by a denominator in int64
|
||||
// format.
|
||||
// Fraction defined in terms of a numerator divided by a denominator in uint64
|
||||
// format. Fraction must be positive.
|
||||
type Fraction struct {
|
||||
// The portion of the denominator in the faction, e.g. 2 in 2/3.
|
||||
Numerator int64 `json:"numerator"`
|
||||
// The value by which the numerator is divided, e.g. 3 in 2/3. Must be
|
||||
// positive.
|
||||
Denominator int64 `json:"denominator"`
|
||||
Numerator uint64 `json:"numerator"`
|
||||
// The value by which the numerator is divided, e.g. 3 in 2/3.
|
||||
Denominator uint64 `json:"denominator"`
|
||||
}
|
||||
|
||||
func (fr Fraction) String() string {
|
||||
@@ -27,16 +27,22 @@ func (fr Fraction) String() string {
|
||||
func ParseFraction(f string) (Fraction, error) {
|
||||
o := strings.Split(f, "/")
|
||||
if len(o) != 2 {
|
||||
return Fraction{}, errors.New("incorrect formating: should be like \"1/3\"")
|
||||
return Fraction{}, errors.New("incorrect formating: should have a single slash i.e. \"1/3\"")
|
||||
}
|
||||
numerator, err := strconv.ParseInt(o[0], 10, 64)
|
||||
numerator, err := strconv.ParseUint(o[0], 10, 64)
|
||||
if err != nil {
|
||||
return Fraction{}, fmt.Errorf("incorrect formatting, err: %w", err)
|
||||
}
|
||||
|
||||
denominator, err := strconv.ParseInt(o[1], 10, 64)
|
||||
denominator, err := strconv.ParseUint(o[1], 10, 64)
|
||||
if err != nil {
|
||||
return Fraction{}, fmt.Errorf("incorrect formatting, err: %w", err)
|
||||
}
|
||||
if denominator == 0 {
|
||||
return Fraction{}, errors.New("denominator can't be 0")
|
||||
}
|
||||
if numerator > math.MaxInt64 || denominator > math.MaxInt64 {
|
||||
return Fraction{}, fmt.Errorf("value overflow, numerator and denominator must be less than %d", int64(math.MaxInt64))
|
||||
}
|
||||
return Fraction{Numerator: numerator, Denominator: denominator}, nil
|
||||
}
|
||||
|
||||
@@ -23,15 +23,33 @@ func TestParseFraction(t *testing.T) {
|
||||
exp: Fraction{15, 5},
|
||||
err: false,
|
||||
},
|
||||
// test divide by zero error
|
||||
{
|
||||
f: "2/0",
|
||||
exp: Fraction{},
|
||||
err: true,
|
||||
},
|
||||
// test negative
|
||||
{
|
||||
f: "-1/2",
|
||||
exp: Fraction{-1, 2},
|
||||
err: false,
|
||||
exp: Fraction{},
|
||||
err: true,
|
||||
},
|
||||
{
|
||||
f: "1/-2",
|
||||
exp: Fraction{1, -2},
|
||||
err: false,
|
||||
exp: Fraction{},
|
||||
err: true,
|
||||
},
|
||||
// test overflow
|
||||
{
|
||||
f: "9223372036854775808/2",
|
||||
exp: Fraction{},
|
||||
err: true,
|
||||
},
|
||||
{
|
||||
f: "2/9223372036854775808",
|
||||
exp: Fraction{},
|
||||
err: true,
|
||||
},
|
||||
{
|
||||
f: "2/3/4",
|
||||
|
||||
+10
-44
@@ -3,7 +3,6 @@ package os
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@@ -13,29 +12,20 @@ type logger interface {
|
||||
Info(msg string, keyvals ...interface{})
|
||||
}
|
||||
|
||||
// TrapSignal catches the SIGTERM/SIGINT and executes cb function. After that it exits
|
||||
// with code 0.
|
||||
// TrapSignal catches SIGTERM and SIGINT, executes the cleanup function,
|
||||
// and exits with code 0.
|
||||
func TrapSignal(logger logger, cb func()) {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
for sig := range c {
|
||||
logger.Info(fmt.Sprintf("captured %v, exiting...", sig))
|
||||
if cb != nil {
|
||||
cb()
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// Kill the running process by sending itself SIGTERM.
|
||||
func Kill() error {
|
||||
p, err := os.FindProcess(os.Getpid())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return p.Signal(syscall.SIGTERM)
|
||||
go func() {
|
||||
sig := <-c
|
||||
logger.Info(fmt.Sprintf("captured %v, exiting...", sig))
|
||||
if cb != nil {
|
||||
cb()
|
||||
}
|
||||
os.Exit(0)
|
||||
}()
|
||||
}
|
||||
|
||||
func Exit(s string) {
|
||||
@@ -58,30 +48,6 @@ func FileExists(filePath string) bool {
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
func ReadFile(filePath string) ([]byte, error) {
|
||||
return ioutil.ReadFile(filePath)
|
||||
}
|
||||
|
||||
func MustReadFile(filePath string) []byte {
|
||||
fileBytes, err := ioutil.ReadFile(filePath)
|
||||
if err != nil {
|
||||
Exit(fmt.Sprintf("MustReadFile failed: %v", err))
|
||||
return nil
|
||||
}
|
||||
return fileBytes
|
||||
}
|
||||
|
||||
func WriteFile(filePath string, contents []byte, mode os.FileMode) error {
|
||||
return ioutil.WriteFile(filePath, contents, mode)
|
||||
}
|
||||
|
||||
func MustWriteFile(filePath string, contents []byte, mode os.FileMode) {
|
||||
err := WriteFile(filePath, contents, mode)
|
||||
if err != nil {
|
||||
Exit(fmt.Sprintf("MustWriteFile failed: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
// CopyFile copies a file. It truncates the destination file if it exists.
|
||||
func CopyFile(src, dst string) error {
|
||||
info, err := os.Stat(src)
|
||||
|
||||
+67
-2
@@ -1,11 +1,16 @@
|
||||
package os
|
||||
package os_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
)
|
||||
|
||||
func TestCopyFile(t *testing.T) {
|
||||
@@ -20,7 +25,7 @@ func TestCopyFile(t *testing.T) {
|
||||
}
|
||||
|
||||
copyfile := fmt.Sprintf("%s.copy", tmpfile.Name())
|
||||
if err := CopyFile(tmpfile.Name(), copyfile); err != nil {
|
||||
if err := tmos.CopyFile(tmpfile.Name(), copyfile); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := os.Stat(copyfile); os.IsNotExist(err) {
|
||||
@@ -35,3 +40,63 @@ func TestCopyFile(t *testing.T) {
|
||||
}
|
||||
os.Remove(copyfile)
|
||||
}
|
||||
|
||||
func TestTrapSignal(t *testing.T) {
|
||||
if os.Getenv("TM_TRAP_SIGNAL_TEST") == "1" {
|
||||
t.Log("inside test process")
|
||||
killer()
|
||||
return
|
||||
}
|
||||
|
||||
cmd, _, mockStderr := newTestProgram(t, "TM_TRAP_SIGNAL_TEST")
|
||||
|
||||
err := cmd.Run()
|
||||
if err == nil {
|
||||
wantStderr := "exiting"
|
||||
if mockStderr.String() != wantStderr {
|
||||
t.Fatalf("stderr: want %q, got %q", wantStderr, mockStderr.String())
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if e, ok := err.(*exec.ExitError); ok && !e.Success() {
|
||||
t.Fatalf("wrong exit code, want 0, got %d", e.ExitCode())
|
||||
}
|
||||
|
||||
t.Fatal("this error should not be triggered")
|
||||
}
|
||||
|
||||
type mockLogger struct{}
|
||||
|
||||
func (ml mockLogger) Info(msg string, keyvals ...interface{}) {}
|
||||
|
||||
func killer() {
|
||||
logger := mockLogger{}
|
||||
|
||||
tmos.TrapSignal(logger, func() { _, _ = fmt.Fprintf(os.Stderr, "exiting") })
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
p, err := os.FindProcess(os.Getpid())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := p.Signal(syscall.SIGTERM); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
func newTestProgram(t *testing.T, environVar string) (cmd *exec.Cmd, stdout *bytes.Buffer, stderr *bytes.Buffer) {
|
||||
t.Helper()
|
||||
|
||||
cmd = exec.Command(os.Args[0], "-test.run="+t.Name())
|
||||
stdout, stderr = bytes.NewBufferString(""), bytes.NewBufferString("")
|
||||
cmd.Env = append(os.Environ(), fmt.Sprintf("%s=1", environVar))
|
||||
cmd.Stdout = stdout
|
||||
cmd.Stderr = stderr
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
+66
-41
@@ -29,6 +29,7 @@ var (
|
||||
//
|
||||
// maxClockDrift defines how much untrustedHeader.Time can drift into the
|
||||
// future.
|
||||
// trustedHeader must have a ChainID, Height and Time
|
||||
func VerifyNonAdjacent(
|
||||
trustedHeader *types.SignedHeader, // height=X
|
||||
trustedVals *types.ValidatorSet, // height=X or height=X+1
|
||||
@@ -39,6 +40,8 @@ func VerifyNonAdjacent(
|
||||
maxClockDrift time.Duration,
|
||||
trustLevel tmmath.Fraction) error {
|
||||
|
||||
checkRequiredHeaderFields(trustedHeader)
|
||||
|
||||
if untrustedHeader.Height == trustedHeader.Height+1 {
|
||||
return errors.New("headers must be non adjacent in height")
|
||||
}
|
||||
@@ -90,6 +93,7 @@ func VerifyNonAdjacent(
|
||||
//
|
||||
// maxClockDrift defines how much untrustedHeader.Time can drift into the
|
||||
// future.
|
||||
// trustedHeader must have a ChainID, Height, Time and NextValidatorsHash
|
||||
func VerifyAdjacent(
|
||||
trustedHeader *types.SignedHeader, // height=X
|
||||
untrustedHeader *types.SignedHeader, // height=X+1
|
||||
@@ -98,6 +102,12 @@ func VerifyAdjacent(
|
||||
now time.Time,
|
||||
maxClockDrift time.Duration) error {
|
||||
|
||||
checkRequiredHeaderFields(trustedHeader)
|
||||
|
||||
if len(trustedHeader.NextValidatorsHash) == 0 {
|
||||
panic("next validators hash in trusted header is empty")
|
||||
}
|
||||
|
||||
if untrustedHeader.Height != trustedHeader.Height+1 {
|
||||
return errors.New("headers must be adjacent in height")
|
||||
}
|
||||
@@ -150,47 +160,6 @@ func Verify(
|
||||
return VerifyAdjacent(trustedHeader, untrustedHeader, untrustedVals, trustingPeriod, now, maxClockDrift)
|
||||
}
|
||||
|
||||
func verifyNewHeaderAndVals(
|
||||
untrustedHeader *types.SignedHeader,
|
||||
untrustedVals *types.ValidatorSet,
|
||||
trustedHeader *types.SignedHeader,
|
||||
now time.Time,
|
||||
maxClockDrift time.Duration) error {
|
||||
|
||||
if err := untrustedHeader.ValidateBasic(trustedHeader.ChainID); err != nil {
|
||||
return fmt.Errorf("untrustedHeader.ValidateBasic failed: %w", err)
|
||||
}
|
||||
|
||||
if untrustedHeader.Height <= trustedHeader.Height {
|
||||
return fmt.Errorf("expected new header height %d to be greater than one of old header %d",
|
||||
untrustedHeader.Height,
|
||||
trustedHeader.Height)
|
||||
}
|
||||
|
||||
if !untrustedHeader.Time.After(trustedHeader.Time) {
|
||||
return fmt.Errorf("expected new header time %v to be after old header time %v",
|
||||
untrustedHeader.Time,
|
||||
trustedHeader.Time)
|
||||
}
|
||||
|
||||
if !untrustedHeader.Time.Before(now.Add(maxClockDrift)) {
|
||||
return fmt.Errorf("new header has a time from the future %v (now: %v; max clock drift: %v)",
|
||||
untrustedHeader.Time,
|
||||
now,
|
||||
maxClockDrift)
|
||||
}
|
||||
|
||||
if !bytes.Equal(untrustedHeader.ValidatorsHash, untrustedVals.Hash()) {
|
||||
return fmt.Errorf("expected new header validators (%X) to match those that were supplied (%X) at height %d",
|
||||
untrustedHeader.ValidatorsHash,
|
||||
untrustedVals.Hash(),
|
||||
untrustedHeader.Height,
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateTrustLevel checks that trustLevel is within the allowed range [1/3,
|
||||
// 1]. If not, it returns an error. 1/3 is the minimum amount of trust needed
|
||||
// which does not break the security model.
|
||||
@@ -243,3 +212,59 @@ func VerifyBackwards(untrustedHeader, trustedHeader *types.Header) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func verifyNewHeaderAndVals(
|
||||
untrustedHeader *types.SignedHeader,
|
||||
untrustedVals *types.ValidatorSet,
|
||||
trustedHeader *types.SignedHeader,
|
||||
now time.Time,
|
||||
maxClockDrift time.Duration) error {
|
||||
|
||||
if err := untrustedHeader.ValidateBasic(trustedHeader.ChainID); err != nil {
|
||||
return fmt.Errorf("untrustedHeader.ValidateBasic failed: %w", err)
|
||||
}
|
||||
|
||||
if untrustedHeader.Height <= trustedHeader.Height {
|
||||
return fmt.Errorf("expected new header height %d to be greater than one of old header %d",
|
||||
untrustedHeader.Height,
|
||||
trustedHeader.Height)
|
||||
}
|
||||
|
||||
if !untrustedHeader.Time.After(trustedHeader.Time) {
|
||||
return fmt.Errorf("expected new header time %v to be after old header time %v",
|
||||
untrustedHeader.Time,
|
||||
trustedHeader.Time)
|
||||
}
|
||||
|
||||
if !untrustedHeader.Time.Before(now.Add(maxClockDrift)) {
|
||||
return fmt.Errorf("new header has a time from the future %v (now: %v; max clock drift: %v)",
|
||||
untrustedHeader.Time,
|
||||
now,
|
||||
maxClockDrift)
|
||||
}
|
||||
|
||||
if !bytes.Equal(untrustedHeader.ValidatorsHash, untrustedVals.Hash()) {
|
||||
return fmt.Errorf("expected new header validators (%X) to match those that were supplied (%X) at height %d",
|
||||
untrustedHeader.ValidatorsHash,
|
||||
untrustedVals.Hash(),
|
||||
untrustedHeader.Height,
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkRequiredHeaderFields(h *types.SignedHeader) {
|
||||
if h.Height == 0 {
|
||||
panic("height in trusted header must be set (non zero")
|
||||
}
|
||||
|
||||
zeroTime := time.Time{}
|
||||
if h.Time == zeroTime {
|
||||
panic("time in trusted header must be set")
|
||||
}
|
||||
|
||||
if h.ChainID == "" {
|
||||
panic("chain ID in trusted header must be set")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,12 +318,10 @@ func TestValidateTrustLevel(t *testing.T) {
|
||||
4: {tmmath.Fraction{Numerator: 4, Denominator: 5}, true},
|
||||
|
||||
// invalid
|
||||
5: {tmmath.Fraction{Numerator: 6, Denominator: 5}, false},
|
||||
6: {tmmath.Fraction{Numerator: -1, Denominator: 3}, false},
|
||||
7: {tmmath.Fraction{Numerator: 0, Denominator: 1}, false},
|
||||
8: {tmmath.Fraction{Numerator: -1, Denominator: -3}, false},
|
||||
9: {tmmath.Fraction{Numerator: 0, Denominator: 0}, false},
|
||||
10: {tmmath.Fraction{Numerator: 1, Denominator: 0}, false},
|
||||
5: {tmmath.Fraction{Numerator: 6, Denominator: 5}, false},
|
||||
6: {tmmath.Fraction{Numerator: 0, Denominator: 1}, false},
|
||||
7: {tmmath.Fraction{Numerator: 0, Denominator: 0}, false},
|
||||
8: {tmmath.Fraction{Numerator: 1, Denominator: 0}, false},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
||||
@@ -160,6 +160,8 @@ func (memR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) {
|
||||
|
||||
// Receive implements Reactor.
|
||||
// It adds any received transactions to the mempool.
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (memR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
msg, err := memR.decodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
@@ -10,8 +10,8 @@ sudo apt-get upgrade -y
|
||||
sudo apt-get install -y jq unzip python-pip software-properties-common make
|
||||
|
||||
# get and unpack golang
|
||||
curl -O https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
|
||||
tar -xvf go1.14.4.linux-amd64.tar.gz
|
||||
curl -O https://dl.google.com/go/go1.15.4.linux-amd64.tar.gz
|
||||
tar -xvf go1.15.4.linux-amd64.tar.gz
|
||||
|
||||
## move binary and add to path
|
||||
mv go /usr/local
|
||||
|
||||
+6
-1
@@ -92,8 +92,13 @@ func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) {
|
||||
return nil, fmt.Errorf("failed to load or gen node key %s: %w", config.NodeKeyFile(), err)
|
||||
}
|
||||
|
||||
pval, err := privval.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewNode(config,
|
||||
privval.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()),
|
||||
pval,
|
||||
nodeKey,
|
||||
proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()),
|
||||
DefaultGenesisDocProviderFunc(config),
|
||||
|
||||
+3
-1
@@ -384,9 +384,11 @@ func TestNodeNewNodeCustomReactors(t *testing.T) {
|
||||
|
||||
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
|
||||
require.NoError(t, err)
|
||||
pval, err := privval.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile())
|
||||
require.NoError(t, err)
|
||||
|
||||
n, err := NewNode(config,
|
||||
privval.LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()),
|
||||
pval,
|
||||
nodeKey,
|
||||
proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()),
|
||||
DefaultGenesisDocProviderFunc(config),
|
||||
|
||||
@@ -44,6 +44,9 @@ type Reactor interface {
|
||||
// copying.
|
||||
//
|
||||
// CONTRACT: msgBytes are not nil.
|
||||
//
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
Receive(chID byte, peer Peer, msgBytes []byte)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -21,7 +22,6 @@ import (
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/crypto/sr25519"
|
||||
"github.com/tendermint/tendermint/libs/async"
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
tmrand "github.com/tendermint/tendermint/libs/rand"
|
||||
)
|
||||
|
||||
@@ -228,8 +228,7 @@ func TestDeriveSecretsAndChallengeGolden(t *testing.T) {
|
||||
if *update {
|
||||
t.Logf("Updating golden test vector file %s", goldenFilepath)
|
||||
data := createGoldenTestVectors(t)
|
||||
err := tmos.WriteFile(goldenFilepath, []byte(data), 0644)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, ioutil.WriteFile(goldenFilepath, []byte(data), 0644))
|
||||
}
|
||||
f, err := os.Open(goldenFilepath)
|
||||
if err != nil {
|
||||
|
||||
-26
@@ -1,9 +1,7 @@
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
@@ -94,27 +92,3 @@ func (nodeKey *NodeKey) SaveAs(filePath string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// MakePoWTarget returns the big-endian encoding of 2^(targetBits - difficulty) - 1.
|
||||
// It can be used as a Proof of Work target.
|
||||
// NOTE: targetBits must be a multiple of 8 and difficulty must be less than targetBits.
|
||||
func MakePoWTarget(difficulty, targetBits uint) []byte {
|
||||
if targetBits%8 != 0 {
|
||||
panic(fmt.Sprintf("targetBits (%d) not a multiple of 8", targetBits))
|
||||
}
|
||||
if difficulty >= targetBits {
|
||||
panic(fmt.Sprintf("difficulty (%d) >= targetBits (%d)", difficulty, targetBits))
|
||||
}
|
||||
targetBytes := targetBits / 8
|
||||
zeroPrefixLen := (int(difficulty) / 8)
|
||||
prefix := bytes.Repeat([]byte{0}, zeroPrefixLen)
|
||||
mod := (difficulty % 8)
|
||||
if mod > 0 {
|
||||
nonZeroPrefix := byte(1<<(8-mod) - 1)
|
||||
prefix = append(prefix, nonZeroPrefix)
|
||||
}
|
||||
tailLen := int(targetBytes) - len(prefix)
|
||||
return append(prefix, bytes.Repeat([]byte{0xFF}, tailLen)...)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -52,30 +51,3 @@ func TestNodeKeySaveAs(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.FileExists(t, filePath)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
func padBytes(bz []byte, targetBytes int) []byte {
|
||||
return append(bz, bytes.Repeat([]byte{0xFF}, targetBytes-len(bz))...)
|
||||
}
|
||||
|
||||
func TestPoWTarget(t *testing.T) {
|
||||
|
||||
targetBytes := 20
|
||||
cases := []struct {
|
||||
difficulty uint
|
||||
target []byte
|
||||
}{
|
||||
{0, padBytes([]byte{}, targetBytes)},
|
||||
{1, padBytes([]byte{127}, targetBytes)},
|
||||
{8, padBytes([]byte{0}, targetBytes)},
|
||||
{9, padBytes([]byte{0, 127}, targetBytes)},
|
||||
{10, padBytes([]byte{0, 63}, targetBytes)},
|
||||
{16, padBytes([]byte{0, 0}, targetBytes)},
|
||||
{17, padBytes([]byte{0, 0, 127}, targetBytes)},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
assert.Equal(t, MakePoWTarget(c.difficulty, 20*8), c.target)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +236,8 @@ func (r *Reactor) logErrAddrBook(err error) {
|
||||
}
|
||||
|
||||
// Receive implements Reactor by handling incoming PEX messages.
|
||||
// XXX: do not call any methods that can block or incur heavy processing.
|
||||
// https://github.com/tendermint/tendermint/issues/2888
|
||||
func (r *Reactor) Receive(chID byte, src Peer, msgBytes []byte) {
|
||||
msg, err := decodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
|
||||
+17
-6
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/crypto/secp256k1"
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
tmjson "github.com/tendermint/tendermint/libs/json"
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
@@ -170,8 +171,15 @@ func NewFilePV(privKey crypto.PrivKey, keyFilePath, stateFilePath string) *FileP
|
||||
|
||||
// GenFilePV generates a new validator with randomly generated private key
|
||||
// and sets the filePaths, but does not call Save().
|
||||
func GenFilePV(keyFilePath, stateFilePath string) *FilePV {
|
||||
return NewFilePV(ed25519.GenPrivKey(), keyFilePath, stateFilePath)
|
||||
func GenFilePV(keyFilePath, stateFilePath, keyType string) (*FilePV, error) {
|
||||
switch keyType {
|
||||
case types.ABCIPubKeyTypeSecp256k1:
|
||||
return NewFilePV(secp256k1.GenPrivKey(), keyFilePath, stateFilePath), nil
|
||||
case "", types.ABCIPubKeyTypeEd25519:
|
||||
return NewFilePV(ed25519.GenPrivKey(), keyFilePath, stateFilePath), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("key type: %s is not supported", keyType)
|
||||
}
|
||||
}
|
||||
|
||||
// LoadFilePV loads a FilePV from the filePaths. The FilePV handles double
|
||||
@@ -227,15 +235,18 @@ func loadFilePV(keyFilePath, stateFilePath string, loadState bool) *FilePV {
|
||||
|
||||
// LoadOrGenFilePV loads a FilePV from the given filePaths
|
||||
// or else generates a new one and saves it to the filePaths.
|
||||
func LoadOrGenFilePV(keyFilePath, stateFilePath string) *FilePV {
|
||||
var pv *FilePV
|
||||
func LoadOrGenFilePV(keyFilePath, stateFilePath string) (*FilePV, error) {
|
||||
var (
|
||||
pv *FilePV
|
||||
err error
|
||||
)
|
||||
if tmos.FileExists(keyFilePath) {
|
||||
pv = LoadFilePV(keyFilePath, stateFilePath)
|
||||
} else {
|
||||
pv = GenFilePV(keyFilePath, stateFilePath)
|
||||
pv, err = GenFilePV(keyFilePath, stateFilePath, "")
|
||||
pv.Save()
|
||||
}
|
||||
return pv
|
||||
return pv, err
|
||||
}
|
||||
|
||||
// GetAddress returns the address of the validator.
|
||||
|
||||
+14
-7
@@ -28,7 +28,8 @@ func TestGenLoadValidator(t *testing.T) {
|
||||
tempStateFile, err := ioutil.TempFile("", "priv_validator_state_")
|
||||
require.Nil(t, err)
|
||||
|
||||
privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
require.NoError(t, err)
|
||||
|
||||
height := int64(100)
|
||||
privVal.LastSignState.Height = height
|
||||
@@ -46,7 +47,8 @@ func TestResetValidator(t *testing.T) {
|
||||
tempStateFile, err := ioutil.TempFile("", "priv_validator_state_")
|
||||
require.Nil(t, err)
|
||||
|
||||
privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
require.NoError(t, err)
|
||||
emptyState := FilePVLastSignState{filePath: tempStateFile.Name()}
|
||||
|
||||
// new priv val has empty state
|
||||
@@ -86,9 +88,11 @@ func TestLoadOrGenValidator(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
privVal := LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath)
|
||||
privVal, err := LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath)
|
||||
require.NoError(t, err)
|
||||
addr := privVal.GetAddress()
|
||||
privVal = LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath)
|
||||
privVal, err = LoadOrGenFilePV(tempKeyFilePath, tempStateFilePath)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(addr, privVal.GetAddress(), "expected privval addr to be the same")
|
||||
}
|
||||
|
||||
@@ -164,7 +168,8 @@ func TestSignVote(t *testing.T) {
|
||||
tempStateFile, err := ioutil.TempFile("", "priv_validator_state_")
|
||||
require.Nil(t, err)
|
||||
|
||||
privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
require.NoError(t, err)
|
||||
|
||||
randbytes := tmrand.Bytes(tmhash.Size)
|
||||
randbytes2 := tmrand.Bytes(tmhash.Size)
|
||||
@@ -217,7 +222,8 @@ func TestSignProposal(t *testing.T) {
|
||||
tempStateFile, err := ioutil.TempFile("", "priv_validator_state_")
|
||||
require.Nil(t, err)
|
||||
|
||||
privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
require.NoError(t, err)
|
||||
|
||||
randbytes := tmrand.Bytes(tmhash.Size)
|
||||
randbytes2 := tmrand.Bytes(tmhash.Size)
|
||||
@@ -265,7 +271,8 @@ func TestDifferByTimestamp(t *testing.T) {
|
||||
tempStateFile, err := ioutil.TempFile("", "priv_validator_state_")
|
||||
require.Nil(t, err)
|
||||
|
||||
privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name())
|
||||
privVal, err := GenFilePV(tempKeyFile.Name(), tempStateFile.Name(), "")
|
||||
require.NoError(t, err)
|
||||
randbytes := tmrand.Bytes(tmhash.Size)
|
||||
block1 := types.BlockID{Hash: randbytes, PartSetHeader: types.PartSetHeader{Total: 5, Hash: randbytes}}
|
||||
height, round := int64(10), int32(1)
|
||||
|
||||
@@ -0,0 +1,469 @@
|
||||
package privval
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/cipher"
|
||||
crand "crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
gogotypes "github.com/gogo/protobuf/types"
|
||||
"github.com/gtank/merlin"
|
||||
pool "github.com/libp2p/go-buffer-pool"
|
||||
"golang.org/x/crypto/chacha20poly1305"
|
||||
"golang.org/x/crypto/curve25519"
|
||||
"golang.org/x/crypto/hkdf"
|
||||
"golang.org/x/crypto/nacl/box"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
cryptoenc "github.com/tendermint/tendermint/crypto/encoding"
|
||||
"github.com/tendermint/tendermint/libs/async"
|
||||
"github.com/tendermint/tendermint/libs/protoio"
|
||||
tmsync "github.com/tendermint/tendermint/libs/sync"
|
||||
tmprivval "github.com/tendermint/tendermint/proto/tendermint/privval"
|
||||
)
|
||||
|
||||
// This code has been duplicated from p2p/conn prior to the P2P refactor.
|
||||
// It is left here temporarily until we migrate privval to gRPC.
|
||||
// https://github.com/tendermint/tendermint/issues/4698
|
||||
|
||||
// 4 + 1024 == 1028 total frame size
|
||||
const (
|
||||
dataLenSize = 4
|
||||
dataMaxSize = 1024
|
||||
totalFrameSize = dataMaxSize + dataLenSize
|
||||
aeadSizeOverhead = 16 // overhead of poly 1305 authentication tag
|
||||
aeadKeySize = chacha20poly1305.KeySize
|
||||
aeadNonceSize = chacha20poly1305.NonceSize
|
||||
)
|
||||
|
||||
var (
|
||||
ErrSmallOrderRemotePubKey = errors.New("detected low order point from remote peer")
|
||||
|
||||
labelEphemeralLowerPublicKey = []byte("EPHEMERAL_LOWER_PUBLIC_KEY")
|
||||
labelEphemeralUpperPublicKey = []byte("EPHEMERAL_UPPER_PUBLIC_KEY")
|
||||
labelDHSecret = []byte("DH_SECRET")
|
||||
labelSecretConnectionMac = []byte("SECRET_CONNECTION_MAC")
|
||||
|
||||
secretConnKeyAndChallengeGen = []byte("TENDERMINT_SECRET_CONNECTION_KEY_AND_CHALLENGE_GEN")
|
||||
)
|
||||
|
||||
// SecretConnection implements net.Conn.
|
||||
// It is an implementation of the STS protocol.
|
||||
// See https://github.com/tendermint/tendermint/blob/0.1/docs/sts-final.pdf for
|
||||
// details on the protocol.
|
||||
//
|
||||
// Consumers of the SecretConnection are responsible for authenticating
|
||||
// the remote peer's pubkey against known information, like a nodeID.
|
||||
// Otherwise they are vulnerable to MITM.
|
||||
// (TODO(ismail): see also https://github.com/tendermint/tendermint/issues/3010)
|
||||
type SecretConnection struct {
|
||||
|
||||
// immutable
|
||||
recvAead cipher.AEAD
|
||||
sendAead cipher.AEAD
|
||||
|
||||
remPubKey crypto.PubKey
|
||||
conn io.ReadWriteCloser
|
||||
|
||||
// net.Conn must be thread safe:
|
||||
// https://golang.org/pkg/net/#Conn.
|
||||
// Since we have internal mutable state,
|
||||
// we need mtxs. But recv and send states
|
||||
// are independent, so we can use two mtxs.
|
||||
// All .Read are covered by recvMtx,
|
||||
// all .Write are covered by sendMtx.
|
||||
recvMtx tmsync.Mutex
|
||||
recvBuffer []byte
|
||||
recvNonce *[aeadNonceSize]byte
|
||||
|
||||
sendMtx tmsync.Mutex
|
||||
sendNonce *[aeadNonceSize]byte
|
||||
}
|
||||
|
||||
// MakeSecretConnection performs handshake and returns a new authenticated
|
||||
// SecretConnection.
|
||||
// Returns nil if there is an error in handshake.
|
||||
// Caller should call conn.Close()
|
||||
// See docs/sts-final.pdf for more information.
|
||||
func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKey) (*SecretConnection, error) {
|
||||
var (
|
||||
locPubKey = locPrivKey.PubKey()
|
||||
)
|
||||
|
||||
// Generate ephemeral keys for perfect forward secrecy.
|
||||
locEphPub, locEphPriv := genEphKeys()
|
||||
|
||||
// Write local ephemeral pubkey and receive one too.
|
||||
// NOTE: every 32-byte string is accepted as a Curve25519 public key (see
|
||||
// DJB's Curve25519 paper: http://cr.yp.to/ecdh/curve25519-20060209.pdf)
|
||||
remEphPub, err := shareEphPubKey(conn, locEphPub)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Sort by lexical order.
|
||||
loEphPub, hiEphPub := sort32(locEphPub, remEphPub)
|
||||
|
||||
transcript := merlin.NewTranscript("TENDERMINT_SECRET_CONNECTION_TRANSCRIPT_HASH")
|
||||
|
||||
transcript.AppendMessage(labelEphemeralLowerPublicKey, loEphPub[:])
|
||||
transcript.AppendMessage(labelEphemeralUpperPublicKey, hiEphPub[:])
|
||||
|
||||
// Check if the local ephemeral public key was the least, lexicographically
|
||||
// sorted.
|
||||
locIsLeast := bytes.Equal(locEphPub[:], loEphPub[:])
|
||||
|
||||
// Compute common diffie hellman secret using X25519.
|
||||
dhSecret, err := computeDHSecret(remEphPub, locEphPriv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
transcript.AppendMessage(labelDHSecret, dhSecret[:])
|
||||
|
||||
// Generate the secret used for receiving, sending, challenge via HKDF-SHA2
|
||||
// on the transcript state (which itself also uses HKDF-SHA2 to derive a key
|
||||
// from the dhSecret).
|
||||
recvSecret, sendSecret := deriveSecrets(dhSecret, locIsLeast)
|
||||
|
||||
const challengeSize = 32
|
||||
var challenge [challengeSize]byte
|
||||
challengeSlice := transcript.ExtractBytes(labelSecretConnectionMac, challengeSize)
|
||||
|
||||
copy(challenge[:], challengeSlice[0:challengeSize])
|
||||
|
||||
sendAead, err := chacha20poly1305.New(sendSecret[:])
|
||||
if err != nil {
|
||||
return nil, errors.New("invalid send SecretConnection Key")
|
||||
}
|
||||
recvAead, err := chacha20poly1305.New(recvSecret[:])
|
||||
if err != nil {
|
||||
return nil, errors.New("invalid receive SecretConnection Key")
|
||||
}
|
||||
|
||||
sc := &SecretConnection{
|
||||
conn: conn,
|
||||
recvBuffer: nil,
|
||||
recvNonce: new([aeadNonceSize]byte),
|
||||
sendNonce: new([aeadNonceSize]byte),
|
||||
recvAead: recvAead,
|
||||
sendAead: sendAead,
|
||||
}
|
||||
|
||||
// Sign the challenge bytes for authentication.
|
||||
locSignature, err := signChallenge(&challenge, locPrivKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Share (in secret) each other's pubkey & challenge signature
|
||||
authSigMsg, err := shareAuthSignature(sc, locPubKey, locSignature)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
remPubKey, remSignature := authSigMsg.Key, authSigMsg.Sig
|
||||
if _, ok := remPubKey.(ed25519.PubKey); !ok {
|
||||
return nil, fmt.Errorf("expected ed25519 pubkey, got %T", remPubKey)
|
||||
}
|
||||
if !remPubKey.VerifySignature(challenge[:], remSignature) {
|
||||
return nil, errors.New("challenge verification failed")
|
||||
}
|
||||
|
||||
// We've authorized.
|
||||
sc.remPubKey = remPubKey
|
||||
return sc, nil
|
||||
}
|
||||
|
||||
// RemotePubKey returns authenticated remote pubkey
|
||||
func (sc *SecretConnection) RemotePubKey() crypto.PubKey {
|
||||
return sc.remPubKey
|
||||
}
|
||||
|
||||
// Writes encrypted frames of `totalFrameSize + aeadSizeOverhead`.
|
||||
// CONTRACT: data smaller than dataMaxSize is written atomically.
|
||||
func (sc *SecretConnection) Write(data []byte) (n int, err error) {
|
||||
sc.sendMtx.Lock()
|
||||
defer sc.sendMtx.Unlock()
|
||||
|
||||
for 0 < len(data) {
|
||||
if err := func() error {
|
||||
var sealedFrame = pool.Get(aeadSizeOverhead + totalFrameSize)
|
||||
var frame = pool.Get(totalFrameSize)
|
||||
defer func() {
|
||||
pool.Put(sealedFrame)
|
||||
pool.Put(frame)
|
||||
}()
|
||||
var chunk []byte
|
||||
if dataMaxSize < len(data) {
|
||||
chunk = data[:dataMaxSize]
|
||||
data = data[dataMaxSize:]
|
||||
} else {
|
||||
chunk = data
|
||||
data = nil
|
||||
}
|
||||
chunkLength := len(chunk)
|
||||
binary.LittleEndian.PutUint32(frame, uint32(chunkLength))
|
||||
copy(frame[dataLenSize:], chunk)
|
||||
|
||||
// encrypt the frame
|
||||
sc.sendAead.Seal(sealedFrame[:0], sc.sendNonce[:], frame, nil)
|
||||
incrNonce(sc.sendNonce)
|
||||
// end encryption
|
||||
|
||||
_, err = sc.conn.Write(sealedFrame)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
n += len(chunk)
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
// CONTRACT: data smaller than dataMaxSize is read atomically.
|
||||
func (sc *SecretConnection) Read(data []byte) (n int, err error) {
|
||||
sc.recvMtx.Lock()
|
||||
defer sc.recvMtx.Unlock()
|
||||
|
||||
// read off and update the recvBuffer, if non-empty
|
||||
if 0 < len(sc.recvBuffer) {
|
||||
n = copy(data, sc.recvBuffer)
|
||||
sc.recvBuffer = sc.recvBuffer[n:]
|
||||
return
|
||||
}
|
||||
|
||||
// read off the conn
|
||||
var sealedFrame = pool.Get(aeadSizeOverhead + totalFrameSize)
|
||||
defer pool.Put(sealedFrame)
|
||||
_, err = io.ReadFull(sc.conn, sealedFrame)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// decrypt the frame.
|
||||
// reads and updates the sc.recvNonce
|
||||
var frame = pool.Get(totalFrameSize)
|
||||
defer pool.Put(frame)
|
||||
_, err = sc.recvAead.Open(frame[:0], sc.recvNonce[:], sealedFrame, nil)
|
||||
if err != nil {
|
||||
return n, fmt.Errorf("failed to decrypt SecretConnection: %w", err)
|
||||
}
|
||||
incrNonce(sc.recvNonce)
|
||||
// end decryption
|
||||
|
||||
// copy checkLength worth into data,
|
||||
// set recvBuffer to the rest.
|
||||
var chunkLength = binary.LittleEndian.Uint32(frame) // read the first four bytes
|
||||
if chunkLength > dataMaxSize {
|
||||
return 0, errors.New("chunkLength is greater than dataMaxSize")
|
||||
}
|
||||
var chunk = frame[dataLenSize : dataLenSize+chunkLength]
|
||||
n = copy(data, chunk)
|
||||
if n < len(chunk) {
|
||||
sc.recvBuffer = make([]byte, len(chunk)-n)
|
||||
copy(sc.recvBuffer, chunk[n:])
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
// Implements net.Conn
|
||||
// nolint
|
||||
func (sc *SecretConnection) Close() error { return sc.conn.Close() }
|
||||
func (sc *SecretConnection) LocalAddr() net.Addr { return sc.conn.(net.Conn).LocalAddr() }
|
||||
func (sc *SecretConnection) RemoteAddr() net.Addr { return sc.conn.(net.Conn).RemoteAddr() }
|
||||
func (sc *SecretConnection) SetDeadline(t time.Time) error { return sc.conn.(net.Conn).SetDeadline(t) }
|
||||
func (sc *SecretConnection) SetReadDeadline(t time.Time) error {
|
||||
return sc.conn.(net.Conn).SetReadDeadline(t)
|
||||
}
|
||||
func (sc *SecretConnection) SetWriteDeadline(t time.Time) error {
|
||||
return sc.conn.(net.Conn).SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
func genEphKeys() (ephPub, ephPriv *[32]byte) {
|
||||
var err error
|
||||
// TODO: Probably not a problem but ask Tony: different from the rust implementation (uses x25519-dalek),
|
||||
// we do not "clamp" the private key scalar:
|
||||
// see: https://github.com/dalek-cryptography/x25519-dalek/blob/34676d336049df2bba763cc076a75e47ae1f170f/src/x25519.rs#L56-L74
|
||||
ephPub, ephPriv, err = box.GenerateKey(crand.Reader)
|
||||
if err != nil {
|
||||
panic("Could not generate ephemeral key-pair")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func shareEphPubKey(conn io.ReadWriter, locEphPub *[32]byte) (remEphPub *[32]byte, err error) {
|
||||
|
||||
// Send our pubkey and receive theirs in tandem.
|
||||
var trs, _ = async.Parallel(
|
||||
func(_ int) (val interface{}, abort bool, err error) {
|
||||
lc := *locEphPub
|
||||
_, err = protoio.NewDelimitedWriter(conn).WriteMsg(&gogotypes.BytesValue{Value: lc[:]})
|
||||
if err != nil {
|
||||
return nil, true, err // abort
|
||||
}
|
||||
return nil, false, nil
|
||||
},
|
||||
func(_ int) (val interface{}, abort bool, err error) {
|
||||
var bytes gogotypes.BytesValue
|
||||
err = protoio.NewDelimitedReader(conn, 1024*1024).ReadMsg(&bytes)
|
||||
if err != nil {
|
||||
return nil, true, err // abort
|
||||
}
|
||||
|
||||
var _remEphPub [32]byte
|
||||
copy(_remEphPub[:], bytes.Value)
|
||||
return _remEphPub, false, nil
|
||||
},
|
||||
)
|
||||
|
||||
// If error:
|
||||
if trs.FirstError() != nil {
|
||||
err = trs.FirstError()
|
||||
return
|
||||
}
|
||||
|
||||
// Otherwise:
|
||||
var _remEphPub = trs.FirstValue().([32]byte)
|
||||
return &_remEphPub, nil
|
||||
}
|
||||
|
||||
func deriveSecrets(
|
||||
dhSecret *[32]byte,
|
||||
locIsLeast bool,
|
||||
) (recvSecret, sendSecret *[aeadKeySize]byte) {
|
||||
hash := sha256.New
|
||||
hkdf := hkdf.New(hash, dhSecret[:], nil, secretConnKeyAndChallengeGen)
|
||||
// get enough data for 2 aead keys, and a 32 byte challenge
|
||||
res := new([2*aeadKeySize + 32]byte)
|
||||
_, err := io.ReadFull(hkdf, res[:])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
recvSecret = new([aeadKeySize]byte)
|
||||
sendSecret = new([aeadKeySize]byte)
|
||||
|
||||
// bytes 0 through aeadKeySize - 1 are one aead key.
|
||||
// bytes aeadKeySize through 2*aeadKeySize -1 are another aead key.
|
||||
// which key corresponds to sending and receiving key depends on whether
|
||||
// the local key is less than the remote key.
|
||||
if locIsLeast {
|
||||
copy(recvSecret[:], res[0:aeadKeySize])
|
||||
copy(sendSecret[:], res[aeadKeySize:aeadKeySize*2])
|
||||
} else {
|
||||
copy(sendSecret[:], res[0:aeadKeySize])
|
||||
copy(recvSecret[:], res[aeadKeySize:aeadKeySize*2])
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// computeDHSecret computes a Diffie-Hellman shared secret key
|
||||
// from our own local private key and the other's public key.
|
||||
func computeDHSecret(remPubKey, locPrivKey *[32]byte) (*[32]byte, error) {
|
||||
shrKey, err := curve25519.X25519(locPrivKey[:], remPubKey[:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var shrKeyArray [32]byte
|
||||
copy(shrKeyArray[:], shrKey)
|
||||
return &shrKeyArray, nil
|
||||
}
|
||||
|
||||
func sort32(foo, bar *[32]byte) (lo, hi *[32]byte) {
|
||||
if bytes.Compare(foo[:], bar[:]) < 0 {
|
||||
lo = foo
|
||||
hi = bar
|
||||
} else {
|
||||
lo = bar
|
||||
hi = foo
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func signChallenge(challenge *[32]byte, locPrivKey crypto.PrivKey) ([]byte, error) {
|
||||
signature, err := locPrivKey.Sign(challenge[:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return signature, nil
|
||||
}
|
||||
|
||||
type authSigMessage struct {
|
||||
Key crypto.PubKey
|
||||
Sig []byte
|
||||
}
|
||||
|
||||
func shareAuthSignature(sc io.ReadWriter, pubKey crypto.PubKey, signature []byte) (recvMsg authSigMessage, err error) {
|
||||
|
||||
// Send our info and receive theirs in tandem.
|
||||
var trs, _ = async.Parallel(
|
||||
func(_ int) (val interface{}, abort bool, err error) {
|
||||
pbpk, err := cryptoenc.PubKeyToProto(pubKey)
|
||||
if err != nil {
|
||||
return nil, true, err
|
||||
}
|
||||
_, err = protoio.NewDelimitedWriter(sc).WriteMsg(&tmprivval.AuthSigMessage{PubKey: pbpk, Sig: signature})
|
||||
if err != nil {
|
||||
return nil, true, err // abort
|
||||
}
|
||||
return nil, false, nil
|
||||
},
|
||||
func(_ int) (val interface{}, abort bool, err error) {
|
||||
var pba tmprivval.AuthSigMessage
|
||||
err = protoio.NewDelimitedReader(sc, 1024*1024).ReadMsg(&pba)
|
||||
if err != nil {
|
||||
return nil, true, err // abort
|
||||
}
|
||||
|
||||
pk, err := cryptoenc.PubKeyFromProto(pba.PubKey)
|
||||
if err != nil {
|
||||
return nil, true, err // abort
|
||||
}
|
||||
|
||||
_recvMsg := authSigMessage{
|
||||
Key: pk,
|
||||
Sig: pba.Sig,
|
||||
}
|
||||
return _recvMsg, false, nil
|
||||
},
|
||||
)
|
||||
|
||||
// If error:
|
||||
if trs.FirstError() != nil {
|
||||
err = trs.FirstError()
|
||||
return
|
||||
}
|
||||
|
||||
var _recvMsg = trs.FirstValue().(authSigMessage)
|
||||
return _recvMsg, nil
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
// Increment nonce little-endian by 1 with wraparound.
|
||||
// Due to chacha20poly1305 expecting a 12 byte nonce we do not use the first four
|
||||
// bytes. We only increment a 64 bit unsigned int in the remaining 8 bytes
|
||||
// (little-endian in nonce[4:]).
|
||||
func incrNonce(nonce *[aeadNonceSize]byte) {
|
||||
counter := binary.LittleEndian.Uint64(nonce[4:])
|
||||
if counter == math.MaxUint64 {
|
||||
// Terminates the session and makes sure the nonce would not re-used.
|
||||
// See https://github.com/tendermint/tendermint/issues/3531
|
||||
panic("can't increase nonce without overflow")
|
||||
}
|
||||
counter++
|
||||
binary.LittleEndian.PutUint64(nonce[4:], counter)
|
||||
}
|
||||
@@ -15,24 +15,26 @@ const (
|
||||
// SignerServiceEndpointOption sets an optional parameter on the SignerDialerEndpoint.
|
||||
type SignerServiceEndpointOption func(*SignerDialerEndpoint)
|
||||
|
||||
// SignerDialerEndpointTimeoutReadWrite sets the read and write timeout for connections
|
||||
// from external signing processes.
|
||||
// SignerDialerEndpointTimeoutReadWrite sets the read and write timeout for
|
||||
// connections from client processes.
|
||||
func SignerDialerEndpointTimeoutReadWrite(timeout time.Duration) SignerServiceEndpointOption {
|
||||
return func(ss *SignerDialerEndpoint) { ss.timeoutReadWrite = timeout }
|
||||
}
|
||||
|
||||
// SignerDialerEndpointConnRetries sets the amount of attempted retries to acceptNewConnection.
|
||||
// SignerDialerEndpointConnRetries sets the amount of attempted retries to
|
||||
// acceptNewConnection.
|
||||
func SignerDialerEndpointConnRetries(retries int) SignerServiceEndpointOption {
|
||||
return func(ss *SignerDialerEndpoint) { ss.maxConnRetries = retries }
|
||||
}
|
||||
|
||||
// SignerDialerEndpointRetryWaitInterval sets the retry wait interval to a custom value
|
||||
// SignerDialerEndpointRetryWaitInterval sets the retry wait interval to a
|
||||
// custom value.
|
||||
func SignerDialerEndpointRetryWaitInterval(interval time.Duration) SignerServiceEndpointOption {
|
||||
return func(ss *SignerDialerEndpoint) { ss.retryWait = interval }
|
||||
}
|
||||
|
||||
// SignerDialerEndpoint dials using its dialer and responds to any
|
||||
// signature requests using its privVal.
|
||||
// SignerDialerEndpoint dials using its dialer and responds to any signature
|
||||
// requests using its privVal.
|
||||
type SignerDialerEndpoint struct {
|
||||
signerEndpoint
|
||||
|
||||
@@ -57,13 +59,13 @@ func NewSignerDialerEndpoint(
|
||||
maxConnRetries: defaultMaxDialRetries,
|
||||
}
|
||||
|
||||
sd.BaseService = *service.NewBaseService(logger, "SignerDialerEndpoint", sd)
|
||||
sd.signerEndpoint.timeoutReadWrite = defaultTimeoutReadWriteSeconds * time.Second
|
||||
|
||||
for _, optionFunc := range options {
|
||||
optionFunc(sd)
|
||||
}
|
||||
|
||||
sd.BaseService = *service.NewBaseService(logger, "SignerDialerEndpoint", sd)
|
||||
sd.signerEndpoint.timeoutReadWrite = defaultTimeoutReadWriteSeconds * time.Second
|
||||
|
||||
return sd
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTimeoutReadWriteSeconds = 3
|
||||
defaultTimeoutReadWriteSeconds = 5
|
||||
)
|
||||
|
||||
type signerEndpoint struct {
|
||||
|
||||
@@ -11,11 +11,22 @@ import (
|
||||
privvalproto "github.com/tendermint/tendermint/proto/tendermint/privval"
|
||||
)
|
||||
|
||||
// SignerValidatorEndpointOption sets an optional parameter on the SocketVal.
|
||||
type SignerValidatorEndpointOption func(*SignerListenerEndpoint)
|
||||
// SignerListenerEndpointOption sets an optional parameter on the SignerListenerEndpoint.
|
||||
type SignerListenerEndpointOption func(*SignerListenerEndpoint)
|
||||
|
||||
// SignerListenerEndpoint listens for an external process to dial in
|
||||
// and keeps the connection alive by dropping and reconnecting
|
||||
// SignerListenerEndpointTimeoutReadWrite sets the read and write timeout for
|
||||
// connections from external signing processes.
|
||||
//
|
||||
// Default: 5s
|
||||
func SignerListenerEndpointTimeoutReadWrite(timeout time.Duration) SignerListenerEndpointOption {
|
||||
return func(sl *SignerListenerEndpoint) { sl.signerEndpoint.timeoutReadWrite = timeout }
|
||||
}
|
||||
|
||||
// SignerListenerEndpoint listens for an external process to dial in and keeps
|
||||
// the connection alive by dropping and reconnecting.
|
||||
//
|
||||
// The process will send pings every ~3s (read/write timeout * 2/3) to keep the
|
||||
// connection alive.
|
||||
type SignerListenerEndpoint struct {
|
||||
signerEndpoint
|
||||
|
||||
@@ -25,6 +36,7 @@ type SignerListenerEndpoint struct {
|
||||
|
||||
timeoutAccept time.Duration
|
||||
pingTimer *time.Ticker
|
||||
pingInterval time.Duration
|
||||
|
||||
instanceMtx tmsync.Mutex // Ensures instance public methods access, i.e. SendRequest
|
||||
}
|
||||
@@ -33,15 +45,21 @@ type SignerListenerEndpoint struct {
|
||||
func NewSignerListenerEndpoint(
|
||||
logger log.Logger,
|
||||
listener net.Listener,
|
||||
options ...SignerListenerEndpointOption,
|
||||
) *SignerListenerEndpoint {
|
||||
sc := &SignerListenerEndpoint{
|
||||
sl := &SignerListenerEndpoint{
|
||||
listener: listener,
|
||||
timeoutAccept: defaultTimeoutAcceptSeconds * time.Second,
|
||||
}
|
||||
|
||||
sc.BaseService = *service.NewBaseService(logger, "SignerListenerEndpoint", sc)
|
||||
sc.signerEndpoint.timeoutReadWrite = defaultTimeoutReadWriteSeconds * time.Second
|
||||
return sc
|
||||
sl.BaseService = *service.NewBaseService(logger, "SignerListenerEndpoint", sl)
|
||||
sl.signerEndpoint.timeoutReadWrite = defaultTimeoutReadWriteSeconds * time.Second
|
||||
|
||||
for _, optionFunc := range options {
|
||||
optionFunc(sl)
|
||||
}
|
||||
|
||||
return sl
|
||||
}
|
||||
|
||||
// OnStart implements service.Service.
|
||||
@@ -49,7 +67,9 @@ func (sl *SignerListenerEndpoint) OnStart() error {
|
||||
sl.connectRequestCh = make(chan struct{})
|
||||
sl.connectionAvailableCh = make(chan net.Conn)
|
||||
|
||||
sl.pingTimer = time.NewTicker(defaultPingPeriodMilliseconds * time.Millisecond)
|
||||
// NOTE: ping timeout must be less than read/write timeout
|
||||
sl.pingInterval = time.Duration(sl.signerEndpoint.timeoutReadWrite.Milliseconds()*2/3) * time.Millisecond
|
||||
sl.pingTimer = time.NewTicker(sl.pingInterval)
|
||||
|
||||
go sl.serviceLoop()
|
||||
go sl.pingLoop()
|
||||
@@ -103,6 +123,9 @@ func (sl *SignerListenerEndpoint) SendRequest(request privvalproto.Message) (*pr
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Reset pingTimer to avoid sending unnecessary pings.
|
||||
sl.pingTimer.Reset(sl.pingInterval)
|
||||
|
||||
return &res, nil
|
||||
}
|
||||
|
||||
@@ -117,6 +140,7 @@ func (sl *SignerListenerEndpoint) ensureConnection(maxWait time.Duration) error
|
||||
}
|
||||
|
||||
// block until connected or timeout
|
||||
sl.Logger.Info("SignerListener: Blocking for connection")
|
||||
sl.triggerConnect()
|
||||
err := sl.WaitConnection(sl.connectionAvailableCh, maxWait)
|
||||
if err != nil {
|
||||
|
||||
@@ -168,7 +168,11 @@ func newSignerListenerEndpoint(logger log.Logger, addr string, timeoutReadWrite
|
||||
listener = tcpLn
|
||||
}
|
||||
|
||||
return NewSignerListenerEndpoint(logger, listener)
|
||||
return NewSignerListenerEndpoint(
|
||||
logger,
|
||||
listener,
|
||||
SignerListenerEndpointTimeoutReadWrite(testTimeoutReadWrite),
|
||||
)
|
||||
}
|
||||
|
||||
func startListenerEndpointAsync(t *testing.T, sle *SignerListenerEndpoint, endpointIsOpenCh chan struct{}) {
|
||||
|
||||
@@ -24,14 +24,17 @@ func DefaultValidationRequestHandler(
|
||||
switch r := req.Sum.(type) {
|
||||
case *privvalproto.Message_PubKeyRequest:
|
||||
if r.PubKeyRequest.GetChainId() != chainID {
|
||||
res = mustWrapMsg(&privvalproto.SignedVoteResponse{
|
||||
Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{
|
||||
res = mustWrapMsg(&privvalproto.PubKeyResponse{
|
||||
PubKey: cryptoproto.PublicKey{}, Error: &privvalproto.RemoteSignerError{
|
||||
Code: 0, Description: "unable to provide pubkey"}})
|
||||
return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.PubKeyRequest.GetChainId(), chainID)
|
||||
}
|
||||
|
||||
var pubKey crypto.PubKey
|
||||
pubKey, err = privVal.GetPubKey()
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
pk, err := cryptoenc.PubKeyToProto(pubKey)
|
||||
if err != nil {
|
||||
return res, err
|
||||
@@ -64,8 +67,8 @@ func DefaultValidationRequestHandler(
|
||||
|
||||
case *privvalproto.Message_SignProposalRequest:
|
||||
if r.SignProposalRequest.GetChainId() != chainID {
|
||||
res = mustWrapMsg(&privvalproto.SignedVoteResponse{
|
||||
Vote: tmproto.Vote{}, Error: &privvalproto.RemoteSignerError{
|
||||
res = mustWrapMsg(&privvalproto.SignedProposalResponse{
|
||||
Proposal: tmproto.Proposal{}, Error: &privvalproto.RemoteSignerError{
|
||||
Code: 0,
|
||||
Description: "unable to sign proposal"}})
|
||||
return res, fmt.Errorf("want chainID: %s, got chainID: %s", r.SignProposalRequest.GetChainId(), chainID)
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
tmnet "github.com/tendermint/tendermint/libs/net"
|
||||
p2pconn "github.com/tendermint/tendermint/p2p/conn"
|
||||
)
|
||||
|
||||
// Socket errors.
|
||||
@@ -28,7 +27,7 @@ func DialTCPFn(addr string, timeoutReadWrite time.Duration, privKey crypto.PrivK
|
||||
err = conn.SetDeadline(deadline)
|
||||
}
|
||||
if err == nil {
|
||||
conn, err = p2pconn.MakeSecretConnection(conn, privKey)
|
||||
conn, err = MakeSecretConnection(conn, privKey)
|
||||
}
|
||||
return conn, err
|
||||
}
|
||||
|
||||
@@ -5,12 +5,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
p2pconn "github.com/tendermint/tendermint/p2p/conn"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTimeoutAcceptSeconds = 3
|
||||
defaultPingPeriodMilliseconds = 100
|
||||
defaultTimeoutAcceptSeconds = 3
|
||||
)
|
||||
|
||||
// timeoutError can be used to check if an error returned from the netp package
|
||||
@@ -77,7 +75,7 @@ func (ln *TCPListener) Accept() (net.Conn, error) {
|
||||
|
||||
// Wrap the conn in our timeout and encryption wrappers
|
||||
timeoutConn := newTimeoutConn(tc, ln.timeoutReadWrite)
|
||||
secretConn, err := p2pconn.MakeSecretConnection(timeoutConn, ln.secretConnKey)
|
||||
secretConn, err := MakeSecretConnection(timeoutConn, ln.secretConnKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ message RequestInfo {
|
||||
string version = 1;
|
||||
uint64 block_version = 2;
|
||||
uint64 p2p_version = 3;
|
||||
string abci_version = 4;
|
||||
}
|
||||
|
||||
message RequestInitChain {
|
||||
@@ -155,6 +156,7 @@ message ResponseFlush {}
|
||||
message ResponseInfo {
|
||||
string data = 1;
|
||||
|
||||
// this is the software version of the application. TODO: remove?
|
||||
string version = 2;
|
||||
uint64 app_version = 3;
|
||||
|
||||
|
||||
@@ -661,6 +661,61 @@ func (*Message) XXX_OneofWrappers() []interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
// AuthSigMessage is duplicated from p2p prior to the P2P refactor.
|
||||
// It is used for the SecretConnection until we migrate privval to gRPC.
|
||||
// https://github.com/tendermint/tendermint/issues/4698
|
||||
type AuthSigMessage struct {
|
||||
PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
|
||||
Sig []byte `protobuf:"bytes,2,opt,name=sig,proto3" json:"sig,omitempty"`
|
||||
}
|
||||
|
||||
func (m *AuthSigMessage) Reset() { *m = AuthSigMessage{} }
|
||||
func (m *AuthSigMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*AuthSigMessage) ProtoMessage() {}
|
||||
func (*AuthSigMessage) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_cb4e437a5328cf9c, []int{10}
|
||||
}
|
||||
func (m *AuthSigMessage) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *AuthSigMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_AuthSigMessage.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *AuthSigMessage) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_AuthSigMessage.Merge(m, src)
|
||||
}
|
||||
func (m *AuthSigMessage) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *AuthSigMessage) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_AuthSigMessage.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_AuthSigMessage proto.InternalMessageInfo
|
||||
|
||||
func (m *AuthSigMessage) GetPubKey() crypto.PublicKey {
|
||||
if m != nil {
|
||||
return m.PubKey
|
||||
}
|
||||
return crypto.PublicKey{}
|
||||
}
|
||||
|
||||
func (m *AuthSigMessage) GetSig() []byte {
|
||||
if m != nil {
|
||||
return m.Sig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("tendermint.privval.Errors", Errors_name, Errors_value)
|
||||
proto.RegisterType((*RemoteSignerError)(nil), "tendermint.privval.RemoteSignerError")
|
||||
@@ -673,59 +728,62 @@ func init() {
|
||||
proto.RegisterType((*PingRequest)(nil), "tendermint.privval.PingRequest")
|
||||
proto.RegisterType((*PingResponse)(nil), "tendermint.privval.PingResponse")
|
||||
proto.RegisterType((*Message)(nil), "tendermint.privval.Message")
|
||||
proto.RegisterType((*AuthSigMessage)(nil), "tendermint.privval.AuthSigMessage")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("tendermint/privval/types.proto", fileDescriptor_cb4e437a5328cf9c) }
|
||||
|
||||
var fileDescriptor_cb4e437a5328cf9c = []byte{
|
||||
// 750 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00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x12, 0xd2, 0x03, 0x04, 0x42, 0x7e, 0x84, 0x33, 0xe4, 0x66, 0xcb, 0x1f, 0x8f, 0x67, 0x51, 0xc2,
|
||||
0xeb, 0x6c, 0x7a, 0x70, 0x0f, 0x60, 0x89, 0x9a, 0x96, 0xe1, 0xab, 0x8f, 0x72, 0xec, 0xad, 0xa9,
|
||||
0x37, 0x38, 0x4c, 0x59, 0x51, 0xc2, 0x31, 0x3a, 0x5c, 0xa2, 0x77, 0x10, 0x17, 0x28, 0x42, 0xe2,
|
||||
0x02, 0x87, 0xc9, 0xcc, 0x86, 0xf1, 0x85, 0x2d, 0xd1, 0xc0, 0x7a, 0x2f, 0x0c, 0xf3, 0xac, 0xdb,
|
||||
0xc9, 0xfd, 0x90, 0x21, 0xc2, 0x43, 0xce, 0x10, 0x82, 0x84, 0x8a, 0x71, 0x05, 0xd7, 0xf4, 0x23,
|
||||
0xad, 0xac, 0x55, 0x8e, 0xb5, 0xa4, 0x84, 0x14, 0x48, 0xfb, 0x35, 0xf5, 0xa4, 0xaa, 0xee, 0xd7,
|
||||
0xd5, 0x03, 0x1d, 0xab, 0xb5, 0x6a, 0x45, 0xab, 0xa9, 0x49, 0x19, 0xa5, 0x60, 0x4d, 0xf4, 0xb5,
|
||||
0x8a, 0xbe, 0x5f, 0xd1, 0x34, 0x75, 0xbf, 0x5e, 0xaa, 0x68, 0xc9, 0x39, 0xf4, 0x08, 0x36, 0x44,
|
||||
0x67, 0x58, 0xd6, 0xeb, 0xa5, 0x43, 0xb5, 0x72, 0x54, 0x4f, 0xce, 0xa3, 0x87, 0xb0, 0x2a, 0xda,
|
||||
0x58, 0x7d, 0x7b, 0xe0, 0x37, 0x42, 0x01, 0xc4, 0x63, 0x5c, 0xaa, 0xab, 0x7e, 0x27, 0xbc, 0x57,
|
||||
0xbb, 0xba, 0x51, 0xe4, 0xeb, 0x1b, 0x45, 0xfe, 0x73, 0xa3, 0xc8, 0xdf, 0x6e, 0x15, 0xe9, 0xfa,
|
||||
0x56, 0x91, 0x7e, 0xdd, 0x2a, 0xd2, 0xe9, 0x6b, 0xc3, 0x74, 0xcf, 0xba, 0xcd, 0x7c, 0xcb, 0xee,
|
||||
0x14, 0x82, 0x6f, 0x57, 0xf0, 0x61, 0xec, 0xbf, 0x57, 0x93, 0x2f, 0x65, 0x33, 0xc2, 0x3b, 0x2f,
|
||||
0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x2a, 0xe5, 0x4a, 0x46, 0x07, 0x00, 0x00,
|
||||
// 779 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x4f, 0xdb, 0x4a,
|
||||
0x14, 0xb6, 0xc9, 0x0b, 0x4e, 0x1e, 0x84, 0x81, 0xcb, 0x0d, 0x11, 0xd7, 0xe4, 0xfa, 0xea, 0xb6,
|
||||
0x28, 0x8b, 0xa4, 0xa2, 0x52, 0xa5, 0x8a, 0x6e, 0x78, 0x58, 0x4d, 0x14, 0xe1, 0xa4, 0x93, 0x50,
|
||||
0x10, 0x52, 0x65, 0xe5, 0x31, 0x75, 0x2c, 0x88, 0xed, 0x7a, 0x1c, 0xa4, 0xac, 0xbb, 0xeb, 0xaa,
|
||||
0x52, 0xff, 0x44, 0xd7, 0xfd, 0x15, 0x2c, 0x59, 0x76, 0x55, 0x55, 0xf0, 0x47, 0xaa, 0x8c, 0x27,
|
||||
0x8e, 0xf3, 0x42, 0xad, 0xd8, 0xcd, 0x9c, 0x73, 0xe6, 0x3b, 0xdf, 0x37, 0xf3, 0xd9, 0x07, 0x24,
|
||||
0x97, 0x98, 0x1d, 0xe2, 0xf4, 0x0c, 0xd3, 0x2d, 0xda, 0x8e, 0x71, 0x7d, 0xdd, 0xbc, 0x2a, 0xba,
|
||||
0x03, 0x9b, 0xd0, 0x82, 0xed, 0x58, 0xae, 0x85, 0xd0, 0x38, 0x5f, 0xe0, 0xf9, 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63, 0xca, 0x79, 0x4d, 0x39, 0x6a, 0x28, 0xc7, 0x1a,
|
||||
0x56, 0xea, 0xb5, 0xaa, 0x5a, 0x57, 0xd2, 0x22, 0xca, 0xc0, 0x06, 0xcf, 0xab, 0x55, 0xed, 0xa8,
|
||||
0xaa, 0xaa, 0xca, 0x51, 0xa3, 0x5c, 0x55, 0xd3, 0x4b, 0xe8, 0x1f, 0xd8, 0xe2, 0x99, 0x71, 0x58,
|
||||
0x6b, 0x94, 0x4f, 0x94, 0xea, 0x69, 0x23, 0x1d, 0x42, 0x7f, 0xc3, 0x3a, 0x4f, 0x63, 0xe5, 0xe0,
|
||||
0xd8, 0x4f, 0x84, 0x03, 0x88, 0x67, 0xb8, 0xdc, 0x50, 0xfc, 0x4c, 0xe4, 0xb0, 0x7e, 0x73, 0x27,
|
||||
0x89, 0xb7, 0x77, 0x92, 0xf8, 0xf3, 0x4e, 0x12, 0x3f, 0xdf, 0x4b, 0xc2, 0xed, 0xbd, 0x24, 0x7c,
|
||||
0xbf, 0x97, 0x84, 0x8b, 0x97, 0xba, 0xe1, 0x76, 0xfb, 0xad, 0x42, 0xdb, 0xea, 0x15, 0x83, 0xc3,
|
||||
0x31, 0x38, 0x79, 0x87, 0x03, 0x71, 0x76, 0x14, 0xb7, 0xa2, 0x2c, 0xf3, 0xfc, 0x57, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0x46, 0x64, 0xeb, 0xa4, 0xa7, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *RemoteSignerError) Marshal() (dAtA []byte, err error) {
|
||||
@@ -1258,6 +1316,46 @@ func (m *Message_PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
func (m *AuthSigMessage) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *AuthSigMessage) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *AuthSigMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Sig) > 0 {
|
||||
i -= len(m.Sig)
|
||||
copy(dAtA[i:], m.Sig)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Sig)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
{
|
||||
size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTypes(v)
|
||||
base := offset
|
||||
@@ -1503,6 +1601,20 @@ func (m *Message_PingResponse) Size() (n int) {
|
||||
}
|
||||
return n
|
||||
}
|
||||
func (m *AuthSigMessage) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = m.PubKey.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
l = len(m.Sig)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTypes(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
@@ -2746,6 +2858,126 @@ func (m *Message) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *AuthSigMessage) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: AuthSigMessage: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: AuthSigMessage: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Sig", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Sig = append(m.Sig[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Sig == nil {
|
||||
m.Sig = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTypes(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user