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
Anton Kaliaev
1339a44402
add safe*Clip funcs
2017-12-26 14:13:12 -06:00
Ethan Buchman
6c39c77fc5
Merge pull request #996 from ricardohsd/types-add-tests-to-vote
...
Add more tests to types/vote.go
2017-12-26 10:32:07 -05:00
Anton Kaliaev
69c3a7640b
add safeAdd & safeSub plus quickcheck tests
2017-12-25 18:39:14 -06:00
Anton Kaliaev
e8b0458f16
check for overflow and underflow while choosing proposer
...
Refs #919
2017-12-25 18:39:14 -06:00
Ethan Buchman
c2436c46e6
Merge pull request #972 from tendermint/feature/enhance-endblock
...
Update EndBlock parameters
2017-12-22 01:30:58 -05:00
Ethan Buchman
91acc51cd1
fix test
2017-12-21 17:52:06 -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
b5857da877
forgot file
2017-12-21 16:49:47 -05:00
Ethan Buchman
3d00c477fc
separate block vs state based validation
2017-12-21 16:49:47 -05:00
Ethan Buchman
f81025631e
update comment [ci skip]
2017-12-21 16:28:05 -05:00
Ethan Buchman
9c03c58de2
priv validator checks if only difference is timestamp; else error
2017-12-21 15:37:27 -05:00
Anton Kaliaev
0ffd60b8cf
ValidatorSetUpdates -> ValidatorUpdates
2017-12-21 11:52:26 -06:00
Ricardo Domingos
d5baa6601c
types: Add test for IsVoteTypeValid
2017-12-21 18:13:31 +01:00
Ricardo Domingos
19eeef0aad
types: Rename exampleVote to examplePrecommit on vote_test
...
exampleVote doesn't express the type of the vote.
2017-12-21 18:13:31 +01:00
Ricardo Domingos
e76392e330
types: Update String() test to assert Prevote type
2017-12-20 23:21:30 +01:00
Anton Kaliaev
a1cc9ac642
priv validator returns last sign bytes if h/r/s matches
...
since now we have time in the msgs and we might crash between writing
the priv val and writing to wal.
Refs #984
2017-12-20 14:41:43 -06:00
Anton Kaliaev
843e1ed400
Updates -> ValidatoSetUpdates
2017-12-19 13:03:39 -06: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
a0b2d77bef
Add hash to ConsensusParams
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
Anton Kaliaev
72da553ed9
add missing Timestamp to Vote
...
Fixes #974
2017-12-13 22:24:06 -06:00
Anton Kaliaev
b78606d94f
Merge pull request #967 from tendermint/feature/total-tx
...
Add TotalTx to block header
2017-12-13 17:09:48 -06:00
Ethan Frey
a6f719a402
Add tests for block validation
2017-12-13 19:54:16 +01: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
Ethan Frey
5ffb5f01cc
Add more tests for Proposal/Vote serialization
...
String() and Proposal valid after serializing.
To be safe, but mainly to increase test coverage for the PR
2017-12-12 12:59:51 +01:00
Ethan Frey
8576ad58bd
Cleanup canonical json
2017-12-12 12:59:51 +01:00
Ethan Frey
c4860f6c29
Force CanonicalTime to UTC
...
fixes issue with vote serialization breaking the signatures
2017-12-12 12:59:51 +01:00
Ethan Frey
850310b034
Add test to isolate precommit failure
...
types/vote_test.go now checks signature on a serialized and
then deserialized vote. Turns out go-wire time encoding doesn't
respect timezones, and the signatures don't check out.
2017-12-12 12:59:51 +01:00
Ethan Frey
a29c781295
Add default timestamp to all instances of *types.Vote
2017-12-12 12:59:51 +01:00
Ethan Frey
599673690c
Add timestamp to vote canonical encoding
2017-12-12 12:59:51 +01:00
Ethan Frey
7deda53b7c
Add Timestamp to Proposal for issue #929
...
Store it as time.Timestamp locally, encode it as RFC3339 with milliseconds
before signing the canonical form.
2017-12-12 12:59:51 +01:00
Anton Kaliaev
950a64f756
bring back transparent websocket (Refs #945 )
2017-12-10 01:18:10 -06:00
Ethan Buchman
898ae53672
types: fix for broken customtype int in gogo
2017-12-02 12:00:46 -05:00
Ethan Buchman
388f66c9b3
types: drop uint64 from protobuf.go
2017-12-02 01:07:17 -05:00
Anton Kaliaev
10f7858453
use rand.Int63n, remove underflow check, remove unnecessary cast
2017-12-01 19:22:18 -06: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
Anton Kaliaev
86af889dfb
remove unnecessary casts (Refs #911 )
2017-12-01 17:17:22 -05:00
Anton Kaliaev
b3492356e6
uint64 height (Refs #911 )
2017-12-01 17:17:22 -05:00
Anton Kaliaev
91f2184003
fixes after bucky's review
2017-11-29 14:24:18 -06:00
Anton Kaliaev
ea0b205455
searching transaction results
2017-11-29 14:24:18 -06:00
Anton Kaliaev
16cf7a5e0a
use a switch when validating tags
2017-11-29 14:23:44 -06:00
Anton Kaliaev
56abea7427
rename tm.events.type to just tm.event
2017-11-29 14:23:44 -06:00
Anton Kaliaev
29cd1a1b8f
rewrite indexer to be a listener of eventBus
2017-11-29 14:23:44 -06:00
Anton Kaliaev
acae38ab9e
validate tags
2017-11-29 14:23:43 -06:00
Anton Kaliaev
a52cdbfe43
extract tags from DeliverTx/Result
...
and send them along with predefined
2017-11-29 14:23:43 -06:00
Ethan Buchman
9529f12c28
more linting
2017-11-27 22:39:12 +00:00
Zach Ramsay
414a8cb0ba
pass tests!
2017-11-27 22:39:12 +00:00
Zach Ramsay
c84c7250ba
linting: few more fixes
2017-11-27 22:39:12 +00:00
Zach Ramsay
478a10aa41
Write doesn't need error checked
2017-11-27 22:39:12 +00:00
Zach Ramsay
7ad8a8ab55
Tests almost passing
2017-11-27 22:39:12 +00:00
Zach Ramsay
d7cb291fb2
errcheck; sort some stuff out
2017-11-27 22:39:11 +00:00
Zach Ramsay
68e7983c70
linting errors: afew more
2017-11-27 22:39:11 +00:00
Zach Ramsay
8f0237610e
linting errors: clean it all up
2017-11-27 22:39:11 +00:00
Zach Ramsay
b75d4f73e7
errcheck: PR comment fixes
2017-11-27 22:39:11 +00:00
Zach Ramsay
57ea4987f7
linting: apply errcheck part1
2017-11-27 22:39:11 +00:00
Zach Ramsay
1721543e5c
linting: apply misspell
2017-11-27 22:39:11 +00:00
Zach Ramsay
46ccbcbff6
linting: apply 'gofmt -s -w' throughout
2017-11-27 22:39:11 +00:00
Ethan Buchman
c0e2649ed6
Merge pull request #788 from tendermint/feature/548-indexing-tags
...
new pubsub package
2017-11-08 01:02:48 +00:00
Anton Kaliaev
fcdd30b2d3
fixes from Bucky's review 2
2017-11-02 13:20:05 -05:00
Ethan Buchman
5466720d75
minor changes from @odeke-em PR #725
2017-10-31 15:32:07 -04:00
Ethan Buchman
d71aed309f
some minor changes
2017-10-30 22:52:03 -04:00
Anton Kaliaev
61d76a273f
fixes from Bucky's and Emmanuel's reviews
2017-10-30 11:12:01 -05:00
Anton Kaliaev
f6539737de
new pubsub package
...
comment out failing consensus tests for now
rewrite rpc httpclient to use new pubsub package
import pubsub as tmpubsub, query as tmquery
make event IDs constants
EventKey -> EventTypeKey
rename EventsPubsub to PubSub
mempool does not use pubsub
rename eventsSub to pubsub
new subscribe API
fix channel size issues and consensus tests bugs
refactor rpc client
add missing discardFromChan method
add mutex
rename pubsub to eventBus
remove IsRunning from WSRPCConnection interface (not needed)
add a comment in broadcastNewRoundStepsAndVotes
rename registerEventCallbacks to broadcastNewRoundStepsAndVotes
See https://dave.cheney.net/2014/03/19/channel-axioms
stop eventBuses after reactor tests
remove unnecessary Unsubscribe
return subscribe helper function
move discardFromChan to where it is used
subscribe now returns an err
this gives us ability to refuse to subscribe if pubsub is at its max
capacity.
use context for control overflow
cache queries
handle err when subscribing in replay_test
rename testClientID to testSubscriber
extract var
set channel buffer capacity to 1 in replay_file
fix byzantine_test
unsubscribe from single event, not all events
refactor httpclient to return events to appropriate channels
return failing testReplayCrashBeforeWriteVote test
fix TestValidatorSetChanges
refactor code a bit
fix testReplayCrashBeforeWriteVote
add comment
fix TestValidatorSetChanges
fixes from Bucky's review
update comment [ci skip]
test TxEventBuffer
update changelog
fix TestValidatorSetChanges (2nd attempt)
only do wg.Done when no errors
benchmark event bus
create pubsub server inside NewEventBus
only expose config params (later if needed)
set buffer capacity to 0 so we are not testing cache
new tx event format: key = "Tx" plus a tag {"tx.hash": XYZ}
This should allow to subscribe to all transactions! or a specific one
using a query: "tm.events.type = Tx and tx.hash = '013ABF99434...'"
use TimeoutCommit instead of afterPublishEventNewBlockTimeout
TimeoutCommit is the time a node waits after committing a block, before
it goes into the next height. So it will finish everything from the last
block, but then wait a bit. The idea is this gives it time to hear more
votes from other validators, to strengthen the commit it includes in the
next block. But it also gives it time to hear about new transactions.
waitForBlockWithUpdatedVals
rewrite WAL crash tests
Task:
test that we can recover from any WAL crash.
Solution:
the old tests were relying on event hub being run in the same thread (we
were injecting the private validator's last signature).
when considering a rewrite, we considered two possible solutions: write
a "fuzzy" testing system where WAL is crashing upon receiving a new
message, or inject failures and trigger them in tests using something
like https://github.com/coreos/gofail .
remove sleep
no cs.Lock around wal.Save
test different cases (empty block, non-empty block, ...)
comments
add comments
test 4 cases: empty block, non-empty block, non-empty block with smaller part size, many blocks
fixes as per Bucky's last review
reset subscriptions on UnsubscribeAll
use a simple counter to track message for which we panicked
also, set a smaller part size for all test cases
2017-10-30 00:32:22 -05:00
Ethan Buchman
1ecd580061
Merge pull request #773 from tendermint/docs-staging
...
docs improvements
2017-10-27 16:18:56 -04:00
Ethan Buchman
e76ef2a8a1
types: unexpose valset.To/FromBytes
2017-10-26 00:27:02 -04:00
Ethan Frey
f653ba63bf
Separated out certifiers.Commit from rpc structs
2017-10-25 16:43:18 +02:00
Ethan Frey
94b36bb65e
Move VerifyCommitAny into the types package
2017-10-25 16:13:04 +02:00
Zach Ramsay
62e8ec34d1
fix comment, #723
2017-10-23 19:51:09 -04:00
Ethan Buchman
87cc277b38
Merge pull request #721 from tendermint/564-add-app-options-to-genesis-resp
...
Add app_options to GenesisDoc
2017-10-23 16:03:45 -04:00
Ethan Buchman
a75bccfbc4
Merge branch 'develop' into 564-add-app-options-to-genesis-resp
2017-10-23 11:30:00 -04:00
Ethan Buchman
f97229f05a
Merge pull request #748 from tendermint/params-test
...
types: ConsensusParams test + document the ranges/limits
2017-10-23 11:18:00 -04:00
Adrian Brink
036d3b59a3
Address reviews
2017-10-23 11:04:45 -04:00
Adrian Brink
782a836db0
Cleanup of code and code docs
...
This cleans up some of the code in the state package
2017-10-23 11:04:45 -04:00
Emmanuel Odeke
f24f03906f
types: ConsensusParams: add feedback from @ebuchman and @melekes
2017-10-20 00:11:30 -06:00
Emmanuel Odeke
bff069f83c
types: ConsensusParams test + document the ranges/limits
...
Fixes https://github.com/tendermint/tendermint/issues/747
Updates https://github.com/tendermint/tendermint/issues/693
* Document the unmentioned limits for ConsensusParams.Validate()
* Make the limit for ConsensusParams.BlockSizeParams.MaxBytes
clear at 100MiB
2017-10-16 16:57:44 -06:00
Anton Kaliaev
616b07ff6b
make AppOptions an interface{}
2017-10-16 10:58:52 +04:00
Anton Kaliaev
321061125f
add app_options to GenesisDoc (Refs #564 )
2017-10-16 10:58:52 +04:00
Emmanuel Odeke
6fc82f3824
types/heartbeat: test all Heartbeat functions
...
Updates https://github.com/tendermint/tendermint/issues/693
* Adjusted Heartbeat.Copy to return nil on
trying to copy a nil value instead of panicking.
* Also documented that WriteSignBytes panics
if the Heartbeat is nil.
2017-10-05 21:24:36 -06:00
Zach Ramsay
d56b44f3a5
all: no more anonymous imports
2017-10-04 16:40:45 -04:00
Ethan Buchman
97e9802255
fix out of range error in VoteSet.addVote
2017-10-02 23:34:06 -04:00
Ethan Buchman
d1a00c684e
types: comments
2017-09-22 12:00:37 -04:00
Ethan Buchman
24f7b9387a
more tests
2017-09-22 00:05:39 -04:00
Ethan Buchman
756818f940
fixes from review
2017-09-21 21:44:36 -04:00
Ethan Buchman
2131f8d330
some fixes from review
2017-09-21 17:21:20 -04:00
Ethan Buchman
8ae2ffda89
put funcs back in order to simplify review
2017-09-21 16:59:25 -04:00
Ethan Buchman
75b97a5a65
PrivValidatorFS is like old PrivValidator, for now
2017-09-21 16:46:31 -04:00
Ethan Buchman
7b99039c34
make signBytesHRS a method on LastSignedInfo
2017-09-21 15:54:33 -04:00
Ethan Buchman
3ca7b10ad4
types: more . -> cmn
2017-09-21 15:54:33 -04:00
Ethan Buchman
4382c8d28b
fix tests
2017-09-21 15:52:25 -04:00
Ethan Buchman
944ebccfe9
more PrivValidator interface
2017-09-21 15:51:20 -04:00
Ethan Buchman
fd1b0b997a
PrivValidator interface
2017-09-21 15:51:20 -04:00
Ethan Buchman
abe912c610
FuncSignerAndApp allows custom signer and abci app
2017-09-21 15:50:43 -04:00
Adrian Brink
4e13a19339
Add ability to construct new instance of Tendermint core from scratch
2017-09-21 15:50:43 -04:00
Adrian Brink
7dd3c007c7
Refactor priv_validator
...
Users can now just pass an object that implements the Signer interface.
2017-09-21 15:50:43 -04:00
Duncan Jones
0d392a0442
Allow Signer to be generated with priv key
...
Prior to this change, a custom Signer would have no knowledge of the private
key stored in the configuration file. This changes introduces a generator
function, which creates a Signer based on the private key. This provides an
opportunity for customer Signers to adjust behaviour based on the key
contents. (E.g. imagine key contents are a key label, rather than the key
itself).
2017-09-21 15:50:43 -04:00
Duncan Jones
7e4a704bd1
Remove reliance on default Signer
...
This change allows the default privValidator to use a custom Signer
implementation with no reliance on the default Signer implementation.
2017-09-21 15:50:43 -04:00
Adrian Brink
83f7d5c95a
Setup custom tendermint node
...
By exporting all of the commands, we allow users to setup their own
tendermint node cli. This enables users to provide a different
pivValidator without the need to fork tendermint.
2017-09-21 15:50:43 -04:00
Ethan Buchman
1f0985689d
ConsensusParams ptr in GenesisDoc for json
2017-09-21 15:22:58 -04:00
Ethan Buchman
3089bbf2b8
Amount -> Power. Closes #166
2017-09-21 14:59:27 -04:00
Ethan Buchman
5feeb65cf0
dont use pointers for ConsensusParams
2017-09-21 14:59:24 -04:00
Ethan Buchman
715e74186c
fixes from review
2017-09-21 14:51:29 -04:00
Ethan Buchman
3a03fe5a15
updated to match adr 005
2017-09-21 14:51:29 -04:00
Ethan Buchman
2b6db268cf
genesis json tests and mv ConsensusParams to types
2017-09-21 14:51:29 -04:00
Ethan Buchman
14abdd57f3
genDoc.ValidateAndComplete
2017-09-21 14:51:29 -04:00
Ethan Buchman
1f3e4d2d9a
move PartSetSize out of the config, into ConsensusParams
2017-09-21 14:51:29 -04:00
Ethan Buchman
29bfcb0a31
minor comments/changes
2017-09-21 14:51:29 -04:00
Ethan Buchman
90c0267bc1
types: privVal.Sign returns an error
2017-09-16 01:07:04 -04:00
Ethan Buchman
c5a657f540
consensus: test proposal heartbeat
2017-08-10 01:24:23 -04:00
Ethan Buchman
d0965cca05
forgot heartbeat file
2017-08-03 13:58:17 -04:00
Ethan Buchman
ab753abfa0
Proposer->Proposal; sign heartbeats
2017-07-29 17:04:28 -04:00
Ethan Buchman
530626dab7
broadcast proposer heartbeat msg
2017-07-29 11:45:02 -04:00
Ethan Buchman
3444bee47f
fixes from review; use mempool.TxsAvailable() directly
2017-07-28 23:42:43 -04:00
Ethan Buchman
678a9a2e42
TxsAvailable tests
2017-07-28 22:11:45 -04:00
Ethan Buchman
4beac54bd9
no empty blocks
2017-07-28 22:11:45 -04:00
Ethan Buchman
525fc0ae5b
types: block comments
2017-07-17 12:58:15 -04:00
Ethan Buchman
3065059da7
update changelog
2017-06-26 17:20:27 -04:00
Ethan Buchman
12c084c8c0
ParseGenesisFile -> types.GenesisDocFromFile
2017-06-26 16:16:54 -04:00
Ethan Frey
e4caf96bcb
Calculate validator hash from genesis doc
2017-06-26 17:06:49 +02:00
zramsay
bf5181d9ca
address PR comments
2017-05-30 13:27:08 -04:00
zramsay
cf31f8d06f
core: apply megacheck vet tool (unused, gosimple, staticcheck)
2017-05-29 23:11:40 -04:00
Ethan Buchman
42626d9e16
[types] overwrite pubkey/addr in LoadPrivValidator. closes #500
2017-05-25 13:40:13 -04:00
Ethan Buchman
6a30a902c9
[types] more []byte->data.Bytes and some %X->%v
2017-05-17 01:08:41 +02:00
Ethan Buchman
6d83c60c40
[types] dont hash validator.Accum
2017-05-17 00:16:38 +02:00
Ethan Buchman
e1792c1ea5
fix tx string format take 2
2017-05-16 14:12:48 +02:00
Ethan Buchman
d5113377e2
fix tx string format
2017-05-16 14:01:52 +02:00
Ethan Buchman
c4ad0f76e6
Merge pull request #494 from tendermint/json-naming
...
Clean up json output
2017-05-15 19:03:25 +02:00
Adrian Brink
118d565534
Merge pull request #472 from tendermint/string_reprs
...
Add Tx String representation. Got the ok from Anton.
2017-05-15 09:49:40 +02:00
Ethan Frey
926fb83e33
Re-added comment
2017-05-14 19:10:58 +02:00
Ethan Frey
157ec8af2d
Add json tags to validator set
2017-05-14 19:06:33 +02:00
Anton Kaliaev
f8fdbe3dbc
changes as per Bucky's review
2017-05-13 16:22:51 +02:00
Anton Kaliaev
f803544195
new logging
2017-05-13 10:24:58 +02:00
Ethan Buchman
75b6c5215f
fewer structs. remove viper from consensus
2017-05-04 22:43:55 -04:00
Ethan Buchman
29c0e6e4f4
remove viper from blockchain and state
2017-05-04 22:39:21 -04:00
Ethan Buchman
4305d054d6
Merge pull request #465 from tendermint/bytes
...
RPC Serialization Overhaul
2017-05-03 14:37:21 -04:00
Jae Kwon
4c7a2be06a
Add Tx String representation
2017-04-30 16:06:49 -07:00
Ethan Buchman
07e59e63f9
TMEventDataInner
2017-04-28 17:57:06 -04:00
Ethan Buchman
bdb34f9f4e
types: []byte -> data.Bytes
2017-04-27 19:01:18 -04:00
Adrian Brink
842609ddcb
Send InitChain message from ABCI to Core on Genesis
...
InitChain is send from the ABCI to the Core node when the ABCI
app has no blocks stored.
2017-04-27 20:22:11 +02:00
Ethan Buchman
a70c95b79e
tmlibs/common/test -> tmlibs/test
2017-04-21 18:18:22 -04:00
Ethan Buchman
d5b524e309
go-merkle -> merkleeyes/iavl and tmlibs/merkle
2017-04-21 18:16:05 -04:00
Ethan Buchman
e6fe6b5b76
go-data -> go-wire/data
2017-04-21 18:13:25 -04:00
Ethan Buchman
d1926bcad1
use tmlibs
2017-04-21 18:12:54 -04:00
Ethan Buchman
5da9b3a803
postmerge
2017-04-21 18:09:47 -04:00
Ethan Buchman
c55d83281a
move into rpc package
2017-04-21 18:05:39 -04:00
Ethan Buchman
15d5b2ac49
use tmlibs
2017-04-21 17:51:11 -04:00
Ethan Buchman
c3295f4878
RPCRequest.Params can be map[string]interface{} or []interface{}
2017-04-12 13:42:19 -04:00
Anton Kaliaev
e1d5873bdf
support key-value params in JSONRPC (Refs #1 )
...
More changes:
- remove Client interface (reason: empty)
- introduce HTTPClient interface, which can be used for both ClientURI
and ClientJSONRPC clients (so our users don't have to create their own) (Refs #8 )
- rename integration tests script to `integration_test.sh`
- do not update deps on `get_deps`
2017-03-07 19:27:27 +04:00
Ethan Buchman
855255d73e
use EventSwitch interface; less logging
2016-10-10 03:22:34 -04:00
Ethan Buchman
1410693eae
support unix domain websockets
2016-02-19 02:05:24 +00:00
Ethan Buchman
6607232a5d
add support for unix sockets
2016-02-18 22:45:55 +00:00
Ethan Buchman
14735d5eb5
RawMessage fix
2016-01-13 22:16:56 -05:00
Ethan Buchman
aff561d8c3
RPCResponse.Result is json.RawMessage
2016-01-13 18:37:35 -05:00
Ethan Buchman
3d59e13dd8
move from tendermint/tendermint
2016-01-12 16:50:06 -05:00