Commit Graph

523 Commits

Author SHA1 Message Date
Ethan Buchman 6b8613b3e7 ResponseEndBlock: ensure Address matches PubKey if provided 2018-06-06 16:12:14 -07:00
Ethan Buchman 71556c62eb fixes from rebase 2018-06-05 22:14:37 -07:00
Ethan Buchman 54e61468d4 fixes from review 2018-06-05 22:04:38 -07:00
Ethan Buchman 3d2c4fd309 update Evidence type - requires pubkey and valset to verify and convert to abci.Evidence 2018-06-05 22:04:26 -07:00
Ethan Buchman 866bcceb35 fix consensus tests 2018-06-05 22:00:25 -07:00
Ethan Buchman e1e6878a4d fix state tests 2018-06-05 22:00:25 -07:00
Ethan Buchman e4147b6f1a state test runs 2018-06-05 22:00:25 -07:00
Ethan Buchman 485b4a0c6f revert gogo 2018-06-05 21:59:52 -07:00
Ethan Buchman 575d94dbb9 state compiles 2018-06-05 21:59:52 -07:00
Ethan Buchman 2007c66091 fix test 2018-06-04 21:20:23 -07:00
Ethan Buchman 97c5533c35 update some comments 2018-06-04 21:20:23 -07:00
Ethan Buchman 3d33226e80 move types/services.go to state pkg. pass State to evpool.Update 2018-06-04 21:20:23 -07:00
Ethan Buchman edb851280a state: b -> block 2018-06-04 21:20:23 -07:00
Ethan Buchman dd62f06994 state: s -> state 2018-06-04 21:20:23 -07:00
Ethan Buchman f1c53c7358 evidence: dont send evidence to unsynced peers
* only send evidence to peers that are synced enough to validate it all
* closes #1624
2018-06-04 21:20:23 -07:00
Anton Kaliaev 6004587347
expect all tags to be strings (#1498)
* expect all tags to be strings

Refs #1369

* port changes from https://github.com/tendermint/tmlibs/pull/204

Refs #1369
2018-05-28 14:37:11 +04:00
Anton Kaliaev bb9aa85d22
copy events and pubsub packages from tmlibs
Refs #847
2018-05-21 10:51:47 +04:00
Anton Kaliaev 5e3a23df6d
simplify indexer service main loop 2018-05-17 10:00:59 +04:00
Anton Kaliaev 6f7333fd5f
fix tests 2018-05-17 10:00:59 +04:00
Anton Kaliaev 58e3246ffc
batch index txs 2018-05-17 10:00:59 +04:00
Ethan Buchman c68d406195 fix tests 2018-04-07 19:47:19 +03:00
Ethan Buchman c170800fbd Merge branch 'develop' into jae/aminoify 2018-04-07 16:16:53 +03:00
Jae Kwon e4492afbad Merge 2018-04-05 08:17:10 -07:00
Jae Kwon 89cdde7f1e Fix state tests 2018-04-03 06:50:53 -07:00
Thomas Corbière 2644a529f0 Fix lint errors (#1390)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix package comment with leading space.

* fix receiver names.

* fix error strings.

* remove omittable code.

* remove redundant return statement.

* Revert changes (code is generated.)

* use cfg as receiver name for all config-related types.

* use lsi as the receiver name for the LastSignedInfo type.
2018-04-02 10:21:17 +02:00
Anton Kaliaev 2b63f57b4c fix tx_indexer's matchRange
before we're using IteratePrefix, which is wrong because we want full
range, not just "account.number=1".
2018-03-28 15:02:54 +02:00
Anton Kaliaev 4085c72496 sort /tx_search results by height by default
Refs #1366
2018-03-28 15:02:54 +02:00
Anton Kaliaev 116a4ec705
temporary fix
I assume there is a deeper issue with how UnmarshalBinary works in
go-amino (i.e., when loading array of some objects, the empty array
becomes []object{nil}). Note when Marshaling, the object is nil.
2018-03-23 12:47:02 +01:00
Ethan Buchman 656854186c state: fix txResult issue with UnmarshalBinary into ptr 2018-03-02 02:28:17 -05:00
Ethan Buchman eaafd9d61c state: builds 2018-03-02 01:51:27 -05:00
Zach 2cc63069c6 rename dummy to kvstore (#1223)
* remove accidental binary

* docs: s/Dummy&dummy/KVStore&kvstore/g

* glide update to abci

* update abci import paths

* dummy begone, hello kvstore

* RequestInitChain needs genesisBytes

* glide update
2018-02-27 18:01:10 +04:00
Ethan Buchman f4feb7703b fix appHash log. closes #1207 2018-02-19 15:32:09 -05:00
Anton Kaliaev 106cdb74e5
do not enforce 1/3 validator power change
leave it to the app

Refs #1022
2018-02-09 23:30:04 +04:00
Ethan Buchman d34286c421 minor fixes - tests pass 2018-02-03 03:54:49 -05:00
Anton Kaliaev bb2bdbc0e1 add missing element (tag.Value) to keyForTag
encoded as %s. not sure this will work with raw bytes
2018-02-03 03:52:25 -05:00
Ethan Buchman cd0fd06b0d update for sdk2 libs. need to fix kv test
NOTE we only updating for tmlibs and abci
2018-02-03 03:35:02 -05:00
Ethan Buchman 57cc8ab977
Merge pull request #1143 from tendermint/1091-race-condition
call FlushSync before calling CommitSync
2018-01-24 14:22:43 -05:00
Anton Kaliaev 5f3048bd09
call FlushSync before calling CommitSync
if we call it after, we might receive a "fresh" transaction from
  `broadcast_tx_sync` before old transactions (which were not
  committed).

Refs #1091

```
Commit is called with a lock on the mempool, meaning no calls to CheckTx
can start. However, since CheckTx is called async in the mempool
connection, some CheckTx might have already "sailed", when the lock is
released in the mempool and Commit proceeds.

Then, that spurious CheckTx has not yet "begun" in the ABCI app (stuck
in transport?). Instead, ABCI app manages to start to process the
Commit. Next, the spurious, "sailed" CheckTx happens in the wrong place.
```
2018-01-23 16:56:14 +04:00
Ethan Buchman ee674f919f StopPeerForError in blockchain and consensus 2018-01-21 13:32:04 -05:00
Ethan Buchman 28bbeac763 state: send byzantine validators in BeginBlock 2017-12-29 11:26:55 -05:00
Ethan Buchman 444db4c242 metalinter 2017-12-28 23:15:54 -05:00
Ethan Buchman cb845ebff5 fix EvidencePool and VerifyEvidence 2017-12-28 23:15:54 -05:00
Ethan Buchman 6112578d07 ValidateBlock is a method on blockExec 2017-12-28 23:15:54 -05:00
Ethan Buchman ae68fcb78a move fireEvents to ApplyBlock 2017-12-28 23:15:54 -05:00
Ethan Buchman 1d6f00859d fixes from review 2017-12-28 23:15:54 -05:00
Ethan Buchman 0acca7fe69 final updates for state 2017-12-28 23:15:54 -05:00
Ethan Buchman f82b7e2a13 state: re-order funcs. fix tests 2017-12-28 23:15:54 -05:00
Ethan Buchman 9e6d088757 state: BlockExecutor 2017-12-28 23:15:54 -05:00
Ethan Buchman c915719f85 *State->State; SetBlockAndValidators->NextState 2017-12-28 23:15:54 -05:00
Ethan Buchman f55135578c state: move methods to funcs 2017-12-28 23:15:54 -05:00
Ethan Buchman 6a4fd46479 fixes from rebase 2017-12-26 20:42:34 -05:00
Ethan Buchman 0f293bfc2b remove some TODOs 2017-12-26 20:27:40 -05:00
Ethan Buchman cc418e5dab state.VerifyEvidence enforces EvidenceParams.MaxAge 2017-12-26 20:27:32 -05:00
Ethan Buchman 869d873d5c state.ApplyBlock takes evpool and calls MarkEvidenceAsCommitted 2017-12-26 20:27:32 -05:00
Ethan Buchman 3271634e7a types: evidence cleanup 2017-12-26 20:26:21 -05:00
Ethan Buchman 6c4a0f9363 cleanup evidence pkg. state.VerifyEvidence 2017-12-26 20:26:21 -05:00
Ethan Buchman df3f4de7c3 check evidence is from validator; some cleanup 2017-12-26 20:25:14 -05:00
Ethan Buchman 77e45756f2 types: Evidences for merkle hashing; Evidence.String() 2017-12-26 20:21:17 -05:00
Ethan Buchman 9cdcffbe4b types: comments; compiles; evidence test 2017-12-26 20:21:17 -05:00
Ethan Buchman 35587658cd verify evidence in block 2017-12-26 20:21:17 -05:00
Ethan Buchman 7928659f70 track evidence, include in block 2017-12-26 20:21:17 -05:00
Ethan Buchman bfcb40bf6b validate block.ValidatorsHash 2017-12-26 20:00:45 -05:00
Ethan Buchman 051c2701ab remove LastConsensusParams 2017-12-26 19:56:39 -05:00
Ethan Buchman 028ee58580 call it LastResultsHash 2017-12-26 19:53:26 -05:00
Ethan Buchman 73fb1c3a17 consolidate saveResults/SaveABCIResponses 2017-12-26 19:24:45 -05:00
Ethan Frey d65234ed51 Add /block_results?height=H as rpc endpoint
Expose it in rpc client
Move ABCIResults into tendermint/types from tendermint/state
2017-12-26 19:24:25 -05:00
Ethan Frey 58c5df729b Add ResultHash to header 2017-12-26 19:24:25 -05:00
Ethan Frey 632cc918b4 Save/Load Results for every height
Add some tests.
Behaves like saving validator set, except it always saves at each height
instead of a reference to last changed.
2017-12-26 19:24:25 -05:00
Ethan Frey f870a49f42 Add ABCIResults with Hash and Proof to State
State maintains LastResultsHash
Verify that we can produce unique hashes for each result,
and provide valid proofs from the root hash.
2017-12-26 19:24:25 -05:00
Ethan Buchman 3ea1145486 bring back test 2017-12-26 19:22:15 -05:00
Anton Kaliaev b8215d8ac8
more test cases 2017-12-26 13:30:00 -06:00
Anton Kaliaev 0093f9877a
change voting power change, not number of vals 2017-12-25 17:49:36 -06:00
Anton Kaliaev cf0b5d3715
enforce <1/3 validator updates
Refs #950
2017-12-25 12:10:53 -06:00
Ethan Buchman dc54ba67e4 state: TestValidateBlock 2017-12-21 17:51:03 -05:00
Ethan Buchman 35521b553a save historical consensus params 2017-12-21 17:46:25 -05:00
Ethan Buchman 70a744558c types: params.Update() 2017-12-21 17:00:52 -05:00
Ethan Buchman 3d00c477fc separate block vs state based validation 2017-12-21 16:49:47 -05:00
Anton Kaliaev 0ffd60b8cf
ValidatorSetUpdates -> ValidatorUpdates 2017-12-21 11:52:26 -06:00
Anton Kaliaev 843e1ed400
Updates -> ValidatoSetUpdates 2017-12-19 13:03:39 -06:00
Ethan Buchman 4bca6bf6f5 fix test 2017-12-19 12:30:34 -05:00
Ethan Frey 960b25408f Store LastConsensusHash in State as well
Update all BlockValidation that it matches the last state
2017-12-19 12:28:08 -05:00
Ethan Frey d151e36ea8 Add ConsensusHash to header 2017-12-19 12:28:08 -05:00
Ethan Frey 56cada6a0c Validate ConsensusParams returned from abci app 2017-12-19 12:28:08 -05:00
Ethan Frey 030fd00232 Added tests for applying consensus param changes 2017-12-19 12:28:08 -05:00
Ethan Frey d21f39160f Apply ConsensusParamChanges to state/State 2017-12-19 12:28:08 -05:00
Ethan Frey 4265a94bfe Update EndBlock parameters
* Update abci dependencies
* Modify references from Diffs to Changes
* Fixes issues #924
2017-12-19 12:28:08 -05:00
Anton Kaliaev 7f649ccf23
fixes from Frey's review 2017-12-15 12:21:15 -06:00
Anton Kaliaev 808b830942
add a unit test
Refs #668
2017-12-15 12:13:02 -06:00
Anton Kaliaev d669816a1b
send absent validators in BeginBlock
Refs #668
2017-12-15 12:13:02 -06:00
Ethan Frey dedf03bb81 Add TotalTx to block header, issue #952
Update state to keep track of this info.
Change function args as needed.
Make NumTx also an int64 for consistency.
2017-12-13 12:20:53 +01:00
Zach 12c5a57415
determinisitic linter (#902)
* linter: address gosimple lints

* linter: make deterministic & a rebase fix

* lint/rpc: fix a gosimple lint

* run linter in CI

* fix rebase mistake

* fix makefile

* ugh

* revert Makefile

* add metalinter to CI

* try this

* linter: last little fix

* need glide

* better

* okayy circle, have it your way

* lints: gosimple

* pr comments
2017-12-10 17:44:22 +00:00
Ethan Buchman 9af8da7aad update for new abci int types 2017-12-02 01:47:55 -05:00
Anton Kaliaev 922af7c405
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
2017-12-01 19:04:53 -06:00
Ethan Buchman e9f8e56895 fixes from rebase 2017-12-01 17:25:44 -05:00
Anton Kaliaev b3492356e6 uint64 height (Refs #911) 2017-12-01 17:17:22 -05:00
Anton Kaliaev 6423306980
TestIndexAllTags (unit) 2017-11-30 23:02:40 -06:00
Anton Kaliaev c5b62ce1ee
correct abci version 2017-11-30 20:20:35 -06:00
Anton Kaliaev e538e0e077
config variable to index all tags 2017-11-30 20:02:39 -06:00
Anton Kaliaev 66ad366a4f
test searching for tx with multiple same tags 2017-11-29 20:04:26 -06:00
Anton Kaliaev 864ad8546e
more test cases 2017-11-29 20:04:00 -06:00