From 61f3aa0848aad0b303a90a638401172df1da930f Mon Sep 17 00:00:00 2001 From: William Banfield <4561443+williambanfield@users.noreply.github.com> Date: Wed, 26 Jan 2022 14:50:31 -0500 Subject: [PATCH 1/7] consensus: use buffered channel in TestStateFullRound1 (#7668) --- internal/consensus/common_test.go | 3 ++- internal/consensus/state_test.go | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index b7b5e2a8c..e2f11b566 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -594,7 +594,7 @@ func ensureNewTimeout(t *testing.T, timeoutCh <-chan tmpubsub.Message, height in ensureNewEvent(t, timeoutCh, height, round, timeoutDuration) } -func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height int64, round int32) { +func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height int64, round int32) types.BlockID { t.Helper() msg := ensureMessageBeforeTimeout(t, proposalCh, ensureTimeout) proposalEvent, ok := msg.Data().(types.EventDataCompleteProposal) @@ -602,6 +602,7 @@ func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height msg.Data()) require.Equal(t, height, proposalEvent.Height) require.Equal(t, round, proposalEvent.Round) + return proposalEvent.BlockID } func ensureNewValidBlock(t *testing.T, validBlockCh <-chan tmpubsub.Message, height int64, round int32) { diff --git a/internal/consensus/state_test.go b/internal/consensus/state_test.go index 10adbccaa..c35a3cc6a 100644 --- a/internal/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -343,9 +343,7 @@ func TestStateFullRound1(t *testing.T) { cs, vss := makeState(ctx, t, config, logger, 1) height, round := cs.Height, cs.Round - pv, err := cs.privValidator.GetPubKey(ctx) - require.NoError(t, err) - voteCh := subscribeToVoter(ctx, t, cs, pv.Address()) + voteCh := subscribe(ctx, t, cs.eventBus, types.EventQueryVote) propCh := subscribe(ctx, t, cs.eventBus, types.EventQueryCompleteProposal) newRoundCh := subscribe(ctx, t, cs.eventBus, types.EventQueryNewRound) @@ -354,17 +352,16 @@ func TestStateFullRound1(t *testing.T) { ensureNewRound(t, newRoundCh, height, round) - ensureNewProposal(t, propCh, height, round) - propBlockHash := cs.GetRoundState().ProposalBlock.Hash() + propBlock := ensureNewProposal(t, propCh, height, round) - ensurePrevoteMatch(t, voteCh, height, round, propBlockHash) // wait for prevote + ensurePrevoteMatch(t, voteCh, height, round, propBlock.Hash) // wait for prevote ensurePrecommit(t, voteCh, height, round) // wait for precommit // we're going to roll right into new height ensureNewRound(t, newRoundCh, height+1, 0) - validateLastPrecommit(ctx, t, cs, vss[0], propBlockHash) + validateLastPrecommit(ctx, t, cs, vss[0], propBlock.Hash) } // nil is proposed, so prevote and precommit nil From 09c41dc06df766a0566a6d4c519cbb649d136d11 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Wed, 26 Jan 2022 11:57:44 -0800 Subject: [PATCH 2/7] Pin super-linter to a less noisy version. (#7706) The latest point release includes https://github.com/github/super-linter/pull/2295 which enables a bunch of checks that break existing use. --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a652faf67..00fa7964e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,7 +21,7 @@ jobs: - name: Checkout Code uses: actions/checkout@v2.4.0 - name: Lint Code Base - uses: docker://github/super-linter:v4 + uses: docker://github/super-linter:v4.8.5 env: LINTER_RULES_PATH: . VALIDATE_ALL_CODEBASE: true From b37c10c32484d1797234e4fee415be6a4b75decd Mon Sep 17 00:00:00 2001 From: William Banfield <4561443+williambanfield@users.noreply.github.com> Date: Wed, 26 Jan 2022 15:29:54 -0500 Subject: [PATCH 3/7] params: increase default synchrony params (#7704) --- types/params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/params.go b/types/params.go index 3540805cc..eaa91195f 100644 --- a/types/params.go +++ b/types/params.go @@ -132,7 +132,7 @@ func DefaultSynchronyParams() SynchronyParams { // https://github.com/tendermint/tendermint/issues/7202 return SynchronyParams{ Precision: 500 * time.Millisecond, - MessageDelay: 2 * time.Second, + MessageDelay: 3 * time.Second, } } From 1ac58469f32a98f1c0e2905ca1773d9eac7b7103 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Wed, 26 Jan 2022 12:40:23 -0800 Subject: [PATCH 4/7] Forward-port v0.35.1 changelogs. (#7705) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31349a7cc..e0a612670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,41 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/cosmos). +## v0.35.1 + +January 26, 2022 + +Special thanks to external contributors on this release: @altergui, @odeke-em, +@thanethomson + +### BREAKING CHANGES + +- CLI/RPC/Config + + - [config] [\#7276](https://github.com/tendermint/tendermint/pull/7276) rpc: Add experimental config params to allow for subscription buffer size control (@thanethomson). + +- P2P Protocol + + - [p2p] [\#7265](https://github.com/tendermint/tendermint/pull/7265) Peer manager reduces peer score for each failed dial attempts for peers that have not successfully dialed. (@tychoish) + - [p2p] [\#7594](https://github.com/tendermint/tendermint/pull/7594) always advertise self, to enable mutual address discovery. (@altergui) + +### FEATURES + +- [rpc] [\#7270](https://github.com/tendermint/tendermint/pull/7270) Add `header` and `header_by_hash` RPC Client queries. (@fedekunze) (@cmwaters) + +### IMPROVEMENTS + +- [internal/protoio] [\#7325](https://github.com/tendermint/tendermint/pull/7325) Optimized `MarshalDelimited` by inlining the common case and using a `sync.Pool` in the worst case. (@odeke-em) +- [\#7338](https://github.com/tendermint/tendermint/pull/7338) pubsub: Performance improvements for the event query API (backport of #7319) (@creachadair) +- [\#7252](https://github.com/tendermint/tendermint/pull/7252) Add basic metrics to the indexer package. (@creachadair) +- [\#7338](https://github.com/tendermint/tendermint/pull/7338) Performance improvements for the event query API. (@creachadair) + +### BUG FIXES + +- [\#7310](https://github.com/tendermint/tendermint/issues/7310) pubsub: Report a non-nil error when shutting down (fixes #7306). +- [\#7355](https://github.com/tendermint/tendermint/pull/7355) Fix incorrect tests using the PSQL sink. (@creachadair) +- [\#7683](https://github.com/tendermint/tendermint/pull/7683) rpc: check error code for broadcast_tx_commit. (@tychoish) + ## v0.35.0 November 4, 2021 From 5eb50a43b5ee6afb502317113cfaed83925c87f8 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Thu, 27 Jan 2022 05:33:11 -0800 Subject: [PATCH 5/7] ci: fix super-linter configuration settings (#7708) - Revert the version pin from #7706. - Override the YAML linter config to be more forgiving. - Update YAML lint warnings in a number of files. The choice of which lints to fix and which to override was ad hoc: I fixed the ones that were mainly whitespace oriented, and suppressed the ones that were document-structure related. Fixes #7707. --- .github/auto-comment.yml | 20 +++++++++---------- .github/linter/markdownlint.yml | 8 -------- .github/linters/markdownlint.yml | 8 ++++++++ .github/linters/yaml-lint.yml | 9 +++++++++ .github/workflows/docker.yml | 6 +++--- .github/workflows/e2e-nightly-34x.yml | 4 ++-- .github/workflows/e2e-nightly-35x.yml | 4 ++-- .github/workflows/e2e-nightly-master.yml | 4 ++-- .github/workflows/e2e.yml | 3 +-- .github/workflows/fuzz-nightly.yml | 2 +- .github/workflows/linkchecker.yml | 2 +- .github/workflows/linter.yml | 4 ++-- .github/workflows/release.yml | 2 +- .goreleaser.yml | 10 +++++----- docker-compose.yml | 4 ++-- networks/remote/ansible/config.yml | 7 ++----- networks/remote/ansible/install.yml | 2 -- networks/remote/ansible/logzio.yml | 5 +---- networks/remote/ansible/reset.yml | 3 --- networks/remote/ansible/restart.yml | 2 -- .../ansible/roles/config/tasks/main.yml | 4 +--- .../ansible/roles/install/handlers/main.yml | 2 -- .../ansible/roles/install/tasks/main.yml | 2 -- .../ansible/roles/logzio/handlers/main.yml | 2 -- .../ansible/roles/logzio/tasks/main.yml | 2 -- .../remote/ansible/roles/start/tasks/main.yml | 2 -- .../ansible/roles/status/tasks/main.yml | 2 -- .../remote/ansible/roles/stop/tasks/main.yml | 2 -- .../ansible/roles/unsafe_reset/tasks/main.yml | 1 - networks/remote/ansible/start.yml | 2 -- networks/remote/ansible/status.yml | 2 -- networks/remote/ansible/stop.yml | 2 -- 32 files changed, 53 insertions(+), 81 deletions(-) delete mode 100644 .github/linter/markdownlint.yml create mode 100644 .github/linters/markdownlint.yml create mode 100644 .github/linters/yaml-lint.yml diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index 604c2f878..9a85bc9b7 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -1,16 +1,16 @@ pullRequestOpened: | - :wave: Thanks for creating a PR! + :wave: Thanks for creating a PR! - Before we can merge this PR, please make sure that all the following items have been + Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but - write a little note why. + write a little note why. - - [ ] Wrote tests - - [ ] Updated CHANGELOG_PENDING.md - - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - - [ ] Updated relevant documentation (`docs/`) and code comments - - [ ] Re-reviewed `Files changed` in the Github PR explorer - - [ ] Applied Appropriate Labels + - [ ] Wrote tests + - [ ] Updated CHANGELOG_PENDING.md + - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. + - [ ] Updated relevant documentation (`docs/`) and code comments + - [ ] Re-reviewed `Files changed` in the Github PR explorer + - [ ] Applied Appropriate Labels - Thank you for your contribution to Tendermint! :rocket: \ No newline at end of file + Thank you for your contribution to Tendermint! :rocket: diff --git a/.github/linter/markdownlint.yml b/.github/linter/markdownlint.yml deleted file mode 100644 index 1637001cc..000000000 --- a/.github/linter/markdownlint.yml +++ /dev/null @@ -1,8 +0,0 @@ -default: true, -MD007: { "indent": 4 } -MD013: false -MD024: { siblings_only: true } -MD025: false -MD033: { no-inline-html: false } -no-hard-tabs: false -whitespace: false diff --git a/.github/linters/markdownlint.yml b/.github/linters/markdownlint.yml new file mode 100644 index 000000000..6a4f61a49 --- /dev/null +++ b/.github/linters/markdownlint.yml @@ -0,0 +1,8 @@ +default: true, +MD007: {"indent": 4} +MD013: false +MD024: {siblings_only: true} +MD025: false +MD033: {no-inline-html: false} +no-hard-tabs: false +whitespace: false diff --git a/.github/linters/yaml-lint.yml b/.github/linters/yaml-lint.yml new file mode 100644 index 000000000..e6fd77d11 --- /dev/null +++ b/.github/linters/yaml-lint.yml @@ -0,0 +1,9 @@ +--- +# Default rules for YAML linting from super-linter. +# See: See https://yamllint.readthedocs.io/en/stable/rules.html +extends: default +rules: + document-end: disable + document-start: disable + line-length: disable + truthy: disable diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6ebddbb50..b42a14404 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,13 +1,13 @@ name: Docker -# Build & Push rebuilds the tendermint docker image on every push to master and creation of tags +# 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: push: branches: - master tags: - - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 - - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 jobs: build: diff --git a/.github/workflows/e2e-nightly-34x.yml b/.github/workflows/e2e-nightly-34x.yml index 910d9bc2c..2a3f0015f 100644 --- a/.github/workflows/e2e-nightly-34x.yml +++ b/.github/workflows/e2e-nightly-34x.yml @@ -6,7 +6,7 @@ name: e2e-nightly-34x on: - workflow_dispatch: # allow running workflow manually, in theory + workflow_dispatch: # allow running workflow manually, in theory schedule: - cron: '0 2 * * *' @@ -59,7 +59,7 @@ jobs: SLACK_MESSAGE: Nightly E2E tests failed on v0.34.x SLACK_FOOTER: '' - e2e-nightly-success: # may turn this off once they seem to pass consistently + e2e-nightly-success: # may turn this off once they seem to pass consistently needs: e2e-nightly-test if: ${{ success() }} runs-on: ubuntu-latest diff --git a/.github/workflows/e2e-nightly-35x.yml b/.github/workflows/e2e-nightly-35x.yml index df4dfb039..13e3f8020 100644 --- a/.github/workflows/e2e-nightly-35x.yml +++ b/.github/workflows/e2e-nightly-35x.yml @@ -5,7 +5,7 @@ name: e2e-nightly-35x on: - workflow_dispatch: # allow running workflow manually + workflow_dispatch: # allow running workflow manually schedule: - cron: '0 2 * * *' @@ -59,7 +59,7 @@ jobs: SLACK_MESSAGE: Nightly E2E tests failed on v0.35.x SLACK_FOOTER: '' - e2e-nightly-success: # may turn this off once they seem to pass consistently + e2e-nightly-success: # may turn this off once they seem to pass consistently needs: e2e-nightly-test if: ${{ success() }} runs-on: ubuntu-latest diff --git a/.github/workflows/e2e-nightly-master.yml b/.github/workflows/e2e-nightly-master.yml index 8d55eb6ad..3602cd832 100644 --- a/.github/workflows/e2e-nightly-master.yml +++ b/.github/workflows/e2e-nightly-master.yml @@ -5,7 +5,7 @@ name: e2e-nightly-master on: - workflow_dispatch: # allow running workflow manually + workflow_dispatch: # allow running workflow manually schedule: - cron: '0 2 * * *' @@ -56,7 +56,7 @@ jobs: SLACK_MESSAGE: Nightly E2E tests failed on master SLACK_FOOTER: '' - e2e-nightly-success: # may turn this off once they seem to pass consistently + e2e-nightly-success: # may turn this off once they seem to pass consistently needs: e2e-nightly-test if: ${{ success() }} runs-on: ubuntu-latest diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fced46601..71aec16f7 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,7 +2,7 @@ name: e2e # Runs the CI end-to-end test network on all pushes to master or release branches # and every pull request, but only if any Go files have been changed. on: - workflow_dispatch: # allow running workflow manually + workflow_dispatch: # allow running workflow manually pull_request: push: branches: @@ -35,4 +35,3 @@ jobs: working-directory: test/e2e run: ./run-multiple.sh networks/ci.toml if: "env.GIT_DIFF != ''" - diff --git a/.github/workflows/fuzz-nightly.yml b/.github/workflows/fuzz-nightly.yml index e1167e2c8..e12ee2321 100644 --- a/.github/workflows/fuzz-nightly.yml +++ b/.github/workflows/fuzz-nightly.yml @@ -1,7 +1,7 @@ # Runs fuzzing nightly. name: Fuzz Tests on: - workflow_dispatch: # allow running workflow manually + workflow_dispatch: # allow running workflow manually schedule: - cron: '0 3 * * *' pull_request: diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 1a6380026..af446771a 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -1,5 +1,5 @@ name: Check Markdown links -on: +on: schedule: - cron: '* */24 * * *' jobs: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 00fa7964e..628b1af69 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,12 +21,12 @@ jobs: - name: Checkout Code uses: actions/checkout@v2.4.0 - name: Lint Code Base - uses: docker://github/super-linter:v4.8.5 + uses: docker://github/super-linter:v4 env: - LINTER_RULES_PATH: . VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_MD: true VALIDATE_OPENAPI: true VALIDATE_YAML: true + YAML_CONFIG_FILE: yaml-lint.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54a6c010a..3d65b289b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: branches: - "RC[0-9]/**" tags: - - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: goreleaser: diff --git a/.goreleaser.yml b/.goreleaser.yml index 267d4e4ac..28c6a017d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -29,8 +29,8 @@ release: archives: - files: - - LICENSE - - README.md - - UPGRADING.md - - SECURITY.md - - CHANGELOG.md + - LICENSE + - README.md + - UPGRADING.md + - SECURITY.md + - CHANGELOG.md diff --git a/docker-compose.yml b/docker-compose.yml index 76d89a53c..157b7c381 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,5 +65,5 @@ networks: ipam: driver: default config: - - - subnet: 192.167.10.0/16 \ No newline at end of file + - + subnet: 192.167.10.0/16 diff --git a/networks/remote/ansible/config.yml b/networks/remote/ansible/config.yml index 7b772fb70..43f08c979 100644 --- a/networks/remote/ansible/config.yml +++ b/networks/remote/ansible/config.yml @@ -1,8 +1,6 @@ --- - -#Requires BINARY and CONFIGDIR variables set. -#N=4 hosts by default. - +# Requires BINARY and CONFIGDIR variables set. +# N=4 hosts by default. - hosts: all user: root any_errors_fatal: true @@ -15,4 +13,3 @@ - config - unsafe_reset - start - diff --git a/networks/remote/ansible/install.yml b/networks/remote/ansible/install.yml index a57b4be44..9920fba15 100644 --- a/networks/remote/ansible/install.yml +++ b/networks/remote/ansible/install.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -8,4 +7,3 @@ - service: tendermint roles: - install - diff --git a/networks/remote/ansible/logzio.yml b/networks/remote/ansible/logzio.yml index 53f637f2f..4636df5fb 100644 --- a/networks/remote/ansible/logzio.yml +++ b/networks/remote/ansible/logzio.yml @@ -1,7 +1,5 @@ --- - -#Note: You need to add LOGZIO_TOKEN variable with your API key. Like tihs: ansible-playbook -e LOGZIO_TOKEN=ABCXYZ123456 - +# Note: You need to add LOGZIO_TOKEN variable with your API key. Like tihs: ansible-playbook -e LOGZIO_TOKEN=ABCXYZ123456 - hosts: all user: root any_errors_fatal: true @@ -11,4 +9,3 @@ - JOURNALBEAT_BINARY: "{{lookup('env', 'GOPATH')}}/bin/journalbeat" roles: - logzio - diff --git a/networks/remote/ansible/reset.yml b/networks/remote/ansible/reset.yml index 63b1733c7..76a27db2f 100644 --- a/networks/remote/ansible/reset.yml +++ b/networks/remote/ansible/reset.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -10,5 +9,3 @@ - stop - unsafe_reset - start - - diff --git a/networks/remote/ansible/restart.yml b/networks/remote/ansible/restart.yml index 71d4bc66d..540d8c690 100644 --- a/networks/remote/ansible/restart.yml +++ b/networks/remote/ansible/restart.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -9,4 +8,3 @@ roles: - stop - start - diff --git a/networks/remote/ansible/roles/config/tasks/main.yml b/networks/remote/ansible/roles/config/tasks/main.yml index a51098caa..aac02a7e5 100644 --- a/networks/remote/ansible/roles/config/tasks/main.yml +++ b/networks/remote/ansible/roles/config/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Copy binary copy: src: "{{BINARY}}" @@ -13,5 +12,4 @@ dest: "/home/{{service}}/.{{service}}/" owner: "{{service}}" group: "{{service}}" - loop: [ 0, 1, 2, 3, 4, 5, 6, 7 ] - + loop: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/networks/remote/ansible/roles/install/handlers/main.yml b/networks/remote/ansible/roles/install/handlers/main.yml index 16afbb618..ab39f51ee 100644 --- a/networks/remote/ansible/roles/install/handlers/main.yml +++ b/networks/remote/ansible/roles/install/handlers/main.yml @@ -1,5 +1,3 @@ --- - - name: reload services systemd: "name={{service}} daemon_reload=yes enabled=yes" - diff --git a/networks/remote/ansible/roles/install/tasks/main.yml b/networks/remote/ansible/roles/install/tasks/main.yml index 9e5a7524a..effc3fb9f 100644 --- a/networks/remote/ansible/roles/install/tasks/main.yml +++ b/networks/remote/ansible/roles/install/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Create service group group: "name={{service}}" @@ -12,4 +11,3 @@ - name: Create service template: "src=systemd.service.j2 dest=/etc/systemd/system/{{service}}.service" notify: reload services - diff --git a/networks/remote/ansible/roles/logzio/handlers/main.yml b/networks/remote/ansible/roles/logzio/handlers/main.yml index 0b371fc51..ad668d629 100644 --- a/networks/remote/ansible/roles/logzio/handlers/main.yml +++ b/networks/remote/ansible/roles/logzio/handlers/main.yml @@ -1,8 +1,6 @@ --- - - name: reload daemon command: "systemctl daemon-reload" - name: restart journalbeat service: name=journalbeat state=restarted - diff --git a/networks/remote/ansible/roles/logzio/tasks/main.yml b/networks/remote/ansible/roles/logzio/tasks/main.yml index ab3976f22..580c81e8a 100644 --- a/networks/remote/ansible/roles/logzio/tasks/main.yml +++ b/networks/remote/ansible/roles/logzio/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: Copy journalbeat binary copy: src="{{JOURNALBEAT_BINARY}}" dest=/usr/bin/journalbeat mode=0755 notify: restart journalbeat @@ -24,4 +23,3 @@ notify: - reload daemon - restart journalbeat - diff --git a/networks/remote/ansible/roles/start/tasks/main.yml b/networks/remote/ansible/roles/start/tasks/main.yml index 6bc611c91..0d19efc7a 100644 --- a/networks/remote/ansible/roles/start/tasks/main.yml +++ b/networks/remote/ansible/roles/start/tasks/main.yml @@ -1,5 +1,3 @@ --- - - name: start service service: "name={{service}} state=started" - diff --git a/networks/remote/ansible/roles/status/tasks/main.yml b/networks/remote/ansible/roles/status/tasks/main.yml index 50170c746..1bd4039ea 100644 --- a/networks/remote/ansible/roles/status/tasks/main.yml +++ b/networks/remote/ansible/roles/status/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: application service status command: "service {{service}} status" changed_when: false @@ -7,4 +6,3 @@ - name: Result debug: var=status.stdout_lines - diff --git a/networks/remote/ansible/roles/stop/tasks/main.yml b/networks/remote/ansible/roles/stop/tasks/main.yml index 7db356f22..0bbcfbaac 100644 --- a/networks/remote/ansible/roles/stop/tasks/main.yml +++ b/networks/remote/ansible/roles/stop/tasks/main.yml @@ -1,5 +1,3 @@ --- - - name: stop service service: "name={{service}} state=stopped" - diff --git a/networks/remote/ansible/roles/unsafe_reset/tasks/main.yml b/networks/remote/ansible/roles/unsafe_reset/tasks/main.yml index 6ac1ec55a..59ae68d17 100644 --- a/networks/remote/ansible/roles/unsafe_reset/tasks/main.yml +++ b/networks/remote/ansible/roles/unsafe_reset/tasks/main.yml @@ -1,4 +1,3 @@ - command: "{{service}} unsafe_reset_all {{ (service != 'tendermint') | ternary('node','') }} --home /home/{{service}}/.{{service}}" become_user: "{{service}}" become: yes - diff --git a/networks/remote/ansible/start.yml b/networks/remote/ansible/start.yml index 2be07dc73..ceb72e63c 100644 --- a/networks/remote/ansible/start.yml +++ b/networks/remote/ansible/start.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -8,4 +7,3 @@ - service: tendermint roles: - start - diff --git a/networks/remote/ansible/status.yml b/networks/remote/ansible/status.yml index a1721b87b..ff01d227c 100644 --- a/networks/remote/ansible/status.yml +++ b/networks/remote/ansible/status.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -8,4 +7,3 @@ - service: tendermint roles: - status - diff --git a/networks/remote/ansible/stop.yml b/networks/remote/ansible/stop.yml index abc6031d5..d269f8d9b 100644 --- a/networks/remote/ansible/stop.yml +++ b/networks/remote/ansible/stop.yml @@ -1,5 +1,4 @@ --- - - hosts: all user: root any_errors_fatal: true @@ -8,4 +7,3 @@ - service: tendermint roles: - stop - From 04bcfecce2f30a442eae7e4fe56938bc8344547e Mon Sep 17 00:00:00 2001 From: William Banfield <4561443+williambanfield@users.noreply.github.com> Date: Thu, 27 Jan 2022 09:42:56 -0500 Subject: [PATCH 6/7] metrics: add metric for proposal timestamp difference (#7709) Moving this over from the proposer-based timestamps branch #7550. --- internal/consensus/metrics.go | 33 ++++++++++++++++++++++++--------- internal/consensus/state.go | 14 ++++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/internal/consensus/metrics.go b/internal/consensus/metrics.go index dbefb9a5b..b10cebdb5 100644 --- a/internal/consensus/metrics.go +++ b/internal/consensus/metrics.go @@ -80,6 +80,11 @@ type Metrics struct { // timestamp and the timestamp of the latest prevote in a round where 100% // of the voting power on the network issued prevotes. FullPrevoteMessageDelay metrics.Gauge + + // ProposalTimestampDifference is the difference between the timestamp in + // the proposal message and the local time of the validator at the time + // that the validator received the message. + ProposalTimestampDifference metrics.Histogram } // PrometheusMetrics returns Metrics build using Prometheus client library. @@ -226,6 +231,15 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Help: "Difference in seconds between the proposal timestamp and the timestamp " + "of the latest prevote that achieved 100% of the voting power in the prevote step.", }, labels).With(labelsAndValues...), + ProposalTimestampDifference: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{ + Namespace: namespace, + Subsystem: MetricsSubsystem, + Name: "proposal_timestamp_difference", + Help: "Difference in seconds between the timestamp in the proposal " + + "message and the local time when the message was received. " + + "Only calculated when a new block is proposed.", + Buckets: []float64{-10, -.5, -.025, 0, .1, .5, 1, 1.5, 2, 10}, + }, append(labels, "is_timely")).With(labelsAndValues...), } } @@ -249,15 +263,16 @@ func NopMetrics() *Metrics { BlockIntervalSeconds: discard.NewHistogram(), - NumTxs: discard.NewGauge(), - BlockSizeBytes: discard.NewHistogram(), - TotalTxs: discard.NewGauge(), - CommittedHeight: discard.NewGauge(), - BlockSyncing: discard.NewGauge(), - StateSyncing: discard.NewGauge(), - BlockParts: discard.NewCounter(), - QuorumPrevoteMessageDelay: discard.NewGauge(), - FullPrevoteMessageDelay: discard.NewGauge(), + NumTxs: discard.NewGauge(), + BlockSizeBytes: discard.NewHistogram(), + TotalTxs: discard.NewGauge(), + CommittedHeight: discard.NewGauge(), + BlockSyncing: discard.NewGauge(), + StateSyncing: discard.NewGauge(), + BlockParts: discard.NewCounter(), + QuorumPrevoteMessageDelay: discard.NewGauge(), + FullPrevoteMessageDelay: discard.NewGauge(), + ProposalTimestampDifference: discard.NewHistogram(), } } diff --git a/internal/consensus/state.go b/internal/consensus/state.go index f4b4edf8e..f4af758df 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -2017,6 +2017,7 @@ func (cs *State) defaultSetProposal(proposal *types.Proposal, recvTime time.Time proposal.Signature = p.Signature cs.Proposal = proposal cs.ProposalReceiveTime = recvTime + cs.calculateProposalTimestampDifferenceMetric() // We don't update cs.ProposalBlockParts if it is already set. // This happens if we're already in cstypes.RoundStepCommit or if there is a valid block in the current round. // TODO: We can check if Proposal is for a different block as this is a sign of misbehavior! @@ -2562,6 +2563,19 @@ func repairWalFile(src, dst string) error { return nil } +func (cs *State) calculateProposalTimestampDifferenceMetric() { + if cs.Proposal != nil && cs.Proposal.POLRound == -1 { + tp := types.SynchronyParams{ + Precision: cs.state.ConsensusParams.Synchrony.Precision, + MessageDelay: cs.state.ConsensusParams.Synchrony.MessageDelay, + } + + isTimely := cs.Proposal.IsTimely(cs.ProposalReceiveTime, tp, cs.state.InitialHeight) + cs.metrics.ProposalTimestampDifference.With("is_timely", fmt.Sprintf("%t", isTimely)). + Observe(cs.ProposalReceiveTime.Sub(cs.Proposal.Timestamp).Seconds()) + } +} + // proposerWaitTime determines how long the proposer should wait to propose its next block. // If the result is zero, a block can be proposed immediately. // From db3044ff3c6eef4f23d561d425b80969512084e1 Mon Sep 17 00:00:00 2001 From: mempirate Date: Thu, 27 Jan 2022 16:24:01 +0100 Subject: [PATCH 7/7] rpc: add application info to `status` call (#7701) * rpc/coretypes: add `ApplicationInfo` to `ResultStatus` * internal/rpc/core: return application version Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: M. J. Fromberger --- CHANGELOG_PENDING.md | 1 + internal/rpc/core/status.go | 9 ++++++++- rpc/coretypes/responses.go | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 47f26f2c2..922ed09e3 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -47,6 +47,7 @@ Special thanks to external contributors on this release: ### FEATURES - [rpc] [\#7270](https://github.com/tendermint/tendermint/pull/7270) Add `header` and `header_by_hash` RPC Client queries. (@fedekunze) +- [rpc] [\#7701] Add `ApplicationInfo` to `status` rpc call which contains the application version. (@jonasbostoen) - [cli] [#7033](https://github.com/tendermint/tendermint/pull/7033) Add a `rollback` command to rollback to the previous tendermint state in the event of non-determinstic app hash or reverting an upgrade. - [mempool, rpc] \#7041 Add removeTx operation to the RPC layer. (@tychoish) - [consensus] \#7354 add a new `synchrony` field to the `ConsensusParameter` struct for controlling the parameters of the proposer-based timestamp algorithm. (@williambanfield) diff --git a/internal/rpc/core/status.go b/internal/rpc/core/status.go index 44a2b7469..2f648978a 100644 --- a/internal/rpc/core/status.go +++ b/internal/rpc/core/status.go @@ -3,6 +3,7 @@ package core import ( "bytes" "context" + "fmt" "time" tmbytes "github.com/tendermint/tendermint/libs/bytes" @@ -59,8 +60,14 @@ func (env *Environment) Status(ctx context.Context) (*coretypes.ResultStatus, er } } + var applicationInfo coretypes.ApplicationInfo + if abciInfo, err := env.ABCIInfo(ctx); err == nil { + applicationInfo.Version = fmt.Sprint(abciInfo.Response.AppVersion) + } + result := &coretypes.ResultStatus{ - NodeInfo: env.P2PTransport.NodeInfo(), + NodeInfo: env.P2PTransport.NodeInfo(), + ApplicationInfo: applicationInfo, SyncInfo: coretypes.SyncInfo{ LatestBlockHash: latestBlockHash, LatestAppHash: latestAppHash, diff --git a/rpc/coretypes/responses.go b/rpc/coretypes/responses.go index 39a2755e9..a25d348e3 100644 --- a/rpc/coretypes/responses.go +++ b/rpc/coretypes/responses.go @@ -116,6 +116,10 @@ type SyncInfo struct { BackFillBlocksTotal int64 `json:"backfill_blocks_total,string"` } +type ApplicationInfo struct { + Version string `json:"version"` +} + // Info about the node's validator type ValidatorInfo struct { Address bytes.HexBytes @@ -155,6 +159,7 @@ func (v *ValidatorInfo) UnmarshalJSON(data []byte) error { // Node Status type ResultStatus struct { NodeInfo types.NodeInfo `json:"node_info"` + ApplicationInfo ApplicationInfo `json:"application_info,omitempty"` SyncInfo SyncInfo `json:"sync_info"` ValidatorInfo ValidatorInfo `json:"validator_info"` LightClientInfo types.LightClientInfo `json:"light_client_info,omitempty"`