Commit Graph

71 Commits

Author SHA1 Message Date
Callum Waters
f861062ee2 abci: implement process proposal to spec (#9122) 2022-08-09 15:15:18 +02:00
Sergio Mena
b2409b3345 Follow-up fixes to main PrepareProposal implementation (#9162)
* -----start------

* [cherrypicked] 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>

* [cherrypicked] abci++: remove CheckTx call from PrepareProposal flow (#8176)

* [cherrypicked] abci++: correct max-size check to only operate on added and unmodified (#8242)

* [cherrypicked] 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>

* make proto-gen

* Fixed testcase on PrepareProposal error

* mockery

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-08-03 19:39:17 +02:00
Sergio Mena
d268e56383 Sync PrepareProposal with Spec. Main part (#9158)
* ----start----

* [PARTIAL cherry-pick] ABCI Vote Extension 2 (#6885)

* Cherry-picked #6567: state/types: refactor makeBlock, makeBlocks and makeTxs (#6567)

* [Cherrypicked] types: remove panic from block methods (#7501)

* [cherrypicked] 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.

* make proto-gen

* Backported EvidenceList's method ToABCI from #7961

* make build

* Fix mockery for Mempool

* mockery

* Backported abci Application mocks from #7961

* mockery2

* Fixed new PrepareProposal test cases in state/execution_test.go

* Fixed returned errors in consensus/state.go

* lint

* Addressed @cmwaters' comment

Co-authored-by: mconcat <monoidconcat@gmail.com>
Co-authored-by: JayT106 <JayT106@users.noreply.github.com>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
2022-08-03 17:24:24 +02:00
Sergio Mena
2164883501 Old PrepareProposal and vote extension integration on feature/abci++ppp (#9117)
* abci: PrepareProposal-VoteExtension integration [2nd try] (#7821)

* PrepareProposal-VoteExtension integration (#6915)

* make proto-gen

* Fix protobuf crash in e2e nightly tests

* Update types/vote.go

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

* Addressed @creachadair's comments

Co-authored-by: mconcat <monoidconcat@gmail.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Proto changes

* make proto-gen

* Fixed UTs

* bump

* lint

* lint2

* lint3

* lint4

* lint5

* lint6

* no_lint

Co-authored-by: mconcat <monoidconcat@gmail.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-08-03 13:29:15 +02:00
Sergio Mena
58effdd8b3 Old PrepareProposal on feature/abci++ppp (#9106)
* [Rebased to v0.34.x] abci: PrepareProposal (#6544)

* fixed cherry-pick

* proto changes

* make proto-gen

* UT fixes

* generate Client directive

* mockery

* App fixes

* Disable 'modified tx' hack

* mockery

* Make format

* Fix lint

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-07-27 15:09:02 +02:00
Aleksandr Bezobchuk
6b7d30cf37 feat: v0.34.x Prioritized Mempool (#8695)
* Updated mocks

* add reactor tests

* add v1 reactor tests

* Fix fuzz test for priority mempool

* e2e adapted to mempool v1; prio pool is default now

* Reverted default mempool to be fifo

* Changed buf version

* Added priority mempool to ci testnet

* Fixed linter

* Updated makefile

* Aligned makefile changes to v0.34.x

* Added go install for proto

* Add log message to warn about prioritized mempool bug

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

* Changelog message

Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Co-authored-by: Sam Kleinman <garen@tychoish.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
2022-06-27 11:34:28 +02:00
Jasmina Malicevic
a3cc3d98b9 makefile: change buf to use tools.go ; backport v0.34 (#8852)
* makefile: update buf commands to use tools.go (#8609)

This will keep the version of `buf` consistent between all developer machines.
2022-06-23 16:47:44 +02:00
mergify[bot]
11523b1302 note: add nondeterministic note to events (#6220) (#6225)
## Description

Since events are not hashed into the header they can be non deterministic. Changing an event is not consensus breaking. Will update docs in the spec

(cherry picked from commit 884d4d5252)

Co-authored-by: Marko <marbar3778@yahoo.com>
2021-03-09 16:39:19 +04:00
Marko
54338a52fa proto: bump gogoproto (1.3.2) (#5886)
- bump gogoproto (1.3.2)
- regenerate proto files

Closes: #XXX
2021-01-19 12:41:35 +01:00
Callum Waters
9d354c842e evidence: structs can independently form abci evidence (#5610) 2020-11-05 10:38:42 +01:00
Marko
ad4f54e9b2 privval: make response values non nullable (#5583)
make response values non nullable in privval

Does this need a changelog for master?

Closes: #5581

cc @tarcieri
2020-10-28 16:44:30 +01:00
Marko
6f908eb814 crypto: add in secp256k1 support (#5500)
Secp256k1 was removed in the protobuf migration, this pr adds it back in order to provide this functionality for users (band)

Closes: #5495
2020-10-19 10:07:51 +02:00
Marko
09982ae407 backport block size fixes (#5492)
* mempool: length prefix txs when getting them from mempool (#5483)

* correctly calculate evidence data size (#5482)

* block: use commit sig size instead of vote size (#5490)

* tx: reduce function to one parameter (#5493)
2020-10-13 18:07:54 +02:00
Callum Waters
7d5d417dc9 evidence: use bytes instead of quantity to limit size (#5449)(#5476) 2020-10-08 14:38:11 +02:00
Anton Kaliaev
ffe2742a6c mempool: batch txs per peer in broadcastTxRoutine (#5321)
Closes #625
2020-09-23 14:13:13 +04:00
Marko
0aecda68fc ux: use docker to format proto files (#5384)
## Description

Add a cmd to docker image and use it to format our proto files. This avoids developers the need to install clang-format

Closes: #XXX
2020-09-22 21:42:55 +00:00
Callum Waters
ed002cea7e evidence: introduction of LightClientAttackEvidence and refactor of evidence lifecycle (#5361)
evidence: modify evidence types (#5342)

light: detect light client attacks (#5344)

evidence: refactor evidence pool (#5345)

abci: application evidence prepared by evidence pool (#5354)
2020-09-22 10:22:54 +02:00
Callum Waters
c752e2e586 abci: update evidence (#5324) 2020-09-02 18:17:59 +02:00
Marko
710a97d850 evidence: remove amnesia & POLC (#5319)
## Description

remove unneeded types 

![](https://media1.giphy.com/media/fSAyceY3BCgtiQGnJs/giphy.gif)

ref #5288
2020-09-02 13:05:15 +00:00
Marko
82011ee7ab evidence: remove lunatic (#5318)
## Description

remove lunaticEvidence
2020-09-01 16:56:26 +00:00
Marko
e0140e4beb evidence: remove ConflictingHeaders type (#5317)
## Description

Remove ConflictingHeaders & compositeEvidence types


Ref #5288
2020-09-01 16:34:37 +00:00
Callum Waters
2b58a62721 light: implement light block (#5298) 2020-09-01 17:45:55 +02:00
Marko
e8eef85619 crypto: remove proto privatekey (#5301)
## Description

This type was used for json but was never removed once we migrated to tmjson. 


Closes: #XXX
2020-08-28 09:51:26 +00:00
Marko
8cdaa7f515 privval: add chainID to requests (#5239)
## Description

Add chainid to requests to privval. This is a non-breaking change and hardware devices can opt to ignore the field.
 
Closes: #4503 

Took the approach of passing chainID to the client instead of modifying `GetPubKey` because it would lead to a larger change throughout the codebase and in some places it could get tricky to get chainID.
2020-08-17 09:07:15 +00:00
Erik Grinaker
cc247c091b genesis: add support for arbitrary initial height (#5191)
Adds a genesis parameter `initial_height` which specifies the initial block height, as well as ABCI `RequestInitChain.InitialHeight` to pass it to the ABCI application, and `State.InitialHeight` to keep track of the initial height throughout the code. Fixes #2543, based on [RFC-002](https://github.com/tendermint/spec/pull/119). Spec changes in https://github.com/tendermint/spec/pull/135.
2020-08-11 17:03:28 +00:00
Erik Grinaker
08ffe13295 abci: add ResponseInitChain.app_hash, check and record it (#5227)
Fixes #5177.
2020-08-11 14:28:11 +00:00
Marko
40bd416d59 test: protobuf vectors for reactors (#5221)
## Description

Add test vectors for all reactors

- [x] state-sync
- [x] privval
- [x] mempool
- [x] p2p
- [x] evidence
- [ ] light?

this PR is primarily oriented at testvectors for things going over the wire. should we expand the testvectors into types as well?

Closes: #XXX
2020-08-11 14:00:11 +00:00
Callum Waters
312c4f8fe1 evidence: change evidence time to block time (#5219)
adds blockstore interface to evidence and adds fix to byzantine test
2020-08-11 14:39:07 +02:00
Callum Waters
68468fb024 evidence: fix usage of time field in abci evidence (#5201)
* fix usage of time in abci evidence

* update changelong and upgrading

* add test cases
2020-08-04 12:58:48 +02:00
Callum Waters
3c21c3546c evidence: remove phantom validator evidence (#5181) 2020-07-31 12:23:58 +02:00
Anton Kaliaev
b5f030892d docs: document ConsensusParams (#5165)
Closes #2836
2020-07-29 11:24:01 +00:00
Anton Kaliaev
a29fd7c699 proto: add a comment for Validator#Address (#5144)
Refs #3732
2020-07-28 12:04:44 +00:00
Marko
909163afa8 rpc: make gasWanted/Used snake_case (#5137)
## Description

THis pr adds `json_name` to replace proto generated json tags. 

Closes: #5111
2020-07-20 13:10:09 +00:00
Anton Kaliaev
8cdb53c811 docs: EventAttribute#Index is not deterministic (#5132)
Closes #5125
2020-07-19 09:36:01 +00:00
Anton Kaliaev
0825d57cf7 proto/tendermint/abci: fix Request oneof numbers (#5116)
- the sequence does not start with 1
- RequestDeliverTx has out-of-order field number

Closes #5115
2020-07-14 08:24:08 +00:00
Anton Kaliaev
730e16566e proto: change type + a cleanup (#5107)
- drop Height & Base from StatusRequest
It does not make sense nor it's used anywhere currently. Also, there
seem to be no trace of these fields in the ADR-40 (blockchain reactor
v2).

- change PacketMsg#EOF type from int32 to bool
2020-07-13 10:24:17 +00:00
Erik Grinaker
0b1722d78e proto: minor cleanups (#5105)
Removes the unused `NetAddress.str` field, and fixes some comments.
2020-07-09 12:36:39 +00:00
Erik Grinaker
66ed8ec39d proto: reorganize Protobuf schemas (#5102)
Reorganizes the Protobuf schemas. It is mostly bikeshedding, so if something is contentious or causes a lot of extra work then I'm fine with reverting. Some Protobuf and Go import paths will change.

* Move `abci/types/types.proto` to `abci/types.proto`.

* Move `crypto/keys/types.proto` and `crypto/merkle/types.proto` to `crypto/keys.proto` and `crypto/proof.proto`.

* Drop the use of `msgs` in filenames, as "message" is a very overloaded term (all Protobuf types are messages, and we also have `message Message`). Use `types.proto` as a catch-all, and otherwise name files by conceptual grouping instead of message kind.
2020-07-08 15:47:01 +00:00
Erik Grinaker
59a17b28a7 proto: improve enums (#5099)
Fixes some minor issues with Protobuf enums, not likely to break anything.

Branched off of #5096, rebase to `master` before merging.
2020-07-08 13:49:50 +00:00
Erik Grinaker
ab20f3520f proto: increase lint level to basic and fix lint warnings (#5096)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-08 13:27:09 +00:00
Anton Kaliaev
6e434338ec abci/types: add comment for TotalVotingPower (#5081)
Refs #4581
2020-07-03 10:24:12 +00:00
Marko
92a361b1e3 mempool: use oneof (#5063)
## Description

To provide the ability to add more message types without needing to cause a breaking change the mempool message was migrated to a oneof.


Closes: #XXX
2020-06-30 09:35:27 +00:00
Callum Waters
3ecc0ffe7e evidence: replace mock evidence with mocked duplicate vote evidence (#5036) 2020-06-24 07:24:30 +02:00
Anton Kaliaev
ceac02b891 types: add AppVersion to ConsensusParams (#5031)
Co-authored-by: JamesRay <66258875@qq.com>

making it possible to change app version via EndBlock
2020-06-23 12:14:16 +04:00
Marko
73e22a3c5a abci: proto files follow same path (#5039)
## Description

have the defined abci proto types follow the same directory structure as in abci folder.

Closes: #XXX
2020-06-23 05:38:50 +00:00
Marko
dedf0d2350 proto: folder structure adhere to buf (#5025) 2020-06-22 10:00:51 +02:00
Marko
51da4fe356 types: rename partsheader to partsetheader (#5029)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-22 09:38:03 +02:00
Marko
dc87c09d93 cov: ignore autogen file (#5033)
## Description

ignore autogen file codecov 


Closes: #XXX
2020-06-19 12:53:29 +00:00
Marko
a12bfca93d proto: move all proto dirs to /proto (#5012)
## Description

This PR moves all proto files under one dir (`/proto`). The script to generate adding functionality to copy the files that still need to be in the same place. (abci & rpc)

renames every proto package from `tendermint.proto.<pkg_name>` to `tendermint.<pkg_name>`

Removes unneeded types in privval proto directory

Closes: #XXX
2020-06-16 14:41:36 +00:00
Ismail Khoffi
4774a8ec61 non breaking signbytes (#5008)
* test-vectors for backwards compatibility:

 - copy & paste test-vectors from v0.33.5 to ensure
 backwards compatibility for vote's SignBytes

* WIP: everything besides time seems to match :-/

* almost

* Found the culprit: field nums weren't consecutive ints ...

* fix order of partset header too

* this last votes-related test can easily be fixed

* some minor changes and fix last failing test

* move proto types back to stdtime, fix various linting

* use libs/protoio

* remvoe commented code

* add comments

* fix tests

* uncomment testscases

* dont ignore error panic

* fix signable test

* fix happy path testing

* fix comment

Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
2020-06-15 21:54:58 +02:00