Ismail Khoffi
a530352f61
Align Vote/Proposal fields with canonical order and fields ( #2730 )
* reorder fields
* add TestVoteString & update tests
* remove redundant info from Proposal.String()
* update spec
* revert changes on vote.String() -> more human friendly
6 years ago
Ismail Khoffi
b6d5b8b745
Update to amino 0.14.0 ( #2710 )
* WIP: update to amino 0.14.0
* update Changelog
* Update to latest amino version (v0.14.0)
6 years ago
Ismail Khoffi
6643c5dd11
Catch up with amino 0.13.0 ( #2690 )
* catch up with amino changes in
https://github.com/tendermint/go-amino/pull/222
* WIP: update to amino v0.13.0
* update to fixed amino release
6 years ago
Ethan Buchman
be929acd6a
Update to Amino v0.13.0-rc0 ( #2687 )
* types: test tm2pm on fully populated header
* upgrade for amino v0.13.0-rc0
* fix lint
* comment out final test
6 years ago
Ismail Khoffi
8888595b94
[R4R] Fixed sized and reordered fields for Vote/Proposal/Heartbeat SignBytes ( #2598 )
* WIP: switching to fixed offsets for SignBytes
* add version field to sign bytes and update order
* more comments on test-cases and add a tc with a chainID
* remove amino:"write_empty" tag
- it doesn't affect if default fixed size fields ((u)int64) are
written or not
- add comment about int->int64 casting
* update CHANGELOG_PENDING
* update documentation
* add back link to issue #1622 in documentation
* remove JSON tags and add (failing test-case)
* fix failing test
* update test-vectors due to added `Type` field
* change Type field from string to byte and add new type alias
- SignedMsgType replaces VoteTypePrevote, VoteTypePrecommit and adds new
ProposalType to separate votes from proposal when signed
- update test-vectors
* fix remains from rebasing
* use SignMessageType instead of byte everywhere
* fixes from review
6 years ago
Ethan Buchman
52e21cebcf
remove some xxx comments and the config.mempool.recheck_empty ( #2505 )
* remove some XXX
* config: remove Mempool.RecheckEmpty
* docs: remove recheck_empty
6 years ago
Ismail Khoffi
fc073746a0
privval: Switch to amino encoding in SignBytes ( #2459 )
* switch to amino for SignBytes and add Reply with error message
- currently only Vote is done
* switch Reply type in socket for other messages
- add error description on error
* add TODOs regarding error handling
* address comments from peer review session (thx @xla )
- contains all changes besides the test-coverage / error'ing branches
* increase test coverage:
- add tests for each newly introduced error'ing code path
* return error if received wrong response
* add test for wrong response branches (ErrUnexpectedResponse)
* update CHANGELOG_PENDING and related documentation (spec)
* fix typo: s/CanonicallockID/CanonicalBlockID
* fixes from review
6 years ago
Anton Kaliaev
8d50bb9dad
conesnsu: follow up to removing some consensus params ( #2427 )
* follow up to removing some consensus params Refs #2382
* change args type to int64 in state#makeParams
* make valsCount and evidenceCount ints again
* MaxEvidenceBytesPerBlock: include magic number in godoc
* [spec] creating a proposal
* test state#TxFilter
* panic if MaxDataBytes is less than 0
* fixes after review
* use amino#UvarintSize to calculate overhead
0c74291f3b/encoder.go (L85-L90)
* avoid cyclic imports
* you can do better Go, come on
* remove testdouble package
6 years ago
Anton Kaliaev
166fd82b70
max-bytes PR follow-up ( #2318 )
* ReapMaxTxs: return all txs if max is negative
this mirrors ReapMaxBytes behavior
See https://github.com/tendermint/tendermint/pull/2184#discussion_r214439950
* increase MaxAminoOverheadForBlock
tested with:
```
func TestMaxAminoOverheadForBlock(t *testing.T) {
maxChainID := ""
for i := 0; i < MaxChainIDLen; i++ {
maxChainID += "𠜎"
}
h := Header{
ChainID: maxChainID,
Height: 10,
Time: time.Now().UTC(),
NumTxs: 100,
TotalTxs: 200,
LastBlockID: makeBlockID(make([]byte, 20), 300, make([]byte, 20)),
LastCommitHash: tmhash.Sum([]byte("last_commit_hash")),
DataHash: tmhash.Sum([]byte("data_hash")),
ValidatorsHash: tmhash.Sum([]byte("validators_hash")),
NextValidatorsHash: tmhash.Sum([]byte("next_validators_hash")),
ConsensusHash: tmhash.Sum([]byte("consensus_hash")),
AppHash: tmhash.Sum([]byte("app_hash")),
LastResultsHash: tmhash.Sum([]byte("last_results_hash")),
EvidenceHash: tmhash.Sum([]byte("evidence_hash")),
ProposerAddress: tmhash.Sum([]byte("proposer_address")),
}
b := Block{
Header: h,
Data: Data{Txs: makeTxs(10000, 100)},
Evidence: EvidenceData{},
LastCommit: &Commit{},
}
bz, err := cdc.MarshalBinary(b)
require.NoError(t, err)
assert.Equal(t, MaxHeaderBytes+MaxAminoOverheadForBlock-2, len(bz)-1000000-20000-1)
}
```
* fix MaxYYY constants calculation
by using math.MaxInt64
See https://github.com/tendermint/tendermint/pull/2184#discussion_r214444244
* pass mempool filter as an option
See https://github.com/tendermint/tendermint/pull/2184#discussion_r214445869
* fixes after Dev's comments
6 years ago
Anton Kaliaev
d73c5cbdb1
reap max bytes from the mempool & check transaction size
See ADR 020: Limiting txs size inside a block docs/architecture/adr-020-block-size.md
Refs #2035
6 years ago
Ethan Buchman
309a6772d7
types: fix formatting when printing signatures
- use cmn.Fingerprint and %X
6 years ago
ValarDragon
f903947ff3
crypto: Remove interface from crypto.Signature
Signatures are now []byte, which saves on the number of bytes after
amino encoding
(squash this) address Ismail's comment
6 years ago
Zach Ramsay
44dad6d70b
Revert "detele everything"
This reverts commit d02c5d1e30
.
6 years ago
Zach Ramsay
d02c5d1e30
detele everything
6 years ago
Ethan Buchman
d55243f0e6
fix import paths
6 years ago
Liamsi
d2c05bc5b9
Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
7 years ago
Liamsi
96a3502126
delete everything
7 years ago
Jae Kwon
34974e3932
Make types use Amino; Refactor PrivValidator* to FilePV/SocketPV
7 years ago
Anton Kaliaev
b0d8f552c5
return err if peer has sent a vote that does not match our round
7 years ago
Ethan Buchman
3395f5fb0e
types: builds
7 years ago
Ethan Buchman
200787ede2
types: update for new go-wire. WriteSignBytes -> SignBytes
7 years ago
Ethan Buchman
cd0fd06b0d
update for sdk2 libs. need to fix kv test
NOTE we only updating for tmlibs and abci
7 years ago
Ethan Buchman
d0e0ac5fac
types: better error messages for votes
7 years ago
Ethan Buchman
9cdcffbe4b
types: comments; compiles; evidence test
7 years ago
Ethan Buchman
35587658cd
verify evidence in block
7 years ago
Ethan Buchman
4661c98c17
add pubkey to conflicting vote evidence
7 years ago
Ethan Frey
599673690c
Add timestamp to vote canonical encoding
7 years ago
Anton Kaliaev
922af7c405
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
7 years ago
Anton Kaliaev
b3492356e6
uint64 height (Refs #911 )
7 years ago
Ethan Buchman
5466720d75
minor changes from @odeke-em PR #725
7 years ago
Ethan Buchman
97e9802255
fix out of range error in VoteSet.addVote
7 years ago
Ethan Buchman
bdb34f9f4e
types: []byte -> data.Bytes
8 years ago
Ethan Buchman
d1926bcad1
use tmlibs
8 years ago
Ethan Buchman
5da9b3a803
postmerge
8 years ago
Ethan Buchman
0017fb7ffe
premerge
8 years ago
Ethan Buchman
38783e7fa1
types: SignatureEd25519 -> Signature
8 years ago
Ethan Buchman
1b3766d802
types: canonical_json.go
8 years ago
zachary balder
da8b043612
sign bytes w struct literals
8 years ago
Jae Kwon
b73a6905a1
Initial pass at bft_fix_2 completion
8 years ago
Jae Kwon
1173a85c85
Use BlockID everywhere
8 years ago
Jae Kwon
7221887330
VoteSet can handle conflicting votes. TODO: add more tests
8 years ago
Jae Kwon
3c5a2f55c2
Add validator index and address to Vote.
9 years ago
Jae Kwon
ad17090a0f
No global config
9 years ago
Jae Kwon
f17c4c1d57
s/Validation/Commit/g
9 years ago
Jae Kwon
d69b5c5ab6
Conform to go-wire 1.0
9 years ago
Jae Kwon
e12f9d10e7
Bare consensus refactor
9 years ago
Jae Kwon
c4ed55d801
Refactor to move common libraries out of project
9 years ago
Jae Kwon
5bf0040f14
Parts -> PartsHeader; *_parts -> *_parts_header in sign_bytes
9 years ago
Jae Kwon
3be3647dc8
tendermint/binary -> tendermint/wire
9 years ago
Ethan Buchman
8e50bf15de
panic wrapper functions
9 years ago