Compare commits

...

238 Commits

Author SHA1 Message Date
William Banfield
2b7f46206e change output and related tests 2022-05-11 13:37:02 -04:00
William Banfield
ad577e93d4 sort data and merge 2022-05-11 13:27:50 -04:00
William Banfield
5b5dc2ea95 use strings.Builder 2022-05-11 10:12:54 -04:00
William Banfield
81cac78702 field renames 2022-05-11 10:10:23 -04:00
William Banfield
4eb6bdaee7 use fmt.Print 2022-05-11 10:04:29 -04:00
William Banfield
0048bfe5a9 use flag.Arg 2022-05-11 10:03:05 -04:00
William Banfield
8ebbc52b97 close files 2022-05-11 10:00:47 -04:00
William Banfield
ace89bf523 simplify open error 2022-05-11 09:59:51 -04:00
William Banfield
4257b0762e non allocating decl 2022-05-11 09:58:19 -04:00
William Banfield
e0badc0b2f rename diff function 2022-05-11 09:57:26 -04:00
William Banfield
7947e9ea5f change struct name 2022-05-11 09:56:28 -04:00
William Banfield
f3550cea47 use want as name in test 2022-05-11 09:54:50 -04:00
William Banfield
dc1d9d48e0 use NArg 2022-05-11 09:52:49 -04:00
William Banfield
f834edea56 Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:50:53 -04:00
William Banfield
8c5f42949f Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:49:15 -04:00
William Banfield
035356df64 Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:48:19 -04:00
William Banfield
672a26a3cf Update scripts/metricsgen/metricsdiff/metricsdiff.go
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 09:47:51 -04:00
William Banfield
118b48fba0 scripts/metricsgen: add metricsdiff tool 2022-05-11 00:06:04 -04:00
Sergio Mena
735a1a537b Fixed math notation in ABCI++ app requirements (#8499)
* Fixed math notation in ABCI++ app requirements

* Update spec/abci++/abci++_app_requirements_002_draft.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update spec/abci++/abci++_app_requirements_002_draft.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update spec/abci++/abci++_app_requirements_002_draft.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update spec/abci++/abci++_app_requirements_002_draft.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

Co-authored-by: Daniel <daniel.cason@usi.ch>
2022-05-10 21:50:28 +02:00
William Banfield
c052181e32 consensus: add additional metrics for abci++ data (#8480)
This pull request adds an additional set of metrics targeted at providing more visibility into `abci++`. 

The following set of metrics are added and exposed through the `metrics` endpoint:

```
tendermint_consensus_proposal_receive_count{chain_id="test-chain-IrF74Y",status="accepted"} 34
tendermint_consensus_proposal_create_count{chain_id="test-chain-IrF74Y"} 34
tendermint_consensus_vote_extension_receive_count{chain_id="test-chain-IrF74Y",status="accepted"} 34
tendermint_consensus_round_voting_power_percent{chain_id="test-chain-IrF74Y",vote_type="precommit"} 1
tendermint_consensus_round_voting_power_percent{chain_id="test-chain-IrF74Y",vote_type="prevote"} 1
tendermint_state_consensus_param_updates{chain_id="test-chain-IrF74Y"} 0
tendermint_state_validator_set_updates{chain_id="test-chain-IrF74Y"} 0
tendermint_consensus_late_votes{chain_id="test-chain-IrF74Y",vote_type="precommit"} 16
```

This pull request also updates the `metrics.md` file to include some metrics that were previously missed. My hope is to generate the `metrics.md` file with a future version of the tool being architected in #8479
2022-05-10 16:48:13 +00:00
Callum Waters
a4c3b5cab4 validate block before we persist it (#8493) 2022-05-10 17:34:53 +02:00
Callum Waters
9dae97d845 RFC 016: Node Architecture (#8285) 2022-05-10 15:42:22 +02:00
dependabot[bot]
412a77915d build(deps): Bump github.com/golangci/golangci-lint (#8490) 2022-05-10 08:25:15 -04:00
William Banfield
4b36feaa2b scripts/metricsgen: add the initial version of metricsgen (#8479)
This pull requests adds a new tool, metricsgen, for generating Tendermint metrics constructors from `Metrics` struct definitions. This tool aims to reduce the amount of boilerplate required to add additional metrics to Tendermint.

Its working is fairly simple, it parses the go ast, extracts field information, and uses this field information to execute a go template. 

This pull request also adds a proof-of-concept of the tool's output and working by using it to generate the [indexer metrics](https://github.com/tendermint/tendermint/pull/8479/files#diff-4b0c597b6fa05332a2f9a8e0ce079e360602942fae99dc5485f1edfe71c0a29e) using `//go:generate` directives and a simple `make` target.

The next steps for this tool are documented in https://github.com/tendermint/tendermint/issues/8485 and https://github.com/tendermint/tendermint/issues/8486, which detail using the tool to generate the `metrics.md` documentation file and using the tool to migrate away from `go-kit`.
2022-05-09 22:52:10 +00:00
dependabot[bot]
b52b8f2740 build(deps): Bump docker/login-action from 1.14.1 to 2.0.0 (#8481)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.14.1 to 2.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/login-action/releases">docker/login-action's releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<ul>
<li>Node 16 as default runtime by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/161">#161</a>)
<ul>
<li>This requires a minimum <a href="https://github.com/actions/runner/releases/tag/v2.285.0">Actions Runner</a> version of v2.285.0, which is by default available in GHES 3.4 or later.</li>
</ul>
</li>
<li>chore: update dev dependencies and workflow by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/170">#170</a>)</li>
<li>Bump <code>@​actions/exec</code> from 1.1.0 to 1.1.1 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/167">#167</a>)</li>
<li>Bump <code>@​actions/io</code> from 1.1.1 to 1.1.2 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/168">#168</a>)</li>
<li>Bump minimist from 1.2.5 to 1.2.6 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/176">#176</a>)</li>
<li>Bump https-proxy-agent from 5.0.0 to 5.0.1 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/182">#182</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/docker/login-action/compare/v1.14.1...v2.0.0">https://github.com/docker/login-action/compare/v1.14.1...v2.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="49ed152c8e"><code>49ed152</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/161">#161</a> from crazy-max/node16-runtime</li>
<li><a href="b61a9ce7bd"><code>b61a9ce</code></a> Node 16 as default runtime</li>
<li><a href="3a136a8631"><code>3a136a8</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/182">#182</a> from docker/dependabot/npm_and_yarn/https-proxy-agent...</li>
<li><a href="b312880b69"><code>b312880</code></a> Update generated content</li>
<li><a href="795794e081"><code>795794e</code></a> Bump https-proxy-agent from 5.0.0 to 5.0.1</li>
<li><a href="1edf6180e0"><code>1edf618</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/179">#179</a> from docker/dependabot/github_actions/codecov/codecov...</li>
<li><a href="8e66ad4089"><code>8e66ad4</code></a> Bump codecov/codecov-action from 2 to 3</li>
<li><a href="7c79b598ea"><code>7c79b59</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/176">#176</a> from docker/dependabot/npm_and_yarn/minimist-1.2.6</li>
<li><a href="24a38e0d6d"><code>24a38e0</code></a> Bump minimist from 1.2.5 to 1.2.6</li>
<li><a href="70e1ff84cb"><code>70e1ff8</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/170">#170</a> from crazy-max/eslint</li>
<li>Additional commits viewable in <a href="https://github.com/docker/login-action/compare/v1.14.1...v2.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=1.14.1&new-version=2.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-05-09 14:35:43 +00:00
dependabot[bot]
083716b22a build(deps): Bump docker/build-push-action from 2.10.0 to 3.0.0 (#8482)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.10.0 to 3.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/build-push-action/releases">docker/build-push-action's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<ul>
<li>Node 16 as default runtime by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/564">#564</a>)
<ul>
<li>This requires a minimum <a href="https://github.com/actions/runner/releases/tag/v2.285.0">Actions Runner</a> version of v2.285.0, which is by default available in GHES 3.4 or later.</li>
</ul>
</li>
<li>Standalone mode support by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/601">#601</a> <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/609">#609</a>)</li>
<li>chore: update dev dependencies and workflow by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/571">#571</a>)</li>
<li>Bump <code>@​actions/exec</code> from 1.1.0 to 1.1.1 (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/573">#573</a>)</li>
<li>Bump <code>@​actions/github</code> from 5.0.0 to 5.0.1 (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/582">#582</a>)</li>
<li>Bump minimist from 1.2.5 to 1.2.6 (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/584">#584</a>)</li>
<li>Bump semver from 7.3.5 to 7.3.7 (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/595">#595</a>)</li>
<li>Bump csv-parse from 4.16.3 to 5.0.4 (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/533">#533</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v2.10.0...v3.0.0">https://github.com/docker/build-push-action/compare/v2.10.0...v3.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e551b19e49"><code>e551b19</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/564">#564</a> from crazy-max/node-16</li>
<li><a href="3554377aa3"><code>3554377</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/609">#609</a> from crazy-max/ci-fix-test</li>
<li><a href="a62bc1b22b"><code>a62bc1b</code></a> ci: fix standalone test</li>
<li><a href="c2085839e1"><code>c208583</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/601">#601</a> from crazy-max/standalone-mode</li>
<li><a href="fcd91249e5"><code>fcd9124</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/607">#607</a> from docker/dependabot/github_actions/docker/metadata...</li>
<li><a href="0ebe720aed"><code>0ebe720</code></a> Bump docker/metadata-action from 3 to 4</li>
<li><a href="38b45804b5"><code>38b4580</code></a> Standalone mode support</li>
<li><a href="ba317382dc"><code>ba31738</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/533">#533</a> from docker/dependabot/npm_and_yarn/csv-parse-5.0.4</li>
<li><a href="43721d2346"><code>43721d2</code></a> Update generated content</li>
<li><a href="5ea21bf2ba"><code>5ea21bf</code></a> Fix csv-parse implementation since major update</li>
<li>Additional commits viewable in <a href="https://github.com/docker/build-push-action/compare/v2.10.0...v3.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=2.10.0&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-05-09 14:33:45 +00:00
dependabot[bot]
494c5cddbe build(deps): Bump docker/setup-buildx-action from 1.7.0 to 2.0.0 (#8483)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.7.0 to 2.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/setup-buildx-action/releases">docker/setup-buildx-action's releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<ul>
<li>Node 16 as default runtime by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/131">#131</a>)
<ul>
<li>This requires a minimum <a href="https://github.com/actions/runner/releases/tag/v2.285.0">Actions Runner</a> version of v2.285.0, which is by default available in GHES 3.4 or later.</li>
</ul>
</li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v1.7.0...v2.0.0">https://github.com/docker/setup-buildx-action/compare/v1.7.0...v2.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="dc7b9719a9"><code>dc7b971</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/131">#131</a> from crazy-max/node16</li>
<li><a href="f55bc08278"><code>f55bc08</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/141">#141</a> from crazy-max/fix-test</li>
<li><a href="aa877a9d36"><code>aa877a9</code></a> ci: fix standalone test</li>
<li><a href="130c56f342"><code>130c56f</code></a> Node 16 as default runtime</li>
<li>See full diff in <a href="https://github.com/docker/setup-buildx-action/compare/v1.7.0...v2.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/setup-buildx-action&package-manager=github_actions&previous-version=1.7.0&new-version=2.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-05-09 14:31:59 +00:00
Sergio Mena
cec0a97987 RFC017: ABCI++ Vote Extension Propagation (#8317)
* 1st version

* Addressed (some of) @williambanfield's comments

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Daniel <daniel.cason@usi.ch>

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Sam Kleinman <garen@tychoish.com>

* Update docs/rfc/README.md

Co-authored-by: Sam Kleinman <garen@tychoish.com>

* Addressed some comments

* Addressed more comments. Improved description of Solution 3

* Work on 'definitions' section

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Callum Waters <cmwaters19@gmail.com>

* bottom

* Addressed Josef's valset-change comment. Other minor edits

* Improved wording of 'disjoint valsets' case

* Addressed TODOs: major revamp of various sections. First complete version.

* Fixed minor wording problem

* removed blank line

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Addressed some of Thane's comments

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Addressed outstanding comments

* Addressed @williambanfield's 'catch-up message' comment

* Removed TODO after confirming statesync is only run on nodes starting from scratch

* Removed TODO (after checking with Jasmina)

* Removed addressed TODO

* Addressed Josef's feedback on case (h)

* Typo

* Update docs/rfc/rfc-017-abci++-vote-extension-propag.md

Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>

* Added log line

Co-authored-by: Daniel <daniel.cason@usi.ch>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>
2022-05-09 02:15:08 +02:00
elias-orijtech
694ab2c6d1 test/fuzz: replace outdated reference to go-fuzz in README (#8477) 2022-05-06 11:02:19 -07:00
M. J. Fromberger
97f2944db0 Reintegrate docs deployment into the main TM repo (#8468)
Per https://github.com/tendermint/docs/issues/20, it is no longer necessary to
build the static documentation out of a separate repository.

This change:

- Adds an actions workflow to build and deploy the docs to GitHub Pages.
- Updates some build settings in a compatible manner.

This change does not affect the existing site deployment. To complete this
change, we will need to update the custom domain pointer and disable the
corresponding workflow in the tendermint/docs repository. Those changes can and
must be done after this is merged.

In the future should probably also move the build rule out of the Makefile and
into the workflow directly. That will also make it easier to manage caching of
build artifacts. For now, however, I've left it as-is, so that we do not break
the active workflow on tendermint/docs, which depends on it.
2022-05-06 07:35:35 -07:00
M. J. Fromberger
ef44460c41 Convert explicit zero comparison to a method. (#8475)
Fixes #8472.

I didn't see any other obvious cases of us doing this (although we do return zeroes in other places alongside errors, which is fine).
2022-05-06 13:44:09 +00:00
dependabot[bot]
ce40697ea6 build(deps): Bump github.com/vektra/mockery/v2 from 2.12.1 to 2.12.2 (#8474)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.12.1 to 2.12.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.12.2</h2>
<h2>Changelog</h2>
<ul>
<li>ea4c438 Add deprecation notice to logs</li>
<li>735bc0c Add go-get deprecation note</li>
<li>bea853e Add missing mock</li>
<li>989253d Fix *unsafe.Pointer</li>
<li>9228ad4 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/457">#457</a> from LandonTClipp/readme_deprecation</li>
<li>1d92e73 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/460">#460</a> from grongor/fix-unsafe-pointer</li>
<li>2fcd83d Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/462">#462</a> from LandonTClipp/deprecation</li>
<li>9f67b8a More explicit deprecation for go-get</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="1d92e7320b"><code>1d92e73</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/460">#460</a> from grongor/fix-unsafe-pointer</li>
<li><a href="2fcd83d746"><code>2fcd83d</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/462">#462</a> from LandonTClipp/deprecation</li>
<li><a href="ea4c438a53"><code>ea4c438</code></a> Add deprecation notice to logs</li>
<li><a href="989253d1a4"><code>989253d</code></a> Fix *unsafe.Pointer</li>
<li><a href="bea853e93d"><code>bea853e</code></a> Add missing mock</li>
<li><a href="9f67b8afdc"><code>9f67b8a</code></a> More explicit deprecation for go-get</li>
<li><a href="9228ad4b4a"><code>9228ad4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/457">#457</a> from LandonTClipp/readme_deprecation</li>
<li><a href="735bc0c9f8"><code>735bc0c</code></a> Add go-get deprecation note</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.12.1...v2.12.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.12.1&new-version=2.12.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-05-06 10:25:34 +00:00
William Banfield
e980e1468d RFC-018: initial research of BLS signature aggregation (#8358)
This provides an initial document for understanding the landscape of implementing a BLS signature aggregation scheme into Tendermint.
2022-05-05 12:08:22 -04:00
M. J. Fromberger
dd4fee88ef keymigrate: improve filtering for legacy transaction hashes (#8466)
This is a follow-up to #8352. The check for legacy evidence keys is only based
on the prefix of the key. Hashes, which are unprefixed, could easily have this
form and be misdiagnosed.

Because the conversion for evidence checks the key structure, this should not
cause corruption. The probability that a hash is a syntactically valid evidence
key is negligible.  The tool will report an error rather than storing bad data.
But this does mean that such transaction hashes could cause the migration to
stop and report an error before it is complete.

To ensure we convert all the data, refine the legacy key check to filter these
keys more precisely. Update the test cases to exercise this condition.

* Update upgrading instructions.
2022-05-04 11:08:26 -07:00
William Banfield
c8e336f2e9 docs: minor fixups to pbts overview (#8454) 2022-05-04 13:21:32 +00:00
dependabot[bot]
9a028b7d8a build(deps): Bump github.com/creachadair/atomicfile from 0.2.5 to 0.2.6 (#8460)
Bumps [github.com/creachadair/atomicfile](https://github.com/creachadair/atomicfile) from 0.2.5 to 0.2.6.
- [Release notes](https://github.com/creachadair/atomicfile/releases)
- [Commits](https://github.com/creachadair/atomicfile/compare/v0.2.5...v0.2.6)

---
updated-dependencies:
- dependency-name: github.com/creachadair/atomicfile
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 07:51:33 -04:00
Sam Kleinman
37287ead94 p2p: remove message type from channel implementation (#8452) 2022-05-02 10:52:57 -04:00
dependabot[bot]
6c40ad39b2 build(deps): Bump docker/setup-buildx-action from 1.6.0 to 1.7.0 (#8451)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.6.0 to 1.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/setup-buildx-action/releases">docker/setup-buildx-action's releases</a>.</em></p>
<blockquote>
<h2>v1.7.0</h2>
<ul>
<li>Standalone mode by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/119">#119</a>)</li>
<li>Update dev dependencies and workflow by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/114">#114</a> <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/130">#130</a>)</li>
<li>Bump tmpl from 1.0.4 to 1.0.5 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/108">#108</a>)</li>
<li>Bump ansi-regex from 5.0.0 to 5.0.1 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/109">#109</a>)</li>
<li>Bump <code>@​actions/core</code> from 1.5.0 to 1.6.0 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/110">#110</a>)</li>
<li>Bump actions/checkout from 2 to 3 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/126">#126</a>)</li>
<li>Bump <code>@​actions/tool-cache</code> from 1.7.1 to 1.7.2 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/128">#128</a>)</li>
<li>Bump <code>@​actions/exec</code> from 1.1.0 to 1.1.1 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/129">#129</a>)</li>
<li>Bump minimist from 1.2.5 to 1.2.6 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/132">#132</a>)</li>
<li>Bump codecov/codecov-action from 2 to 3 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/133">#133</a>)</li>
<li>Bump semver from 7.3.5 to 7.3.7 (<a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/136">#136</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f211e3e9de"><code>f211e3e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/136">#136</a> from docker/dependabot/npm_and_yarn/semver-7.3.7</li>
<li><a href="b23216e504"><code>b23216e</code></a> Update generated content</li>
<li><a href="be7e600e20"><code>be7e600</code></a> Bump semver from 7.3.5 to 7.3.7</li>
<li><a href="7117987c01"><code>7117987</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/119">#119</a> from crazy-max/standalone</li>
<li><a href="17ebdd4d65"><code>17ebdd4</code></a> ci: add jobs to check standalone behavior</li>
<li><a href="3472856dd9"><code>3472856</code></a> support standalone mode and display version</li>
<li><a href="74283caced"><code>74283ca</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/133">#133</a> from docker/dependabot/github_actions/codecov/codecov...</li>
<li><a href="5b77ad49e8"><code>5b77ad4</code></a> Bump codecov/codecov-action from 2 to 3</li>
<li><a href="2a6fbda6d8"><code>2a6fbda</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/setup-buildx-action/issues/132">#132</a> from docker/dependabot/npm_and_yarn/minimist-1.2.6</li>
<li><a href="03815bdb06"><code>03815bd</code></a> Bump minimist from 1.2.5 to 1.2.6</li>
<li>Additional commits viewable in <a href="https://github.com/docker/setup-buildx-action/compare/v1.6.0...v1.7.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/setup-buildx-action&package-manager=github_actions&previous-version=1.6.0&new-version=1.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-05-02 11:52:11 +00:00
Daniel
a49325e4e0 PBTS: system model made more precise (#8096)
* PBTS model: precision, accuracy, and delay defs

* PBTS model: consensus properties reviewed

* PBTS model: reinforcing alignment with UTC

* PBTS model: precision parameter embodies accuracy

* PBTS model: discussion about accuracy shortened

* PBTS model: proposal time monotonocity rephrased

* PBTS model: precision, accuracy, and delay defs

* PBTS model: consensus properties reviewed

* PBTS model: reinforcing alignment with UTC

* PBTS model: precision parameter embodies accuracy

* PBTS model: discussion about accuracy shortened

* PBTS model: proposal time monotonocity rephrased

* PBTS model: Safety Invariants subsection

* PBTS model: MSGDELAY description shortened

* PBTS model: timely proposals definition refined

* PBTS model: some formatting changes

* PBTS model: timely predicate definition

* PBTS model: timely proof-of-lock re-defined

* PBTS model: derived proof-of-lock requirements

   * The property needs to be properly demonstrated.

* Apply suggestions from William

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* PBTS model: reference to arXiv algorithm on timely

* PBTS model: typos fixed

* PBTS model: derived POL "demonstration"

* PBTS model: fix formatting, r' renamed to vr

* PBTS model: minor fixes

* PBTS model: derived POL proof ammended

* PBTS safety: consensus validity with time inequalty

* PBTS: renamed receiveTime to proposalReceptionTime

* PBTS safety: short intro, some links

* PBTS model: safety refactored again

* PBTS model: liveness condition stated

* PBTS liveness: minor change

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>

* Update spec/consensus/proposer-based-timestamp/pbts-sysmodel_002_draft.md

Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>

* PBTS sysmodel: formmatting typo fixed

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: Josef Widder <44643235+josef-widder@users.noreply.github.com>
2022-05-02 10:22:03 +02:00
Thane Thomson
e7451a43e7 blocksync: Honor contexts supplied to BlockPool (#8447)
* Lift condition into for loop

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Honor contexts in BlockPool

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only stop timers when necessary

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Optimize timers

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Simplify request interval definition

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove extraneous timer stop

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Convert switch into if

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Eliminate timers

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-30 14:34:59 -04:00
Sam Kleinman
cf2a00b398 p2p: avoid using p2p.Channel internals (#8444) 2022-04-29 17:21:36 -04:00
Sam Kleinman
89196596f7 privval/grpc: normalize signature (#8441) 2022-04-29 10:56:10 -04:00
Sam Kleinman
eee19e42db consensus: reduce size of validator set changes test (#8442) 2022-04-29 10:29:26 -04:00
dependabot[bot]
97b39770e0 build(deps): Bump github.com/btcsuite/btcd from 0.22.0-beta to 0.22.1 (#8439)
Bumps [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.22.0-beta to 0.22.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/btcsuite/btcd/blob/v0.22.1/CHANGES">github.com/btcsuite/btcd's changelog</a>.</em></p>
<blockquote>
<h1>============================================================================
User visible changes for btcd
A full-node bitcoin implementation written in Go</h1>
<p>Changes in 0.22.1 (Wed Apr 27 2022)</p>
<ul>
<li>Notable developer-related package changes:
<ul>
<li>Update to use chaincfg/chainhash module and remove conflicting
package</li>
</ul>
</li>
<li>Contributors (alphabetical order):
<ul>
<li>Dave Collins</li>
</ul>
</li>
</ul>
<p>Changes in 0.22.0 (Tue Jun 01 2021)</p>
<ul>
<li>Protocol and network-related changes:
<ul>
<li>Add support for witness tx and block in notfound msg (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1625">#1625</a>)</li>
<li>Add support for receiving sendaddrv2 messages from a peer (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1670">#1670</a>)</li>
<li>Fix bug in peer package causing last block height to go backwards
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1606">#1606</a>)</li>
<li>Add chain parameters for connecting to the public Signet network
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1692">#1692</a>, <a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1718">#1718</a>)</li>
</ul>
</li>
<li>Crypto changes:
<ul>
<li>Fix bug causing panic due to bad R and S signature components in
btcec.RecoverCompact (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1691">#1691</a>)</li>
<li>Set the name (secp256k1) in the CurveParams of the S256 curve
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1565">#1565</a>)</li>
</ul>
</li>
<li>Notable developer-related package changes:
<ul>
<li>Remove unknown block version warning in the blockchain package,
due to false positives triggered by AsicBoost (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1463">#1463</a>)</li>
<li>Add chaincfg.RegisterHDKeyID function to populate HD key ID pairs
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1617">#1617</a>)</li>
<li>Add new method mining.AddWitnessCommitment to add the witness
commitment as an OP_RETURN output within the coinbase transaction.
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1716">#1716</a>)</li>
</ul>
</li>
<li>RPC changes:
<ul>
<li>Support Batch JSON-RPC in rpcclient and server (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1583">#1583</a>)</li>
<li>Add rpcclient method to invoke getdescriptorinfo JSON-RPC command
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1578">#1578</a>)</li>
<li>Update the rpcserver handler for validateaddress JSON-RPC command to
have parity with the bitcoind 0.20.0 interface (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1613">#1613</a>)</li>
<li>Add rpcclient method to invoke getblockfilter JSON-RPC command
(<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1579">#1579</a>)</li>
<li>Add signmessagewithprivkey JSON-RPC command in rpcserver (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1585">#1585</a>)</li>
<li>Add rpcclient method to invoke importmulti JSON-RPC command (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1579">#1579</a>)</li>
<li>Add watchOnly argument in rpcclient method to invoke
listtransactions JSON-RPC command (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1628">#1628</a>)</li>
<li>Update btcjson.ListTransactionsResult for compatibility with Bitcoin
Core 0.20.0 (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1626">#1626</a>)</li>
<li>Support nullable optional JSON-RPC parameters (<a href="https://github-redirect.dependabot.com/btcsuite/btcd/issues/1594">#1594</a>)</li>
<li>Add rpcclient and server method to invoke getnodeaddresses JSON-RPC</li>
</ul>
</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2f508b3f86"><code>2f508b3</code></a> Update CHANGES file for 0.22.1 release.</li>
<li><a href="ff92d88504"><code>ff92d88</code></a> btcd: bump version to v0.22.1.</li>
<li><a href="cf5c461d91"><code>cf5c461</code></a> main: Switch to chaincfg/chainhash module.</li>
<li>See full diff in <a href="https://github.com/btcsuite/btcd/compare/v0.22.0-beta...v0.22.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/btcsuite/btcd&package-manager=go_modules&previous-version=0.22.0-beta&new-version=0.22.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-29 11:21:56 +00:00
dependabot[bot]
297fcc0a7c build(deps): Bump github.com/creachadair/tomledit from 0.0.18 to 0.0.19 (#8440)
Bumps [github.com/creachadair/tomledit](https://github.com/creachadair/tomledit) from 0.0.18 to 0.0.19.
<details>
<summary>Commits</summary>
<ul>
<li><a href="0692e4157a"><code>0692e41</code></a> Release v0.0.19</li>
<li><a href="d1160a474b"><code>d1160a4</code></a> Update default permissions.</li>
<li><a href="56f28f4ea0"><code>56f28f4</code></a> Move transform tests to that package.</li>
<li><a href="3b8b380274"><code>3b8b380</code></a> Add permissions to CI workflow.</li>
<li><a href="409951b699"><code>409951b</code></a> Add a quotation test case.</li>
<li><a href="f35c8bec5c"><code>f35c8be</code></a> parser: include line numbers in headings, mappings, and values</li>
<li><a href="26acca1df8"><code>26acca1</code></a> Regularize location formatting in diagnostics.</li>
<li><a href="3394f599e4"><code>3394f59</code></a> Add more parser test cases.</li>
<li><a href="5ce10cc05a"><code>5ce10cc</code></a> Rename test file.</li>
<li><a href="29f3eb34c8"><code>29f3eb3</code></a> Allow compliance tests to be skipped with -short.</li>
<li>See full diff in <a href="https://github.com/creachadair/tomledit/compare/v0.0.18...v0.0.19">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/creachadair/tomledit&package-manager=go_modules&previous-version=0.0.18&new-version=0.0.19)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-29 10:59:15 +00:00
Sam Kleinman
3d448e1ef8 crypto: cleanup tmhash package (#8434) 2022-04-28 22:21:43 -04:00
M. J. Fromberger
6faf506540 rpc: fix byte string decoding for URL parameters (#8431)
In #8397 I tried to remove all the cases where we needed to keep track of the
target type of parameters for JSON encoding, but there is one case still left:
When decoding parameters from URL query terms, there is no way to tell whether
or not we need base64 encoding without knowing whether the underlying type of
the target is string or []byte.

To fix this, keep track of parameters that are []byte valued when RPCFunc is
compiling its argument map, and use that when parsing URL query terms.  Update
the tests accordingly.
2022-04-28 15:18:11 -07:00
Thane Thomson
d69bd64702 abci++: Vote extension cleanup (#8402)
* Split vote verification/validation based on vote extensions

Some parts of the code need vote extensions to be verified and
validated (mostly in consensus), and other parts of the code don't
because its possible that, in some cases (as per RFC 017), we won't have
vote extensions.

This explicitly facilitates that split.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only sign extensions in precommits, not prevotes

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update privval/file.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Apply suggestions from code review

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Temporarily disable extension requirement again for E2E testing

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Reorganize comment for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Leave vote validation and pre-call nil check up to caller of VoteToProto

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Split complex vote validation test into multiple tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Universally enforce no vote extensions on any vote type but precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Make error messages more generic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Verify with vote extensions when constructing a VoteSet

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand comment for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add extension check for prevotes prior to signing votes

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix supporting test code to only inject extensions into precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Separate vote malleation from signing in vote tests for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add extension signature length check and corresponding test

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Perform basic vote validation in CommitToVoteSet

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-04-28 13:53:44 -04:00
M. J. Fromberger
47d52fc78d Use patched link-checker for periodic checks. (#8430)
In #8339 we pointed the markdown link checker action to a patched version that
has the up-to-date version of the underlying check tool. In doing so, I missed
the periodic cron job that runs the same workflow. Update it to use the patched
version also.
2022-04-28 06:44:56 -07:00
Sam Kleinman
2a58ea3ab2 p2p: use nodeinfo less often (#8427) 2022-04-27 21:13:38 +00:00
Sam Kleinman
1121698757 node: start rpc service after reactors (#8426) 2022-04-27 15:55:27 -04:00
Sam Kleinman
8670678291 p2p: remove support for multiple transports and endpoints (#8420) 2022-04-27 14:29:19 -04:00
M. J. Fromberger
da1b871808 Unify RPC method signatures and parameter decoding (#8397)
Pass all parameters from JSON-RPC requests to their corresponding handlers
using struct types instead of positional parameters. This allows us to control
encoding of arguments using only the standard library, and to eliminate the
remaining special-purpose JSON encoding hooks in the server.

To support existing use, the server still allows arguments to be encoded in
JSON as either an array or an object.

Related changes:

- Rework the RPCFunc constructor to reduce reflection during RPC call service.
- Add request parameter wrappers for each RPC service method.
- Update the RPC Environment methods to use these types.
- Update the interfaces and shims derived from Environment to the new
  signatures.
- Update and extend test cases.
2022-04-27 07:53:51 -07:00
elias-orijtech
e741d01231 fuzz: don't panic on expected errors (#8423)
In the conversion to Go 1.18 fuzzing in e4991fd862,
a `return 0` was converted to a panic. A `return 0` is a hint to the fuzzer, not
a failing testcase.

While here, clean up the test by folding setup code into it.
2022-04-27 07:26:21 -07:00
dependabot[bot]
b626b0a719 build(deps): Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 (#8422)
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.7 to 0.5.8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/google/go-cmp/releases">github.com/google/go-cmp's releases</a>.</em></p>
<blockquote>
<h2>v0.5.8</h2>
<p>Reporter changes:</p>
<ul>
<li>(<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/293">#293</a>) Fix printing of types in reporter output for interface and pointer types</li>
<li>(<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/294">#294</a>) Use string formatting for slice of bytes in more circumstances</li>
</ul>
<p>Dependency changes:</p>
<ul>
<li>(<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/292">#292</a>) Update minimum supported version to go1.13 and remove <code>xerrors</code> dependency</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f144a35ed4"><code>f144a35</code></a> Additional cleanup with Go 1.13 as minimal version (<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/295">#295</a>)</li>
<li><a href="63c2960be6"><code>63c2960</code></a> remove xerrors (<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/292">#292</a>)</li>
<li><a href="71220fc3ca"><code>71220fc</code></a> Use string formatting for slice of bytes (<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/294">#294</a>)</li>
<li><a href="4664e24d52"><code>4664e24</code></a> Fix printing of types in reporter output (<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/293">#293</a>)</li>
<li><a href="79433ace28"><code>79433ac</code></a> Run tests on Go 1.18 (<a href="https://github-redirect.dependabot.com/google/go-cmp/issues/290">#290</a>)</li>
<li>See full diff in <a href="https://github.com/google/go-cmp/compare/v0.5.7...v0.5.8">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/google/go-cmp&package-manager=go_modules&previous-version=0.5.7&new-version=0.5.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-27 13:21:03 +00:00
dependabot[bot]
c44e6d1799 build(deps): Bump github.com/vektra/mockery/v2 from 2.12.0 to 2.12.1 (#8417)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.12.0 to 2.12.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.12.1</h2>
<h2>Changelog</h2>
<ul>
<li>facf60b Add extra test cases for increasing code coverage.</li>
<li>2e1360a Collapse if statements and rename interface in the fixtures.</li>
<li>8bdc90d Fix test on go1.18.</li>
<li>fe03b57 Fix tests.</li>
<li>b8c62f7 Fix: avoid package name collision with inPackage (<a href="https://github-redirect.dependabot.com/vektra/mockery/issues/291">#291</a>)</li>
<li>c9dc740 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/422">#422</a> from i-sevostyanov/fix-package-collision</li>
<li>58a7f18 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/452">#452</a> from grongor/refactor-first-letter-helper</li>
<li>749b2d6 Refactor mock name generation</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="c9dc740b50"><code>c9dc740</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/422">#422</a> from i-sevostyanov/fix-package-collision</li>
<li><a href="facf60b02e"><code>facf60b</code></a> Add extra test cases for increasing code coverage.</li>
<li><a href="8bdc90da7a"><code>8bdc90d</code></a> Fix test on go1.18.</li>
<li><a href="fe03b57da5"><code>fe03b57</code></a> Fix tests.</li>
<li><a href="2e1360ae46"><code>2e1360a</code></a> Collapse if statements and rename interface in the fixtures.</li>
<li><a href="b8c62f7858"><code>b8c62f7</code></a> Fix: avoid package name collision with inPackage (<a href="https://github-redirect.dependabot.com/vektra/mockery/issues/291">#291</a>)</li>
<li><a href="58a7f185bd"><code>58a7f18</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/452">#452</a> from grongor/refactor-first-letter-helper</li>
<li><a href="749b2d6fa5"><code>749b2d6</code></a> Refactor mock name generation</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.12.0...v2.12.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.12.0&new-version=2.12.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-26 15:01:57 +00:00
Thane Thomson
dcfbd9bc3d abci++: Remove intermediate protos (#8414)
* Sync protos with their intermediates

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove intermediate protos and their supporting scripts

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make proto-gen

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-26 08:02:17 -04:00
Sam Kleinman
e36052c80e crypto: remove unused code (#8412) 2022-04-25 12:35:59 -04:00
Sam Kleinman
02c1c8ecb4 config: minor template infrastructure (#8411) 2022-04-25 12:08:22 -04:00
dependabot[bot]
701eff8968 build(deps): Bump google.golang.org/grpc from 1.45.0 to 1.46.0 (#8408)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.45.0 to 1.46.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p>
<blockquote>
<h2>Release 1.46.0</h2>
<h1>New Features</h1>
<ul>
<li>server: Support setting <code>TCP_USER_TIMEOUT</code> on <code>grpc.Server</code> connections using <code>keepalive.ServerParameters.Time</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5219">#5219</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/bonnefoa"><code>@​bonnefoa</code></a></li>
</ul>
</li>
<li>client: perform graceful switching of LB policies in the <code>ClientConn</code> by default (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5285">#5285</a>)</li>
<li>all: improve logging by including channelz identifier in log messages (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5192">#5192</a>)</li>
</ul>
<h1>API Changes</h1>
<ul>
<li>grpc: delete <code>WithBalancerName()</code> API, deprecated over 4 years ago in <a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/1697">#1697</a> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5232">#5232</a>)</li>
<li>balancer: change BuildOptions.ChannelzParentID to an opaque identifier instead of int (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5192">#5192</a>)
<ul>
<li>Note: the balancer package is labeled as EXPERIMENTAL, and we don't believe users were using this field.</li>
</ul>
</li>
</ul>
<h1>Behavior Changes</h1>
<ul>
<li>client: change connectivity state to <code>TransientFailure</code> in <code>pick_first</code> LB policy when all addresses are removed (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5274">#5274</a>)
<ul>
<li>This is a minor change that brings grpc-go's behavior in line with the intended behavior and how C and Java behave.</li>
</ul>
</li>
<li>metadata: add client-side validation of HTTP-invalid metadata before attempting to send (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4886">#4886</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/Patrick0308"><code>@​Patrick0308</code></a></li>
</ul>
</li>
</ul>
<h1>Bug Fixes</h1>
<ul>
<li>metadata: make a copy of the value slices in FromContext() functions so that modifications won't be made to the original copy (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5267">#5267</a>)</li>
<li>client: handle invalid service configs by applying the default, if applicable (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5238">#5238</a>)</li>
<li>xds: the xds client will now apply a 1 second backoff before recreating ADS or LRS streams (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5280">#5280</a>)</li>
</ul>
<h1>Dependencies</h1>
<ul>
<li>Upgrade security/authorization module dependencies to <a href="https://github.com/google/cel-go">https://github.com/google/cel-go</a> v0.10.1 and others (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5243">#5243</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/TristonianJones"><code>@​TristonianJones</code></a></li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e8d06c51a5"><code>e8d06c5</code></a> Change version to 1.46.0 (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5296">#5296</a>)</li>
<li><a href="efbd542a4f"><code>efbd542</code></a> gcp/observability: correctly test this module in presubmit tests (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5300">#5300</a>) (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5307">#5307</a>)</li>
<li><a href="4467a29dbb"><code>4467a29</code></a> gcp/observability: implement logging via binarylog (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5196">#5196</a>)</li>
<li><a href="18fdf542fa"><code>18fdf54</code></a> cmd/protoc-gen-go-grpc: allow hooks to modify client structs and service hand...</li>
<li><a href="337b815c41"><code>337b815</code></a> interop: build client without timeout; add logs to help debug failures (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5294">#5294</a>)</li>
<li><a href="e583b196ce"><code>e583b19</code></a> xds: Add RLS in xDS e2e test (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5281">#5281</a>)</li>
<li><a href="0066bf69de"><code>0066bf6</code></a> grpc: perform graceful switching of LB policies in the <code>ClientConn</code> by defaul...</li>
<li><a href="3cccf6a43b"><code>3cccf6a</code></a> xdsclient: always backoff between new streams even after successful stream (#...</li>
<li><a href="4e780933f8"><code>4e78093</code></a> xds: ignore routes with unsupported cluster specifiers (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5269">#5269</a>)</li>
<li><a href="99aae3442d"><code>99aae34</code></a> cluster manager: Add Graceful Switch functionality to Cluster Manager (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5265">#5265</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.45.0...v1.46.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.45.0&new-version=1.46.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-25 12:04:57 +00:00
dependabot[bot]
a4190208a3 build(deps): Bump codecov/codecov-action from 3.0.0 to 3.1.0 (#8406)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<h2>3.1.0</h2>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/699">#699</a> Incorporate <code>xcode</code> arguments for the Codecov uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/694">#694</a> build(deps-dev): bump <code>@​vercel/ncc</code> from 0.33.3 to 0.33.4</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/696">#696</a> build(deps-dev): bump <code>@​types/node</code> from 17.0.23 to 17.0.25</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/698">#698</a> build(deps-dev): bump jest-junit from 13.0.0 to 13.2.0</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md">codecov/codecov-action's changelog</a>.</em></p>
<blockquote>
<h2>3.1.0</h2>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/699">#699</a> Incorporate <code>xcode</code> arguments for the Codecov uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/694">#694</a> build(deps-dev): bump <code>@​vercel/ncc</code> from 0.33.3 to 0.33.4</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/696">#696</a> build(deps-dev): bump <code>@​types/node</code> from 17.0.23 to 17.0.25</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/698">#698</a> build(deps-dev): bump jest-junit from 13.0.0 to 13.2.0</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="81cd2dc814"><code>81cd2dc</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/699">#699</a> from codecov/feat-xcode</li>
<li><a href="a03184e530"><code>a03184e</code></a> feat: add xcode support</li>
<li><a href="6a6a9ae7b1"><code>6a6a9ae</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/694">#694</a> from codecov/dependabot/npm_and_yarn/vercel/ncc-0.33.4</li>
<li><a href="92a872a5e7"><code>92a872a</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/696">#696</a> from codecov/dependabot/npm_and_yarn/types/node-17.0.25</li>
<li><a href="43a9c182dd"><code>43a9c18</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/698">#698</a> from codecov/dependabot/npm_and_yarn/jest-junit-13.2.0</li>
<li><a href="13ce822ccd"><code>13ce822</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/690">#690</a> from codecov/ci-v3</li>
<li><a href="4d6dbaaea6"><code>4d6dbaa</code></a> build(deps-dev): bump jest-junit from 13.0.0 to 13.2.0</li>
<li><a href="98f0f19300"><code>98f0f19</code></a> build(deps-dev): bump <code>@​types/node</code> from 17.0.23 to 17.0.25</li>
<li><a href="d3021d9910"><code>d3021d9</code></a> build(deps-dev): bump <code>@​vercel/ncc</code> from 0.33.3 to 0.33.4</li>
<li><a href="2c83f35c20"><code>2c83f35</code></a> Update makefile to v3</li>
<li>See full diff in <a href="https://github.com/codecov/codecov-action/compare/v3.0.0...v3.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=3.0.0&new-version=3.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-25 11:52:01 +00:00
dependabot[bot]
5b38bc17b1 build(deps): Bump bufbuild/buf-setup-action from 1.3.1 to 1.4.0 (#8405)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.3.1 to 1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/bufbuild/buf-setup-action/releases">bufbuild/buf-setup-action's releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<ul>
<li>Set the default buf version to v1.4.0</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b0ab760002"><code>b0ab760</code></a> Update to v1.4.0</li>
<li><a href="60debd1093"><code>60debd1</code></a> Revert &quot;Add dependabot config (<a href="https://github-redirect.dependabot.com/bufbuild/buf-setup-action/issues/21">#21</a>)&quot; (<a href="https://github-redirect.dependabot.com/bufbuild/buf-setup-action/issues/33">#33</a>)</li>
<li><a href="e789cb128b"><code>e789cb1</code></a> Add dependabot config (<a href="https://github-redirect.dependabot.com/bufbuild/buf-setup-action/issues/21">#21</a>)</li>
<li>See full diff in <a href="https://github.com/bufbuild/buf-setup-action/compare/v1.3.1...v1.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bufbuild/buf-setup-action&package-manager=github_actions&previous-version=1.3.1&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-25 11:50:11 +00:00
Sam Kleinman
2e5d53ea9a abci: interface should take pointers to arguments (#8404) 2022-04-24 18:37:07 +00:00
Sam Kleinman
674908b130 abci: remove unneccessary implementations (#8403) 2022-04-24 12:01:39 -04:00
M. J. Fromberger
001449d536 Remove obsolete build tagged patch for net.Pipe. (#8399)
The p2p/conn library was using a build patch to work around an old issue with
the net.Conn type that has not existed since Go 1.10. Remove the workaround and
update usage to use the standard net.Pipe directly.
2022-04-23 09:57:42 -07:00
Sam Kleinman
a5ecd418a6 abci: remove redundant methods in client (#8401) 2022-04-23 08:59:18 -04:00
M. J. Fromberger
20f8485080 Make encoding of HexBytes values more robust. (#8398)
The HexBytes wrapper type handles decoding byte strings from JSON.  In the RPC
API, hashes are encoded as hex digits rather than the standard base64.

Simplify the implementation of this wrapper using the TextMarshaler interface,
which the encoding/json package uses for values (like these) that are meant to
be wrapped in JSON strings.

In addition, allow HexBytes values to be decoded from either hex OR base64
input. This preserves all existing use, but will allow us to remove some
reflection special cases in the RPC decoder plumbing.

Update tests to correctly tolerate empty/nil.
2022-04-22 18:02:41 -07:00
Sam Kleinman
b5e6cf50d1 abci: Application should return errors errors and nilable response objects (#8396) 2022-04-22 20:40:42 -04:00
Sam Kleinman
8345dc4f7c abci: application type should take contexts (#8388) 2022-04-22 10:58:01 -04:00
dependabot[bot]
6970c9177b build(deps): Bump github.com/vektra/mockery/v2 from 2.11.0 to 2.12.0 (#8393) 2022-04-22 05:55:33 -07:00
dependabot[bot]
383f9ea180 build(deps): Bump github.com/creachadair/tomledit from 0.0.16 to 0.0.18 (#8392)
Bumps [github.com/creachadair/tomledit](https://github.com/creachadair/tomledit) from 0.0.16 to 0.0.18.
<details>
<summary>Commits</summary>
<ul>
<li><a href="5802e262c6"><code>5802e26</code></a> Release v0.0.18</li>
<li><a href="3c9daf1a4a"><code>3c9daf1</code></a> document that we don't validate</li>
<li><a href="da8c938af4"><code>da8c938</code></a> Remove non-applicable test cases.</li>
<li><a href="ac4210b0d1"><code>ac4210b</code></a> parser: ensure unclosed arrays are not treated as empty</li>
<li><a href="f98f82fec1"><code>f98f82f</code></a> parser: ensure array separators are present</li>
<li><a href="ea1671ecca"><code>ea1671e</code></a> scanner: clean up some issues in escape and space handling</li>
<li><a href="8168589a25"><code>8168589</code></a> scanner: filter bad commas in numeric literals</li>
<li><a href="83189e20b7"><code>83189e2</code></a> scanner: fix some issues in multiline string recognition</li>
<li><a href="bdc8e22990"><code>bdc8e22</code></a> scanner: allow space separators in date-time strings</li>
<li><a href="1ab2c8d654"><code>1ab2c8d</code></a> Add compliance tests.</li>
<li>Additional commits viewable in <a href="https://github.com/creachadair/tomledit/compare/v0.0.16...v0.0.18">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/creachadair/tomledit&package-manager=go_modules&previous-version=0.0.16&new-version=0.0.18)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-22 12:22:20 +00:00
M. J. Fromberger
ef314708e7 RFC 019: Configuration File Versioning (#8379)
This RFC discusses issues in how we migrate configuration data across
Tendermint versions, and some options for how to improve the experience for
node operators in the future.
2022-04-21 10:08:47 -07:00
Sam Kleinman
f0db0ff260 abci: streamline grpc application construction (#8383)
In my mind this is "don't make grpc any weirder than it has to be." 

We definitely don't need to export this type: if you're using gRPC for
ABCI you *probably* don't want to also depend on the huge swath of the
code that

The ideal case is you generate the proto yourself, standup a gRPC
service on your own (presumably because your application has other
gRPC services that you want to expose,) and then your application
doesn't need to interact with the types package at all. This is
definitely the case for anyone who uses gRPC and doesn't use Go (which
is likely the predominant use case.)

If you're using Go, and want to use tendermint's service runner for
running your gRPC service, you can, but at this point (as before,)
you're already importing the `types` package (and you were before,)
I've just eliminated an intermediate type that you shouldn't need to
think about.

Reviewers: I think the change is pretty rote, but the logic/user-story
above would definitely be better for being validated by someone other
than me. :)
2022-04-21 16:21:11 +00:00
M. J. Fromberger
9d49c4b9af Add config samples from TM v26, v27, v28, v29. (#8384) 2022-04-21 08:54:07 -07:00
elias-orijtech
b4da12815f test/fuzz/tests: remove debug logging statement (#8385) 2022-04-21 10:26:07 -04:00
Sam Kleinman
cbae5f9f53 abci: avoid having untracked requests in the channel (#8382)
It seems to me that by adding requests to the clients tracker (the
`reqSent` linked list), then there's no need to actually drain the
channel, becuase we will mark all of these requests as done/errored
(which propogates to users, as users never get future objects any
more), and then the GC can reap all of the request objects and the
channel accordingly.
2022-04-20 18:06:07 +00:00
M. J. Fromberger
d56392cee9 Add confix testdata for Tendermint v0.30. (#8380)
Some additional testdata I grabbed while writing up the draft of RFC 019.
2022-04-20 14:38:48 +00:00
Sam Kleinman
29e5fbcc64 rpc: reformat method signatures and use a context (#8377)
I was digging around over here, and thought it'd be good to
cleanup/standardize the line formating on a few of these methods. Also
found a few cases where we could use contexts better so did a little
bit of cleanup there too!
2022-04-19 19:17:07 +00:00
elias-orijtech
e4991fd862 test/fuzz: convert to Go 1.18 native fuzzing (#8359) 2022-04-19 11:49:51 -07:00
Sam Kleinman
ad249ca178 node: cleanup setup for indexer and evidence components (#8378) 2022-04-19 15:35:14 +00:00
Sam Kleinman
d919a42f53 node: use signals rather than ephemeral contexts (#8376) 2022-04-19 15:13:01 +00:00
dependabot[bot]
82585e1ce6 build(deps): Bump github.com/vektra/mockery/v2 from 2.10.6 to 2.11.0 (#8374)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.10.6 to 2.11.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.11.0</h2>
<h2>Changelog</h2>
<ul>
<li>a0d98e4 Add constructor to the generated mocks</li>
<li>09de88a Fix Makefile (don't call &quot;clean&quot; during &quot;all&quot;)</li>
<li>eddf049 Fix import</li>
<li>b4d8eef Fix panic in tests</li>
<li>a328a65 Merge branch 'master' into add-constructor-for-mocks</li>
<li>32dd223 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/406">#406</a> from grongor/add-constructor-for-mocks</li>
<li>9489caf TMP-PLS-CHECK-AND-FIXUP fix rebase errors</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="32dd223292"><code>32dd223</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/406">#406</a> from grongor/add-constructor-for-mocks</li>
<li><a href="eddf0493df"><code>eddf049</code></a> Fix import</li>
<li><a href="a328a65522"><code>a328a65</code></a> Merge branch 'master' into add-constructor-for-mocks</li>
<li><a href="b4d8eef500"><code>b4d8eef</code></a> Fix panic in tests</li>
<li><a href="9489caf271"><code>9489caf</code></a> TMP-PLS-CHECK-AND-FIXUP fix rebase errors</li>
<li><a href="09de88af60"><code>09de88a</code></a> Fix Makefile (don't call &quot;clean&quot; during &quot;all&quot;)</li>
<li><a href="a0d98e44bd"><code>a0d98e4</code></a> Add constructor to the generated mocks</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.10.6...v2.11.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.10.6&new-version=2.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-19 14:02:49 +00:00
Thane Thomson
a1104b98d2 abci++: Sync implementation and spec for vote extensions (#8141)
* Refactor so building and linting works

This is the first step towards implementing vote extensions: generating
the relevant proto stubs and getting the build and linter to pass.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix typo

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Better describe method given vote extensions

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix types tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Move CanonicalVoteExtension to canonical types proto defs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Regenerate protos including latest PBTS synchrony params update

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Inject vote extensions into proposal

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Thread vote extensions through code and fix tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove extraneous empty value initialization

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix lint

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix missing VerifyVoteExtension request data

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Explicitly ensure length > 0 to sign vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Explicitly ensure length > 0 to sign vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove extraneous comment

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update privval/file.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update types/vote_test.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix ABCI proto generation scripts for Linux

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Sync intermediate and goal protos

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update internal/consensus/common_test.go

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Use dummy value with clearer meaning

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Rewrite loop for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Panic on ABCI++ method call failure

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add strong correctness guarantees when constructing extended commit info for ABCI++

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add strong guarantee in extendedCommitInfo that the number of votes corresponds

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Make extendedCommitInfo function more robust

At first extendedCommitInfo expected votes to be in the same order as
their corresponding validators in the supplied CommitInfo struct, but
this proved to be rather difficult since when a validator set's loaded
from state it's first sorted by voting power and then by address.

Instead of sorting the votes in the same way, this approach simply maps
votes to their corresponding validator's address prior to constructing
the extended commit info. This way it's easy to look up the
corresponding vote and we don't need to care about vote order.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove extraneous validator address assignment

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Sign over canonical vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Validate vote extension signature against canonical vote extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update privval tests for more meaningful dummy value

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add vote extension capability to E2E test app

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Disable lint for weak RNG usage for test app

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Use parseVoteExtension instead of custom parsing in PrepareProposal

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only include extension if we have received txs

It's unclear at this point why this is necessary to ensure that the
application's local app_hash matches that committed in the previous
block.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Require app_hash from app to match that from last block

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add contrived (possibly flaky) test to check that vote extensions code works

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove workaround for problem now solved by #8229

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* add tests for vote extension cases

* Fix spelling mistake to appease linter

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Collapse redundant if statement

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Formatting

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Always expect an extension signature, regardless of whether an extension is present

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Votes constructed from commits cannot include extensions or signatures

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Pass through vote extension in test helpers

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Temporarily disable vote extension signature requirement

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand on vote equality test errors for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand on vote matching error messages in testing

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Allow for selective subscription by vote type

This is an attempt to fix the intermittently failing
`TestPrepareProposalReceivesVoteExtensions` test in the internal
consensus package.

Occasionally we get prevote messages via the subscription channel, and
we're not interested in those. This change allows us to specify what
types of votes we're interested in (i.e. precommits) and discard the
rest.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Read lock consensus state mutex in test helper to avoid data race

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Revert BlockIDFlag parameter in node test

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Perform additional check in ProcessProposal for special txs generated by vote extensions

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* e2e: check that our added tx does not cause all txs to exceed req.MaxTxBytes

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only set vote extension signatures when signing is successful

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove channel capacity constraint in test helper to avoid missing messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add TODO to always require extension signatures in vote validation

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* e2e: reject vote extensions if the request height does not match what we expect

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: remove extraneous call to voteWithoutExtension in test

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove unnecessary address parameter from CanonicalVoteExtension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* privval: change test vote type to precommit since we use an extension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* privval: update signing logic to cater for vote extensions

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto: update field descriptions for vote message

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto: update field description for vote extension sig in vote message

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto/types: use fixed-length 64-bit integers for rounds in CanonicalVoteExtension

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* consensus: fix flaky TestPrepareProposalReceivesVoteExtensions

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* consensus: remove previously added test helper functionality

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* e2e: add error logs when we get an unexpected height in ExtendVote or VerifyVoteExtension requests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node_test: get validator addresses from privvals

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* privval/file_test: optimize filepv creation in tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* privval: add test to check that vote extensions are always signed

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add a script to check documentation for ToC entries. (#8356)

This script verifies that each document in the docs and architecture directory
has a corresponding table-of-contents entry in its README file.  It can be run
manually from the command line.

- Hook up this script to run in CI (optional workflow).
- Update ADR ToC to include missing entries this script found.

* build(deps): Bump async from 2.6.3 to 2.6.4 in /docs (#8357)

Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* privval/file_test: reset vote ext sig before signing

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: Sergio Mena <sergio@informal.systems>
Co-authored-by: William Banfield <wbanfield@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-19 08:05:17 -04:00
M. J. Fromberger
9ea0e5efa7 cleanup: pin get-diff-action uses to major version only, not minor/patch (#8368) 2022-04-18 22:49:26 +00:00
Sam Kleinman
efd4f4a40b cleanup: unused parameters (#8372) 2022-04-18 16:45:21 -04:00
Sam Kleinman
c372390fea eventbus: publish without contexts (#8369) 2022-04-18 16:28:31 -04:00
Sam Kleinman
889341152a p2p: fix setting in con-tracker (#8370) 2022-04-18 15:49:11 -04:00
M. J. Fromberger
7243ef71e2 Forward port changelog from v0.35.4 to master. (#8364) 2022-04-18 14:21:05 +00:00
dependabot[bot]
bebfd8663b build(deps): Bump github.com/creachadair/atomicfile from 0.2.4 to 0.2.5 (#8365)
Bumps [github.com/creachadair/atomicfile](https://github.com/creachadair/atomicfile) from 0.2.4 to 0.2.5.
<details>
<summary>Commits</summary>
<ul>
<li><a href="b8ff50ef68"><code>b8ff50e</code></a> Release v0.2.5.</li>
<li><a href="95084abf9a"><code>95084ab</code></a> Update actions/setup-go to v3.</li>
<li><a href="10d28f61c3"><code>10d28f6</code></a> Update actions/checkout to v3.</li>
<li><a href="5f1989ddcc"><code>5f1989d</code></a> Use a more explanatory temp file prefix.</li>
<li><a href="7819ee53ec"><code>7819ee5</code></a> Add Go 1.18 to the CI workflow.</li>
<li><a href="c30fad6a27"><code>c30fad6</code></a> Drop old Go versions from CI.</li>
<li><a href="ebcfa6b22a"><code>ebcfa6b</code></a> acat: use WriteData to simplify the code</li>
<li>See full diff in <a href="https://github.com/creachadair/atomicfile/compare/v0.2.4...v0.2.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/creachadair/atomicfile&package-manager=go_modules&previous-version=0.2.4&new-version=0.2.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-18 12:48:09 +00:00
dependabot[bot]
851c0dc4f3 build(deps): Bump async from 2.6.3 to 2.6.4 in /docs (#8357)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-15 20:48:10 -04:00
M. J. Fromberger
767e2ec8a2 Add a script to check documentation for ToC entries. (#8356)
This script verifies that each document in the docs and architecture directory
has a corresponding table-of-contents entry in its README file.  It can be run
manually from the command line.

- Hook up this script to run in CI (optional workflow).
- Update ADR ToC to include missing entries this script found.
2022-04-15 12:15:35 -07:00
M. J. Fromberger
43f92806fd Update pending changelog for #8352. (#8354)
I forgot to add this before merging. 🙁
2022-04-14 23:07:59 +00:00
M. J. Fromberger
34e727676c keymigrate: fix conversion of transaction hash keys (#8352)
* keymigrate: fix conversion of transaction hash keys

In the legacy database format, keys were generally stored with a string prefix
to partition the key space. Transaction hashes, however, were not prefixed: The
hash of a transaction was the entire key for its record.

When the key migration script scans its input, it checks the format of each
key to determine whether it has already been converted, so that it is safe to run
the script over an already-converted database.

After checking for known prefixes, the migration script used two heuristics to
distinguish ABCI events and transaction hashes: For ABCI events, whose keys
used the form "name/value/height/index", it checked for the right number of
separators. For hashes, it checked that the length is exactly 32 bytes (the
length of a SHA-256 digest) AND that the value does not contain a "/".

This last check is problematic: Any hash containing the byte 0x2f (the code
point for "/") would be incorrectly filtered out from conversion. This leads to
some transaction hashes not being converted.

To fix this problem, this changes how the script recognizes keys:

1. Use a more rigorous syntactic check to filter out ABCI metadata.
2. Use only the length to identify hashes among what remains.

This change is still not a complete fix: It is possible, though unlikely, that
a valid hash could happen to look exactly like an ABCI metadata key. However,
the chance of that happening is vastly smaller than the chance of generating a
hash that contains at least one "/" byte.

Similarly, it is possible that an already-converted key of some other type
could be mistaken for a hash (not a converted hash, ironically, but another
type of the right length). Again, we can't do anything about that.
2022-04-14 15:41:40 -07:00
dependabot[bot]
a0f51d0370 build(deps): Bump github.com/spf13/viper from 1.10.1 to 1.11.0 (#8344)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.10.1 to 1.11.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/spf13/viper/releases">github.com/spf13/viper's releases</a>.</em></p>
<blockquote>
<h2>v1.11.0</h2>

<h2>What's Changed</h2>
<h3>Exciting New Features 🎉</h3>
<ul>
<li>Experimental yaml v3 library support by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1273">spf13/viper#1273</a></li>
<li>Experimental toml v2 support by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1274">spf13/viper#1274</a></li>
<li>Experimental logger by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1275">spf13/viper#1275</a></li>
</ul>
<h3>Enhancements 🚀</h3>
<ul>
<li>Remove unnecessary operand by <a href="https://github.com/steviebps"><code>@​steviebps</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1213">spf13/viper#1213</a></li>
<li>Improve encoding layer by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1167">spf13/viper#1167</a></li>
<li>Allow merging configs with different types of leaf values by <a href="https://github.com/illarion"><code>@​illarion</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1181">spf13/viper#1181</a></li>
</ul>
<h3>Bug Fixes 🐛</h3>
<ul>
<li>Disable race detector on windows by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1269">spf13/viper#1269</a></li>
</ul>
<h3>Breaking Changes 🛠</h3>
<ul>
<li>Drop Go 1.14 support by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1327">spf13/viper#1327</a></li>
</ul>
<h3>Dependency Updates ⬆️</h3>
<ul>
<li>build(deps): bump github.com/spf13/afero from 1.6.0 to 1.7.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1265">spf13/viper#1265</a></li>
<li>build(deps): bump github.com/spf13/afero from 1.7.0 to 1.7.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1271">spf13/viper#1271</a></li>
<li>build(deps): bump github.com/spf13/afero from 1.7.1 to 1.8.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1281">spf13/viper#1281</a></li>
<li>build(deps): bump gopkg.in/ini.v1 from 1.66.2 to 1.66.3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1287">spf13/viper#1287</a></li>
<li>build(deps): bump github.com/spf13/afero from 1.8.0 to 1.8.1 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1291">spf13/viper#1291</a></li>
<li>build(deps): bump actions/github-script from 5 to 6 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1295">spf13/viper#1295</a></li>
<li>build(deps): bump actions/checkout from 2 to 3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1304">spf13/viper#1304</a></li>
<li>build(deps): bump github.com/magiconair/properties from 1.8.5 to 1.8.6 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1299">spf13/viper#1299</a></li>
<li>build(deps): bump gopkg.in/ini.v1 from 1.66.3 to 1.66.4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1293">spf13/viper#1293</a></li>
<li>build(deps): bump github.com/spf13/afero from 1.8.1 to 1.8.2 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1311">spf13/viper#1311</a></li>
<li>build(deps): bump actions/setup-go from 2 to 3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1319">spf13/viper#1319</a></li>
<li>build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.0-beta.6 to 2.0.0-beta.7 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1320">spf13/viper#1320</a></li>
<li>build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.0-beta.7 to 2.0.0-beta.8 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1322">spf13/viper#1322</a></li>
<li>Update crypt by <a href="https://github.com/sagikazarmark"><code>@​sagikazarmark</code></a> in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1325">spf13/viper#1325</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/steviebps"><code>@​steviebps</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1213">spf13/viper#1213</a></li>
<li><a href="https://github.com/illarion"><code>@​illarion</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/spf13/viper/pull/1181">spf13/viper#1181</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/spf13/viper/compare/v1.10.1...v1.11.0">https://github.com/spf13/viper/compare/v1.10.1...v1.11.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6986c0ab48"><code>6986c0a</code></a> chore: update crypt</li>
<li><a href="65293ecec2"><code>65293ec</code></a> add release note configuration</li>
<li><a href="6804da723f"><code>6804da7</code></a> chore!: drop Go 1.14 support</li>
<li><a href="5b21ca137d"><code>5b21ca1</code></a> fix: deprecated config</li>
<li><a href="55fac1047e"><code>55fac10</code></a> chore: fix lint</li>
<li><a href="e0bf4ac05d"><code>e0bf4ac</code></a> chore: add go 1.18 builds</li>
<li><a href="973c265115"><code>973c265</code></a> build(deps): bump github.com/pelletier/go-toml/v2</li>
<li><a href="129e4f973c"><code>129e4f9</code></a> build(deps): bump github.com/pelletier/go-toml/v2</li>
<li><a href="9a8603d8f8"><code>9a8603d</code></a> build(deps): bump actions/setup-go from 2 to 3</li>
<li><a href="dc76f3c0a9"><code>dc76f3c</code></a> build(deps): bump github.com/spf13/afero from 1.8.1 to 1.8.2</li>
<li>Additional commits viewable in <a href="https://github.com/spf13/viper/compare/v1.10.1...v1.11.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/viper&package-manager=go_modules&previous-version=1.10.1&new-version=1.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-14 15:40:00 +00:00
dependabot[bot]
be7cb50bb3 build(deps): Bump github.com/vektra/mockery/v2 from 2.10.4 to 2.10.6 (#8346)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.10.4 to 2.10.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.10.6</h2>
<h2>Changelog</h2>
<ul>
<li>df6e689 Add PR/issue templates</li>
<li>e8bf201 Add golang-1.18 note</li>
<li>54589be Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/445">#445</a> from bigbluedisco/fix/bump-golang-org-x-tools</li>
<li>aa25af0 fix: bump golang.org/x/tools to v0.1.10 to fix some go 1.18 issues</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="54589be6dd"><code>54589be</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/445">#445</a> from bigbluedisco/fix/bump-golang-org-x-tools</li>
<li><a href="aa25af0c7d"><code>aa25af0</code></a> fix: bump golang.org/x/tools to v0.1.10 to fix some go 1.18 issues</li>
<li><a href="e8bf201675"><code>e8bf201</code></a> Add golang-1.18 note</li>
<li><a href="df6e689d94"><code>df6e689</code></a> Add PR/issue templates</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.10.4...v2.10.6">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.10.4&new-version=2.10.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-14 14:51:38 +00:00
M. J. Fromberger
69874c2050 confix: convert tx-index.indexer from string to array (#8342)
The format of this config value was changed in v0.35.

- Move plan to its own file (for ease of reading).
- Convert indexer string to an array if not already done.
2022-04-14 06:20:49 -07:00
Callum Waters
68c9efdb82 cli: simplify resetting commands (#8312) 2022-04-14 12:27:08 +12:00
M. J. Fromberger
6bbf5b6d0f Work around markdown-link-check issues. (#8339)
Work around two issues causing the markdown link check to fail in CI.

1. https://github.com/actions/checkout/pull/760. A git permissions issue,
   apparently triggered by a combination of a git change and the behaviour of
   actions/checkout.

2. https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/129.
   Merging an updated version of the underlying package that fixes a bug in the
   handling of local #anchors.

The workaround is a temporary patched fork of the link-checker action.  This
should be removed once the upstream issues are addressed.
2022-04-13 16:01:39 -07:00
M. J. Fromberger
024f6117ee confix: remove mempool.version in v0.36 (#8334) 2022-04-13 13:41:35 -07:00
M. J. Fromberger
9296717433 Update RFC ToC for RFC-015. (#8338) 2022-04-13 20:25:59 +00:00
M. J. Fromberger
6dc15b2f50 Only run the markdown linter if markdown was touched. (#8337) 2022-04-13 13:13:59 -07:00
Sam Kleinman
0e4b18806e pubsub: [minor] remove unused stub method (#8316)
OnReset was removed from the service interface and we missed deleting
this.
2022-04-13 19:20:56 +00:00
Sam Kleinman
c45367e22c rpc: avoid leaking threads (#8328) 2022-04-13 14:09:49 -04:00
M. J. Fromberger
29ad4dcb3b Remove resolved TODO comments. (#8325)
Resolved by merge of #8300.
2022-04-13 04:44:16 +00:00
Sam Kleinman
80b8c0057b state: remove unused weighted time (#8315) 2022-04-12 21:14:00 +00:00
Sam Kleinman
5d4d01b4e4 service: minor cleanup of comments (#8314) 2022-04-12 17:11:21 -04:00
Sam Kleinman
571d26fbb0 events: remove unused event code (#8313) 2022-04-12 14:58:14 -04:00
M. J. Fromberger
cf337cc3f2 Add configuration updates for Tendermint v0.36. (#8310)
* v36: remove [fastsync] and [blocksync] config sections
* v36: remove [blocksync], consolidate rename
* v36: remove gRPC options from [rpc]
* v36: add top-level mode setting
* v36: remove deprecated per-node consensus timeouts
* v36: remove vestigial mempool.wal-dir setting
* v36: add queue-type setting
* v36: add p2p connection limits
* v36: add or update statsync.fetchers
* v36: add statesync.use-p2p setting
2022-04-11 14:49:17 -07:00
William Banfield
969690d81c abci++: only include meaningful header fields in data passed-through to application (#8216)
closes: #7950
2022-04-11 20:27:50 +00:00
M. J. Fromberger
9ec30ecc0c Add configuration diff tool. (#8298)
* Add diff outputs as testdata.
* Normalize all samples to kebabs.
2022-04-11 12:41:27 -07:00
Ismail Khoffi
0e32ad9e5c Update outdated doc comment (#8309)
SetEventBus was deleted, same with the NopEventBus
2022-04-11 07:06:57 -07:00
Callum Waters
b7e87eef05 cli: add graceful catches to SIGINT (#8308) 2022-04-12 01:20:43 +12:00
dependabot[bot]
0ab2f31239 build(deps): Bump github.com/creachadair/tomledit from 0.0.11 to 0.0.13 (#8307)
Bumps [github.com/creachadair/tomledit](https://github.com/creachadair/tomledit) from 0.0.11 to 0.0.13.
<details>
<summary>Commits</summary>
<ul>
<li><a href="baee445826"><code>baee445</code></a> Release v0.0.13.</li>
<li><a href="8dfcc1b378"><code>8dfcc1b</code></a> Exercise insertion before comments.</li>
<li><a href="97f4e85ccf"><code>97f4e85</code></a> When inserting a key, push it before block comments.</li>
<li><a href="029089e311"><code>029089e</code></a> Release v0.0.12.</li>
<li><a href="d226405c2a"><code>d226405</code></a> Test finding the global table.</li>
<li><a href="34b7aad990"><code>34b7aad</code></a> Let FindTable return the global table with an empty name.</li>
<li>See full diff in <a href="https://github.com/creachadair/tomledit/compare/v0.0.11...v0.0.13">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/creachadair/tomledit&package-manager=go_modules&previous-version=0.0.11&new-version=0.0.13)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:47:05 +00:00
dependabot[bot]
9a46f575f5 build(deps): Bump actions/upload-artifact from 2 to 3 (#8303)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update default runtime to node16 (<a href="https://github-redirect.dependabot.com/actions/upload-artifact/issues/293">#293</a>)</li>
<li>Update package-lock.json file version to 2 (<a href="https://github-redirect.dependabot.com/actions/upload-artifact/issues/302">#302</a>)</li>
</ul>
<h3>Breaking Changes</h3>
<p>With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.</p>
<h2>v2.3.1</h2>
<p>Fix for empty fails on Windows failing on upload <a href="https://github-redirect.dependabot.com/actions/upload-artifact/issues/281">#281</a></p>
<h2>v2.3.0 Upload Artifact</h2>
<ul>
<li>Optimizations for faster uploads of larger files that are already compressed</li>
<li>Significantly improved logging when there are chunked uploads</li>
<li>Clarifications in logs around the upload size and prohibited characters that aren't allowed in the artifact name or any uploaded files</li>
<li>Various other small bugfixes &amp; optimizations</li>
</ul>
<h2>v2.2.4</h2>
<ul>
<li>Retry on HTTP 500 responses from the service</li>
</ul>
<h2>v2.2.3</h2>
<ul>
<li>Fixes for proxy related issues</li>
</ul>
<h2>v2.2.2</h2>
<ul>
<li>Improved retryability and error handling</li>
</ul>
<h2>v2.2.1</h2>
<ul>
<li>Update used actions/core package to the latest version</li>
</ul>
<h2>v2.2.0</h2>
<ul>
<li>Support for artifact retention</li>
</ul>
<h2>v2.1.4</h2>
<ul>
<li>Add Third Party License Information</li>
</ul>
<h2>v2.1.3</h2>
<ul>
<li>Use updated version of the <code>@action/artifact</code> NPM package</li>
</ul>
<h2>v2.1.2</h2>
<ul>
<li>Increase upload chunk size from 4MB to 8MB</li>
<li>Detect case insensitive file uploads</li>
</ul>
<h2>v2.1.1</h2>
<ul>
<li>Fix for certain symlinks not correctly being identified as directories before starting uploads</li>
</ul>
<h2>v2.1.0</h2>
<ul>
<li>Support for uploading artifacts with multiple paths</li>
<li>Support for using exclude paths</li>
<li>Updates to dependencies</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6673cd052c"><code>6673cd0</code></a> Update <code>lockfileVersion</code> in <code>package-lock.json</code> (<a href="https://github-redirect.dependabot.com/actions/upload-artifact/issues/302">#302</a>)</li>
<li><a href="2244c82003"><code>2244c82</code></a> Update to node16 (<a href="https://github-redirect.dependabot.com/actions/upload-artifact/issues/293">#293</a>)</li>
<li><a href="87348cee5f"><code>87348ce</code></a> Add 503 warning when uploading to the same artifact</li>
<li>See full diff in <a href="https://github.com/actions/upload-artifact/compare/v2...v3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:33:01 +00:00
dependabot[bot]
8c4e982616 build(deps): Bump actions/download-artifact from 2 to 3 (#8302)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/download-artifact/releases">actions/download-artifact's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update default runtime to node16 (<a href="https://github-redirect.dependabot.com/actions/download-artifact/pull/134">actions/download-artifact#134</a>)</li>
<li>Update package-lock.json file version to 2 (<a href="https://github-redirect.dependabot.com/actions/download-artifact/pull/136">actions/download-artifact#136</a>)</li>
</ul>
<h3>Breaking Changes</h3>
<p>With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.</p>
<h2>v2.1.0 Download Artifact</h2>
<ul>
<li>Improved output &amp; logging</li>
<li>Fixed issue where downloading all artifacts could cause display percentages to be over 100%</li>
<li>Various small bug fixes &amp; improvements</li>
</ul>
<h2>v2.0.10</h2>
<ul>
<li>Retry on HTTP 500 responses from the service</li>
</ul>
<h2>v2.0.9</h2>
<ul>
<li>Fixes to proxy related issues</li>
</ul>
<h2>v2.0.8</h2>
<ul>
<li>Improvements to retryability if an error is encountered during artifact download</li>
</ul>
<h2>v2.0.7 download-artifact</h2>
<ul>
<li>Improved download retry-ability if a partial download is encountered</li>
</ul>
<h2>v2.0.6</h2>
<p>Update actions/core NPM package that is used internally</p>
<h2>v2.0.5</h2>
<ul>
<li>Add Third Party License Information</li>
</ul>
<h2>v2.0.4</h2>
<ul>
<li>Use the latest version of the <code>@actions/artifact</code> NPM package</li>
</ul>
<h2>v2.0.3</h2>
<ul>
<li>Misc improvements</li>
</ul>
<h2>v2.0.2</h2>
<ul>
<li>Support for tilde expansion</li>
</ul>
<h2>v2.0.1</h2>
<ul>
<li>Download path output</li>
<li>Improved logging</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="fb598a63ae"><code>fb598a6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/actions/download-artifact/issues/136">#136</a> from actions/jtamsut/update-lockfile-version</li>
<li><a href="a4a09c5d7e"><code>a4a09c5</code></a> regenerate index.js</li>
<li><a href="9acf51df79"><code>9acf51d</code></a> regenerate package lock</li>
<li><a href="8821072325"><code>8821072</code></a> upgrade artifact version</li>
<li><a href="b8bbd3b64f"><code>b8bbd3b</code></a> regenerate lockfile</li>
<li><a href="6ee3d963e5"><code>6ee3d96</code></a> revert artifact version</li>
<li><a href="d4793f4e27"><code>d4793f4</code></a> update docs for v3</li>
<li><a href="2d338d2145"><code>2d338d2</code></a> upgrade package to v3</li>
<li><a href="360d0830b5"><code>360d083</code></a> update dependency on artifact lib</li>
<li><a href="d9b73cccac"><code>d9b73cc</code></a> update lock file</li>
<li>Additional commits viewable in <a href="https://github.com/actions/download-artifact/compare/v2...v3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/download-artifact&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:29:42 +00:00
dependabot[bot]
fa531d3da9 build(deps): Bump actions/stale from 4 to 5 (#8304)
Bumps [actions/stale](https://github.com/actions/stale) from 4 to 5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>Features</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/stale/pull/670">Update Runtime to node16</a></li>
</ul>
<h2>v4.1.0</h2>
<h1>Features</h1>
<ul>
<li><a href="9912fa74d1">Ability to exempt draft PRs</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/blob/main/CHANGELOG.md">actions/stale's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3cc1237663"><code>3cc1237</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/actions/stale/issues/670">#670</a> from actions/thboop/node16upgrade</li>
<li><a href="76e9fbc6ae"><code>76e9fbc</code></a> update node version</li>
<li><a href="6467b96231"><code>6467b96</code></a> Update default runtime to node16</li>
<li><a href="8af60513da"><code>8af6051</code></a> build(deps-dev): bump jest-circus from 27.2.0 to 27.4.6 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/665">#665</a>)</li>
<li><a href="7a7efcae1f"><code>7a7efca</code></a> Fix per issue operation count (<a href="https://github-redirect.dependabot.com/actions/stale/issues/662">#662</a>)</li>
<li><a href="04a1828bc1"><code>04a1828</code></a> build(deps-dev): bump ts-jest from 27.0.5 to 27.1.2 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/641">#641</a>)</li>
<li><a href="65ca3956bd"><code>65ca395</code></a> build(deps-dev): bump eslint-plugin-jest from 24.4.2 to 25.3.2 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/639">#639</a>)</li>
<li><a href="eee276c280"><code>eee276c</code></a> build(deps-dev): bump prettier from 2.4.1 to 2.5.1 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/628">#628</a>)</li>
<li><a href="6c2f9f3f54"><code>6c2f9f3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/actions/stale/issues/640">#640</a> from dmitry-shibanov/v-dmshib/fix-check-dist</li>
<li><a href="37323f14dd"><code>37323f1</code></a> fix check-dist.yml</li>
<li>Additional commits viewable in <a href="https://github.com/actions/stale/compare/v4...v5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:27:21 +00:00
dependabot[bot]
ce3b48febd build(deps): Bump actions/setup-go from 2 to 3 (#8305)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/setup-go/releases">actions/setup-go's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update default runtime to node16 (<a href="https://github-redirect.dependabot.com/actions/setup-go/pull/192">actions/setup-go#192</a>)</li>
<li>Update <code>package-lock.json</code> file version to 2 (<a href="https://github-redirect.dependabot.com/actions/setup-go/pull/193">actions/setup-go#193</a>) and <code>@types/node</code> to 16.11.25 (<a href="https://github-redirect.dependabot.com/actions/setup-go/pull/194">actions/setup-go#194</a>)</li>
<li>Remove the <code>stable</code> input and fix SemVer notation (<a href="https://github-redirect.dependabot.com/actions/setup-go/pull/195">actions/setup-go#195</a>)</li>
</ul>
<h3>Breaking Changes</h3>
<p>With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.</p>
<p>This new major release removes the <code>stable</code> input, so there is no need to specify additional input to use pre-release versions. This release also corrects the pre-release versions syntax to satisfy the SemVer notation (1.18.0-beta1 -&gt; 1.18.0-beta.1, 1.18.0-rc1 -&gt; 1.18.0-rc.1).</p>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v2
  - uses: actions/setup-go@v3
    with:
      go-version: '1.18.0-rc.1' 
  - run: go version
</code></pre>
<h2>Add check-latest input</h2>
<p>In scope of this release we add the <a href="https://github-redirect.dependabot.com/actions/setup-go/pull/186">check-latest</a> input. If <code>check-latest</code> is set to <code>true</code>, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a Go version will then be downloaded from <a href="https://github.com/actions/go-versions">go-versions</a> repository. By default <code>check-latest</code> is set to <code>false</code>.
Example of usage:</p>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v2
  - uses: actions/setup-go@v2
    with:
      go-version: '1.16'
      check-latest: true
  - run: go version
</code></pre>
<p>Moreover, we updated <code>@actions/core</code> from <code>1.2.6</code> to <code>1.6.0</code></p>
<h2>v2.1.5</h2>
<p>In scope of this release we updated <code>matchers.json</code>  to improve the problem matcher pattern. For more information please refer to this <a href="https://github-redirect.dependabot.com/actions/setup-go/pull/98">pull request</a></p>
<h2>v2.1.4</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix extractor selection on windows by <a href="https://github.com/paulcacheux"><code>@​paulcacheux</code></a> in <a href="https://github-redirect.dependabot.com/actions/setup-go/pull/141">actions/setup-go#141</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/paulcacheux"><code>@​paulcacheux</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/actions/setup-go/pull/141">actions/setup-go#141</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-go/compare/v2.1.3...v2.1.4">https://github.com/actions/setup-go/compare/v2.1.3...v2.1.4</a></p>
<h2>v2.1.3</h2>
<ul>
<li>Updated communication with runner to use environment files rather then workflow commands</li>
</ul>
<h2>v2.1.2</h2>
<p>This release includes vendored licenses for this action's npm dependencies.</p>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f6164bd8c8"><code>f6164bd</code></a> Remove stable input and fix SemVer notation (<a href="https://github-redirect.dependabot.com/actions/setup-go/issues/195">#195</a>)</li>
<li><a href="2bb2aab2fd"><code>2bb2aab</code></a> update types node (<a href="https://github-redirect.dependabot.com/actions/setup-go/issues/194">#194</a>)</li>
<li><a href="edcbc0c2cd"><code>edcbc0c</code></a> update lockfileVersion (<a href="https://github-redirect.dependabot.com/actions/setup-go/issues/193">#193</a>)</li>
<li><a href="fb9a043dd8"><code>fb9a043</code></a> Update default runtime to node16 (<a href="https://github-redirect.dependabot.com/actions/setup-go/issues/192">#192</a>)</li>
<li><a href="5b0ae0e97d"><code>5b0ae0e</code></a> Bump pathval from 1.1.0 to 1.1.1 (<a href="https://github-redirect.dependabot.com/actions/setup-go/issues/188">#188</a>)</li>
<li>See full diff in <a href="https://github.com/actions/setup-go/compare/v2...v3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-go&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:04:17 +00:00
dependabot[bot]
5235913e12 build(deps): Bump codecov/codecov-action from 2.1.0 to 3.0.0 (#8306)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/689">#689</a> Bump to node16 and small fixes</li>
</ul>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/688">#688</a> Incorporate <code>gcov</code> arguments for the Codecov uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/548">#548</a> build(deps-dev): bump jest-junit from 12.2.0 to 13.0.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/603">#603</a> [Snyk] Upgrade <code>@​actions/core</code> from 1.5.0 to 1.6.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/628">#628</a> build(deps): bump node-fetch from 2.6.1 to 3.1.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/634">#634</a> build(deps): bump node-fetch from 3.1.1 to 3.2.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/636">#636</a> build(deps): bump openpgp from 5.0.1 to 5.1.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/652">#652</a> build(deps-dev): bump <code>@​vercel/ncc</code> from 0.30.0 to 0.33.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/653">#653</a> build(deps-dev): bump <code>@​types/node</code> from 16.11.21 to 17.0.18</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/659">#659</a> build(deps-dev): bump <code>@​types/jest</code> from 27.4.0 to 27.4.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/667">#667</a> build(deps): bump actions/checkout from 2 to 3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/673">#673</a> build(deps): bump node-fetch from 3.2.0 to 3.2.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/683">#683</a> build(deps): bump minimist from 1.2.5 to 1.2.6</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/685">#685</a> build(deps): bump <code>@​actions/github</code> from 5.0.0 to 5.0.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/681">#681</a> build(deps-dev): bump <code>@​types/node</code> from 17.0.18 to 17.0.23</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/682">#682</a> build(deps-dev): bump typescript from 4.5.5 to 4.6.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/676">#676</a> build(deps): bump <code>@​actions/exec</code> from 1.1.0 to 1.1.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/675">#675</a> build(deps): bump openpgp from 5.1.0 to 5.2.1</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md">codecov/codecov-action's changelog</a>.</em></p>
<blockquote>
<h2>3.0.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/689">#689</a> Bump to node16 and small fixes</li>
</ul>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/688">#688</a> Incorporate <code>gcov</code> arguments for the Codecov uploader</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/548">#548</a> build(deps-dev): bump jest-junit from 12.2.0 to 13.0.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/603">#603</a> [Snyk] Upgrade <code>@​actions/core</code> from 1.5.0 to 1.6.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/628">#628</a> build(deps): bump node-fetch from 2.6.1 to 3.1.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/634">#634</a> build(deps): bump node-fetch from 3.1.1 to 3.2.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/636">#636</a> build(deps): bump openpgp from 5.0.1 to 5.1.0</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/652">#652</a> build(deps-dev): bump <code>@​vercel/ncc</code> from 0.30.0 to 0.33.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/653">#653</a> build(deps-dev): bump <code>@​types/node</code> from 16.11.21 to 17.0.18</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/659">#659</a> build(deps-dev): bump <code>@​types/jest</code> from 27.4.0 to 27.4.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/667">#667</a> build(deps): bump actions/checkout from 2 to 3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/673">#673</a> build(deps): bump node-fetch from 3.2.0 to 3.2.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/683">#683</a> build(deps): bump minimist from 1.2.5 to 1.2.6</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/685">#685</a> build(deps): bump <code>@​actions/github</code> from 5.0.0 to 5.0.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/681">#681</a> build(deps-dev): bump <code>@​types/node</code> from 17.0.18 to 17.0.23</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/682">#682</a> build(deps-dev): bump typescript from 4.5.5 to 4.6.3</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/676">#676</a> build(deps): bump <code>@​actions/exec</code> from 1.1.0 to 1.1.1</li>
<li><a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/675">#675</a> build(deps): bump openpgp from 5.1.0 to 5.2.1</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e3c560433a"><code>e3c5604</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/689">#689</a> from codecov/feat/gcov</li>
<li><a href="174efc5984"><code>174efc5</code></a> Update package-lock.json</li>
<li><a href="6243a75ef3"><code>6243a75</code></a> bump to 3.0.0</li>
<li><a href="0d6466ff9c"><code>0d6466f</code></a> Bump to node16</li>
<li><a href="d4729eeb39"><code>d4729ee</code></a> fetch.default</li>
<li><a href="351baf62fa"><code>351baf6</code></a> fix: bash</li>
<li><a href="d8cf6802a8"><code>d8cf680</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/675">#675</a> from codecov/dependabot/npm_and_yarn/openpgp-5.2.1</li>
<li><a href="b775e9013c"><code>b775e90</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/676">#676</a> from codecov/dependabot/npm_and_yarn/actions/exec-1.1.1</li>
<li><a href="2ebc2f0f6f"><code>2ebc2f0</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/682">#682</a> from codecov/dependabot/npm_and_yarn/typescript-4.6.3</li>
<li><a href="8e2ef2bfcc"><code>8e2ef2b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-action/issues/681">#681</a> from codecov/dependabot/npm_and_yarn/types/node-17.0.23</li>
<li>Additional commits viewable in <a href="https://github.com/codecov/codecov-action/compare/v2.1.0...v3.0.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=2.1.0&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-11 12:02:43 +00:00
M. J. Fromberger
4743a7ad0d confix: clean up and document transformations (#8301)
Right now the confix tool works up to v0.35. This change is preparation for
extending the tool to handle additional changes in v0.36.

Mostly this is adding documentation. The one functional change is to fix the
name of the moved "fast-sync" parameter, which was renamed "enable".

- Document the origin of each transformation step.
- Update fast-sync target name.
2022-04-10 19:37:54 -07:00
John Adler
f504089273 build: use go install instead of go get. (#8299) 2022-04-09 20:15:07 -07:00
Chill Validation
c53b71821c Fix a spelling error (#8297) 2022-04-09 11:42:47 -07:00
elias-orijtech
b91501cecf test/fuzz: update oss-fuzz build script to match reality (#8296)
p2p/pex and p2p/addrbook were deleted in 03ad7d6f20,
secret_connection was renamed to secretconnection in dd97ac6e1c.
2022-04-09 08:07:40 -07:00
M. J. Fromberger
322bb460dd keymigrate: fix decoding of block-hash row keys (#8294) 2022-04-09 07:20:08 -07:00
M. J. Fromberger
26b5672a54 Add a tool to update old config files to the latest version (#8281) 2022-04-08 19:40:03 -07:00
M. J. Fromberger
e6550f8686 Fix release notes to match the prevailing style. (#8292) 2022-04-08 18:02:49 -07:00
M. J. Fromberger
e565a4a1f5 Forward-port v0.35.3 changelog to master. (#8291) 2022-04-09 00:21:24 +00:00
William Banfield
6ff07a1633 switch to consensus change startup ordering (#8290) 2022-04-08 18:11:20 -04:00
Sam Kleinman
631ef7aae0 consensus: add nil check to gossip routine (#8288) 2022-04-08 17:13:10 -04:00
Sam Kleinman
3e3a934818 rpc: add more nil checks in the status end point (#8287) 2022-04-08 14:04:43 -04:00
Sam Kleinman
90b951af72 node+statesync: normalize initialization (#8275) 2022-04-08 11:00:58 -04:00
dependabot[bot]
5df277caca build(deps): Bump github.com/lib/pq from 1.10.4 to 1.10.5 (#8283)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.4 to 1.10.5.
<details>
<summary>Commits</summary>
<ul>
<li><a href="1ef134dc0e"><code>1ef134d</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/lib/pq/issues/1074">#1074</a> from lib/fix-assertions</li>
<li><a href="4b55993141"><code>4b55993</code></a> Avoid asserting on error message for cancel tests</li>
<li>See full diff in <a href="https://github.com/lib/pq/compare/v1.10.4...v1.10.5">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/lib/pq&package-manager=go_modules&previous-version=1.10.4&new-version=1.10.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-08 13:19:28 +00:00
M. J. Fromberger
53b7dbe285 Forward-port changelog for v0.34.19 to master. (#8279) 2022-04-07 22:30:48 +00:00
M. J. Fromberger
f3858e52de scmigrate: ensure target key is correctly renamed (#8276)
Prior to v0.35, the keys for seen-commit records included the applicable
height.  In v0.35 and beyond, we only keep the record for the latest height,
and its key does not include the height.

Update the seen-commit migration to ensure that the record we retain after
migration is correctly renamed to omit the height from its key.

Update the test cases to check for this condition after migrating.
2022-04-07 15:09:09 -07:00
Sam Kleinman
9d20e06900 statesync+blocksync: move event publications into the sync operations (#8274) 2022-04-07 16:23:36 -04:00
Sam Kleinman
6ed3f2d98d node: move handshake out of constructor (#8264) 2022-04-07 11:21:10 -04:00
Sam Kleinman
681cdf8347 consensus: avoid panics during handshake (#8266)
There's no case where we recieve an error during handshake and don't
just return/continue, and it's at a point during startup where not
much is going on in the process, so having some classes of errors
return errors and some return panics is confusing and doesn't protect
anything.
2022-04-07 12:58:44 +00:00
M. J. Fromberger
14f41ac5e3 Fix more broken Markdown links. (#8271) 2022-04-07 00:15:20 -07:00
Sam Kleinman
7678ab8850 statesync: tweak test performance (#8267) 2022-04-06 21:50:14 +00:00
M. J. Fromberger
025894c11d Forward-port changelogs from v0.34.17 and v0.34.18 to master. (#8265)
* Forward-port changelogs from v0.34.17 and v0.34.18 to master.
* Fix broken markdown links.
2022-04-06 13:58:57 -07:00
Sam Kleinman
85364a9ba8 node: reorder service construction (#8262) 2022-04-06 14:59:30 -04:00
Sam Kleinman
d153388446 p2p: inject nodeinfo into router (#8261) 2022-04-06 14:02:07 -04:00
Sam Kleinman
2304ea70f7 consensus: remove string indented function (#8257) 2022-04-06 08:07:21 -07:00
dependabot[bot]
60f88194ec build(deps): Bump github.com/BurntSushi/toml from 1.0.0 to 1.1.0 (#8251)
Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.0.0 to 1.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/BurntSushi/toml/releases">github.com/BurntSushi/toml's releases</a>.</em></p>
<blockquote>
<h2>v1.1.0</h2>
<p>Just a few bugfixes:</p>
<ul>
<li>
<p>Skip fields with <code>toml:&quot;-&quot;</code> even when they're unsupported types. Previously something like this would fail to encode due to <code>func</code> being an unsupported type:</p>
<pre><code>struct {
    Str  string `toml:&quot;str&quot;
    Func func() `toml:&quot;-&quot;`
}
</code></pre>
</li>
<li>
<p>Multiline strings can't end with <code>\</code>. This is valid:</p>
<pre><code># Valid
key = &quot;&quot;&quot; foo \
&quot;&quot;&quot;
<h1>Invalid</h1>
<p>key = &quot;&quot;&quot; foo \ &quot;&quot;&quot;
</code></pre></p>
</li>
<li>
<p>Don't quote values in <code>TOMLMarshaler</code>. Previously they would always include quoting (e.g. <code>&quot;value&quot;</code>), while the entire point of this interface is to bypass that.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="891d2617dd"><code>891d261</code></a> Don't error out if a multiline string ends with an incomplete UTF-8 sequence</li>
<li><a href="ef65e34f3f"><code>ef65e34</code></a> Don't run Unmarshal() through Decode()</li>
<li><a href="573cad4c89"><code>573cad4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/BurntSushi/toml/issues/347">#347</a> from zhsj/fix-32</li>
<li><a href="f3633f4f90"><code>f3633f4</code></a> Fix test on 32 bit arch</li>
<li><a href="551f4a51e9"><code>551f4a5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/BurntSushi/toml/issues/344">#344</a> from lucasbutn/hotfix-341-marshaler-shouldnot-writequ...</li>
<li><a href="dec58255de"><code>dec5825</code></a> Removed write quote in marshal to allow write other types than strings</li>
<li><a href="2249a9c68e"><code>2249a9c</code></a> Multiline strings can't end with &quot;&quot;</li>
<li><a href="51b22f2fef"><code>51b22f2</code></a> Fix README</li>
<li><a href="01e551605f"><code>01e5516</code></a> Skip fields with toml:&quot;-&quot;, even when they're unsupported types</li>
<li><a href="87b9f055f4"><code>87b9f05</code></a> Fix tests for older Go versions</li>
<li>See full diff in <a href="https://github.com/BurntSushi/toml/compare/v1.0.0...v1.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/BurntSushi/toml&package-manager=go_modules&previous-version=1.0.0&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-05 16:56:48 +00:00
dependabot[bot]
0a23b1e51d build(deps): Bump github.com/vektra/mockery/v2 from 2.10.2 to 2.10.4 (#8250)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.10.2 to 2.10.4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.10.4</h2>
<h2>Changelog</h2>
<ul>
<li>c943e69 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/441">#441</a> from cfstras/fix/support-more-env-keys</li>
<li>ed87cf6 fix: allow configuring flags with &quot;-&quot; as Env var</li>
<li>17abd96 fix: unused config field <code>Tags</code></li>
<li>53114cf test: add test for env var configurations</li>
</ul>
<h2>v2.10.3</h2>
<h2>Changelog</h2>
<ul>
<li>ee25bcf Add/update mocks</li>
<li>4703d1a Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/444">#444</a> from vektra/remove_need_deps</li>
<li>ba1f213 Remove packages.NeedDeps</li>
<li>ed38b20 Update go.sum</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="c943e696a0"><code>c943e69</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/441">#441</a> from cfstras/fix/support-more-env-keys</li>
<li><a href="4703d1a42f"><code>4703d1a</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/444">#444</a> from vektra/remove_need_deps</li>
<li><a href="ed38b20a49"><code>ed38b20</code></a> Update go.sum</li>
<li><a href="ee25bcfcb5"><code>ee25bcf</code></a> Add/update mocks</li>
<li><a href="ba1f213e17"><code>ba1f213</code></a> Remove packages.NeedDeps</li>
<li><a href="17abd96c57"><code>17abd96</code></a> fix: unused config field <code>Tags</code></li>
<li><a href="53114cfce4"><code>53114cf</code></a> test: add test for env var configurations</li>
<li><a href="ed87cf671a"><code>ed87cf6</code></a> fix: allow configuring flags with &quot;-&quot; as Env var</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.10.2...v2.10.4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.10.2&new-version=2.10.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-05 15:47:24 +00:00
Sam Kleinman
9d1e8eaad4 node: remove channel and peer update initialization from construction (#8238) 2022-04-05 13:26:53 +00:00
Sam Kleinman
97f7021712 statesync: merge channel processing (#8240) 2022-04-04 12:31:15 -04:00
dependabot[bot]
cb8e6b1c1a build(deps): Bump github.com/vektra/mockery/v2 from 2.10.1 to 2.10.2 (#8246)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.10.1 to 2.10.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.10.2</h2>
<h2>Changelog</h2>
<ul>
<li>8384e25 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/443">#443</a> from OrlovEvgeny/fix-build-go-version</li>
<li>408740d fix: golang build version</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8384e25927"><code>8384e25</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/443">#443</a> from OrlovEvgeny/fix-build-go-version</li>
<li><a href="408740d185"><code>408740d</code></a> fix: golang build version</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.10.1...v2.10.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.10.1&new-version=2.10.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-04-04 14:25:00 +00:00
Sergio Mena
8df38db82e Remove ModifiedTxStatus from the spec and the code (#8210)
* Outstanding abci-gen changes to 'pb.go' files

* Removed modified_tx_status from spec and protobufs

* Fix sed for OSX

* Regenerated abci protobufs with 'abci-proto-gen'

* Code changes. UTs e2e tests passing

* Recovered UT: TestPrepareProposalModifiedTxStatusFalse

* Adapted UT

* Fixed UT

* Revert "Fix sed for OSX"

This reverts commit e576708c61.

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update internal/state/execution_test.go

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Addressed some comments

* Added one test that tests error at the ABCI client + Fixed some mock calls

* Addressed remaining comments

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update abci/example/kvstore/kvstore.go

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update spec/abci++/abci++_tmint_expected_behavior_002_draft.md

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Addressed William's latest comments

* Adressed Michael's comment

* Fixed UT

* Some md fixes

* More md fixes

* gofmt

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-04-04 12:43:01 +02:00
dependabot[bot]
9fe25a1ed1 build(deps): Bump bufbuild/buf-setup-action from 1.3.0 to 1.3.1 (#8245) 2022-04-04 11:49:00 +02:00
William Banfield
99f9ee0f63 abci++: correct max-size check to only operate on added and unmodified (#8242) 2022-04-01 17:44:38 -04:00
Sergio Mena
4a504c0687 e2e: Fix hashing for app + Fix logic of TestApp_Hash (#8229)
* Fix hashing of e2e App

* Fix TestApp_Hash

* CaMeL

* Update test/e2e/app/state.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* for-->Eventually + if-->require

* Update test/e2e/tests/app_test.go

Co-authored-by: Sam Kleinman <garen@tychoish.com>

* fix lint

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
2022-03-31 22:21:25 +02:00
Sam Kleinman
b68424be47 light: remove untracked close channel (#8228) 2022-03-31 18:48:26 +00:00
Sam Kleinman
a79dd42d24 lint: bump linter version in ci (#8234) 2022-03-31 14:37:13 -04:00
Sam Kleinman
6af23ff757 state: avoid premature genericism (#8224) 2022-03-31 13:10:09 +00:00
dependabot[bot]
d1722c9c10 build(deps): Bump github.com/vektra/mockery/v2 from 2.10.0 to 2.10.1 (#8226)
Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.10.0 to 2.10.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vektra/mockery/releases">github.com/vektra/mockery/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.10.1</h2>
<h2>Changelog</h2>
<ul>
<li>fa0080c Fix config.GetSemverInfo() for Go 1.18</li>
<li>4e181be Load packages with dependencies for Go 1.18</li>
<li>232f954 Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/435">#435</a> from emmanuel099/master</li>
<li>b11695e Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/436">#436</a> from emmanuel099/test_with_3.18</li>
<li>e0e183b Test with Go 1.18</li>
<li>adda07f Update README.md</li>
<li>5f5570d Update README.md</li>
<li>4fc5912 Update README.md</li>
<li>fa2d82d Update README.md</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b11695e6d4"><code>b11695e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/436">#436</a> from emmanuel099/test_with_3.18</li>
<li><a href="232f954622"><code>232f954</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/vektra/mockery/issues/435">#435</a> from emmanuel099/master</li>
<li><a href="fa0080cf03"><code>fa0080c</code></a> Fix config.GetSemverInfo() for Go 1.18</li>
<li><a href="e0e183bcb9"><code>e0e183b</code></a> Test with Go 1.18</li>
<li><a href="4e181be712"><code>4e181be</code></a> Load packages with dependencies for Go 1.18</li>
<li><a href="adda07f546"><code>adda07f</code></a> Update README.md</li>
<li><a href="5f5570d72d"><code>5f5570d</code></a> Update README.md</li>
<li><a href="4fc5912f49"><code>4fc5912</code></a> Update README.md</li>
<li><a href="fa2d82d34d"><code>fa2d82d</code></a> Update README.md</li>
<li>See full diff in <a href="https://github.com/vektra/mockery/compare/v2.10.0...v2.10.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/vektra/mockery/v2&package-manager=go_modules&previous-version=2.10.0&new-version=2.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-31 12:58:41 +00:00
William Banfield
6ed2c42d7b Document steps for updating the timeout parameters. (#8217)
closes: #8182 

This pull request adds documentation to the `UPGRADING.md` file as well as a set of deprecation checks for the old timeout parameters in the `config.toml` file. It additionally documents the parameters in the `genesis.md`.
2022-03-30 22:11:48 +00:00
M. J. Fromberger
185f15d645 config: default indexer configuration to null (#8222)
After this change, new nodes will not have indexing enabled by default.
Test configurations will still use "kv".

* Update pending changelog and upgrading notes.
* Fix indexer config for the test app.
* Update config template and enable indexing for e2e tests.
2022-03-30 13:47:52 -07:00
M. J. Fromberger
dfb322e68b Fix broken Markdown links (#8214)
- Remove pointless Makefile and package documentation.
- Fix broken links.
2022-03-29 12:07:12 -07:00
M. J. Fromberger
3d0d89e505 Re-enable markdown link checker. (#8212)
The upstream fix for link syntax has landed.

- Uncomment the workflow and bump the version.
- Add a config file to encourage retries.
2022-03-29 11:32:22 -07:00
Sam Kleinman
9e643f3628 migration: remove stale seen commits (#8205) 2022-03-29 12:31:37 -04:00
Simon Kirillov
1949095c51 Fix empty tendermint version in Docker (#8161)
* Fix Dockerfile and scripts

* Fix docker scripts

* Remove unused scripts

* Retrigger checks

Co-authored-by: Simon Kirillov <skirillov@wallarm.com>
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
2022-03-29 12:06:32 -04:00
William Banfield
41a1bf539b timeout parameters take the default if not set (#8189) 2022-03-28 18:25:19 -04:00
William Banfield
462c475abc consensus: timeout params in toml used as overrides (#8186)
Replaces the set of timeout parameters in the config.toml file with unsafe-*override versions of the corresponding ConsensusParams.Timeout field. These fields can be used for the duration of v0.36 to override the consensus param in case of emergency.

Adds a set to the ./internal/consensus/State type for correctly calculating the value of each timeout based on the set of overrides specified.
2022-03-28 17:33:23 -04:00
Sergio Mena
9d56520f76 Update ABCI++ spec with decisions taken in the bi-weekly meeting (#8191)
* Clarify 0-length vote extensions in the spec, according to #8174

* Update spec so that Tendermnit can propose more txs than the size limit in

* Addressed Manu's comment

* Reworded size limit following Manu's suggestion
2022-03-28 21:15:35 +02:00
dependabot[bot]
14f5588ce2 build(deps): Bump github.com/adlio/schema from 1.2.3 to 1.3.0 (#8201)
Bumps [github.com/adlio/schema](https://github.com/adlio/schema) from 1.2.3 to 1.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/adlio/schema/releases">github.com/adlio/schema's releases</a>.</em></p>
<blockquote>
<h2>1.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Initial SQL Server support from <a href="https://github.com/pubkraal"><code>@​pubkraal</code></a> in <a href="https://github-redirect.dependabot.com/adlio/schema/pull/15">adlio/schema#15</a></li>
<li>Fix tests on M1 Macs by <a href="https://github.com/adlio"><code>@​adlio</code></a> in <a href="https://github-redirect.dependabot.com/adlio/schema/pull/16">adlio/schema#16</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/pubkraal"><code>@​pubkraal</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/adlio/schema/pull/15">adlio/schema#15</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/adlio/schema/compare/v1.2.3...v1.3.0">https://github.com/adlio/schema/compare/v1.2.3...v1.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="0c0c352416"><code>0c0c352</code></a> Merge branch 'pubkraal-mssql'</li>
<li><a href="cdf157e39b"><code>cdf157e</code></a> NOT NULL consistency for applied_at column</li>
<li><a href="f32be8707e"><code>f32be87</code></a> README updates to caveat the SQL Server support</li>
<li><a href="a48b8286a4"><code>a48b828</code></a> Skip SQL Server tests on ARM</li>
<li><a href="3b7371832c"><code>3b73718</code></a> Merge branch 'mssql' of <a href="https://github.com/pubkraal/schema">https://github.com/pubkraal/schema</a> into pubkraal-mssql</li>
<li><a href="1aa7823276"><code>1aa7823</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/adlio/schema/issues/16">#16</a> from adlio/m1-testing</li>
<li><a href="bc8352411b"><code>bc83524</code></a> Fix time zone assertion failing during DST</li>
<li><a href="cfb349ddeb"><code>cfb349d</code></a> M1 Mac Support for Testing</li>
<li><a href="c2400eac57"><code>c2400ea</code></a> feat: add mssql support</li>
<li><a href="531e542ba4"><code>531e542</code></a> README updates.</li>
<li>See full diff in <a href="https://github.com/adlio/schema/compare/v1.2.3...v1.3.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/adlio/schema&package-manager=go_modules&previous-version=1.2.3&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-28 13:59:24 +00:00
dependabot[bot]
3945915920 build(deps): Bump bufbuild/buf-setup-action from 1.1.0 to 1.3.0 (#8199) 2022-03-28 09:20:46 -04:00
dependabot[bot]
0af58409bf build(deps): Bump minimist from 1.2.5 to 1.2.6 in /docs (#8196)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-25 12:39:20 -07:00
dependabot[bot]
7d39f639f6 build(deps): Bump github.com/golangci/golangci-lint from 1.45.0 to 1.45.2 (#8192)
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.45.0 to 1.45.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/golangci/golangci-lint/releases">github.com/golangci/golangci-lint's releases</a>.</em></p>
<blockquote>
<h2>v1.45.2</h2>
<h2>Changelog</h2>
<ul>
<li>8bdc4d3f fix: help command (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2681">#2681</a>)</li>
</ul>
<h2>v1.45.1</h2>
<h2>Changelog</h2>
<ul>
<li>da0a6b3b build(deps): bump actions/cache from 2.1.7 to 3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2674">#2674</a>)</li>
<li>e187dd8a build(deps): bump github.com/hashicorp/go-version from 1.2.1 to 1.4.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2659">#2659</a>)</li>
<li>ec8d6894 build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2660">#2660</a>)</li>
<li>243ec6f0 bump varnamelen to v0.6.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2656">#2656</a>)</li>
<li>8f7f44d1 depguard: reduce requirements (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2672">#2672</a>)</li>
<li>7bbbe77e feat: automatic Go version detection (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2669">#2669</a>)</li>
<li>f0554415 fix: disable structcheck with go1.18 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2666">#2666</a>)</li>
<li>93feed1d fix: update base images (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2661">#2661</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md">github.com/golangci/golangci-lint's changelog</a>.</em></p>
<blockquote>
<h3>v1.45.2</h3>
<ol>
<li>misc:
<ul>
<li>fix: help command</li>
</ul>
</li>
</ol>
<h3>v1.45.1</h3>
<ol>
<li>updated linters:
<ul>
<li><code>interfacer</code>: inactivate with go1.18</li>
<li><code>govet</code>: inactivate unsupported analyzers (go1.18)</li>
<li><code>depguard</code>: reduce requirements</li>
<li><code>structcheck</code>: inactivate with go1.18</li>
<li><code>varnamelen</code>: bump from v0.6.0 to v0.6.1</li>
</ul>
</li>
<li>misc:
<ul>
<li>Automatic Go version detection 🎉 (go1.18)</li>
<li>docker: update base images (go1.18)</li>
</ul>
</li>
</ol>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8bdc4d3f80"><code>8bdc4d3</code></a> fix: help command (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2681">#2681</a>)</li>
<li><a href="7bbbe77e5e"><code>7bbbe77</code></a> feat: automatic Go version detection (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2669">#2669</a>)</li>
<li><a href="da0a6b3b8a"><code>da0a6b3</code></a> build(deps): bump actions/cache from 2.1.7 to 3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2674">#2674</a>)</li>
<li><a href="8f7f44d175"><code>8f7f44d</code></a> depguard: reduce requirements (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2672">#2672</a>)</li>
<li><a href="f055441536"><code>f055441</code></a> fix: disable structcheck with go1.18 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2666">#2666</a>)</li>
<li><a href="cd37b5c31d"><code>cd37b5c</code></a> docs: fix GitHub Releases Stats badge link. (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2665">#2665</a>)</li>
<li><a href="93feed1d63"><code>93feed1</code></a> fix: update base images (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2661">#2661</a>)</li>
<li><a href="ec8d6894ed"><code>ec8d689</code></a> build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2660">#2660</a>)</li>
<li><a href="e187dd8ac8"><code>e187dd8</code></a> build(deps): bump github.com/hashicorp/go-version from 1.2.1 to 1.4.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2659">#2659</a>)</li>
<li><a href="243ec6f000"><code>243ec6f</code></a> bump varnamelen to v0.6.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2656">#2656</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/golangci/golangci-lint/compare/v1.45.0...v1.45.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/golangci/golangci-lint&package-manager=go_modules&previous-version=1.45.0&new-version=1.45.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-25 19:30:52 +00:00
William Banfield
e4ae922c33 consensus: update state machine to use the new consensus params (#8181) 2022-03-23 11:26:42 -04:00
Sam Kleinman
cbce877480 consensus: add leaktest check to replay tests (#8185) 2022-03-23 00:00:08 +00:00
Sam Kleinman
b29cc95920 consensus: cleanup tempfile explictly (#8184) 2022-03-22 17:41:00 -04:00
Sam Kleinman
0c9558a742 consensus: avoid panic during shutdown (#8170) 2022-03-22 15:28:33 -04:00
William Banfield
e2fc50ec9f types: add TimeoutParams into ConsensusParams structs (#8177) 2022-03-22 11:19:54 -04:00
William Banfield
2361e0c65c abci++: remove CheckTx call from PrepareProposal flow (#8176) 2022-03-22 10:03:35 -04:00
dependabot[bot]
e2365c1368 build(deps): Bump github.com/golangci/golangci-lint from 1.44.2 to 1.45.0 (#8169)
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.44.2 to 1.45.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/golangci/golangci-lint/releases">github.com/golangci/golangci-lint's releases</a>.</em></p>
<blockquote>
<h2>v1.45.0</h2>
<h2>Changelog</h2>
<ul>
<li>ea1df6f1 Default to YAML when config file has no extension (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2618">#2618</a>)</li>
<li>93a0015c build(deps): bump actions/checkout from 2 to 3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2643">#2643</a>)</li>
<li>176ef3f7 build(deps): bump actions/setup-node from 2 to 3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2628">#2628</a>)</li>
<li>adc0d8ec build(deps): bump github.com/ashanbrown/makezero from 1.1.0 to 1.1.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2621">#2621</a>)</li>
<li>8f9bc4a7 build(deps): bump github.com/daixiang0/gci from 0.3.1 to 0.3.2 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2640">#2640</a>)</li>
<li>6fc688ae build(deps): bump github.com/securego/gosec/v2 from 2.9.6 to 2.10.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2624">#2624</a>)</li>
<li>da08d2bd build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.1 to 3.22.2 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2641">#2641</a>)</li>
<li>873a27e7 build(deps): bump github.com/sivchari/containedctx from 1.0.1 to 1.0.2 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2623">#2623</a>)</li>
<li>ec952367 build(deps): bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2646">#2646</a>)</li>
<li>0e7233eb build(deps): bump github.com/tomarrell/wrapcheck/v2 from 2.4.0 to 2.5.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2603">#2603</a>)</li>
<li>0bcc0a3b build(deps): bump golangci/golangci-lint-action from 2.5.2 to 3.1.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2627">#2627</a>)</li>
<li>5ffadacb build(deps): bump mvdan.cc/gofumpt from 0.2.1 to 0.3.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2622">#2622</a>)</li>
<li>d5ebd7eb build(deps): bump node-fetch in /.github/contributors (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2616">#2616</a>)</li>
<li>5ddb5e7a bump github.com/daixiang0/gci to v0.3.1 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2596">#2596</a>)</li>
<li>56d77e2b bump github.com/denis-tingaikin/go-header from 0.4.2 to 0.4.3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2614">#2614</a>)</li>
<li>2f689958 errcheck: add an option to remove default exclusions (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2607">#2607</a>)</li>
<li>1f4c1ed9 fix: completion for fish-shell</li>
<li>0c0804c6 go1.18 support (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2438">#2438</a>)</li>
<li>42ca6449 gofumpt: add module-path setting (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2644">#2644</a>)</li>
<li>30c6166b revive: fix default values (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2611">#2611</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md">github.com/golangci/golangci-lint's changelog</a>.</em></p>
<blockquote>
<h3>v1.45.0</h3>
<ol>
<li>updated linters:
<ul>
<li><code>cobra</code>: from 1.3.0 to 1.4.0</li>
<li><code>containedctx</code>: from 1.0.1 to 1.0.2</li>
<li><code>errcheck</code>: add an option to remove default exclusions</li>
<li><code>gci</code>: from 0.3.1 to 0.3.2</li>
<li><code>go-header</code>: from 0.4.2 to 0.4.3</li>
<li><code>gofumpt</code>: add module-path setting</li>
<li><code>gofumpt</code>: from 0.2.1 to 0.3.0</li>
<li><code>gopsutil</code>: from 3.22.1 to 3.22.2</li>
<li><code>gosec</code>: from 2.9.6 to 2.10.0</li>
<li><code>makezero</code>: from 1.1.0 to 1.1.1</li>
<li><code>revive</code>: fix default values</li>
<li><code>wrapcheck</code>: from 2.4.0 to 2.5.0</li>
</ul>
</li>
<li>documentation:
<ul>
<li>docs: add &quot;back to the top&quot; button</li>
<li>docs: add <code>forbidigo</code> example that uses comments</li>
<li>docs: improve linters page</li>
</ul>
</li>
<li>misc:
<ul>
<li>go1.18 support 🎉</li>
<li>Add an option to manage the targeted version of Go</li>
<li>Default to YAML when config file has no extension</li>
</ul>
</li>
</ol>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="1f4c1ed9f9"><code>1f4c1ed</code></a> fix: completion for fish-shell</li>
<li><a href="0c0804c6a4"><code>0c0804c</code></a> go1.18 support (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2438">#2438</a>)</li>
<li><a href="ec952367e9"><code>ec95236</code></a> build(deps): bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2646">#2646</a>)</li>
<li><a href="42ca644953"><code>42ca644</code></a> gofumpt: add module-path setting (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2644">#2644</a>)</li>
<li><a href="93a0015cfc"><code>93a0015</code></a> build(deps): bump actions/checkout from 2 to 3 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2643">#2643</a>)</li>
<li><a href="d7b28ca346"><code>d7b28ca</code></a> build(deps): bump normalize-url from 4.5.0 to 4.5.1 in /docs (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2642">#2642</a>)</li>
<li><a href="da08d2bd2a"><code>da08d2b</code></a> build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.1 to 3.22.2 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2641">#2641</a>)</li>
<li><a href="8f9bc4a794"><code>8f9bc4a</code></a> build(deps): bump github.com/daixiang0/gci from 0.3.1 to 0.3.2 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2640">#2640</a>)</li>
<li><a href="41646f256f"><code>41646f2</code></a> build(deps): bump gatsby-plugin-manifest from 4.7.0 to 4.9.0 in /docs (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2635">#2635</a>)</li>
<li><a href="fdd7218ead"><code>fdd7218</code></a> build(deps): bump <code>@​emotion/react</code> from 11.7.1 to 11.8.1 in /docs (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint/issues/2634">#2634</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/golangci/golangci-lint/compare/v1.44.2...v1.45.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/golangci/golangci-lint&package-manager=go_modules&previous-version=1.44.2&new-version=1.45.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-21 22:31:49 +00:00
Sam Kleinman
43943d2dce rollback: cleanup second node during test (#8175) 2022-03-21 16:13:43 -04:00
William Banfield
cc838a5a19 ABCI++: Update new protos to use enum instead of bool (#8158)
closes: #8039 

This pull request updates the new ABCI++ protos to use `enum`s in place of `bool`s. `enums` may be preferred over `bool` because an `enum` can be udpated to include new statuses in the future, whereas a `bool` cannot and is fixed as just `true` or `false` over the whole lifecycle of the API.
2022-03-21 16:57:34 +00:00
Sam Kleinman
c33be0a410 state: propogate error from state store (#8171)
* state: propogate error from state store

* fix lint
2022-03-21 15:28:42 +00:00
Sam Kleinman
c680cca96e consensus: reduce size of test fixtures and logging rate (#8172)
We can reduce the size of test fixtures (which will improve test
reliability) without impacting these tests' primary role (which is
correctness.)

Also reducing these test logging will make the tests easier to read,
which whill be a good quality of life improvement for devs.
2022-03-21 15:07:52 +00:00
dependabot[bot]
039fef14e0 build(deps): Bump docker/build-push-action from 2.9.0 to 2.10.0 (#8167)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.9.0 to 2.10.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/build-push-action/releases">docker/build-push-action's releases</a>.</em></p>
<blockquote>
<h2>v2.10.0</h2>
<ul>
<li>Add <code>imageid</code> output and use metadata to set <code>digest</code> output (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/569">#569</a>)</li>
<li>Add <code>build-contexts</code> input (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/563">#563</a>)</li>
<li>Enhance outputs display (<a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/559">#559</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="ac9327eae2"><code>ac9327e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/563">#563</a> from crazy-max/new-inputs</li>
<li><a href="7c41daf2a5"><code>7c41daf</code></a> <code>build-contexts</code> input</li>
<li><a href="e115266953"><code>e115266</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/569">#569</a> from crazy-max/imageid-digest</li>
<li><a href="50fa0058d9"><code>50fa005</code></a> add imageid output and use metadata to set digest output</li>
<li><a href="309fb9180f"><code>309fb91</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/568">#568</a> from docker/dependabot/github_actions/actions/checkout-3</li>
<li><a href="db68526220"><code>db68526</code></a> Bump actions/checkout from 2 to 3</li>
<li><a href="fe02965b48"><code>fe02965</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/build-push-action/issues/559">#559</a> from crazy-max/outputs</li>
<li><a href="5af8693d82"><code>5af8693</code></a> Enhance outputs display</li>
<li>See full diff in <a href="https://github.com/docker/build-push-action/compare/v2.9.0...v2.10.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=2.9.0&new-version=2.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-21 13:56:13 +00:00
dependabot[bot]
3a75fbceec build(deps): Bump gaurav-nelson/github-action-markdown-link-check from 1.0.13 to 1.0.14 (#8166)
Bumps [gaurav-nelson/github-action-markdown-link-check](https://github.com/gaurav-nelson/github-action-markdown-link-check) from 1.0.13 to 1.0.14.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/gaurav-nelson/github-action-markdown-link-check/releases">gaurav-nelson/github-action-markdown-link-check's releases</a>.</em></p>
<blockquote>
<h2>1.0.14</h2>
<h2>Changes</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/gaurav-nelson/github-action-markdown-link-check/pull/116">gaurav-nelson/github-action-markdown-link-check#116</a> - Changed the base image to more stage Node image <code>node:lts-alpine</code></li>
<li><a href="https://github-redirect.dependabot.com/gaurav-nelson/github-action-markdown-link-check/pull/126">gaurav-nelson/github-action-markdown-link-check#126</a> - Use markdown-link-check version 3.9.3</li>
</ul>
<p>Thank you <a href="https://github.com/thanethomson"><code>@​thanethomson</code></a> <a href="https://github.com/edumco"><code>@​edumco</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="58f84fd654"><code>58f84fd</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gaurav-nelson/github-action-markdown-link-check/issues/116">#116</a> from edumco/docker-update</li>
<li><a href="56618d65ea"><code>56618d6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gaurav-nelson/github-action-markdown-link-check/issues/126">#126</a> from thanethomson/bump-mlc-version</li>
<li><a href="611438d456"><code>611438d</code></a> Bump markdown-link-check version to 3.9.3</li>
<li><a href="8f0156cc69"><code>8f0156c</code></a> Update Ko-fi link</li>
<li><a href="af2ced5c1b"><code>af2ced5</code></a> Changes base image to LTS</li>
<li><a href="9de9db77de"><code>9de9db7</code></a> Fixed broken link</li>
<li>See full diff in <a href="https://github.com/gaurav-nelson/github-action-markdown-link-check/compare/1.0.13...1.0.14">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=gaurav-nelson/github-action-markdown-link-check&package-manager=github_actions&previous-version=1.0.13&new-version=1.0.14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-21 12:42:01 +00:00
M. J. Fromberger
ea964e2133 node: always sync with the application at startup (#8159) 2022-03-19 21:18:17 -07:00
William Banfield
485c96b0d3 consensus: change lock handling in reactor and handleMsg for RoundState (forward-port #7994 #7992) (#8139)
Related to #8157
2022-03-18 18:59:44 +00:00
Sam Kleinman
9a833a8495 consensus: skip channel close during shutdown (#8155)
I see this panic in tests occasionally, and I don't think there's any
need to close this channel:

- it's only sent to in one place which has a select case with a
  default clause, so there's no chance of deadlocks.

- the only place we recieve from it thas a timeout.
2022-03-18 18:35:42 +00:00
Sam Kleinman
0bded371c5 testing: logger cleanup (#8153)
This contains two major changes:

- Remove the legacy test logging method, and just explicitly call the
  noop logger. This is just to make the test logging behavior more
  coherent and clear. 
  
- Move the logging in the light package from the testing.T logger to
  the noop logger. It's really the case that we very rarely need/want
  to consider test logs unless we're doing reproductions and running a
  narrow set of tests.
  
In most cases, I (for one) prefer to run in verbose mode so I can
watch progress of tests, but I basically never need to consider
logs. If I do want to see logs, then I can edit in the testing.T
logger locally (which is what you have to do today, anyway.)
2022-03-18 17:39:38 +00:00
Sam Kleinman
12d13cd31d mempool: reduce size of test (#8152)
This is failing intermittently, but it's a really simple test, and I
suspect that we're just running into thread scheduling issues on CI
nodes. I don't think making the test smaller reduces the utility of
this test.
2022-03-18 16:55:10 +00:00
William Banfield
bba8367aac state: panic on ResponsePrepareProposal validation error (#8145)
* state: panic on ResponsePrepareProposal validation error

* lint++

Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-18 16:42:29 +00:00
Sam Kleinman
f1a8f47d4d types: minor cleanup of un or minimally used types (#8154) 2022-03-18 16:27:10 +00:00
Sam Kleinman
f61e6e4201 autofile: remove vestigal close mechanism (#8150) 2022-03-18 12:05:53 -04:00
Sam Kleinman
1db41663c7 consensus: avoid race in accessing channel (#8149) 2022-03-18 09:54:40 -04:00
Sam Kleinman
5e0e05f938 consensus: avoid persistent kvstore in tests (#8148) 2022-03-18 09:39:06 -04:00
Sam Kleinman
5bb51aab03 events: remove service aspects of event switch (#8146) 2022-03-18 12:31:08 +00:00
Sam Kleinman
13f7501950 blocksync: remove intermediate channel (#8140)
Based on local testing, I'm now convinced that this is ok, and also I think the fact that the new p2p layer has more caching and queue.
2022-03-17 22:20:59 +00:00
JayT106
4400b0f6d3 p2p: adjust max non-persistent peer score (#8137)
Guarantee persistent peers have the highest connecting priority. 
The peerStore.Ranked returns an arbitrary order of peers with the same scores.
2022-03-17 14:30:45 -07:00
frog power 4000
5b6849ccf7 Docs: abci++ typo (#8147) 2022-03-17 16:44:29 -04:00
Sam Kleinman
a68e356596 consensus: avoid extra close channel (#8144)
Saw this in a test panic, doesn't seem neccessary.
2022-03-17 20:27:20 +00:00
William Banfield
7c91b53999 docs: PBTS synchrony issues runbook (#8129)
closes: #7756 

# What does this pull request change?
This pull request adds a new runbook for operators enountering errors related to the new Proposer-Based Timestamps algorithm. The goal of this runbook is to give operators a set of clear steps that they can follow if they are having issues producing blocks because of clock synchronization problems. 
This pull request also renames the `*PrevoteDelay` metrics to drop the term `MessageDelay`. These metrics provide a combined view of `message_delay` + `synchrony` so the name may be confusing.
# Questions to reviewers
* Are there ways to make the set of steps clearer or are there any pieces that seem confusing?
2022-03-17 19:20:46 +00:00
William Banfield
02c7199eec types: update synchrony params to match checked in proto (#8142)
The `.proto` file do not have the `nullable = false` annotation present on the `SynchronyParams` durations. This pull request updates the `SynchronyParams` to match the checked in proto files.  Note, this does not make the code buildable against the latest protos. This pull request was achieved by checking out all files _not relevant_ to the `SynchronyParams` and removing the new `TimeoutParams` from the the `params.proto` file. Future updates will add these back. 

This pull request also adds a `nil` check to the `pbParams.Synchrony` field in `ConsensusParamsFromProto`. Old versions of Tendermint will not have the `Synchrony` parameters filled in so this code would panic on startup.

We will fill in the empty fields with defaults, but per https://github.com/tendermint/tendermint/blob/master/docs/rfc/rfc-009-consensus-parameter-upgrades.md#only-update-hashedparams-on-hash-breaking-releases we will keep out of the hash during this release.
2022-03-17 18:49:37 +00:00
Sam Kleinman
1dd8807cc3 mempool: test harness should expose application (#8143)
This is minor, but I was trying to write a test and realized that the
application reference in the harness isn't actually used, which is
quite confusing.
2022-03-17 17:45:27 +00:00
Sam Kleinman
07b46d5a05 blocksync: drop redundant shutdown mechanisms (#8136) 2022-03-17 13:30:13 -04:00
Sam Kleinman
7a0b05f22d libs/events: remove unneccessary unsubscription code (#8135)
The events switch code is largely vestigal and is responsible for
wiring between the consensus state machine and the consensus
reactor. While there might have been a need, historicallly to managed
these subscriptions at runtime, it's nolonger used: subscriptions are
registered during startup, and then the switch shuts down at at the
end. 

Eventually the EventSwitch should be replaced by a much smaller
implementation of an eventloop in the consensus state machine, but
cutting down on the scope of the event switch will help clarify the
requirements from the consensus side.
2022-03-17 13:02:02 +00:00
Sam Kleinman
bedb68078c libs/clist: remove unused surface area (#8134) 2022-03-16 11:57:41 -04:00
dependabot[bot]
348c494c99 build(deps): Bump github.com/stretchr/testify from 1.7.0 to 1.7.1 (#8131)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="083ff1c044"><code>083ff1c</code></a> Fixed didPanic to now detect panic(nil).</li>
<li><a href="1e36bfe104"><code>1e36bfe</code></a> Use cross Go version compatible build tag syntax</li>
<li><a href="e798dc2763"><code>e798dc2</code></a> Add docs on 1.17 build tags</li>
<li><a href="83198c2c50"><code>83198c2</code></a> assert: guard CanConvert call in backward compatible wrapper</li>
<li><a href="087b655c75"><code>087b655</code></a> assert: allow comparing time.Time</li>
<li><a href="7bcf74e94f"><code>7bcf74e</code></a> fix msgAndArgs forwarding</li>
<li><a href="c29de71342"><code>c29de71</code></a> add tests for correct msgAndArgs forwarding</li>
<li><a href="f87e2b2119"><code>f87e2b2</code></a> Update builds</li>
<li><a href="ab6dc32628"><code>ab6dc32</code></a> fix linting errors in /assert package</li>
<li><a href="edff5a049b"><code>edff5a0</code></a> fix funtion name</li>
<li>Additional commits viewable in <a href="https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/stretchr/testify&package-manager=go_modules&previous-version=1.7.0&new-version=1.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-16 14:08:43 +00:00
Sam Kleinman
48b1952f18 state: avoid panics for marshaling errors (#8125) 2022-03-15 22:27:23 +00:00
William Banfield
93c4e00e8e abci++: remove app_signed_updates (#8128) 2022-03-15 17:07:02 -04:00
William Banfield
68c624f5de abci++: synchronize PrepareProposal with the newest version of the spec (#8094)
This change implements the logic for the PrepareProposal ABCI++ method call. The main logic for creating and issuing the PrepareProposal request lives in execution.go and is tested in a set of new tests in execution_test.go. This change also updates the mempool mock to use a mockery generated version and removes much of the plumbing for the no longer used ABCIResponses.
2022-03-15 15:37:30 -04:00
Thane Thomson
4dce885994 ADR: Protocol Buffers Management (#8029)
* First draft of protobuf management ADR

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Pre-emptively add ADR to "Accepted" section in README

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add missing prototool link

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Elaborate on positive consequences of decision

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add clang-format GA to detailed design

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix broken link

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add notes on automated docs generation

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Rewording and restructuring for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Grammatical fixes and elaborations

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Revise wording for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Address comments

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update ADR to reflect current consensus on Buf

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Minor grammar fix

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-03-15 11:25:03 -04:00
Sam Kleinman
faf123bda2 autofile: reduce minor panic and docs changes (#8122)
* autofile: reduce minor panic and docs changes

* fix lint
2022-03-15 14:25:25 +00:00
Sam Kleinman
da5c09cf6f cleanup: remove commented code (#8123) 2022-03-15 10:07:06 -04:00
Sam Kleinman
b08dd93d88 libs/log: remove Must constructor (#8120)
* libs/log: remove Must constructor

* Update test/e2e/node/main.go

Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>

* use stdlog

Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
2022-03-15 13:02:31 +00:00
Sam Kleinman
a5320da5c8 node: cleanup evidence db (#8119) 2022-03-14 21:00:51 +00:00
William Banfield
8e5dfa55ef rfc: RFC 015 ABCI++ Tx Mutation (#8033)
This pull requests adds an RFC to discuss the proposed mechanism for transaction replacement detailed in the ABCI++ specification.
2022-03-14 09:49:04 -04:00
Jordi Pinyana
70df7d9e6e readme: add vocdoni (#8117)
Add Vocdoni under applications section on the README.
2022-03-14 12:52:19 +00:00
frog power 4000
98dd0d6c5a minor typo in docs (#8116) 2022-03-13 21:09:49 -07:00
frog power 4000
aff1481682 Update abci++_basic_concepts_002_draft.md (#8114)
Minor Typo (nice doc!)
2022-03-12 18:57:43 -08:00
M. J. Fromberger
e9bc33d807 consensus: ensure the node terminates on consensus failure (#8111)
Updates #8077. The panic handler for consensus currently attempts to effect a
clean shutdown, but this can leave a failed node running in an unknown state
for an arbitrary amount of time after the failure.

Since a panic at this point means consensus is already irrecoverably broken, we
should not allow the node to continue executing. After making a best effort to
shut down the writeahead log, re-panic to ensure the node will terminate before
any further state transitions are processed.

Even with this change, it is possible some transitions may occur while the
cleanup is happening. It might be preferable to abort unconditionally without
any attempt at cleanup.

Related changes:

- Clean up the creation of WAL directories.
- Filter WAL close errors at rethrow.
2022-03-11 13:30:15 -08:00
Thane Thomson
72bbe64da7 proto: update proto generation to use buf (#7975)
* Hard-code go_package option for .proto files

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Automatically relocate generated ABCI types after proto-gen

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Skip building gogoproto (i.e. only build our types)

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove unnecessary proto generation scripts

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Upgrade buf config from v1beta1 to v1

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add simple proto generation script

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Replace buf-based protobuf generation with simple protoc-based approach

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove custom buf-based Docker image generation config and Dockerfile

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Adopt Cosmos SDK's approach to Protobuf linting and breakage checking in CI

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Suppress command echo when running proto checks

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix proto-check workflow YAML indentation

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Restore proto-format target

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Replace custom BASH script with make equivalent

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove proto linting/breaking changes CI checks after discussion today

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove dangling reference to CI workflow that no longer exists

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update contributing guidelines relating to protos

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Use buf instead for generating protos

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove unused buf config for gogoprotobuf

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add reminder for if we migrate fully to buf

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Restore protopackage script for #8065

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix permissions on protopackage script

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Update contributing guidelines to show building of protos using buf

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix breaking changes check and add disclaimer

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand on contributing guidelines for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Re-remove old proto workflows

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add buf-based proto linting workflow in CI

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Superficially reorder proto targets

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix proto lints

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix GA workflow YAML indentation

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Temporarily use forked version of mlc

Use forked version of markdown-link-check until
https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/126
lands.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Temporarily disable markdown link checker

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove gogo protos - superseded by version from buf registry

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-11 14:10:46 -05:00
M. J. Fromberger
658a7661c5 p2p: remove unnecessary panic handling in PEX reactor (#8110)
The message handling in this reactor is all under control of the reactor
itself, and does not call out to callbacks or other externally-supplied code.
It doesn't need to check for panics.

- Remove an irrelevant channel ID check.
- Remove an unnecessary panic recovery wrapper.
2022-03-11 08:23:03 -08:00
M. J. Fromberger
89b4321af2 p2p: update polling interval calculation for PEX requests (#8106)
The PEX reactor has a simple feedback control mechanism to decide how often to
poll peers for peer address updates. The idea is to poll more frequently when
knowledge of the network is less, and decrease frequency as knowledge grows.

This change solves two problems:

1. It is possible in some cases we may poll a peer "too often" and get dropped
   by that peer for spamming.

2. The first successful peer update with any content resets the polling timer
   to a very long time (10m), meaning if we are unlucky in getting an
   incomplete reply while the network is small, we may not try again for a very
   long time. This may contribute to difficulties bootstrapping sync.

The main change here is to only update the interval when new information is
added to the system, and not (as before) whenever a request is sent out to a
peer. The rate computation is essentially the same as before, although the code
has been a bit simplified, and I consolidated some of the error handling so
that we don't have to check in multiple places for the same conditions.

Related changes:

- Improve error diagnostics for too-soon and overflow conditions.
- Clean up state handling in the poll interval computation.
- Pin the minimum interval avert a chance of PEX spamming a peer.
2022-03-11 07:49:33 -08:00
dependabot[bot]
c79bb13807 build(deps): Bump github.com/spf13/cobra from 1.3.0 to 1.4.0 (#8109)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.3.0 to 1.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/spf13/cobra/releases">github.com/spf13/cobra's releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<h1>Winter 2022 Release ❄️</h1>
<p>Another season, another release!</p>
<h2>Goodbye viper! 🐍 🚀</h2>
<p>The core Cobra library no longer requires Viper and all of its indirect dependencies. This means that Cobra's dependency tree has been drastically thinned! The Viper dependency was included because of the <code>cobra</code> CLI generation tool. <a href="https://github.com/spf13/cobra-cli/releases/tag/v1.3.0">This tool has migrated to <code>spf13/cobra-cli</code></a>.</p>
<p>It's <em>pretty unlikely</em> you were importing and using <strong>the bootstrapping CLI tool</strong> as part of your application (after all, it's just a tool to get going with core <code>cobra</code>).</p>
<p>But if you were, replace occurrences of</p>
<pre><code>&quot;github.com/spf13/cobra/cobra&quot;
</code></pre>
<p>with</p>
<pre><code>&quot;github.com/spf13/cobra-cli&quot;
</code></pre>
<p>And in your <code>go.mod</code>, you'll want to also include this dependency:</p>
<pre><code>github.com/spf13/cobra-cli v1.3.0
</code></pre>
<p>Again, the maintainers <em>do not anticipate</em> this being a breaking change to users of the core <code>cobra</code> library, so minimal work should be required for users to integrate with this new release. Moreover, this means the dependency tree for your application using Cobra should no longer require dependencies that were inherited from Viper. Huzzah! 🥳</p>
<p>If you'd like to read more</p>
<ul>
<li>issue: <a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1597">spf13/cobra#1597</a></li>
<li>PR: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1604">spf13/cobra#1604</a></li>
</ul>
<h2>Documentation 📝</h2>
<ul>
<li>Update Go Doc link and badge in README: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1593">spf13/cobra#1593</a></li>
<li>Fix to install command, now targets <code>@latest</code>: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1576">spf13/cobra#1576</a></li>
<li>Added MAINTAINERS file: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1545">spf13/cobra#1545</a></li>
</ul>
<h2>Other 💭</h2>
<ul>
<li>Bumped license year to 2022 in golden files: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1575">spf13/cobra#1575</a></li>
<li>Added Pixie to projects: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1581">spf13/cobra#1581</a></li>
<li>Updated labeler for new labeling scheme: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1613">spf13/cobra#1613</a> &amp; syntax fix: <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1624">spf13/cobra#1624</a></li>
</ul>
<p>Shoutout to our awesome contributors helping to make this cobra release possible!!
<a href="https://github.com/spf13"><code>@​spf13</code></a> <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> <a href="https://github.com/johnSchnake"><code>@​johnSchnake</code></a> <a href="https://github.com/jpmcb"><code>@​jpmcb</code></a> <a href="https://github.com/liggitt"><code>@​liggitt</code></a> <a href="https://github.com/umarcor"><code>@​umarcor</code></a> <a href="https://github.com/hiljusti"><code>@​hiljusti</code></a> <a href="https://github.com/marians"><code>@​marians</code></a> <a href="https://github.com/shyim"><code>@​shyim</code></a> <a href="https://github.com/htroisi"><code>@​htroisi</code></a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/spf13/cobra/blob/master/CHANGELOG.md">github.com/spf13/cobra's changelog</a>.</em></p>
<blockquote>
<h1>Cobra Changelog</h1>
<h2>v1.1.3</h2>
<ul>
<li><strong>Fix:</strong> release-branch.cobra1.1 only: Revert &quot;Deprecate Go &lt; 1.14&quot; to maintain backward compatibility</li>
</ul>
<h2>v1.1.2</h2>
<h3>Notable Changes</h3>
<ul>
<li>Bump license year to 2021 in golden files (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1309">#1309</a>) <a href="https://github.com/Bowbaq"><code>@​Bowbaq</code></a></li>
<li>Enhance PowerShell completion with custom comp (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1208">#1208</a>) <a href="https://github.com/Luap99"><code>@​Luap99</code></a></li>
<li>Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see <a href="https://github-redirect.dependabot.com/go-yaml/yaml/issues/670">go-yaml/yaml#670</a></li>
<li>Documentation readability improvements (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1228">#1228</a> etc.) <a href="https://github.com/zaataylor"><code>@​zaataylor</code></a> etc.</li>
<li>Use golangci-lint: Repair warnings and errors resulting from linting (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1044">#1044</a>) <a href="https://github.com/umarcor"><code>@​umarcor</code></a></li>
</ul>
<h2>v1.1.1</h2>
<ul>
<li><strong>Fix:</strong> yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See <a href="https://github-redirect.dependabot.com/spf13/cobra/pull/1259">spf13/cobra#1259</a> for context.</li>
<li><strong>Fix:</strong> correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See <a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1049">spf13/cobra#1049</a> for context.</li>
</ul>
<h2>v1.1.0</h2>
<h3>Notable Changes</h3>
<ul>
<li>Extend Go completions and revamp zsh comp (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1070">#1070</a>)</li>
<li>Fix man page doc generation - no auto generated tag when <code>cmd.DisableAutoGenTag = true</code> (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1104">#1104</a>) <a href="https://github.com/jpmcb"><code>@​jpmcb</code></a></li>
<li>Add completion for help command (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1136">#1136</a>)</li>
<li>Complete subcommands when TraverseChildren is set (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1171">#1171</a>)</li>
<li>Fix stderr printing functions (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/894">#894</a>)</li>
<li>fix: fish output redirection (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1247">#1247</a>)</li>
</ul>
<h2>v1.0.0</h2>
<p>Announcing v1.0.0 of Cobra. 🎉</p>
<h3>Notable Changes</h3>
<ul>
<li>Fish completion (including support for Go custom completion) <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a></li>
<li>API (urgent): Rename BashCompDirectives to ShellCompDirectives <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a></li>
<li>Remove/replace SetOutput on Command - deprecated <a href="https://github.com/jpmcb"><code>@​jpmcb</code></a></li>
<li>add support for autolabel stale PR <a href="https://github.com/xchapter7x"><code>@​xchapter7x</code></a></li>
<li>Add Labeler Actions <a href="https://github.com/xchapter7x"><code>@​xchapter7x</code></a></li>
<li>Custom completions coded in Go (instead of Bash) <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a></li>
<li>Partial Revert of <a href="https://github-redirect.dependabot.com/spf13/cobra/issues/922">#922</a> <a href="https://github.com/jharshman"><code>@​jharshman</code></a></li>
<li>Add Makefile to project <a href="https://github.com/jharshman"><code>@​jharshman</code></a></li>
<li>Correct documentation for InOrStdin <a href="https://github.com/desponda"><code>@​desponda</code></a></li>
<li>Apply formatting to templates <a href="https://github.com/jharshman"><code>@​jharshman</code></a></li>
<li>Revert change so help is printed on stdout again <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a></li>
<li>Update md2man to v2.0.0 <a href="https://github.com/pdf"><code>@​pdf</code></a></li>
<li>update viper to v1.4.0 <a href="https://github.com/umarcor"><code>@​umarcor</code></a></li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="5b2b9e9f61"><code>5b2b9e9</code></a> Removes viper dependency by removing cobra/ CLI tool (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1604">#1604</a>)</li>
<li><a href="9369465955"><code>9369465</code></a> labeler: fix syntax</li>
<li><a href="e1b831e5c2"><code>e1b831e</code></a> Updates labeler for new labels (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1613">#1613</a>)</li>
<li><a href="8267283cfe"><code>8267283</code></a> Add MAINTAINERS file (alphabetical order) (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1545">#1545</a>)</li>
<li><a href="6d2dc43606"><code>6d2dc43</code></a> Add Pixie to projects. (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1581">#1581</a>)</li>
<li><a href="a599632379"><code>a599632</code></a> Fix install command (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1576">#1576</a>)</li>
<li><a href="7cabfeb8f8"><code>7cabfeb</code></a> Update Go Doc link and badge (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1593">#1593</a>)</li>
<li><a href="e04ec72550"><code>e04ec72</code></a> Bump license year to 2022 in golden files (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1575">#1575</a>)</li>
<li><a href="cb9d7b1cec"><code>cb9d7b1</code></a> Bump github.com/spf13/viper from 1.10.0 to 1.10.1 (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1567">#1567</a>)</li>
<li>See full diff in <a href="https://github.com/spf13/cobra/compare/v1.3.0...v1.4.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/cobra&package-manager=go_modules&previous-version=1.3.0&new-version=1.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-11 14:41:50 +00:00
JayT106
d9c9675e2a p2p+flowrate: rate control refactor (#7828)
Adding `CurrentTransferRate ` in the flowrate package because only the status of the transfer rate has been used.
2022-03-10 13:48:23 +00:00
dependabot[bot]
a54bae25b7 build(deps): Bump google.golang.org/grpc from 1.44.0 to 1.45.0 (#8104)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.44.0 to 1.45.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p>
<blockquote>
<h2>Release 1.45.0</h2>
<h1>Bug Fixes</h1>
<ul>
<li>xds/clusterresolver: pass cluster name to DNS child policy to be used in creds handshake (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5119">#5119</a>)</li>
<li>reflection: support dynamic messages (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5180">#5180</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/codebutler"><code>@​codebutler</code></a></li>
</ul>
</li>
</ul>
<h1>Performance Improvements</h1>
<ul>
<li>wrr: improve randomWRR performance (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5067">#5067</a>)
<ul>
<li>Special Thanks: <a href="https://github.com/huangchong94"><code>@​huangchong94</code></a></li>
</ul>
</li>
</ul>
<h1>Behavior Changes</h1>
<ul>
<li>server: convert context errors returned by service handlers to status with the correct status code (<code>Canceled</code> or <code>DeadlineExceeded</code>), instead of <code>Unknown</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5156">#5156</a>)</li>
</ul>
<h1>New Features</h1>
<ul>
<li>reflection: add <code>NewServer(ServerOptions)</code> for creating a reflection server with advanced customizations (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5197">#5197</a>)</li>
<li>xds: support federation (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5128">#5128</a>)</li>
<li>xds/resource: accept Self as LDS's RDS config source and CDS's EDS config source (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5152">#5152</a>)</li>
<li>xds/bootstrap: add plugin system for credentials specified in bootstrap file (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5136">#5136</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a82cc96f07"><code>a82cc96</code></a> Change version to 1.45.0 (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5202">#5202</a>)</li>
<li><a href="011544f729"><code>011544f</code></a> authz: add additional logs to sdk authz (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5094">#5094</a>)</li>
<li><a href="18564ff61d"><code>18564ff</code></a> reflection: improve server implementation (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5197">#5197</a>)</li>
<li><a href="ec717cad73"><code>ec717ca</code></a> xds: minor cleanup in xdsclient bootstrap code (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5195">#5195</a>)</li>
<li><a href="ebc30b8fc3"><code>ebc30b8</code></a> reflection: use protobuf/reflect instead of go reflection, fix dynamic messag...</li>
<li><a href="46009ac902"><code>46009ac</code></a> transport: Add an Unwrap method to ConnectionError (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5148">#5148</a>)</li>
<li><a href="75fd0240ac"><code>75fd024</code></a> remove sdk term from grpc authz (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5191">#5191</a>)</li>
<li><a href="a354b1eec3"><code>a354b1e</code></a> channelz: rename NewChannelzStorage to NewChannelzStorageForTesting (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5190">#5190</a>)</li>
<li><a href="0e055491d5"><code>0e05549</code></a> Format directory/file references (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5184">#5184</a>)</li>
<li><a href="c44f627fd1"><code>c44f627</code></a> cleanup: replace grpc.WithInsecure with insecure.NewCredentials (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5177">#5177</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.44.0...v1.45.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.44.0&new-version=1.45.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-10 13:27:37 +00:00
William Banfield
ddbc93d993 service: add NopService and use for PexReactor (#8100) 2022-03-09 14:33:57 -05:00
M. J. Fromberger
6f7427ec7e Update pending changelog for #8081. (#8093) 2022-03-08 21:18:13 +00:00
Marko
7c03e7dbfb cmd: make reset more safe (#8081)
* add safe reset

* undo change

* remove unsafe

* Update cmd/tendermint/commands/reset_priv_validator.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update cmd/tendermint/commands/reset_priv_validator.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* remove export comment

Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-03-08 09:32:29 -05:00
Sam Kleinman
c35d6d6e2c node: pass eventbus at construction time (#8084)
* node: pass eventbus at construction time

* remove cruft
2022-03-08 13:04:59 +00:00
Manuel Bravo
4edc8c5523 abci++ spec: reorganizing basic concepts, adding outline for easy navigation (#8048)
* reorganizing basic concepts, adding outline to navigate easy

* Update spec/abci++/README.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* address problem with snapshot list data type

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>

* Update spec/abci++/abci++_basic_concepts_002_draft.md

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* clarify handling events in same-execution model

* remove outdated text about vote extension singing

* clarification apphash state-sync

Co-authored-by: Sergio Mena <sergio@informal.systems>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
2022-03-08 11:12:57 +01:00
M. J. Fromberger
f992a7e740 Fix YAML front matter. (#8086)
Fixes #8052 again. Ideally we would have some way of detecting that this
happens before merging, but the way we build docs right now is kind of
complicated.
2022-03-07 14:50:13 -08:00
Sam Kleinman
691cb52528 statesync: avoid leaking a thread during tests (#8085)
* statesync: avoid leaking a thread during tests

* fix
2022-03-07 22:12:39 +00:00
Sam Kleinman
01266881b8 evidence: manage and initialize state objects more clearly in the pool (#8080) 2022-03-07 14:26:58 -05:00
M. J. Fromberger
2df5c85a8d Fix govet errors for %w use in test errors. (#8083)
The %w syntax is a fmt.Errorf thing, not supported by the testing package.
2022-03-07 18:17:37 +00:00
dependabot[bot]
1f03287f52 build(deps): Bump golangci/golangci-lint-action from 2.5.2 to 3.1.0 (#8074)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 2.5.2 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/golangci/golangci-lint-action/releases">golangci/golangci-lint-action's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<h2>What's Changed</h2>
<h3>New features</h3>
<ul>
<li>Allow to disable caching completely by <a href="https://github.com/tdabasinskas"><code>@​tdabasinskas</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/351">golangci/golangci-lint-action#351</a></li>
</ul>
<h3>CI</h3>
<ul>
<li>ci(dep): Add step to commit changes if PR has dependencies label by <a href="https://github.com/sayboras"><code>@​sayboras</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/108">golangci/golangci-lint-action#108</a></li>
</ul>
<h3>Dependabot</h3>
<ul>
<li>build(deps-dev): bump eslint from 8.9.0 to 8.10.0 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/405">golangci/golangci-lint-action#405</a></li>
</ul>
<h3>Misc</h3>
<ul>
<li>Update version to 3.1.0 in package.json by <a href="https://github.com/SVilgelm"><code>@​SVilgelm</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/406">golangci/golangci-lint-action#406</a></li>
<li>fix version in package-lock.json by <a href="https://github.com/SVilgelm"><code>@​SVilgelm</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/407">golangci/golangci-lint-action#407</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/tdabasinskas"><code>@​tdabasinskas</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/351">golangci/golangci-lint-action#351</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/golangci/golangci-lint-action/compare/v3...v3.1.0">https://github.com/golangci/golangci-lint-action/compare/v3...v3.1.0</a></p>
<h2>v3.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix grammar in action.yml by <a href="https://github.com/abennett"><code>@​abennett</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/356">golangci/golangci-lint-action#356</a></li>
<li>Add description for permissions settings by <a href="https://github.com/sg0hsmt"><code>@​sg0hsmt</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/298">golangci/golangci-lint-action#298</a></li>
<li>Remove Setup-Go by <a href="https://github.com/StevenACoffman"><code>@​StevenACoffman</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/403">golangci/golangci-lint-action#403</a></li>
<li>Update all direct dependencies by <a href="https://github.com/SVilgelm"><code>@​SVilgelm</code></a> in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/404">golangci/golangci-lint-action#404</a></li>
<li>139 Dependabot updates</li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/abennett"><code>@​abennett</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/356">golangci/golangci-lint-action#356</a></li>
<li><a href="https://github.com/sg0hsmt"><code>@​sg0hsmt</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/298">golangci/golangci-lint-action#298</a></li>
<li><a href="https://github.com/StevenACoffman"><code>@​StevenACoffman</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/pull/403">golangci/golangci-lint-action#403</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/golangci/golangci-lint-action/compare/v2...v3.0.0">https://github.com/golangci/golangci-lint-action/compare/v2...v3.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b517f99ae2"><code>b517f99</code></a> fix version in package-lock.json (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/407">#407</a>)</li>
<li><a href="9636c5bc97"><code>9636c5b</code></a> Update version to 3.1.0 in package.json (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/406">#406</a>)</li>
<li><a href="03e4befc7a"><code>03e4bef</code></a> ci(dep): Add step to commit changes if PR has dependencies label (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/108">#108</a>)</li>
<li><a href="cdfc708aeb"><code>cdfc708</code></a> Allow to disable caching completely (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/351">#351</a>)</li>
<li><a href="7d5614c3eb"><code>7d5614c</code></a> build(deps-dev): bump eslint from 8.9.0 to 8.10.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/405">#405</a>)</li>
<li><a href="c675eb70db"><code>c675eb7</code></a> Update all direct dependencies (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/404">#404</a>)</li>
<li><a href="423fbafafc"><code>423fbaf</code></a> Remove Setup-Go (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/403">#403</a>)</li>
<li><a href="bcfc6f96bb"><code>bcfc6f9</code></a> build(deps-dev): bump eslint-plugin-import from 2.25.3 to 2.25.4 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/402">#402</a>)</li>
<li><a href="d34ac2aef3"><code>d34ac2a</code></a> build(deps): bump setup-go from v2.1.4 to v2.2.0 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/401">#401</a>)</li>
<li><a href="e4b538ed37"><code>e4b538e</code></a> build(deps-dev): bump <code>@​types/node</code> from 16.11.10 to 17.0.19 (<a href="https://github-redirect.dependabot.com/golangci/golangci-lint-action/issues/400">#400</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/golangci/golangci-lint-action/compare/v2.5.2...v3.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golangci/golangci-lint-action&package-manager=github_actions&previous-version=2.5.2&new-version=3.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-07 16:24:18 +00:00
dependabot[bot]
e7955185b4 build(deps): Bump docker/login-action from 1.13.0 to 1.14.1 (#8075)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/docker/login-action/releases">docker/login-action's releases</a>.</em></p>
<blockquote>
<h2>v1.14.1</h2>
<ul>
<li>Revert to Node 12 as default runtime to fix issue for GHE users (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/160">#160</a>)</li>
</ul>
<h2>v1.14.0</h2>
<ul>
<li>Update to node 16 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/158">#158</a>)</li>
<li>Bump <code>@​aws-sdk/client-ecr</code> from 3.45.0 to 3.53.0 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/157">#157</a>)</li>
<li>Bump <code>@​aws-sdk/client-ecr-public</code> from 3.45.0 to 3.53.0 (<a href="https://github-redirect.dependabot.com/docker/login-action/issues/156">#156</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="dd4fa0671b"><code>dd4fa06</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/160">#160</a> from crazy-max/node12</li>
<li><a href="4e3538592e"><code>4e35385</code></a> Revert to Node 12 as default runtime</li>
<li><a href="bb984efc56"><code>bb984ef</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/156">#156</a> from docker/dependabot/npm_and_yarn/aws-sdk/client-ec...</li>
<li><a href="722888132b"><code>7228881</code></a> Update generated content</li>
<li><a href="17780b56b7"><code>17780b5</code></a> Bump <code>@​aws-sdk/client-ecr-public</code> from 3.45.0 to 3.53.0</li>
<li><a href="39857b3b45"><code>39857b3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/157">#157</a> from docker/dependabot/npm_and_yarn/aws-sdk/client-ec...</li>
<li><a href="5fcc728422"><code>5fcc728</code></a> Update generated content</li>
<li><a href="9fb8721eb9"><code>9fb8721</code></a> Bump <code>@​aws-sdk/client-ecr</code> from 3.45.0 to 3.53.0</li>
<li><a href="4e3c9375bb"><code>4e3c937</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/docker/login-action/issues/158">#158</a> from crazy-max/node-16</li>
<li><a href="4b59a429db"><code>4b59a42</code></a> update to node 16</li>
<li>See full diff in <a href="https://github.com/docker/login-action/compare/v1.13.0...v1.14.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=1.13.0&new-version=1.14.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-07 14:27:08 +00:00
dependabot[bot]
854add04b0 build(deps): Bump actions/checkout from 2.4.0 to 3 (#8076)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<ul>
<li>Update default runtime to node16</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>v2.3.1</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/284">Fix default branch resolution for .wiki and when using SSH</a></li>
</ul>
<h2>v2.3.0</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/278">Fallback to the default branch</a></li>
</ul>
<h2>v2.2.0</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/258">Fetch all history for all tags and branches when fetch-depth=0</a></li>
</ul>
<h2>v2.1.1</h2>
<ul>
<li>Changes to support GHES (<a href="https://github-redirect.dependabot.com/actions/checkout/pull/236">here</a> and <a href="https://github-redirect.dependabot.com/actions/checkout/pull/248">here</a>)</li>
</ul>
<h2>v2.1.0</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/191">Group output</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/199">Changes to support GHES alpha release</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/184">Persist core.sshCommand for submodules</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/163">Add support ssh</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/179">Convert submodule SSH URL to HTTPS, when not using SSH</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/157">Add submodule support</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/144">Follow proxy settings</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/141">Fix ref for pr closed event when a pr is merged</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/128">Fix issue checking detached when git less than 2.22</a></li>
</ul>
<h2>v2.0.0</h2>
<ul>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/108">Do not pass cred on command line</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/107">Add input persist-credentials</a></li>
<li><a href="https://github-redirect.dependabot.com/actions/checkout/pull/104">Fallback to REST API to download repo</a></li>
</ul>
<h2>v2 (beta)</h2>
<ul>
<li>Improved fetch performance
<ul>
<li>The default behavior now fetches only the SHA being checked-out</li>
</ul>
</li>
<li>Script authenticated git commands
<ul>
<li>Persists <code>with.token</code> in the local git config</li>
<li>Enables your scripts to run authenticated git commands</li>
<li>Post-job cleanup removes the token</li>
<li>Coming soon: Opt out by setting <code>with.persist-credentials</code> to <code>false</code></li>
</ul>
</li>
<li>Creates a local branch
<ul>
<li>No longer detached HEAD when checking out a branch</li>
<li>A local branch is created with the corresponding upstream branch set</li>
</ul>
</li>
<li>Improved layout</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a12a3943b4"><code>a12a394</code></a> update readme for v3 (<a href="https://github-redirect.dependabot.com/actions/checkout/issues/708">#708</a>)</li>
<li><a href="8f9e05e482"><code>8f9e05e</code></a> Update to node 16 (<a href="https://github-redirect.dependabot.com/actions/checkout/issues/689">#689</a>)</li>
<li><a href="230611dbd0"><code>230611d</code></a> Change secret name for PAT to not start with GITHUB_ (<a href="https://github-redirect.dependabot.com/actions/checkout/issues/623">#623</a>)</li>
<li>See full diff in <a href="https://github.com/actions/checkout/compare/v2.4.0...v3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=2.4.0&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-03-07 14:25:08 +00:00
Sam Kleinman
8df7b6103f proxy: collapse triforcated abci.Client (#8067) 2022-03-06 18:25:50 -05:00
Sam Kleinman
f1659ce329 consensus: fix TestInvalidState race and reporting (#8071) 2022-03-06 12:29:05 -05:00
William Banfield
8d0bd1c0ff update abci cli test output (#8070) 2022-03-04 17:54:21 -05:00
William Banfield
0b8a62c87b abci: Synchronize FinalizeBlock with the updated specification (#7983)
This change set implements the most recent version of `FinalizeBlock`. 

# What does this change actually contain?

* This change set is rather large but fear not! The majority of the files touched and changes are renaming `ResponseDeliverTx` to `ExecTxResult`. This should be a pretty inoffensive change since they're effectively the same type but with a different name.
* The `execBlockOnProxyApp` was totally removed since it served as just a wrapper around the logic that is now mostly encapsulated within `FinalizeBlock`
* The `updateState` helper function has been made a public method on `State`. It was being exposed as a shim through the testing infrastructure, so this seemed innocuous.
* Tests already existed to ensure that the application received the `ByzantineValidators` and the `ValidatorUpdates`, but one was fixed up to ensure that `LastCommitInfo` was being sent across.
* Tests were removed from the `psql` indexer that seemed to search for an event in the indexer that was not being created.

# Questions for reviewers
* We store this [ABCIResponses](5721a13ab1/proto/tendermint/state/types.pb.go (L37)) type in the data base as the block results. This type has changed since v0.35 to contain the `FinalizeBlock` response. I'm wondering if we need to do any shimming to keep the old data retrieveable?
* Similarly, this change is exposed via the RPC through [ResultBlockResults](5721a13ab1/rpc/coretypes/responses.go (L69)) changing. Should we somehow shim or notify for this change? 


closes: #7658
2022-03-04 22:32:37 +00:00
498 changed files with 24877 additions and 14177 deletions

View File

@@ -20,11 +20,11 @@ jobs:
goos: ["linux"]
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
@@ -41,11 +41,11 @@ jobs:
needs: build
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
@@ -63,11 +63,11 @@ jobs:
needs: build
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go

View File

@@ -13,7 +13,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
@@ -39,17 +39,17 @@ jobs:
platforms: all
- name: Set up Docker Build
uses: docker/setup-buildx-action@v1.6.0
uses: docker/setup-buildx-action@v2.0.0
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1.13.0
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
uses: docker/build-push-action@v2.9.0
uses: docker/build-push-action@v3.0.0
with:
context: .
file: ./DOCKER/Dockerfile

62
.github/workflows/docs-deployment.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
# Build and deploy the docs.tendermint.com website content.
# The static content is published to GitHub Pages.
#
# For documentation build info, see docs/DOCS_README.md.
name: Build static documentation site
on:
workflow_dispatch: # allow manual updates
push:
branches:
- master
paths:
- docs/**
- spec/**
jobs:
# This is split into two jobs so that the build, which runs npm, does not
# have write access to anything. The deploy requires write access to publish
# to the branch used by GitHub Pages, however, so we can't just make the
# whole workflow read-only.
build:
name: VuePress build
runs-on: ubuntu-latest
container:
image: alpine:latest
permissions:
contents: read
steps:
- name: Install generator dependencies
run: |
apk add --no-cache make bash git npm
- uses: actions/checkout@v3
with:
# We need to fetch full history so the backport branches for previous
# versions will be available for the build.
fetch-depth: 0
- name: Build documentation
run: |
git config --global --add safe.directory "$PWD"
make build-docs
- uses: actions/upload-artifact@v3
with:
name: build-output
path: ~/output/
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-output
path: ~/output
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: 'docs-tendermint-com'
folder: ~/output
single-commit: true

20
.github/workflows/docs-toc.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
# Verify that important design docs have ToC entries.
name: Check documentation ToC
on:
pull_request:
push:
branches:
- master
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
docs/architecture/**
docs/rfc/**
- run: ./docs/presubmit.sh
if: env.GIT_DIFF

View File

@@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Build
working-directory: test/e2e

View File

@@ -20,11 +20,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
with:
ref: 'v0.34.x'

View File

@@ -20,11 +20,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
with:
ref: 'v0.35.x'

View File

@@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Build
working-directory: test/e2e

View File

@@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go

View File

@@ -13,15 +13,15 @@ jobs:
fuzz-nightly-test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Install go-fuzz
working-directory: test/fuzz
run: go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
run: go install github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
- name: Fuzz mempool
working-directory: test/fuzz
@@ -39,14 +39,14 @@ jobs:
continue-on-error: true
- name: Archive crashers
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: crashers
path: test/fuzz/**/crashers
retention-days: 3
- name: Archive suppressions
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: suppressions
path: test/fuzz/**/suppressions

View File

@@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the Jepsen repository
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
repository: 'tendermint/jepsen'
@@ -58,7 +58,7 @@ jobs:
run: docker exec -i jepsen-control bash -c 'source /root/.bashrc; cd /jepsen/tendermint; lein run test --nemesis ${{ github.event.inputs.nemesis }} --workload ${{ github.event.inputs.workload }} --concurrency ${{ github.event.inputs.concurrency }} --tendermint-url ${{ github.event.inputs.tendermintUrl }} --merkleeyes-url ${{ github.event.inputs.merkleeyesUrl }} --time-limit ${{ github.event.inputs.timeLimit }} ${{ github.event.inputs.dupOrSuperByzValidators }}'
- name: Archive results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: results
path: tendermint/store/latest

View File

@@ -6,7 +6,7 @@ jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.13
- uses: actions/checkout@v3
- uses: creachadair/github-action-markdown-link-check@master
with:
folder-path: "docs"

View File

@@ -1,7 +1,11 @@
name: Golang Linter
# Lint runs golangci-lint over the entire Tendermint repository
# This workflow is run on every pull request and push to master
# The `golangci` job will pass without running if no *.{go, mod, sum} files have been modified.
# Lint runs golangci-lint over the entire Tendermint repository.
#
# This workflow is run on every pull request and push to master.
#
# The `golangci` job will pass without running if no *.{go, mod, sum}
# files have been modified.
on:
pull_request:
push:
@@ -13,17 +17,22 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.17'
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v2.5.2
- uses: golangci/golangci-lint-action@v3.1.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.42.1
# Required: the version of golangci-lint is required and
# must be specified without patch version: we always use the
# latest patch version.
version: v1.45
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF

View File

@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
- name: Lint Code Base
uses: docker://github/super-linter:v4
env:

View File

@@ -11,7 +11,13 @@ jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.13
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.md
- uses: creachadair/github-action-markdown-link-check@master
with:
check-modified-files-only: 'yes'
config-file: '.md-link-check.json'
if: env.GIT_DIFF

View File

@@ -1,24 +0,0 @@
name: Proto Check
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a file in the proto directory
# has been modified.
on:
workflow_dispatch: # allow running workflow manually
pull_request:
paths:
- "proto/*"
jobs:
proto-lint:
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- uses: actions/checkout@v2.4.0
- name: lint
run: make proto-lint
proto-breakage:
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- uses: actions/checkout@v2.4.0
- name: check-breakage
run: make proto-check-breaking-ci

View File

@@ -1,64 +0,0 @@
# This workflow (re)builds and pushes a Docker image containing the
# protobuf build tools used by the other workflows.
#
# When making changes that require updates to the builder image, you
# should merge the updates first and wait for this workflow to complete,
# so that the changes will be available for the dependent workflows.
#
name: Build & Push Proto Builder Image
on:
pull_request:
paths:
- "proto/*"
push:
branches:
- master
paths:
- "proto/*"
schedule:
# run this job once a month to recieve any go or buf updates
- cron: "0 9 1 * *"
env:
REGISTRY: ghcr.io
IMAGE_NAME: tendermint/docker-build-proto
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- name: Check out and assign tags
id: prep
run: |
DOCKER_IMAGE="${REGISTRY}/${IMAGE_NAME}"
VERSION=noop
if [[ "$GITHUB_REF" == "refs/tags/*" ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
elif [[ "$GITHUB_REF" == "refs/heads/*" ]]; then
VERSION="$(echo "${GITHUB_REF#refs/heads/}" | sed -r 's#/+#-#g')"
if [[ "${{ github.event.repository.default_branch }}" = "$VERSION" ]]; then
VERSION=latest
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=tags::"${TAGS}"
- name: Set up docker buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Log in to the container registry
uses: docker/login-action@v1.13.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish image
uses: docker/build-push-action@v2.9.0
with:
context: ./proto
file: ./proto/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}

21
.github/workflows/proto-lint.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Protobuf Lint
on:
pull_request:
paths:
- 'proto/**'
push:
branches:
- master
paths:
- 'proto/**'
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1.4.0
- uses: bufbuild/buf-lint-action@v1
with:
input: 'proto'

View File

@@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '1.17'
@@ -27,11 +27,13 @@ jobs:
version: latest
args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
- run: echo https://github.com/tendermint/tendermint/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
- name: Release
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
args: release --rm-dist --release-notes=../release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: "This pull request has been automatically marked as stale because it has not had

View File

@@ -16,11 +16,11 @@ jobs:
matrix:
part: ["00", "01", "02", "03", "04", "05"]
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.17"
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
@@ -32,7 +32,7 @@ jobs:
run: |
make test-group-${{ matrix.part }} NUM_SPLIT=6
if: env.GIT_DIFF
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./build/${{ matrix.part }}.profile.out
@@ -41,8 +41,8 @@ jobs:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
@@ -50,26 +50,26 @@ jobs:
go.mod
go.sum
Makefile
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: "${{ github.sha }}-00-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: "${{ github.sha }}-01-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: "${{ github.sha }}-02-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: "${{ github.sha }}-03-coverage"
if: env.GIT_DIFF
- run: |
cat ./*profile.out | grep -v "mode: set" >> coverage.txt
if: env.GIT_DIFF
- uses: codecov/codecov-action@v2.1.0
- uses: codecov/codecov-action@v3.1.0
with:
file: ./coverage.txt
if: env.GIT_DIFF

6
.md-link-check.json Normal file
View File

@@ -0,0 +1,6 @@
{
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [200, 206, 503]
}

View File

@@ -2,6 +2,39 @@
Friendly reminder: We have a [bug bounty program](https://hackerone.com/cosmos).
## v0.35.4
April 18, 2022
Special thanks to external contributors on this release: @firelizzard18
### FEATURES
- [cli] [\#8300](https://github.com/tendermint/tendermint/pull/8300) Add a tool to update old config files to the latest version [backport [\#8281](https://github.com/tendermint/tendermint/pull/8281)]. (@creachadair)
### IMPROVEMENTS
### BUG FIXES
- [cli] [\#8294](https://github.com/tendermint/tendermint/pull/8294) keymigrate: ensure block hash keys are correctly translated. (@creachadair)
- [cli] [\#8352](https://github.com/tendermint/tendermint/pull/8352) keymigrate: ensure transaction hash keys are correctly translated. (@creachadair)
## v0.35.3
April 8, 2022
### FEATURES
- [cli] [\#8081](https://github.com/tendermint/tendermint/pull/8081) add a safer-to-use `reset-state` command. (@marbar3778)
### IMPROVEMENTS
- [consensus] [\#8138](https://github.com/tendermint/tendermint/pull/8138) change lock handling in reactor and handleMsg for RoundState. (@williambanfield)
### BUG FIXES
- [cli] [\#8276](https://github.com/tendermint/tendermint/pull/8276) scmigrate: ensure target key is correctly renamed. (@creachadair)
## v0.35.2
February 28, 2022
@@ -94,7 +127,7 @@ Special thanks to external contributors on this release: @JayT106,
- [\#7106](https://github.com/tendermint/tendermint/pull/7106) Revert mutex change to ABCI Clients (@tychoish).
- [\#7142](https://github.com/tendermint/tendermint/pull/7142) mempool: remove panic when recheck-tx was not sent to ABCI application (@williambanfield).
- [consensus]: [\#7060](https://github.com/tendermint/tendermint/pull/7060)
- [consensus]: [\#7060](https://github.com/tendermint/tendermint/pull/7060) <!-- markdown-link-check-disable-line -->
wait until peerUpdates channel is closed to close remaining peers (@williambanfield)
- [privval] [\#5638](https://github.com/tendermint/tendermint/pull/5638) Increase read/write timeout to 5s and calculate ping interval based on it (@JoeKash)
- [evidence] [\#6375](https://github.com/tendermint/tendermint/pull/6375) Fix bug with inconsistent LightClientAttackEvidence hashing (cmwaters)
@@ -230,6 +263,32 @@ Special thanks to external contributors on this release: @JayT106,
- [cmd/tendermint/commands] [\#6623](https://github.com/tendermint/tendermint/pull/6623) replace `$HOME/.some/test/dir` with `t.TempDir` (@tanyabouman)
- [statesync] \6807 Implement P2P state provider as an alternative to RPC (@cmwaters)
## v0.34.19
### BUG FIXES
- [cli] [\#8270](https://github.com/tendermint/tendermint/issues/8270) fix reset commands (@alexanderbez).
## v0.34.18
### BREAKING CHANGES
- CLI/RPC/Config
- [cli] [\#8258](https://github.com/tendermint/tendermint/pull/8258) Fix a bug in the cli that caused `unsafe-reset-all` to panic
## v0.34.17
### BREAKING CHANGES
- CLI/RPC/Config
- [cli] [\#8081](https://github.com/tendermint/tendermint/issues/8081) make the reset command safe to use (@marbar3778).
### BUG FIXES
- [consensus] [\#8079](https://github.com/tendermint/tendermint/issues/8079) start the timeout ticker before relay (backport #7844) (@creachadair).
- [consensus] [\#7992](https://github.com/tendermint/tendermint/issues/7992) [\#7994](https://github.com/tendermint/tendermint/issues/7994) change lock handling in handleMsg and reactor to alleviate issues gossiping during long ABCI calls (@williambanfield).
## v0.34.16
Special thanks to external contributors on this release: @yihuang
@@ -1374,7 +1433,7 @@ Special thanks to external contributors on this release: @jon-certik, @gracenoah
*August 28, 2019*
@climber73 wrote the [Writing a Tendermint Core application in Java
(gRPC)](https://github.com/tendermint/tendermint/blob/master/docs/guides/java.md)
(gRPC)](https://github.com/tendermint/tendermint/blob/master/docs/guides/java.md) <!-- markdown-link-check-disable-line -->
guide.
Special thanks to external contributors on this release:
@@ -1953,7 +2012,7 @@ more details.
- [rpc] [\#3269](https://github.com/tendermint/tendermint/issues/2826) Limit number of unique clientIDs with open subscriptions. Configurable via `rpc.max_subscription_clients`
- [rpc] [\#3269](https://github.com/tendermint/tendermint/issues/2826) Limit number of unique queries a given client can subscribe to at once. Configurable via `rpc.max_subscriptions_per_client`.
- [rpc] [\#3435](https://github.com/tendermint/tendermint/issues/3435) Default ReadTimeout and WriteTimeout changed to 10s. WriteTimeout can increased by setting `rpc.timeout_broadcast_tx_commit` in the config.
- [rpc/client] [\#3269](https://github.com/tendermint/tendermint/issues/3269) Update `EventsClient` interface to reflect new pubsub/eventBus API [ADR-33](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-033-pubsub.md). This includes `Subscribe`, `Unsubscribe`, and `UnsubscribeAll` methods.
- [rpc/client] [\#3269](https://github.com/tendermint/tendermint/issues/3269) Update `EventsClient` interface to reflect new pubsub/eventBus API [ADR-33](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-033-pubsub.md). This includes `Subscribe`, `Unsubscribe`, and `UnsubscribeAll` methods.
* Apps
- [abci] [\#3403](https://github.com/tendermint/tendermint/issues/3403) Remove `time_iota_ms` from BlockParams. This is a
@@ -2006,7 +2065,7 @@ more details.
- [blockchain] [\#3358](https://github.com/tendermint/tendermint/pull/3358) Fix timer leak in `BlockPool` (@guagualvcha)
- [cmd] [\#3408](https://github.com/tendermint/tendermint/issues/3408) Fix `testnet` command's panic when creating non-validator configs (using `--n` flag) (@srmo)
- [libs/db/remotedb/grpcdb] [\#3402](https://github.com/tendermint/tendermint/issues/3402) Close Iterator/ReverseIterator after use
- [libs/pubsub] [\#951](https://github.com/tendermint/tendermint/issues/951), [\#1880](https://github.com/tendermint/tendermint/issues/1880) Use non-blocking send when dispatching messages [ADR-33](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-033-pubsub.md)
- [libs/pubsub] [\#951](https://github.com/tendermint/tendermint/issues/951), [\#1880](https://github.com/tendermint/tendermint/issues/1880) Use non-blocking send when dispatching messages [ADR-33](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-033-pubsub.md)
- [lite] [\#3364](https://github.com/tendermint/tendermint/issues/3364) Fix `/validators` and `/abci_query` proxy endpoints
(@guagualvcha)
- [p2p/conn] [\#3347](https://github.com/tendermint/tendermint/issues/3347) Reject all-zero shared secrets in the Diffie-Hellman step of secret-connection
@@ -2710,7 +2769,7 @@ Special thanks to external contributors on this release:
This release is mostly about the ConsensusParams - removing fields and enforcing MaxGas.
It also addresses some issues found via security audit, removes various unused
functions from `libs/common`, and implements
[ADR-012](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-012-peer-transport.md).
[ADR-012](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-012-peer-transport.md).
BREAKING CHANGES:
@@ -2775,7 +2834,7 @@ are affected by a change.
A few more breaking changes are in the works - each will come with a clear
Architecture Decision Record (ADR) explaining the change. You can review ADRs
[here](https://github.com/tendermint/tendermint/tree/develop/docs/architecture)
[here](https://github.com/tendermint/tendermint/tree/master/docs/architecture)
or in the [open Pull Requests](https://github.com/tendermint/tendermint/pulls).
You can also check in on the [issues marked as
breaking](https://github.com/tendermint/tendermint/issues?q=is%3Aopen+is%3Aissue+label%3Abreaking).
@@ -2791,7 +2850,7 @@ BREAKING CHANGES:
- [abci] Added address of the original proposer of the block to Header
- [abci] Change ABCI Header to match Tendermint exactly
- [abci] [\#2159](https://github.com/tendermint/tendermint/issues/2159) Update use of `Validator` (see
[ADR-018](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-018-ABCI-Validators.md)):
[ADR-018](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-018-ABCI-Validators.md)):
- Remove PubKey from `Validator` (so it's just Address and Power)
- Introduce `ValidatorUpdate` (with just PubKey and Power)
- InitChain and EndBlock use ValidatorUpdate
@@ -2813,7 +2872,7 @@ BREAKING CHANGES:
- [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block (!)
- Add NextValidatorSet to State, changes on-disk representation of state
- [state] [\#2184](https://github.com/tendermint/tendermint/issues/2184) Enforce ConsensusParams.BlockSize.MaxBytes (See
[ADR-020](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-020-block-size.md)).
[ADR-020](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-020-block-size.md)).
- Remove ConsensusParams.BlockSize.MaxTxs
- Introduce maximum sizes for all components of a block, including ChainID
- [types] Updates to the block Header:
@@ -2824,7 +2883,7 @@ BREAKING CHANGES:
- [consensus] [\#2203](https://github.com/tendermint/tendermint/issues/2203) Implement BFT time
- Timestamp in block must be monotonic and equal the median of timestamps in block's LastCommit
- [crypto] [\#2239](https://github.com/tendermint/tendermint/issues/2239) Secp256k1 signature changes (See
[ADR-014](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-014-secp-malleability.md)):
[ADR-014](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-014-secp-malleability.md)):
- format changed from DER to `r || s`, both little endian encoded as 32 bytes.
- malleability removed by requiring `s` to be in canonical form.
@@ -3054,7 +3113,7 @@ BREAKING CHANGES:
FEATURES
- [cmd] Added metrics (served under `/metrics` using a Prometheus client;
disabled by default). See the new `instrumentation` section in the config and
[metrics](https://tendermint.readthedocs.io/projects/tools/en/develop/metrics.html)
[metrics](https://github.com/tendermint/tendermint/blob/master/docs/nodes/metrics.md)
guide.
- [p2p] Add IPv6 support to peering.
- [p2p] Add `external_address` to config to allow specifying the address for
@@ -3168,7 +3227,7 @@ BREAKING:
FEATURES
- [rpc] the RPC documentation is now published to https://tendermint.github.io/slate
- [rpc] the RPC documentation is now published to `https://tendermint.github.io/slate`
- [p2p] AllowDuplicateIP config option to refuse connections from same IP.
- true by default for now, false by default in next breaking release
- [docs] Add docs for query, tx indexing, events, pubsub
@@ -3646,7 +3705,7 @@ containing substructs: `BaseConfig`, `P2PConfig`, `MempoolConfig`, `ConsensusCon
- Change some [function and method signatures](https://gist.github.com/ebuchman/640d5fc6c2605f73497992fe107ebe0b) accomodate new config
- Logger
- Replace static `log15` logger with a simple interface, and provide a new implementation using `go-kit`.
- Replace static `log15` logger with a simple interface, and provide a new implementation using `go-kit`. <!-- markdown-link-check-disable-next-line -->
See our new [logging library](https://github.com/tendermint/tmlibs/log) and [blog post](https://tendermint.com/blog/abstracting-the-logger-interface-in-go) for more details
- Levels `warn` and `notice` are removed (you may need to change them in your `config.toml`!)
- Change some [function and method signatures](https://gist.github.com/ebuchman/640d5fc6c2605f73497992fe107ebe0b) to accept a logger

View File

@@ -19,6 +19,8 @@ Special thanks to external contributors on this release:
- [rpc] \#7713 Remove unused options for websocket clients. (@creachadair)
- [config] \#7930 Add new event subscription options and defaults. (@creachadair)
- [rpc] \#7982 Add new Events interface and deprecate Subscribe. (@creachadair)
- [cli] \#8081 make the reset command safe to use by intoducing `reset-state` command. Fixed by \#8259. (@marbar3778, @cmwaters)
- [config] \#8222 default indexer configuration to null. (@creachadair)
- Apps
@@ -45,6 +47,7 @@ Special thanks to external contributors on this release:
- [libs/service] \#7288 Remove SetLogger method on `service.Service` interface. (@tychoish)
- [abci/client] \#7607 Simplify client interface (removes most "async" methods). (@creachadair)
- [libs/json] \#7673 Remove the libs/json (tmjson) library. (@creachadair)
- [crypto] \#8412 \#8432 Remove `crypto/tmhash` package in favor of small functions in `crypto` package and cleanup of unused functions. (@tychoish)
- Blockchain Protocol
@@ -60,6 +63,7 @@ Special thanks to external contributors on this release:
- [consensus] \#7415 Update proposal validation logic to Prevote nil if a proposal does not meet the conditions for Timelyness per the proposer-based timestamp specification. (@anca)
- [consensus] \#7382 Update block validation to no longer require the block timestamp to be the median of the timestamps of the previous commit. (@anca)
- [consensus] \#7711 Use the proposer timestamp for the first height instead of the genesis time. Chains will still start consensus at the genesis time. (@anca)
- [cli] \#8281 Add a tool to update old config files to the latest version. (@creachadair)
### IMPROVEMENTS
@@ -79,3 +83,6 @@ Special thanks to external contributors on this release:
- [light] \#7640 Light Client: fix absence proof verification (@ashcherbakov)
- [light] \#7641 Light Client: fix querying against the latest height (@ashcherbakov)
- [cli] [#7837](https://github.com/tendermint/tendermint/pull/7837) fix app hash in state rollback. (@yihuang)
- [cli] \#8276 scmigrate: ensure target key is correctly renamed. (@creachadair)
- [cli] \#8294 keymigrate: ensure block hash keys are correctly translated. (@creachadair)
- [cli] \#8352 keymigrate: ensure transaction hash keys are correctly translated. (@creachadair)

View File

@@ -20,7 +20,7 @@ This code of conduct applies to all projects run by the Tendermint/COSMOS team a
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we dont tolerate behavior that excludes people in socially marginalized groups.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behaviour. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we dont tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel admins or the person mentioned above immediately. Whether youre a regular contributor or a newcomer, we care about making this community a safe place for you and weve got your back.

View File

@@ -105,11 +105,33 @@ specify exactly the dependency you want to update, eg.
## Protobuf
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.
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, 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`.
To generate proto stubs, lint, and check protos for breaking changes, you will
need to install [buf](https://buf.build/) and `gogoproto`. Then, from the root
of the repository, run:
We use [Docker](https://www.docker.com/) to generate the protobuf stubs. To generate the stubs yourself, make sure docker is running then run `make proto-gen`. This command uses the spec repo to get the necessary protobuf files for generating the go code. If you are modifying the proto files manually for changes in the core data structures, you will need to clone them into the go repo and comment out lines 22-37 of the file `./scripts/protocgen.sh`.
```bash
# Lint all of the .proto files in proto/tendermint
make proto-lint
# Check if any of your local changes (prior to committing to the Git repository)
# are breaking
make proto-check-breaking
# Generate Go code from the .proto files in proto/tendermint
make proto-gen
```
To automatically format `.proto` files, you will need
[`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) installed. Once
installed, you can run:
```bash
make proto-format
```
### Visual Studio Code

1
DOCKER/.gitignore vendored
View File

@@ -1 +0,0 @@
tendermint

View File

@@ -2,7 +2,7 @@
FROM golang:1.17-alpine as builder
RUN apk update && \
apk upgrade && \
apk --no-cache add make
apk --no-cache add make git
COPY / /tendermint
WORKDIR /tendermint
RUN make build-linux
@@ -53,4 +53,3 @@ CMD ["start"]
# Expose the data directory as a volume since there's mutable state in there
VOLUME [ "$TMHOME" ]

View File

@@ -1,28 +0,0 @@
FROM amazonlinux:2
RUN yum -y update && \
yum -y install wget
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \
rpm -ivh epel-release-latest-7.noarch.rpm
RUN yum -y groupinstall "Development Tools"
RUN yum -y install leveldb-devel which
ENV GOVERSION=1.16.5
RUN cd /tmp && \
wget https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xf go${GOVERSION}.linux-amd64.tar.gz && \
mkdir -p /go/src && \
mkdir -p /go/bin
ENV PATH=$PATH:/usr/local/go/bin:/go/bin
ENV GOBIN=/go/bin
ENV GOPATH=/go/src
RUN mkdir -p /tendermint
WORKDIR /tendermint
CMD ["/usr/bin/make", "build", "TENDERMINT_BUILD_OPTIONS=cleveldb"]

View File

@@ -1,16 +0,0 @@
FROM golang:latest
# Grab deps (jq, hexdump, xxd, killall)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq bsdmainutils vim-common psmisc netcat
# Add testing deps for curl
RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends curl
VOLUME /go
EXPOSE 26656
EXPOSE 26657

View File

@@ -1,13 +0,0 @@
build:
@sh -c "'$(CURDIR)/build.sh'"
push:
@sh -c "'$(CURDIR)/push.sh'"
build_testing:
docker build --tag tendermint/testing -f ./Dockerfile.testing .
build_amazonlinux_buildimage:
docker build -t "tendermint/tendermint:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux .
.PHONY: build push build_testing build_amazonlinux_buildimage

View File

@@ -8,7 +8,7 @@ Official releases can be found [here](https://github.com/tendermint/tendermint/r
The Dockerfile for tendermint is not expected to change in the near future. The master file used for all builds can be found [here](https://raw.githubusercontent.com/tendermint/tendermint/master/DOCKER/Dockerfile).
Respective versioned files can be found <https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).
Respective versioned files can be found at `https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile` (replace the Xs with the version number).
## Quick reference

View File

@@ -1,20 +0,0 @@
#!/usr/bin/env bash
set -e
# Get the tag from the version, or try to figure it out.
if [ -z "$TAG" ]; then
TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go)
fi
if [ -z "$TAG" ]; then
echo "Please specify a tag."
exit 1
fi
TAG_NO_PATCH=${TAG%.*}
read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .
fi

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env bash
set -e
# Get the tag from the version, or try to figure it out.
if [ -z "$TAG" ]; then
TAG=$(awk -F\" '/TMCoreSemVer =/ { print $2; exit }' < ../version/version.go)
fi
if [ -z "$TAG" ]; then
echo "Please specify a tag."
exit 1
fi
TAG_NO_PATCH=${TAG%.*}
read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO_PATCH)? y/n" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker push "tendermint/tendermint:latest"
docker push "tendermint/tendermint:$TAG"
docker push "tendermint/tendermint:$TAG_NO_PATCH"
fi

View File

@@ -13,8 +13,6 @@ endif
LD_FLAGS = -X github.com/tendermint/tendermint/version.TMVersion=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
BUILD_IMAGE := ghcr.io/tendermint/docker-build-proto
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(BUILD_IMAGE)
CGO_ENABLED ?= 0
# handle nostrip
@@ -73,48 +71,52 @@ install:
$(BUILDDIR)/:
mkdir -p $@
# The Docker image containing the generator, formatter, and linter.
# This is generated by proto/Dockerfile. To update tools, make changes
# there and run the Build & Push Proto Builder Image workflow.
IMAGE := ghcr.io/tendermint/docker-build-proto:latest
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(IMAGE)
HTTPS_GIT := https://github.com/tendermint/tendermint.git
###############################################################################
### Protobuf ###
###############################################################################
proto-all: proto-lint proto-check-breaking
.PHONY: proto-all
check-proto-deps:
ifeq (,$(shell which buf))
$(error "buf is required for Protobuf building, linting and breakage checking. See https://docs.buf.build/installation for installation instructions.")
endif
ifeq (,$(shell which protoc-gen-gogofaster))
$(error "gogofaster plugin for protoc is required. Run 'go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest' to install")
endif
.PHONY: check-proto-deps
proto-gen:
check-proto-format-deps:
ifeq (,$(shell which clang-format))
$(error "clang-format is required for Protobuf formatting. See instructions for your platform on how to install it.")
endif
.PHONY: check-proto-format-deps
proto-gen: check-proto-deps
@echo "Generating Protobuf files"
@$(DOCKER_PROTO_BUILDER) buf generate --template=./buf.gen.yaml --config ./buf.yaml
@buf generate
@mv ./proto/tendermint/abci/types.pb.go ./abci/types/
.PHONY: proto-gen
# TODO: Should be removed when work on ABCI++ is complete.
# For more information, see https://github.com/tendermint/tendermint/issues/8066
abci-proto-gen:
./scripts/abci-gen.sh
.PHONY: abci-proto-gen
proto-lint:
@$(DOCKER_PROTO_BUILDER) buf lint --error-format=json --config ./buf.yaml
# These targets are provided for convenience and are intended for local
# execution only.
proto-lint: check-proto-deps
@echo "Linting Protobuf files"
@buf lint
.PHONY: proto-lint
proto-format:
proto-format: check-proto-format-deps
@echo "Formatting Protobuf files"
@$(DOCKER_PROTO_BUILDER) find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
@find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
.PHONY: proto-format
proto-check-breaking:
@$(DOCKER_PROTO_BUILDER) buf breaking --against .git --config ./buf.yaml
proto-check-breaking: check-proto-deps
@echo "Checking for breaking changes in Protobuf files against local branch"
@echo "Note: This is only useful if your changes have not yet been committed."
@echo " Otherwise read up on buf's \"breaking\" command usage:"
@echo " https://docs.buf.build/breaking/usage"
@buf breaking --against ".git"
.PHONY: proto-check-breaking
proto-check-breaking-ci:
@$(DOCKER_PROTO_BUILDER) buf breaking --against $(HTTPS_GIT) --config ./buf.yaml
.PHONY: proto-check-breaking-ci
###############################################################################
### Build ABCI ###
###############################################################################
@@ -170,7 +172,7 @@ go.sum: go.mod
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
go install github.com/RobotsAndPencils/goviz@latest
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
.PHONY: draw_deps
@@ -224,7 +226,8 @@ DESTINATION = ./index.html.md
build-docs:
@cd docs && \
while read -r branch path_prefix; do \
(git checkout $${branch} && npm ci && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \
( git checkout $${branch} && npm ci --quiet && \
VUEPRESS_BASE="/$${path_prefix}/" npm run build --quiet ) ; \
mkdir -p ~/output/$${path_prefix} ; \
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
cp ~/output/$${path_prefix}/index.html ~/output ; \
@@ -235,10 +238,8 @@ build-docs:
### Docker image ###
###############################################################################
build-docker: build-linux
cp $(BUILDDIR)/tendermint DOCKER/tendermint
build-docker:
docker build --label=tendermint --tag="tendermint/tendermint" -f DOCKER/Dockerfile .
rm -rf DOCKER/tendermint
.PHONY: build-docker
@@ -250,6 +251,21 @@ mockery:
go generate -run="./scripts/mockery_generate.sh" ./...
.PHONY: mockery
###############################################################################
### Metrics ###
###############################################################################
metrics: testdata-metrics
go generate -run="scripts/metricsgen" ./...
.PHONY: metrics
# By convention, the go tool ignores subdirectories of directories named
# 'testdata'. This command invokes the generate command on the folder directly
# to avoid this.
testdata-metrics:
ls ./scripts/metricsgen/testdata | xargs -I{} go generate -run="scripts/metricsgen" ./scripts/metricsgen/testdata/{}
.PHONY: testdata-metrics
###############################################################################
### Local testnet using docker ###
###############################################################################
@@ -335,4 +351,3 @@ split-test-packages:$(BUILDDIR)/packages.txt
split -d -n l/$(NUM_SPLIT) $< $<.
test-group-%:split-test-packages
cat $(BUILDDIR)/packages.txt.$* | xargs go test -mod=readonly -timeout=5m -race -coverprofile=$(BUILDDIR)/$*.profile.out

View File

@@ -127,6 +127,7 @@ We keep a public up-to-date version of our roadmap [here](./docs/roadmap/roadmap
- [Terra](https://www.terra.money/)
- [Celestia](https://celestia.org/)
- [Anoma](https://anoma.network/)
- [Vocdoni](https://docs.vocdoni.io/)
### Research

View File

@@ -26,6 +26,31 @@ application concern so be very sure to test the application thoroughly
using realistic workloads and the race detector to ensure your
applications remains correct.
### Config Changes
- We have added a new, experimental tool to help operators migrate
configuration files created by previous versions of Tendermint.
To try this tool, run:
```shell
# Install the tool.
go install github.com/tendermint/tendermint/scripts/confix@latest
# Run the tool with the old configuration file as input.
# Replace the -config argument with your path.
confix -config ~/.tendermint/config/config.toml -out updated.toml
```
This tool should be able to update configurations from v0.34 and v0.35. We
plan to extend it to handle older configuration files in the future. For now,
it will report an error (without making any changes) if it does not recognize
the version that created the file.
- The default configuration for a newly-created node now disables indexing for
ABCI event metadata. Existing node configurations that already have indexing
turned on are not affected. Operators who wish to enable indexing for a new
node, however, must now edit the `config.toml` explicitly.
### RPC Changes
Tendermint v0.36 adds a new RPC event subscription API. The existing event
@@ -63,6 +88,84 @@ callback.
For more detailed information, see [ADR 075](https://tinyurl.com/adr075) which
defines and describes the new API in detail.
### Timeout Parameter Changes
Tendermint v0.36 updates how the Tendermint consensus timing parameters are
configured. These parameters, `timeout-propose`, `timeout-propose-delta`,
`timeout-prevote`, `timeout-prevote-delta`, `timeout-precommit`,
`timeout-precommit-delta`, `timeout-commit`, and `skip-timeout-commit`, were
previously configured in `config.toml`. These timing parameters have moved and
are no longer configured in the `config.toml` file. These parameters have been
migrated into the `ConsensusParameters`. Nodes with these parameters set in the
local configuration file will see a warning logged on startup indicating that
these parameters are no longer used.
These parameters have also been pared-down. There are no longer separate
parameters for both the `prevote` and `precommit` phases of Tendermint. The
separate `timeout-prevote` and `timeout-precommit` parameters have been merged
into a single `timeout-vote` parameter that configures both of these similar
phases of the consensus protocol.
A set of reasonable defaults have been put in place for these new parameters
that will take effect when the node starts up in version v0.36. New chains
created using v0.36 and beyond will be able to configure these parameters in the
chain's `genesis.json` file. Chains that upgrade to v0.36 from a previous
compatible version of Tendermint will begin running with the default values.
Upgrading applications that wish to use different values from the defaults for
these parameters may do so by setting the `ConsensusParams.Timeout` field of the
`FinalizeBlock` `ABCI` response.
As a safety measure in case of unusual timing issues during the upgrade to
v0.36, an operator may override the consensus timeout values for a single node.
Note, however, that these overrides will be removed in Tendermint v0.37. See
[configuration](https://github.com/tendermint/tendermint/blob/master/docs/nodes/configuration.md)
for more information about these overrides.
For more discussion of this, see [ADR 074](https://tinyurl.com/adr074), which
lays out the reasoning for the changes as well as [RFC
009](https://tinyurl.com/rfc009) for a discussion of the complexities of
upgrading consensus parameters.
### CLI Changes
The functionality around resetting a node has been extended to make it safer. The
`unsafe-reset-all` command has been replaced by a `reset` command with four
subcommands: `blockchain`, `peers`, `unsafe-signer` and `unsafe-all`.
- `tendermint reset blockchain`: Clears a node of all blocks, consensus state, evidence,
and indexed transactions. NOTE: This command does not reset application state.
If you need to rollback the last application state (to recover from application
nondeterminism), see instead the `tendermint rollback` command.
- `tendermint reset peers`: Clears the peer store, which persists information on peers used
by the networking layer. This can be used to get rid of stale addresses or to switch
to a predefined set of static peers.
- `tendermint reset unsafe-signer`: Resets the watermark level of the PrivVal File signer
allowing it to sign votes from the genesis height. This should only be used in testing as
it can lead to the node double signing.
- `tendermint reset unsafe-all`: A summation of the other three commands. This will delete
the entire `data` directory which may include application data as well.
### Go API Changes
#### `crypto` Package Cleanup
The `github.com/tendermint/tendermint/crypto/tmhash` package was removed
to improve clarity. Users are encouraged to use the standard library
`crypto/sha256` package directly. However, as a convenience, some constants
and one function have moved to the Tendermint `crypto` package:
- The `crypto.Checksum` function returns the sha256 checksum of a
byteslice. This is a wrapper around `sha256.Sum265` from the
standard libary, but provided as a function to ease type
requirements (the library function returns a `[32]byte` rather than
a `[]byte`).
- `tmhash.TruncatedSize` is now `crypto.AddressSize` which was
previously an alias for the same value.
- `tmhash.Size` and `tmhash.BlockSize` are now `crypto.HashSize` and
`crypto.HashSize`.
- `tmhash.SumTruncated` is now available via `crypto.AddressHash` or by
`crypto.Checksum(<...>)[:crypto.AddressSize]`
## v0.35
### ABCI Changes
@@ -109,22 +212,25 @@ defines and describes the new API in detail.
The format of all tendermint on-disk database keys changes in
0.35. Upgrading nodes must either re-sync all data or run a migration
script provided in this release. The script located in
`github.com/tendermint/tendermint/scripts/keymigrate/migrate.go`
provides the function `Migrate(context.Context, db.DB)` which you can
operationalize as makes sense for your deployment.
script provided in this release.
The script located in
`github.com/tendermint/tendermint/scripts/keymigrate/migrate.go` provides the
function `Migrate(context.Context, db.DB)` which you can operationalize as
makes sense for your deployment.
For ease of use the `tendermint` command includes a CLI version of the
migration script, which you can invoke, as in:
tendermint key-migrate
This reads the configuration file as normal and allows the
`--db-backend` and `--db-dir` flags to change database operations as
needed.
This reads the configuration file as normal and allows the `--db-backend` and
`--db-dir` flags to override the database location as needed.
The migration operation is idempotent and can be run more than once,
if needed.
The migration operation is intended to be idempotent, and should be safe to
rerun on the same database multiple times. As a safety measure, however, we
recommend that operators test out the migration on a copy of the database
first, if it is practical to do so, before applying it to the production data.
### CLI Changes
@@ -177,11 +283,13 @@ the full RPC interface provided as direct function calls. Import the
the node service as in the following:
```go
node := node.NewDefault() //construct the node object
// start and set up the node service
logger := log.NewNopLogger()
client := local.New(node.(local.NodeService))
// use client object to interact with the node
// Construct and start up a node with default settings.
node := node.NewDefault(logger)
// Construct a local (in-memory) RPC client to the node.
client := local.New(logger, node.(local.NodeService))
```
### gRPC Support

View File

@@ -17,35 +17,18 @@ const (
//go:generate ../../scripts/mockery_generate.sh Client
// Client defines an interface for an ABCI client.
//
// All methods return the appropriate protobuf ResponseXxx struct and
// an error.
// Client defines the interface for an ABCI client.
//
// NOTE these are client errors, eg. ABCI socket connectivity issues.
// Application-related errors are reflected in response via ABCI error codes
// and logs.
// and (potentially) error response.
type Client interface {
service.Service
types.Application
Error() error
Flush(context.Context) error
Echo(ctx context.Context, msg string) (*types.ResponseEcho, error)
Info(context.Context, types.RequestInfo) (*types.ResponseInfo, error)
CheckTx(context.Context, types.RequestCheckTx) (*types.ResponseCheckTx, error)
Query(context.Context, types.RequestQuery) (*types.ResponseQuery, error)
Commit(context.Context) (*types.ResponseCommit, error)
InitChain(context.Context, types.RequestInitChain) (*types.ResponseInitChain, error)
PrepareProposal(context.Context, types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)
ProcessProposal(context.Context, types.RequestProcessProposal) (*types.ResponseProcessProposal, error)
ExtendVote(context.Context, types.RequestExtendVote) (*types.ResponseExtendVote, error)
VerifyVoteExtension(context.Context, types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)
FinalizeBlock(context.Context, types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)
ListSnapshots(context.Context, types.RequestListSnapshots) (*types.ResponseListSnapshots, error)
OfferSnapshot(context.Context, types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)
LoadSnapshotChunk(context.Context, types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)
ApplySnapshotChunk(context.Context, types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)
Echo(context.Context, string) (*types.ResponseEcho, error)
}
//----------------------------------------

View File

@@ -1,33 +0,0 @@
package abciclient
import (
"fmt"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
)
// Creator creates new ABCI clients.
type Creator func(log.Logger) (Client, error)
// NewLocalCreator returns a Creator for the given app,
// which will be running locally.
func NewLocalCreator(app types.Application) Creator {
return func(logger log.Logger) (Client, error) {
return NewLocalClient(logger, app), nil
}
}
// NewRemoteCreator returns a Creator for the given address (e.g.
// "192.168.0.1") and transport (e.g. "tcp"). Set mustConnect to true if you
// want the client to connect before reporting success.
func NewRemoteCreator(logger log.Logger, addr, transport string, mustConnect bool) Creator {
return func(log.Logger) (Client, error) {
remoteApp, err := NewClient(logger, addr, transport, mustConnect)
if err != nil {
return nil, fmt.Errorf("failed to connect to proxy: %w", err)
}
return remoteApp, nil
}
}

View File

@@ -52,6 +52,9 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {
}
func (cli *grpcClient) OnStart(ctx context.Context) error {
timer := time.NewTimer(0)
defer timer.Stop()
RETRY_LOOP:
for {
conn, err := grpc.Dial(cli.addr,
@@ -63,8 +66,13 @@ RETRY_LOOP:
return err
}
cli.logger.Error(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr), "err", err)
time.Sleep(time.Second * dialRetryIntervalSeconds)
continue RETRY_LOOP
timer.Reset(time.Second * dialRetryIntervalSeconds)
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
continue RETRY_LOOP
}
}
cli.logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr)
@@ -82,7 +90,13 @@ RETRY_LOOP:
}
cli.logger.Error("Echo failed", "err", err)
time.Sleep(time.Second * echoRetryIntervalSeconds)
timer.Reset(time.Second * echoRetryIntervalSeconds)
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
continue ENSURE_CONNECTED
}
}
cli.client = client
@@ -114,15 +128,15 @@ func (cli *grpcClient) Echo(ctx context.Context, msg string) (*types.ResponseEch
return cli.client.Echo(ctx, types.ToRequestEcho(msg).GetEcho(), grpc.WaitForReady(true))
}
func (cli *grpcClient) Info(ctx context.Context, params types.RequestInfo) (*types.ResponseInfo, error) {
func (cli *grpcClient) Info(ctx context.Context, params *types.RequestInfo) (*types.ResponseInfo, error) {
return cli.client.Info(ctx, types.ToRequestInfo(params).GetInfo(), grpc.WaitForReady(true))
}
func (cli *grpcClient) CheckTx(ctx context.Context, params types.RequestCheckTx) (*types.ResponseCheckTx, error) {
func (cli *grpcClient) CheckTx(ctx context.Context, params *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
return cli.client.CheckTx(ctx, types.ToRequestCheckTx(params).GetCheckTx(), grpc.WaitForReady(true))
}
func (cli *grpcClient) Query(ctx context.Context, params types.RequestQuery) (*types.ResponseQuery, error) {
func (cli *grpcClient) Query(ctx context.Context, params *types.RequestQuery) (*types.ResponseQuery, error) {
return cli.client.Query(ctx, types.ToRequestQuery(params).GetQuery(), grpc.WaitForReady(true))
}
@@ -130,42 +144,42 @@ func (cli *grpcClient) Commit(ctx context.Context) (*types.ResponseCommit, error
return cli.client.Commit(ctx, types.ToRequestCommit().GetCommit(), grpc.WaitForReady(true))
}
func (cli *grpcClient) InitChain(ctx context.Context, params types.RequestInitChain) (*types.ResponseInitChain, error) {
func (cli *grpcClient) InitChain(ctx context.Context, params *types.RequestInitChain) (*types.ResponseInitChain, error) {
return cli.client.InitChain(ctx, types.ToRequestInitChain(params).GetInitChain(), grpc.WaitForReady(true))
}
func (cli *grpcClient) ListSnapshots(ctx context.Context, params types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
func (cli *grpcClient) ListSnapshots(ctx context.Context, params *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
return cli.client.ListSnapshots(ctx, types.ToRequestListSnapshots(params).GetListSnapshots(), grpc.WaitForReady(true))
}
func (cli *grpcClient) OfferSnapshot(ctx context.Context, params types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
func (cli *grpcClient) OfferSnapshot(ctx context.Context, params *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
return cli.client.OfferSnapshot(ctx, types.ToRequestOfferSnapshot(params).GetOfferSnapshot(), grpc.WaitForReady(true))
}
func (cli *grpcClient) LoadSnapshotChunk(ctx context.Context, params types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
func (cli *grpcClient) LoadSnapshotChunk(ctx context.Context, params *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
return cli.client.LoadSnapshotChunk(ctx, types.ToRequestLoadSnapshotChunk(params).GetLoadSnapshotChunk(), grpc.WaitForReady(true))
}
func (cli *grpcClient) ApplySnapshotChunk(ctx context.Context, params types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
func (cli *grpcClient) ApplySnapshotChunk(ctx context.Context, params *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
return cli.client.ApplySnapshotChunk(ctx, types.ToRequestApplySnapshotChunk(params).GetApplySnapshotChunk(), grpc.WaitForReady(true))
}
func (cli *grpcClient) PrepareProposal(ctx context.Context, params types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
func (cli *grpcClient) PrepareProposal(ctx context.Context, params *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
return cli.client.PrepareProposal(ctx, types.ToRequestPrepareProposal(params).GetPrepareProposal(), grpc.WaitForReady(true))
}
func (cli *grpcClient) ProcessProposal(ctx context.Context, params types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
func (cli *grpcClient) ProcessProposal(ctx context.Context, params *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
return cli.client.ProcessProposal(ctx, types.ToRequestProcessProposal(params).GetProcessProposal(), grpc.WaitForReady(true))
}
func (cli *grpcClient) ExtendVote(ctx context.Context, params types.RequestExtendVote) (*types.ResponseExtendVote, error) {
func (cli *grpcClient) ExtendVote(ctx context.Context, params *types.RequestExtendVote) (*types.ResponseExtendVote, error) {
return cli.client.ExtendVote(ctx, types.ToRequestExtendVote(params).GetExtendVote(), grpc.WaitForReady(true))
}
func (cli *grpcClient) VerifyVoteExtension(ctx context.Context, params types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
func (cli *grpcClient) VerifyVoteExtension(ctx context.Context, params *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
return cli.client.VerifyVoteExtension(ctx, types.ToRequestVerifyVoteExtension(params).GetVerifyVoteExtension(), grpc.WaitForReady(true))
}
func (cli *grpcClient) FinalizeBlock(ctx context.Context, params types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
func (cli *grpcClient) FinalizeBlock(ctx context.Context, params *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
return cli.client.FinalizeBlock(ctx, types.ToRequestFinalizeBlock(params).GetFinalizeBlock(), grpc.WaitForReady(true))
}

View File

@@ -34,81 +34,7 @@ func NewLocalClient(logger log.Logger, app types.Application) Client {
func (*localClient) OnStart(context.Context) error { return nil }
func (*localClient) OnStop() {}
func (*localClient) Error() error { return nil }
//-------------------------------------------------------
func (*localClient) Flush(context.Context) error { return nil }
func (app *localClient) Echo(_ context.Context, msg string) (*types.ResponseEcho, error) {
func (*localClient) Flush(context.Context) error { return nil }
func (*localClient) Echo(_ context.Context, msg string) (*types.ResponseEcho, error) {
return &types.ResponseEcho{Message: msg}, nil
}
func (app *localClient) Info(ctx context.Context, req types.RequestInfo) (*types.ResponseInfo, error) {
res := app.Application.Info(req)
return &res, nil
}
func (app *localClient) CheckTx(_ context.Context, req types.RequestCheckTx) (*types.ResponseCheckTx, error) {
res := app.Application.CheckTx(req)
return &res, nil
}
func (app *localClient) Query(_ context.Context, req types.RequestQuery) (*types.ResponseQuery, error) {
res := app.Application.Query(req)
return &res, nil
}
func (app *localClient) Commit(ctx context.Context) (*types.ResponseCommit, error) {
res := app.Application.Commit()
return &res, nil
}
func (app *localClient) InitChain(_ context.Context, req types.RequestInitChain) (*types.ResponseInitChain, error) {
res := app.Application.InitChain(req)
return &res, nil
}
func (app *localClient) ListSnapshots(_ context.Context, req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
res := app.Application.ListSnapshots(req)
return &res, nil
}
func (app *localClient) OfferSnapshot(_ context.Context, req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
res := app.Application.OfferSnapshot(req)
return &res, nil
}
func (app *localClient) LoadSnapshotChunk(_ context.Context, req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
res := app.Application.LoadSnapshotChunk(req)
return &res, nil
}
func (app *localClient) ApplySnapshotChunk(_ context.Context, req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
res := app.Application.ApplySnapshotChunk(req)
return &res, nil
}
func (app *localClient) PrepareProposal(_ context.Context, req types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
res := app.Application.PrepareProposal(req)
return &res, nil
}
func (app *localClient) ProcessProposal(_ context.Context, req types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
res := app.Application.ProcessProposal(req)
return &res, nil
}
func (app *localClient) ExtendVote(_ context.Context, req types.RequestExtendVote) (*types.ResponseExtendVote, error) {
res := app.Application.ExtendVote(req)
return &res, nil
}
func (app *localClient) VerifyVoteExtension(_ context.Context, req types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
res := app.Application.VerifyVoteExtension(req)
return &res, nil
}
func (app *localClient) FinalizeBlock(_ context.Context, req types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
res := app.Application.FinalizeBlock(req)
return &res, nil
}

View File

@@ -4,8 +4,10 @@ package mocks
import (
context "context"
testing "testing"
mock "github.com/stretchr/testify/mock"
types "github.com/tendermint/tendermint/abci/types"
)
@@ -15,11 +17,11 @@ type Client struct {
}
// ApplySnapshotChunk provides a mock function with given fields: _a0, _a1
func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseApplySnapshotChunk
if rf, ok := ret.Get(0).(func(context.Context, types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -28,7 +30,7 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 types.RequestApply
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestApplySnapshotChunk) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -38,11 +40,11 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 types.RequestApply
}
// CheckTx provides a mock function with given fields: _a0, _a1
func (_m *Client) CheckTx(_a0 context.Context, _a1 types.RequestCheckTx) (*types.ResponseCheckTx, error) {
func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseCheckTx
if rf, ok := ret.Get(0).(func(context.Context, types.RequestCheckTx) *types.ResponseCheckTx); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -51,7 +53,7 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.RequestCheckTx) (*types
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestCheckTx) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -83,13 +85,13 @@ func (_m *Client) Commit(_a0 context.Context) (*types.ResponseCommit, error) {
return r0, r1
}
// Echo provides a mock function with given fields: ctx, msg
func (_m *Client) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) {
ret := _m.Called(ctx, msg)
// Echo provides a mock function with given fields: _a0, _a1
func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseEcho
if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok {
r0 = rf(ctx, msg)
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseEcho)
@@ -98,7 +100,7 @@ func (_m *Client) Echo(ctx context.Context, msg string) (*types.ResponseEcho, er
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, msg)
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
@@ -121,11 +123,11 @@ func (_m *Client) Error() error {
}
// ExtendVote provides a mock function with given fields: _a0, _a1
func (_m *Client) ExtendVote(_a0 context.Context, _a1 types.RequestExtendVote) (*types.ResponseExtendVote, error) {
func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) (*types.ResponseExtendVote, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseExtendVote
if rf, ok := ret.Get(0).(func(context.Context, types.RequestExtendVote) *types.ResponseExtendVote); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -134,7 +136,7 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 types.RequestExtendVote) (
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestExtendVote) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -144,11 +146,11 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 types.RequestExtendVote) (
}
// FinalizeBlock provides a mock function with given fields: _a0, _a1
func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseFinalizeBlock
if rf, ok := ret.Get(0).(func(context.Context, types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -157,7 +159,7 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 types.RequestFinalizeBl
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestFinalizeBlock) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -181,11 +183,11 @@ func (_m *Client) Flush(_a0 context.Context) error {
}
// Info provides a mock function with given fields: _a0, _a1
func (_m *Client) Info(_a0 context.Context, _a1 types.RequestInfo) (*types.ResponseInfo, error) {
func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.ResponseInfo, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseInfo
if rf, ok := ret.Get(0).(func(context.Context, types.RequestInfo) *types.ResponseInfo); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -194,7 +196,7 @@ func (_m *Client) Info(_a0 context.Context, _a1 types.RequestInfo) (*types.Respo
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestInfo) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -204,11 +206,11 @@ func (_m *Client) Info(_a0 context.Context, _a1 types.RequestInfo) (*types.Respo
}
// InitChain provides a mock function with given fields: _a0, _a1
func (_m *Client) InitChain(_a0 context.Context, _a1 types.RequestInitChain) (*types.ResponseInitChain, error) {
func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (*types.ResponseInitChain, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseInitChain
if rf, ok := ret.Get(0).(func(context.Context, types.RequestInitChain) *types.ResponseInitChain); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -217,7 +219,7 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 types.RequestInitChain) (*t
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestInitChain) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -241,11 +243,11 @@ func (_m *Client) IsRunning() bool {
}
// ListSnapshots provides a mock function with given fields: _a0, _a1
func (_m *Client) ListSnapshots(_a0 context.Context, _a1 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseListSnapshots
if rf, ok := ret.Get(0).(func(context.Context, types.RequestListSnapshots) *types.ResponseListSnapshots); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -254,7 +256,7 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 types.RequestListSnapsh
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestListSnapshots) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -264,11 +266,11 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 types.RequestListSnapsh
}
// LoadSnapshotChunk provides a mock function with given fields: _a0, _a1
func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseLoadSnapshotChunk
if rf, ok := ret.Get(0).(func(context.Context, types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -277,7 +279,7 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 types.RequestLoadSn
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestLoadSnapshotChunk) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -287,11 +289,11 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 types.RequestLoadSn
}
// OfferSnapshot provides a mock function with given fields: _a0, _a1
func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseOfferSnapshot
if rf, ok := ret.Get(0).(func(context.Context, types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -300,7 +302,7 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 types.RequestOfferSnaps
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestOfferSnapshot) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -310,11 +312,11 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 types.RequestOfferSnaps
}
// PrepareProposal provides a mock function with given fields: _a0, _a1
func (_m *Client) PrepareProposal(_a0 context.Context, _a1 types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponsePrepareProposal
if rf, ok := ret.Get(0).(func(context.Context, types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -323,7 +325,7 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 types.RequestPrepareP
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestPrepareProposal) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -333,11 +335,11 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 types.RequestPrepareP
}
// ProcessProposal provides a mock function with given fields: _a0, _a1
func (_m *Client) ProcessProposal(_a0 context.Context, _a1 types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseProcessProposal
if rf, ok := ret.Get(0).(func(context.Context, types.RequestProcessProposal) *types.ResponseProcessProposal); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -346,7 +348,7 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 types.RequestProcessP
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestProcessProposal) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -356,11 +358,11 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 types.RequestProcessP
}
// Query provides a mock function with given fields: _a0, _a1
func (_m *Client) Query(_a0 context.Context, _a1 types.RequestQuery) (*types.ResponseQuery, error) {
func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.ResponseQuery, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseQuery
if rf, ok := ret.Get(0).(func(context.Context, types.RequestQuery) *types.ResponseQuery); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -369,7 +371,7 @@ func (_m *Client) Query(_a0 context.Context, _a1 types.RequestQuery) (*types.Res
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestQuery) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -393,11 +395,11 @@ func (_m *Client) Start(_a0 context.Context) error {
}
// VerifyVoteExtension provides a mock function with given fields: _a0, _a1
func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseVerifyVoteExtension
if rf, ok := ret.Get(0).(func(context.Context, types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok {
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
@@ -406,7 +408,7 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 types.RequestVeri
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.RequestVerifyVoteExtension) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
@@ -419,3 +421,13 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 types.RequestVeri
func (_m *Client) Wait() {
_m.Called()
}
// NewClient creates a new instance of Client. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func NewClient(t testing.TB) *Client {
mock := &Client{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View File

@@ -64,6 +64,8 @@ func (cli *socketClient) OnStart(ctx context.Context) error {
err error
conn net.Conn
)
timer := time.NewTimer(0)
defer timer.Stop()
for {
conn, err = tmnet.Connect(cli.addr)
@@ -73,8 +75,15 @@ func (cli *socketClient) OnStart(ctx context.Context) error {
}
cli.logger.Error(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying after %vs...",
cli.addr, dialRetryIntervalSeconds), "err", err)
time.Sleep(time.Second * dialRetryIntervalSeconds)
continue
timer.Reset(time.Second * dialRetryIntervalSeconds)
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
continue
}
}
cli.conn = conn
@@ -90,11 +99,7 @@ func (cli *socketClient) OnStop() {
if cli.conn != nil {
cli.conn.Close()
}
// this timeout is arbitrary.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
cli.drainQueue(ctx)
cli.drainQueue()
}
// Error returns an error if the client was stopped abruptly.
@@ -113,12 +118,6 @@ func (cli *socketClient) sendRequestsRoutine(ctx context.Context, conn io.Writer
case <-ctx.Done():
return
case reqres := <-cli.reqQueue:
if ctx.Err() != nil {
return
}
cli.willSendReq(reqres)
if err := types.WriteMessage(reqres.Request, bw); err != nil {
cli.stopForError(fmt.Errorf("write to buffer: %w", err))
return
@@ -162,6 +161,11 @@ func (cli *socketClient) recvResponseRoutine(ctx context.Context, conn io.Reader
func (cli *socketClient) willSendReq(reqres *requestAndResponse) {
cli.mtx.Lock()
defer cli.mtx.Unlock()
if !cli.IsRunning() {
return
}
cli.reqSent.PushBack(reqres)
}
@@ -189,138 +193,13 @@ func (cli *socketClient) didRecvResponse(res *types.Response) error {
//----------------------------------------
func (cli *socketClient) Flush(ctx context.Context) error {
_, err := cli.doRequest(ctx, types.ToRequestFlush())
if err != nil {
return err
}
return nil
}
func (cli *socketClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) {
res, err := cli.doRequest(ctx, types.ToRequestEcho(msg))
if err != nil {
return nil, err
}
return res.GetEcho(), nil
}
func (cli *socketClient) Info(ctx context.Context, req types.RequestInfo) (*types.ResponseInfo, error) {
res, err := cli.doRequest(ctx, types.ToRequestInfo(req))
if err != nil {
return nil, err
}
return res.GetInfo(), nil
}
func (cli *socketClient) CheckTx(ctx context.Context, req types.RequestCheckTx) (*types.ResponseCheckTx, error) {
res, err := cli.doRequest(ctx, types.ToRequestCheckTx(req))
if err != nil {
return nil, err
}
return res.GetCheckTx(), nil
}
func (cli *socketClient) Query(ctx context.Context, req types.RequestQuery) (*types.ResponseQuery, error) {
res, err := cli.doRequest(ctx, types.ToRequestQuery(req))
if err != nil {
return nil, err
}
return res.GetQuery(), nil
}
func (cli *socketClient) Commit(ctx context.Context) (*types.ResponseCommit, error) {
res, err := cli.doRequest(ctx, types.ToRequestCommit())
if err != nil {
return nil, err
}
return res.GetCommit(), nil
}
func (cli *socketClient) InitChain(ctx context.Context, req types.RequestInitChain) (*types.ResponseInitChain, error) {
res, err := cli.doRequest(ctx, types.ToRequestInitChain(req))
if err != nil {
return nil, err
}
return res.GetInitChain(), nil
}
func (cli *socketClient) ListSnapshots(ctx context.Context, req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
res, err := cli.doRequest(ctx, types.ToRequestListSnapshots(req))
if err != nil {
return nil, err
}
return res.GetListSnapshots(), nil
}
func (cli *socketClient) OfferSnapshot(ctx context.Context, req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
res, err := cli.doRequest(ctx, types.ToRequestOfferSnapshot(req))
if err != nil {
return nil, err
}
return res.GetOfferSnapshot(), nil
}
func (cli *socketClient) LoadSnapshotChunk(ctx context.Context, req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
res, err := cli.doRequest(ctx, types.ToRequestLoadSnapshotChunk(req))
if err != nil {
return nil, err
}
return res.GetLoadSnapshotChunk(), nil
}
func (cli *socketClient) ApplySnapshotChunk(ctx context.Context, req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
res, err := cli.doRequest(ctx, types.ToRequestApplySnapshotChunk(req))
if err != nil {
return nil, err
}
return res.GetApplySnapshotChunk(), nil
}
func (cli *socketClient) PrepareProposal(ctx context.Context, req types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
res, err := cli.doRequest(ctx, types.ToRequestPrepareProposal(req))
if err != nil {
return nil, err
}
return res.GetPrepareProposal(), nil
}
func (cli *socketClient) ProcessProposal(ctx context.Context, req types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
res, err := cli.doRequest(ctx, types.ToRequestProcessProposal(req))
if err != nil {
return nil, err
}
return res.GetProcessProposal(), nil
}
func (cli *socketClient) ExtendVote(ctx context.Context, req types.RequestExtendVote) (*types.ResponseExtendVote, error) {
res, err := cli.doRequest(ctx, types.ToRequestExtendVote(req))
if err != nil {
return nil, err
}
return res.GetExtendVote(), nil
}
func (cli *socketClient) VerifyVoteExtension(ctx context.Context, req types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
res, err := cli.doRequest(ctx, types.ToRequestVerifyVoteExtension(req))
if err != nil {
return nil, err
}
return res.GetVerifyVoteExtension(), nil
}
func (cli *socketClient) FinalizeBlock(ctx context.Context, req types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
res, err := cli.doRequest(ctx, types.ToRequestFinalizeBlock(req))
if err != nil {
return nil, err
}
return res.GetFinalizeBlock(), nil
}
//----------------------------------------
func (cli *socketClient) doRequest(ctx context.Context, req *types.Request) (*types.Response, error) {
if !cli.IsRunning() {
return nil, errors.New("client has stopped")
}
reqres := makeReqRes(req)
cli.willSendReq(reqres)
select {
case cli.reqQueue <- reqres:
@@ -342,7 +221,7 @@ func (cli *socketClient) doRequest(ctx context.Context, req *types.Request) (*ty
// drainQueue marks as complete and discards all remaining pending requests
// from the queue.
func (cli *socketClient) drainQueue(ctx context.Context) {
func (cli *socketClient) drainQueue() {
cli.mtx.Lock()
defer cli.mtx.Unlock()
@@ -351,22 +230,136 @@ func (cli *socketClient) drainQueue(ctx context.Context) {
reqres := req.Value.(*requestAndResponse)
reqres.markDone()
}
}
// Mark all queued messages as resolved.
//
// TODO(creachadair): We can't simply range the channel, because it is never
// closed, and the writer continues to add work.
// See https://github.com/tendermint/tendermint/issues/6996.
for {
select {
case <-ctx.Done():
return
case reqres := <-cli.reqQueue:
reqres.markDone()
default:
return
}
//----------------------------------------
func (cli *socketClient) Flush(ctx context.Context) error {
_, err := cli.doRequest(ctx, types.ToRequestFlush())
if err != nil {
return err
}
return nil
}
func (cli *socketClient) Echo(ctx context.Context, msg string) (*types.ResponseEcho, error) {
res, err := cli.doRequest(ctx, types.ToRequestEcho(msg))
if err != nil {
return nil, err
}
return res.GetEcho(), nil
}
func (cli *socketClient) Info(ctx context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) {
res, err := cli.doRequest(ctx, types.ToRequestInfo(req))
if err != nil {
return nil, err
}
return res.GetInfo(), nil
}
func (cli *socketClient) CheckTx(ctx context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
res, err := cli.doRequest(ctx, types.ToRequestCheckTx(req))
if err != nil {
return nil, err
}
return res.GetCheckTx(), nil
}
func (cli *socketClient) Query(ctx context.Context, req *types.RequestQuery) (*types.ResponseQuery, error) {
res, err := cli.doRequest(ctx, types.ToRequestQuery(req))
if err != nil {
return nil, err
}
return res.GetQuery(), nil
}
func (cli *socketClient) Commit(ctx context.Context) (*types.ResponseCommit, error) {
res, err := cli.doRequest(ctx, types.ToRequestCommit())
if err != nil {
return nil, err
}
return res.GetCommit(), nil
}
func (cli *socketClient) InitChain(ctx context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) {
res, err := cli.doRequest(ctx, types.ToRequestInitChain(req))
if err != nil {
return nil, err
}
return res.GetInitChain(), nil
}
func (cli *socketClient) ListSnapshots(ctx context.Context, req *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
res, err := cli.doRequest(ctx, types.ToRequestListSnapshots(req))
if err != nil {
return nil, err
}
return res.GetListSnapshots(), nil
}
func (cli *socketClient) OfferSnapshot(ctx context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
res, err := cli.doRequest(ctx, types.ToRequestOfferSnapshot(req))
if err != nil {
return nil, err
}
return res.GetOfferSnapshot(), nil
}
func (cli *socketClient) LoadSnapshotChunk(ctx context.Context, req *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
res, err := cli.doRequest(ctx, types.ToRequestLoadSnapshotChunk(req))
if err != nil {
return nil, err
}
return res.GetLoadSnapshotChunk(), nil
}
func (cli *socketClient) ApplySnapshotChunk(ctx context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
res, err := cli.doRequest(ctx, types.ToRequestApplySnapshotChunk(req))
if err != nil {
return nil, err
}
return res.GetApplySnapshotChunk(), nil
}
func (cli *socketClient) PrepareProposal(ctx context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
res, err := cli.doRequest(ctx, types.ToRequestPrepareProposal(req))
if err != nil {
return nil, err
}
return res.GetPrepareProposal(), nil
}
func (cli *socketClient) ProcessProposal(ctx context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
res, err := cli.doRequest(ctx, types.ToRequestProcessProposal(req))
if err != nil {
return nil, err
}
return res.GetProcessProposal(), nil
}
func (cli *socketClient) ExtendVote(ctx context.Context, req *types.RequestExtendVote) (*types.ResponseExtendVote, error) {
res, err := cli.doRequest(ctx, types.ToRequestExtendVote(req))
if err != nil {
return nil, err
}
return res.GetExtendVote(), nil
}
func (cli *socketClient) VerifyVoteExtension(ctx context.Context, req *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
res, err := cli.doRequest(ctx, types.ToRequestVerifyVoteExtension(req))
if err != nil {
return nil, err
}
return res.GetVerifyVoteExtension(), nil
}
func (cli *socketClient) FinalizeBlock(ctx context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
res, err := cli.doRequest(ctx, types.ToRequestFinalizeBlock(req))
if err != nil {
return nil, err
}
return res.GetFinalizeBlock(), nil
}
//----------------------------------------

View File

@@ -1,85 +0,0 @@
package abciclient_test
import (
"context"
"fmt"
"testing"
"time"
"math/rand"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abciclient "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/service"
)
func TestProperSyncCalls(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
app := slowApp{}
logger := log.NewNopLogger()
_, c := setupClientServer(ctx, t, logger, app)
resp := make(chan error, 1)
go func() {
rsp, err := c.FinalizeBlock(ctx, types.RequestFinalizeBlock{})
assert.NoError(t, err)
assert.NoError(t, c.Flush(ctx))
assert.NotNil(t, rsp)
select {
case <-ctx.Done():
case resp <- c.Error():
}
}()
select {
case <-time.After(time.Second):
require.Fail(t, "No response arrived")
case err, ok := <-resp:
require.True(t, ok, "Must not close channel")
assert.NoError(t, err, "This should return success")
}
}
func setupClientServer(
ctx context.Context,
t *testing.T,
logger log.Logger,
app types.Application,
) (service.Service, abciclient.Client) {
t.Helper()
// some port between 20k and 30k
port := 20000 + rand.Int31()%10000
addr := fmt.Sprintf("localhost:%d", port)
s, err := server.NewServer(logger, addr, "socket", app)
require.NoError(t, err)
require.NoError(t, s.Start(ctx))
t.Cleanup(s.Wait)
c := abciclient.NewSocketClient(logger, addr, true)
require.NoError(t, c.Start(ctx))
t.Cleanup(c.Wait)
require.True(t, s.IsRunning())
require.True(t, c.IsRunning())
return s, c
}
type slowApp struct {
types.BaseApplication
}
func (slowApp) FinalizeBlock(req types.RequestFinalizeBlock) types.ResponseFinalizeBlock {
time.Sleep(200 * time.Millisecond)
return types.ResponseFinalizeBlock{}
}

View File

@@ -125,7 +125,7 @@ func addCommands(cmd *cobra.Command, logger log.Logger) {
cmd.AddCommand(consoleCmd)
cmd.AddCommand(echoCmd)
cmd.AddCommand(infoCmd)
cmd.AddCommand(deliverTxCmd)
cmd.AddCommand(finalizeBlockCmd)
cmd.AddCommand(checkTxCmd)
cmd.AddCommand(commitCmd)
cmd.AddCommand(versionCmd)
@@ -150,10 +150,9 @@ where example.file looks something like:
check_tx 0x00
check_tx 0xff
deliver_tx 0x00
finalize_block 0x00
check_tx 0x00
deliver_tx 0x01
deliver_tx 0x04
finalize_block 0x01 0x04 0xff
info
`,
Args: cobra.ExactArgs(0),
@@ -169,7 +168,7 @@ This command opens an interactive console for running any of the other commands
without opening a new connection each time
`,
Args: cobra.ExactArgs(0),
ValidArgs: []string{"echo", "info", "deliver_tx", "check_tx", "commit", "query"},
ValidArgs: []string{"echo", "info", "finalize_block", "check_tx", "commit", "query"},
RunE: cmdConsole,
}
@@ -188,11 +187,11 @@ var infoCmd = &cobra.Command{
RunE: cmdInfo,
}
var deliverTxCmd = &cobra.Command{
Use: "deliver_tx",
Short: "deliver a new transaction to the application",
Long: "deliver a new transaction to the application",
Args: cobra.ExactArgs(1),
var finalizeBlockCmd = &cobra.Command{
Use: "finalize_block",
Short: "deliver a block of transactions to the application",
Long: "deliver a block of transactions to the application",
Args: cobra.MinimumNArgs(1),
RunE: cmdFinalizeBlock,
}
@@ -426,7 +425,7 @@ func muxOnCommands(cmd *cobra.Command, pArgs []string) error {
return cmdCheckTx(cmd, actualArgs)
case "commit":
return cmdCommit(cmd, actualArgs)
case "deliver_tx":
case "finalize_block":
return cmdFinalizeBlock(cmd, actualArgs)
case "echo":
return cmdEcho(cmd, actualArgs)
@@ -483,7 +482,7 @@ func cmdInfo(cmd *cobra.Command, args []string) error {
if len(args) == 1 {
version = args[0]
}
res, err := client.Info(cmd.Context(), types.RequestInfo{Version: version})
res, err := client.Info(cmd.Context(), &types.RequestInfo{Version: version})
if err != nil {
return err
}
@@ -500,19 +499,23 @@ func cmdFinalizeBlock(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
printResponse(cmd, args, response{
Code: codeBad,
Log: "want the tx",
Log: "Must provide at least one transaction",
})
return nil
}
txBytes, err := stringOrHexToBytes(args[0])
txs := make([][]byte, len(args))
for i, arg := range args {
txBytes, err := stringOrHexToBytes(arg)
if err != nil {
return err
}
txs[i] = txBytes
}
res, err := client.FinalizeBlock(cmd.Context(), &types.RequestFinalizeBlock{Txs: txs})
if err != nil {
return err
}
res, err := client.FinalizeBlock(cmd.Context(), types.RequestFinalizeBlock{Txs: [][]byte{txBytes}})
if err != nil {
return err
}
for _, tx := range res.Txs {
for _, tx := range res.TxResults {
printResponse(cmd, args, response{
Code: tx.Code,
Data: tx.Data,
@@ -536,7 +539,7 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
res, err := client.CheckTx(cmd.Context(), types.RequestCheckTx{Tx: txBytes})
res, err := client.CheckTx(cmd.Context(), &types.RequestCheckTx{Tx: txBytes})
if err != nil {
return err
}
@@ -576,7 +579,7 @@ func cmdQuery(cmd *cobra.Command, args []string) error {
return err
}
resQuery, err := client.Query(cmd.Context(), types.RequestQuery{
resQuery, err := client.Query(cmd.Context(), &types.RequestQuery{
Data: queryBytes,
Path: flagPath,
Height: int64(flagHeight),

View File

@@ -53,7 +53,7 @@ func TestGRPC(t *testing.T) {
logger := log.NewNopLogger()
t.Log("### Testing GRPC")
testGRPCSync(ctx, t, logger, types.NewGRPCApplication(types.NewBaseApplication()))
testGRPCSync(ctx, t, logger, types.NewBaseApplication())
}
func testBulk(ctx context.Context, t *testing.T, logger log.Logger, app types.Application) {
@@ -77,15 +77,15 @@ func testBulk(ctx context.Context, t *testing.T, logger log.Logger, app types.Ap
require.NoError(t, err)
// Construct request
rfb := types.RequestFinalizeBlock{Txs: make([][]byte, numDeliverTxs)}
rfb := &types.RequestFinalizeBlock{Txs: make([][]byte, numDeliverTxs)}
for counter := 0; counter < numDeliverTxs; counter++ {
rfb.Txs[counter] = []byte("test")
}
// Send bulk request
res, err := client.FinalizeBlock(ctx, rfb)
require.NoError(t, err)
require.Equal(t, numDeliverTxs, len(res.Txs), "Number of txs doesn't match")
for _, tx := range res.Txs {
require.Equal(t, numDeliverTxs, len(res.TxResults), "Number of txs doesn't match")
for _, tx := range res.TxResults {
require.Equal(t, tx.Code, code.CodeTypeOK, "Tx failed")
}
@@ -101,7 +101,7 @@ func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {
return tmnet.Connect(addr)
}
func testGRPCSync(ctx context.Context, t *testing.T, logger log.Logger, app types.ABCIApplicationServer) {
func testGRPCSync(ctx context.Context, t *testing.T, logger log.Logger, app types.Application) {
t.Helper()
numDeliverTxs := 680000
socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30))
@@ -138,8 +138,8 @@ func testGRPCSync(ctx context.Context, t *testing.T, logger log.Logger, app type
// Send request
response, err := client.FinalizeBlock(ctx, &rfb)
require.NoError(t, err, "Error in GRPC FinalizeBlock")
require.Equal(t, numDeliverTxs, len(response.Txs), "Number of txs returned via GRPC doesn't match")
for _, tx := range response.Txs {
require.Equal(t, numDeliverTxs, len(response.TxResults), "Number of txs returned via GRPC doesn't match")
for _, tx := range response.TxResults {
require.Equal(t, tx.Code, code.CodeTypeOK, "Tx failed")
}
}

View File

@@ -1,6 +1,7 @@
package kvstore
import (
"context"
mrand "math/rand"
"github.com/tendermint/tendermint/abci/types"
@@ -32,8 +33,9 @@ func RandVals(cnt int) []types.ValidatorUpdate {
// InitKVStore initializes the kvstore app with some data,
// which allows tests to pass and is fine as long as you
// don't make any tx that modify the validator state
func InitKVStore(app *PersistentKVStoreApplication) {
app.InitChain(types.RequestInitChain{
func InitKVStore(ctx context.Context, app *PersistentKVStoreApplication) error {
_, err := app.InitChain(ctx, &types.RequestInitChain{
Validators: RandVals(1),
})
return err
}

View File

@@ -2,6 +2,7 @@ package kvstore
import (
"bytes"
"context"
"encoding/base64"
"encoding/binary"
"encoding/json"
@@ -90,7 +91,7 @@ func NewApplication() *Application {
}
}
func (app *Application) InitChain(req types.RequestInitChain) types.ResponseInitChain {
func (app *Application) InitChain(_ context.Context, req *types.RequestInitChain) (*types.ResponseInitChain, error) {
app.mu.Lock()
defer app.mu.Unlock()
@@ -101,23 +102,23 @@ func (app *Application) InitChain(req types.RequestInitChain) types.ResponseInit
panic("problem updating validators")
}
}
return types.ResponseInitChain{}
return &types.ResponseInitChain{}, nil
}
func (app *Application) Info(req types.RequestInfo) types.ResponseInfo {
func (app *Application) Info(_ context.Context, req *types.RequestInfo) (*types.ResponseInfo, error) {
app.mu.Lock()
defer app.mu.Unlock()
return types.ResponseInfo{
return &types.ResponseInfo{
Data: fmt.Sprintf("{\"size\":%v}", app.state.Size),
Version: version.ABCIVersion,
AppVersion: ProtocolVersion,
LastBlockHeight: app.state.Height,
LastBlockAppHash: app.state.AppHash,
}
}, nil
}
// tx is either "val:pubkey!power" or "key=value" or just arbitrary bytes
func (app *Application) handleTx(tx []byte) *types.ResponseDeliverTx {
func (app *Application) handleTx(tx []byte) *types.ExecTxResult {
// if it starts with "val:", update the validator set
// format is "val:pubkey!power"
if isValidatorTx(tx) {
@@ -156,7 +157,7 @@ func (app *Application) handleTx(tx []byte) *types.ResponseDeliverTx {
},
}
return &types.ResponseDeliverTx{Code: code.CodeTypeOK, Events: events}
return &types.ExecTxResult{Code: code.CodeTypeOK, Events: events}
}
func (app *Application) Close() error {
@@ -166,7 +167,7 @@ func (app *Application) Close() error {
return app.state.db.Close()
}
func (app *Application) FinalizeBlock(req types.RequestFinalizeBlock) types.ResponseFinalizeBlock {
func (app *Application) FinalizeBlock(_ context.Context, req *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
app.mu.Lock()
defer app.mu.Unlock()
@@ -175,7 +176,7 @@ func (app *Application) FinalizeBlock(req types.RequestFinalizeBlock) types.Resp
// Punish validators who committed equivocation.
for _, ev := range req.ByzantineValidators {
if ev.Type == types.EvidenceType_DUPLICATE_VOTE {
if ev.Type == types.MisbehaviorType_DUPLICATE_VOTE {
addr := string(ev.Validator.Address)
if pubKey, ok := app.valAddrToPubKeyMap[addr]; ok {
app.updateValidator(types.ValidatorUpdate{
@@ -190,19 +191,19 @@ func (app *Application) FinalizeBlock(req types.RequestFinalizeBlock) types.Resp
}
}
respTxs := make([]*types.ResponseDeliverTx, len(req.Txs))
respTxs := make([]*types.ExecTxResult, len(req.Txs))
for i, tx := range req.Txs {
respTxs[i] = app.handleTx(tx)
}
return types.ResponseFinalizeBlock{Txs: respTxs, ValidatorUpdates: app.ValUpdates}
return &types.ResponseFinalizeBlock{TxResults: respTxs, ValidatorUpdates: app.ValUpdates}, nil
}
func (*Application) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx {
return types.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1}
func (*Application) CheckTx(_ context.Context, req *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
return &types.ResponseCheckTx{Code: code.CodeTypeOK, GasWanted: 1}, nil
}
func (app *Application) Commit() types.ResponseCommit {
func (app *Application) Commit(_ context.Context) (*types.ResponseCommit, error) {
app.mu.Lock()
defer app.mu.Unlock()
@@ -213,15 +214,15 @@ func (app *Application) Commit() types.ResponseCommit {
app.state.Height++
saveState(app.state)
resp := types.ResponseCommit{Data: appHash}
resp := &types.ResponseCommit{Data: appHash}
if app.RetainBlocks > 0 && app.state.Height >= app.RetainBlocks {
resp.RetainHeight = app.state.Height - app.RetainBlocks + 1
}
return resp
return resp, nil
}
// Returns an associated value or nil if missing.
func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery {
func (app *Application) Query(_ context.Context, reqQuery *types.RequestQuery) (*types.ResponseQuery, error) {
app.mu.Lock()
defer app.mu.Unlock()
@@ -232,10 +233,10 @@ func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery {
panic(err)
}
return types.ResponseQuery{
return &types.ResponseQuery{
Key: reqQuery.Data,
Value: value,
}
}, nil
}
if reqQuery.Prove {
@@ -257,7 +258,7 @@ func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery {
resQuery.Log = "exists"
}
return resQuery
return &resQuery, nil
}
value, err := app.state.db.Get(prefixKey(reqQuery.Data))
@@ -277,23 +278,25 @@ func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery {
resQuery.Log = "exists"
}
return resQuery
return &resQuery, nil
}
func (app *Application) PrepareProposal(req types.RequestPrepareProposal) types.ResponsePrepareProposal {
func (app *Application) PrepareProposal(_ context.Context, req *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
app.mu.Lock()
defer app.mu.Unlock()
return types.ResponsePrepareProposal{BlockData: app.substPrepareTx(req.BlockData)}
return &types.ResponsePrepareProposal{
TxRecords: app.substPrepareTx(req.Txs, req.MaxTxBytes),
}, nil
}
func (*Application) ProcessProposal(req types.RequestProcessProposal) types.ResponseProcessProposal {
func (*Application) ProcessProposal(_ context.Context, req *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
for _, tx := range req.Txs {
if len(tx) == 0 {
return types.ResponseProcessProposal{Accept: false}
return &types.ResponseProcessProposal{Status: types.ResponseProcessProposal_REJECT}, nil
}
}
return types.ResponseProcessProposal{Accept: true}
return &types.ResponseProcessProposal{Status: types.ResponseProcessProposal_ACCEPT}, nil
}
//---------------------------------------------
@@ -338,13 +341,13 @@ func isValidatorTx(tx []byte) bool {
// format is "val:pubkey!power"
// pubkey is a base64-encoded 32-byte ed25519 key
func (app *Application) execValidatorTx(tx []byte) *types.ResponseDeliverTx {
func (app *Application) execValidatorTx(tx []byte) *types.ExecTxResult {
tx = tx[len(ValidatorSetChangePrefix):]
// get the pubkey and power
pubKeyAndPower := strings.Split(string(tx), "!")
if len(pubKeyAndPower) != 2 {
return &types.ResponseDeliverTx{
return &types.ExecTxResult{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Expected 'pubkey!power'. Got %v", pubKeyAndPower)}
}
@@ -353,7 +356,7 @@ func (app *Application) execValidatorTx(tx []byte) *types.ResponseDeliverTx {
// decode the pubkey
pubkey, err := base64.StdEncoding.DecodeString(pubkeyS)
if err != nil {
return &types.ResponseDeliverTx{
return &types.ExecTxResult{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Pubkey (%s) is invalid base64", pubkeyS)}
}
@@ -361,7 +364,7 @@ func (app *Application) execValidatorTx(tx []byte) *types.ResponseDeliverTx {
// decode the power
power, err := strconv.ParseInt(powerS, 10, 64)
if err != nil {
return &types.ResponseDeliverTx{
return &types.ExecTxResult{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("Power (%s) is not an int", powerS)}
}
@@ -371,7 +374,7 @@ func (app *Application) execValidatorTx(tx []byte) *types.ResponseDeliverTx {
}
// add, update, or remove a validator
func (app *Application) updateValidator(v types.ValidatorUpdate) *types.ResponseDeliverTx {
func (app *Application) updateValidator(v types.ValidatorUpdate) *types.ExecTxResult {
pubkey, err := encoding.PubKeyFromProto(v.PubKey)
if err != nil {
panic(fmt.Errorf("can't decode public key: %w", err))
@@ -386,7 +389,7 @@ func (app *Application) updateValidator(v types.ValidatorUpdate) *types.Response
}
if !hasKey {
pubStr := base64.StdEncoding.EncodeToString(pubkey.Bytes())
return &types.ResponseDeliverTx{
return &types.ExecTxResult{
Code: code.CodeTypeUnauthorized,
Log: fmt.Sprintf("Cannot remove non-existent validator %s", pubStr)}
}
@@ -398,7 +401,7 @@ func (app *Application) updateValidator(v types.ValidatorUpdate) *types.Response
// add or update validator
value := bytes.NewBuffer(make([]byte, 0))
if err := types.WriteMessage(&v, value); err != nil {
return &types.ResponseDeliverTx{
return &types.ExecTxResult{
Code: code.CodeTypeEncodingError,
Log: fmt.Sprintf("error encoding validator: %v", err)}
}
@@ -411,7 +414,7 @@ func (app *Application) updateValidator(v types.ValidatorUpdate) *types.Response
// we only update the changes array if we successfully updated the tree
app.ValUpdates = append(app.ValUpdates, v)
return &types.ResponseDeliverTx{Code: code.CodeTypeOK}
return &types.ExecTxResult{Code: code.CodeTypeOK}
}
// -----------------------------
@@ -420,26 +423,44 @@ func (app *Application) updateValidator(v types.ValidatorUpdate) *types.Response
const PreparePrefix = "prepare"
func isPrepareTx(tx []byte) bool {
return strings.HasPrefix(string(tx), PreparePrefix)
return bytes.HasPrefix(tx, []byte(PreparePrefix))
}
// execPrepareTx is noop. tx data is considered as placeholder
// and is substitute at the PrepareProposal.
func (app *Application) execPrepareTx(tx []byte) *types.ResponseDeliverTx {
func (app *Application) execPrepareTx(tx []byte) *types.ExecTxResult {
// noop
return &types.ResponseDeliverTx{}
return &types.ExecTxResult{}
}
// substPrepareTx subst all the preparetx in the blockdata
// to null string(could be any arbitrary string).
func (app *Application) substPrepareTx(blockData [][]byte) [][]byte {
// TODO: this mechanism will change with the current spec of PrepareProposal
// We now have a special type for marking a tx as changed
for i, tx := range blockData {
// substPrepareTx substitutes all the transactions prefixed with 'prepare' in the
// proposal for transactions with the prefix stripped.
// It marks all of the original transactions as 'REMOVED' so that
// Tendermint will remove them from its mempool.
func (app *Application) substPrepareTx(blockData [][]byte, maxTxBytes int64) []*types.TxRecord {
trs := make([]*types.TxRecord, 0, len(blockData))
var removed []*types.TxRecord
var totalBytes int64
for _, tx := range blockData {
txMod := tx
action := types.TxRecord_UNMODIFIED
if isPrepareTx(tx) {
blockData[i] = make([]byte, len(tx))
removed = append(removed, &types.TxRecord{
Tx: tx,
Action: types.TxRecord_REMOVED,
})
txMod = bytes.TrimPrefix(tx, []byte(PreparePrefix))
action = types.TxRecord_ADDED
}
totalBytes += int64(len(txMod))
if totalBytes > maxTxBytes {
break
}
trs = append(trs, &types.TxRecord{
Tx: txMod,
Action: action,
})
}
return blockData
return append(trs, removed...)
}

View File

@@ -16,7 +16,6 @@ import (
"github.com/tendermint/tendermint/abci/example/code"
abciserver "github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)
const (
@@ -24,37 +23,43 @@ const (
testValue = "def"
)
func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) {
req := types.RequestFinalizeBlock{Txs: [][]byte{tx}}
ar := app.FinalizeBlock(req)
require.Equal(t, 1, len(ar.Txs))
require.False(t, ar.Txs[0].IsErr())
func testKVStore(ctx context.Context, t *testing.T, app types.Application, tx []byte, key, value string) {
req := &types.RequestFinalizeBlock{Txs: [][]byte{tx}}
ar, err := app.FinalizeBlock(ctx, req)
require.NoError(t, err)
require.Equal(t, 1, len(ar.TxResults))
require.False(t, ar.TxResults[0].IsErr())
// repeating tx doesn't raise error
ar = app.FinalizeBlock(req)
require.Equal(t, 1, len(ar.Txs))
require.False(t, ar.Txs[0].IsErr())
ar, err = app.FinalizeBlock(ctx, req)
require.NoError(t, err)
require.Equal(t, 1, len(ar.TxResults))
require.False(t, ar.TxResults[0].IsErr())
// commit
app.Commit()
_, err = app.Commit(ctx)
require.NoError(t, err)
info := app.Info(types.RequestInfo{})
info, err := app.Info(ctx, &types.RequestInfo{})
require.NoError(t, err)
require.NotZero(t, info.LastBlockHeight)
// make sure query is fine
resQuery := app.Query(types.RequestQuery{
resQuery, err := app.Query(ctx, &types.RequestQuery{
Path: "/store",
Data: []byte(key),
})
require.NoError(t, err)
require.Equal(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, key, string(resQuery.Key))
require.Equal(t, value, string(resQuery.Value))
require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
// make sure proof is fine
resQuery = app.Query(types.RequestQuery{
resQuery, err = app.Query(ctx, &types.RequestQuery{
Path: "/store",
Data: []byte(key),
Prove: true,
})
require.NoError(t, err)
require.EqualValues(t, code.CodeTypeOK, resQuery.Code)
require.Equal(t, key, string(resQuery.Key))
require.Equal(t, value, string(resQuery.Value))
@@ -62,18 +67,24 @@ func testKVStore(t *testing.T, app types.Application, tx []byte, key, value stri
}
func TestKVStoreKV(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
kvstore := NewApplication()
key := testKey
value := key
tx := []byte(key)
testKVStore(t, kvstore, tx, key, value)
testKVStore(ctx, t, kvstore, tx, key, value)
value = testValue
tx = []byte(key + "=" + value)
testKVStore(t, kvstore, tx, key, value)
testKVStore(ctx, t, kvstore, tx, key, value)
}
func TestPersistentKVStoreKV(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
dir := t.TempDir()
logger := log.NewNopLogger()
@@ -81,22 +92,30 @@ func TestPersistentKVStoreKV(t *testing.T) {
key := testKey
value := key
tx := []byte(key)
testKVStore(t, kvstore, tx, key, value)
testKVStore(ctx, t, kvstore, tx, key, value)
value = testValue
tx = []byte(key + "=" + value)
testKVStore(t, kvstore, tx, key, value)
testKVStore(ctx, t, kvstore, tx, key, value)
}
func TestPersistentKVStoreInfo(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
dir := t.TempDir()
logger := log.NewNopLogger()
kvstore := NewPersistentKVStoreApplication(logger, dir)
InitKVStore(kvstore)
if err := InitKVStore(ctx, kvstore); err != nil {
t.Fatal(err)
}
height := int64(0)
resInfo := kvstore.Info(types.RequestInfo{})
resInfo, err := kvstore.Info(ctx, &types.RequestInfo{})
if err != nil {
t.Fatal(err)
}
if resInfo.LastBlockHeight != height {
t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
}
@@ -104,13 +123,19 @@ func TestPersistentKVStoreInfo(t *testing.T) {
// make and apply block
height = int64(1)
hash := []byte("foo")
header := tmproto.Header{
Height: height,
if _, err := kvstore.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Hash: hash, Height: height}); err != nil {
t.Fatal(err)
}
kvstore.FinalizeBlock(types.RequestFinalizeBlock{Hash: hash, Header: header, Height: height})
kvstore.Commit()
resInfo = kvstore.Info(types.RequestInfo{})
if _, err := kvstore.Commit(ctx); err != nil {
t.Fatal(err)
}
resInfo, err = kvstore.Info(ctx, &types.RequestInfo{})
if err != nil {
t.Fatal(err)
}
if resInfo.LastBlockHeight != height {
t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight)
}
@@ -119,6 +144,9 @@ func TestPersistentKVStoreInfo(t *testing.T) {
// add a validator, remove a validator, update a validator
func TestValUpdates(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
kvstore := NewApplication()
// init with some validators
@@ -126,9 +154,12 @@ func TestValUpdates(t *testing.T) {
nInit := 5
vals := RandVals(total)
// initialize with the first nInit
kvstore.InitChain(types.RequestInitChain{
_, err := kvstore.InitChain(ctx, &types.RequestInitChain{
Validators: vals[:nInit],
})
if err != nil {
t.Fatal(err)
}
vals1, vals2 := vals[:nInit], kvstore.Validators()
valsEqual(t, vals1, vals2)
@@ -141,7 +172,7 @@ func TestValUpdates(t *testing.T) {
tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power)
tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power)
makeApplyBlock(t, kvstore, 1, diff, tx1, tx2)
makeApplyBlock(ctx, t, kvstore, 1, diff, tx1, tx2)
vals1, vals2 = vals[:nInit+2], kvstore.Validators()
valsEqual(t, vals1, vals2)
@@ -156,7 +187,7 @@ func TestValUpdates(t *testing.T) {
tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power)
tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power)
makeApplyBlock(t, kvstore, 2, diff, tx1, tx2, tx3)
makeApplyBlock(ctx, t, kvstore, 2, diff, tx1, tx2, tx3)
vals1 = append(vals[:nInit-2], vals[nInit+1]) // nolint: gocritic
vals2 = kvstore.Validators()
@@ -172,7 +203,7 @@ func TestValUpdates(t *testing.T) {
diff = []types.ValidatorUpdate{v1}
tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power)
makeApplyBlock(t, kvstore, 3, diff, tx1)
makeApplyBlock(ctx, t, kvstore, 3, diff, tx1)
vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...)
vals2 = kvstore.Validators()
@@ -180,27 +211,23 @@ func TestValUpdates(t *testing.T) {
}
func makeApplyBlock(
t *testing.T,
kvstore types.Application,
heightInt int,
diff []types.ValidatorUpdate,
txs ...[]byte) {
func makeApplyBlock(ctx context.Context, t *testing.T, kvstore types.Application, heightInt int, diff []types.ValidatorUpdate, txs ...[]byte) {
// make and apply block
height := int64(heightInt)
hash := []byte("foo")
header := tmproto.Header{
Height: height,
}
resFinalizeBlock := kvstore.FinalizeBlock(types.RequestFinalizeBlock{
resFinalizeBlock, err := kvstore.FinalizeBlock(ctx, &types.RequestFinalizeBlock{
Hash: hash,
Header: header,
Height: height,
Txs: txs,
})
if err != nil {
t.Fatal(err)
}
kvstore.Commit()
_, err = kvstore.Commit(ctx)
if err != nil {
t.Fatal(err)
}
valsEqual(t, diff, resFinalizeBlock.ValidatorUpdates)
@@ -269,8 +296,7 @@ func makeGRPCClientServer(
// Start the listener
socket := fmt.Sprintf("unix://%s.sock", name)
gapp := types.NewGRPCApplication(app)
server := abciserver.NewGRPCServer(logger.With("module", "abci-server"), socket, gapp)
server := abciserver.NewGRPCServer(logger.With("module", "abci-server"), socket, app)
if err := server.Start(ctx); err != nil {
cancel()
@@ -324,25 +350,25 @@ func runClientTests(ctx context.Context, t *testing.T, client abciclient.Client)
}
func testClient(ctx context.Context, t *testing.T, app abciclient.Client, tx []byte, key, value string) {
ar, err := app.FinalizeBlock(ctx, types.RequestFinalizeBlock{Txs: [][]byte{tx}})
ar, err := app.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: [][]byte{tx}})
require.NoError(t, err)
require.Equal(t, 1, len(ar.Txs))
require.False(t, ar.Txs[0].IsErr())
require.Equal(t, 1, len(ar.TxResults))
require.False(t, ar.TxResults[0].IsErr())
// repeating FinalizeBlock doesn't raise error
ar, err = app.FinalizeBlock(ctx, types.RequestFinalizeBlock{Txs: [][]byte{tx}})
ar, err = app.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: [][]byte{tx}})
require.NoError(t, err)
require.Equal(t, 1, len(ar.Txs))
require.False(t, ar.Txs[0].IsErr())
require.Equal(t, 1, len(ar.TxResults))
require.False(t, ar.TxResults[0].IsErr())
// commit
_, err = app.Commit(ctx)
require.NoError(t, err)
info, err := app.Info(ctx, types.RequestInfo{})
info, err := app.Info(ctx, &types.RequestInfo{})
require.NoError(t, err)
require.NotZero(t, info.LastBlockHeight)
// make sure query is fine
resQuery, err := app.Query(ctx, types.RequestQuery{
resQuery, err := app.Query(ctx, &types.RequestQuery{
Path: "/store",
Data: []byte(key),
})
@@ -353,7 +379,7 @@ func testClient(ctx context.Context, t *testing.T, app abciclient.Client, tx []b
require.EqualValues(t, info.LastBlockHeight, resQuery.Height)
// make sure proof is fine
resQuery, err = app.Query(ctx, types.RequestQuery{
resQuery, err = app.Query(ctx, &types.RequestQuery{
Path: "/store",
Data: []byte(key),
Prove: true,

View File

@@ -1,14 +1,13 @@
package kvstore
import (
"bytes"
"context"
dbm "github.com/tendermint/tm-db"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
cryptoproto "github.com/tendermint/tendermint/proto/tendermint/crypto"
ptypes "github.com/tendermint/tendermint/proto/tendermint/types"
)
const (
@@ -38,41 +37,10 @@ func NewPersistentKVStoreApplication(logger log.Logger, dbDir string) *Persisten
}
}
func (app *PersistentKVStoreApplication) OfferSnapshot(req types.RequestOfferSnapshot) types.ResponseOfferSnapshot {
return types.ResponseOfferSnapshot{Result: types.ResponseOfferSnapshot_ABORT}
func (app *PersistentKVStoreApplication) OfferSnapshot(_ context.Context, req *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
return &types.ResponseOfferSnapshot{Result: types.ResponseOfferSnapshot_ABORT}, nil
}
func (app *PersistentKVStoreApplication) ApplySnapshotChunk(req types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk {
return types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT}
}
func (app *PersistentKVStoreApplication) ExtendVote(req types.RequestExtendVote) types.ResponseExtendVote {
return types.ResponseExtendVote{VoteExtension: ConstructVoteExtension(req.Vote.ValidatorAddress)}
}
func (app *PersistentKVStoreApplication) VerifyVoteExtension(req types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension {
return types.RespondVerifyVoteExtension(app.verifyExtension(req.Vote.ValidatorAddress, req.Vote.VoteExtension))
}
// -----------------------------
func ConstructVoteExtension(valAddr []byte) *ptypes.VoteExtension {
return &ptypes.VoteExtension{
AppDataToSign: valAddr,
AppDataSelfAuthenticating: valAddr,
}
}
func (app *PersistentKVStoreApplication) verifyExtension(valAddr []byte, ext *ptypes.VoteExtension) bool {
if ext == nil {
return false
}
canonical := ConstructVoteExtension(valAddr)
if !bytes.Equal(canonical.AppDataToSign, ext.AppDataToSign) {
return false
}
if !bytes.Equal(canonical.AppDataSelfAuthenticating, ext.AppDataSelfAuthenticating) {
return false
}
return true
func (app *PersistentKVStoreApplication) ApplySnapshotChunk(_ context.Context, req *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
return &types.ResponseApplySnapshotChunk{Result: types.ResponseApplySnapshotChunk_ABORT}, nil
}

View File

@@ -20,11 +20,11 @@ type GRPCServer struct {
addr string
server *grpc.Server
app types.ABCIApplicationServer
app types.Application
}
// NewGRPCServer returns a new gRPC ABCI server
func NewGRPCServer(logger log.Logger, protoAddr string, app types.ABCIApplicationServer) service.Service {
func NewGRPCServer(logger log.Logger, protoAddr string, app types.Application) service.Service {
proto, addr := tmnet.ProtocolAndAddress(protoAddr)
s := &GRPCServer{
logger: logger,
@@ -44,7 +44,7 @@ func (s *GRPCServer) OnStart(ctx context.Context) error {
}
s.server = grpc.NewServer()
types.RegisterABCIApplicationServer(s.server, s.app)
types.RegisterABCIApplicationServer(s.server, &gRPCApplication{Application: s.app})
s.logger.Info("Listening", "proto", s.proto, "addr", s.addr)
go func() {
@@ -62,3 +62,22 @@ func (s *GRPCServer) OnStart(ctx context.Context) error {
// OnStop stops the gRPC server.
func (s *GRPCServer) OnStop() { s.server.Stop() }
//-------------------------------------------------------
// gRPCApplication is a gRPC shim for Application
type gRPCApplication struct {
types.Application
}
func (app *gRPCApplication) Echo(_ context.Context, req *types.RequestEcho) (*types.ResponseEcho, error) {
return &types.ResponseEcho{Message: req.Message}, nil
}
func (app *gRPCApplication) Flush(_ context.Context, req *types.RequestFlush) (*types.ResponseFlush, error) {
return &types.ResponseFlush{}, nil
}
func (app *gRPCApplication) Commit(ctx context.Context, req *types.RequestCommit) (*types.ResponseCommit, error) {
return app.Application.Commit(ctx)
}

View File

@@ -23,7 +23,7 @@ func NewServer(logger log.Logger, protoAddr, transport string, app types.Applica
case "socket":
s = NewSocketServer(logger, protoAddr, app)
case "grpc":
s = NewGRPCServer(logger, protoAddr, types.NewGRPCApplication(app))
s = NewGRPCServer(logger, protoAddr, app)
default:
err = fmt.Errorf("unknown server type %s", transport)
}

View File

@@ -159,12 +159,7 @@ func (s *SocketServer) acceptConnectionsRoutine(ctx context.Context) {
}
// Read requests from conn and deal with them
func (s *SocketServer) handleRequests(
ctx context.Context,
closer func(error),
conn io.Reader,
responses chan<- *types.Response,
) {
func (s *SocketServer) handleRequests(ctx context.Context, closer func(error), conn io.Reader, responses chan<- *types.Response) {
var bufReader = bufio.NewReader(conn)
defer func() {
@@ -184,7 +179,12 @@ func (s *SocketServer) handleRequests(
return
}
resp := s.processRequest(req)
resp, err := s.processRequest(ctx, req)
if err != nil {
closer(err)
return
}
select {
case <-ctx.Done():
closer(ctx.Err())
@@ -194,42 +194,99 @@ func (s *SocketServer) handleRequests(
}
}
func (s *SocketServer) processRequest(req *types.Request) *types.Response {
func (s *SocketServer) processRequest(ctx context.Context, req *types.Request) (*types.Response, error) {
switch r := req.Value.(type) {
case *types.Request_Echo:
return types.ToResponseEcho(r.Echo.Message)
return types.ToResponseEcho(r.Echo.Message), nil
case *types.Request_Flush:
return types.ToResponseFlush()
return types.ToResponseFlush(), nil
case *types.Request_Info:
return types.ToResponseInfo(s.app.Info(*r.Info))
res, err := s.app.Info(ctx, r.Info)
if err != nil {
return nil, err
}
return types.ToResponseInfo(res), nil
case *types.Request_CheckTx:
return types.ToResponseCheckTx(s.app.CheckTx(*r.CheckTx))
res, err := s.app.CheckTx(ctx, r.CheckTx)
if err != nil {
return nil, err
}
return types.ToResponseCheckTx(res), nil
case *types.Request_Commit:
return types.ToResponseCommit(s.app.Commit())
res, err := s.app.Commit(ctx)
if err != nil {
return nil, err
}
return types.ToResponseCommit(res), nil
case *types.Request_Query:
return types.ToResponseQuery(s.app.Query(*r.Query))
res, err := s.app.Query(ctx, r.Query)
if err != nil {
return nil, err
}
return types.ToResponseQuery(res), nil
case *types.Request_InitChain:
return types.ToResponseInitChain(s.app.InitChain(*r.InitChain))
res, err := s.app.InitChain(ctx, r.InitChain)
if err != nil {
return nil, err
}
return types.ToResponseInitChain(res), nil
case *types.Request_ListSnapshots:
return types.ToResponseListSnapshots(s.app.ListSnapshots(*r.ListSnapshots))
res, err := s.app.ListSnapshots(ctx, r.ListSnapshots)
if err != nil {
return nil, err
}
return types.ToResponseListSnapshots(res), nil
case *types.Request_OfferSnapshot:
return types.ToResponseOfferSnapshot(s.app.OfferSnapshot(*r.OfferSnapshot))
res, err := s.app.OfferSnapshot(ctx, r.OfferSnapshot)
if err != nil {
return nil, err
}
return types.ToResponseOfferSnapshot(res), nil
case *types.Request_PrepareProposal:
return types.ToResponsePrepareProposal(s.app.PrepareProposal(*r.PrepareProposal))
res, err := s.app.PrepareProposal(ctx, r.PrepareProposal)
if err != nil {
return nil, err
}
return types.ToResponsePrepareProposal(res), nil
case *types.Request_ProcessProposal:
return types.ToResponseProcessProposal(s.app.ProcessProposal(*r.ProcessProposal))
res, err := s.app.ProcessProposal(ctx, r.ProcessProposal)
if err != nil {
return nil, err
}
return types.ToResponseProcessProposal(res), nil
case *types.Request_LoadSnapshotChunk:
return types.ToResponseLoadSnapshotChunk(s.app.LoadSnapshotChunk(*r.LoadSnapshotChunk))
res, err := s.app.LoadSnapshotChunk(ctx, r.LoadSnapshotChunk)
if err != nil {
return nil, err
}
return types.ToResponseLoadSnapshotChunk(res), nil
case *types.Request_ApplySnapshotChunk:
return types.ToResponseApplySnapshotChunk(s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk))
res, err := s.app.ApplySnapshotChunk(ctx, r.ApplySnapshotChunk)
if err != nil {
return nil, err
}
return types.ToResponseApplySnapshotChunk(res), nil
case *types.Request_ExtendVote:
return types.ToResponseExtendVote(s.app.ExtendVote(*r.ExtendVote))
res, err := s.app.ExtendVote(ctx, r.ExtendVote)
if err != nil {
return nil, err
}
return types.ToResponseExtendVote(res), nil
case *types.Request_VerifyVoteExtension:
return types.ToResponseVerifyVoteExtension(s.app.VerifyVoteExtension(*r.VerifyVoteExtension))
res, err := s.app.VerifyVoteExtension(ctx, r.VerifyVoteExtension)
if err != nil {
return nil, err
}
return types.ToResponseVerifyVoteExtension(res), nil
case *types.Request_FinalizeBlock:
return types.ToResponseFinalizeBlock(s.app.FinalizeBlock(*r.FinalizeBlock))
res, err := s.app.FinalizeBlock(ctx, r.FinalizeBlock)
if err != nil {
return nil, err
}
return types.ToResponseFinalizeBlock(res), nil
default:
return types.ToResponseException("Unknown request")
return types.ToResponseException("Unknown request"), errors.New("unknown request type")
}
}

View File

@@ -21,7 +21,7 @@ func InitChain(ctx context.Context, client abciclient.Client) error {
power := mrand.Int()
vals[i] = types.UpdateValidator(pubkey, int64(power), "")
}
_, err := client.InitChain(ctx, types.RequestInitChain{
_, err := client.InitChain(ctx, &types.RequestInitChain{
Validators: vals,
})
if err != nil {
@@ -50,8 +50,8 @@ func Commit(ctx context.Context, client abciclient.Client, hashExp []byte) error
}
func FinalizeBlock(ctx context.Context, client abciclient.Client, txBytes [][]byte, codeExp []uint32, dataExp []byte) error {
res, _ := client.FinalizeBlock(ctx, types.RequestFinalizeBlock{Txs: txBytes})
for i, tx := range res.Txs {
res, _ := client.FinalizeBlock(ctx, &types.RequestFinalizeBlock{Txs: txBytes})
for i, tx := range res.TxResults {
code, data, log := tx.Code, tx.Data, tx.Log
if code != codeExp[i] {
fmt.Println("Failed test: FinalizeBlock")
@@ -71,7 +71,7 @@ func FinalizeBlock(ctx context.Context, client abciclient.Client, txBytes [][]by
}
func CheckTx(ctx context.Context, client abciclient.Client, txBytes []byte, codeExp uint32, dataExp []byte) error {
res, _ := client.CheckTx(ctx, types.RequestCheckTx{Tx: txBytes})
res, _ := client.CheckTx(ctx, &types.RequestCheckTx{Tx: txBytes})
code, data, log := res.Code, res.Data, res.Log
if code != codeExp {
fmt.Println("Failed test: CheckTx")

View File

@@ -1,10 +1,10 @@
echo hello
info
commit
deliver_tx "abc"
finalize_block "abc"
info
commit
query "abc"
deliver_tx "def=xyz"
finalize_block "def=xyz" "ghi=123"
commit
query "def"

View File

@@ -12,7 +12,7 @@
-> code: OK
-> data.hex: 0x0000000000000000
> deliver_tx "abc"
> finalize_block "abc"
-> code: OK
> info
@@ -33,12 +33,14 @@
-> value: abc
-> value.hex: 616263
> deliver_tx "def=xyz"
> finalize_block "def=xyz" "ghi=123"
-> code: OK
> finalize_block "def=xyz" "ghi=123"
-> code: OK
> commit
-> code: OK
-> data.hex: 0x0400000000000000
-> data.hex: 0x0600000000000000
> query "def"
-> code: OK

View File

@@ -1,7 +1,7 @@
check_tx 0x00
check_tx 0xff
deliver_tx 0x00
finalize_block 0x00
check_tx 0x00
deliver_tx 0x01
deliver_tx 0x04
finalize_block 0x01
finalize_block 0x04
info

View File

@@ -4,20 +4,20 @@
> check_tx 0xff
-> code: OK
> deliver_tx 0x00
> finalize_block 0x00
-> code: OK
> check_tx 0x00
-> code: OK
> deliver_tx 0x01
> finalize_block 0x01
-> code: OK
> deliver_tx 0x04
> finalize_block 0x04
-> code: OK
> info
-> code: OK
-> data: {"hashes":0,"txs":3}
-> data.hex: 0x7B22686173686573223A302C22747873223A337D
-> data: {"size":3}
-> data.hex: 0x7B2273697A65223A337D

View File

@@ -1,40 +1,36 @@
package types
import (
"context"
)
import "context"
//go:generate ../../scripts/mockery_generate.sh Application
// Application is an interface that enables any finite, deterministic state machine
// to be driven by a blockchain-based replication engine via the ABCI.
// All methods take a RequestXxx argument and return a ResponseXxx argument,
// except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing.
type Application interface {
// Info/Query Connection
Info(RequestInfo) ResponseInfo // Return application info
Query(RequestQuery) ResponseQuery // Query for state
Info(context.Context, *RequestInfo) (*ResponseInfo, error) // Return application info
Query(context.Context, *RequestQuery) (*ResponseQuery, error) // Query for state
// Mempool Connection
CheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool
CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) // Validate a tx for the mempool
// Consensus Connection
InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from TendermintCore
PrepareProposal(RequestPrepareProposal) ResponsePrepareProposal
ProcessProposal(RequestProcessProposal) ResponseProcessProposal
InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) // Initialize blockchain w validators/other info from TendermintCore
PrepareProposal(context.Context, *RequestPrepareProposal) (*ResponsePrepareProposal, error)
ProcessProposal(context.Context, *RequestProcessProposal) (*ResponseProcessProposal, error)
// Commit the state and return the application Merkle root hash
Commit() ResponseCommit
Commit(context.Context) (*ResponseCommit, error)
// Create application specific vote extension
ExtendVote(RequestExtendVote) ResponseExtendVote
ExtendVote(context.Context, *RequestExtendVote) (*ResponseExtendVote, error)
// Verify application's vote extension data
VerifyVoteExtension(RequestVerifyVoteExtension) ResponseVerifyVoteExtension
VerifyVoteExtension(context.Context, *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error)
// Deliver the decided block with its txs to the Application
FinalizeBlock(RequestFinalizeBlock) ResponseFinalizeBlock
FinalizeBlock(context.Context, *RequestFinalizeBlock) (*ResponseFinalizeBlock, error)
// State Sync Connection
ListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshots
OfferSnapshot(RequestOfferSnapshot) ResponseOfferSnapshot // Offer a snapshot to the application
LoadSnapshotChunk(RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk // Load a snapshot chunk
ApplySnapshotChunk(RequestApplySnapshotChunk) ResponseApplySnapshotChunk // Apply a shapshot chunk
ListSnapshots(context.Context, *RequestListSnapshots) (*ResponseListSnapshots, error) // List available snapshots
OfferSnapshot(context.Context, *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) // Offer a snapshot to the application
LoadSnapshotChunk(context.Context, *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) // Load a snapshot chunk
ApplySnapshotChunk(context.Context, *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) // Apply a shapshot chunk
}
//-------------------------------------------------------
@@ -48,164 +44,78 @@ func NewBaseApplication() *BaseApplication {
return &BaseApplication{}
}
func (BaseApplication) Info(req RequestInfo) ResponseInfo {
return ResponseInfo{}
func (BaseApplication) Info(_ context.Context, req *RequestInfo) (*ResponseInfo, error) {
return &ResponseInfo{}, nil
}
func (BaseApplication) CheckTx(req RequestCheckTx) ResponseCheckTx {
return ResponseCheckTx{Code: CodeTypeOK}
func (BaseApplication) CheckTx(_ context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) {
return &ResponseCheckTx{Code: CodeTypeOK}, nil
}
func (BaseApplication) Commit() ResponseCommit {
return ResponseCommit{}
func (BaseApplication) Commit(_ context.Context) (*ResponseCommit, error) {
return &ResponseCommit{}, nil
}
func (BaseApplication) ExtendVote(req RequestExtendVote) ResponseExtendVote {
return ResponseExtendVote{}
func (BaseApplication) ExtendVote(_ context.Context, req *RequestExtendVote) (*ResponseExtendVote, error) {
return &ResponseExtendVote{}, nil
}
func (BaseApplication) VerifyVoteExtension(req RequestVerifyVoteExtension) ResponseVerifyVoteExtension {
return ResponseVerifyVoteExtension{
Result: ResponseVerifyVoteExtension_ACCEPT,
func (BaseApplication) VerifyVoteExtension(_ context.Context, req *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) {
return &ResponseVerifyVoteExtension{
Status: ResponseVerifyVoteExtension_ACCEPT,
}, nil
}
func (BaseApplication) Query(_ context.Context, req *RequestQuery) (*ResponseQuery, error) {
return &ResponseQuery{Code: CodeTypeOK}, nil
}
func (BaseApplication) InitChain(_ context.Context, req *RequestInitChain) (*ResponseInitChain, error) {
return &ResponseInitChain{}, nil
}
func (BaseApplication) ListSnapshots(_ context.Context, req *RequestListSnapshots) (*ResponseListSnapshots, error) {
return &ResponseListSnapshots{}, nil
}
func (BaseApplication) OfferSnapshot(_ context.Context, req *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) {
return &ResponseOfferSnapshot{}, nil
}
func (BaseApplication) LoadSnapshotChunk(_ context.Context, _ *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) {
return &ResponseLoadSnapshotChunk{}, nil
}
func (BaseApplication) ApplySnapshotChunk(_ context.Context, req *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) {
return &ResponseApplySnapshotChunk{}, nil
}
func (BaseApplication) PrepareProposal(_ context.Context, req *RequestPrepareProposal) (*ResponsePrepareProposal, error) {
trs := make([]*TxRecord, 0, len(req.Txs))
var totalBytes int64
for _, tx := range req.Txs {
totalBytes += int64(len(tx))
if totalBytes > req.MaxTxBytes {
break
}
trs = append(trs, &TxRecord{
Action: TxRecord_UNMODIFIED,
Tx: tx,
})
}
return &ResponsePrepareProposal{TxRecords: trs}, nil
}
func (BaseApplication) Query(req RequestQuery) ResponseQuery {
return ResponseQuery{Code: CodeTypeOK}
func (BaseApplication) ProcessProposal(_ context.Context, req *RequestProcessProposal) (*ResponseProcessProposal, error) {
return &ResponseProcessProposal{Status: ResponseProcessProposal_ACCEPT}, nil
}
func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain {
return ResponseInitChain{}
}
func (BaseApplication) ListSnapshots(req RequestListSnapshots) ResponseListSnapshots {
return ResponseListSnapshots{}
}
func (BaseApplication) OfferSnapshot(req RequestOfferSnapshot) ResponseOfferSnapshot {
return ResponseOfferSnapshot{}
}
func (BaseApplication) LoadSnapshotChunk(req RequestLoadSnapshotChunk) ResponseLoadSnapshotChunk {
return ResponseLoadSnapshotChunk{}
}
func (BaseApplication) ApplySnapshotChunk(req RequestApplySnapshotChunk) ResponseApplySnapshotChunk {
return ResponseApplySnapshotChunk{}
}
func (BaseApplication) PrepareProposal(req RequestPrepareProposal) ResponsePrepareProposal {
return ResponsePrepareProposal{}
}
func (BaseApplication) ProcessProposal(req RequestProcessProposal) ResponseProcessProposal {
return ResponseProcessProposal{}
}
func (BaseApplication) FinalizeBlock(req RequestFinalizeBlock) ResponseFinalizeBlock {
txs := make([]*ResponseDeliverTx, len(req.Txs))
func (BaseApplication) FinalizeBlock(_ context.Context, req *RequestFinalizeBlock) (*ResponseFinalizeBlock, error) {
txs := make([]*ExecTxResult, len(req.Txs))
for i := range req.Txs {
txs[i] = &ResponseDeliverTx{Code: CodeTypeOK}
}
return ResponseFinalizeBlock{
Txs: txs,
txs[i] = &ExecTxResult{Code: CodeTypeOK}
}
}
//-------------------------------------------------------
// GRPCApplication is a GRPC wrapper for Application
type GRPCApplication struct {
app Application
}
func NewGRPCApplication(app Application) *GRPCApplication {
return &GRPCApplication{app}
}
func (app *GRPCApplication) Echo(ctx context.Context, req *RequestEcho) (*ResponseEcho, error) {
return &ResponseEcho{Message: req.Message}, nil
}
func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*ResponseFlush, error) {
return &ResponseFlush{}, nil
}
func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) {
res := app.app.Info(*req)
return &res, nil
}
func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) {
res := app.app.CheckTx(*req)
return &res, nil
}
func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) {
res := app.app.Query(*req)
return &res, nil
}
func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) {
res := app.app.Commit()
return &res, nil
}
func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) {
res := app.app.InitChain(*req)
return &res, nil
}
func (app *GRPCApplication) ListSnapshots(
ctx context.Context, req *RequestListSnapshots) (*ResponseListSnapshots, error) {
res := app.app.ListSnapshots(*req)
return &res, nil
}
func (app *GRPCApplication) OfferSnapshot(
ctx context.Context, req *RequestOfferSnapshot) (*ResponseOfferSnapshot, error) {
res := app.app.OfferSnapshot(*req)
return &res, nil
}
func (app *GRPCApplication) LoadSnapshotChunk(
ctx context.Context, req *RequestLoadSnapshotChunk) (*ResponseLoadSnapshotChunk, error) {
res := app.app.LoadSnapshotChunk(*req)
return &res, nil
}
func (app *GRPCApplication) ApplySnapshotChunk(
ctx context.Context, req *RequestApplySnapshotChunk) (*ResponseApplySnapshotChunk, error) {
res := app.app.ApplySnapshotChunk(*req)
return &res, nil
}
func (app *GRPCApplication) ExtendVote(
ctx context.Context, req *RequestExtendVote) (*ResponseExtendVote, error) {
res := app.app.ExtendVote(*req)
return &res, nil
}
func (app *GRPCApplication) VerifyVoteExtension(
ctx context.Context, req *RequestVerifyVoteExtension) (*ResponseVerifyVoteExtension, error) {
res := app.app.VerifyVoteExtension(*req)
return &res, nil
}
func (app *GRPCApplication) PrepareProposal(
ctx context.Context, req *RequestPrepareProposal) (*ResponsePrepareProposal, error) {
res := app.app.PrepareProposal(*req)
return &res, nil
}
func (app *GRPCApplication) ProcessProposal(
ctx context.Context, req *RequestProcessProposal) (*ResponseProcessProposal, error) {
res := app.app.ProcessProposal(*req)
return &res, nil
}
func (app *GRPCApplication) FinalizeBlock(
ctx context.Context, req *RequestFinalizeBlock) (*ResponseFinalizeBlock, error) {
res := app.app.FinalizeBlock(*req)
return &res, nil
return &ResponseFinalizeBlock{
TxResults: txs,
}, nil
}

View File

@@ -39,15 +39,15 @@ func ToRequestFlush() *Request {
}
}
func ToRequestInfo(req RequestInfo) *Request {
func ToRequestInfo(req *RequestInfo) *Request {
return &Request{
Value: &Request_Info{&req},
Value: &Request_Info{req},
}
}
func ToRequestCheckTx(req RequestCheckTx) *Request {
func ToRequestCheckTx(req *RequestCheckTx) *Request {
return &Request{
Value: &Request_CheckTx{&req},
Value: &Request_CheckTx{req},
}
}
@@ -57,69 +57,69 @@ func ToRequestCommit() *Request {
}
}
func ToRequestQuery(req RequestQuery) *Request {
func ToRequestQuery(req *RequestQuery) *Request {
return &Request{
Value: &Request_Query{&req},
Value: &Request_Query{req},
}
}
func ToRequestInitChain(req RequestInitChain) *Request {
func ToRequestInitChain(req *RequestInitChain) *Request {
return &Request{
Value: &Request_InitChain{&req},
Value: &Request_InitChain{req},
}
}
func ToRequestListSnapshots(req RequestListSnapshots) *Request {
func ToRequestListSnapshots(req *RequestListSnapshots) *Request {
return &Request{
Value: &Request_ListSnapshots{&req},
Value: &Request_ListSnapshots{req},
}
}
func ToRequestOfferSnapshot(req RequestOfferSnapshot) *Request {
func ToRequestOfferSnapshot(req *RequestOfferSnapshot) *Request {
return &Request{
Value: &Request_OfferSnapshot{&req},
Value: &Request_OfferSnapshot{req},
}
}
func ToRequestLoadSnapshotChunk(req RequestLoadSnapshotChunk) *Request {
func ToRequestLoadSnapshotChunk(req *RequestLoadSnapshotChunk) *Request {
return &Request{
Value: &Request_LoadSnapshotChunk{&req},
Value: &Request_LoadSnapshotChunk{req},
}
}
func ToRequestApplySnapshotChunk(req RequestApplySnapshotChunk) *Request {
func ToRequestApplySnapshotChunk(req *RequestApplySnapshotChunk) *Request {
return &Request{
Value: &Request_ApplySnapshotChunk{&req},
Value: &Request_ApplySnapshotChunk{req},
}
}
func ToRequestExtendVote(req RequestExtendVote) *Request {
func ToRequestExtendVote(req *RequestExtendVote) *Request {
return &Request{
Value: &Request_ExtendVote{&req},
Value: &Request_ExtendVote{req},
}
}
func ToRequestVerifyVoteExtension(req RequestVerifyVoteExtension) *Request {
func ToRequestVerifyVoteExtension(req *RequestVerifyVoteExtension) *Request {
return &Request{
Value: &Request_VerifyVoteExtension{&req},
Value: &Request_VerifyVoteExtension{req},
}
}
func ToRequestPrepareProposal(req RequestPrepareProposal) *Request {
func ToRequestPrepareProposal(req *RequestPrepareProposal) *Request {
return &Request{
Value: &Request_PrepareProposal{&req},
Value: &Request_PrepareProposal{req},
}
}
func ToRequestProcessProposal(req RequestProcessProposal) *Request {
func ToRequestProcessProposal(req *RequestProcessProposal) *Request {
return &Request{
Value: &Request_ProcessProposal{&req},
Value: &Request_ProcessProposal{req},
}
}
func ToRequestFinalizeBlock(req RequestFinalizeBlock) *Request {
func ToRequestFinalizeBlock(req *RequestFinalizeBlock) *Request {
return &Request{
Value: &Request_FinalizeBlock{&req},
Value: &Request_FinalizeBlock{req},
}
}
@@ -143,86 +143,86 @@ func ToResponseFlush() *Response {
}
}
func ToResponseInfo(res ResponseInfo) *Response {
func ToResponseInfo(res *ResponseInfo) *Response {
return &Response{
Value: &Response_Info{&res},
Value: &Response_Info{res},
}
}
func ToResponseCheckTx(res ResponseCheckTx) *Response {
func ToResponseCheckTx(res *ResponseCheckTx) *Response {
return &Response{
Value: &Response_CheckTx{&res},
Value: &Response_CheckTx{res},
}
}
func ToResponseCommit(res ResponseCommit) *Response {
func ToResponseCommit(res *ResponseCommit) *Response {
return &Response{
Value: &Response_Commit{&res},
Value: &Response_Commit{res},
}
}
func ToResponseQuery(res ResponseQuery) *Response {
func ToResponseQuery(res *ResponseQuery) *Response {
return &Response{
Value: &Response_Query{&res},
Value: &Response_Query{res},
}
}
func ToResponseInitChain(res ResponseInitChain) *Response {
func ToResponseInitChain(res *ResponseInitChain) *Response {
return &Response{
Value: &Response_InitChain{&res},
Value: &Response_InitChain{res},
}
}
func ToResponseListSnapshots(res ResponseListSnapshots) *Response {
func ToResponseListSnapshots(res *ResponseListSnapshots) *Response {
return &Response{
Value: &Response_ListSnapshots{&res},
Value: &Response_ListSnapshots{res},
}
}
func ToResponseOfferSnapshot(res ResponseOfferSnapshot) *Response {
func ToResponseOfferSnapshot(res *ResponseOfferSnapshot) *Response {
return &Response{
Value: &Response_OfferSnapshot{&res},
Value: &Response_OfferSnapshot{res},
}
}
func ToResponseLoadSnapshotChunk(res ResponseLoadSnapshotChunk) *Response {
func ToResponseLoadSnapshotChunk(res *ResponseLoadSnapshotChunk) *Response {
return &Response{
Value: &Response_LoadSnapshotChunk{&res},
Value: &Response_LoadSnapshotChunk{res},
}
}
func ToResponseApplySnapshotChunk(res ResponseApplySnapshotChunk) *Response {
func ToResponseApplySnapshotChunk(res *ResponseApplySnapshotChunk) *Response {
return &Response{
Value: &Response_ApplySnapshotChunk{&res},
Value: &Response_ApplySnapshotChunk{res},
}
}
func ToResponseExtendVote(res ResponseExtendVote) *Response {
func ToResponseExtendVote(res *ResponseExtendVote) *Response {
return &Response{
Value: &Response_ExtendVote{&res},
Value: &Response_ExtendVote{res},
}
}
func ToResponseVerifyVoteExtension(res ResponseVerifyVoteExtension) *Response {
func ToResponseVerifyVoteExtension(res *ResponseVerifyVoteExtension) *Response {
return &Response{
Value: &Response_VerifyVoteExtension{&res},
Value: &Response_VerifyVoteExtension{res},
}
}
func ToResponsePrepareProposal(res ResponsePrepareProposal) *Response {
func ToResponsePrepareProposal(res *ResponsePrepareProposal) *Response {
return &Response{
Value: &Response_PrepareProposal{&res},
Value: &Response_PrepareProposal{res},
}
}
func ToResponseProcessProposal(res ResponseProcessProposal) *Response {
func ToResponseProcessProposal(res *ResponseProcessProposal) *Response {
return &Response{
Value: &Response_ProcessProposal{&res},
Value: &Response_ProcessProposal{res},
}
}
func ToResponseFinalizeBlock(res ResponseFinalizeBlock) *Response {
func ToResponseFinalizeBlock(res *ResponseFinalizeBlock) *Response {
return &Response{
Value: &Response_FinalizeBlock{&res},
Value: &Response_FinalizeBlock{res},
}
}

View File

@@ -13,7 +13,7 @@ import (
)
func TestMarshalJSON(t *testing.T) {
b, err := json.Marshal(&ResponseDeliverTx{})
b, err := json.Marshal(&ExecTxResult{Code: 1})
assert.NoError(t, err)
// include empty fields.
assert.True(t, strings.Contains(string(b), "code"))

View File

@@ -3,7 +3,11 @@
package mocks
import (
context "context"
testing "testing"
mock "github.com/stretchr/testify/mock"
types "github.com/tendermint/tendermint/abci/types"
)
@@ -12,198 +16,334 @@ type Application struct {
mock.Mock
}
// ApplySnapshotChunk provides a mock function with given fields: _a0
func (_m *Application) ApplySnapshotChunk(_a0 types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk {
// ApplySnapshotChunk provides a mock function with given fields: _a0, _a1
func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseApplySnapshotChunk
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CheckTx provides a mock function with given fields: _a0, _a1
func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*types.ResponseCheckTx, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseCheckTx
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseCheckTx)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Commit provides a mock function with given fields: _a0
func (_m *Application) Commit(_a0 context.Context) (*types.ResponseCommit, error) {
ret := _m.Called(_a0)
var r0 types.ResponseApplySnapshotChunk
if rf, ok := ret.Get(0).(func(types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk); ok {
var r0 *types.ResponseCommit
if rf, ok := ret.Get(0).(func(context.Context) *types.ResponseCommit); ok {
r0 = rf(_a0)
} else {
r0 = ret.Get(0).(types.ResponseApplySnapshotChunk)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseCommit)
}
}
return r0
}
// CheckTx provides a mock function with given fields: _a0
func (_m *Application) CheckTx(_a0 types.RequestCheckTx) types.ResponseCheckTx {
ret := _m.Called(_a0)
var r0 types.ResponseCheckTx
if rf, ok := ret.Get(0).(func(types.RequestCheckTx) types.ResponseCheckTx); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
} else {
r0 = ret.Get(0).(types.ResponseCheckTx)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// Commit provides a mock function with given fields:
func (_m *Application) Commit() types.ResponseCommit {
ret := _m.Called()
// ExtendVote provides a mock function with given fields: _a0, _a1
func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) (*types.ResponseExtendVote, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponseCommit
if rf, ok := ret.Get(0).(func() types.ResponseCommit); ok {
r0 = rf()
var r0 *types.ResponseExtendVote
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseCommit)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseExtendVote)
}
}
return r0
}
// ExtendVote provides a mock function with given fields: _a0
func (_m *Application) ExtendVote(_a0 types.RequestExtendVote) types.ResponseExtendVote {
ret := _m.Called(_a0)
var r0 types.ResponseExtendVote
if rf, ok := ret.Get(0).(func(types.RequestExtendVote) types.ResponseExtendVote); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseExtendVote)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// FinalizeBlock provides a mock function with given fields: _a0
func (_m *Application) FinalizeBlock(_a0 types.RequestFinalizeBlock) types.ResponseFinalizeBlock {
ret := _m.Called(_a0)
// FinalizeBlock provides a mock function with given fields: _a0, _a1
func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponseFinalizeBlock
if rf, ok := ret.Get(0).(func(types.RequestFinalizeBlock) types.ResponseFinalizeBlock); ok {
r0 = rf(_a0)
var r0 *types.ResponseFinalizeBlock
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseFinalizeBlock)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseFinalizeBlock)
}
}
return r0
}
// Info provides a mock function with given fields: _a0
func (_m *Application) Info(_a0 types.RequestInfo) types.ResponseInfo {
ret := _m.Called(_a0)
var r0 types.ResponseInfo
if rf, ok := ret.Get(0).(func(types.RequestInfo) types.ResponseInfo); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseInfo)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// InitChain provides a mock function with given fields: _a0
func (_m *Application) InitChain(_a0 types.RequestInitChain) types.ResponseInitChain {
ret := _m.Called(_a0)
// Info provides a mock function with given fields: _a0, _a1
func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.ResponseInfo, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponseInitChain
if rf, ok := ret.Get(0).(func(types.RequestInitChain) types.ResponseInitChain); ok {
r0 = rf(_a0)
var r0 *types.ResponseInfo
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseInitChain)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseInfo)
}
}
return r0
}
// ListSnapshots provides a mock function with given fields: _a0
func (_m *Application) ListSnapshots(_a0 types.RequestListSnapshots) types.ResponseListSnapshots {
ret := _m.Called(_a0)
var r0 types.ResponseListSnapshots
if rf, ok := ret.Get(0).(func(types.RequestListSnapshots) types.ResponseListSnapshots); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseListSnapshots)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// LoadSnapshotChunk provides a mock function with given fields: _a0
func (_m *Application) LoadSnapshotChunk(_a0 types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk {
ret := _m.Called(_a0)
// InitChain provides a mock function with given fields: _a0, _a1
func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (*types.ResponseInitChain, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponseLoadSnapshotChunk
if rf, ok := ret.Get(0).(func(types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk); ok {
r0 = rf(_a0)
var r0 *types.ResponseInitChain
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseLoadSnapshotChunk)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseInitChain)
}
}
return r0
}
// OfferSnapshot provides a mock function with given fields: _a0
func (_m *Application) OfferSnapshot(_a0 types.RequestOfferSnapshot) types.ResponseOfferSnapshot {
ret := _m.Called(_a0)
var r0 types.ResponseOfferSnapshot
if rf, ok := ret.Get(0).(func(types.RequestOfferSnapshot) types.ResponseOfferSnapshot); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseOfferSnapshot)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// PrepareProposal provides a mock function with given fields: _a0
func (_m *Application) PrepareProposal(_a0 types.RequestPrepareProposal) types.ResponsePrepareProposal {
ret := _m.Called(_a0)
// ListSnapshots provides a mock function with given fields: _a0, _a1
func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponsePrepareProposal
if rf, ok := ret.Get(0).(func(types.RequestPrepareProposal) types.ResponsePrepareProposal); ok {
r0 = rf(_a0)
var r0 *types.ResponseListSnapshots
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponsePrepareProposal)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseListSnapshots)
}
}
return r0
}
// ProcessProposal provides a mock function with given fields: _a0
func (_m *Application) ProcessProposal(_a0 types.RequestProcessProposal) types.ResponseProcessProposal {
ret := _m.Called(_a0)
var r0 types.ResponseProcessProposal
if rf, ok := ret.Get(0).(func(types.RequestProcessProposal) types.ResponseProcessProposal); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseProcessProposal)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// Query provides a mock function with given fields: _a0
func (_m *Application) Query(_a0 types.RequestQuery) types.ResponseQuery {
ret := _m.Called(_a0)
// LoadSnapshotChunk provides a mock function with given fields: _a0, _a1
func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
ret := _m.Called(_a0, _a1)
var r0 types.ResponseQuery
if rf, ok := ret.Get(0).(func(types.RequestQuery) types.ResponseQuery); ok {
r0 = rf(_a0)
var r0 *types.ResponseLoadSnapshotChunk
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseQuery)
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk)
}
}
return r0
}
// VerifyVoteExtension provides a mock function with given fields: _a0
func (_m *Application) VerifyVoteExtension(_a0 types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension {
ret := _m.Called(_a0)
var r0 types.ResponseVerifyVoteExtension
if rf, ok := ret.Get(0).(func(types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension); ok {
r0 = rf(_a0)
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok {
r1 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(types.ResponseVerifyVoteExtension)
r1 = ret.Error(1)
}
return r0
return r0, r1
}
// OfferSnapshot provides a mock function with given fields: _a0, _a1
func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseOfferSnapshot
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseOfferSnapshot)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PrepareProposal provides a mock function with given fields: _a0, _a1
func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponsePrepareProposal
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponsePrepareProposal)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ProcessProposal provides a mock function with given fields: _a0, _a1
func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseProcessProposal
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseProcessProposal)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Query provides a mock function with given fields: _a0, _a1
func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.ResponseQuery, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseQuery
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseQuery)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// VerifyVoteExtension provides a mock function with given fields: _a0, _a1
func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) {
ret := _m.Called(_a0, _a1)
var r0 *types.ResponseVerifyVoteExtension
if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok {
r0 = rf(_a0, _a1)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ResponseVerifyVoteExtension)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewApplication creates a new instance of Application. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
func NewApplication(t testing.TB) *Application {
mock := &Application{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

View File

@@ -1,189 +0,0 @@
package mocks
import (
types "github.com/tendermint/tendermint/abci/types"
)
// BaseMock provides a wrapper around the generated Application mock and a BaseApplication.
// BaseMock first tries to use the mock's implementation of the method.
// If no functionality was provided for the mock by the user, BaseMock dispatches
// to the BaseApplication and uses its functionality.
// BaseMock allows users to provide mocked functionality for only the methods that matter
// for their test while avoiding a panic if the code calls Application methods that are
// not relevant to the test.
type BaseMock struct {
base *types.BaseApplication
*Application
}
func NewBaseMock() BaseMock {
return BaseMock{
base: types.NewBaseApplication(),
Application: new(Application),
}
}
// Info/Query Connection
// Return application info
func (m BaseMock) Info(input types.RequestInfo) types.ResponseInfo {
var ret types.ResponseInfo
defer func() {
if r := recover(); r != nil {
ret = m.base.Info(input)
}
}()
ret = m.Application.Info(input)
return ret
}
func (m BaseMock) Query(input types.RequestQuery) types.ResponseQuery {
var ret types.ResponseQuery
defer func() {
if r := recover(); r != nil {
ret = m.base.Query(input)
}
}()
ret = m.Application.Query(input)
return ret
}
// Mempool Connection
// Validate a tx for the mempool
func (m BaseMock) CheckTx(input types.RequestCheckTx) types.ResponseCheckTx {
var ret types.ResponseCheckTx
defer func() {
if r := recover(); r != nil {
ret = m.base.CheckTx(input)
}
}()
ret = m.Application.CheckTx(input)
return ret
}
// Consensus Connection
// Initialize blockchain w validators/other info from TendermintCore
func (m BaseMock) InitChain(input types.RequestInitChain) types.ResponseInitChain {
var ret types.ResponseInitChain
defer func() {
if r := recover(); r != nil {
ret = m.base.InitChain(input)
}
}()
ret = m.Application.InitChain(input)
return ret
}
func (m BaseMock) PrepareProposal(input types.RequestPrepareProposal) types.ResponsePrepareProposal {
var ret types.ResponsePrepareProposal
defer func() {
if r := recover(); r != nil {
ret = m.base.PrepareProposal(input)
}
}()
ret = m.Application.PrepareProposal(input)
return ret
}
func (m BaseMock) ProcessProposal(input types.RequestProcessProposal) types.ResponseProcessProposal {
var ret types.ResponseProcessProposal
defer func() {
if r := recover(); r != nil {
ret = m.base.ProcessProposal(input)
}
}()
ret = m.Application.ProcessProposal(input)
return ret
}
// Commit the state and return the application Merkle root hash
func (m BaseMock) Commit() types.ResponseCommit {
var ret types.ResponseCommit
defer func() {
if r := recover(); r != nil {
ret = m.base.Commit()
}
}()
ret = m.Application.Commit()
return ret
}
// Create application specific vote extension
func (m BaseMock) ExtendVote(input types.RequestExtendVote) types.ResponseExtendVote {
var ret types.ResponseExtendVote
defer func() {
if r := recover(); r != nil {
ret = m.base.ExtendVote(input)
}
}()
ret = m.Application.ExtendVote(input)
return ret
}
// Verify application's vote extension data
func (m BaseMock) VerifyVoteExtension(input types.RequestVerifyVoteExtension) types.ResponseVerifyVoteExtension {
var ret types.ResponseVerifyVoteExtension
defer func() {
if r := recover(); r != nil {
ret = m.base.VerifyVoteExtension(input)
}
}()
ret = m.Application.VerifyVoteExtension(input)
return ret
}
// State Sync Connection
// List available snapshots
func (m BaseMock) ListSnapshots(input types.RequestListSnapshots) types.ResponseListSnapshots {
var ret types.ResponseListSnapshots
defer func() {
if r := recover(); r != nil {
ret = m.base.ListSnapshots(input)
}
}()
ret = m.Application.ListSnapshots(input)
return ret
}
func (m BaseMock) OfferSnapshot(input types.RequestOfferSnapshot) types.ResponseOfferSnapshot {
var ret types.ResponseOfferSnapshot
defer func() {
if r := recover(); r != nil {
ret = m.base.OfferSnapshot(input)
}
}()
ret = m.Application.OfferSnapshot(input)
return ret
}
func (m BaseMock) LoadSnapshotChunk(input types.RequestLoadSnapshotChunk) types.ResponseLoadSnapshotChunk {
var ret types.ResponseLoadSnapshotChunk
defer func() {
if r := recover(); r != nil {
ret = m.base.LoadSnapshotChunk(input)
}
}()
ret = m.Application.LoadSnapshotChunk(input)
return ret
}
func (m BaseMock) ApplySnapshotChunk(input types.RequestApplySnapshotChunk) types.ResponseApplySnapshotChunk {
var ret types.ResponseApplySnapshotChunk
defer func() {
if r := recover(); r != nil {
ret = m.base.ApplySnapshotChunk(input)
}
}()
ret = m.Application.ApplySnapshotChunk(input)
return ret
}
func (m BaseMock) FinalizeBlock(input types.RequestFinalizeBlock) types.ResponseFinalizeBlock {
var ret types.ResponseFinalizeBlock
defer func() {
if r := recover(); r != nil {
ret = m.base.FinalizeBlock(input)
}
}()
ret = m.Application.FinalizeBlock(input)
return ret
}

View File

@@ -5,8 +5,6 @@ import (
"encoding/json"
"github.com/gogo/protobuf/jsonpb"
types "github.com/tendermint/tendermint/proto/tendermint/types"
)
const (
@@ -33,6 +31,16 @@ func (r ResponseDeliverTx) IsErr() bool {
return r.Code != CodeTypeOK
}
// IsOK returns true if Code is OK.
func (r ExecTxResult) IsOK() bool {
return r.Code == CodeTypeOK
}
// IsErr returns true if Code is something other than OK.
func (r ExecTxResult) IsErr() bool {
return r.Code != CodeTypeOK
}
// IsOK returns true if Code is OK.
func (r ResponseQuery) IsOK() bool {
return r.Code == CodeTypeOK
@@ -43,19 +51,27 @@ func (r ResponseQuery) IsErr() bool {
return r.Code != CodeTypeOK
}
// IsUnknown returns true if Code is Unknown
func (r ResponseVerifyVoteExtension) IsUnknown() bool {
return r.Result == ResponseVerifyVoteExtension_UNKNOWN
func (r ResponseProcessProposal) IsAccepted() bool {
return r.Status == ResponseProcessProposal_ACCEPT
}
func (r ResponseProcessProposal) IsStatusUnknown() bool {
return r.Status == ResponseProcessProposal_UNKNOWN
}
// IsStatusUnknown returns true if Code is Unknown
func (r ResponseVerifyVoteExtension) IsStatusUnknown() bool {
return r.Status == ResponseVerifyVoteExtension_UNKNOWN
}
// IsOK returns true if Code is OK
func (r ResponseVerifyVoteExtension) IsOK() bool {
return r.Result == ResponseVerifyVoteExtension_ACCEPT
return r.Status == ResponseVerifyVoteExtension_ACCEPT
}
// IsErr returns true if Code is something other than OK.
func (r ResponseVerifyVoteExtension) IsErr() bool {
return r.Result != ResponseVerifyVoteExtension_ACCEPT
return r.Status != ResponseVerifyVoteExtension_ACCEPT
}
//---------------------------------------------------------------------------
@@ -139,21 +155,40 @@ var _ jsonRoundTripper = (*EventAttribute)(nil)
// -----------------------------------------------
// construct Result data
func RespondExtendVote(appDataToSign, appDataSelfAuthenticating []byte) ResponseExtendVote {
return ResponseExtendVote{
VoteExtension: &types.VoteExtension{
AppDataToSign: appDataToSign,
AppDataSelfAuthenticating: appDataSelfAuthenticating,
},
func RespondVerifyVoteExtension(ok bool) ResponseVerifyVoteExtension {
status := ResponseVerifyVoteExtension_REJECT
if ok {
status = ResponseVerifyVoteExtension_ACCEPT
}
return ResponseVerifyVoteExtension{
Status: status,
}
}
func RespondVerifyVoteExtension(ok bool) ResponseVerifyVoteExtension {
result := ResponseVerifyVoteExtension_REJECT
if ok {
result = ResponseVerifyVoteExtension_ACCEPT
}
return ResponseVerifyVoteExtension{
Result: result,
// deterministicExecTxResult constructs a copy of response that omits
// non-deterministic fields. The input response is not modified.
func deterministicExecTxResult(response *ExecTxResult) *ExecTxResult {
return &ExecTxResult{
Code: response.Code,
Data: response.Data,
GasWanted: response.GasWanted,
GasUsed: response.GasUsed,
}
}
// MarshalTxResults encodes the the TxResults as a list of byte
// slices. It strips off the non-deterministic pieces of the TxResults
// so that the resulting data can be used for hash comparisons and used
// in Merkle proofs.
func MarshalTxResults(r []*ExecTxResult) ([][]byte, error) {
s := make([][]byte, len(r))
for i, e := range r {
d := deterministicExecTxResult(e)
b, err := d.Marshal()
if err != nil {
return nil, err
}
s[i] = b
}
return s, nil
}

File diff suppressed because it is too large Load Diff

74
abci/types/types_test.go Normal file
View File

@@ -0,0 +1,74 @@
package types_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/merkle"
)
func TestHashAndProveResults(t *testing.T) {
trs := []*abci.ExecTxResult{
// Note, these tests rely on the first two entries being in this order.
{Code: 0, Data: nil},
{Code: 0, Data: []byte{}},
{Code: 0, Data: []byte("one")},
{Code: 14, Data: nil},
{Code: 14, Data: []byte("foo")},
{Code: 14, Data: []byte("bar")},
}
// Nil and []byte{} should produce the same bytes
bz0, err := trs[0].Marshal()
require.NoError(t, err)
bz1, err := trs[1].Marshal()
require.NoError(t, err)
require.Equal(t, bz0, bz1)
// Make sure that we can get a root hash from results and verify proofs.
rs, err := abci.MarshalTxResults(trs)
require.NoError(t, err)
root := merkle.HashFromByteSlices(rs)
assert.NotEmpty(t, root)
_, proofs := merkle.ProofsFromByteSlices(rs)
for i, tr := range trs {
bz, err := tr.Marshal()
require.NoError(t, err)
valid := proofs[i].Verify(root, bz)
assert.NoError(t, valid, "%d", i)
}
}
func TestHashDeterministicFieldsOnly(t *testing.T) {
tr1 := abci.ExecTxResult{
Code: 1,
Data: []byte("transaction"),
Log: "nondeterministic data: abc",
Info: "nondeterministic data: abc",
GasWanted: 1000,
GasUsed: 1000,
Events: []abci.Event{},
Codespace: "nondeterministic.data.abc",
}
tr2 := abci.ExecTxResult{
Code: 1,
Data: []byte("transaction"),
Log: "nondeterministic data: def",
Info: "nondeterministic data: def",
GasWanted: 1000,
GasUsed: 1000,
Events: []abci.Event{},
Codespace: "nondeterministic.data.def",
}
r1, err := abci.MarshalTxResults([]*abci.ExecTxResult{&tr1})
require.NoError(t, err)
r2, err := abci.MarshalTxResults([]*abci.ExecTxResult{&tr2})
require.NoError(t, err)
require.Equal(t, merkle.HashFromByteSlices(r1), merkle.HashFromByteSlices(r2))
}

View File

@@ -1,14 +1,9 @@
# The version of the generation template (required).
# The only currently-valid value is v1beta1.
version: v1beta1
# The plugins to run.
version: v1
plugins:
# The name of the plugin.
- name: gogofaster
# The directory where the generated proto output will be written.
# The directory is relative to where the generation tool was run.
out: proto
# Set options to assign import paths to the well-known types
# and to enable service generation.
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
out: ./proto/
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

3
buf.work.yaml Normal file
View File

@@ -0,0 +1,3 @@
version: v1
directories:
- proto

View File

@@ -113,7 +113,7 @@ func main() {
// add prometheus metrics for unary RPC calls
opts = append(opts, grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor))
ss := grpcprivval.NewSignerServer(*chainID, pv, logger)
ss := grpcprivval.NewSignerServer(logger, *chainID, pv)
protocol, address := tmnet.ProtocolAndAddress(*addr)

View File

@@ -2,6 +2,7 @@ package debug
import (
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/log"
)

View File

@@ -9,6 +9,7 @@ import (
cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/scripts/keymigrate"
"github.com/tendermint/tendermint/scripts/scmigrate"
)
func MakeKeyMigrateCommand(conf *cfg.Config, logger log.Logger) *cobra.Command {
@@ -51,6 +52,13 @@ func MakeKeyMigrateCommand(conf *cfg.Config, logger log.Logger) *cobra.Command {
return fmt.Errorf("running migration for context %q: %w",
dbctx, err)
}
if dbctx == "blockstore" {
if err := scmigrate.Migrate(ctx, db); err != nil {
return fmt.Errorf("running seen commit migration: %w", err)
}
}
}
logger.Info("completed database migration successfully")

View File

@@ -180,7 +180,7 @@ for applications built w/ Cosmos SDK).
return err
}
ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM)
ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM)
defer cancel()
go func() {

View File

@@ -213,7 +213,7 @@ func eventReIndex(cmd *cobra.Command, args eventReIndexArgs) error {
Height: b.Height,
Index: uint32(i),
Tx: b.Data.Txs[i],
Result: *(r.FinalizeBlock.Txs[i]),
Result: *(r.FinalizeBlock.TxResults[i]),
}
_ = batch.Add(&tr)

View File

@@ -153,10 +153,10 @@ func TestReIndexEvent(t *testing.T) {
On("IndexTxEvents", mock.AnythingOfType("[]*types.TxResult")).Return(errors.New("")).Once().
On("IndexTxEvents", mock.AnythingOfType("[]*types.TxResult")).Return(nil)
dtx := abcitypes.ResponseDeliverTx{}
dtx := abcitypes.ExecTxResult{}
abciResp := &prototmstate.ABCIResponses{
FinalizeBlock: &abcitypes.ResponseFinalizeBlock{
Txs: []*abcitypes.ResponseDeliverTx{&dtx},
TxResults: []*abcitypes.ExecTxResult{&dtx},
},
}

View File

@@ -0,0 +1,182 @@
package commands
import (
"os"
"path/filepath"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/types"
)
// MakeResetCommand constructs a command that removes the database of
// the specified Tendermint core instance.
func MakeResetCommand(conf *config.Config, logger log.Logger) *cobra.Command {
var keyType string
resetCmd := &cobra.Command{
Use: "reset",
Short: "Set of commands to conveniently reset tendermint related data",
}
resetBlocksCmd := &cobra.Command{
Use: "blockchain",
Short: "Removes all blocks, state, transactions and evidence stored by the tendermint node",
RunE: func(cmd *cobra.Command, args []string) error {
return ResetState(conf.DBDir(), logger)
},
}
resetPeersCmd := &cobra.Command{
Use: "peers",
Short: "Removes all peer addresses",
RunE: func(cmd *cobra.Command, args []string) error {
return ResetPeerStore(conf.DBDir())
},
}
resetSignerCmd := &cobra.Command{
Use: "unsafe-signer",
Short: "esets private validator signer state",
Long: `Resets private validator signer state.
Only use in testing. This can cause the node to double sign`,
RunE: func(cmd *cobra.Command, args []string) error {
return ResetFilePV(conf.PrivValidator.KeyFile(), conf.PrivValidator.StateFile(), logger, keyType)
},
}
resetAllCmd := &cobra.Command{
Use: "unsafe-all",
Short: "Removes all tendermint data including signing state",
Long: `Removes all tendermint data including signing state.
Only use in testing. This can cause the node to double sign`,
RunE: func(cmd *cobra.Command, args []string) error {
return ResetAll(conf.DBDir(), conf.PrivValidator.KeyFile(),
conf.PrivValidator.StateFile(), logger, keyType)
},
}
resetSignerCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
"Signer key type. Options: ed25519, secp256k1")
resetAllCmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
"Signer key type. Options: ed25519, secp256k1")
resetCmd.AddCommand(resetBlocksCmd)
resetCmd.AddCommand(resetPeersCmd)
resetCmd.AddCommand(resetSignerCmd)
resetCmd.AddCommand(resetAllCmd)
return resetCmd
}
// ResetAll removes address book files plus all data, and resets the privValdiator data.
// Exported for extenal CLI usage
// XXX: this is unsafe and should only suitable for testnets.
func ResetAll(dbDir, privValKeyFile, privValStateFile string, logger log.Logger, keyType string) error {
if err := os.RemoveAll(dbDir); err == nil {
logger.Info("Removed all blockchain history", "dir", dbDir)
} else {
logger.Error("error removing all blockchain history", "dir", dbDir, "err", err)
}
if err := tmos.EnsureDir(dbDir, 0700); err != nil {
logger.Error("unable to recreate dbDir", "err", err)
}
// recreate the dbDir since the privVal state needs to live there
return ResetFilePV(privValKeyFile, privValStateFile, logger, keyType)
}
// ResetState removes all blocks, tendermint state, indexed transactions and evidence.
func ResetState(dbDir string, logger log.Logger) error {
blockdb := filepath.Join(dbDir, "blockstore.db")
state := filepath.Join(dbDir, "state.db")
wal := filepath.Join(dbDir, "cs.wal")
evidence := filepath.Join(dbDir, "evidence.db")
txIndex := filepath.Join(dbDir, "tx_index.db")
if tmos.FileExists(blockdb) {
if err := os.RemoveAll(blockdb); err == nil {
logger.Info("Removed all blockstore.db", "dir", blockdb)
} else {
logger.Error("error removing all blockstore.db", "dir", blockdb, "err", err)
}
}
if tmos.FileExists(state) {
if err := os.RemoveAll(state); err == nil {
logger.Info("Removed all state.db", "dir", state)
} else {
logger.Error("error removing all state.db", "dir", state, "err", err)
}
}
if tmos.FileExists(wal) {
if err := os.RemoveAll(wal); err == nil {
logger.Info("Removed all cs.wal", "dir", wal)
} else {
logger.Error("error removing all cs.wal", "dir", wal, "err", err)
}
}
if tmos.FileExists(evidence) {
if err := os.RemoveAll(evidence); err == nil {
logger.Info("Removed all evidence.db", "dir", evidence)
} else {
logger.Error("error removing all evidence.db", "dir", evidence, "err", err)
}
}
if tmos.FileExists(txIndex) {
if err := os.RemoveAll(txIndex); err == nil {
logger.Info("Removed tx_index.db", "dir", txIndex)
} else {
logger.Error("error removing tx_index.db", "dir", txIndex, "err", err)
}
}
return tmos.EnsureDir(dbDir, 0700)
}
// ResetFilePV loads the file private validator and resets the watermark to 0. If used on an existing network,
// this can cause the node to double sign.
// XXX: this is unsafe and should only suitable for testnets.
func ResetFilePV(privValKeyFile, privValStateFile string, logger log.Logger, keyType string) error {
if _, err := os.Stat(privValKeyFile); err == nil {
pv, err := privval.LoadFilePVEmptyState(privValKeyFile, privValStateFile)
if err != nil {
return err
}
if err := pv.Reset(); err != nil {
return err
}
logger.Info("Reset private validator file to genesis state", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
} else {
pv, err := privval.GenFilePV(privValKeyFile, privValStateFile, keyType)
if err != nil {
return err
}
if err := pv.Save(); err != nil {
return err
}
logger.Info("Generated private validator file", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
}
return nil
}
// ResetPeerStore removes the peer store containing all information used by the tendermint networking layer
// In the case of a reset, new peers will need to be set either via the config or through the discovery mechanism
func ResetPeerStore(dbDir string) error {
peerstore := filepath.Join(dbDir, "peerstore.db")
if tmos.FileExists(peerstore) {
return os.RemoveAll(peerstore)
}
return nil
}

View File

@@ -1,95 +0,0 @@
package commands
import (
"os"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/types"
)
// MakeResetAllCommand constructs a command that removes the database of
// the specified Tendermint core instance.
func MakeResetAllCommand(conf *config.Config, logger log.Logger) *cobra.Command {
var keyType string
cmd := &cobra.Command{
Use: "unsafe-reset-all",
Short: "(unsafe) Remove all the data and WAL, reset this node's validator to genesis state",
RunE: func(cmd *cobra.Command, args []string) error {
return resetAll(conf.DBDir(), conf.PrivValidator.KeyFile(),
conf.PrivValidator.StateFile(), logger, keyType)
},
}
cmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
"Key type to generate privval file with. Options: ed25519, secp256k1")
return cmd
}
func MakeResetPrivateValidatorCommand(conf *config.Config, logger log.Logger) *cobra.Command {
var keyType string
cmd := &cobra.Command{
Use: "unsafe-reset-priv-validator",
Short: "(unsafe) Reset this node's validator to genesis state",
RunE: func(cmd *cobra.Command, args []string) error {
return resetFilePV(conf.PrivValidator.KeyFile(), conf.PrivValidator.StateFile(), logger, keyType)
},
}
cmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519,
"Key type to generate privval file with. Options: ed25519, secp256k1")
return cmd
}
// XXX: this is totally unsafe.
// it's only suitable for testnets.
// XXX: this is totally unsafe.
// it's only suitable for testnets.
// resetAll removes address book files plus all data, and resets the privValdiator data.
// Exported so other CLI tools can use it.
func resetAll(dbDir, privValKeyFile, privValStateFile string, logger log.Logger, keyType string) error {
if err := os.RemoveAll(dbDir); err == nil {
logger.Info("Removed all blockchain history", "dir", dbDir)
} else {
logger.Error("error removing all blockchain history", "dir", dbDir, "err", err)
}
// recreate the dbDir since the privVal state needs to live there
if err := tmos.EnsureDir(dbDir, 0700); err != nil {
logger.Error("unable to recreate dbDir", "err", err)
}
return resetFilePV(privValKeyFile, privValStateFile, logger, keyType)
}
func resetFilePV(privValKeyFile, privValStateFile string, logger log.Logger, keyType string) error {
if _, err := os.Stat(privValKeyFile); err == nil {
pv, err := privval.LoadFilePVEmptyState(privValKeyFile, privValStateFile)
if err != nil {
return err
}
if err := pv.Reset(); err != nil {
return err
}
logger.Info("Reset private validator file to genesis state", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
} else {
pv, err := privval.GenFilePV(privValKeyFile, privValStateFile, keyType)
if err != nil {
return err
}
if err := pv.Save(); err != nil {
return err
}
logger.Info("Generated private validator file", "keyFile", privValKeyFile,
"stateFile", privValStateFile)
}
return nil
}

View File

@@ -0,0 +1,62 @@
package commands
import (
"context"
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/types"
)
func Test_ResetAll(t *testing.T) {
config := cfg.TestConfig()
dir := t.TempDir()
config.SetRoot(dir)
logger := log.NewNopLogger()
cfg.EnsureRoot(dir)
require.NoError(t, initFilesWithConfig(context.Background(), config, logger, types.ABCIPubKeyTypeEd25519))
pv, err := privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile())
require.NoError(t, err)
pv.LastSignState.Height = 10
require.NoError(t, pv.Save())
require.NoError(t, ResetAll(config.DBDir(), config.PrivValidator.KeyFile(),
config.PrivValidator.StateFile(), logger, types.ABCIPubKeyTypeEd25519))
require.DirExists(t, config.DBDir())
require.NoFileExists(t, filepath.Join(config.DBDir(), "block.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "state.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "evidence.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "tx_index.db"))
require.FileExists(t, config.PrivValidator.StateFile())
pv, err = privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile())
require.NoError(t, err)
require.Equal(t, int64(0), pv.LastSignState.Height)
}
func Test_ResetState(t *testing.T) {
config := cfg.TestConfig()
dir := t.TempDir()
config.SetRoot(dir)
logger := log.NewNopLogger()
cfg.EnsureRoot(dir)
require.NoError(t, initFilesWithConfig(context.Background(), config, logger, types.ABCIPubKeyTypeEd25519))
pv, err := privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile())
require.NoError(t, err)
pv.LastSignState.Height = 10
require.NoError(t, pv.Save())
require.NoError(t, ResetState(config.DBDir(), logger))
require.DirExists(t, config.DBDir())
require.NoFileExists(t, filepath.Join(config.DBDir(), "block.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "state.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "evidence.db"))
require.NoFileExists(t, filepath.Join(config.DBDir(), "tx_index.db"))
require.FileExists(t, config.PrivValidator.StateFile())
pv, err = privval.LoadFilePV(config.PrivValidator.KeyFile(), config.PrivValidator.StateFile())
require.NoError(t, err)
// private validator state should still be in tact.
require.Equal(t, int64(10), pv.LastSignState.Height)
}

View File

@@ -53,6 +53,7 @@ func TestRollbackIntegration(t *testing.T) {
defer cancel()
node2, _, err2 := rpctest.StartTendermint(ctx, cfg, app, rpctest.SuppressStdout)
require.NoError(t, err2)
t.Cleanup(node2.Wait)
logger := log.NewNopLogger()

View File

@@ -51,10 +51,12 @@ func RootCommand(conf *config.Config, logger log.Logger) *cobra.Command {
}
*conf = *pconf
config.EnsureRoot(conf.RootDir)
if err := log.OverrideWithNewLogger(logger, conf.LogFormat, conf.LogLevel); err != nil {
return err
}
if warning := pconf.DeprecatedFieldWarning(); warning != nil {
logger.Info("WARNING", "deprecated field warning", warning)
}
return nil
},

View File

@@ -105,7 +105,7 @@ func NewRunNodeCmd(nodeProvider cfg.ServiceProvider, conf *cfg.Config, logger lo
return err
}
ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM)
ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM)
defer cancel()
n, err := nodeProvider(ctx, conf, logger)

View File

@@ -33,8 +33,7 @@ func main() {
commands.MakeLightCommand(conf, logger),
commands.MakeReplayCommand(conf, logger),
commands.MakeReplayConsoleCommand(conf, logger),
commands.MakeResetAllCommand(conf, logger),
commands.MakeResetPrivateValidatorCommand(conf, logger),
commands.MakeResetCommand(conf, logger),
commands.MakeShowValidatorCommand(conf, logger),
commands.MakeTestnetFilesCommand(conf, logger),
commands.MakeShowNodeIDCommand(conf),

View File

@@ -8,6 +8,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/tendermint/tendermint/libs/log"
@@ -145,6 +146,10 @@ func (cfg *Config) ValidateBasic() error {
return nil
}
func (cfg *Config) DeprecatedFieldWarning() error {
return cfg.Consensus.DeprecatedFieldWarning()
}
//-----------------------------------------------------------------------------
// BaseConfig
@@ -956,27 +961,6 @@ type ConsensusConfig struct {
WalPath string `mapstructure:"wal-file"`
walFile string // overrides WalPath if set
// TODO: remove timeout configs, these should be global not local
// How long we wait for a proposal block before prevoting nil
TimeoutPropose time.Duration `mapstructure:"timeout-propose"`
// How much timeout-propose increases with each round
TimeoutProposeDelta time.Duration `mapstructure:"timeout-propose-delta"`
// How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
TimeoutPrevote time.Duration `mapstructure:"timeout-prevote"`
// How much the timeout-prevote increases with each round
TimeoutPrevoteDelta time.Duration `mapstructure:"timeout-prevote-delta"`
// How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
TimeoutPrecommit time.Duration `mapstructure:"timeout-precommit"`
// How much the timeout-precommit increases with each round
TimeoutPrecommitDelta time.Duration `mapstructure:"timeout-precommit-delta"`
// 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).
TimeoutCommit time.Duration `mapstructure:"timeout-commit"`
// Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
SkipTimeoutCommit bool `mapstructure:"skip-timeout-commit"`
// EmptyBlocks mode and possible interval between empty blocks
CreateEmptyBlocks bool `mapstructure:"create-empty-blocks"`
CreateEmptyBlocksInterval time.Duration `mapstructure:"create-empty-blocks-interval"`
@@ -986,20 +970,59 @@ type ConsensusConfig struct {
PeerQueryMaj23SleepDuration time.Duration `mapstructure:"peer-query-maj23-sleep-duration"`
DoubleSignCheckHeight int64 `mapstructure:"double-sign-check-height"`
// TODO: The following fields are all temporary overrides that should exist only
// for the duration of the v0.36 release. The below fields should be completely
// removed in the v0.37 release of Tendermint.
// See: https://github.com/tendermint/tendermint/issues/8188
// UnsafeProposeTimeoutOverride provides an unsafe override of the Propose
// timeout consensus parameter. It configures how long the consensus engine
// will wait to receive a proposal block before prevoting nil.
UnsafeProposeTimeoutOverride time.Duration `mapstructure:"unsafe-propose-timeout-override"`
// UnsafeProposeTimeoutDeltaOverride provides an unsafe override of the
// ProposeDelta timeout consensus parameter. It configures how much the
// propose timeout increases with each round.
UnsafeProposeTimeoutDeltaOverride time.Duration `mapstructure:"unsafe-propose-timeout-delta-override"`
// UnsafeVoteTimeoutOverride provides an unsafe override of the Vote timeout
// consensus parameter. It configures how long the consensus engine will wait
// to gather additional votes after receiving +2/3 votes in a round.
UnsafeVoteTimeoutOverride time.Duration `mapstructure:"unsafe-vote-timeout-override"`
// UnsafeVoteTimeoutDeltaOverride provides an unsafe override of the VoteDelta
// timeout consensus parameter. It configures how much the vote timeout
// increases with each round.
UnsafeVoteTimeoutDeltaOverride time.Duration `mapstructure:"unsafe-vote-timeout-delta-override"`
// UnsafeCommitTimeoutOverride provides an unsafe override of the Commit timeout
// consensus parameter. It configures how long the consensus engine will wait
// after receiving +2/3 precommits before beginning the next height.
UnsafeCommitTimeoutOverride time.Duration `mapstructure:"unsafe-commit-timeout-override"`
// UnsafeBypassCommitTimeoutOverride provides an unsafe override of the
// BypassCommitTimeout consensus parameter. It configures if the consensus
// engine will wait for the full Commit timeout before proceeding to the next height.
// If it is set to true, the consensus engine will proceed to the next height
// as soon as the node has gathered votes from all of the validators on the network.
UnsafeBypassCommitTimeoutOverride *bool `mapstructure:"unsafe-bypass-commit-timeout-override"`
// Deprecated timeout parameters. These parameters are present in this struct
// so that they can be parsed so that validation can check if they have erroneously
// been included and provide a helpful error message.
// These fields should be completely removed in v0.37.
// See: https://github.com/tendermint/tendermint/issues/8188
DeprecatedTimeoutPropose *interface{} `mapstructure:"timeout-propose"`
DeprecatedTimeoutProposeDelta *interface{} `mapstructure:"timeout-propose-delta"`
DeprecatedTimeoutPrevote *interface{} `mapstructure:"timeout-prevote"`
DeprecatedTimeoutPrevoteDelta *interface{} `mapstructure:"timeout-prevote-delta"`
DeprecatedTimeoutPrecommit *interface{} `mapstructure:"timeout-precommit"`
DeprecatedTimeoutPrecommitDelta *interface{} `mapstructure:"timeout-precommit-delta"`
DeprecatedTimeoutCommit *interface{} `mapstructure:"timeout-commit"`
DeprecatedSkipTimeoutCommit *interface{} `mapstructure:"skip-timeout-commit"`
}
// DefaultConsensusConfig returns a default configuration for the consensus service
func DefaultConsensusConfig() *ConsensusConfig {
return &ConsensusConfig{
WalPath: filepath.Join(defaultDataDir, "cs.wal", "wal"),
TimeoutPropose: 3000 * time.Millisecond,
TimeoutProposeDelta: 500 * time.Millisecond,
TimeoutPrevote: 1000 * time.Millisecond,
TimeoutPrevoteDelta: 500 * time.Millisecond,
TimeoutPrecommit: 1000 * time.Millisecond,
TimeoutPrecommitDelta: 500 * time.Millisecond,
TimeoutCommit: 1000 * time.Millisecond,
SkipTimeoutCommit: false,
CreateEmptyBlocks: true,
CreateEmptyBlocksInterval: 0 * time.Second,
PeerGossipSleepDuration: 100 * time.Millisecond,
@@ -1011,14 +1034,6 @@ func DefaultConsensusConfig() *ConsensusConfig {
// TestConsensusConfig returns a configuration for testing the consensus service
func TestConsensusConfig() *ConsensusConfig {
cfg := DefaultConsensusConfig()
cfg.TimeoutPropose = 40 * time.Millisecond
cfg.TimeoutProposeDelta = 1 * time.Millisecond
cfg.TimeoutPrevote = 10 * time.Millisecond
cfg.TimeoutPrevoteDelta = 1 * time.Millisecond
cfg.TimeoutPrecommit = 10 * time.Millisecond
cfg.TimeoutPrecommitDelta = 1 * time.Millisecond
cfg.TimeoutCommit = 10 * time.Millisecond
cfg.SkipTimeoutCommit = true
cfg.PeerGossipSleepDuration = 5 * time.Millisecond
cfg.PeerQueryMaj23SleepDuration = 250 * time.Millisecond
cfg.DoubleSignCheckHeight = int64(0)
@@ -1030,33 +1045,6 @@ func (cfg *ConsensusConfig) WaitForTxs() bool {
return !cfg.CreateEmptyBlocks || cfg.CreateEmptyBlocksInterval > 0
}
// Propose returns the amount of time to wait for a proposal
func (cfg *ConsensusConfig) Propose(round int32) time.Duration {
return time.Duration(
cfg.TimeoutPropose.Nanoseconds()+cfg.TimeoutProposeDelta.Nanoseconds()*int64(round),
) * time.Nanosecond
}
// Prevote returns the amount of time to wait for straggler votes after receiving any +2/3 prevotes
func (cfg *ConsensusConfig) Prevote(round int32) time.Duration {
return time.Duration(
cfg.TimeoutPrevote.Nanoseconds()+cfg.TimeoutPrevoteDelta.Nanoseconds()*int64(round),
) * time.Nanosecond
}
// Precommit returns the amount of time to wait for straggler votes after receiving any +2/3 precommits
func (cfg *ConsensusConfig) Precommit(round int32) time.Duration {
return time.Duration(
cfg.TimeoutPrecommit.Nanoseconds()+cfg.TimeoutPrecommitDelta.Nanoseconds()*int64(round),
) * time.Nanosecond
}
// Commit returns the amount of time to wait for straggler votes after receiving +2/3 precommits
// for a single block (ie. a commit).
func (cfg *ConsensusConfig) Commit(t time.Time) time.Time {
return t.Add(cfg.TimeoutCommit)
}
// WalFile returns the full path to the write-ahead log file
func (cfg *ConsensusConfig) WalFile() string {
if cfg.walFile != "" {
@@ -1073,26 +1061,20 @@ func (cfg *ConsensusConfig) SetWalFile(walFile string) {
// ValidateBasic performs basic validation (checking param bounds, etc.) and
// returns an error if any check fails.
func (cfg *ConsensusConfig) ValidateBasic() error {
if cfg.TimeoutPropose < 0 {
return errors.New("timeout-propose can't be negative")
if cfg.UnsafeProposeTimeoutOverride < 0 {
return errors.New("unsafe-propose-timeout-override can't be negative")
}
if cfg.TimeoutProposeDelta < 0 {
return errors.New("timeout-propose-delta can't be negative")
if cfg.UnsafeProposeTimeoutDeltaOverride < 0 {
return errors.New("unsafe-propose-timeout-delta-override can't be negative")
}
if cfg.TimeoutPrevote < 0 {
return errors.New("timeout-prevote can't be negative")
if cfg.UnsafeVoteTimeoutOverride < 0 {
return errors.New("unsafe-vote-timeout-override can't be negative")
}
if cfg.TimeoutPrevoteDelta < 0 {
return errors.New("timeout-prevote-delta can't be negative")
if cfg.UnsafeVoteTimeoutDeltaOverride < 0 {
return errors.New("unsafe-vote-timeout-delta-override can't be negative")
}
if cfg.TimeoutPrecommit < 0 {
return errors.New("timeout-precommit can't be negative")
}
if cfg.TimeoutPrecommitDelta < 0 {
return errors.New("timeout-precommit-delta can't be negative")
}
if cfg.TimeoutCommit < 0 {
return errors.New("timeout-commit can't be negative")
if cfg.UnsafeCommitTimeoutOverride < 0 {
return errors.New("unsafe-commit-timeout-override can't be negative")
}
if cfg.CreateEmptyBlocksInterval < 0 {
return errors.New("create-empty-blocks-interval can't be negative")
@@ -1109,6 +1091,44 @@ func (cfg *ConsensusConfig) ValidateBasic() error {
return nil
}
func (cfg *ConsensusConfig) DeprecatedFieldWarning() error {
var fields []string
if cfg.DeprecatedSkipTimeoutCommit != nil {
fields = append(fields, "skip-timeout-commit")
}
if cfg.DeprecatedTimeoutPropose != nil {
fields = append(fields, "timeout-propose")
}
if cfg.DeprecatedTimeoutProposeDelta != nil {
fields = append(fields, "timeout-propose-delta")
}
if cfg.DeprecatedTimeoutPrevote != nil {
fields = append(fields, "timeout-prevote")
}
if cfg.DeprecatedTimeoutPrevoteDelta != nil {
fields = append(fields, "timeout-prevote-delta")
}
if cfg.DeprecatedTimeoutPrecommit != nil {
fields = append(fields, "timeout-precommit")
}
if cfg.DeprecatedTimeoutPrecommitDelta != nil {
fields = append(fields, "timeout-precommit-delta")
}
if cfg.DeprecatedTimeoutCommit != nil {
fields = append(fields, "timeout-commit")
}
if cfg.DeprecatedSkipTimeoutCommit != nil {
fields = append(fields, "skip-timeout-commit")
}
if len(fields) != 0 {
return fmt.Errorf("the following deprecated fields were set in the "+
"configuration file: %s. These fields were removed in v0.36. Timeout "+
"configuration has been moved to the ConsensusParams. For more information see "+
"https://tinyurl.com/adr074", strings.Join(fields, ", "))
}
return nil
}
//-----------------------------------------------------------------------------
// TxIndexConfig
// Remember that Event has the following structure:
@@ -1125,9 +1145,8 @@ type TxIndexConfig struct {
// If list contains `null`, meaning no indexer service will be used.
//
// Options:
// 1) "null" - no indexer services.
// 2) "kv" (default) - the simplest possible indexer,
// backed by key-value storage (defaults to levelDB; see DBBackend).
// 1) "null" (default) - no indexer services.
// 2) "kv" - a simple indexer backed by key-value storage (see DBBackend)
// 3) "psql" - the indexer services backed by PostgreSQL.
Indexer []string `mapstructure:"indexer"`
@@ -1138,14 +1157,12 @@ type TxIndexConfig struct {
// DefaultTxIndexConfig returns a default configuration for the transaction indexer.
func DefaultTxIndexConfig() *TxIndexConfig {
return &TxIndexConfig{
Indexer: []string{"kv"},
}
return &TxIndexConfig{Indexer: []string{"null"}}
}
// TestTxIndexConfig returns a default configuration for the transaction indexer.
func TestTxIndexConfig() *TxIndexConfig {
return DefaultTxIndexConfig()
return &TxIndexConfig{Indexer: []string{"kv"}}
}
//-----------------------------------------------------------------------------

View File

@@ -29,8 +29,8 @@ func TestConfigValidateBasic(t *testing.T) {
cfg := DefaultConfig()
assert.NoError(t, cfg.ValidateBasic())
// tamper with timeout_propose
cfg.Consensus.TimeoutPropose = -10 * time.Second
// tamper with unsafe-propose-timeout-override
cfg.Consensus.UnsafeProposeTimeoutOverride = -10 * time.Second
assert.Error(t, cfg.ValidateBasic())
}
@@ -106,25 +106,21 @@ func TestConsensusConfig_ValidateBasic(t *testing.T) {
modify func(*ConsensusConfig)
expectErr bool
}{
"TimeoutPropose": {func(c *ConsensusConfig) { c.TimeoutPropose = time.Second }, false},
"TimeoutPropose negative": {func(c *ConsensusConfig) { c.TimeoutPropose = -1 }, true},
"TimeoutProposeDelta": {func(c *ConsensusConfig) { c.TimeoutProposeDelta = time.Second }, false},
"TimeoutProposeDelta negative": {func(c *ConsensusConfig) { c.TimeoutProposeDelta = -1 }, true},
"TimeoutPrevote": {func(c *ConsensusConfig) { c.TimeoutPrevote = time.Second }, false},
"TimeoutPrevote negative": {func(c *ConsensusConfig) { c.TimeoutPrevote = -1 }, true},
"TimeoutPrevoteDelta": {func(c *ConsensusConfig) { c.TimeoutPrevoteDelta = time.Second }, false},
"TimeoutPrevoteDelta negative": {func(c *ConsensusConfig) { c.TimeoutPrevoteDelta = -1 }, true},
"TimeoutPrecommit": {func(c *ConsensusConfig) { c.TimeoutPrecommit = time.Second }, false},
"TimeoutPrecommit negative": {func(c *ConsensusConfig) { c.TimeoutPrecommit = -1 }, true},
"TimeoutPrecommitDelta": {func(c *ConsensusConfig) { c.TimeoutPrecommitDelta = time.Second }, false},
"TimeoutPrecommitDelta negative": {func(c *ConsensusConfig) { c.TimeoutPrecommitDelta = -1 }, true},
"TimeoutCommit": {func(c *ConsensusConfig) { c.TimeoutCommit = time.Second }, false},
"TimeoutCommit negative": {func(c *ConsensusConfig) { c.TimeoutCommit = -1 }, true},
"PeerGossipSleepDuration": {func(c *ConsensusConfig) { c.PeerGossipSleepDuration = time.Second }, false},
"PeerGossipSleepDuration negative": {func(c *ConsensusConfig) { c.PeerGossipSleepDuration = -1 }, true},
"PeerQueryMaj23SleepDuration": {func(c *ConsensusConfig) { c.PeerQueryMaj23SleepDuration = time.Second }, false},
"PeerQueryMaj23SleepDuration negative": {func(c *ConsensusConfig) { c.PeerQueryMaj23SleepDuration = -1 }, true},
"DoubleSignCheckHeight negative": {func(c *ConsensusConfig) { c.DoubleSignCheckHeight = -1 }, true},
"UnsafeProposeTimeoutOverride": {func(c *ConsensusConfig) { c.UnsafeProposeTimeoutOverride = time.Second }, false},
"UnsafeProposeTimeoutOverride negative": {func(c *ConsensusConfig) { c.UnsafeProposeTimeoutOverride = -1 }, true},
"UnsafeProposeTimeoutDeltaOverride": {func(c *ConsensusConfig) { c.UnsafeProposeTimeoutDeltaOverride = time.Second }, false},
"UnsafeProposeTimeoutDeltaOverride negative": {func(c *ConsensusConfig) { c.UnsafeProposeTimeoutDeltaOverride = -1 }, true},
"UnsafePrevoteTimeoutOverride": {func(c *ConsensusConfig) { c.UnsafeVoteTimeoutOverride = time.Second }, false},
"UnsafePrevoteTimeoutOverride negative": {func(c *ConsensusConfig) { c.UnsafeVoteTimeoutOverride = -1 }, true},
"UnsafePrevoteTimeoutDeltaOverride": {func(c *ConsensusConfig) { c.UnsafeVoteTimeoutDeltaOverride = time.Second }, false},
"UnsafePrevoteTimeoutDeltaOverride negative": {func(c *ConsensusConfig) { c.UnsafeVoteTimeoutDeltaOverride = -1 }, true},
"UnsafeCommitTimeoutOverride": {func(c *ConsensusConfig) { c.UnsafeCommitTimeoutOverride = time.Second }, false},
"UnsafeCommitTimeoutOverride negative": {func(c *ConsensusConfig) { c.UnsafeCommitTimeoutOverride = -1 }, true},
"PeerGossipSleepDuration": {func(c *ConsensusConfig) { c.PeerGossipSleepDuration = time.Second }, false},
"PeerGossipSleepDuration negative": {func(c *ConsensusConfig) { c.PeerGossipSleepDuration = -1 }, true},
"PeerQueryMaj23SleepDuration": {func(c *ConsensusConfig) { c.PeerQueryMaj23SleepDuration = time.Second }, false},
"PeerQueryMaj23SleepDuration negative": {func(c *ConsensusConfig) { c.PeerQueryMaj23SleepDuration = -1 }, true},
"DoubleSignCheckHeight negative": {func(c *ConsensusConfig) { c.DoubleSignCheckHeight = -1 }, true},
}
for desc, tc := range testcases {
tc := tc // appease linter

View File

@@ -12,8 +12,8 @@ import (
tmrand "github.com/tendermint/tendermint/libs/rand"
)
// DefaultDirPerm is the default permissions used when creating directories.
const DefaultDirPerm = 0700
// defaultDirPerm is the default permissions used when creating directories.
const defaultDirPerm = 0700
var configTemplate *template.Template
@@ -32,13 +32,13 @@ func init() {
// EnsureRoot creates the root, config, and data directories if they don't exist,
// and panics if it fails.
func EnsureRoot(rootDir string) {
if err := tmos.EnsureDir(rootDir, DefaultDirPerm); err != nil {
if err := tmos.EnsureDir(rootDir, defaultDirPerm); err != nil {
panic(err.Error())
}
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultConfigDir), DefaultDirPerm); err != nil {
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultConfigDir), defaultDirPerm); err != nil {
panic(err.Error())
}
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultDataDir), DefaultDirPerm); err != nil {
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultDataDir), defaultDirPerm); err != nil {
panic(err.Error())
}
}
@@ -450,32 +450,12 @@ fetchers = "{{ .StateSync.Fetchers }}"
wal-file = "{{ js .Consensus.WalPath }}"
# How long we wait for a proposal block before prevoting nil
timeout-propose = "{{ .Consensus.TimeoutPropose }}"
# How much timeout-propose increases with each round
timeout-propose-delta = "{{ .Consensus.TimeoutProposeDelta }}"
# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil)
timeout-prevote = "{{ .Consensus.TimeoutPrevote }}"
# How much the timeout-prevote increases with each round
timeout-prevote-delta = "{{ .Consensus.TimeoutPrevoteDelta }}"
# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil)
timeout-precommit = "{{ .Consensus.TimeoutPrecommit }}"
# How much the timeout-precommit increases with each round
timeout-precommit-delta = "{{ .Consensus.TimeoutPrecommitDelta }}"
# 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 = "{{ .Consensus.TimeoutCommit }}"
# 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 = {{ .Consensus.DoubleSignCheckHeight }}
# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
skip-timeout-commit = {{ .Consensus.SkipTimeoutCommit }}
# EmptyBlocks mode and possible interval between empty blocks
create-empty-blocks = {{ .Consensus.CreateEmptyBlocks }}
create-empty-blocks-interval = "{{ .Consensus.CreateEmptyBlocksInterval }}"
@@ -484,6 +464,50 @@ create-empty-blocks-interval = "{{ .Consensus.CreateEmptyBlocksInterval }}"
peer-gossip-sleep-duration = "{{ .Consensus.PeerGossipSleepDuration }}"
peer-query-maj23-sleep-duration = "{{ .Consensus.PeerQueryMaj23SleepDuration }}"
### Unsafe Timeout Overrides ###
# These fields provide temporary overrides for the Timeout consensus parameters.
# Use of these parameters is strongly discouraged. Using these parameters may have serious
# liveness implications for the validator and for the chain.
#
# These fields will be removed from the configuration file in the v0.37 release of Tendermint.
# For additional information, see ADR-74:
# https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-074-timeout-params.md
# This field provides an unsafe override of the Propose timeout consensus parameter.
# This field configures how long the consensus engine will wait for a proposal block before prevoting nil.
# If this field is set to a value greater than 0, it will take effect.
# unsafe-propose-timeout-override = {{ .Consensus.UnsafeProposeTimeoutOverride }}
# This field provides an unsafe override of the ProposeDelta timeout consensus parameter.
# This field configures how much the propose timeout increases with each round.
# If this field is set to a value greater than 0, it will take effect.
# unsafe-propose-timeout-delta-override = {{ .Consensus.UnsafeProposeTimeoutDeltaOverride }}
# This field provides an unsafe override of the Vote timeout consensus parameter.
# This field configures how long the consensus engine will wait after
# receiving +2/3 votes in a round.
# If this field is set to a value greater than 0, it will take effect.
# unsafe-vote-timeout-override = {{ .Consensus.UnsafeVoteTimeoutOverride }}
# This field provides an unsafe override of the VoteDelta timeout consensus parameter.
# This field configures how much the vote timeout increases with each round.
# If this field is set to a value greater than 0, it will take effect.
# unsafe-vote-timeout-delta-override = {{ .Consensus.UnsafeVoteTimeoutDeltaOverride }}
# This field provides an unsafe override of the Commit timeout consensus parameter.
# This field configures how long the consensus engine will wait after receiving
# +2/3 precommits before beginning the next height.
# If this field is set to a value greater than 0, it will take effect.
# unsafe-commit-timeout-override = {{ .Consensus.UnsafeCommitTimeoutOverride }}
# This field provides an unsafe override of the BypassCommitTimeout consensus parameter.
# This field configures if the consensus engine will wait for the full Commit timeout
# before proceeding to the next height.
# If this field is set to true, the consensus engine will proceed to the next height
# as soon as the node has gathered votes from all of the validators on the network.
# unsafe-bypass-commit-timeout-override =
#######################################################
### Transaction Indexer Configuration Options ###
#######################################################
@@ -496,8 +520,8 @@ peer-query-maj23-sleep-duration = "{{ .Consensus.PeerQueryMaj23SleepDuration }}"
# 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).
# 1) "null" (default) - no indexer services.
# 2) "kv" - a simple indexer backed by key-value storage (see DBBackend)
# 3) "psql" - the indexer services backed by PostgreSQL.
# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed.
indexer = [{{ range $i, $e := .TxIndex.Indexer }}{{if $i}}, {{end}}{{ printf "%q" $e}}{{end}}]
@@ -542,10 +566,10 @@ func ResetTestRootWithChainID(dir, testName string, chainID string) (*Config, er
return nil, err
}
// ensure config and data subdirs are created
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultConfigDir), DefaultDirPerm); err != nil {
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultConfigDir), defaultDirPerm); err != nil {
return nil, err
}
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultDataDir), DefaultDirPerm); err != nil {
if err := tmos.EnsureDir(filepath.Join(rootDir, defaultDataDir), defaultDirPerm); err != nil {
return nil, err
}
@@ -588,7 +612,7 @@ func writeFile(filePath string, contents []byte, mode os.FileMode) error {
return nil
}
var testGenesisFmt = `{
const testGenesisFmt = `{
"genesis_time": "2018-10-10T08:20:13.695936996Z",
"chain_id": "%s",
"initial_height": "1",
@@ -602,6 +626,14 @@ var testGenesisFmt = `{
"message_delay": "500000000",
"precision": "10000000"
},
"timeout": {
"propose": "30000000",
"propose_delta": "50000",
"vote": "30000000",
"vote_delta": "50000",
"commit": "10000000",
"bypass_timeout_commit": true
},
"evidence": {
"max_age_num_blocks": "100000",
"max_age_duration": "172800000000000",
@@ -627,7 +659,7 @@ var testGenesisFmt = `{
"app_hash": ""
}`
var testPrivValidatorKey = `{
const testPrivValidatorKey = `{
"address": "A3258DCBF45DCA0DF052981870F2D1441A36D145",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
@@ -639,7 +671,7 @@ var testPrivValidatorKey = `{
}
}`
var testPrivValidatorState = `{
const testPrivValidatorState = `{
"height": "0",
"round": 0,
"step": 0

View File

@@ -12,7 +12,7 @@ For any specific algorithm, use its specific module e.g.
## Binary encoding
For Binary encoding, please refer to the [Tendermint encoding specification](https://docs.tendermint.com/master/spec/blockchain/encoding.html).
For Binary encoding, please refer to the [Tendermint encoding specification](https://docs.tendermint.com/master/spec/core/encoding.html).
## JSON Encoding

View File

@@ -1,14 +1,18 @@
package crypto
import (
"github.com/tendermint/tendermint/crypto/tmhash"
"crypto/sha256"
"github.com/tendermint/tendermint/internal/jsontypes"
"github.com/tendermint/tendermint/libs/bytes"
)
const (
// HashSize is the size in bytes of an AddressHash.
HashSize = sha256.Size
// AddressSize is the size of a pubkey address.
AddressSize = tmhash.TruncatedSize
AddressSize = 20
)
// An address is a []byte, but hex-encoded even in JSON.
@@ -16,8 +20,19 @@ const (
// Use an alias so Unmarshal methods (with ptr receivers) are available too.
type Address = bytes.HexBytes
// AddressHash computes a truncated SHA-256 hash of bz for use as
// a peer address.
//
// See: https://docs.tendermint.com/master/spec/core/data_structures.html#address
func AddressHash(bz []byte) Address {
return Address(tmhash.SumTruncated(bz))
h := sha256.Sum256(bz)
return Address(h[:AddressSize])
}
// Checksum returns the SHA256 of the bz.
func Checksum(bz []byte) []byte {
h := sha256.Sum256(bz)
return h[:]
}
type PubKey interface {

View File

@@ -2,6 +2,8 @@ package ed25519
import (
"bytes"
"crypto/rand"
"crypto/sha256"
"crypto/subtle"
"errors"
"fmt"
@@ -11,7 +13,6 @@ import (
"github.com/oasisprotocol/curve25519-voi/primitives/ed25519/extra/cache"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/internal/jsontypes"
)
@@ -124,7 +125,7 @@ func (privKey PrivKey) Type() string {
// It uses OS randomness in conjunction with the current global random seed
// in tendermint/libs/common to generate the private key.
func GenPrivKey() PrivKey {
return genPrivKey(crypto.CReader())
return genPrivKey(rand.Reader)
}
// genPrivKey generates a new ed25519 private key using the provided reader.
@@ -142,9 +143,8 @@ func genPrivKey(rand io.Reader) PrivKey {
// NOTE: secret should be the output of a KDF like bcrypt,
// if it's derived from user input.
func GenPrivKeyFromSecret(secret []byte) PrivKey {
seed := crypto.Sha256(secret) // Not Ripemd160 because we want 32 bytes.
return PrivKey(ed25519.NewKeyFromSeed(seed))
seed := sha256.Sum256(secret)
return PrivKey(ed25519.NewKeyFromSeed(seed[:]))
}
//-------------------------------------
@@ -162,7 +162,7 @@ func (pubKey PubKey) Address() crypto.Address {
if len(pubKey) != PubKeySize {
panic("pubkey is incorrect size")
}
return crypto.Address(tmhash.SumTruncated(pubKey))
return crypto.AddressHash(pubKey)
}
// Bytes returns the PubKey byte format.
@@ -229,5 +229,5 @@ func (b *BatchVerifier) Add(key crypto.PubKey, msg, signature []byte) error {
}
func (b *BatchVerifier) Verify() (bool, []bool) {
return b.BatchVerifier.Verify(crypto.CReader())
return b.BatchVerifier.Verify(rand.Reader)
}

View File

@@ -1,28 +0,0 @@
// Copyright 2017 Tendermint. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package crypto_test
import (
"fmt"
"github.com/tendermint/tendermint/crypto"
)
func ExampleSha256() {
sum := crypto.Sha256([]byte("This is Tendermint"))
fmt.Printf("%x\n", sum)
// Output:
// f91afb642f3d1c87c17eb01aae5cb65c242dfdbe7cf1066cc260f4ce5d33b94e
}

View File

@@ -1,11 +0,0 @@
package crypto
import (
"crypto/sha256"
)
func Sha256(bytes []byte) []byte {
hasher := sha256.New()
hasher.Write(bytes)
return hasher.Sum(nil)
}

View File

@@ -3,7 +3,7 @@ package merkle
import (
"hash"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/crypto"
)
// TODO: make these have a large predefined capacity
@@ -14,12 +14,12 @@ var (
// returns tmhash(<empty>)
func emptyHash() []byte {
return tmhash.Sum([]byte{})
return crypto.Checksum([]byte{})
}
// returns tmhash(0x00 || leaf)
func leafHash(leaf []byte) []byte {
return tmhash.Sum(append(leafPrefix, leaf...))
return crypto.Checksum(append(leafPrefix, leaf...))
}
// returns tmhash(0x00 || leaf)
@@ -36,7 +36,7 @@ func innerHash(left []byte, right []byte) []byte {
n := copy(data, innerPrefix)
n += copy(data[n:], left)
copy(data[n:], right)
return tmhash.Sum(data)
return crypto.Checksum(data)[:]
}
func innerHashOpt(s hash.Hash, left []byte, right []byte) []byte {

View File

@@ -5,7 +5,7 @@ import (
"errors"
"fmt"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/crypto"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
)
@@ -102,15 +102,15 @@ func (sp *Proof) ValidateBasic() error {
if sp.Index < 0 {
return errors.New("negative Index")
}
if len(sp.LeafHash) != tmhash.Size {
return fmt.Errorf("expected LeafHash size to be %d, got %d", tmhash.Size, len(sp.LeafHash))
if len(sp.LeafHash) != crypto.HashSize {
return fmt.Errorf("expected LeafHash size to be %d, got %d", crypto.HashSize, len(sp.LeafHash))
}
if len(sp.Aunts) > MaxAunts {
return fmt.Errorf("expected no more than %d aunts, got %d", MaxAunts, len(sp.Aunts))
}
for i, auntHash := range sp.Aunts {
if len(auntHash) != tmhash.Size {
return fmt.Errorf("expected Aunts#%d size to be %d, got %d", i, tmhash.Size, len(auntHash))
if len(auntHash) != crypto.HashSize {
return fmt.Errorf("expected Aunts#%d size to be %d, got %d", i, crypto.HashSize, len(auntHash))
}
}
return nil

View File

@@ -2,9 +2,9 @@ package merkle
import (
"bytes"
"crypto/sha256"
"fmt"
"github.com/tendermint/tendermint/crypto/tmhash"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
)
@@ -79,14 +79,13 @@ func (op ValueOp) Run(args [][]byte) ([][]byte, error) {
return nil, fmt.Errorf("expected 1 arg, got %v", len(args))
}
value := args[0]
hasher := tmhash.New()
hasher.Write(value)
vhash := hasher.Sum(nil)
vhash := sha256.Sum256(value)
bz := new(bytes.Buffer)
// Wrap <op.Key, vhash> to hash the KVPair.
encodeByteSlice(bz, op.key) //nolint: errcheck // does not error
encodeByteSlice(bz, vhash) //nolint: errcheck // does not error
encodeByteSlice(bz, op.key) //nolint: errcheck // does not error
encodeByteSlice(bz, vhash[:]) //nolint: errcheck // does not error
kvhash := leafHash(bz.Bytes())
if !bytes.Equal(kvhash, op.Proof.LeafHash) {

View File

@@ -20,7 +20,7 @@ import (
"encoding/hex"
"testing"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/crypto"
)
func TestRFC6962Hasher(t *testing.T) {
@@ -39,7 +39,7 @@ func TestRFC6962Hasher(t *testing.T) {
// echo -n '' | sha256sum
{
desc: "RFC6962 Empty Tree",
want: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"[:tmhash.Size*2],
want: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"[:crypto.HashSize*2],
got: emptyTreeHash,
},
@@ -47,19 +47,19 @@ func TestRFC6962Hasher(t *testing.T) {
// echo -n 00 | xxd -r -p | sha256sum
{
desc: "RFC6962 Empty Leaf",
want: "6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"[:tmhash.Size*2],
want: "6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"[:crypto.HashSize*2],
got: emptyLeafHash,
},
// echo -n 004C313233343536 | xxd -r -p | sha256sum
{
desc: "RFC6962 Leaf",
want: "395aa064aa4c29f7010acfe3f25db9485bbd4b91897b6ad7ad547639252b4d56"[:tmhash.Size*2],
want: "395aa064aa4c29f7010acfe3f25db9485bbd4b91897b6ad7ad547639252b4d56"[:crypto.HashSize*2],
got: leafHash,
},
// echo -n 014E3132334E343536 | xxd -r -p | sha256sum
{
desc: "RFC6962 Node",
want: "aa217fe888e47007fa15edab33c2b492a722cb106c64667fc2b044444de66bbb"[:tmhash.Size*2],
want: "aa217fe888e47007fa15edab33c2b492a722cb106c64667fc2b044444de66bbb"[:crypto.HashSize*2],
got: innerHash([]byte("N123"), []byte("N456")),
},
} {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/crypto"
ctest "github.com/tendermint/tendermint/internal/libs/test"
tmrand "github.com/tendermint/tendermint/libs/rand"
)
@@ -53,7 +53,7 @@ func TestProof(t *testing.T) {
items := make([][]byte, total)
for i := 0; i < total; i++ {
items[i] = testItem(tmrand.Bytes(tmhash.Size))
items[i] = testItem(tmrand.Bytes(crypto.HashSize))
}
rootHash = HashFromByteSlices(items)
@@ -106,7 +106,7 @@ func TestHashAlternatives(t *testing.T) {
items := make([][]byte, total)
for i := 0; i < total; i++ {
items[i] = testItem(tmrand.Bytes(tmhash.Size))
items[i] = testItem(tmrand.Bytes(crypto.HashSize))
}
rootHash1 := HashFromByteSlicesIterative(items)
@@ -119,7 +119,7 @@ func BenchmarkHashAlternatives(b *testing.B) {
items := make([][]byte, total)
for i := 0; i < total; i++ {
items[i] = testItem(tmrand.Bytes(tmhash.Size))
items[i] = testItem(tmrand.Bytes(crypto.HashSize))
}
b.ResetTimer()

View File

@@ -1,35 +1,15 @@
package crypto
import (
crand "crypto/rand"
"encoding/hex"
"io"
"crypto/rand"
)
// This only uses the OS's randomness
func randBytes(numBytes int) []byte {
func CRandBytes(numBytes int) []byte {
b := make([]byte, numBytes)
_, err := crand.Read(b)
_, err := rand.Read(b)
if err != nil {
panic(err)
}
return b
}
// This only uses the OS's randomness
func CRandBytes(numBytes int) []byte {
return randBytes(numBytes)
}
// CRandHex returns a hex encoded string that's floor(numDigits/2) * 2 long.
//
// Note: CRandHex(24) gives 96 bits of randomness that
// are usually strong enough for most purposes.
func CRandHex(numDigits int) string {
return hex.EncodeToString(CRandBytes(numDigits / 2))
}
// Returns a crand.Reader.
func CReader() io.Reader {
return crand.Reader
}

View File

@@ -2,6 +2,7 @@ package secp256k1
import (
"bytes"
"crypto/rand"
"crypto/sha256"
"crypto/subtle"
"fmt"
@@ -70,7 +71,7 @@ func (privKey PrivKey) Type() string {
// GenPrivKey generates a new ECDSA private key on curve secp256k1 private key.
// It uses OS randomness to generate the private key.
func GenPrivKey() PrivKey {
return genPrivKey(crypto.CReader())
return genPrivKey(rand.Reader)
}
// genPrivKey generates a new secp256k1 private key using the provided reader.
@@ -190,8 +191,8 @@ var secp256k1halfN = new(big.Int).Rsh(secp256k1.S256().N, 1)
// The returned signature will be of the form R || S (in lower-S form).
func (privKey PrivKey) Sign(msg []byte) ([]byte, error) {
priv, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), privKey)
sig, err := priv.Sign(crypto.Sha256(msg))
seed := sha256.Sum256(msg)
sig, err := priv.Sign(seed[:])
if err != nil {
return nil, err
}
@@ -220,7 +221,8 @@ func (pubKey PubKey) VerifySignature(msg []byte, sigStr []byte) bool {
return false
}
return signature.Verify(crypto.Sha256(msg), pub)
seed := sha256.Sum256(msg)
return signature.Verify(seed[:], pub)
}
// Read Signature struct from R || S. Caller needs to ensure

View File

@@ -1,6 +1,7 @@
package sr25519
import (
"crypto/rand"
"fmt"
"github.com/oasisprotocol/curve25519-voi/primitives/sr25519"
@@ -42,5 +43,5 @@ func (b *BatchVerifier) Add(key crypto.PubKey, msg, signature []byte) error {
}
func (b *BatchVerifier) Verify() (bool, []bool) {
return b.BatchVerifier.Verify(crypto.CReader())
return b.BatchVerifier.Verify(rand.Reader)
}

View File

@@ -1,6 +1,8 @@
package sr25519
import (
"crypto/rand"
"crypto/sha256"
"encoding/json"
"fmt"
"io"
@@ -48,7 +50,7 @@ func (privKey PrivKey) Sign(msg []byte) ([]byte, error) {
st := signingCtx.NewTranscriptBytes(msg)
sig, err := privKey.kp.Sign(crypto.CReader(), st)
sig, err := privKey.kp.Sign(rand.Reader, st)
if err != nil {
return nil, fmt.Errorf("sr25519: failed to sign message: %w", err)
}
@@ -132,7 +134,7 @@ func (privKey *PrivKey) UnmarshalJSON(data []byte) error {
// It uses OS randomness in conjunction with the current global random seed
// in tendermint/libs/common to generate the private key.
func GenPrivKey() PrivKey {
return genPrivKey(crypto.CReader())
return genPrivKey(rand.Reader)
}
func genPrivKey(rng io.Reader) PrivKey {
@@ -154,10 +156,9 @@ func genPrivKey(rng io.Reader) PrivKey {
// NOTE: secret should be the output of a KDF like bcrypt,
// if it's derived from user input.
func GenPrivKeyFromSecret(secret []byte) PrivKey {
seed := crypto.Sha256(secret) // Not Ripemd160 because we want 32 bytes.
seed := sha256.Sum256(secret)
var privKey PrivKey
if err := privKey.msk.UnmarshalBinary(seed); err != nil {
if err := privKey.msk.UnmarshalBinary(seed[:]); err != nil {
panic("sr25519: failed to deserialize MiniSecretKey: " + err.Error())
}

View File

@@ -7,7 +7,6 @@ import (
"github.com/oasisprotocol/curve25519-voi/primitives/sr25519"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/tmhash"
)
var _ crypto.PubKey = PubKey{}
@@ -31,7 +30,7 @@ func (pubKey PubKey) Address() crypto.Address {
if len(pubKey) != PubKeySize {
panic("pubkey is incorrect size")
}
return crypto.Address(tmhash.SumTruncated(pubKey))
return crypto.AddressHash(pubKey)
}
// Bytes returns the PubKey byte format.

View File

@@ -1,65 +0,0 @@
package tmhash
import (
"crypto/sha256"
"hash"
)
const (
Size = sha256.Size
BlockSize = sha256.BlockSize
)
// New returns a new hash.Hash.
func New() hash.Hash {
return sha256.New()
}
// Sum returns the SHA256 of the bz.
func Sum(bz []byte) []byte {
h := sha256.Sum256(bz)
return h[:]
}
//-------------------------------------------------------------
const (
TruncatedSize = 20
)
type sha256trunc struct {
sha256 hash.Hash
}
func (h sha256trunc) Write(p []byte) (n int, err error) {
return h.sha256.Write(p)
}
func (h sha256trunc) Sum(b []byte) []byte {
shasum := h.sha256.Sum(b)
return shasum[:TruncatedSize]
}
func (h sha256trunc) Reset() {
h.sha256.Reset()
}
func (h sha256trunc) Size() int {
return TruncatedSize
}
func (h sha256trunc) BlockSize() int {
return h.sha256.BlockSize()
}
// NewTruncated returns a new hash.Hash.
func NewTruncated() hash.Hash {
return sha256trunc{
sha256: sha256.New(),
}
}
// SumTruncated returns the first 20 bytes of SHA256 of the bz.
func SumTruncated(bz []byte) []byte {
hash := sha256.Sum256(bz)
return hash[:TruncatedSize]
}

Some files were not shown because too many files have changed in this diff Show More