Commit Graph

9977 Commits

Author SHA1 Message Date
M. J. Fromberger
8175b2b26d docs: fix some broken markdown links (#8021)
Found by the link checker.

There are still some links that aren't fixed, because it's not clear where they _should_ point. I just hit the obvious ones.
2022-02-27 13:27:29 +00:00
dependabot[bot]
0fcfaa4568 build(deps): Bump url-parse from 1.5.7 to 1.5.10 in /docs (#8023)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-25 19:48:51 -08:00
dependabot[bot]
b488198d47 build(deps): Bump prismjs from 1.26.0 to 1.27.0 in /docs (#8022)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.26.0 to 1.27.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.26.0...v1.27.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-25 19:38:41 -08:00
M. J. Fromberger
b848c79971 Revert "Migration of TLA+ files from the spec repo (#8004)" (#8016)
This reverts commit e762dbb603.

These files need a more thorough review before integration.
2022-02-25 16:37:31 -08:00
Sam Kleinman
f25b7ceeb2 consensus: make orchestration more reliable for invalid precommit test (#8013)
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-02-26 00:21:59 +00:00
Kukovec
e762dbb603 Migration of TLA+ files from the spec repo (#8004) 2022-02-25 16:09:27 -08:00
M. J. Fromberger
cd0472014a Add command-line tool to manually subscribe to an event stream. (#8015)
This tool is an aid to debugging, and demonstrates the API of the eventstream
helper package. It subscribes to the event stream of a running node with the
ADR 075 event log enabled, and writes matching events to stdout as JSON.
2022-02-25 13:23:39 -08:00
M. J. Fromberger
ab32f5a9b6 rpc/client: add eventstream helper (#7987)
This allows the caller to stream events. It handles the bookkeeping for cursors
and pagination, and delivers items to a callback.

Handle missed items by reporting a structured error. The caller can use the
Reset method to "catch up" to head after this happens.

Add a manual test CLI to probe a running node. Requires the node to be
configured with the event log settings.

Add a unit test that scripts input to the stream to exercise it.
2022-02-25 12:37:01 -08:00
Sam Kleinman
a153f82433 p2p: ignore transport close error during cleanup (#8011)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-25 14:48:41 -05:00
William Banfield
c80734e5af state: synchronize the ProcessProposal implementation with the latest version of the spec (#7961)
This change implements the spec for `ProcessProposal`. It first calls the Tendermint block validation logic to check that all of the proposed block fields are well formed and do not violate any of the rules for Tendermint to consider the block valid and then passes the validated block the `ProcessProposal`.

This change also adds additional fixtures to test the change. It adds the `baseMock` types that holds a mock as well as a reference to `BaseApplication`. If the function was not setup by the test on the contained mock Application, the type delegates to the `BaseApplication` and returns what `BaseApplication` returns. 

The change also switches the `makeState` helper to take an arg struct so that an ABCI application can be plumbed through when needed.

closes: #7656
2022-02-25 18:56:34 +00:00
Sam Kleinman
89dbebd1c5 p2p: retry failed connections slightly more aggressively (#8010)
* p2p: retry failed connections slightly more aggressively

* fix dial interval test
2022-02-25 18:05:29 +00:00
M. J. Fromberger
af60a9c385 Forward port v0.34.16 changelog to master. (#8008) 2022-02-25 17:04:37 +00:00
Sam Kleinman
c8ae5db50e p2p: relax pong timeout (#8007) 2022-02-25 10:58:29 -05:00
JayT106
49e3688b79 fix syncAny test (#8001)
Co-authored-by: Sam Kleinman <garen@tychoish.com>
2022-02-25 10:33:28 -05:00
Sam Kleinman
c85e3e4ba8 p2p: mconn track last message for pongs (#7995)
* p2p: mconn track last message for pongs

* fix spell

* cr feedback

* test fix part one

* cleanup tests

* fix comment

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-02-25 15:15:13 +00:00
M. J. Fromberger
8c5e36159e abci: use no-op loggers in the examples (#7996)
This averts a rare but annoying log-after-test race condition.
2022-02-25 14:41:49 +00:00
Sam Kleinman
858d57a984 abci/kvstore: test cleanup improvements (#7991)
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-02-25 03:12:27 +00:00
M. J. Fromberger
0875074ea2 Add upgrading notes for the new Events RPC interface. (#7993)
Add deprecation logs when websocket is enabled
As promised in ADR 075, this causes the node to log (without error) when
websocket transport is enabled, and also when subscribers connect.
2022-02-24 15:04:55 -08:00
Sam Kleinman
3e2d5db289 abci: remove lock protecting calls to the application interface (#7984)
Closes #7073

As part of the 0.36 cycle we've discussed and decided to remove the mutex in tendermint that protects the ABCI application. First, applications should be able to be responsible for their own concurrency control, and can make more fine-grained decisions about concurrent use than tendermint ever could. Second, I've observed in recent weeks as we've been making this change that the mutex wasn't applied particularly consistently in many cases (e.g. multiple "local" connections to the application had multiple locks, etc.) so this will give more consistent experiences across ABCI execution environments, and simplifies the tendermint ABCI handling code.
2022-02-24 19:53:04 +00:00
M. J. Fromberger
f795d3f360 rpc/client: rewrite the WaitForOneEvent helper (#7986)
Update usage in tests.
2022-02-24 11:21:40 -08:00
Sam Kleinman
06e6d3f2e9 e2e: change ci network configuration (#7988) 2022-02-24 13:57:00 -05:00
Sam Kleinman
680ebc6f8e consensus: TestReactorValidatorSetChanges test fix (#7985) 2022-02-24 12:47:27 -05:00
M. J. Fromberger
211b80a484 rpc/client: add Events method to the client interface (#7982)
- Update documentation to deprecate the old methods.
- Add Events methods to HTTP, WS, and Local clients.
- Add Events method to the light client wrapper.
- Rename legacy events client to SubscriptionClient.
2022-02-24 06:51:14 -08:00
Sam Kleinman
62a1cb8d17 testing: reduce usage of the MustDefaultLogger constructor (#7960)
* testing: reduce usage of the MustDefualtLogger constructor

* Apply suggestions from code review

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

* cleanup tests

Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
2022-02-24 02:43:11 +00:00
M. J. Fromberger
a57567ba33 node: hook up eventlog and eventlog metrics (#7981) 2022-02-23 16:37:12 -08:00
M. J. Fromberger
5662bd12a8 rpc: implement the ADR 075 /events method (#7965)
This method implements the eventlog extension interface to expose ABCI metadata
to the log for query processing. Only the types that have ABCI events need to
implement this.

- Add an event log to the environment
- Add a sketch of the handler method
- Add an /events RPCFunc to the route map
- Implement query logic
- Subscribe to pubsub if confingured, handle termination
2022-02-23 15:22:40 -08:00
Sam Kleinman
61a81279bd abci: make tendermint example+test clients manage a mutex (#7978)
This is the first step in removing the mutex from ABCI applications:
making our test applications hold mutexes, which this does, hopefully
with zero impact. If this lands well, then we can explore deleting the
other mutexes (in the ABCI server and the clients.) While this change
is not user impacting at all, removing the other mutexes *will* be. 

In persuit of this, I've changed the KV app somewhat, to put almost
all of the logic in the base application and make the persistent
application mostly be a wrapper on top of that with a different
storage layer.
2022-02-23 22:39:47 +00:00
M. J. Fromberger
f939f962b1 Remove master from versions and copy it from the latest. (#7980) 2022-02-23 13:58:33 -08:00
Sam Kleinman
9968f53c15 p2p: make mconn transport test less flaky (#7973)
The previous implementation of the *test* was flaky, and this irons
out some of those problems. The primary assertion that was failing
(less than 1% of the time) was an error on close that I think we
shouldn't care about.
2022-02-23 19:06:03 +00:00
M. J. Fromberger
80186a9d9c Update OpenAPI docs. (#7974)
* Update OpenAPI docs.

- Add an Events tag for event methods.
- Add schema entries for event request/response types.
- Clarify the documentation for broadcast methods.
- Note that websocket will be deprecated in v0.36.
2022-02-23 06:42:29 -08:00
Sam Kleinman
21461e55a7 e2e(harness): plumb logging instance (#7958)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-23 08:11:01 -05:00
Sam Kleinman
2ffb262600 context: cleaning up context dead ends (#7963) 2022-02-22 20:04:16 +00:00
Sam Kleinman
912751cf93 math: remove panics in safe math ops (#7962)
* math: remove panics in safe math ops

* fix docs

* fix lint
2022-02-22 18:34:17 +00:00
M. J. Fromberger
926c469fcc Restore building docs for master on docs.tendermint.com. (#7969)
There are a lot of existing links to the master section of the site, and my
attempts to get a redirector working have so far not succeeded. While it still
makes sense to not publish docs for unreleased code, a 404 is almost certainly
more disruptive than seeing docs for unreleased stuff.

This includes the docs in the build again, but does not add them back to the
selector menu. That allows URLs to resolve but encourages folks to use the
released versions when they have a choice.

I left the redirect for the RPC link in place, since that's still useful.

Updates #7935.
2022-02-22 17:14:40 +00:00
Sam Kleinman
3dc04430c3 cmd/debug: remove global variables and logging (#7957) 2022-02-22 10:13:03 -05:00
M. J. Fromberger
70ee282d9e docs: redirect master links to the latest release version (#7936) 2022-02-22 04:51:02 -08:00
M. J. Fromberger
c88cf0b66c config: add event subscription options and defaults (#7930) 2022-02-22 04:46:27 -08:00
Callum Waters
50de246a2b docs: update repo and spec readme's (#7907) 2022-02-21 20:00:05 +01:00
M. J. Fromberger
705f365bcd rpc: implement the eventlog defined by ADR 075 (#7825)
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
2022-02-21 08:54:50 -08:00
M. J. Fromberger
3b20931da3 docs: Pin the RPC docs to v0.35 instead of master (#7909) 2022-02-21 07:46:39 -08:00
M. J. Fromberger
bd6fce13ae Update release instructions for documentation. (#7846)
* Add linkpatch tool to rewrite documentation URLs.
* Update instructions for creating backport branches.

Updates #7675.
2022-02-21 07:26:48 -08:00
M. J. Fromberger
351adf8ddb Remove master from the docs site version config. (#7874) 2022-02-21 06:07:06 -08:00
Jasmina Malicevic
e80541a251 types/events+evidence: emit events + metrics on evidence validation (#7802)
* event: Added Events after evidence validation; evidence: refactored AddEvidence

Added context and Metrics as parameter for the pool constructor

* evidence: pushed event firing into evidence pool and added metrics to represent the size of the evpool

* state: fixed parameters of evpool mock functions

* evidence: added test to confirm events are generated

* Removed obsolete EvidenceEventPublisher interface

* evidence: pool removed error on missing eventbus
2022-02-21 14:45:56 +01:00
JayT106
ce898a738c consensus: HasVoteMessage index boundary check (#7720)
Went through #2871, there are several issues, this PR tries to tackle the `HasVoteMessage` with an invalid validator index sent by a bad peer and it prevents the bad vote goes to the peerMsgQueue.

Future work, check other bad message cases and plumbing the reactor errors with the peer manager and then can disconnect the peer sending the bad messages.
2022-02-21 13:21:24 +00:00
M. J. Fromberger
a185163c57 light: avert a data race (#7888) 2022-02-21 04:54:43 -08:00
M. J. Fromberger
51b93c8606 Re-enable the Markdown link checker. (#7889) 2022-02-21 04:26:23 -08:00
dependabot[bot]
325740a57c build(deps): Bump docker/login-action from 1.12.0 to 1.13.0 (#7890) 2022-02-21 10:41:06 +01:00
Thane Thomson
abdf717761 spec: Minor updates to spec merge PR (#7835)
Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
2022-02-20 11:36:20 -08:00
Sam Kleinman
d65237ff87 logging: allow logging level override (#7873)
I think in the future we should migrate from having our own logging
interface and use our logger directly, which I think would help
obviate this particular problem, but in the mean time, this seems safe.
2022-02-20 16:18:05 +00:00
William Banfield
3401eb2410 types: add default values for the synchrony parameters (#7788)
## Summary

This pull request adds a default set of values to the new Synchrony parameters. These values were chosen by after observation of three live networks: Emoney, Osmosis, and the Cosmos Hub. 

For the default Precision value, `505ms` was selected. The reasoning for this is summarized in https://github.com/tendermint/tendermint/issues/7724

For each observed chain, an experimental Message Delay was collected over a 24 hour period and an average over this period was calculated using this data. Values over 10s were considered outliers and treated separately for the average since the majority of observations were far below 10s. The message delay was calculated both for the quorum and the 'full' prevote. Description of the technique for collecting the experimental values can found in #7202. This value is calculated only using timestamps given by processes on the network, so large variation in values is almost certainly due to clock skew among the validator set.

`12s` is proposed for the default MessageDelay value. This value would easily accomodates all non-outlier values, allowing even E-money's 4.25s value to be valid. This would also allow some validators with skewed clocks to still participate without allowing for huge variation in the timestamps produced by the network. Additionally, for the currently listed use-cases of PBTS, such as unbonding period, and light client trust period, the current bounds for these are in weeks. Adding a few seconds of tolerance by default is therefore unlikely to have serious side-effects.

## Data

### Cosmos Hub
Observation Period: 2022-02-03 20:22-2022-02-04 20:22

Avg Full Prevote Message Delay: 1.27s
Outliers: 11s,13s,50s,106s,144s
Total Outlier Heights: 86

Avg Quorum Prevote Message Delay: .77s
Outliers: 10s,14s,107s,144s
Total Outlier Heights: 617

Total heights: 11528

### Osmosis
Observation Period: 2022-01-29 20:26-2022-01-28 20:26
Avg Quorum Prevote Message Delay: .46s
Outliers: 21s,50s
Total Outlier Heights: 26
NOTE: During the observation period, a 'full' prevote was not observed.

Total heights: 13983

### E-Money
Observation Period: 2022-02-07 04:29-2022-02-08 04:29
Avg Full Prevote Message Delay: 4.25s
Outliers: 12s,15s,39s
Total Outlier Heights: 128

Avg Quorum Prevote Message Delay: .20s
Outliers: 28s
Total Outlier Heights: 15

Total heights: 3791
2022-02-19 19:53:18 +00:00