Commit Graph

426 Commits

Author SHA1 Message Date
Thane Thomson
6389f2ff0c Embed CommitSig into ExtendedCommitSig instead of duplicating fields
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 12:30:42 -04:00
Thane Thomson
739e60e309 Fix comment grammar
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 10:40:07 -04:00
Thane Thomson
521734934d There are no extended commits below the initial height
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 10:35:14 -04:00
Thane Thomson
08bf156462 Remove CommigSig.Absent helper
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 10:13:57 -04:00
Thane Thomson
accba4774d Remove CommigSig.ForBlock helper
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 10:11:01 -04:00
Thane Thomson
630ec2591d Remove debug log
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 09:59:45 -04:00
Thane Thomson
0dd7ce3aa4 Rename local var for clarity
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 09:44:06 -04:00
Thane Thomson
408cc4c5b5 Rename local var for clarity
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 09:44:05 -04:00
Thane Thomson
a20a485dbe Propagate validator info to PrepareProposal
In order to propagate validator voting power through to PrepareProposal,
we need to load the validator set info from the height corresponding to
the extended commit that we're passing through to PrepareProposal as the
"LocalLastCommit".

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-07 09:44:05 -04:00
Thane Thomson
6a69e88b48 store/state: Add TODO to move prefixes to common package
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-05 08:34:01 -04:00
Thane Thomson
0a31afe4c6 types: Convert ExtendedCommit.Copy to a deep clone
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 17:38:34 -04:00
Thane Thomson
59434d8513 types: Remove NewCommit constructor
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 17:33:31 -04:00
Thane Thomson
b5a94bba16 types: Remove NewExtendedCommit constructor
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 17:18:41 -04:00
Thane Thomson
9fcab6000a state: Rename LoadBlockExtCommit to LoadBlockExtendedCommit
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 14:05:01 -04:00
Thane Thomson
0e8fc8e0b0 evidence/pool_test: Inline slice construction
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 13:59:25 -04:00
Thane Thomson
1667ed25ea consensus: Allocate TODO to Sergio
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 13:58:20 -04:00
Thane Thomson
fce052d710 consensus: Rename short-lived local variable
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 13:50:07 -04:00
Thane Thomson
86f942ac0f blocksync: Return error without also logging it
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 13:46:22 -04:00
Thane Thomson
a8adf63287 blocksync: Expand on extended commit requirement in AddBlock description
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 13:45:08 -04:00
Thane Thomson
dd5c23de7d blocksync: Change pool AddBlock function signature to return errors
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 11:36:03 -04:00
Thane Thomson
421a12bfce make format
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 10:30:05 -04:00
Thane Thomson
1378900e86 blocksync: Just return error
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-04 10:29:54 -04:00
Thane Thomson
51f87b6074 Apply suggestions from code review
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: Sergio Mena <sergio@informal.systems>
2022-05-04 08:31:27 -04:00
Thane Thomson
6396abd49f Remove global state from store tests
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 17:26:18 -04:00
Thane Thomson
e503d746a8 Fix TestBlockFetchAtHeight
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 16:54:08 -04:00
Thane Thomson
ce70167add Fix store prefix collision
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 11:52:48 -04:00
Thane Thomson
656d2d01be Fix most tests except TestHandshake*
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 10:59:37 -04:00
Thane Thomson
5c81f7a568 Make panic output from BlockStore.SaveBlock more readable
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 10:50:39 -04:00
Thane Thomson
583d5fc3ce make mockery
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-05-03 07:39:15 -04:00
Thane Thomson
61d5837ba2 Merge branch 'master' into thane/8272-propagate-vote-extensions 2022-05-03 07:38:53 -04:00
Sam Kleinman
37287ead94 p2p: remove message type from channel implementation (#8452) 2022-05-02 10:52:57 -04:00
Thane Thomson
91d076a6cc Merge changes from master and resolve conflicts
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-30 14:37:13 -04: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
Thane Thomson
fba6848f6c Isolate TODO more clearly
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-29 17:51:01 -04:00
Thane Thomson
dc6a208f1d Expand on comment for PeekTwoBlocks for posterity
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-29 17:49:35 -04:00
Sam Kleinman
cf2a00b398 p2p: avoid using p2p.Channel internals (#8444) 2022-04-29 17:21:36 -04:00
Thane Thomson
82dd779e93 Lift termination condition into for loop
Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-29 14:43:49 -04:00
Thane Thomson
bb4a1c7645 Merge branch 'master' into thane/8272-propagate-vote-extensions 2022-04-29 14:43:42 -04:00
Sam Kleinman
eee19e42db consensus: reduce size of validator set changes test (#8442) 2022-04-29 10:29:26 -04:00
Thane Thomson
49a6b2f88f Merge branch 'master' into thane/8272-propagate-vote-extensions 2022-04-29 08:08:14 -04:00
Sam Kleinman
3d448e1ef8 crypto: cleanup tmhash package (#8434) 2022-04-28 22:21:43 -04:00
Sergio Mena
9cd356db8d Fix exit condition in blocksync 2022-04-28 17:54:52 -04:00
Sergio Mena
f18f1cb3db BlockStore holds extended commit
Cherry-pick 8d504d4b50ec6afbdffe2df7ababbef30e15053d and fix conflicts.

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-28 17:12:20 -04: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
Sam Kleinman
2a58ea3ab2 p2p: use nodeinfo less often (#8427) 2022-04-27 21:13:38 +00: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
Sam Kleinman
2e5d53ea9a abci: interface should take pointers to arguments (#8404) 2022-04-24 18:37:07 +00: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
b5e6cf50d1 abci: Application should return errors errors and nilable response objects (#8396) 2022-04-22 20:40:42 -04:00