Commit Graph
371 Commits
Author SHA1 Message Date
Thane Thomson 16b67fd9e6 Merge latest changes from master and fix conflicts
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-05 09:33:05 -04:00
Sam KleinmanandGitHub 97f7021712 statesync: merge channel processing (#8240) 2022-04-04 12:31:15 -04:00
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
Thane Thomson a682cc89c1 Fix spelling mistake to appease linter
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-01 16:03:48 -04:00
William Banfield 431c85be60 add tests for vote extension cases 2022-04-01 14:59:58 -04:00
Thane Thomson 989c9b63d6 Merge latest changes from master and resolve conflicts
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-31 19:57:23 -04:00
Sam KleinmanandGitHub 6af23ff757 state: avoid premature genericism (#8224) 2022-03-31 13:10:09 +00:00
Thane Thomson d9b2859191 Merge latest changes from master
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-29 08:38:48 -04:00
Thane Thomson f618fc2a1c 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>
2022-03-29 08:35:13 -04:00
William BanfieldandGitHub 41a1bf539b timeout parameters take the default if not set (#8189) 2022-03-28 18:25:19 -04:00
William BanfieldandGitHub 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
Thane Thomson 620c3236ec Add strong guarantee in extendedCommitInfo that the number of votes corresponds
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-28 11:45:06 -04:00
Thane Thomson fab3cd0932 Add strong correctness guarantees when constructing extended commit info for ABCI++
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-28 11:41:24 -04:00
Thane Thomson 01b6a4f2d5 Panic on ABCI++ method call failure
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-28 11:40:36 -04:00
Thane Thomson cbe85608cb Rewrite loop for clarity
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-25 10:37:06 -04:00
Thane Thomson 617f47fe44 Use dummy value with clearer meaning
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-25 10:36:59 -04:00
806e348af8 Update internal/consensus/common_test.go
Co-authored-by: Sergio Mena <sergio@informal.systems>
2022-03-25 10:36:45 -04:00
Thane Thomson 040cb566fb Merge latest changes from master and resolve conflicts
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-24 08:03:42 -04:00
William BanfieldandGitHub e4ae922c33 consensus: update state machine to use the new consensus params (#8181) 2022-03-23 11:26:42 -04:00
Sam KleinmanandGitHub cbce877480 consensus: add leaktest check to replay tests (#8185) 2022-03-23 00:00:08 +00:00
Sam KleinmanandGitHub b29cc95920 consensus: cleanup tempfile explictly (#8184) 2022-03-22 17:41:00 -04:00
Sam KleinmanandGitHub 0c9558a742 consensus: avoid panic during shutdown (#8170) 2022-03-22 15:28:33 -04:00
William BanfieldandGitHub 2361e0c65c abci++: remove CheckTx call from PrepareProposal flow (#8176) 2022-03-22 10:03:35 -04:00
William BanfieldandGitHub 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 KleinmanandGitHub 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 KleinmanandGitHub 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
Thane Thomson ab50582319 Fix missing VerifyVoteExtension request data
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-20 14:12:05 -04:00
Thane Thomson 9431db98e3 Fix lint
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-20 13:38:53 -04:00
Thane Thomson 19e07c9a8c Remove extraneous empty value initialization
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-20 13:34:46 -04:00
Thane Thomson 71d36953c3 Thread vote extensions through code and fix tests
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-20 13:34:46 -04:00
Thane Thomson aac3df4901 Inject vote extensions into proposal
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-03-20 13:34:46 -04:00
Thane Thomson 8fbe537d5d 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>
2022-03-20 13:34:44 -04:00
William BanfieldandGitHub 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 KleinmanandGitHub 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 KleinmanandGitHub 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 KleinmanandGitHub 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 BanfieldGitHubSam Kleinmanmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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 KleinmanandGitHub f1a8f47d4d types: minor cleanup of un or minimally used types (#8154) 2022-03-18 16:27:10 +00:00
Sam KleinmanandGitHub f61e6e4201 autofile: remove vestigal close mechanism (#8150) 2022-03-18 12:05:53 -04:00
Sam KleinmanandGitHub 1db41663c7 consensus: avoid race in accessing channel (#8149) 2022-03-18 09:54:40 -04:00
Sam KleinmanandGitHub 5e0e05f938 consensus: avoid persistent kvstore in tests (#8148) 2022-03-18 09:39:06 -04:00
Sam KleinmanandGitHub 5bb51aab03 events: remove service aspects of event switch (#8146) 2022-03-18 12:31:08 +00:00
Sam KleinmanandGitHub 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
JayT106andGitHub 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
Sam KleinmanandGitHub 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 BanfieldandGitHub 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
Sam KleinmanandGitHub 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 KleinmanandGitHub 07b46d5a05 blocksync: drop redundant shutdown mechanisms (#8136) 2022-03-17 13:30:13 -04:00
Sam KleinmanandGitHub 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 KleinmanandGitHub bedb68078c libs/clist: remove unused surface area (#8134) 2022-03-16 11:57:41 -04:00