Commit Graph

364 Commits

Author SHA1 Message Date
Jae Kwon 5d1c758730 Fix evidence 2018-04-05 05:43:23 -07:00
Jae Kwon 1b9323f105 Fix blockchain tests 2018-04-05 05:17:43 -07:00
Anton Kaliaev ed782e7508
include validator's voting power in /status
Refs #581
2018-04-04 11:34:59 +02:00
Anton Kaliaev 0732526465
use more relaxing < and >= ops instead of !=
an example of Search from godocs:

```
package main

import (
	"fmt"
	"sort"
)

func main() {
	a := []int{1, 3, 6, 10, 15, 21, 28, 36, 45, 55}
	x := 6

	i := sort.Search(len(a), func(i int) bool { return a[i] >= x })
	if i < len(a) && a[i] == x {
		fmt.Printf("found %d at index %d in %v\n", x, i, a)
	} else {
		fmt.Printf("%d not found in %v\n", x, a)
	}
}
```
2018-04-04 10:42:35 +02:00
Anton Kaliaev 39a4963782
document funcs in validator_set.go 2018-04-04 10:42:35 +02:00
Anton Kaliaev 37ce6b195a
ValidatorSet#GetByAddress: return -1 if no validator was found 2018-04-04 10:42:34 +02:00
Ethan Buchman d14aacf03e
Merge pull request #1300 from tendermint/lite-proxy-hardening-and-tests
lite/proxy: Validation* tests and hardening for nil dereferences
2018-04-03 22:43:38 +03:00
Ethan Buchman 39ff4d22e9 minor cleanup 2018-04-03 22:34:18 +03:00
Jae Kwon 196f8410ba WIP commit; Fix types/results_test 2018-04-03 07:03:08 -07:00
Anton Kaliaev 8462493cbf [rpc] fix subscribing using an abci.ResponseDeliverTx tag
Refs #1369
2018-04-03 15:53:13 +02:00
Anton Kaliaev 47b8bd1728 wrote a test for EventBus#PublishEventTx
Refs #1369
2018-04-03 15:53:13 +02: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
Jae Kwon 34974e3932 Make types use Amino; Refactor PrivValidator* to FilePV/SocketPV 2018-03-31 00:18:43 +02:00
Alex Hernandez 575a46d9d4 fix typo on block header (#1387) 2018-03-29 11:28:29 +02:00
Eugene Chung 34f5d439ee
remove Heap.Update() call when setting Proposer field
In for loop of IncrementAccum(), Heap.Update() call is unnecessary when i == times - 1.
2018-03-28 12:58:53 +09:00
Ethan Buchman 9bf5862def types: fix genesis.AppStateJSON 2018-03-27 11:20:09 -04:00
Anton Kaliaev 4e86835163
update changelog for 0.17.0 release 2018-03-27 09:06:32 +02:00
Anton Kaliaev 1c82281b77
make app_options -> app_state backwards compatible 2018-03-26 21:51:07 +02:00
Ethan Buchman 8c0c8e8e01
Merge pull request #1301 from tendermint/types-data+header+non-nil-panics
types: Hash invoked for nil Data and Header should not panic
2018-03-20 23:38:55 +01:00
Eugene Chung a61130aebb
Remove unnecessary bytes.Compare() call 2018-03-20 23:43:18 +09:00
Constantine 152290db7e Add `\health` rpc endpoint (#1306)
* Init `\health` rpc endpoint

* remove additional info from `\health` rpc endpoint

* Cleanup imports

* Added time threshold for health check

* Update rpc doc

* Remove unnecessary checks for blocktime creation lag

* Clean up of unnecessary config usage
2018-03-19 19:39:37 +03:00
Ethan Buchman ff1ec0260e
Merge pull request #1318 from tendermint/bucky/testnet-cmd-fix
testnet cmd: ensure config dir exists. closes #1290
2018-03-17 00:05:30 +01:00
Emmanuel T Odeke 7cb3188fbc testnet cmd: ensure config dir exists. closes #1290 2018-03-16 14:26:43 +01:00
Alexander Simmerl 9b9022f8df privVal: Improve SocketClient network code (#1315)
Follow-up to feedback from #1286, this change simplifies the connection
handling in the SocketClient and makes the communication via TCP more
robust. It introduces the tcpTimeoutListener to encapsulate accept and
i/o timeout handling as well as connection keep-alive, this type could
likely be upgraded to handle more fine-grained tuning of the tcp stack
(linger, nodelay, etc.) according to the properties we desire. The same
methods should be applied to the RemoteSigner which will be overhauled
when the priv_val_server is fleshed out.

* require private key
* simplify connect logic
* break out conn upgrades to tcpTimeoutListener
* extend test coverage and simplify component setup
2018-03-16 16:32:17 +04:00
Anton Kaliaev b0d8f552c5
return err if peer has sent a vote that does not match our round 2018-03-15 11:58:20 +04:00
Emmanuel T Odeke 8723c91db9
types: Hash invoked for nil Data and Header should not panic
Fixes https://github.com/tendermint/tendermint/issues/1298
Fixes https://github.com/tendermint/tendermint/issues/1299

Found while writing tests in https://github.com/tendermint/tendermint/pull/1300
2018-03-10 21:44:08 -08:00
Alexander Simmerl 589781721a
Invert privVal socket communication
Follow-up to #1255 aligning with the expectation that the external
signing process connects to the node. The SocketClient will block on
start until one connection has been established, support for multiple
signers connected simultaneously is a planned future extension.

* SocketClient accepts connection
* PrivValSocketServer renamed to RemoteSigner
* extend tests
2018-03-07 12:37:05 +01:00
Alexander Simmerl 2aa77025c3
Fix typo 2018-03-06 19:56:31 +01:00
Alexander Simmerl 8e1856a90a
Use builtin panic 2018-03-06 19:56:31 +01:00
Alexander Simmerl ca619c80b6
Stop privVal socket client on node shutdown 2018-03-06 19:56:30 +01:00
Alexander Simmerl 25ff699425
Improve method docs 2018-03-06 19:55:26 +01:00
Alexander Simmerl 879b4c0a2c
Use common method to determine file existence 2018-03-06 19:55:26 +01:00
Alexander Simmerl b7ce89e568
Speed up CircleCI builds
To achieve faster feedback cycles for our feature PRs this change
reduces the average buildtime from 35 to ~6min by utilising their new
2.0 offering based on docker and nomad. We make use of parallel build
steps wherever possible so that the duration is determined by the
slowest test suite (p2p).

This is an intermediate step until we move our CI/CD completely
on-premise for more control and added security.
2018-03-06 17:36:44 +01:00
Ethan Buchman d4e4055d57
PrivValidatorAddr -> PrivValidatorListenAddr. Update ADR008 2018-03-05 17:11:43 +01:00
Ethan Buchman ff8c648c23 types: uncomment some tests 2018-03-02 09:26:37 -05:00
Ethan Buchman c394eef7b8 types: TestValidatorSetVerifyCommit 2018-03-02 04:21:23 -05:00
Ethan Buchman f9921ae362 types/validator_set_test: move funcs around 2018-03-02 03:52:44 -05:00
Ethan Buchman 6596bff8ec types: bring back json.Marshal/Unmarshal for genesis/priv_val 2018-03-02 02:09:28 -05:00
Ethan Buchman 5378bfc5c7 types.SignBytes -> o.SignBytes 2018-03-02 01:50:17 -05:00
Ethan Buchman abeeeeb611 types: fix validator_set_test issue with UnmarshalBinary into ptr 2018-03-02 01:49:59 -05:00
Ethan Buchman ca3655a409 types: p2pID -> P2PID 2018-03-02 01:42:56 -05:00
Ethan Buchman 6cf5100645 types: working on tests... 2018-03-02 01:34:23 -05:00
Ethan Buchman 51628aea08 types: revert to old wire. builds 2018-03-02 01:33:38 -05:00
Ethan Buchman 3395f5fb0e types: builds 2018-03-02 01:28:38 -05:00
Ethan Buchman d2cd079541 types: tests build 2018-03-02 01:28:21 -05:00
Ethan Buchman fd58645dd2 types: remove dep on p2p 2018-03-02 01:26:03 -05:00
Ethan Buchman 200787ede2 types: update for new go-wire. WriteSignBytes -> SignBytes 2018-03-02 01:25:54 -05:00
Anton Kaliaev 4ce79baac7
rename app_options to app_state in genesis_test 2018-02-28 23:44:10 +04:00
rigelrozanski 4806b3b9bf
AppOptions -> AppStateJSON 2018-02-28 23:44:10 +04:00
Ethan Buchman dd2d846c02
Merge pull request #1203 from tendermint/feature/priv_val
types/priv_validator package
2018-02-28 09:27:03 -05:00
Ethan Buchman 9293ae76bf p2p: introduce peerConn to simplify peer creation (#1226)
* expose AuthEnc in the P2P config

if AuthEnc is true, dialed peers must have a node ID in the address and
it must match the persistent pubkey from the secret handshake.

Refs #1157

* fixes after my own review

* fix docs

* fix build failure

```
p2p/pex/pex_reactor_test.go:288:88: cannot use seed.NodeInfo().NetAddress() (type *p2p.NetAddress) as type string in array or slice literal
```

* p2p: introduce peerConn to simplify peer creation

* Introduce `peerConn` containing the known fields of `peer`
* `peer` only created in `sw.addPeer` once handshake is complete and NodeInfo is checked
* Eliminates some mutable variables and makes the code flow better
* Simplifies the `newXxxPeer` funcs
* Use ID instead of PubKey where possible.
        * SetPubKeyFilter -> SetIDFilter
        * nodeInfo.Validate takes ID
        * remove peer.PubKey()

* persistent node ids

* fixes from review

* test: use ip_plus_id.sh more

* fix invalid memory panic during fast_sync test

```
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: panic: runtime error: invalid memory address or nil pointer dereference
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x98dd3e]
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]:
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: goroutine 3432 [running]:
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.newOutboundPeerConn(0xc423fd1380, 0xc420933e00, 0x1, 0x1239a60, 0
xc420128c40, 0x2, 0x42caf6, 0xc42001f300, 0xc422831d98, 0xc4227951c0, ...)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/peer.go:123 +0x31e
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).addOutboundPeerWithConfig(0xc4200ad040, 0xc423fd1380, 0
xc420933e00, 0xc423f48801, 0x28, 0x2)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:455 +0x12b
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress(0xc4200ad040, 0xc423fd1380, 0x1, 0x
0, 0x0)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:371 +0xdc
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: github.com/tendermint/tendermint/p2p.(*Switch).reconnectToPeer(0xc4200ad040, 0x123e000, 0xc42007bb00)
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:290 +0x25f
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: created by github.com/tendermint/tendermint/p2p.(*Switch).StopPeerForError
2018-02-21T06:30:05Z box887.localdomain docker/local_testnet_4[14907]: #011/go/src/github.com/tendermint/tendermint/p2p/switch.go:256 +0x1b7
```
2018-02-27 15:54:40 +04:00
Alexander Simmerl 74d3f7e1fd
Integrate private validator socket client
Following ADDR 008 the node will connect to an external
process to handle signing requests. Operation of the external process is
left to the user.

* introduce alias for PrivValidator interface on socket client
* integrate socket client in node
* structure tests
* remove unnecessary flag
2018-02-23 13:58:22 +01:00
Alexander Simmerl 6c70b4ce05 Apply connection deadline consistently 2018-02-14 02:25:17 +01:00
Alexander Simmerl 2a292efb56 Return error for all PrivValidator methoods
As calls to the private validator can involve side-effects like network
communication it is desirable for all methods returning an error to not
break the control flow of the caller.

* adjust PrivValidator interface
2018-02-13 19:34:50 +01:00
Alexander Simmerl 82b1a34a36 Separate connect logic
* break out connect functionality out of OnStart
* introduce max retries
2018-02-13 19:08:21 +01:00
Ethan Buchman 8da2a6a147 types/priv_validator: fixes for latest p2p and cmn 2018-02-09 17:24:30 -05:00
Alexander Simmerl 38d18ca11a Harden tests 2018-02-09 16:53:17 -05:00
Alexander Simmerl 32d9563a15 Format and consolidate 2018-02-09 16:53:17 -05:00
Alexander Simmerl 18f7e52562 Use secret connection 2018-02-09 16:53:17 -05:00
Alexander Simmerl fec541373d Correct server protocol 2018-02-09 16:53:17 -05:00
Alexander Simmerl ff600e9aa0 wip: check error of wire read 2018-02-09 16:53:17 -05:00
Alexander Simmerl a49357b19e wip: Avoid underscore in var name 2018-02-09 16:53:17 -05:00
Alexander Simmerl 4b997c29ee wip: fix nil pointer deference 2018-02-09 16:53:17 -05:00
Alexander Simmerl c27fda09dd wip: Comment types
* add comments to all public types
* fix comments to adhere to comment standards
2018-02-09 16:53:15 -05:00
Ethan Buchman 459633fb4c types/priv_validator 2018-02-09 16:38:23 -05:00
Emmanuel Odeke 15ef57c6d0
types: TxEventBuffer.Flush now uses capacity preserving slice clearing idiom
Fixes https://github.com/tendermint/tendermint/issues/1189

For every TxEventBuffer.Flush() invoking, we were invoking
a:
  b.events = make([]EventDataTx, 0, b.capacity)
whose intention is to innocently clear the events slice but
maintain the underlying capacity.

However, unfortunately this is memory and garbage collection intensive
which is linear in the number of events added. If an attack had access
to our code somehow, invoking .Flush() in tight loops would be a sure
way to cause huge GC pressure, and say if they added about 1e9
events maliciously, every Flush() would take at least 3.2seconds
which is enough to now control our application.

The new using of the capacity preserving slice clearing idiom
takes a constant time regardless of the number of elements with zero
allocations so we are killing many birds with one stone i.e
  b.events = b.events[:0]

For benchmarking results, please see
https://gist.github.com/odeke-em/532c14ab67d71c9c0b95518a7a526058
for a reference on how things can get out of hand easily.
2018-02-05 23:34:15 -08:00
Ethan Buchman 7a5060dc52 replace data.Bytes with cmn.HexBytes 2018-02-03 03:47:01 -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 4e3488c677 update types 2018-02-03 03:23:10 -05:00
Zach Ramsay 1c01671ec6 improve vague error msg, closes #1158 2018-01-31 17:44:19 +00: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 b1485b181a Merge branch 'p2p-consolidate' into p2p-id 2018-01-13 15:20:23 -05:00
Adrian Brink 32311acd01 Vulnerability in light client proxy (#1081)
* Vulnerability in light client proxy

When calling GetCertifiedCommit the light client proxy would call
Certify and even on error return the Commit as if it had been correctly
certified.

Now it returns the error correctly and returns an empty Commit on error.

* Improve names for clarity

The lite package now contains StaticCertifier, DynamicCertifier and
InqueringCertifier. This also changes the method receivers from one
letter to two letter names, which will make future refactoring easier
and follows the coding standards.

* Fix test failures

* Rename files

* remove dead code
2018-01-09 10:36:11 -06:00
Ethan Buchman b9cbaf8f10 priv-val: fix timestamp for signing things that only differ by timestamp 2018-01-08 16:36:16 -05:00
Ethan Buchman cf42611187
Merge pull request #997 from tendermint/919-careful-with-validator-voting
check for overflow and underflow while choosing proposer
2018-01-07 16:48:39 -05:00
Ethan Buchman a17105fd46 p2p: peer.Key -> peer.ID 2018-01-01 22:39:05 -05:00
Ethan Buchman 28bbeac763 state: send byzantine validators in BeginBlock 2017-12-29 11:26:55 -05:00
Ethan Buchman cb845ebff5 fix EvidencePool and VerifyEvidence 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 f55135578c state: move methods to funcs 2017-12-28 23:15:54 -05:00
Ethan Buchman d0e0ac5fac types: better error messages for votes 2017-12-27 14:46:24 -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 c13e93d63e evidence: store tests and fixes 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 7a18fa887d evidence linked with consensus/node. compiles 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 10c43c9edc introduce evidence store 2017-12-26 20:25:14 -05:00
Ethan Buchman 48d778c4b3 types/params: introduce EvidenceParams 2017-12-26 20:24:12 -05:00
Ethan Buchman 7d086e9524 check if we already have evidence 2017-12-26 20:21:17 -05:00
Ethan Buchman 6e9433c7a8 post rebase fix 2017-12-26 20:21:17 -05:00
Ethan Buchman eeab0efa56 types: tx.go comments 2017-12-26 20:21:17 -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 50850cf8a2 verify sigs on both votes; note about indices 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 4661c98c17 add pubkey to conflicting vote evidence 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 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
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