Commit Graph

95 Commits

Author SHA1 Message Date
William Banfield
cff2d43d1e move TxsToTxRecords as helper function for state tests 2022-03-15 10:21:56 -04:00
William Banfield
e87cef8dd3 Merge branch 'master' into wb/abci-prepare-proposal-synchronize 2022-03-15 09:54:05 -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
William Banfield
747eb86de8 remove Get prefix 2022-03-14 17:51:54 -04:00
William Banfield
51cf3fe7db rename to MarshalTxResults 2022-03-14 17:32:56 -04:00
William Banfield
9082915626 implement TxRecordSet for dealing with TxRecord validation 2022-03-14 14:52:19 -04:00
William Banfield
ce9b5982bc fix all cases of CreateProposalBlock votes 2022-03-11 17:39:15 -05:00
William Banfield
5849b16dff fix joined lines 2022-03-11 16:41:55 -05:00
William Banfield
232b38100b use block.Txs 2022-03-11 16:41:54 -05:00
William Banfield
dd98161894 thread vote information through for future use by vote extensions 2022-03-11 16:41:49 -05:00
William Banfield
c25f7769a6 remove Must* proof and hash functions 2022-03-09 16:30:08 -05:00
William Banfield
75fb1ce421 MakeBlock no longer returns error 2022-03-08 18:46:00 -05:00
William Banfield
531150819d remove unused method from state.go 2022-03-08 18:25:49 -05:00
William Banfield
245687f6cb cleanup eventbus changes from merge 2022-03-08 17:46:19 -05:00
William Banfield
4f597b4ab6 do not rebuild block if not modified 2022-03-08 17:37:24 -05:00
William Banfield
333b25cfbe remove TODO for prepare proposal 2022-03-08 17:37:23 -05:00
William Banfield
6a085d6077 reorder tx test also removes txs 2022-03-08 17:37:22 -05:00
William Banfield
d102b4881e maxDataBytes remove comment 2022-03-08 17:37:21 -05:00
William Banfield
428efab53f update test comment 2022-03-08 17:37:20 -05:00
William Banfield
378bc12c71 update checktx log statement 2022-03-08 17:37:19 -05:00
William Banfield
8f474fbbdb add logic for ignoring Tx changes if modifiedTx is false 2022-03-08 17:37:18 -05:00
William Banfield
7e75f88780 initial suite of tests 2022-03-08 17:37:17 -05:00
William Banfield
041361da04 add logic to check tx to the mempool if marked added 2022-03-08 17:37:16 -05:00
William Banfield
3ae7382ed0 remove unused 'votes' parameter from CreateProposalBlock 2022-03-08 17:37:16 -05:00
William Banfield
d796d3f103 mempool yakshave: replace old mock entirely 2022-03-08 17:37:13 -05:00
William Banfield
a3d8c7ed18 initial test for prepare proposal 2022-03-08 17:28:01 -05:00
William Banfield
914c555ff5 initial logic to remove txs from the mempool 2022-03-08 17:28:00 -05:00
William Banfield
9fbbdecb65 implement ResponsePrepareProposal validation rules 2022-03-08 17:27:58 -05:00
William Banfield
f52a2858c8 annotate methods with notes from spec 2022-03-08 17:26:57 -05:00
William Banfield
778e2e8908 add tx conversions to get consensus tests to pass 2022-03-08 17:26:56 -05:00
William Banfield
4f890ecff5 MakeBlock no longer returns part set 2022-03-08 17:26:50 -05:00
William Banfield
1d336ea221 limit use of ABCIResponses 2022-03-08 17:25:30 -05:00
William Banfield
b0aa4b0ba8 unimplemented method stubs. compiles 2022-03-08 17:25:26 -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
Sam Kleinman
8df7b6103f proxy: collapse triforcated abci.Client (#8067) 2022-03-06 18:25:50 -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
Sam Kleinman
0167f0d527 node: nodes should fetch state on startup (#8062) 2022-03-04 12:23:57 -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
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
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
yihuang
8a238fdcb4 fix app hash in state rollback (#7837)
When testing rollback feature in the Cosmos SDK, we found that the app hash
in Tendermint after rollback was the value after the latest block, rather than 
before it.

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
2022-02-19 07:40:55 -08:00
Sam Kleinman
c2cce2a696 abci/client: remove client-level callback (#7845)
* abci/client: remove client-level callback

* ditch multi conn con

* fix lint

* fix teset
2022-02-18 14:56:35 +00:00
Sam Kleinman
28d34d635c service: change stop interface (#7816) 2022-02-17 11:23:32 -05:00
Sergio Mena
60f09840dd 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>
2022-02-15 18:16:11 +01:00
Sergio Mena
d3548eb706 Completed the existing FinalizeBlock PR and rebased to master (#7798)
* Rebased and git-squashed the commits in PR #6546

migrate abci to finalizeBlock

work on abci, proxy and mempool

abciresponse, blok events, indexer, some tests

fix some tests

fix errors

fix errors in abci

fix tests amd errors

* Fixes after rebasing PR#6546

* Restored height to RequestFinalizeBlock & other

* Fixed more UTs

* Fixed kvstore

* More UT fixes

* last TC fixed

* make format

* Update internal/consensus/mempool_test.go

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

* Addressed @williambanfield's comments

* Fixed UTs

* Addressed last comments from @williambanfield

* make format

Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
2022-02-14 23:41:28 +01:00
M. J. Fromberger
7e09c2ef43 Clean up temp files more thoroughly after testing. (#7815)
Our test cases spew a lot of files and directories around $TMPDIR.  Make more
thorough use of the testing package's TempDir methods to ensure these are
cleaned up.

In a few cases, this required plumbing test contexts through existing helper
code. In a couple places an explicit path was required, to work around cases
where we do global setup during a TestMain function. Those cases probably
deserve more thorough cleansing (preferably with fire), but for now I have just
worked around it to keep focused on the cleanup.
2022-02-14 06:32:07 -08:00
M. J. Fromberger
73f605af3f indexer: skip Docker tests when Docker is not available (#7814)
To simplify local testing, do not report failures for tests that require Docker
when Docker is not avaliable. Instead, log a warning and skip the tests.
This has no effect in CI, where Docker is installed.
2022-02-14 01:46:16 -08:00
Sergio Mena
27297a447c Rebased to master the existing ProcessProposal PR (#7752)
* Rebased and git-squashed the commits in PR #7091

  - add processproposal proto/boilerplate/logic

  - mockery

  - gofmt

  - fix test

  - gofmt

  - move UNKNOWN response behaviour to reject

* Fixed build of some UTs

* Addressed William's comment on context

* Adapted TestProcessProposal

* BaseApp needs to ACCEPT vote extensions by default

* Added missing ProcessProposal to socket_server.go

* Re-renamed TwoThirdPrevote... to Valid...

* Addressed William's comment on ProcessProposal error

* Addressed Callum's comments

* fmt

Co-authored-by: mconcat <monoidconcat@gmail.com>
2022-02-08 17:32:17 +01:00
Jasmina Malicevic
cd875c8a2c types: remove nested evidence field from block (#7765)
* types: replaced EvidenceData in block structure with EvidenceList

* types: introduced toProto, fromProto functions to EvidenceList

* updated Changelog

* Removed comments from tests
2022-02-07 13:57:52 +01:00
Sergio Mena
854fd07461 Fixing handling of contexts in the ABCI++ rebased branch (#7768)
* Fixing context

* Removed logger change

* Fixing UTs

* Bump
2022-02-04 15:55:35 +01:00