From a5b7ea93c42d77a812b0ccd213de0197178f8e41 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 29 May 2018 01:03:03 -0700 Subject: [PATCH 001/149] Delay validator set changes by 1 block. --- Makefile | 4 +- consensus/reactor_test.go | 6 +- consensus/replay.go | 12 ++- consensus/state.go | 1 - consensus/state_test.go | 8 +- evidence/pool_test.go | 1 + rpc/core/status.go | 7 +- state/execution.go | 44 +++++------ state/state.go | 17 ++--- state/state_test.go | 157 +++++++++++++++++++------------------- state/store.go | 9 ++- state/validation.go | 12 ++- types/block.go | 38 ++++----- types/validator_set.go | 11 ++- 14 files changed, 172 insertions(+), 155 deletions(-) diff --git a/Makefile b/Makefile index 079c58f9..0f7578c0 100644 --- a/Makefile +++ b/Makefile @@ -132,11 +132,11 @@ vagrant_test: ### go tests test: @echo "--> Running go test" - @go test $(PACKAGES) + @GOCACHE=off go test -p 1 $(PACKAGES) test_race: @echo "--> Running go test --race" - @go test -v -race $(PACKAGES) + @GOCACHE=off go test -p 1 -v -race $(PACKAGES) ######################################## diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 498a857b..70af588a 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -174,14 +174,14 @@ func TestReactorRecordsBlockParts(t *testing.T) { require.Equal(t, 1, ps.BlockPartsSent(), "number of block parts sent should stay the same") } -// Test we record votes from other peers +// Test we record votes from other peers. func TestReactorRecordsVotes(t *testing.T) { - // create dummy peer + // Create dummy peer. peer := p2pdummy.NewPeer() ps := NewPeerState(peer).SetLogger(log.TestingLogger()) peer.Set(types.PeerStateKey, ps) - // create reactor + // Create reactor. css := randConsensusNet(1, "consensus_reactor_records_votes_test", newMockTickerFunc(true), newPersistentKVStore) reactor := NewConsensusReactor(css[0], false) // so we dont start the consensus states reactor.SetEventBus(css[0].eventBus) diff --git a/consensus/replay.go b/consensus/replay.go index f681828c..75173061 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -264,15 +264,15 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight stateBlockHeight := state.LastBlockHeight h.logger.Info("ABCI Replay Blocks", "appHeight", appBlockHeight, "storeHeight", storeBlockHeight, "stateHeight", stateBlockHeight) - // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain + // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - validators := types.TM2PB.Validators(state.Validators) + nvals := types.TM2PB.Validators(state.Validators) // state.Validators would work too. csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime.Unix(), // TODO ChainId: h.genDoc.ChainID, ConsensusParams: csParams, - Validators: validators, + Validators: nvals, AppStateBytes: h.genDoc.AppStateJSON, } res, err := proxyApp.Consensus().InitChainSync(req) @@ -280,9 +280,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight return nil, err } - // if the app returned validators - // or consensus params, update the state - // with the them + // If the app returned validators or consensus params, update the state. if len(res.Validators) > 0 { vals, err := types.PB2TM.Validators(res.Validators) if err != nil { @@ -296,7 +294,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight sm.SaveState(h.stateDB, state) } - // First handle edge cases and constraints on the storeBlockHeight + // First handle edge cases and constraints on the storeBlockHeight. if storeBlockHeight == 0 { return appHash, checkAppHash(state, appHash) diff --git a/consensus/state.go b/consensus/state.go index 5d6842a8..a12345d7 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -74,7 +74,6 @@ type ConsensusState struct { privValidator types.PrivValidator // for signing votes // services for creating and executing blocks - // TODO: encapsulate all of this in one "BlockManager" blockExec *sm.BlockExecutor blockStore sm.BlockStore mempool sm.Mempool diff --git a/consensus/state_test.go b/consensus/state_test.go index d0def630..ece70dd5 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -64,22 +64,22 @@ func TestStateProposerSelection0(t *testing.T) { startTestRound(cs1, height, round) - // wait for new round so proposer is set + // Wait for new round so proposer is set. <-newRoundCh - // lets commit a block and ensure proposer for the next height is correct + // Commit a block and ensure proposer for the next height is correct. prop := cs1.GetRoundState().Validators.GetProposer() if !bytes.Equal(prop.Address, cs1.privValidator.GetAddress()) { t.Fatalf("expected proposer to be validator %d. Got %X", 0, prop.Address) } - // wait for complete proposal + // Wait for complete proposal. <-proposalCh rs := cs1.GetRoundState() signAddVotes(cs1, types.VoteTypePrecommit, rs.ProposalBlock.Hash(), rs.ProposalBlockParts.Header(), vss[1:]...) - // wait for new round so next validator is set + // Wait for new round so next validator is set. <-newRoundCh prop = cs1.GetRoundState().Validators.GetProposer() diff --git a/evidence/pool_test.go b/evidence/pool_test.go index 01907623..4b3e3581 100644 --- a/evidence/pool_test.go +++ b/evidence/pool_test.go @@ -27,6 +27,7 @@ func initializeValidatorState(valAddr []byte, height int64) dbm.DB { LastBlockHeight: 0, LastBlockTime: time.Now(), Validators: valSet, + NextValidators: valSet.CopyIncrementAccum(1), LastHeightValidatorsChanged: 1, ConsensusParams: types.ConsensusParams{ EvidenceParams: types.EvidenceParams{ diff --git a/rpc/core/status.go b/rpc/core/status.go index 2c54d0a9..5738685b 100644 --- a/rpc/core/status.go +++ b/rpc/core/status.go @@ -109,7 +109,7 @@ func validatorAtHeight(h int64) *types.Validator { privValAddress := pubKey.Address() - // if we're still at height h, search in the current validator set + // If we're still at height h, search in the current validator set. if lastBlockHeight == h { for _, val := range vals { if bytes.Equal(val.Address, privValAddress) { @@ -118,12 +118,11 @@ func validatorAtHeight(h int64) *types.Validator { } } - // if we've moved to the next height, retrieve the validator set from DB + // If we've moved to the next height, retrieve the validator set from DB. if lastBlockHeight > h { vals, err := sm.LoadValidators(stateDB, h) if err != nil { - // should not happen - return nil + return nil // should not happen } _, val := vals.GetByAddress(privValAddress) return val diff --git a/state/execution.go b/state/execution.go index 0d6ee81b..3dbd3bf2 100644 --- a/state/execution.go +++ b/state/execution.go @@ -80,18 +80,18 @@ func (blockExec *BlockExecutor) ApplyBlock(state State, blockID types.BlockID, b fail.Fail() // XXX - // save the results before we commit + // Save the results before we commit. saveABCIResponses(blockExec.db, block.Height, abciResponses) fail.Fail() // XXX - // update the state with the block and responses + // Update the state with the block and responses. state, err = updateState(state, blockID, block.Header, abciResponses) if err != nil { return state, fmt.Errorf("Commit failed for application: %v", err) } - // lock mempool, commit app state, update mempoool + // Lock mempool, commit app state, update mempoool. appHash, err := blockExec.Commit(block) if err != nil { return state, fmt.Errorf("Commit failed for application: %v", err) @@ -102,13 +102,13 @@ func (blockExec *BlockExecutor) ApplyBlock(state State, blockID types.BlockID, b fail.Fail() // XXX - // update the app hash and save the state + // Update the app hash and save the state. state.AppHash = appHash SaveState(blockExec.db, state) fail.Fail() // XXX - // events are fired after everything else + // Events are fired after everything else. // NOTE: if we crash between Commit and Save, events wont be fired during replay fireEvents(blockExec.logger, blockExec.eventBus, block, abciResponses) @@ -164,7 +164,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, txIndex := 0 abciResponses := NewABCIResponses(block) - // Execute transactions and get hash + // Execute transactions and get hash. proxyCb := func(req *abci.Request, res *abci.Response) { switch r := res.Value.(type) { case *abci.Response_DeliverTx: @@ -186,7 +186,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, signVals, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) - // Begin block + // Begin block. _, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{ Hash: block.Hash(), Header: types.TM2PB.Header(block.Header), @@ -198,7 +198,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, return nil, err } - // Run txs of block + // Run txs of block. for _, tx := range block.Txs { proxyAppConn.DeliverTxAsync(tx) if err := proxyAppConn.Error(); err != nil { @@ -206,7 +206,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, } } - // End block + // End block. abciResponses.EndBlock, err = proxyAppConn.EndBlockSync(abci.RequestEndBlock{block.Height}) if err != nil { logger.Error("Error in proxyAppConn.EndBlock", "err", err) @@ -307,26 +307,25 @@ func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.Validat func updateState(state State, blockID types.BlockID, header *types.Header, abciResponses *ABCIResponses) (State, error) { - // copy the valset so we can apply changes from EndBlock - // and update s.LastValidators and s.Validators - prevValSet := state.Validators.Copy() - nextValSet := prevValSet.Copy() + // Copy the valset so we can apply changes from EndBlock + // and update s.LastValidators and s.Validators. + nValSet := state.NextValidators.Copy() - // update the validator set with the latest abciResponses + // Update the validator set with the latest abciResponses. lastHeightValsChanged := state.LastHeightValidatorsChanged if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { - err := updateValidators(nextValSet, abciResponses.EndBlock.ValidatorUpdates) + err := updateValidators(nValSet, abciResponses.EndBlock.ValidatorUpdates) if err != nil { return state, fmt.Errorf("Error changing validator set: %v", err) } - // change results from this height but only applies to the next height - lastHeightValsChanged = header.Height + 1 + // Change results from this height but only applies to the next next height. + lastHeightValsChanged = header.Height + 1 + 1 } - // Update validator accums and set state variables - nextValSet.IncrementAccum(1) + // Update validator accums and set state variables. + nValSet.IncrementAccum(1) - // update the params with the latest abciResponses + // Update the params with the latest abciResponses. nextParams := state.ConsensusParams lastHeightParamsChanged := state.LastHeightConsensusParamsChanged if abciResponses.EndBlock.ConsensusParamUpdates != nil { @@ -336,7 +335,7 @@ func updateState(state State, blockID types.BlockID, header *types.Header, if err != nil { return state, fmt.Errorf("Error updating consensus params: %v", err) } - // change results from this height but only applies to the next height + // Change results from this height but only applies to the next height. lastHeightParamsChanged = header.Height + 1 } @@ -348,7 +347,8 @@ func updateState(state State, blockID types.BlockID, header *types.Header, LastBlockTotalTx: state.LastBlockTotalTx + header.NumTxs, LastBlockID: blockID, LastBlockTime: header.Time, - Validators: nextValSet, + NextValidators: nValSet, + Validators: state.NextValidators.Copy(), LastValidators: state.Validators.Copy(), LastHeightValidatorsChanged: lastHeightValsChanged, ConsensusParams: nextParams, diff --git a/state/state.go b/state/state.go index 3bc08dae..0891f837 100644 --- a/state/state.go +++ b/state/state.go @@ -24,7 +24,7 @@ var ( // Instead, use state.Copy() or state.NextState(...). // NOTE: not goroutine-safe. type State struct { - // Immutable + // immutable ChainID string // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) @@ -38,6 +38,7 @@ type State struct { // so we can query for historical validator sets. // Note that if s.LastBlockHeight causes a valset change, // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + NextValidators *types.ValidatorSet Validators *types.ValidatorSet LastValidators *types.ValidatorSet LastHeightValidatorsChanged int64 @@ -50,7 +51,7 @@ type State struct { // Merkle root of the results from executing prev block LastResultsHash []byte - // The latest AppHash we've received from calling abci.Commit() + // the latest AppHash we've received from calling abci.Commit() AppHash []byte } @@ -64,6 +65,7 @@ func (state State) Copy() State { LastBlockID: state.LastBlockID, LastBlockTime: state.LastBlockTime, + NextValidators: state.NextValidators.Copy(), Validators: state.Validators.Copy(), LastValidators: state.LastValidators.Copy(), LastHeightValidatorsChanged: state.LastHeightValidatorsChanged, @@ -93,24 +95,20 @@ func (state State) IsEmpty() bool { return state.Validators == nil // XXX can't compare to Empty } -// GetValidators returns the last and current validator sets. -func (state State) GetValidators() (last *types.ValidatorSet, current *types.ValidatorSet) { - return state.LastValidators, state.Validators -} - //------------------------------------------------------------------------ // Create a block from the latest state // MakeBlock builds a block with the given txs and commit from the current state. func (state State) MakeBlock(height int64, txs []types.Tx, commit *types.Commit) (*types.Block, *types.PartSet) { - // build base block + // Build base block. block := types.MakeBlock(height, txs, commit) - // fill header with state data + // Fill header with state data. block.ChainID = state.ChainID block.TotalTxs = state.LastBlockTotalTx + block.NumTxs block.LastBlockID = state.LastBlockID block.ValidatorsHash = state.Validators.Hash() + block.NextValidatorsHash = state.NextValidators.Hash() block.AppHash = state.AppHash block.ConsensusHash = state.ConsensusParams.Hash() block.LastResultsHash = state.LastResultsHash @@ -175,6 +173,7 @@ func MakeGenesisState(genDoc *types.GenesisDoc) (State, error) { LastBlockID: types.BlockID{}, LastBlockTime: genDoc.GenesisTime, + NextValidators: types.NewValidatorSet(validators).CopyIncrementAccum(1), Validators: types.NewValidatorSet(validators), LastValidators: types.NewValidatorSet(nil), LastHeightValidatorsChanged: 1, diff --git a/state/state_test.go b/state/state_test.go index 30a87fb0..ae70cc10 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -16,7 +16,7 @@ import ( "github.com/tendermint/tendermint/types" ) -// setupTestCase does setup common to all test cases +// setupTestCase does setup common to all test cases. func setupTestCase(t *testing.T) (func(t *testing.T), dbm.DB, State) { config := cfg.ResetTestRoot("state_") dbType := dbm.DBBackendType(config.DBBackend) @@ -72,7 +72,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { state.LastBlockHeight++ - // build mock responses + // Build mock responses. block := makeBlock(state, 2) abciResponses := NewABCIResponses(block) abciResponses.DeliverTx[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Tags: nil} @@ -89,7 +89,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { loadedABCIResponses, abciResponses)) } -// TestResultsSaveLoad tests saving and loading abci results. +// TestResultsSaveLoad tests saving and loading ABCI results. func TestABCIResponsesSaveLoad2(t *testing.T) { tearDown, stateDB, _ := setupTestCase(t) defer tearDown(t) @@ -97,8 +97,8 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { assert := assert.New(t) cases := [...]struct { - // height is implied index+2 - // as block 1 is created from genesis + // Height is implied to equal index+2, + // as block 1 is created from genesis. added []*abci.ResponseDeliverTx expected types.ABCIResults }{ @@ -132,14 +132,14 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { }, } - // query all before, should return error + // Query all before, this should return error. for i := range cases { h := int64(i + 1) res, err := LoadABCIResponses(stateDB, h) assert.Error(err, "%d: %#v", i, res) } - // add all cases + // Add all cases. for i, tc := range cases { h := int64(i + 1) // last block height, one below what we save responses := &ABCIResponses{ @@ -149,7 +149,7 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { saveABCIResponses(stateDB, h, responses) } - // query all before, should return expected value + // Query all before, should return expected value. for i, tc := range cases { h := int64(i + 1) res, err := LoadABCIResponses(stateDB, h) @@ -165,34 +165,30 @@ func TestValidatorSimpleSaveLoad(t *testing.T) { // nolint: vetshadow assert := assert.New(t) - // can't load anything for height 0 + // Can't load anything for height 0. v, err := LoadValidators(stateDB, 0) assert.IsType(ErrNoValSetForHeight{}, err, "expected err at height 0") - // should be able to load for height 1 + // Should be able to load for height 1. v, err = LoadValidators(stateDB, 1) assert.Nil(err, "expected no err at height 1") assert.Equal(v.Hash(), state.Validators.Hash(), "expected validator hashes to match") - // increment height, save; should be able to load for next height + // Should be able to load for height 2. + v, err = LoadValidators(stateDB, 2) + assert.Nil(err, "expected no err at height 2") + assert.Equal(v.Hash(), state.NextValidators.Hash(), "expected validator hashes to match") + + // Increment height, save; should be able to load for next & next next height. state.LastBlockHeight++ nextHeight := state.LastBlockHeight + 1 - saveValidatorsInfo(stateDB, nextHeight, state.LastHeightValidatorsChanged, state.Validators) - v, err = LoadValidators(stateDB, nextHeight) + saveValidatorsInfo(stateDB, nextHeight+1, state.LastHeightValidatorsChanged, state.NextValidators) + vp0, err := LoadValidators(stateDB, nextHeight+0) assert.Nil(err, "expected no err") - assert.Equal(v.Hash(), state.Validators.Hash(), "expected validator hashes to match") - - // increment height, save; should be able to load for next height - state.LastBlockHeight += 10 - nextHeight = state.LastBlockHeight + 1 - saveValidatorsInfo(stateDB, nextHeight, state.LastHeightValidatorsChanged, state.Validators) - v, err = LoadValidators(stateDB, nextHeight) + vp1, err := LoadValidators(stateDB, nextHeight+1) assert.Nil(err, "expected no err") - assert.Equal(v.Hash(), state.Validators.Hash(), "expected validator hashes to match") - - // should be able to load for next next height - _, err = LoadValidators(stateDB, state.LastBlockHeight+2) - assert.IsType(ErrNoValSetForHeight{}, err, "expected err at unknown height") + assert.Equal(vp0.Hash(), state.Validators.Hash(), "expected validator hashes to match") + assert.Equal(vp1.Hash(), state.NextValidators.Hash(), "expected next validator hashes to match") } // TestValidatorChangesSaveLoad tests saving and loading a validator set with changes. @@ -200,38 +196,37 @@ func TestOneValidatorChangesSaveLoad(t *testing.T) { tearDown, stateDB, state := setupTestCase(t) defer tearDown(t) - // change vals at these heights + // Change vals at these heights. changeHeights := []int64{1, 2, 4, 5, 10, 15, 16, 17, 20} N := len(changeHeights) - // build the validator history by running updateState - // with the right validator set for each height + // Build the validator history by running updateState + // with the right validator set for each height. highestHeight := changeHeights[N-1] + 5 changeIndex := 0 _, val := state.Validators.GetByIndex(0) power := val.VotingPower var err error for i := int64(1); i < highestHeight; i++ { - // when we get to a change height, - // use the next pubkey + // When we get to a change height, use the next pubkey. if changeIndex < len(changeHeights) && i == changeHeights[changeIndex] { changeIndex++ power++ } - header, blockID, responses := makeHeaderPartsResponsesValPowerChange(state, i, power) + header, blockID, responses := makeHeaderPartsResponsesValPowerChange(state, power) state, err = updateState(state, blockID, header, responses) assert.Nil(t, err) nextHeight := state.LastBlockHeight + 1 - saveValidatorsInfo(stateDB, nextHeight, state.LastHeightValidatorsChanged, state.Validators) + saveValidatorsInfo(stateDB, nextHeight+1, state.LastHeightValidatorsChanged, state.NextValidators) } - // on each change height, increment the power by one. + // On each height change, increment the power by one. testCases := make([]int64, highestHeight) changeIndex = 0 power = val.VotingPower for i := int64(1); i < highestHeight+1; i++ { - // we we get to the height after a change height - // use the next pubkey (note our counter starts at 0 this time) + // We get to the height after a change height use the next pubkey (note + // our counter starts at 0 this time). if changeIndex < len(changeHeights) && i == changeHeights[changeIndex]+1 { changeIndex++ power++ @@ -240,7 +235,7 @@ func TestOneValidatorChangesSaveLoad(t *testing.T) { } for i, power := range testCases { - v, err := LoadValidators(stateDB, int64(i+1)) + v, err := LoadValidators(stateDB, int64(i+1+1)) // +1 because vset changes delayed by 1 block. assert.Nil(t, err, fmt.Sprintf("expected no err at height %d", i)) assert.Equal(t, v.Size(), 1, "validator set size is greater than 1: %d", v.Size()) _, val := v.GetByIndex(0) @@ -255,25 +250,41 @@ func TestOneValidatorChangesSaveLoad(t *testing.T) { func TestManyValidatorChangesSaveLoad(t *testing.T) { const valSetSize = 7 tearDown, stateDB, state := setupTestCase(t) + require.Equal(t, int64(0), state.LastBlockHeight) state.Validators = genValSet(valSetSize) + state.NextValidators = state.Validators.CopyIncrementAccum(1) SaveState(stateDB, state) defer tearDown(t) - const height = 1 - pubkey := crypto.GenPrivKeyEd25519().PubKey() - // swap the first validator with a new one ^^^ (validator set size stays the same) - header, blockID, responses := makeHeaderPartsResponsesValPubKeyChange(state, height, pubkey) + _, valOld := state.Validators.GetByIndex(0) + var pubkeyOld = valOld.PubKey + var pubkey = crypto.GenPrivKeyEd25519().PubKey() + + // Swap the first validator with a new one (validator set size stays the same). + header, blockID, responses := makeHeaderPartsResponsesValPubKeyChange(state, pubkey) + + // Save state etc. var err error state, err = updateState(state, blockID, header, responses) require.Nil(t, err) nextHeight := state.LastBlockHeight + 1 - saveValidatorsInfo(stateDB, nextHeight, state.LastHeightValidatorsChanged, state.Validators) + saveValidatorsInfo(stateDB, nextHeight+1, state.LastHeightValidatorsChanged, state.NextValidators) - v, err := LoadValidators(stateDB, height+1) + // Load nextheight, it should be the oldpubkey. + v0, err := LoadValidators(stateDB, nextHeight) assert.Nil(t, err) - assert.Equal(t, valSetSize, v.Size()) + assert.Equal(t, valSetSize, v0.Size()) + index, val := v0.GetByAddress(pubkeyOld.Address()) + assert.NotNil(t, val) + if index < 0 { + t.Fatal("expected to find old validator") + } - index, val := v.GetByAddress(pubkey.Address()) + // Load nextheight+1, it should be the new pubkey. + v1, err := LoadValidators(stateDB, nextHeight+1) + assert.Nil(t, err) + assert.Equal(t, valSetSize, v1.Size()) + index, val = v1.GetByAddress(pubkey.Address()) assert.NotNil(t, val) if index < 0 { t.Fatal("expected to find newly added validator") @@ -294,12 +305,12 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) { tearDown, stateDB, state := setupTestCase(t) defer tearDown(t) - // change vals at these heights + // Change vals at these heights. changeHeights := []int64{1, 2, 4, 5, 10, 15, 16, 17, 20} N := len(changeHeights) - // each valset is just one validator - // create list of them + // Each valset is just one validator. + // create list of them. params := make([]types.ConsensusParams, N+1) params[0] = state.ConsensusParams for i := 1; i < N+1; i++ { @@ -307,20 +318,19 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) { params[i].BlockSize.MaxBytes += i } - // build the params history by running updateState - // with the right params set for each height + // Build the params history by running updateState + // with the right params set for each height. highestHeight := changeHeights[N-1] + 5 changeIndex := 0 cp := params[changeIndex] var err error for i := int64(1); i < highestHeight; i++ { - // when we get to a change height, - // use the next params + // When we get to a change height, use the next params. if changeIndex < len(changeHeights) && i == changeHeights[changeIndex] { changeIndex++ cp = params[changeIndex] } - header, blockID, responses := makeHeaderPartsResponsesParams(state, i, cp) + header, blockID, responses := makeHeaderPartsResponsesParams(state, cp) state, err = updateState(state, blockID, header, responses) require.Nil(t, err) @@ -328,13 +338,13 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) { saveConsensusParamsInfo(stateDB, nextHeight, state.LastHeightConsensusParamsChanged, state.ConsensusParams) } - // make all the test cases by using the same params until after the change + // Make all the test cases by using the same params until after the change. testCases := make([]paramsChangeTestCase, highestHeight) changeIndex = 0 cp = params[changeIndex] for i := int64(1); i < highestHeight+1; i++ { - // we we get to the height after a change height - // use the next pubkey (note our counter starts at 0 this time) + // We get to the height after a change height use the next pubkey (note + // our counter starts at 0 this time). if changeIndex < len(changeHeights) && i == changeHeights[changeIndex]+1 { changeIndex++ cp = params[changeIndex] @@ -419,16 +429,16 @@ func TestApplyUpdates(t *testing.T) { } } -func makeHeaderPartsResponsesValPubKeyChange(state State, height int64, - pubkey crypto.PubKey) (*types.Header, types.BlockID, *ABCIResponses) { +func makeHeaderPartsResponsesValPubKeyChange(state State, pubkey crypto.PubKey) ( + *types.Header, types.BlockID, *ABCIResponses) { - block := makeBlock(state, height) + block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ABCIResponses{ EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } - // if the pubkey is new, remove the old and add the new - _, val := state.Validators.GetByIndex(0) + // If the pubkey is new, remove the old and add the new. + _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { abciResponses.EndBlock = &abci.ResponseEndBlock{ ValidatorUpdates: []abci.Validator{ @@ -441,16 +451,16 @@ func makeHeaderPartsResponsesValPubKeyChange(state State, height int64, return block.Header, types.BlockID{block.Hash(), types.PartSetHeader{}}, abciResponses } -func makeHeaderPartsResponsesValPowerChange(state State, height int64, - power int64) (*types.Header, types.BlockID, *ABCIResponses) { +func makeHeaderPartsResponsesValPowerChange(state State, power int64) ( + *types.Header, types.BlockID, *ABCIResponses) { - block := makeBlock(state, height) + block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ABCIResponses{ EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil}, } - // if the pubkey is new, remove the old and add the new - _, val := state.Validators.GetByIndex(0) + // If the pubkey is new, remove the old and add the new. + _, val := state.NextValidators.GetByIndex(0) if val.VotingPower != power { abciResponses.EndBlock = &abci.ResponseEndBlock{ ValidatorUpdates: []abci.Validator{ @@ -462,10 +472,10 @@ func makeHeaderPartsResponsesValPowerChange(state State, height int64, return block.Header, types.BlockID{block.Hash(), types.PartSetHeader{}}, abciResponses } -func makeHeaderPartsResponsesParams(state State, height int64, - params types.ConsensusParams) (*types.Header, types.BlockID, *ABCIResponses) { +func makeHeaderPartsResponsesParams(state State, params types.ConsensusParams) ( + *types.Header, types.BlockID, *ABCIResponses) { - block := makeBlock(state, height) + block := makeBlock(state, state.LastBlockHeight+1) abciResponses := &ABCIResponses{ EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.TM2PB.ConsensusParams(¶ms)}, } @@ -476,14 +486,3 @@ type paramsChangeTestCase struct { height int64 params types.ConsensusParams } - -func makeHeaderPartsResults(state State, height int64, - results []*abci.ResponseDeliverTx) (*types.Header, types.BlockID, *ABCIResponses) { - - block := makeBlock(state, height) - abciResponses := &ABCIResponses{ - DeliverTx: results, - EndBlock: &abci.ResponseEndBlock{}, - } - return block.Header, types.BlockID{block.Hash(), types.PartSetHeader{}}, abciResponses -} diff --git a/state/store.go b/state/store.go index 79893254..040bc9fd 100644 --- a/state/store.go +++ b/state/store.go @@ -86,7 +86,14 @@ func SaveState(db dbm.DB, state State) { func saveState(db dbm.DB, state State, key []byte) { nextHeight := state.LastBlockHeight + 1 - saveValidatorsInfo(db, nextHeight, state.LastHeightValidatorsChanged, state.Validators) + // If first block, save validators for block 1. + if nextHeight == 1 { + lastHeightVoteChanged := int64(1) // Due to Tendermint validator set changes being delayed 1 block. + saveValidatorsInfo(db, nextHeight, lastHeightVoteChanged, state.Validators) + } + // Save next validators. + saveValidatorsInfo(db, nextHeight+1, state.LastHeightValidatorsChanged, state.NextValidators) + // Save next consensus params. saveConsensusParamsInfo(db, nextHeight, state.LastHeightConsensusParamsChanged, state.ConsensusParams) db.SetSync(stateKey, state.Bytes()) } diff --git a/state/validation.go b/state/validation.go index 84a4cc82..76c1a1ec 100644 --- a/state/validation.go +++ b/state/validation.go @@ -13,12 +13,12 @@ import ( // Validate block func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { - // validate internal consistency + // Validate internal consistency. if err := block.ValidateBasic(); err != nil { return err } - // validate basic info + // Validate basic info. if block.ChainID != state.ChainID { return fmt.Errorf("Wrong Block.Header.ChainID. Expected %v, got %v", state.ChainID, block.ChainID) } @@ -33,7 +33,7 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } */ - // validate prev block info + // Validate prev block info. if !block.LastBlockID.Equals(state.LastBlockID) { return fmt.Errorf("Wrong Block.Header.LastBlockID. Expected %v, got %v", state.LastBlockID, block.LastBlockID) } @@ -42,7 +42,7 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { return fmt.Errorf("Wrong Block.Header.TotalTxs. Expected %v, got %v", state.LastBlockTotalTx+newTxs, block.TotalTxs) } - // validate app info + // Validate app info if !bytes.Equal(block.AppHash, state.AppHash) { return fmt.Errorf("Wrong Block.Header.AppHash. Expected %X, got %v", state.AppHash, block.AppHash) } @@ -55,6 +55,9 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { if !bytes.Equal(block.ValidatorsHash, state.Validators.Hash()) { return fmt.Errorf("Wrong Block.Header.ValidatorsHash. Expected %X, got %v", state.Validators.Hash(), block.ValidatorsHash) } + if !bytes.Equal(block.NextValidatorsHash, state.NextValidators.Hash()) { + return fmt.Errorf("Wrong Block.Header.NextValidatorsHash. Expected %X, got %v", state.NextValidators.Hash(), block.NextValidatorsHash) + } // Validate block LastCommit. if block.Height == 1 { @@ -73,6 +76,7 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } } + // Validate all evidence. // TODO: Each check requires loading an old validator set. // We should cap the amount of evidence per block // to prevent potential proposer DoS. diff --git a/types/block.go b/types/block.go index 6adc0c4c..e72b5fc7 100644 --- a/types/block.go +++ b/types/block.go @@ -196,10 +196,11 @@ type Header struct { DataHash cmn.HexBytes `json:"data_hash"` // transactions // hashes from the app output from the prev block - ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block - ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block - AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block - LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block + ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block + NextValidatorsHash cmn.HexBytes `json:"next_validators_hash"` // validators for the next block + ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block + AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block + LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block // consensus info EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block @@ -214,19 +215,20 @@ func (h *Header) Hash() cmn.HexBytes { return nil } return merkle.SimpleHashFromMap(map[string]merkle.Hasher{ - "ChainID": aminoHasher(h.ChainID), - "Height": aminoHasher(h.Height), - "Time": aminoHasher(h.Time), - "NumTxs": aminoHasher(h.NumTxs), - "TotalTxs": aminoHasher(h.TotalTxs), - "LastBlockID": aminoHasher(h.LastBlockID), - "LastCommit": aminoHasher(h.LastCommitHash), - "Data": aminoHasher(h.DataHash), - "Validators": aminoHasher(h.ValidatorsHash), - "App": aminoHasher(h.AppHash), - "Consensus": aminoHasher(h.ConsensusHash), - "Results": aminoHasher(h.LastResultsHash), - "Evidence": aminoHasher(h.EvidenceHash), + "ChainID": aminoHasher(h.ChainID), + "Height": aminoHasher(h.Height), + "Time": aminoHasher(h.Time), + "NumTxs": aminoHasher(h.NumTxs), + "TotalTxs": aminoHasher(h.TotalTxs), + "LastBlockID": aminoHasher(h.LastBlockID), + "LastCommit": aminoHasher(h.LastCommitHash), + "Data": aminoHasher(h.DataHash), + "Validators": aminoHasher(h.ValidatorsHash), + "NextValidators": aminoHasher(h.NextValidatorsHash), + "App": aminoHasher(h.AppHash), + "Consensus": aminoHasher(h.ConsensusHash), + "Results": aminoHasher(h.LastResultsHash), + "Evidence": aminoHasher(h.EvidenceHash), }) } @@ -245,6 +247,7 @@ func (h *Header) StringIndented(indent string) string { %s LastCommit: %v %s Data: %v %s Validators: %v +%s NextValidators: %v %s App: %v %s Consensus: %v %s Results: %v @@ -259,6 +262,7 @@ func (h *Header) StringIndented(indent string) string { indent, h.LastCommitHash, indent, h.DataHash, indent, h.ValidatorsHash, + indent, h.NextValidatorsHash, indent, h.AppHash, indent, h.ConsensusHash, indent, h.LastResultsHash, diff --git a/types/validator_set.go b/types/validator_set.go index f2fac292..8f085090 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -46,7 +46,14 @@ func NewValidatorSet(vals []*Validator) *ValidatorSet { return vs } -// incrementAccum and update the proposer +// Increment Accum and update the proposer on a copy, and return it. +func (valSet *ValidatorSet) CopyIncrementAccum(times int) *ValidatorSet { + copy := valSet.Copy() + copy.IncrementAccum(times) + return copy +} + +// Increment Accum and update the proposer. func (valSet *ValidatorSet) IncrementAccum(times int) { // Add VotingPower * times to each validator and order into heap. validatorsHeap := cmn.NewHeap() @@ -387,7 +394,7 @@ func (valSet *ValidatorSet) StringIndented(indent string) string { %s}`, indent, valSet.GetProposer().String(), indent, - indent, strings.Join(valStrings, "\n"+indent+" "), + indent, strings.Join(valStrings, "\n"+indent+" "), indent) } From bf0ff212b94c6c9b8799d0adaa421a7f85c68208 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sat, 9 Jun 2018 04:25:48 -0700 Subject: [PATCH 002/149] Refactor "lite" to handle delayed validator set changes. Also, fix consensus liveness issue. --- Gopkg.lock | 21 +- Gopkg.toml | 6 +- blockchain/store_test.go | 8 +- consensus/common_test.go | 25 ++ consensus/state.go | 4 +- consensus/state_test.go | 18 +- libs/pubsub/pubsub.go | 3 +- lite/base_certifier.go | 72 ++++ ...rtifier_test.go => base_certifier_test.go} | 35 +- lite/client/main_test.go | 25 -- lite/client/provider.go | 164 ++++---- lite/client/provider_test.go | 62 +-- lite/commit.go | 148 ++++--- lite/dbprovider.go | 168 ++++++++ lite/doc.go | 210 +++++----- lite/dynamic_certifier.go | 96 ----- lite/dynamic_certifier_test.go | 130 ------- lite/errors/errors.go | 148 ++++--- lite/errors/errors_test.go | 18 - lite/files/commit.go | 93 ----- lite/files/commit_test.go | 66 ---- lite/files/provider.go | 139 ------- lite/files/provider_test.go | 96 ----- lite/files/wire.go | 12 - lite/helpers.go | 119 +++--- lite/inquiring_certifier.go | 268 +++++++------ lite/inquiring_certifier_test.go | 189 ++++----- lite/memprovider.go | 152 -------- lite/multiprovider.go | 72 ++++ lite/performance_test.go | 365 ------------------ lite/provider.go | 117 +----- lite/provider_test.go | 137 +++---- lite/proxy/block.go | 29 +- lite/proxy/certifier.go | 26 +- lite/proxy/errors.go | 24 +- lite/proxy/errors_test.go | 17 - lite/proxy/query.go | 40 +- lite/proxy/query_test.go | 24 +- lite/proxy/validate_test.go | 71 ++-- lite/proxy/wrapper.go | 27 +- lite/static_certifier.go | 73 ---- lite/types.go | 13 + privval/priv_validator_test.go | 11 +- privval/socket_test.go | 8 +- rpc/core/blocks.go | 6 +- rpc/core/consensus.go | 6 +- rpc/core/types/responses.go | 6 +- rpc/lib/server/http_server.go | 2 +- scripts/install_abci_apps.sh | 4 +- test/app/grpc_client.go | 4 +- types/block.go | 77 +++- types/canonical_json.go | 4 +- types/proposal.go | 2 +- types/validator_set.go | 325 ++++++++-------- types/vote_set.go | 6 +- 55 files changed, 1542 insertions(+), 2449 deletions(-) create mode 100644 lite/base_certifier.go rename lite/{static_certifier_test.go => base_certifier_test.go} (54%) delete mode 100644 lite/client/main_test.go create mode 100644 lite/dbprovider.go delete mode 100644 lite/dynamic_certifier.go delete mode 100644 lite/dynamic_certifier_test.go delete mode 100644 lite/errors/errors_test.go delete mode 100644 lite/files/commit.go delete mode 100644 lite/files/commit_test.go delete mode 100644 lite/files/provider.go delete mode 100644 lite/files/provider_test.go delete mode 100644 lite/files/wire.go delete mode 100644 lite/memprovider.go create mode 100644 lite/multiprovider.go delete mode 100644 lite/performance_test.go delete mode 100644 lite/proxy/errors_test.go delete mode 100644 lite/static_certifier.go create mode 100644 lite/types.go diff --git a/Gopkg.lock b/Gopkg.lock index f9729ffa..9dfc2a5f 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -7,6 +7,12 @@ packages = ["quantile"] revision = "3a771d992973f24aa725d07868b467d1ddfceafb" +[[projects]] + branch = "master" + name = "github.com/brejski/hid" + packages = ["."] + revision = "06112dcfcc50a7e0e4fd06e17f9791e788fdaafc" + [[projects]] branch = "master" name = "github.com/btcsuite/btcd" @@ -289,11 +295,8 @@ [[projects]] name = "github.com/tendermint/abci" packages = [ - "client", "example/code", - "example/counter", "example/kvstore", - "server", "types" ] revision = "198dccf0ddfd1bb176f87657e3286a05a6ed9540" @@ -327,10 +330,16 @@ "flowrate", "log", "merkle", + "merkle/tmhash", "test" ] - revision = "692f1d86a6e2c0efa698fd1e4541b68c74ffaf38" - version = "v0.8.4" + revision = "fb7ec62b2925f48de159aeea73b254ae8c58a738" + version = "v0.9.0-rc1" + +[[projects]] + name = "github.com/zondax/ledger-goclient" + packages = ["."] + revision = "3e2146609cdb97894c064d59e9d00accd8c2b1dd" [[projects]] branch = "master" @@ -435,6 +444,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "d17038089dd6383ff5028229d4026bb92f5c7adc7e9c1cd52584237e2e5fd431" + inputs-digest = "fcc5b0344f1e328b6abefa1a937d1161e14bbaef603e6f2065e6690531bc5de1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 4c32f3d8..d892405b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -69,13 +69,17 @@ name = "github.com/stretchr/testify" version = "~1.2.1" +[[constraint]] + name = "github.com/tendermint/abci" + version = "~0.12.0" + [[constraint]] name = "github.com/tendermint/go-amino" version = "~0.10.1" [[override]] name = "github.com/tendermint/tmlibs" - version = "~0.8.4" + version = "0.9.0-rc1" [[constraint]] name = "google.golang.org/grpc" diff --git a/blockchain/store_test.go b/blockchain/store_test.go index 1e0c223a..5cb18cdc 100644 --- a/blockchain/store_test.go +++ b/blockchain/store_test.go @@ -49,7 +49,7 @@ func TestNewBlockStore(t *testing.T) { return nil, nil }) require.NotNil(t, panicErr, "#%d panicCauser: %q expected a panic", i, tt.data) - assert.Contains(t, panicErr.Error(), tt.wantErr, "#%d data: %q", i, tt.data) + assert.Contains(t, fmt.Sprintf("%#v", panicErr), tt.wantErr, "#%d data: %q", i, tt.data) } db.Set(blockStoreKey, nil) @@ -238,7 +238,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) { if subStr := tuple.wantPanic; subStr != "" { if panicErr == nil { t.Errorf("#%d: want a non-nil panic", i) - } else if got := panicErr.Error(); !strings.Contains(got, subStr) { + } else if got := fmt.Sprintf("%#v", panicErr); !strings.Contains(got, subStr) { t.Errorf("#%d:\n\tgotErr: %q\nwant substring: %q", i, got, subStr) } continue @@ -287,7 +287,7 @@ func TestLoadBlockPart(t *testing.T) { db.Set(calcBlockPartKey(height, index), []byte("Tendermint")) res, _, panicErr = doFn(loadPart) require.NotNil(t, panicErr, "expecting a non-nil panic") - require.Contains(t, panicErr.Error(), "Error reading block part") + require.Contains(t, fmt.Sprintf("%#v", panicErr), "Error reading block part") // 3. A good block serialized and saved to the DB should be retrievable db.Set(calcBlockPartKey(height, index), cdc.MustMarshalBinaryBare(part1)) @@ -316,7 +316,7 @@ func TestLoadBlockMeta(t *testing.T) { db.Set(calcBlockMetaKey(height), []byte("Tendermint-Meta")) res, _, panicErr = doFn(loadMeta) require.NotNil(t, panicErr, "expecting a non-nil panic") - require.Contains(t, panicErr.Error(), "Error reading block meta") + require.Contains(t, fmt.Sprintf("%#v", panicErr), "Error reading block meta") // 3. A good blockMeta serialized and saved to the DB should be retrievable meta := &types.BlockMeta{} diff --git a/consensus/common_test.go b/consensus/common_test.go index b990f525..8c5aa6c9 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "path" + "reflect" "sort" "sync" "testing" @@ -325,6 +326,30 @@ func ensureNewStep(stepCh <-chan interface{}) { } } +func ensureVote(voteCh chan interface{}, height int64, round int, voteType byte) { + timer := time.NewTimer(ensureTimeout) + select { + case <-timer.C: + break + case v := <-voteCh: + edv, ok := v.(types.EventDataVote) + if !ok { + panic(fmt.Sprintf("expected a *types.Vote, got %v. wrong subscription channel?", + reflect.TypeOf(v))) + } + vote := edv.Vote + if vote.Height != height { + panic(fmt.Sprintf("expected height %v, got %v", height, vote.Height)) + } + if vote.Round != round { + panic(fmt.Sprintf("expected round %v, got %v", round, vote.Round)) + } + if vote.Type != voteType { + panic(fmt.Sprintf("expected type %v, got %v", voteType, vote.Type)) + } + } +} + //------------------------------------------------------------------------------- // consensus nets diff --git a/consensus/state.go b/consensus/state.go index a12345d7..93e1f6b4 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1594,7 +1594,9 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, blockID, ok := precommits.TwoThirdsMajority() if ok { if len(blockID.Hash) == 0 { - cs.enterNewRound(height, vote.Round+1) + cs.enterNewRound(height, vote.Round) + cs.enterPrecommit(height, vote.Round) + cs.enterPrecommitWait(height, vote.Round) } else { cs.enterNewRound(height, vote.Round) cs.enterPrecommit(height, vote.Round) diff --git a/consensus/state_test.go b/consensus/state_test.go index ece70dd5..307a3993 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -718,6 +718,8 @@ func TestStateLockPOLUnlock(t *testing.T) { func TestStateLockPOLSafety1(t *testing.T) { cs1, vss := randConsensusState(4) vs2, vs3, vs4 := vss[1], vss[2], vss[3] + h := cs1.GetRoundState().Height + r := cs1.GetRoundState().Round partSize := cs1.state.ConsensusParams.BlockPartSizeBytes @@ -734,7 +736,7 @@ func TestStateLockPOLSafety1(t *testing.T) { rs := re.(types.EventDataRoundState).RoundState.(*cstypes.RoundState) propBlock := rs.ProposalBlock - <-voteCh // prevote + ensureVote(voteCh, h, r, types.VoteTypePrevote) validatePrevote(t, cs1, 0, vss[0], propBlock.Hash()) @@ -755,6 +757,11 @@ func TestStateLockPOLSafety1(t *testing.T) { // we do see them precommit nil signAddVotes(cs1, types.VoteTypePrecommit, nil, types.PartSetHeader{}, vs2, vs3, vs4) + ensureVote(voteCh, h, r, types.VoteTypePrecommit) + + <-newRoundCh + t.Log("### ONTO ROUND 1") + prop, propBlock := decideProposal(cs1, vs2, vs2.Height, vs2.Round+1) propBlockHash := propBlock.Hash() propBlockParts := propBlock.MakePartSet(partSize) @@ -765,9 +772,6 @@ func TestStateLockPOLSafety1(t *testing.T) { if err := cs1.SetProposalAndBlock(prop, propBlock, propBlockParts, "some peer"); err != nil { t.Fatal(err) } - - <-newRoundCh - t.Log("### ONTO ROUND 1") /*Round2 // we timeout and prevote our lock // a polka happened but we didn't see it! @@ -788,13 +792,13 @@ func TestStateLockPOLSafety1(t *testing.T) { } t.Logf("new prop hash %v", fmt.Sprintf("%X", propBlockHash)) // go to prevote, prevote for proposal block - <-voteCh + ensureVote(voteCh, h, r+1, types.VoteTypePrevote) validatePrevote(t, cs1, 1, vss[0], propBlockHash) // now we see the others prevote for it, so we should lock on it signAddVotes(cs1, types.VoteTypePrevote, propBlockHash, propBlockParts.Header(), vs2, vs3, vs4) - <-voteCh // precommit + ensureVote(voteCh, h, r+1, types.VoteTypePrecommit) // we should have precommitted validatePrecommit(t, cs1, 1, 1, vss[0], propBlockHash, propBlockHash) @@ -816,7 +820,7 @@ func TestStateLockPOLSafety1(t *testing.T) { <-timeoutProposeCh // finish prevote - <-voteCh + ensureVote(voteCh, h, r+2, types.VoteTypePrevote) // we should prevote what we're locked on validatePrevote(t, cs1, 2, vss[0], propBlockHash) diff --git a/libs/pubsub/pubsub.go b/libs/pubsub/pubsub.go index 776e0653..df7bc7a4 100644 --- a/libs/pubsub/pubsub.go +++ b/libs/pubsub/pubsub.go @@ -283,7 +283,8 @@ loop: } func (state *state) add(clientID string, q Query, ch chan<- interface{}) { - // add query if needed + + // initialize clientToChannelMap per query if needed if _, ok := state.queries[q]; !ok { state.queries[q] = make(map[string]chan<- interface{}) } diff --git a/lite/base_certifier.go b/lite/base_certifier.go new file mode 100644 index 00000000..6f2b3da9 --- /dev/null +++ b/lite/base_certifier.go @@ -0,0 +1,72 @@ +package lite + +import ( + "bytes" + + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" + cmn "github.com/tendermint/tmlibs/common" +) + +var _ Certifier = (*BaseCertifier)(nil) + +// BaseCertifier lets us check the validity of SignedHeaders at height or +// later, requiring sufficient votes (> 2/3) from the given valset. +// To certify blocks produced by a blockchain with mutable validator sets, +// use the InquiringCertifier. +// TODO: Handle unbonding time. +type BaseCertifier struct { + chainID string + height int64 + valset *types.ValidatorSet +} + +// NewBaseCertifier returns a new certifier initialized with a validator set at +// some height. +func NewBaseCertifier(chainID string, height int64, valset *types.ValidatorSet) *BaseCertifier { + if valset == nil || len(valset.Hash()) == 0 { + panic("NewBaseCertifier requires a valid valset") + } + return &BaseCertifier{ + chainID: chainID, + height: height, + valset: valset, + } +} + +// Implements Certifier. +func (bc *BaseCertifier) ChainID() string { + return bc.chainID +} + +// Implements Certifier. +func (bc *BaseCertifier) Certify(signedHeader types.SignedHeader) error { + + // We can't certify commits older than bc.height. + if signedHeader.Height < bc.height { + return cmn.NewError("BaseCertifier height is %v, cannot certify height %v", + bc.height, signedHeader.Height) + } + + // We can't certify with the wrong validator set. + if !bytes.Equal(signedHeader.ValidatorsHash, + bc.valset.Hash()) { + return lerr.ErrUnexpectedValidators(signedHeader.ValidatorsHash, bc.valset.Hash()) + } + + // Do basic sanity checks. + err := signedHeader.ValidateBasic(bc.chainID) + if err != nil { + return cmn.ErrorWrap(err, "in certify") + } + + // Check commit signatures. + err = bc.valset.VerifyCommit( + bc.chainID, signedHeader.Commit.BlockID, + signedHeader.Height, signedHeader.Commit) + if err != nil { + return cmn.ErrorWrap(err, "in certify") + } + + return nil +} diff --git a/lite/static_certifier_test.go b/lite/base_certifier_test.go similarity index 54% rename from lite/static_certifier_test.go rename to lite/base_certifier_test.go index 03567daa..20342c90 100644 --- a/lite/static_certifier_test.go +++ b/lite/base_certifier_test.go @@ -1,59 +1,58 @@ -package lite_test +package lite import ( "testing" "github.com/stretchr/testify/assert" + lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" ) -func TestStaticCert(t *testing.T) { +func TestBaseCert(t *testing.T) { // assert, require := assert.New(t), require.New(t) assert := assert.New(t) // require := require.New(t) - keys := lite.GenValKeys(4) + keys := genPrivKeys(4) // 20, 30, 40, 50 - the first 3 don't have 2/3, the last 3 do! vals := keys.ToValidators(20, 10) // and a certifier based on our known set chainID := "test-static" - cert := lite.NewStaticCertifier(chainID, vals) + cert := NewBaseCertifier(chainID, 2, vals) cases := []struct { - keys lite.ValKeys + keys privKeys vals *types.ValidatorSet height int64 first, last int // who actually signs proper bool // true -> expect no error changed bool // true -> expect validator change error }{ + // height regression + {keys, vals, 1, 0, len(keys), false, false}, // perfect, signed by everyone - {keys, vals, 1, 0, len(keys), true, false}, + {keys, vals, 2, 0, len(keys), true, false}, // skip little guy is okay - {keys, vals, 2, 1, len(keys), true, false}, + {keys, vals, 3, 1, len(keys), true, false}, // but not the big guy - {keys, vals, 3, 0, len(keys) - 1, false, false}, - // even changing the power a little bit breaks the static validator - // the sigs are enough, but the validator hash is unknown - {keys, keys.ToValidators(20, 11), 4, 0, len(keys), false, true}, + {keys, vals, 4, 0, len(keys) - 1, false, false}, + // Changing the power a little bit breaks the static validator. + // The sigs are enough, but the validator hash is unknown. + {keys, keys.ToValidators(20, 11), 5, 0, len(keys), false, true}, } for _, tc := range cases { - check := tc.keys.GenCommit(chainID, tc.height, nil, tc.vals, + sh := tc.keys.GenSignedHeader(chainID, tc.height, nil, tc.vals, tc.vals, []byte("foo"), []byte("params"), []byte("results"), tc.first, tc.last) - err := cert.Certify(check) + err := cert.Certify(sh) if tc.proper { assert.Nil(err, "%+v", err) } else { assert.NotNil(err) if tc.changed { - assert.True(liteErr.IsValidatorsChangedErr(err), "%+v", err) + assert.True(lerr.IsErrUnexpectedValidators(err), "%+v", err) } } } - } diff --git a/lite/client/main_test.go b/lite/client/main_test.go deleted file mode 100644 index 49b19436..00000000 --- a/lite/client/main_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package client_test - -import ( - "os" - "testing" - - "github.com/tendermint/tendermint/abci/example/kvstore" - - nm "github.com/tendermint/tendermint/node" - rpctest "github.com/tendermint/tendermint/rpc/test" -) - -var node *nm.Node - -func TestMain(m *testing.M) { - // start a tendermint node (and merkleeyes) in the background to test against - app := kvstore.NewKVStoreApplication() - node = rpctest.StartTendermint(app) - code := m.Run() - - // and shut down proper at the end - node.Stop() - node.Wait() - os.Exit(code) -} diff --git a/lite/client/provider.go b/lite/client/provider.go index 5f3d7245..188ce7d0 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -1,19 +1,19 @@ /* Package client defines a provider that uses a rpcclient to get information, which is used to get new headers -and validators directly from a node. +and validators directly from a Tendermint client. */ package client import ( - "bytes" + "fmt" rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" + lerr "github.com/tendermint/tendermint/lite/errors" ) // SignStatusClient combines a SignClient and StatusClient. @@ -23,119 +23,111 @@ type SignStatusClient interface { } type provider struct { - node SignStatusClient - lastHeight int64 + chainID string + client SignStatusClient } -// NewProvider can wrap any rpcclient to expose it as -// a read-only provider. -func NewProvider(node SignStatusClient) lite.Provider { - return &provider{node: node} +// NewProvider implements Provider (but not PersistentProvider). +func NewProvider(chainID string, client SignStatusClient) lite.Provider { + return &provider{chainID: chainID, client: client} } // NewHTTPProvider can connect to a tendermint json-rpc endpoint // at the given url, and uses that as a read-only provider. -func NewHTTPProvider(remote string) lite.Provider { +func NewHTTPProvider(chainID, remote string) lite.Provider { return &provider{ - node: rpcclient.NewHTTP(remote, "/websocket"), + chainID: chainID, + client: rpcclient.NewHTTP(remote, "/websocket"), } } -// StatusClient returns the internal node as a StatusClient +// StatusClient returns the internal client as a StatusClient func (p *provider) StatusClient() rpcclient.StatusClient { - return p.node + return p.client } -// StoreCommit is a noop, as clients can only read from the chain... -func (p *provider) StoreCommit(_ lite.FullCommit) error { return nil } - -// GetHash gets the most recent validator and sees if it matches -// -// TODO: improve when the rpc interface supports more functionality -func (p *provider) GetByHash(hash []byte) (lite.FullCommit, error) { - var fc lite.FullCommit - vals, err := p.node.Validators(nil) - // if we get no validators, or a different height, return an error +// LatestFullCommit implements Provider. +func (p *provider) LatestFullCommit(chainID string, minHeight, maxHeight int64) (fc lite.FullCommit, err error) { + if chainID != p.chainID { + err = fmt.Errorf("expected chainID %s, got %s", p.chainID, chainID) + return + } + if maxHeight != 0 && maxHeight < minHeight { + err = fmt.Errorf("need maxHeight == 0 or minHeight <= maxHeight, got %v and %v", + minHeight, maxHeight) + return + } + commit, err := p.fetchLatestCommit(minHeight, maxHeight) if err != nil { - return fc, err + return } - p.updateHeight(vals.BlockHeight) - vhash := types.NewValidatorSet(vals.Validators).Hash() - if !bytes.Equal(hash, vhash) { - return fc, liteErr.ErrCommitNotFound() - } - return p.seedFromVals(vals) + fc, err = p.fillFullCommit(commit.SignedHeader) + return } -// GetByHeight gets the validator set by height -func (p *provider) GetByHeight(h int64) (fc lite.FullCommit, err error) { - commit, err := p.node.Commit(&h) - if err != nil { - return fc, err - } - return p.seedFromCommit(commit) -} - -// LatestCommit returns the newest commit stored. -func (p *provider) LatestCommit() (fc lite.FullCommit, err error) { - commit, err := p.GetLatestCommit() - if err != nil { - return fc, err - } - return p.seedFromCommit(commit) -} - -// GetLatestCommit should return the most recent commit there is, -// which handles queries for future heights as per the semantics -// of GetByHeight. -func (p *provider) GetLatestCommit() (*ctypes.ResultCommit, error) { - status, err := p.node.Status() +// fetchLatestCommit fetches the latest commit from the client. +func (p *provider) fetchLatestCommit(minHeight int64, maxHeight int64) (*ctypes.ResultCommit, error) { + status, err := p.client.Status() if err != nil { return nil, err } - return p.node.Commit(&status.SyncInfo.LatestBlockHeight) + if status.SyncInfo.LatestBlockHeight < minHeight { + err = fmt.Errorf("provider is at %v but require minHeight=%v", + status.SyncInfo.LatestBlockHeight, minHeight) + return nil, err + } + if maxHeight == 0 { + maxHeight = status.SyncInfo.LatestBlockHeight + } else if status.SyncInfo.LatestBlockHeight < maxHeight { + maxHeight = status.SyncInfo.LatestBlockHeight + } + return p.client.Commit(&maxHeight) } -// CommitFromResult ... -func CommitFromResult(result *ctypes.ResultCommit) lite.Commit { - return (lite.Commit)(result.SignedHeader) +// Implements Provider. +func (p *provider) ValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + return p.getValidatorSet(chainID, height) } -func (p *provider) seedFromVals(vals *ctypes.ResultValidators) (lite.FullCommit, error) { - // now get the commits and build a full commit - commit, err := p.node.Commit(&vals.BlockHeight) +func (p *provider) getValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + if chainID != p.chainID { + err = fmt.Errorf("expected chainID %s, got %s", p.chainID, chainID) + return + } + if height < 1 { + err = fmt.Errorf("expected height >= 1, got %v", height) + return + } + heightPtr := new(int64) + *heightPtr = height + res, err := p.client.Validators(heightPtr) + if err != nil { + // TODO pass through other types of errors. + return nil, lerr.ErrMissingValidators(chainID, height) + } + valset = types.NewValidatorSet(res.Validators) + valset.TotalVotingPower() // to test deep equality. + return +} + +// This does no validation. +func (p *provider) fillFullCommit(signedHeader types.SignedHeader) (fc lite.FullCommit, err error) { + fc.SignedHeader = signedHeader + + // Get the validators. + valset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height) if err != nil { return lite.FullCommit{}, err } - fc := lite.NewFullCommit( - CommitFromResult(commit), - types.NewValidatorSet(vals.Validators), - ) - return fc, nil -} + fc.Validators = valset -func (p *provider) seedFromCommit(commit *ctypes.ResultCommit) (fc lite.FullCommit, err error) { - fc.Commit = CommitFromResult(commit) - - // now get the proper validators - vals, err := p.node.Validators(&commit.Header.Height) + // Get the next validators. + nvalset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height+1) if err != nil { - return fc, err + return lite.FullCommit{}, err + } else { + fc.NextValidators = nvalset } - // make sure they match the commit (as we cannot enforce height) - vset := types.NewValidatorSet(vals.Validators) - if !bytes.Equal(vset.Hash(), commit.Header.ValidatorsHash) { - return fc, liteErr.ErrValidatorsChanged() - } - - p.updateHeight(commit.Header.Height) - fc.Validators = vset return fc, nil } - -func (p *provider) updateHeight(h int64) { - if h > p.lastHeight { - p.lastHeight = h - } -} diff --git a/lite/client/provider_test.go b/lite/client/provider_test.go index 94d47da3..2385bbbe 100644 --- a/lite/client/provider_test.go +++ b/lite/client/provider_test.go @@ -1,63 +1,73 @@ package client import ( + "os" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/abci/example/kvstore" rpcclient "github.com/tendermint/tendermint/rpc/client" rpctest "github.com/tendermint/tendermint/rpc/test" "github.com/tendermint/tendermint/types" ) +// TODO fix tests!! +func TestMain(m *testing.M) { + app := kvstore.NewKVStoreApplication() + node := rpctest.StartTendermint(app) + + code := m.Run() + + node.Stop() + node.Wait() + os.Exit(code) +} + func TestProvider(t *testing.T) { assert, require := assert.New(t), require.New(t) cfg := rpctest.GetConfig() rpcAddr := cfg.RPC.ListenAddress - genDoc, _ := types.GenesisDocFromFile(cfg.GenesisFile()) + genDoc, err := types.GenesisDocFromFile(cfg.GenesisFile()) + if err != nil { + panic(err) + } chainID := genDoc.ChainID - p := NewHTTPProvider(rpcAddr) + t.Log("chainID:", chainID) + p := NewHTTPProvider(chainID, rpcAddr) require.NotNil(t, p) // let it produce some blocks - err := rpcclient.WaitForHeight(p.(*provider).node, 6, nil) + err = rpcclient.WaitForHeight(p.(*provider).client, 6, nil) require.Nil(err) // let's get the highest block - seed, err := p.LatestCommit() + fc, err := p.LatestFullCommit(chainID, 1, 1<<63-1) require.Nil(err, "%+v", err) - sh := seed.Height() - vhash := seed.Header.ValidatorsHash + sh := fc.Height() assert.True(sh < 5000) // let's check this is valid somehow - assert.Nil(seed.ValidateBasic(chainID)) - cert := lite.NewStaticCertifier(chainID, seed.Validators) + assert.Nil(fc.ValidateBasic(chainID)) // historical queries now work :) lower := sh - 5 - seed, err = p.GetByHeight(lower) + fc, err = p.LatestFullCommit(chainID, lower, lower) assert.Nil(err, "%+v", err) - assert.Equal(lower, seed.Height()) + assert.Equal(lower, fc.Height()) - // also get by hash (given the match) - seed, err = p.GetByHash(vhash) - require.Nil(err, "%+v", err) - require.Equal(vhash, seed.Header.ValidatorsHash) - err = cert.Certify(seed.Commit) - assert.Nil(err, "%+v", err) + /* + // also get by hash (given the match) + fc, err = p.GetByHash(vhash) + require.Nil(err, "%+v", err) + require.Equal(vhash, fc.Header.ValidatorsHash) - // get by hash fails without match - seed, err = p.GetByHash([]byte("foobar")) - assert.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) - - // storing the seed silently ignored - err = p.StoreCommit(seed) - assert.Nil(err, "%+v", err) + // get by hash fails without match + fc, err = p.GetByHash([]byte("foobar")) + assert.NotNil(err) + assert.True(liteErr.IsCommitNotFoundErr(err)) + */ } diff --git a/lite/commit.go b/lite/commit.go index 11ae6d7f..8449bf69 100644 --- a/lite/commit.go +++ b/lite/commit.go @@ -2,98 +2,92 @@ package lite import ( "bytes" - - "github.com/pkg/errors" + "errors" + "fmt" "github.com/tendermint/tendermint/types" - - liteErr "github.com/tendermint/tendermint/lite/errors" ) -// Certifier checks the votes to make sure the block really is signed properly. -// Certifier must know the current set of validitors by some other means. -type Certifier interface { - Certify(check Commit) error - ChainID() string -} - -// Commit is basically the rpc /commit response, but extended -// -// This is the basepoint for proving anything on the blockchain. It contains -// a signed header. If the signatures are valid and > 2/3 of the known set, -// we can store this checkpoint and use it to prove any number of aspects of -// the system: such as txs, abci state, validator sets, etc... -type Commit types.SignedHeader - -// FullCommit is a commit and the actual validator set, -// the base info you need to update to a given point, -// assuming knowledge of some previous validator set +// FullCommit is a signed header (the block header and a commit that signs it), +// the validator set which signed the commit, and the next validator set. The +// next validator set (which is proven from the block header) allows us to +// revert to block-by-block updating of lite certifier's latest validator set, +// even in the face of arbitrarily power changes. type FullCommit struct { - Commit `json:"commit"` - Validators *types.ValidatorSet `json:"validator_set"` + SignedHeader types.SignedHeader `json:"signed_header"` + Validators *types.ValidatorSet `json:"validator_set"` + NextValidators *types.ValidatorSet `json:"next_validator_set"` } // NewFullCommit returns a new FullCommit. -func NewFullCommit(commit Commit, vals *types.ValidatorSet) FullCommit { +func NewFullCommit(signedHeader types.SignedHeader, valset, nvalset *types.ValidatorSet) FullCommit { return FullCommit{ - Commit: commit, - Validators: vals, + SignedHeader: signedHeader, + Validators: valset, + NextValidators: nvalset, } } +// Validate the components and check for consistency. +// This also checks to make sure that Validators actually +// signed the SignedHeader.Commit. +// If > 2/3 did not sign the Commit from fc.Validators, it +// is not a valid commit! +func (fc FullCommit) ValidateBasic(chainID string) error { + // Ensure that Validators exists and matches the header. + if fc.Validators.Size() == 0 { + return errors.New("need FullCommit.Validators") + } + if !bytes.Equal( + fc.SignedHeader.ValidatorsHash, + fc.Validators.Hash()) { + return fmt.Errorf("header has vhash %X but valset hash is %X", + fc.SignedHeader.ValidatorsHash, + fc.Validators.Hash(), + ) + } + // Ensure that NextValidators exists and matches the header. + if fc.NextValidators.Size() == 0 { + return errors.New("need FullCommit.NextValidators") + } + if !bytes.Equal( + fc.SignedHeader.NextValidatorsHash, + fc.NextValidators.Hash()) { + return fmt.Errorf("header has next vhash %X but next valset hash is %X", + fc.SignedHeader.NextValidatorsHash, + fc.NextValidators.Hash(), + ) + } + // Validate the header. + err := fc.SignedHeader.ValidateBasic(chainID) + if err != nil { + return err + } + // Validate the signatures on the commit. + hdr, cmt := fc.SignedHeader.Header, fc.SignedHeader.Commit + err = fc.Validators.VerifyCommit( + hdr.ChainID, cmt.BlockID, + hdr.Height, cmt) + if err != nil { + return err + } + + // All good! + return nil +} + // Height returns the height of the header. -func (c Commit) Height() int64 { - if c.Header == nil { - return 0 +func (fc FullCommit) Height() int64 { + if fc.SignedHeader.Header == nil { + panic("should not happen") } - return c.Header.Height + return fc.SignedHeader.Height } -// ValidatorsHash returns the hash of the validator set. -func (c Commit) ValidatorsHash() []byte { - if c.Header == nil { - return nil +// ChainID returns the chainID of the header. +func (fc FullCommit) ChainID() string { + if fc.SignedHeader.Header == nil { + panic("should not happen") } - return c.Header.ValidatorsHash -} - -// ValidateBasic does basic consistency checks and makes sure the headers -// and commits are all consistent and refer to our chain. -// -// Make sure to use a Verifier to validate the signatures actually provide -// a significantly strong proof for this header's validity. -func (c Commit) ValidateBasic(chainID string) error { - // make sure the header is reasonable - if c.Header == nil { - return errors.New("Commit missing header") - } - if c.Header.ChainID != chainID { - return errors.Errorf("Header belongs to another chain '%s' not '%s'", - c.Header.ChainID, chainID) - } - - if c.Commit == nil { - return errors.New("Commit missing signatures") - } - - // make sure the header and commit match (height and hash) - if c.Commit.Height() != c.Header.Height { - return liteErr.ErrHeightMismatch(c.Commit.Height(), c.Header.Height) - } - hhash := c.Header.Hash() - chash := c.Commit.BlockID.Hash - if !bytes.Equal(hhash, chash) { - return errors.Errorf("Commits sign block %X header is block %X", - chash, hhash) - } - - // make sure the commit is reasonable - err := c.Commit.ValidateBasic() - if err != nil { - return errors.WithStack(err) - } - - // looks good, we just need to make sure the signatures are really from - // empowered validators - return nil + return fc.SignedHeader.ChainID } diff --git a/lite/dbprovider.go b/lite/dbprovider.go new file mode 100644 index 00000000..834bab66 --- /dev/null +++ b/lite/dbprovider.go @@ -0,0 +1,168 @@ +package lite + +import ( + "fmt" + "regexp" + "strconv" + + amino "github.com/tendermint/go-amino" + crypto "github.com/tendermint/tendermint/crypto" + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" + dbm "github.com/tendermint/tmlibs/db" +) + +func signedHeaderKey(chainID string, height int64) []byte { + return []byte(fmt.Sprintf("%s/%010d/sh", chainID, height)) +} + +var signedHeaderKeyPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/sh`) + +func parseSignedHeaderKey(key []byte) (chainID string, height int64, ok bool) { + submatch := signedHeaderKeyPattern.FindSubmatch(key) + if submatch == nil { + return "", 0, false + } + chainID = string(submatch[1]) + heightStr := string(submatch[2]) + heightInt, err := strconv.Atoi(heightStr) + if err != nil { + return "", 0, false + } + height = int64(heightInt) + ok = true // good! + return +} + +func validatorSetKey(chainID string, height int64) []byte { + return []byte(fmt.Sprintf("%s/%010d/vs", chainID, height)) +} + +type DBProvider struct { + chainID string + db dbm.DB + cdc *amino.Codec +} + +func NewDBProvider(db dbm.DB) *DBProvider { + //db = dbm.NewDebugDB("db provider "+cmn.RandStr(4), db) + cdc := amino.NewCodec() + crypto.RegisterAmino(cdc) + dbp := &DBProvider{db: db, cdc: cdc} + return dbp +} + +// Implements PersistentProvider. +func (dbp *DBProvider) SaveFullCommit(fc FullCommit) error { + + batch := dbp.db.NewBatch() + + // Save the fc.validators. + // We might be overwriting what we already have, but + // it makes the logic easier for now. + vsKey := validatorSetKey(fc.ChainID(), fc.Height()) + vsBz, err := dbp.cdc.MarshalBinary(fc.Validators) + if err != nil { + return err + } + batch.Set(vsKey, vsBz) + + // Save the fc.NextValidators. + nvsKey := validatorSetKey(fc.ChainID(), fc.Height()+1) + nvsBz, err := dbp.cdc.MarshalBinary(fc.NextValidators) + if err != nil { + return err + } + batch.Set(nvsKey, nvsBz) + + // Save the fc.SignedHeader + shKey := signedHeaderKey(fc.ChainID(), fc.Height()) + shBz, err := dbp.cdc.MarshalBinary(fc.SignedHeader) + if err != nil { + return err + } + batch.Set(shKey, shBz) + + // And write sync. + batch.WriteSync() + return nil +} + +// Implements Provider. +func (dbp *DBProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) ( + FullCommit, error) { + + if minHeight <= 0 { + minHeight = 1 + } + if maxHeight == 0 { + maxHeight = 1<<63 - 1 + } + + itr := dbp.db.ReverseIterator( + signedHeaderKey(chainID, maxHeight), + signedHeaderKey(chainID, minHeight-1), + ) + defer itr.Close() + + for itr.Valid() { + key := itr.Key() + _, _, ok := parseSignedHeaderKey(key) + if !ok { + // Skip over other keys. + itr.Next() + continue + } else { + // Found the latest full commit signed header. + shBz := itr.Value() + sh := types.SignedHeader{} + err := dbp.cdc.UnmarshalBinary(shBz, &sh) + if err != nil { + return FullCommit{}, err + } else { + return dbp.fillFullCommit(sh) + } + } + } + return FullCommit{}, lerr.ErrCommitNotFound() +} + +func (dbp *DBProvider) ValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + return dbp.getValidatorSet(chainID, height) +} + +func (dbp *DBProvider) getValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + vsBz := dbp.db.Get(validatorSetKey(chainID, height)) + if vsBz == nil { + err = lerr.ErrMissingValidators(chainID, height) + return + } + err = dbp.cdc.UnmarshalBinary(vsBz, &valset) + if err != nil { + return + } + valset.TotalVotingPower() // to test deep equality. + return +} + +func (dbp *DBProvider) fillFullCommit(sh types.SignedHeader) (FullCommit, error) { + var chainID = sh.ChainID + var height = sh.Height + var valset, nvalset *types.ValidatorSet + // Load the validator set. + valset, err := dbp.getValidatorSet(chainID, height) + if err != nil { + return FullCommit{}, err + } + // Load the next validator set. + nvalset, err = dbp.getValidatorSet(chainID, height+1) + if err != nil { + return FullCommit{}, err + } + // Return filled FullCommit. + return FullCommit{ + SignedHeader: sh, + Validators: valset, + NextValidators: nvalset, + }, nil +} diff --git a/lite/doc.go b/lite/doc.go index 89dc702f..881880f6 100644 --- a/lite/doc.go +++ b/lite/doc.go @@ -1,133 +1,139 @@ /* -Package lite allows you to securely validate headers -without a full node. +Package lite allows you to securely validate headers without a full node. -This library pulls together all the crypto and algorithms, -so given a relatively recent (< unbonding period) known -validator set, one can get indisputable proof that data is in -the chain (current state) or detect if the node is lying to -the client. +This library pulls together all the crypto and algorithms, so given a +relatively recent (< unbonding period) known validator set, one can get +indisputable proof that data is in the chain (current state) or detect if the +node is lying to the client. -Tendermint RPC exposes a lot of info, but a malicious node -could return any data it wants to queries, or even to block -headers, even making up fake signatures from non-existent -validators to justify it. This is a lot of logic to get -right, to be contained in a small, easy to use library, -that does this for you, so you can just build nice UI. +Tendermint RPC exposes a lot of info, but a malicious node could return any +data it wants to queries, or even to block headers, even making up fake +signatures from non-existent validators to justify it. This is a lot of logic +to get right, to be contained in a small, easy to use library, that does this +for you, so you can just build nice applications. -We design for clients who have no strong trust relationship -with any tendermint node, just the validator set as a whole. -Beyond building nice mobile or desktop applications, the -cosmos hub is another important example of a client, -that needs undeniable proof without syncing the full chain, -in order to efficiently implement IBC. +We design for clients who have no strong trust relationship with any Tendermint +node, just the blockchain and validator set as a whole. -Commits +# Data structures -There are two main data structures that we pass around - Commit -and FullCommit. Both of them mirror what information is -exposed in tendermint rpc. +## SignedHeader -Commit is a block header along with enough validator signatures -to prove its validity (> 2/3 of the voting power). A FullCommit -is a Commit along with the full validator set. When the -validator set doesn't change, the Commit is enough, but since -the block header only has a hash, we need the FullCommit to -follow any changes to the validator set. +SignedHeader is a block header along with a commit -- enough validator +precommit-vote signatures to prove its validity (> 2/3 of the voting power) +given the validator set responsible for signing that header. A FullCommit is a +SignedHeader along with the current and next validator sets. -Certifiers +The hash of the next validator set is included and signed in the SignedHeader. +This lets the lite client keep track of arbitrary changes to the validator set, +as every change to the validator set must be approved by inclusion in the +header and signed in the commit. -A Certifier validates a new Commit given the currently known -state. There are three different types of Certifiers exposed, -each one building on the last one, with additional complexity. +In the worst case, with every block changing the validators around completely, +a lite client can sync up with every block header to verify each validator set +change on the chain. In practice, most applications will not have frequent +drastic updates to the validator set, so the logic defined in this package for +lite client syncing is optimized to use intelligent bisection and +block-skipping for efficient sourcing and verification of these data structures +and updates to the validator set (see the InquiringCertifier for more +information). -Static - given the validator set upon initialization. Verifies -all signatures against that set and if the validator set -changes, it will reject all headers. +The FullCommit is also declared in this package as a convenience structure, +which includes the SignedHeader along with the full current and next +ValidatorSets. -Dynamic - This wraps Static and has the same Certify -method. However, it adds an Update method, which can be called -with a FullCommit when the validator set changes. If it can -prove this is a valid transition, it will update the validator -set. +## Certifier -Inquiring - this wraps Dynamic and implements an auto-update -strategy on top of the Dynamic update. If a call to -Certify fails as the validator set has changed, then it -attempts to find a FullCommit and Update to that header. -To get these FullCommits, it makes use of a Provider. +A Certifier validates a new SignedHeader given the currently known state. There +are two different types of Certifiers provided. -Providers +BaseCertifier - given a validator set and a height, this Certifier verifies +that > 2/3 of the voting power of the given validator set had signed the +SignedHeader, and that the SignedHeader was to be signed by the exact given +validator set, and that the height of the commit is at least height (or +greater). -A Provider allows us to store and retrieve the FullCommits, -to provide memory to the Inquiring Certifier. +SignedHeader.Commit may be signed by a different validator set, it can get +certified with a BaseCertifier as long as sufficient signatures from the +previous validator set are present in the commit. -NewMemStoreProvider - in-memory cache. +InquiringCertifier - this certifier implements an auto-update and persistence +strategy to certify any SignedHeader of the blockchain. -files.NewProvider - disk backed storage. +## Provider and PersistentProvider -client.NewHTTPProvider - query tendermint rpc. +A Provider allows us to store and retrieve the FullCommits. -NewCacheProvider - combine multiple providers. +```go +type Provider interface { + // LatestFullCommit returns the latest commit with + // minHeight <= height <= maxHeight. + // If maxHeight is zero, returns the latest where + // minHeight <= height. + LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error) +} +``` -The suggested use for local light clients is -client.NewHTTPProvider for getting new data (Source), -and NewCacheProvider(NewMemStoreProvider(), -files.NewProvider()) to store confirmed headers (Trusted) +* client.NewHTTPProvider - query Tendermint rpc. -How We Track Validators +A PersistentProvider is a Provider that also allows for saving state. This is +used by the InquiringCertifier for persistence. -Unless you want to blindly trust the node you talk with, you -need to trace every response back to a hash in a block header -and validate the commit signatures of that block header match -the proper validator set. If there is a contant validator -set, you store it locally upon initialization of the client, +```go +type PersistentProvider interface { + Provider + + // SaveFullCommit saves a FullCommit (without verification). + SaveFullCommit(fc FullCommit) error +} +``` + +* DBProvider - persistence provider for use with any tmlibs/DB. +* MultiProvider - combine multiple providers. + +The suggested use for local light clients is client.NewHTTPProvider(...) for +getting new data (Source), and NewMultiProvider(NewDBProvider(dbm.NewMemDB()), +NewDBProvider(db.NewFileDB(...))) to store confirmed full commits (Trusted) + + +# How We Track Validators + +Unless you want to blindly trust the node you talk with, you need to trace +every response back to a hash in a block header and validate the commit +signatures of that block header match the proper validator set. If there is a +static validator set, you store it locally upon initialization of the client, and check against that every time. -Once there is a dynamic validator set, the issue of -verifying a block becomes a bit more tricky. There is -background information in a -github issue (https://github.com/tendermint/tendermint/issues/377). +If the validator set for the blockchain is dynamic, verifying block commits is +a bit more involved -- if there is a block at height H with a known (trusted) +validator set V, and another block at height H' (H' > H) with validator set V' +!= V, then we want a way to safely update it. -In short, if there is a block at height H with a known -(trusted) validator set V, and another block at height H' -(H' > H) with validator set V' != V, then we want a way to -safely update it. +First, we get the new (unconfirmed) validator set V' and verify that H' is +internally consistent and properly signed by this V'. Assuming it is a valid +block, we check that at least 2/3 of the validators in V also signed it, +meaning it would also be valid under our old assumptions. Then, we accept H' +and V' as valid and trusted and use that to validate for heights X > H' until a +more recent and updated validator set is found. -First, get the new (unconfirmed) validator set V' and -verify H' is internally consistent and properly signed by -this V'. Assuming it is a valid block, we check that at -least 2/3 of the validators in V also signed it, meaning -it would also be valid under our old assumptions. -That should be enough, but we can also check that the -V counts for at least 2/3 of the total votes in H' -for extra safety (we can have a discussion if this is -strictly required). If we can verify all this, -then we can accept H' and V' as valid and use that to -validate all blocks X > H'. +If we cannot update directly from H -> H' because there was too much change to +the validator set, then we can look for some Hm (H < Hm < H') with a validator +set Vm. Then we try to update H -> Hm and then Hm -> H' in two steps. If one +of these steps doesn't work, then we continue bisecting, until we eventually +have to externally validate the valdiator set changes at every block. -If we cannot update directly from H -> H' because there was -too much change to the validator set, then we can look for -some Hm (H < Hm < H') with a validator set Vm. Then we try -to update H -> Hm and Hm -> H' in two separate steps. -If one of these steps doesn't work, then we continue -bisecting, until we eventually have to externally -validate the valdiator set changes at every block. +Since we never trust any server in this protocol, only the signatures +themselves, it doesn't matter if the seed comes from a (possibly malicious) +node or a (possibly malicious) user. We can accept it or reject it based only +on our trusted validator set and cryptographic proofs. This makes it extremely +important to verify that you have the proper validator set when initializing +the client, as that is the root of all trust. -Since we never trust any server in this protocol, only the -signatures themselves, it doesn't matter if the seed comes -from a (possibly malicious) node or a (possibly malicious) user. -We can accept it or reject it based only on our trusted -validator set and cryptographic proofs. This makes it -extremely important to verify that you have the proper -validator set when initializing the client, as that is the -root of all trust. +The software currently assumes that the unbonding period is infinite in +duration. If the InquiringCertifier hasn't been updated in a while, you should +manually verify the block headers using other sources. -Or course, this assumes that the known block is within the -unbonding period to avoid the "nothing at stake" problem. -If you haven't seen the state in a few months, you will need -to manually verify the new validator set hash using off-chain -means (the same as getting the initial hash). +TODO: Update the software to handle cases around the unbonding period. */ package lite diff --git a/lite/dynamic_certifier.go b/lite/dynamic_certifier.go deleted file mode 100644 index 0ddace8b..00000000 --- a/lite/dynamic_certifier.go +++ /dev/null @@ -1,96 +0,0 @@ -package lite - -import ( - "github.com/tendermint/tendermint/types" - - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -var _ Certifier = (*DynamicCertifier)(nil) - -// DynamicCertifier uses a StaticCertifier for Certify, but adds an -// Update method to allow for a change of validators. -// -// You can pass in a FullCommit with another validator set, -// and if this is a provably secure transition (< 1/3 change, -// sufficient signatures), then it will update the -// validator set for the next Certify call. -// For security, it will only follow validator set changes -// going forward. -type DynamicCertifier struct { - cert *StaticCertifier - lastHeight int64 -} - -// NewDynamic returns a new dynamic certifier. -func NewDynamicCertifier(chainID string, vals *types.ValidatorSet, height int64) *DynamicCertifier { - return &DynamicCertifier{ - cert: NewStaticCertifier(chainID, vals), - lastHeight: height, - } -} - -// ChainID returns the chain id of this certifier. -// Implements Certifier. -func (dc *DynamicCertifier) ChainID() string { - return dc.cert.ChainID() -} - -// Validators returns the validators of this certifier. -func (dc *DynamicCertifier) Validators() *types.ValidatorSet { - return dc.cert.vSet -} - -// Hash returns the hash of this certifier. -func (dc *DynamicCertifier) Hash() []byte { - return dc.cert.Hash() -} - -// LastHeight returns the last height of this certifier. -func (dc *DynamicCertifier) LastHeight() int64 { - return dc.lastHeight -} - -// Certify will verify whether the commit is valid and will update the height if it is or return an -// error if it is not. -// Implements Certifier. -func (dc *DynamicCertifier) Certify(check Commit) error { - err := dc.cert.Certify(check) - if err == nil { - // update last seen height if input is valid - dc.lastHeight = check.Height() - } - return err -} - -// Update will verify if this is a valid change and update -// the certifying validator set if safe to do so. -// -// Returns an error if update is impossible (invalid proof or IsTooMuchChangeErr) -func (dc *DynamicCertifier) Update(fc FullCommit) error { - // ignore all checkpoints in the past -> only to the future - h := fc.Height() - if h <= dc.lastHeight { - return liteErr.ErrPastTime() - } - - // first, verify if the input is self-consistent.... - err := fc.ValidateBasic(dc.ChainID()) - if err != nil { - return err - } - - // now, make sure not too much change... meaning this commit - // would be approved by the currently known validator set - // as well as the new set - commit := fc.Commit.Commit - err = dc.Validators().VerifyCommitAny(fc.Validators, dc.ChainID(), commit.BlockID, h, commit) - if err != nil { - return liteErr.ErrTooMuchChange() - } - - // looks good, we can update - dc.cert = NewStaticCertifier(dc.ChainID(), fc.Validators) - dc.lastHeight = h - return nil -} diff --git a/lite/dynamic_certifier_test.go b/lite/dynamic_certifier_test.go deleted file mode 100644 index 88c145f9..00000000 --- a/lite/dynamic_certifier_test.go +++ /dev/null @@ -1,130 +0,0 @@ -package lite_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/tendermint/tendermint/types" - - "github.com/tendermint/tendermint/lite" - "github.com/tendermint/tendermint/lite/errors" -) - -// TestDynamicCert just makes sure it still works like StaticCert -func TestDynamicCert(t *testing.T) { - // assert, require := assert.New(t), require.New(t) - assert := assert.New(t) - // require := require.New(t) - - keys := lite.GenValKeys(4) - // 20, 30, 40, 50 - the first 3 don't have 2/3, the last 3 do! - vals := keys.ToValidators(20, 10) - // and a certifier based on our known set - chainID := "test-dyno" - cert := lite.NewDynamicCertifier(chainID, vals, 0) - - cases := []struct { - keys lite.ValKeys - vals *types.ValidatorSet - height int64 - first, last int // who actually signs - proper bool // true -> expect no error - changed bool // true -> expect validator change error - }{ - // perfect, signed by everyone - {keys, vals, 1, 0, len(keys), true, false}, - // skip little guy is okay - {keys, vals, 2, 1, len(keys), true, false}, - // but not the big guy - {keys, vals, 3, 0, len(keys) - 1, false, false}, - // even changing the power a little bit breaks the static validator - // the sigs are enough, but the validator hash is unknown - {keys, keys.ToValidators(20, 11), 4, 0, len(keys), false, true}, - } - - for _, tc := range cases { - check := tc.keys.GenCommit(chainID, tc.height, nil, tc.vals, - []byte("bar"), []byte("params"), []byte("results"), tc.first, tc.last) - err := cert.Certify(check) - if tc.proper { - assert.Nil(err, "%+v", err) - assert.Equal(cert.LastHeight(), tc.height) - } else { - assert.NotNil(err) - if tc.changed { - assert.True(errors.IsValidatorsChangedErr(err), "%+v", err) - } - } - } -} - -// TestDynamicUpdate makes sure we update safely and sanely -func TestDynamicUpdate(t *testing.T) { - assert, require := assert.New(t), require.New(t) - - chainID := "test-dyno-up" - keys := lite.GenValKeys(5) - vals := keys.ToValidators(20, 0) - cert := lite.NewDynamicCertifier(chainID, vals, 40) - - // one valid block to give us a sense of time - h := int64(100) - good := keys.GenCommit(chainID, h, nil, vals, []byte("foo"), []byte("params"), []byte("results"), 0, len(keys)) - err := cert.Certify(good) - require.Nil(err, "%+v", err) - - // some new sets to try later - keys2 := keys.Extend(2) - keys3 := keys2.Extend(4) - - // we try to update with some blocks - cases := []struct { - keys lite.ValKeys - vals *types.ValidatorSet - height int64 - first, last int // who actually signs - proper bool // true -> expect no error - changed bool // true -> expect too much change error - }{ - // same validator set, well signed, of course it is okay - {keys, vals, h + 10, 0, len(keys), true, false}, - // same validator set, poorly signed, fails - {keys, vals, h + 20, 2, len(keys), false, false}, - - // shift the power a little, works if properly signed - {keys, keys.ToValidators(10, 0), h + 30, 1, len(keys), true, false}, - // but not on a poor signature - {keys, keys.ToValidators(10, 0), h + 40, 2, len(keys), false, false}, - // and not if it was in the past - {keys, keys.ToValidators(10, 0), h + 25, 0, len(keys), false, false}, - - // let's try to adjust to a whole new validator set (we have 5/7 of the votes) - {keys2, keys2.ToValidators(10, 0), h + 33, 0, len(keys2), true, false}, - - // properly signed but too much change, not allowed (only 7/11 validators known) - {keys3, keys3.ToValidators(10, 0), h + 50, 0, len(keys3), false, true}, - } - - for _, tc := range cases { - fc := tc.keys.GenFullCommit(chainID, tc.height, nil, tc.vals, - []byte("bar"), []byte("params"), []byte("results"), tc.first, tc.last) - err := cert.Update(fc) - if tc.proper { - assert.Nil(err, "%d: %+v", tc.height, err) - // we update last seen height - assert.Equal(cert.LastHeight(), tc.height) - // and we update the proper validators - assert.EqualValues(fc.Header.ValidatorsHash, cert.Hash()) - } else { - assert.NotNil(err, "%d", tc.height) - // we don't update the height - assert.NotEqual(cert.LastHeight(), tc.height) - if tc.changed { - assert.True(errors.IsTooMuchChangeErr(err), - "%d: %+v", tc.height, err) - } - } - } -} diff --git a/lite/errors/errors.go b/lite/errors/errors.go index 99e42a0b..c38ecf88 100644 --- a/lite/errors/errors.go +++ b/lite/errors/errors.go @@ -3,90 +3,110 @@ package errors import ( "fmt" - "github.com/pkg/errors" + cmn "github.com/tendermint/tmlibs/common" ) -var ( - errValidatorsChanged = fmt.Errorf("Validators differ between header and certifier") - errCommitNotFound = fmt.Errorf("Commit not found by provider") - errTooMuchChange = fmt.Errorf("Validators change too much to safely update") - errPastTime = fmt.Errorf("Update older than certifier height") - errNoPathFound = fmt.Errorf("Cannot find a path of validators") -) +//---------------------------------------- +// Error types -// IsCommitNotFoundErr checks whether an error is due to missing data -func IsCommitNotFoundErr(err error) bool { - return err != nil && (errors.Cause(err) == errCommitNotFound) +type errCommitNotFound struct{} + +func (e errCommitNotFound) Error() string { + return "Commit not found by provider" } +type errUnexpectedValidators struct { + got []byte + want []byte +} + +func (e errUnexpectedValidators) Error() string { + return fmt.Sprintf("Validator set is different. Got %X want %X", + e.got, e.want) +} + +type errTooMuchChange struct{} + +func (e errTooMuchChange) Error() string { + return "Insufficient signatures to validate due to valset changes" +} + +type errMissingValidators struct { + chainID string + height int64 +} + +func (e errMissingValidators) Error() string { + return fmt.Sprintf("Validators are unknown or missing for chain %s and height %d", + e.chainID, e.height) +} + +//---------------------------------------- +// Methods for above error types + +//----------------- +// ErrCommitNotFound + // ErrCommitNotFound indicates that a the requested commit was not found. func ErrCommitNotFound() error { - return errors.WithStack(errCommitNotFound) + return cmn.ErrorWrap(errCommitNotFound{}, "") } -// IsValidatorsChangedErr checks whether an error is due -// to a differing validator set. -func IsValidatorsChangedErr(err error) bool { - return err != nil && (errors.Cause(err) == errValidatorsChanged) +func IsErrCommitNotFound(err error) bool { + if err_, ok := err.(cmn.Error); ok { + _, ok := err_.Data().(errCommitNotFound) + return ok + } + return false } -// ErrValidatorsChanged indicates that the validator set was changed between two commits. -func ErrValidatorsChanged() error { - return errors.WithStack(errValidatorsChanged) +//----------------- +// ErrUnexpectedValidators + +// ErrUnexpectedValidators indicates a validator set mismatch. +func ErrUnexpectedValidators(got, want []byte) error { + return cmn.ErrorWrap(errUnexpectedValidators{ + got: got, + want: want, + }, "") } -// IsTooMuchChangeErr checks whether an error is due to too much change -// between these validators sets. -func IsTooMuchChangeErr(err error) bool { - return err != nil && (errors.Cause(err) == errTooMuchChange) +func IsErrUnexpectedValidators(err error) bool { + if err_, ok := err.(cmn.Error); ok { + _, ok := err_.Data().(errUnexpectedValidators) + return ok + } + return false } +//----------------- +// ErrTooMuchChange + // ErrTooMuchChange indicates that the underlying validator set was changed by >1/3. func ErrTooMuchChange() error { - return errors.WithStack(errTooMuchChange) + return cmn.ErrorWrap(errTooMuchChange{}, "") } -// IsPastTimeErr ... -func IsPastTimeErr(err error) bool { - return err != nil && (errors.Cause(err) == errPastTime) -} - -// ErrPastTime ... -func ErrPastTime() error { - return errors.WithStack(errPastTime) -} - -// IsNoPathFoundErr checks whether an error is due to no path of -// validators in provider from where we are to where we want to be -func IsNoPathFoundErr(err error) bool { - return err != nil && (errors.Cause(err) == errNoPathFound) -} - -// ErrNoPathFound ... -func ErrNoPathFound() error { - return errors.WithStack(errNoPathFound) -} - -//-------------------------------------------- - -type errHeightMismatch struct { - h1, h2 int64 -} - -func (e errHeightMismatch) Error() string { - return fmt.Sprintf("Blocks don't match - %d vs %d", e.h1, e.h2) -} - -// IsHeightMismatchErr checks whether an error is due to data from different blocks -func IsHeightMismatchErr(err error) bool { - if err == nil { - return false +func IsErrTooMuchChange(err error) bool { + if err_, ok := err.(cmn.Error); ok { + _, ok := err_.Data().(errTooMuchChange) + return ok } - _, ok := errors.Cause(err).(errHeightMismatch) - return ok + return false } -// ErrHeightMismatch returns an mismatch error with stack-trace -func ErrHeightMismatch(h1, h2 int64) error { - return errors.WithStack(errHeightMismatch{h1, h2}) +//----------------- +// ErrMissingValidators + +// ErrMissingValidators indicates that some validator set was missing or unknown. +func ErrMissingValidators(chainID string, height int64) error { + return cmn.ErrorWrap(errMissingValidators{chainID, height}, "") +} + +func IsErrMissingValidators(err error) bool { + if err_, ok := err.(cmn.Error); ok { + _, ok := err_.Data().(errMissingValidators) + return ok + } + return false } diff --git a/lite/errors/errors_test.go b/lite/errors/errors_test.go deleted file mode 100644 index 479215e4..00000000 --- a/lite/errors/errors_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package errors - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestErrorHeight(t *testing.T) { - e1 := ErrHeightMismatch(2, 3) - e1.Error() - assert.True(t, IsHeightMismatchErr(e1)) - - e2 := errors.New("foobar") - assert.False(t, IsHeightMismatchErr(e2)) - assert.False(t, IsHeightMismatchErr(nil)) -} diff --git a/lite/files/commit.go b/lite/files/commit.go deleted file mode 100644 index 8a7e4721..00000000 --- a/lite/files/commit.go +++ /dev/null @@ -1,93 +0,0 @@ -package files - -import ( - "io/ioutil" - "os" - - "github.com/pkg/errors" - - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -const ( - // MaxFullCommitSize is the maximum number of bytes we will - // read in for a full commit to avoid excessive allocations - // in the deserializer - MaxFullCommitSize = 1024 * 1024 -) - -// SaveFullCommit exports the seed in binary / go-amino style -func SaveFullCommit(fc lite.FullCommit, path string) error { - f, err := os.Create(path) - if err != nil { - return errors.WithStack(err) - } - defer f.Close() - - _, err = cdc.MarshalBinaryWriter(f, fc) - if err != nil { - return errors.WithStack(err) - } - return nil -} - -// SaveFullCommitJSON exports the seed in a json format -func SaveFullCommitJSON(fc lite.FullCommit, path string) error { - f, err := os.Create(path) - if err != nil { - return errors.WithStack(err) - } - defer f.Close() - bz, err := cdc.MarshalJSON(fc) - if err != nil { - return errors.WithStack(err) - } - _, err = f.Write(bz) - if err != nil { - return errors.WithStack(err) - } - return nil -} - -// LoadFullCommit loads the full commit from the file system. -func LoadFullCommit(path string) (lite.FullCommit, error) { - var fc lite.FullCommit - f, err := os.Open(path) - if err != nil { - if os.IsNotExist(err) { - return fc, liteErr.ErrCommitNotFound() - } - return fc, errors.WithStack(err) - } - defer f.Close() - - _, err = cdc.UnmarshalBinaryReader(f, &fc, 0) - if err != nil { - return fc, errors.WithStack(err) - } - return fc, nil -} - -// LoadFullCommitJSON loads the commit from the file system in JSON format. -func LoadFullCommitJSON(path string) (lite.FullCommit, error) { - var fc lite.FullCommit - f, err := os.Open(path) - if err != nil { - if os.IsNotExist(err) { - return fc, liteErr.ErrCommitNotFound() - } - return fc, errors.WithStack(err) - } - defer f.Close() - - bz, err := ioutil.ReadAll(f) - if err != nil { - return fc, errors.WithStack(err) - } - err = cdc.UnmarshalJSON(bz, &fc) - if err != nil { - return fc, errors.WithStack(err) - } - return fc, nil -} diff --git a/lite/files/commit_test.go b/lite/files/commit_test.go deleted file mode 100644 index e0235ba2..00000000 --- a/lite/files/commit_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package files - -import ( - "os" - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - cmn "github.com/tendermint/tmlibs/common" - - "github.com/tendermint/tendermint/lite" -) - -func tmpFile() string { - suffix := cmn.RandStr(16) - return filepath.Join(os.TempDir(), "fc-test-"+suffix) -} - -func TestSerializeFullCommits(t *testing.T) { - assert, require := assert.New(t), require.New(t) - - // some constants - appHash := []byte("some crazy thing") - chainID := "ser-ial" - h := int64(25) - - // build a fc - keys := lite.GenValKeys(5) - vals := keys.ToValidators(10, 0) - fc := keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) - - require.Equal(h, fc.Height()) - require.Equal(vals.Hash(), fc.ValidatorsHash()) - - // try read/write with json - jfile := tmpFile() - defer os.Remove(jfile) - jseed, err := LoadFullCommitJSON(jfile) - assert.NotNil(err) - err = SaveFullCommitJSON(fc, jfile) - require.Nil(err) - jseed, err = LoadFullCommitJSON(jfile) - assert.Nil(err, "%+v", err) - assert.Equal(h, jseed.Height()) - assert.Equal(vals.Hash(), jseed.ValidatorsHash()) - - // try read/write with binary - bfile := tmpFile() - defer os.Remove(bfile) - bseed, err := LoadFullCommit(bfile) - assert.NotNil(err) - err = SaveFullCommit(fc, bfile) - require.Nil(err) - bseed, err = LoadFullCommit(bfile) - assert.Nil(err, "%+v", err) - assert.Equal(h, bseed.Height()) - assert.Equal(vals.Hash(), bseed.ValidatorsHash()) - - // make sure they don't read the other format (different) - _, err = LoadFullCommit(jfile) - assert.NotNil(err) - _, err = LoadFullCommitJSON(bfile) - assert.NotNil(err) -} diff --git a/lite/files/provider.go b/lite/files/provider.go deleted file mode 100644 index 327b0331..00000000 --- a/lite/files/provider.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Package files defines a Provider that stores all data in the filesystem - -We assume the same validator hash may be reused by many different -headers/Commits, and thus store it separately. This leaves us -with three issues: - - 1. Given a validator hash, retrieve the validator set if previously stored - 2. Given a block height, find the Commit with the highest height <= h - 3. Given a FullCommit, store it quickly to satisfy 1 and 2 - -Note that we do not worry about caching, as that can be achieved by -pairing this with a MemStoreProvider and CacheProvider from certifiers -*/ -package files - -import ( - "encoding/hex" - "fmt" - "math" - "os" - "path/filepath" - "sort" - - "github.com/pkg/errors" - - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -// nolint -const ( - Ext = ".tsd" - ValDir = "validators" - CheckDir = "checkpoints" - dirPerm = os.FileMode(0755) - //filePerm = os.FileMode(0644) -) - -type provider struct { - valDir string - checkDir string -} - -// NewProvider creates the parent dir and subdirs -// for validators and checkpoints as needed -func NewProvider(dir string) lite.Provider { - valDir := filepath.Join(dir, ValDir) - checkDir := filepath.Join(dir, CheckDir) - for _, d := range []string{valDir, checkDir} { - err := os.MkdirAll(d, dirPerm) - if err != nil { - panic(err) - } - } - return &provider{valDir: valDir, checkDir: checkDir} -} - -func (p *provider) encodeHash(hash []byte) string { - return hex.EncodeToString(hash) + Ext -} - -func (p *provider) encodeHeight(h int64) string { - // pad up to 10^12 for height... - return fmt.Sprintf("%012d%s", h, Ext) -} - -// StoreCommit saves a full commit after it has been verified. -func (p *provider) StoreCommit(fc lite.FullCommit) error { - // make sure the fc is self-consistent before saving - err := fc.ValidateBasic(fc.Commit.Header.ChainID) - if err != nil { - return err - } - - paths := []string{ - filepath.Join(p.checkDir, p.encodeHeight(fc.Height())), - filepath.Join(p.valDir, p.encodeHash(fc.Header.ValidatorsHash)), - } - for _, path := range paths { - err := SaveFullCommit(fc, path) - // unknown error in creating or writing immediately breaks - if err != nil { - return err - } - } - return nil -} - -// GetByHeight returns the closest commit with height <= h. -func (p *provider) GetByHeight(h int64) (lite.FullCommit, error) { - // first we look for exact match, then search... - path := filepath.Join(p.checkDir, p.encodeHeight(h)) - fc, err := LoadFullCommit(path) - if liteErr.IsCommitNotFoundErr(err) { - path, err = p.searchForHeight(h) - if err == nil { - fc, err = LoadFullCommit(path) - } - } - return fc, err -} - -// LatestCommit returns the newest commit stored. -func (p *provider) LatestCommit() (fc lite.FullCommit, err error) { - // Note to future: please update by 2077 to avoid rollover - return p.GetByHeight(math.MaxInt32 - 1) -} - -// search for height, looks for a file with highest height < h -// return certifiers.ErrCommitNotFound() if not there... -func (p *provider) searchForHeight(h int64) (string, error) { - d, err := os.Open(p.checkDir) - if err != nil { - return "", errors.WithStack(err) - } - files, err := d.Readdirnames(0) - - d.Close() - if err != nil { - return "", errors.WithStack(err) - } - - desired := p.encodeHeight(h) - sort.Strings(files) - i := sort.SearchStrings(files, desired) - if i == 0 { - return "", liteErr.ErrCommitNotFound() - } - found := files[i-1] - path := filepath.Join(p.checkDir, found) - return path, errors.WithStack(err) -} - -// GetByHash returns a commit exactly matching this validator hash. -func (p *provider) GetByHash(hash []byte) (lite.FullCommit, error) { - path := filepath.Join(p.valDir, p.encodeHash(hash)) - return LoadFullCommit(path) -} diff --git a/lite/files/provider_test.go b/lite/files/provider_test.go deleted file mode 100644 index 5deebb1a..00000000 --- a/lite/files/provider_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package files_test - -import ( - "bytes" - "errors" - "io/ioutil" - "os" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" - "github.com/tendermint/tendermint/lite/files" -) - -func checkEqual(stored, loaded lite.FullCommit, chainID string) error { - err := loaded.ValidateBasic(chainID) - if err != nil { - return err - } - if !bytes.Equal(stored.ValidatorsHash(), loaded.ValidatorsHash()) { - return errors.New("Different block hashes") - } - return nil -} - -func TestFileProvider(t *testing.T) { - assert, require := assert.New(t), require.New(t) - - dir, err := ioutil.TempDir("", "fileprovider-test") - assert.Nil(err) - defer os.RemoveAll(dir) - p := files.NewProvider(dir) - - chainID := "test-files" - appHash := []byte("some-data") - keys := lite.GenValKeys(5) - count := 10 - - // make a bunch of seeds... - seeds := make([]lite.FullCommit, count) - for i := 0; i < count; i++ { - // two seeds for each validator, to check how we handle dups - // (10, 0), (10, 1), (10, 1), (10, 2), (10, 2), ... - vals := keys.ToValidators(10, int64(count/2)) - h := int64(20 + 10*i) - check := keys.GenCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) - seeds[i] = lite.NewFullCommit(check, vals) - } - - // check provider is empty - seed, err := p.GetByHeight(20) - require.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) - - seed, err = p.GetByHash(seeds[3].ValidatorsHash()) - require.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) - - // now add them all to the provider - for _, s := range seeds { - err = p.StoreCommit(s) - require.Nil(err) - // and make sure we can get it back - s2, err := p.GetByHash(s.ValidatorsHash()) - assert.Nil(err) - err = checkEqual(s, s2, chainID) - assert.Nil(err) - // by height as well - s2, err = p.GetByHeight(s.Height()) - err = checkEqual(s, s2, chainID) - assert.Nil(err) - } - - // make sure we get the last hash if we overstep - seed, err = p.GetByHeight(5000) - if assert.Nil(err, "%+v", err) { - assert.Equal(seeds[count-1].Height(), seed.Height()) - err = checkEqual(seeds[count-1], seed, chainID) - assert.Nil(err) - } - - // and middle ones as well - seed, err = p.GetByHeight(47) - if assert.Nil(err, "%+v", err) { - // we only step by 10, so 40 must be the one below this - assert.EqualValues(40, seed.Height()) - } - - // and proper error for too low - _, err = p.GetByHeight(5) - assert.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) -} diff --git a/lite/files/wire.go b/lite/files/wire.go deleted file mode 100644 index 3a207744..00000000 --- a/lite/files/wire.go +++ /dev/null @@ -1,12 +0,0 @@ -package files - -import ( - "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/crypto" -) - -var cdc = amino.NewCodec() - -func init() { - crypto.RegisterAmino(cdc) -} diff --git a/lite/helpers.go b/lite/helpers.go index 695f6fb9..764df507 100644 --- a/lite/helpers.go +++ b/lite/helpers.go @@ -4,24 +4,21 @@ import ( "time" crypto "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/types" ) -// ValKeys is a helper for testing. +// privKeys is a helper type for testing. // -// It lets us simulate signing with many keys, either ed25519 or secp256k1. -// The main use case is to create a set, and call GenCommit -// to get properly signed header for testing. +// It lets us simulate signing with many keys. The main use case is to create +// a set, and call GenSignedHeader to get properly signed header for testing. // -// You can set different weights of validators each time you call -// ToValidators, and can optionally extend the validator set later -// with Extend or ExtendSecp -type ValKeys []crypto.PrivKey +// You can set different weights of validators each time you call ToValidators, +// and can optionally extend the validator set later with Extend. +type privKeys []crypto.PrivKey -// GenValKeys produces an array of private keys to generate commits. -func GenValKeys(n int) ValKeys { - res := make(ValKeys, n) +// genPrivKeys produces an array of private keys to generate commits. +func genPrivKeys(n int) privKeys { + res := make(privKeys, n) for i := range res { res[i] = crypto.GenPrivKeyEd25519() } @@ -29,56 +26,41 @@ func GenValKeys(n int) ValKeys { } // Change replaces the key at index i. -func (v ValKeys) Change(i int) ValKeys { - res := make(ValKeys, len(v)) - copy(res, v) +func (pkz privKeys) Change(i int) privKeys { + res := make(privKeys, len(pkz)) + copy(res, pkz) res[i] = crypto.GenPrivKeyEd25519() return res } // Extend adds n more keys (to remove, just take a slice). -func (v ValKeys) Extend(n int) ValKeys { - extra := GenValKeys(n) - return append(v, extra...) +func (pkz privKeys) Extend(n int) privKeys { + extra := genPrivKeys(n) + return append(pkz, extra...) } -// GenSecpValKeys produces an array of secp256k1 private keys to generate commits. -func GenSecpValKeys(n int) ValKeys { - res := make(ValKeys, n) - for i := range res { - res[i] = crypto.GenPrivKeySecp256k1() - } - return res -} - -// ExtendSecp adds n more secp256k1 keys (to remove, just take a slice). -func (v ValKeys) ExtendSecp(n int) ValKeys { - extra := GenSecpValKeys(n) - return append(v, extra...) -} - -// ToValidators produces a list of validators from the set of keys +// ToValidators produces a valset from the set of keys. // The first key has weight `init` and it increases by `inc` every step // so we can have all the same weight, or a simple linear distribution // (should be enough for testing). -func (v ValKeys) ToValidators(init, inc int64) *types.ValidatorSet { - res := make([]*types.Validator, len(v)) - for i, k := range v { +func (pkz privKeys) ToValidators(init, inc int64) *types.ValidatorSet { + res := make([]*types.Validator, len(pkz)) + for i, k := range pkz { res[i] = types.NewValidator(k.PubKey(), init+int64(i)*inc) } return types.NewValidatorSet(res) } // signHeader properly signs the header with all keys from first to last exclusive. -func (v ValKeys) signHeader(header *types.Header, first, last int) *types.Commit { - votes := make([]*types.Vote, len(v)) +func (pkz privKeys) signHeader(header *types.Header, first, last int) *types.Commit { + votes := make([]*types.Vote, len(pkz)) - // we need this list to keep the ordering... - vset := v.ToValidators(1, 0) + // We need this list to keep the ordering. + vset := pkz.ToValidators(1, 0) - // fill in the votes we want - for i := first; i < last && i < len(v); i++ { - vote := makeVote(header, vset, v[i]) + // Fill in the votes we want. + for i := first; i < last && i < len(pkz); i++ { + vote := makeVote(header, vset, pkz[i]) votes[vote.ValidatorIndex] = vote } @@ -89,15 +71,15 @@ func (v ValKeys) signHeader(header *types.Header, first, last int) *types.Commit return res } -func makeVote(header *types.Header, vals *types.ValidatorSet, key crypto.PrivKey) *types.Vote { +func makeVote(header *types.Header, valset *types.ValidatorSet, key crypto.PrivKey) *types.Vote { addr := key.PubKey().Address() - idx, _ := vals.GetByAddress(addr) + idx, _ := valset.GetByAddress(addr) vote := &types.Vote{ ValidatorAddress: addr, ValidatorIndex: idx, Height: header.Height, Round: 1, - Timestamp: time.Now().UTC(), + Timestamp: time.Now().Round(0).UTC(), Type: types.VoteTypePrecommit, BlockID: types.BlockID{Hash: header.Hash()}, } @@ -113,47 +95,46 @@ func makeVote(header *types.Header, vals *types.ValidatorSet, key crypto.PrivKey return vote } -// Silences warning that vals can also be merkle.Hashable -// nolint: interfacer func genHeader(chainID string, height int64, txs types.Txs, - vals *types.ValidatorSet, appHash, consHash, resHash []byte) *types.Header { + valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte) *types.Header { return &types.Header{ ChainID: chainID, Height: height, - Time: time.Now(), + Time: time.Now().Round(0).UTC(), NumTxs: int64(len(txs)), TotalTxs: int64(len(txs)), // LastBlockID // LastCommitHash - ValidatorsHash: vals.Hash(), - DataHash: txs.Hash(), - AppHash: appHash, - ConsensusHash: consHash, - LastResultsHash: resHash, + ValidatorsHash: valset.Hash(), + NextValidatorsHash: nvalset.Hash(), + DataHash: txs.Hash(), + AppHash: appHash, + ConsensusHash: consHash, + LastResultsHash: resHash, } } -// GenCommit calls genHeader and signHeader and combines them into a Commit. -func (v ValKeys) GenCommit(chainID string, height int64, txs types.Txs, - vals *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) Commit { +// GenSignedHeader calls genHeader and signHeader and combines them into a SignedHeader. +func (pkz privKeys) GenSignedHeader(chainID string, height int64, txs types.Txs, + valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) types.SignedHeader { - header := genHeader(chainID, height, txs, vals, appHash, consHash, resHash) - check := Commit{ + header := genHeader(chainID, height, txs, valset, nvalset, appHash, consHash, resHash) + check := types.SignedHeader{ Header: header, - Commit: v.signHeader(header, first, last), + Commit: pkz.signHeader(header, first, last), } return check } -// GenFullCommit calls genHeader and signHeader and combines them into a Commit. -func (v ValKeys) GenFullCommit(chainID string, height int64, txs types.Txs, - vals *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) FullCommit { +// GenFullCommit calls genHeader and signHeader and combines them into a FullCommit. +func (pkz privKeys) GenFullCommit(chainID string, height int64, txs types.Txs, + valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) FullCommit { - header := genHeader(chainID, height, txs, vals, appHash, consHash, resHash) - commit := Commit{ + header := genHeader(chainID, height, txs, valset, nvalset, appHash, consHash, resHash) + commit := types.SignedHeader{ Header: header, - Commit: v.signHeader(header, first, last), + Commit: pkz.signHeader(header, first, last), } - return NewFullCommit(commit, vals) + return NewFullCommit(commit, valset, nvalset) } diff --git a/lite/inquiring_certifier.go b/lite/inquiring_certifier.go index 042bd08e..049cd728 100644 --- a/lite/inquiring_certifier.go +++ b/lite/inquiring_certifier.go @@ -1,163 +1,209 @@ package lite import ( + "bytes" + "github.com/tendermint/tendermint/types" - liteErr "github.com/tendermint/tendermint/lite/errors" + lerr "github.com/tendermint/tendermint/lite/errors" ) var _ Certifier = (*InquiringCertifier)(nil) -// InquiringCertifier wraps a dynamic certifier and implements an auto-update strategy. If a call -// to Certify fails due to a change it validator set, InquiringCertifier will try and find a -// previous FullCommit which it can use to safely update the validator set. It uses a source -// provider to obtain the needed FullCommits. It stores properly validated data on the local system. +// InquiringCertifier implements an auto-updating certifier. It uses a +// "source" provider to obtain the needed FullCommits to securely sync with +// validator set changes. It stores properly validated data on the +// "trusted" local system. type InquiringCertifier struct { - cert *DynamicCertifier - // These are only properly validated data, from local system - trusted Provider - // This is a source of new info, like a node rpc, or other import method - Source Provider + chainID string + // These are only properly validated data, from local system. + trusted PersistentProvider + // This is a source of new info, like a node rpc, or other import method. + source Provider } -// NewInquiringCertifier returns a new Inquiring object. It uses the trusted provider to store -// validated data and the source provider to obtain missing FullCommits. +// NewInquiringCertifier returns a new InquiringCertifier. It uses the +// trusted provider to store validated data and the source provider to +// obtain missing data (e.g. FullCommits). // -// Example: The trusted provider should a CacheProvider, MemProvider or files.Provider. The source -// provider should be a client.HTTPProvider. -func NewInquiringCertifier(chainID string, fc FullCommit, trusted Provider, - source Provider) (*InquiringCertifier, error) { - - // store the data in trusted - err := trusted.StoreCommit(fc) - if err != nil { - return nil, err - } +// The trusted provider should a CacheProvider, MemProvider or +// files.Provider. The source provider should be a client.HTTPProvider. +func NewInquiringCertifier(chainID string, trusted PersistentProvider, source Provider) ( + *InquiringCertifier, error) { return &InquiringCertifier{ - cert: NewDynamicCertifier(chainID, fc.Validators, fc.Height()), + chainID: chainID, trusted: trusted, - Source: source, + source: source, }, nil } -// ChainID returns the chain id. // Implements Certifier. func (ic *InquiringCertifier) ChainID() string { - return ic.cert.ChainID() + return ic.chainID } -// Validators returns the validator set. -func (ic *InquiringCertifier) Validators() *types.ValidatorSet { - return ic.cert.cert.vSet -} - -// LastHeight returns the last height. -func (ic *InquiringCertifier) LastHeight() int64 { - return ic.cert.lastHeight -} - -// Certify makes sure this is checkpoint is valid. -// -// If the validators have changed since the last know time, it looks -// for a path to prove the new validators. -// -// On success, it will store the checkpoint in the store for later viewing // Implements Certifier. -func (ic *InquiringCertifier) Certify(commit Commit) error { - err := ic.useClosestTrust(commit.Height()) +// +// If the validators have changed since the last know time, it looks to +// ic.trusted and ic.source to prove the new validators. On success, it will +// try to store the SignedHeader in ic.trusted if the next +// validator can be sourced. +func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { + + // Get the latest known full commit <= h-1 from our trusted providers. + // The full commit at h-1 contains the valset to sign for h. + h := shdr.Height - 1 + tfc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) if err != nil { return err } - err = ic.cert.Certify(commit) - if !liteErr.IsValidatorsChangedErr(err) { - return err + if tfc.Height() == h { + // Return error if valset doesn't match. + if !bytes.Equal( + tfc.NextValidators.Hash(), + shdr.Header.ValidatorsHash) { + return lerr.ErrUnexpectedValidators( + tfc.NextValidators.Hash(), + shdr.Header.ValidatorsHash) + } + } else { + // If valset doesn't match... + if !bytes.Equal(tfc.NextValidators.Hash(), + shdr.Header.ValidatorsHash) { + // ... update. + tfc, err = ic.updateToHeight(h) + if err != nil { + return err + } + // Return error if valset _still_ doesn't match. + if !bytes.Equal(tfc.NextValidators.Hash(), + shdr.Header.ValidatorsHash) { + return lerr.ErrUnexpectedValidators( + tfc.NextValidators.Hash(), + shdr.Header.ValidatorsHash) + } + } } - err = ic.updateToHash(commit.Header.ValidatorsHash) + + // Certify the signed header using the matching valset. + cert := NewBaseCertifier(ic.chainID, tfc.Height()+1, tfc.NextValidators) + err = cert.Certify(shdr) if err != nil { return err } - err = ic.cert.Certify(commit) - if err != nil { + // Get the next validator set. + nvalset, err := ic.source.ValidatorSet(ic.chainID, shdr.Height+1) + if lerr.IsErrMissingValidators(err) { + // Ignore this error. + return nil + } else if err != nil { return err + } else { + // Create filled FullCommit. + nfc := FullCommit{ + SignedHeader: shdr, + Validators: tfc.NextValidators, + NextValidators: nvalset, + } + // Validate the full commit. This checks the cryptographic + // signatures of Commit against Validators. + if err := nfc.ValidateBasic(ic.chainID); err != nil { + return err + } + // Trust it. + return ic.trusted.SaveFullCommit(nfc) } - - // store the new checkpoint - return ic.trusted.StoreCommit(NewFullCommit(commit, ic.Validators())) } -// Update will verify if this is a valid change and update -// the certifying validator set if safe to do so. -func (ic *InquiringCertifier) Update(fc FullCommit) error { - err := ic.useClosestTrust(fc.Height()) +// verifyAndSave will verify if this is a valid source full commit given the +// best match trusted full commit, and if good, persist to ic.trusted. +// Returns ErrTooMuchChange when >2/3 of tfc did not sign sfc. +// Panics if tfc.Height() >= sfc.Height(). +func (ic *InquiringCertifier) verifyAndSave(tfc, sfc FullCommit) error { + if tfc.Height() >= sfc.Height() { + panic("should not happen") + } + err := tfc.NextValidators.VerifyFutureCommit( + sfc.Validators, + ic.chainID, sfc.SignedHeader.Commit.BlockID, + sfc.SignedHeader.Height, sfc.SignedHeader.Commit, + ) if err != nil { return err } - err = ic.cert.Update(fc) - if err == nil { - err = ic.trusted.StoreCommit(fc) - } - return err + return ic.trusted.SaveFullCommit(sfc) } -func (ic *InquiringCertifier) useClosestTrust(h int64) error { - closest, err := ic.trusted.GetByHeight(h) +// updateToHeight will use divide-and-conquer to find a path to h. +// Returns nil iff we successfully verify and persist a full commit +// for height h, using repeated applications of bisection if necessary. +// +// Returns ErrCommitNotFound if source provider doesn't have the commit for h. +func (ic *InquiringCertifier) updateToHeight(h int64) (FullCommit, error) { + + // Fetch latest full commit from source. + sfc, err := ic.source.LatestFullCommit(ic.chainID, h, h) if err != nil { - return err + return FullCommit{}, err } - // if the best seed is not the one we currently use, - // let's just reset the dynamic validator - if closest.Height() != ic.LastHeight() { - ic.cert = NewDynamicCertifier(ic.ChainID(), closest.Validators, closest.Height()) + // Validate the full commit. This checks the cryptographic + // signatures of Commit against Validators. + if err := sfc.ValidateBasic(ic.chainID); err != nil { + return FullCommit{}, err + } + + // If sfc.Height() != h, we can't do it. + if sfc.Height() != h { + return FullCommit{}, lerr.ErrCommitNotFound() + } + +FOR_LOOP: + for { + // Fetch latest full commit from trusted. + tfc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) + if err != nil { + return FullCommit{}, err + } + // Maybe we have nothing to do. + if tfc.Height() == h { + return FullCommit{}, nil + } + + // Try to update to full commit with checks. + err = ic.verifyAndSave(tfc, sfc) + if err == nil { + // All good! + return sfc, nil + } else { + // Handle special case when err is ErrTooMuchChange. + if lerr.IsErrTooMuchChange(err) { + // Divide and conquer. + start, end := tfc.Height(), sfc.Height() + if !(start < end) { + panic("should not happen") + } + mid := (start + end) / 2 + _, err = ic.updateToHeight(mid) + if err != nil { + return FullCommit{}, err + } + // If we made it to mid, we retry. + continue FOR_LOOP + } + return FullCommit{}, err + } } - return nil } -// updateToHash gets the validator hash we want to update to -// if IsTooMuchChangeErr, we try to find a path by binary search over height -func (ic *InquiringCertifier) updateToHash(vhash []byte) error { - // try to get the match, and update - fc, err := ic.Source.GetByHash(vhash) +func (ic *InquiringCertifier) LastTrustedHeight() int64 { + fc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, 1<<63-1) if err != nil { - return err + panic("should not happen") } - err = ic.cert.Update(fc) - // handle IsTooMuchChangeErr by using divide and conquer - if liteErr.IsTooMuchChangeErr(err) { - err = ic.updateToHeight(fc.Height()) - } - return err -} - -// updateToHeight will use divide-and-conquer to find a path to h -func (ic *InquiringCertifier) updateToHeight(h int64) error { - // try to update to this height (with checks) - fc, err := ic.Source.GetByHeight(h) - if err != nil { - return err - } - start, end := ic.LastHeight(), fc.Height() - if end <= start { - return liteErr.ErrNoPathFound() - } - err = ic.Update(fc) - - // we can handle IsTooMuchChangeErr specially - if !liteErr.IsTooMuchChangeErr(err) { - return err - } - - // try to update to mid - mid := (start + end) / 2 - err = ic.updateToHeight(mid) - if err != nil { - return err - } - - // if we made it to mid, we recurse - return ic.updateToHeight(h) + return fc.Height() } diff --git a/lite/inquiring_certifier_test.go b/lite/inquiring_certifier_test.go index db8160bd..b3d8edea 100644 --- a/lite/inquiring_certifier_test.go +++ b/lite/inquiring_certifier_test.go @@ -1,5 +1,4 @@ -// nolint: vetshadow -package lite_test +package lite import ( "fmt" @@ -8,166 +7,146 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/lite" + dbm "github.com/tendermint/tmlibs/db" ) func TestInquirerValidPath(t *testing.T) { assert, require := assert.New(t), require.New(t) - trust := lite.NewMemStoreProvider() - source := lite.NewMemStoreProvider() + trust := NewDBProvider(dbm.NewMemDB()) + source := NewDBProvider(dbm.NewMemDB()) - // set up the validators to generate test blocks + // Set up the validators to generate test blocks. var vote int64 = 10 - keys := lite.GenValKeys(5) + keys := genPrivKeys(5) + nkeys := keys.Extend(1) - // construct a bunch of commits, each with one more height than the last + // Construct a bunch of commits, each with one more height than the last. chainID := "inquiry-test" consHash := []byte("params") resHash := []byte("results") count := 50 - commits := make([]lite.FullCommit, count) + fcz := make([]FullCommit, count) for i := 0; i < count; i++ { - // extend the keys by 1 each time - keys = keys.Extend(1) vals := keys.ToValidators(vote, 0) - h := int64(20 + 10*i) + nvals := nkeys.ToValidators(vote, 0) + h := int64(1 + i) appHash := []byte(fmt.Sprintf("h=%d", h)) - commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, resHash, 0, - len(keys)) + fcz[i] = keys.GenFullCommit( + chainID, h, nil, + vals, nvals, + appHash, consHash, resHash, 0, len(keys)) + // Extend the keys by 1 each time. + keys = nkeys + nkeys = nkeys.Extend(1) } - // initialize a certifier with the initial state - cert, err := lite.NewInquiringCertifier(chainID, commits[0], trust, source) + // Initialize a certifier with the initial state. + err := trust.SaveFullCommit(fcz[0]) + require.Nil(err) + cert, err := NewInquiringCertifier(chainID, trust, source) require.Nil(err) - // this should fail validation.... - commit := commits[count-1].Commit - err = cert.Certify(commit) + // This should fail validation: + sh := fcz[count-1].SignedHeader + err = cert.Certify(sh) require.NotNil(err) - // adding a few commits in the middle should be insufficient + // Adding a few commits in the middle should be insufficient. for i := 10; i < 13; i++ { - err := source.StoreCommit(commits[i]) + err := source.SaveFullCommit(fcz[i]) require.Nil(err) } - err = cert.Certify(commit) + err = cert.Certify(sh) assert.NotNil(err) - // with more info, we succeed + // With more info, we succeed. for i := 0; i < count; i++ { - err := source.StoreCommit(commits[i]) + err := source.SaveFullCommit(fcz[i]) require.Nil(err) } - err = cert.Certify(commit) - assert.Nil(err, "%+v", err) -} - -func TestInquirerMinimalPath(t *testing.T) { - assert, require := assert.New(t), require.New(t) - trust := lite.NewMemStoreProvider() - source := lite.NewMemStoreProvider() - - // set up the validators to generate test blocks - var vote int64 = 10 - keys := lite.GenValKeys(5) - - // construct a bunch of commits, each with one more height than the last - chainID := "minimal-path" - consHash := []byte("other-params") - count := 12 - commits := make([]lite.FullCommit, count) - for i := 0; i < count; i++ { - // extend the validators, so we are just below 2/3 - keys = keys.Extend(len(keys)/2 - 1) - vals := keys.ToValidators(vote, 0) - h := int64(5 + 10*i) - appHash := []byte(fmt.Sprintf("h=%d", h)) - resHash := []byte(fmt.Sprintf("res=%d", h)) - commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, resHash, 0, - len(keys)) - } - - // initialize a certifier with the initial state - cert, _ := lite.NewInquiringCertifier(chainID, commits[0], trust, source) - - // this should fail validation.... - commit := commits[count-1].Commit - err := cert.Certify(commit) - require.NotNil(err) - - // add a few seed in the middle should be insufficient - for i := 5; i < 8; i++ { - err := source.StoreCommit(commits[i]) - require.Nil(err) - } - err = cert.Certify(commit) - assert.NotNil(err) - - // with more info, we succeed - for i := 0; i < count; i++ { - err := source.StoreCommit(commits[i]) - require.Nil(err) - } - err = cert.Certify(commit) + err = cert.Certify(sh) assert.Nil(err, "%+v", err) } func TestInquirerVerifyHistorical(t *testing.T) { assert, require := assert.New(t), require.New(t) - trust := lite.NewMemStoreProvider() - source := lite.NewMemStoreProvider() + trust := NewDBProvider(dbm.NewMemDB()) + source := NewDBProvider(dbm.NewMemDB()) - // set up the validators to generate test blocks + // Set up the validators to generate test blocks. var vote int64 = 10 - keys := lite.GenValKeys(5) + keys := genPrivKeys(5) + nkeys := keys.Extend(1) - // construct a bunch of commits, each with one more height than the last + // Construct a bunch of commits, each with one more height than the last. chainID := "inquiry-test" count := 10 consHash := []byte("special-params") - commits := make([]lite.FullCommit, count) + fcz := make([]FullCommit, count) for i := 0; i < count; i++ { - // extend the keys by 1 each time - keys = keys.Extend(1) vals := keys.ToValidators(vote, 0) - h := int64(20 + 10*i) + nvals := nkeys.ToValidators(vote, 0) + h := int64(1 + i) appHash := []byte(fmt.Sprintf("h=%d", h)) resHash := []byte(fmt.Sprintf("res=%d", h)) - commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, consHash, resHash, 0, - len(keys)) + fcz[i] = keys.GenFullCommit( + chainID, h, nil, + vals, nvals, + appHash, consHash, resHash, 0, len(keys)) + // Extend the keys by 1 each time. + keys = nkeys + nkeys = nkeys.Extend(1) } - // initialize a certifier with the initial state - cert, _ := lite.NewInquiringCertifier(chainID, commits[0], trust, source) + // Initialize a certifier with the initial state. + err := trust.SaveFullCommit(fcz[0]) + require.Nil(err) + cert, err := NewInquiringCertifier(chainID, trust, source) + require.Nil(err) - // store a few commits as trust + // Store a few full commits as trust. for _, i := range []int{2, 5} { - trust.StoreCommit(commits[i]) + trust.SaveFullCommit(fcz[i]) } - // let's see if we can jump forward using trusted commits - err := source.StoreCommit(commits[7]) + // See if we can jump forward using trusted full commits. + // Souce doesn't have fcz[9] so cert.LastTrustedHeight wont' change. + err = source.SaveFullCommit(fcz[7]) require.Nil(err, "%+v", err) - check := commits[7].Commit - err = cert.Certify(check) + sh := fcz[8].SignedHeader + err = cert.Certify(sh) require.Nil(err, "%+v", err) - assert.Equal(check.Height(), cert.LastHeight()) + assert.Equal(fcz[7].Height(), cert.LastTrustedHeight()) + fc_, err := trust.LatestFullCommit(chainID, fcz[8].Height(), fcz[8].Height()) + require.NotNil(err, "%+v", err) + assert.Equal(fc_, (FullCommit{})) - // add access to all commits via untrusted source + // With fcz[9] Certify will update last trusted height. + err = source.SaveFullCommit(fcz[9]) + require.Nil(err, "%+v", err) + sh = fcz[8].SignedHeader + err = cert.Certify(sh) + require.Nil(err, "%+v", err) + assert.Equal(fcz[8].Height(), cert.LastTrustedHeight()) + fc_, err = trust.LatestFullCommit(chainID, fcz[8].Height(), fcz[8].Height()) + require.Nil(err, "%+v", err) + assert.Equal(fc_.Height(), fcz[8].Height()) + + // Add access to all full commits via untrusted source. for i := 0; i < count; i++ { - err := source.StoreCommit(commits[i]) + err := source.SaveFullCommit(fcz[i]) require.Nil(err) } - // try to check an unknown seed in the past - mid := commits[3].Commit - err = cert.Certify(mid) + // Try to check an unknown seed in the past. + sh = fcz[3].SignedHeader + err = cert.Certify(sh) require.Nil(err, "%+v", err) - assert.Equal(mid.Height(), cert.LastHeight()) + assert.Equal(fcz[8].Height(), cert.LastTrustedHeight()) - // and jump all the way forward again - end := commits[count-1].Commit - err = cert.Certify(end) + // Jump all the way forward again. + sh = fcz[count-1].SignedHeader + err = cert.Certify(sh) require.Nil(err, "%+v", err) - assert.Equal(end.Height(), cert.LastHeight()) + assert.Equal(fcz[9].Height(), cert.LastTrustedHeight()) } diff --git a/lite/memprovider.go b/lite/memprovider.go deleted file mode 100644 index ac0d8321..00000000 --- a/lite/memprovider.go +++ /dev/null @@ -1,152 +0,0 @@ -package lite - -import ( - "encoding/hex" - "sort" - "sync" - - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -type memStoreProvider struct { - mtx sync.RWMutex - // byHeight is always sorted by Height... need to support range search (nil, h] - // btree would be more efficient for larger sets - byHeight fullCommits - byHash map[string]FullCommit - - sorted bool -} - -// fullCommits just exists to allow easy sorting -type fullCommits []FullCommit - -func (s fullCommits) Len() int { return len(s) } -func (s fullCommits) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s fullCommits) Less(i, j int) bool { - return s[i].Height() < s[j].Height() -} - -// NewMemStoreProvider returns a new in-memory provider. -func NewMemStoreProvider() Provider { - return &memStoreProvider{ - byHeight: fullCommits{}, - byHash: map[string]FullCommit{}, - } -} - -func (m *memStoreProvider) encodeHash(hash []byte) string { - return hex.EncodeToString(hash) -} - -// StoreCommit stores a FullCommit after verifying it. -func (m *memStoreProvider) StoreCommit(fc FullCommit) error { - // make sure the fc is self-consistent before saving - err := fc.ValidateBasic(fc.Commit.Header.ChainID) - if err != nil { - return err - } - - // store the valid fc - key := m.encodeHash(fc.ValidatorsHash()) - - m.mtx.Lock() - defer m.mtx.Unlock() - m.byHash[key] = fc - m.byHeight = append(m.byHeight, fc) - m.sorted = false - return nil -} - -// GetByHeight returns the FullCommit for height h or an error if the commit is not found. -func (m *memStoreProvider) GetByHeight(h int64) (FullCommit, error) { - // By heuristics, GetByHeight with linearsearch is fast enough - // for about 50 keys but after that, it needs binary search. - // See https://github.com/tendermint/tendermint/pull/1043#issue-285188242 - m.mtx.RLock() - n := len(m.byHeight) - m.mtx.RUnlock() - - if n <= 50 { - return m.getByHeightLinearSearch(h) - } - return m.getByHeightBinarySearch(h) -} - -func (m *memStoreProvider) sortByHeightIfNecessaryLocked() { - if !m.sorted { - sort.Sort(m.byHeight) - m.sorted = true - } -} - -func (m *memStoreProvider) getByHeightLinearSearch(h int64) (FullCommit, error) { - m.mtx.Lock() - defer m.mtx.Unlock() - m.sortByHeightIfNecessaryLocked() - // search from highest to lowest - for i := len(m.byHeight) - 1; i >= 0; i-- { - if fc := m.byHeight[i]; fc.Height() <= h { - return fc, nil - } - } - return FullCommit{}, liteErr.ErrCommitNotFound() -} - -func (m *memStoreProvider) getByHeightBinarySearch(h int64) (FullCommit, error) { - m.mtx.Lock() - defer m.mtx.Unlock() - m.sortByHeightIfNecessaryLocked() - low, high := 0, len(m.byHeight)-1 - var mid int - var hmid int64 - var midFC FullCommit - // Our goal is to either find: - // * item ByHeight with the query - // * greatest height with a height <= query - for low <= high { - mid = int(uint(low+high) >> 1) // Avoid an overflow - midFC = m.byHeight[mid] - hmid = midFC.Height() - switch { - case hmid == h: - return midFC, nil - case hmid < h: - low = mid + 1 - case hmid > h: - high = mid - 1 - } - } - - if high >= 0 { - if highFC := m.byHeight[high]; highFC.Height() < h { - return highFC, nil - } - } - return FullCommit{}, liteErr.ErrCommitNotFound() -} - -// GetByHash returns the FullCommit for the hash or an error if the commit is not found. -func (m *memStoreProvider) GetByHash(hash []byte) (FullCommit, error) { - m.mtx.RLock() - defer m.mtx.RUnlock() - - fc, ok := m.byHash[m.encodeHash(hash)] - if !ok { - return fc, liteErr.ErrCommitNotFound() - } - return fc, nil -} - -// LatestCommit returns the latest FullCommit or an error if no commits exist. -func (m *memStoreProvider) LatestCommit() (FullCommit, error) { - m.mtx.Lock() - defer m.mtx.Unlock() - - l := len(m.byHeight) - if l == 0 { - return FullCommit{}, liteErr.ErrCommitNotFound() - } - m.sortByHeightIfNecessaryLocked() - return m.byHeight[l-1], nil -} diff --git a/lite/multiprovider.go b/lite/multiprovider.go new file mode 100644 index 00000000..dcfd1318 --- /dev/null +++ b/lite/multiprovider.go @@ -0,0 +1,72 @@ +package lite + +import ( + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" +) + +// multiProvider allows you to place one or more caches in front of a source +// Provider. It runs through them in order until a match is found. +type multiProvider struct { + Providers []PersistentProvider +} + +// NewMultiProvider returns a new provider which wraps multiple other providers. +func NewMultiProvider(providers ...PersistentProvider) multiProvider { + return multiProvider{ + Providers: providers, + } +} + +// SaveFullCommit saves on all providers, and aborts on the first error. +func (mc multiProvider) SaveFullCommit(fc FullCommit) (err error) { + for _, p := range mc.Providers { + err = p.SaveFullCommit(fc) + if err != nil { + return + } + } + return +} + +// LatestFullCommit loads the latest from all providers and provides +// the latest FullCommit that satisfies the conditions. +// Returns the first error encountered. +func (mc multiProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) (fc FullCommit, err error) { + for _, p := range mc.Providers { + var fc_ FullCommit + fc_, err = p.LatestFullCommit(chainID, minHeight, maxHeight) + if lerr.IsErrCommitNotFound(err) { + err = nil + continue + } else if err != nil { + return + } + if fc == (FullCommit{}) { + fc = fc_ + } else if fc_.Height() > fc.Height() { + fc = fc_ + } + if fc.Height() == maxHeight { + return + } + } + if fc == (FullCommit{}) { + err = lerr.ErrCommitNotFound() + return + } + return +} + +// ValidatorSet returns validator set at height as provided by the first +// provider which has it, or an error otherwise. +func (mc multiProvider) ValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + for _, p := range mc.Providers { + valset, err = p.ValidatorSet(chainID, height) + if err == nil { + // TODO Log unexpected types of errors. + return valset, nil + } + } + return nil, lerr.ErrMissingValidators(chainID, height) +} diff --git a/lite/performance_test.go b/lite/performance_test.go deleted file mode 100644 index 8cd522cb..00000000 --- a/lite/performance_test.go +++ /dev/null @@ -1,365 +0,0 @@ -package lite - -import ( - "fmt" - "math/rand" - "sync" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -func TestMemStoreProvidergetByHeightBinaryAndLinearSameResult(t *testing.T) { - p := NewMemStoreProvider().(*memStoreProvider) - - // Store a bunch of commits at specific heights - // and then ensure that: - // * getByHeightLinearSearch - // * getByHeightBinarySearch - // both return the exact same result - - // 1. Non-existent height commits - nonExistent := []int64{-1000, -1, 0, 1, 10, 11, 17, 31, 67, 1000, 1e9} - ensureNonExistentCommitsAtHeight(t, "getByHeightLinearSearch", p.getByHeightLinearSearch, nonExistent) - ensureNonExistentCommitsAtHeight(t, "getByHeightBinarySearch", p.getByHeightBinarySearch, nonExistent) - - // 2. Save some known height commits - knownHeights := []int64{0, 1, 7, 9, 12, 13, 18, 44, 23, 16, 1024, 100, 199, 1e9} - createAndStoreCommits(t, p, knownHeights) - - // 3. Now check if those heights are retrieved - ensureExistentCommitsAtHeight(t, "getByHeightLinearSearch", p.getByHeightLinearSearch, knownHeights) - ensureExistentCommitsAtHeight(t, "getByHeightBinarySearch", p.getByHeightBinarySearch, knownHeights) - - // 4. And now for the height probing to ensure that any height - // requested returns a fullCommit of height <= requestedHeight. - comparegetByHeightAlgorithms(t, p, 0, 0) - comparegetByHeightAlgorithms(t, p, 1, 1) - comparegetByHeightAlgorithms(t, p, 2, 1) - comparegetByHeightAlgorithms(t, p, 5, 1) - comparegetByHeightAlgorithms(t, p, 7, 7) - comparegetByHeightAlgorithms(t, p, 10, 9) - comparegetByHeightAlgorithms(t, p, 12, 12) - comparegetByHeightAlgorithms(t, p, 14, 13) - comparegetByHeightAlgorithms(t, p, 19, 18) - comparegetByHeightAlgorithms(t, p, 43, 23) - comparegetByHeightAlgorithms(t, p, 45, 44) - comparegetByHeightAlgorithms(t, p, 1025, 1024) - comparegetByHeightAlgorithms(t, p, 101, 100) - comparegetByHeightAlgorithms(t, p, 1e3, 199) - comparegetByHeightAlgorithms(t, p, 1e4, 1024) - comparegetByHeightAlgorithms(t, p, 1e9, 1e9) - comparegetByHeightAlgorithms(t, p, 1e9+1, 1e9) -} - -func createAndStoreCommits(t *testing.T, p Provider, heights []int64) { - chainID := "cache-best-height-binary-and-linear" - appHash := []byte("0xdeadbeef") - keys := GenValKeys(len(heights) / 2) - - for _, h := range heights { - vals := keys.ToValidators(10, int64(len(heights)/2)) - fc := keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) - err := p.StoreCommit(fc) - require.NoError(t, err, "StoreCommit height=%d", h) - } -} - -func comparegetByHeightAlgorithms(t *testing.T, p *memStoreProvider, ask, expect int64) { - algos := map[string]func(int64) (FullCommit, error){ - "getHeightByLinearSearch": p.getByHeightLinearSearch, - "getHeightByBinarySearch": p.getByHeightBinarySearch, - } - - for algo, fn := range algos { - fc, err := fn(ask) - // t.Logf("%s got=%v want=%d", algo, expect, fc.Height()) - require.Nil(t, err, "%s: %+v", algo, err) - if assert.Equal(t, expect, fc.Height()) { - err = p.StoreCommit(fc) - require.Nil(t, err, "%s: %+v", algo, err) - } - } -} - -var blankFullCommit FullCommit - -func ensureNonExistentCommitsAtHeight(t *testing.T, prefix string, fn func(int64) (FullCommit, error), data []int64) { - for i, qh := range data { - fc, err := fn(qh) - assert.NotNil(t, err, "#%d: %s: height=%d should return non-nil error", i, prefix, qh) - assert.Equal(t, fc, blankFullCommit, "#%d: %s: height=%d\ngot =%+v\nwant=%+v", i, prefix, qh, fc, blankFullCommit) - } -} - -func ensureExistentCommitsAtHeight(t *testing.T, prefix string, fn func(int64) (FullCommit, error), data []int64) { - for i, qh := range data { - fc, err := fn(qh) - assert.Nil(t, err, "#%d: %s: height=%d should not return an error: %v", i, prefix, qh, err) - assert.NotEqual(t, fc, blankFullCommit, "#%d: %s: height=%d got a blankCommit", i, prefix, qh) - } -} - -func BenchmarkGenCommit20(b *testing.B) { - keys := GenValKeys(20) - benchmarkGenCommit(b, keys) -} - -func BenchmarkGenCommit100(b *testing.B) { - keys := GenValKeys(100) - benchmarkGenCommit(b, keys) -} - -func BenchmarkGenCommitSec20(b *testing.B) { - keys := GenSecpValKeys(20) - benchmarkGenCommit(b, keys) -} - -func BenchmarkGenCommitSec100(b *testing.B) { - keys := GenSecpValKeys(100) - benchmarkGenCommit(b, keys) -} - -func benchmarkGenCommit(b *testing.B, keys ValKeys) { - chainID := fmt.Sprintf("bench-%d", len(keys)) - vals := keys.ToValidators(20, 10) - for i := 0; i < b.N; i++ { - h := int64(1 + i) - appHash := []byte(fmt.Sprintf("h=%d", h)) - resHash := []byte(fmt.Sprintf("res=%d", h)) - keys.GenCommit(chainID, h, nil, vals, appHash, []byte("params"), resHash, 0, len(keys)) - } -} - -// this benchmarks generating one key -func BenchmarkGenValKeys(b *testing.B) { - keys := GenValKeys(20) - for i := 0; i < b.N; i++ { - keys = keys.Extend(1) - } -} - -// this benchmarks generating one key -func BenchmarkGenSecpValKeys(b *testing.B) { - keys := GenSecpValKeys(20) - for i := 0; i < b.N; i++ { - keys = keys.Extend(1) - } -} - -func BenchmarkToValidators20(b *testing.B) { - benchmarkToValidators(b, 20) -} - -func BenchmarkToValidators100(b *testing.B) { - benchmarkToValidators(b, 100) -} - -// this benchmarks constructing the validator set (.PubKey() * nodes) -func benchmarkToValidators(b *testing.B, nodes int) { - keys := GenValKeys(nodes) - for i := 1; i <= b.N; i++ { - keys.ToValidators(int64(2*i), int64(i)) - } -} - -func BenchmarkToValidatorsSec100(b *testing.B) { - benchmarkToValidatorsSec(b, 100) -} - -// this benchmarks constructing the validator set (.PubKey() * nodes) -func benchmarkToValidatorsSec(b *testing.B, nodes int) { - keys := GenSecpValKeys(nodes) - for i := 1; i <= b.N; i++ { - keys.ToValidators(int64(2*i), int64(i)) - } -} - -func BenchmarkCertifyCommit20(b *testing.B) { - keys := GenValKeys(20) - benchmarkCertifyCommit(b, keys) -} - -func BenchmarkCertifyCommit100(b *testing.B) { - keys := GenValKeys(100) - benchmarkCertifyCommit(b, keys) -} - -func BenchmarkCertifyCommitSec20(b *testing.B) { - keys := GenSecpValKeys(20) - benchmarkCertifyCommit(b, keys) -} - -func BenchmarkCertifyCommitSec100(b *testing.B) { - keys := GenSecpValKeys(100) - benchmarkCertifyCommit(b, keys) -} - -func benchmarkCertifyCommit(b *testing.B, keys ValKeys) { - chainID := "bench-certify" - vals := keys.ToValidators(20, 10) - cert := NewStaticCertifier(chainID, vals) - check := keys.GenCommit(chainID, 123, nil, vals, []byte("foo"), []byte("params"), []byte("res"), 0, len(keys)) - for i := 0; i < b.N; i++ { - err := cert.Certify(check) - if err != nil { - panic(err) - } - } - -} - -type algo bool - -const ( - linearSearch = true - binarySearch = false -) - -// Lazy load the commits -var fcs5, fcs50, fcs100, fcs500, fcs1000 []FullCommit -var h5, h50, h100, h500, h1000 []int64 -var commitsOnce sync.Once - -func lazyGenerateFullCommits(b *testing.B) { - b.Logf("Generating FullCommits") - commitsOnce.Do(func() { - fcs5, h5 = genFullCommits(nil, nil, 5) - b.Logf("Generated 5 FullCommits") - fcs50, h50 = genFullCommits(fcs5, h5, 50) - b.Logf("Generated 50 FullCommits") - fcs100, h100 = genFullCommits(fcs50, h50, 100) - b.Logf("Generated 100 FullCommits") - fcs500, h500 = genFullCommits(fcs100, h100, 500) - b.Logf("Generated 500 FullCommits") - fcs1000, h1000 = genFullCommits(fcs500, h500, 1000) - b.Logf("Generated 1000 FullCommits") - }) -} - -func BenchmarkMemStoreProviderGetByHeightLinearSearch5(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs5, h5, linearSearch) -} - -func BenchmarkMemStoreProviderGetByHeightLinearSearch50(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs50, h50, linearSearch) -} - -func BenchmarkMemStoreProviderGetByHeightLinearSearch100(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs100, h100, linearSearch) -} - -func BenchmarkMemStoreProviderGetByHeightLinearSearch500(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs500, h500, linearSearch) -} - -func BenchmarkMemStoreProviderGetByHeightLinearSearch1000(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs1000, h1000, linearSearch) -} - -func BenchmarkMemStoreProviderGetByHeightBinarySearch5(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs5, h5, binarySearch) -} - -func BenchmarkMemStoreProviderGetByHeightBinarySearch50(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs50, h50, binarySearch) -} - -func BenchmarkMemStoreProviderGetByHeightBinarySearch100(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs100, h100, binarySearch) -} - -func BenchmarkMemStoreProviderGetByHeightBinarySearch500(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs500, h500, binarySearch) -} - -func BenchmarkMemStoreProviderGetByHeightBinarySearch1000(b *testing.B) { - benchmarkMemStoreProvidergetByHeight(b, fcs1000, h1000, binarySearch) -} - -var rng = rand.New(rand.NewSource(10)) - -func benchmarkMemStoreProvidergetByHeight(b *testing.B, fcs []FullCommit, fHeights []int64, algo algo) { - lazyGenerateFullCommits(b) - - b.StopTimer() - mp := NewMemStoreProvider() - for i, fc := range fcs { - if err := mp.StoreCommit(fc); err != nil { - b.Fatalf("FullCommit #%d: err: %v", i, err) - } - } - qHeights := make([]int64, len(fHeights)) - copy(qHeights, fHeights) - // Append some non-existent heights to trigger the worst cases. - qHeights = append(qHeights, 19, -100, -10000, 1e7, -17, 31, -1e9) - - memP := mp.(*memStoreProvider) - searchFn := memP.getByHeightLinearSearch - if algo == binarySearch { // nolint - searchFn = memP.getByHeightBinarySearch - } - - hPerm := rng.Perm(len(qHeights)) - b.StartTimer() - b.ResetTimer() - for i := 0; i < b.N; i++ { - for _, j := range hPerm { - h := qHeights[j] - if _, err := searchFn(h); err != nil { - } - } - } - b.ReportAllocs() -} - -func genFullCommits(prevFC []FullCommit, prevH []int64, want int) ([]FullCommit, []int64) { - fcs := make([]FullCommit, len(prevFC)) - copy(fcs, prevFC) - heights := make([]int64, len(prevH)) - copy(heights, prevH) - - appHash := []byte("benchmarks") - chainID := "benchmarks-gen-full-commits" - n := want - keys := GenValKeys(2 + (n / 3)) - for i := 0; i < n; i++ { - vals := keys.ToValidators(10, int64(n/2)) - h := int64(20 + 10*i) - fcs = append(fcs, keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5)) - heights = append(heights, h) - } - return fcs, heights -} - -func TestMemStoreProviderLatestCommitAlwaysUsesSorted(t *testing.T) { - p := NewMemStoreProvider().(*memStoreProvider) - // 1. With no commits yet stored, it should return ErrCommitNotFound - got, err := p.LatestCommit() - require.Equal(t, err.Error(), liteErr.ErrCommitNotFound().Error(), "should return ErrCommitNotFound()") - require.Equal(t, got, blankFullCommit, "With no fullcommits, it should return a blank FullCommit") - - // 2. Generate some full commits now and we'll add them unsorted. - genAndStoreCommitsOfHeight(t, p, 27, 100, 1, 12, 1000, 17, 91) - fc, err := p.LatestCommit() - require.Nil(t, err, "with commits saved no error expected") - require.NotEqual(t, fc, blankFullCommit, "with commits saved no blank FullCommit") - require.Equal(t, fc.Height(), int64(1000), "the latest commit i.e. the largest expected") -} - -func genAndStoreCommitsOfHeight(t *testing.T, p Provider, heights ...int64) { - n := len(heights) - appHash := []byte("tests") - chainID := "tests-gen-full-commits" - keys := GenValKeys(2 + (n / 3)) - for i := 0; i < n; i++ { - h := heights[i] - vals := keys.ToValidators(10, int64(n/2)) - fc := keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) - err := p.StoreCommit(fc) - require.NoError(t, err, "StoreCommit height=%d", h) - } -} diff --git a/lite/provider.go b/lite/provider.go index 22dc964a..34ba40d4 100644 --- a/lite/provider.go +++ b/lite/provider.go @@ -1,103 +1,28 @@ package lite -// Provider is used to get more validators by other means. -// -// Examples: MemProvider, files.Provider, client.Provider, CacheProvider.... +import ( + "github.com/tendermint/tendermint/types" +) + +// Provider provides information for the lite client to sync validators. +// Examples: MemProvider, files.Provider, client.Provider, CacheProvider. type Provider interface { - // StoreCommit saves a FullCommit after we have verified it, - // so we can query for it later. Important for updating our - // store of trusted commits. - StoreCommit(fc FullCommit) error - // GetByHeight returns the closest commit with height <= h. - GetByHeight(h int64) (FullCommit, error) - // GetByHash returns a commit exactly matching this validator hash. - GetByHash(hash []byte) (FullCommit, error) - // LatestCommit returns the newest commit stored. - LatestCommit() (FullCommit, error) + + // LatestFullCommit returns the latest commit with minHeight <= height <= + // maxHeight. + // If maxHeight is zero, returns the latest where minHeight <= height. + LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error) + + // Get the valset that corresponds to chainID and height and return. + // Height must be >= 1. + ValidatorSet(chainID string, height int64) (*types.ValidatorSet, error) } -// cacheProvider allows you to place one or more caches in front of a source -// Provider. It runs through them in order until a match is found. -// So you can keep a local cache, and check with the network if -// no data is there. -type cacheProvider struct { - Providers []Provider -} +// A provider that can also persist new information. +// Examples: MemProvider, files.Provider, CacheProvider. +type PersistentProvider interface { + Provider -// NewCacheProvider returns a new provider which wraps multiple other providers. -func NewCacheProvider(providers ...Provider) Provider { - return cacheProvider{ - Providers: providers, - } -} - -// StoreCommit tries to add the seed to all providers. -// -// Aborts on first error it encounters (closest provider) -func (c cacheProvider) StoreCommit(fc FullCommit) (err error) { - for _, p := range c.Providers { - err = p.StoreCommit(fc) - if err != nil { - break - } - } - return err -} - -// GetByHeight should return the closest possible match from all providers. -// -// The Cache is usually organized in order from cheapest call (memory) -// to most expensive calls (disk/network). However, since GetByHeight returns -// a FullCommit at h' <= h, if the memory has a seed at h-10, but the network would -// give us the exact match, a naive "stop at first non-error" would hide -// the actual desired results. -// -// Thus, we query each provider in order until we find an exact match -// or we finished querying them all. If at least one returned a non-error, -// then this returns the best match (minimum h-h'). -func (c cacheProvider) GetByHeight(h int64) (fc FullCommit, err error) { - for _, p := range c.Providers { - var tfc FullCommit - tfc, err = p.GetByHeight(h) - if err == nil { - if tfc.Height() > fc.Height() { - fc = tfc - } - if tfc.Height() == h { - break - } - } - } - // even if the last one had an error, if any was a match, this is good - if fc.Height() > 0 { - err = nil - } - return fc, err -} - -// GetByHash returns the FullCommit for the hash or an error if the commit is not found. -func (c cacheProvider) GetByHash(hash []byte) (fc FullCommit, err error) { - for _, p := range c.Providers { - fc, err = p.GetByHash(hash) - if err == nil { - break - } - } - return fc, err -} - -// LatestCommit returns the latest FullCommit or an error if no commit exists. -func (c cacheProvider) LatestCommit() (fc FullCommit, err error) { - for _, p := range c.Providers { - var tfc FullCommit - tfc, err = p.LatestCommit() - if err == nil && tfc.Height() > fc.Height() { - fc = tfc - } - } - // even if the last one had an error, if any was a match, this is good - if fc.Height() > 0 { - err = nil - } - return fc, err + // SaveFullCommit saves a FullCommit (without verification). + SaveFullCommit(fc FullCommit) error } diff --git a/lite/provider_test.go b/lite/provider_test.go index 77b5b1a8..96523d94 100644 --- a/lite/provider_test.go +++ b/lite/provider_test.go @@ -1,98 +1,88 @@ -// nolint: vetshadow -package lite_test +package lite import ( + "errors" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/lite" - liteErr "github.com/tendermint/tendermint/lite/errors" + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" + dbm "github.com/tendermint/tmlibs/db" ) -// missingProvider doesn't store anything, always a miss -// Designed as a mock for testing +// missingProvider doesn't store anything, always a miss. +// Designed as a mock for testing. type missingProvider struct{} // NewMissingProvider returns a provider which does not store anything and always misses. -func NewMissingProvider() lite.Provider { +func NewMissingProvider() PersistentProvider { return missingProvider{} } -func (missingProvider) StoreCommit(lite.FullCommit) error { return nil } -func (missingProvider) GetByHeight(int64) (lite.FullCommit, error) { - return lite.FullCommit{}, liteErr.ErrCommitNotFound() +func (missingProvider) SaveFullCommit(FullCommit) error { return nil } +func (missingProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error) { + return FullCommit{}, lerr.ErrCommitNotFound() } -func (missingProvider) GetByHash([]byte) (lite.FullCommit, error) { - return lite.FullCommit{}, liteErr.ErrCommitNotFound() -} -func (missingProvider) LatestCommit() (lite.FullCommit, error) { - return lite.FullCommit{}, liteErr.ErrCommitNotFound() +func (missingProvider) ValidatorSet(chainID string, height int64) (*types.ValidatorSet, error) { + return nil, errors.New("missing validator set") } func TestMemProvider(t *testing.T) { - p := lite.NewMemStoreProvider() + p := NewDBProvider(dbm.NewMemDB()) checkProvider(t, p, "test-mem", "empty") } -func TestCacheProvider(t *testing.T) { - p := lite.NewCacheProvider( +func TestMultiProvider(t *testing.T) { + p := NewMultiProvider( NewMissingProvider(), - lite.NewMemStoreProvider(), + NewDBProvider(dbm.NewMemDB()), NewMissingProvider(), ) checkProvider(t, p, "test-cache", "kjfhekfhkewhgit") } -func checkProvider(t *testing.T, p lite.Provider, chainID, app string) { +func checkProvider(t *testing.T, p PersistentProvider, chainID, app string) { assert, require := assert.New(t), require.New(t) appHash := []byte(app) - keys := lite.GenValKeys(5) + keys := genPrivKeys(5) count := 10 - // make a bunch of commits... - commits := make([]lite.FullCommit, count) + // Make a bunch of full commits. + fcz := make([]FullCommit, count) for i := 0; i < count; i++ { - // two commits for each validator, to check how we handle dups - // (10, 0), (10, 1), (10, 1), (10, 2), (10, 2), ... vals := keys.ToValidators(10, int64(count/2)) h := int64(20 + 10*i) - commits[i] = keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) + fcz[i] = keys.GenFullCommit(chainID, h, nil, vals, vals, appHash, []byte("params"), []byte("results"), 0, 5) } - // check provider is empty - fc, err := p.GetByHeight(20) + // Check that provider is initially empty. + fc, err := p.LatestFullCommit(chainID, 1, 1<<63-1) require.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) + assert.True(lerr.IsErrCommitNotFound(err)) - fc, err = p.GetByHash(commits[3].ValidatorsHash()) - require.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) - - // now add them all to the provider - for _, s := range commits { - err = p.StoreCommit(s) + // Save all full commits to the provider. + for _, fc := range fcz { + err = p.SaveFullCommit(fc) require.Nil(err) - // and make sure we can get it back - s2, err := p.GetByHash(s.ValidatorsHash()) + // Make sure we can get it back. + fc2, err := p.LatestFullCommit(chainID, fc.Height(), fc.Height()) assert.Nil(err) - assert.Equal(s, s2) - // by height as well - s2, err = p.GetByHeight(s.Height()) - assert.Nil(err) - assert.Equal(s, s2) + assert.Equal(fc.SignedHeader, fc2.SignedHeader) + assert.Equal(fc.Validators, fc2.Validators) + assert.Equal(fc.NextValidators, fc2.NextValidators) } - // make sure we get the last hash if we overstep - fc, err = p.GetByHeight(5000) + // Make sure we get the last hash if we overstep. + fc, err = p.LatestFullCommit(chainID, 1, 5000) if assert.Nil(err) { - assert.Equal(commits[count-1].Height(), fc.Height()) - assert.Equal(commits[count-1], fc) + assert.Equal(fcz[count-1].Height(), fc.Height()) + assert.Equal(fcz[count-1], fc) } - // and middle ones as well - fc, err = p.GetByHeight(47) + // ... and middle ones as well. + fc, err = p.LatestFullCommit(chainID, 1, 47) if assert.Nil(err) { // we only step by 10, so 40 must be the one below this assert.EqualValues(40, fc.Height()) @@ -100,50 +90,49 @@ func checkProvider(t *testing.T, p lite.Provider, chainID, app string) { } -// this will make a get height, and if it is good, set the data as well -func checkGetHeight(t *testing.T, p lite.Provider, ask, expect int64) { - fc, err := p.GetByHeight(ask) - require.Nil(t, err, "GetByHeight") +// This will make a get height, and if it is good, set the data as well. +func checkLatestFullCommit(t *testing.T, p PersistentProvider, chainID string, ask, expect int64) { + fc, err := p.LatestFullCommit(chainID, 1, ask) + require.Nil(t, err) if assert.Equal(t, expect, fc.Height()) { - err = p.StoreCommit(fc) - require.Nil(t, err, "StoreCommit") + err = p.SaveFullCommit(fc) + require.Nil(t, err) } } -func TestCacheGetsBestHeight(t *testing.T) { - // assert, require := assert.New(t), require.New(t) +func TestMultiLatestFullCommit(t *testing.T) { require := require.New(t) - // we will write data to the second level of the cache (p2), - // and see what gets cached, stored in - p := lite.NewMemStoreProvider() - p2 := lite.NewMemStoreProvider() - cp := lite.NewCacheProvider(p, p2) + // We will write data to the second level of the cache (p2), and see what + // gets cached/stored in. + p := NewDBProvider(dbm.NewMemDB()) + p2 := NewDBProvider(dbm.NewMemDB()) + cp := NewMultiProvider(p, p2) chainID := "cache-best-height" appHash := []byte("01234567") - keys := lite.GenValKeys(5) + keys := genPrivKeys(5) count := 10 - // set a bunch of commits + // Set a bunch of full commits. for i := 0; i < count; i++ { vals := keys.ToValidators(10, int64(count/2)) h := int64(10 * (i + 1)) - fc := keys.GenFullCommit(chainID, h, nil, vals, appHash, []byte("params"), []byte("results"), 0, 5) - err := p2.StoreCommit(fc) + fc := keys.GenFullCommit(chainID, h, nil, vals, vals, appHash, []byte("params"), []byte("results"), 0, 5) + err := p2.SaveFullCommit(fc) require.NoError(err) } - // let's get a few heights from the cache and set them proper - checkGetHeight(t, cp, 57, 50) - checkGetHeight(t, cp, 33, 30) + // Get a few heights from the cache and set them proper. + checkLatestFullCommit(t, cp, chainID, 57, 50) + checkLatestFullCommit(t, cp, chainID, 33, 30) // make sure they are set in p as well (but nothing else) - checkGetHeight(t, p, 44, 30) - checkGetHeight(t, p, 50, 50) - checkGetHeight(t, p, 99, 50) + checkLatestFullCommit(t, p, chainID, 44, 30) + checkLatestFullCommit(t, p, chainID, 50, 50) + checkLatestFullCommit(t, p, chainID, 99, 50) // now, query the cache for a higher value - checkGetHeight(t, p2, 99, 90) - checkGetHeight(t, cp, 99, 90) + checkLatestFullCommit(t, p2, chainID, 99, 90) + checkLatestFullCommit(t, cp, chainID, 99, 90) } diff --git a/lite/proxy/block.go b/lite/proxy/block.go index 4cff9ee6..663395fa 100644 --- a/lite/proxy/block.go +++ b/lite/proxy/block.go @@ -2,27 +2,24 @@ package proxy import ( "bytes" + "errors" - "github.com/pkg/errors" - - "github.com/tendermint/tendermint/lite" - certerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" ) -func ValidateBlockMeta(meta *types.BlockMeta, check lite.Commit) error { +func ValidateBlockMeta(meta *types.BlockMeta, sh types.SignedHeader) error { if meta == nil { return errors.New("expecting a non-nil BlockMeta") } // TODO: check the BlockID?? - return ValidateHeader(meta.Header, check) + return ValidateHeader(meta.Header, sh) } -func ValidateBlock(meta *types.Block, check lite.Commit) error { +func ValidateBlock(meta *types.Block, sh types.SignedHeader) error { if meta == nil { return errors.New("expecting a non-nil Block") } - err := ValidateHeader(meta.Header, check) + err := ValidateHeader(meta.Header, sh) if err != nil { return err } @@ -32,17 +29,19 @@ func ValidateBlock(meta *types.Block, check lite.Commit) error { return nil } -func ValidateHeader(head *types.Header, check lite.Commit) error { +func ValidateHeader(head *types.Header, sh types.SignedHeader) error { if head == nil { return errors.New("expecting a non-nil Header") } - // make sure they are for the same height (obvious fail) - if head.Height != check.Height() { - return certerr.ErrHeightMismatch(head.Height, check.Height()) + if sh.Header == nil { + return errors.New("unexpected empty SignedHeader") } - // check if they are equal by using hashes - chead := check.Header - if !bytes.Equal(head.Hash(), chead.Hash()) { + // Make sure they are for the same height (obvious fail). + if head.Height != sh.Height { + return errors.New("Header heights mismatched") + } + // Check if they are equal by using hashes. + if !bytes.Equal(head.Hash(), sh.Hash()) { return errors.New("Headers don't match") } return nil diff --git a/lite/proxy/certifier.go b/lite/proxy/certifier.go index 6e319dc0..a6765402 100644 --- a/lite/proxy/certifier.go +++ b/lite/proxy/certifier.go @@ -2,31 +2,29 @@ package proxy import ( "github.com/tendermint/tendermint/lite" - certclient "github.com/tendermint/tendermint/lite/client" - "github.com/tendermint/tendermint/lite/files" + lclient "github.com/tendermint/tendermint/lite/client" + dbm "github.com/tendermint/tmlibs/db" ) func GetCertifier(chainID, rootDir, nodeAddr string) (*lite.InquiringCertifier, error) { - trust := lite.NewCacheProvider( - lite.NewMemStoreProvider(), - files.NewProvider(rootDir), + trust := lite.NewMultiProvider( + lite.NewDBProvider(dbm.NewMemDB()), + lite.NewDBProvider(dbm.NewDB("trust-base", dbm.LevelDBBackend, rootDir)), ) - source := certclient.NewHTTPProvider(nodeAddr) + source := lclient.NewHTTPProvider(chainID, nodeAddr) // XXX: total insecure hack to avoid `init` - fc, err := source.LatestCommit() - /* XXX - // this gets the most recent verified commit - fc, err := trust.LatestCommit() - if certerr.IsCommitNotFoundErr(err) { - return nil, errors.New("Please run init first to establish a root of trust") - }*/ + fc, err := source.LatestFullCommit(chainID, 1, 1) + if err != nil { + return nil, err + } + err = trust.SaveFullCommit(fc) if err != nil { return nil, err } - cert, err := lite.NewInquiringCertifier(chainID, fc, trust, source) + cert, err := lite.NewInquiringCertifier(chainID, trust, source) if err != nil { return nil, err } diff --git a/lite/proxy/errors.go b/lite/proxy/errors.go index 5a2713e3..9af72a54 100644 --- a/lite/proxy/errors.go +++ b/lite/proxy/errors.go @@ -1,22 +1,24 @@ package proxy import ( - "fmt" - - "github.com/pkg/errors" + cmn "github.com/tendermint/tmlibs/common" ) -//-------------------------------------------- +type errNoData struct{} -var errNoData = fmt.Errorf("No data returned for query") +func (e errNoData) Error() string { + return "No data returned for query" +} -// IsNoDataErr checks whether an error is due to a query returning empty data -func IsNoDataErr(err error) bool { - return errors.Cause(err) == errNoData +// IsErrNoData checks whether an error is due to a query returning empty data +func IsErrNoData(err error) bool { + if err_, ok := err.(cmn.Error); ok { + _, ok := err_.Data().(errNoData) + return ok + } + return false } func ErrNoData() error { - return errors.WithStack(errNoData) + return cmn.ErrorWrap(errNoData{}, "") } - -//-------------------------------------------- diff --git a/lite/proxy/errors_test.go b/lite/proxy/errors_test.go deleted file mode 100644 index 7f51be50..00000000 --- a/lite/proxy/errors_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package proxy - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestErrorNoData(t *testing.T) { - e1 := ErrNoData() - assert.True(t, IsNoDataErr(e1)) - - e2 := errors.New("foobar") - assert.False(t, IsNoDataErr(e2)) - assert.False(t, IsNoDataErr(nil)) -} diff --git a/lite/proxy/query.go b/lite/proxy/query.go index 9c9557f8..aa25cdcf 100644 --- a/lite/proxy/query.go +++ b/lite/proxy/query.go @@ -1,15 +1,16 @@ package proxy import ( + "fmt" + "github.com/pkg/errors" cmn "github.com/tendermint/tmlibs/common" "github.com/tendermint/tendermint/lite" - "github.com/tendermint/tendermint/lite/client" - certerr "github.com/tendermint/tendermint/lite/errors" rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" + "github.com/tendermint/tendermint/types" ) // KeyProof represents a proof of existence or absence of a single key. @@ -75,12 +76,12 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption } // AppHash for height H is in header H+1 - commit, err := GetCertifiedCommit(resp.Height+1, node, cert) + signedHeader, err := GetCertifiedCommit(resp.Height+1, node, cert) if err != nil { return nil, nil, err } - _ = commit + _ = signedHeader return &ctypes.ResultABCIQuery{Response: resp}, nil, nil /* // TODO refactor so iavl stuff is not in tendermint core @@ -98,7 +99,7 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption } // Validate the proof against the certified header to ensure data integrity. - err = eproof.Verify(resp.Key, resp.Value, commit.Header.AppHash) + err = eproof.Verify(resp.Key, resp.Value, signedHeader.AppHash) if err != nil { return nil, nil, errors.Wrap(err, "Couldn't verify proof") } @@ -117,7 +118,7 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption } // Validate the proof against the certified header to ensure data integrity. - err = aproof.Verify(resp.Key, nil, commit.Header.AppHash) + err = aproof.Verify(resp.Key, nil, signedHeader.AppHash) if err != nil { return nil, nil, errors.Wrap(err, "Couldn't verify proof") } @@ -125,28 +126,29 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption */ } -// GetCertifiedCommit gets the signed header for a given height -// and certifies it. Returns error if unable to get a proven header. -func GetCertifiedCommit(h int64, node rpcclient.Client, cert lite.Certifier) (lite.Commit, error) { +// GetCertifiedCommit gets the signed header for a given height and certifies +// it. Returns error if unable to get a proven header. +func GetCertifiedCommit(h int64, client rpcclient.Client, cert lite.Certifier) (types.SignedHeader, error) { // FIXME: cannot use cert.GetByHeight for now, as it also requires // Validators and will fail on querying tendermint for non-current height. // When this is supported, we should use it instead... - rpcclient.WaitForHeight(node, h, nil) - cresp, err := node.Commit(&h) + rpcclient.WaitForHeight(client, h, nil) + cresp, err := client.Commit(&h) if err != nil { - return lite.Commit{}, err + return types.SignedHeader{}, err } - commit := client.CommitFromResult(cresp) - // validate downloaded checkpoint with our request and trust store. - if commit.Height() != h { - return lite.Commit{}, certerr.ErrHeightMismatch(h, commit.Height()) + // Validate downloaded checkpoint with our request and trust store. + sh := cresp.SignedHeader + if sh.Height != h { + return types.SignedHeader{}, fmt.Errorf("height mismatch: want %v got %v", + h, sh.Height) } - if err = cert.Certify(commit); err != nil { - return lite.Commit{}, err + if err = cert.Certify(sh); err != nil { + return types.SignedHeader{}, err } - return commit, nil + return sh, nil } diff --git a/lite/proxy/query_test.go b/lite/proxy/query_test.go index 38a43af2..fcc6659a 100644 --- a/lite/proxy/query_test.go +++ b/lite/proxy/query_test.go @@ -19,12 +19,12 @@ import ( ) var node *nm.Node +var chainID = "tendermint_test" // TODO use from config. // TODO fix tests!! func TestMain(m *testing.M) { app := kvstore.NewKVStoreApplication() - node = rpctest.StartTendermint(app) code := m.Run() @@ -55,28 +55,28 @@ func _TestAppProofs(t *testing.T) { brh := br.Height // This sets up our trust on the node based on some past point. - source := certclient.NewProvider(cl) - seed, err := source.GetByHeight(brh - 2) + source := certclient.NewProvider(chainID, cl) + seed, err := source.LatestFullCommit(chainID, brh-2, brh-2) require.NoError(err, "%+v", err) - cert := lite.NewStaticCertifier("my-chain", seed.Validators) + cert := lite.NewBaseCertifier("my-chain", seed.Height(), seed.Validators) client.WaitForHeight(cl, 3, nil) - latest, err := source.LatestCommit() + latest, err := source.LatestFullCommit(chainID, 1, 1<<63-1) require.NoError(err, "%+v", err) - rootHash := latest.Header.AppHash + rootHash := latest.SignedHeader.AppHash // verify a query before the tx block has no data (and valid non-exist proof) bs, height, proof, err := GetWithProof(k, brh-1, cl, cert) fmt.Println(bs, height, proof, err) require.NotNil(err) - require.True(IsNoDataErr(err), err.Error()) + require.True(IsErrNoData(err), err.Error()) require.Nil(bs) // but given that block it is good bs, height, proof, err = GetWithProof(k, brh, cl, cert) require.NoError(err, "%+v", err) require.NotNil(proof) - require.True(height >= int64(latest.Header.Height)) + require.True(height >= int64(latest.Height())) // Alexis there is a bug here, somehow the above code gives us rootHash = nil // and proof.Verify doesn't care, while proofNotExists.Verify fails. @@ -92,7 +92,7 @@ func _TestAppProofs(t *testing.T) { // Test non-existing key. missing := []byte("my-missing-key") bs, _, proof, err = GetWithProof(missing, 0, cl, cert) - require.True(IsNoDataErr(err)) + require.True(IsErrNoData(err)) require.Nil(bs) require.NotNil(proof) err = proof.Verify(missing, nil, rootHash) @@ -114,10 +114,10 @@ func _TestTxProofs(t *testing.T) { require.EqualValues(0, br.DeliverTx.Code) brh := br.Height - source := certclient.NewProvider(cl) - seed, err := source.GetByHeight(brh - 2) + source := certclient.NewProvider(chainID, cl) + seed, err := source.LatestFullCommit(chainID, brh-2, brh-2) require.NoError(err, "%+v", err) - cert := lite.NewStaticCertifier("my-chain", seed.Validators) + cert := lite.NewBaseCertifier("my-chain", seed.Height(), seed.Validators) // First let's make sure a bogus transaction hash returns a valid non-existence proof. key := types.Tx([]byte("bogus")).Hash() diff --git a/lite/proxy/validate_test.go b/lite/proxy/validate_test.go index 782a6aab..af4fc26f 100644 --- a/lite/proxy/validate_test.go +++ b/lite/proxy/validate_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/assert" - "github.com/tendermint/tendermint/lite" "github.com/tendermint/tendermint/lite/proxy" "github.com/tendermint/tendermint/types" ) @@ -26,9 +25,9 @@ var hdrHeight11 = &types.Header{ func TestValidateBlock(t *testing.T) { tests := []struct { - block *types.Block - commit lite.Commit - wantErr string + block *types.Block + signedHeader types.SignedHeader + wantErr string }{ { block: nil, wantErr: "non-nil Block", @@ -37,32 +36,32 @@ func TestValidateBlock(t *testing.T) { block: &types.Block{}, wantErr: "nil Header", }, { - block: &types.Block{Header: new(types.Header)}, + block: &types.Block{Header: new(types.Header)}, wantErr: "unexpected empty SignedHeader", }, // Start Header.Height mismatch test { - block: &types.Block{Header: &types.Header{Height: 10}}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, - wantErr: "don't match - 10 vs 11", + block: &types.Block{Header: &types.Header{Height: 10}}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, + wantErr: "Header heights mismatched", }, { - block: &types.Block{Header: &types.Header{Height: 11}}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, + block: &types.Block{Header: &types.Header{Height: 11}}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, }, // End Header.Height mismatch test // Start Header.Hash mismatch test { - block: &types.Block{Header: hdrHeight11}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, - wantErr: "Headers don't match", + block: &types.Block{Header: hdrHeight11}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, + wantErr: "Headers don't match", }, { - block: &types.Block{Header: hdrHeight11}, - commit: lite.Commit{Header: hdrHeight11}, + block: &types.Block{Header: hdrHeight11}, + signedHeader: types.SignedHeader{Header: hdrHeight11}, }, // End Header.Hash mismatch test @@ -72,7 +71,7 @@ func TestValidateBlock(t *testing.T) { Header: &types.Header{Height: 11}, Data: &types.Data{Txs: []types.Tx{[]byte("0xDE"), []byte("AD")}}, }, - commit: lite.Commit{ + signedHeader: types.SignedHeader{ Header: &types.Header{Height: 11}, Commit: &types.Commit{BlockID: types.BlockID{Hash: []byte("0xDEADBEEF")}}, }, @@ -83,7 +82,7 @@ func TestValidateBlock(t *testing.T) { Header: &types.Header{Height: 11, DataHash: deadBeefHash}, Data: &types.Data{Txs: deadBeefTxs}, }, - commit: lite.Commit{ + signedHeader: types.SignedHeader{ Header: &types.Header{Height: 11}, Commit: &types.Commit{BlockID: types.BlockID{Hash: []byte("DEADBEEF")}}, }, @@ -92,7 +91,7 @@ func TestValidateBlock(t *testing.T) { } for i, tt := range tests { - err := proxy.ValidateBlock(tt.block, tt.commit) + err := proxy.ValidateBlock(tt.block, tt.signedHeader) if tt.wantErr != "" { if err == nil { assert.FailNowf(t, "Unexpectedly passed", "#%d", i) @@ -108,9 +107,9 @@ func TestValidateBlock(t *testing.T) { func TestValidateBlockMeta(t *testing.T) { tests := []struct { - meta *types.BlockMeta - commit lite.Commit - wantErr string + meta *types.BlockMeta + signedHeader types.SignedHeader + wantErr string }{ { meta: nil, wantErr: "non-nil BlockMeta", @@ -119,32 +118,32 @@ func TestValidateBlockMeta(t *testing.T) { meta: &types.BlockMeta{}, wantErr: "non-nil Header", }, { - meta: &types.BlockMeta{Header: new(types.Header)}, + meta: &types.BlockMeta{Header: new(types.Header)}, wantErr: "unexpected empty SignedHeader", }, // Start Header.Height mismatch test { - meta: &types.BlockMeta{Header: &types.Header{Height: 10}}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, - wantErr: "don't match - 10 vs 11", + meta: &types.BlockMeta{Header: &types.Header{Height: 10}}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, + wantErr: "Header heights mismatched", }, { - meta: &types.BlockMeta{Header: &types.Header{Height: 11}}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, + meta: &types.BlockMeta{Header: &types.Header{Height: 11}}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, }, // End Header.Height mismatch test // Start Headers don't match test { - meta: &types.BlockMeta{Header: hdrHeight11}, - commit: lite.Commit{Header: &types.Header{Height: 11}}, - wantErr: "Headers don't match", + meta: &types.BlockMeta{Header: hdrHeight11}, + signedHeader: types.SignedHeader{Header: &types.Header{Height: 11}}, + wantErr: "Headers don't match", }, { - meta: &types.BlockMeta{Header: hdrHeight11}, - commit: lite.Commit{Header: hdrHeight11}, + meta: &types.BlockMeta{Header: hdrHeight11}, + signedHeader: types.SignedHeader{Header: hdrHeight11}, }, { @@ -156,7 +155,7 @@ func TestValidateBlockMeta(t *testing.T) { Time: testTime1, }, }, - commit: lite.Commit{ + signedHeader: types.SignedHeader{ Header: &types.Header{Height: 11, DataHash: deadBeefHash}, }, wantErr: "Headers don't match", @@ -170,7 +169,7 @@ func TestValidateBlockMeta(t *testing.T) { Time: testTime1, }, }, - commit: lite.Commit{ + signedHeader: types.SignedHeader{ Header: &types.Header{ Height: 11, DataHash: deadBeefHash, ValidatorsHash: []byte("Tendermint"), @@ -189,7 +188,7 @@ func TestValidateBlockMeta(t *testing.T) { Time: testTime2, }, }, - commit: lite.Commit{ + signedHeader: types.SignedHeader{ Header: &types.Header{ Height: 11, DataHash: deadBeefHash, ValidatorsHash: []byte("Tendermint-x"), @@ -203,7 +202,7 @@ func TestValidateBlockMeta(t *testing.T) { } for i, tt := range tests { - err := proxy.ValidateBlockMeta(tt.meta, tt.commit) + err := proxy.ValidateBlockMeta(tt.meta, tt.signedHeader) if tt.wantErr != "" { if err == nil { assert.FailNowf(t, "Unexpectedly passed", "#%d: wanted error %q", i, tt.wantErr) diff --git a/lite/proxy/wrapper.go b/lite/proxy/wrapper.go index 5fb12a40..83fc96a1 100644 --- a/lite/proxy/wrapper.go +++ b/lite/proxy/wrapper.go @@ -4,7 +4,6 @@ import ( cmn "github.com/tendermint/tmlibs/common" "github.com/tendermint/tendermint/lite" - certclient "github.com/tendermint/tendermint/lite/client" rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" ) @@ -53,11 +52,11 @@ func (w Wrapper) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) { return res, err } h := int64(res.Height) - check, err := GetCertifiedCommit(h, w.Client, w.cert) + sh, err := GetCertifiedCommit(h, w.Client, w.cert) if err != nil { return res, err } - err = res.Proof.Validate(check.Header.DataHash) + err = res.Proof.Validate(sh.DataHash) return res, err } @@ -74,12 +73,12 @@ func (w Wrapper) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlock // go and verify every blockmeta in the result.... for _, meta := range r.BlockMetas { // get a checkpoint to verify from - c, err := w.Commit(&meta.Header.Height) + res, err := w.Commit(&meta.Header.Height) if err != nil { return nil, err } - check := certclient.CommitFromResult(c) - err = ValidateBlockMeta(meta, check) + sh := res.SignedHeader + err = ValidateBlockMeta(meta, sh) if err != nil { return nil, err } @@ -95,18 +94,18 @@ func (w Wrapper) Block(height *int64) (*ctypes.ResultBlock, error) { return nil, err } // get a checkpoint to verify from - c, err := w.Commit(height) + res, err := w.Commit(height) if err != nil { return nil, err } - check := certclient.CommitFromResult(c) + sh := res.SignedHeader // now verify - err = ValidateBlockMeta(r.BlockMeta, check) + err = ValidateBlockMeta(r.BlockMeta, sh) if err != nil { return nil, err } - err = ValidateBlock(r.Block, check) + err = ValidateBlock(r.Block, sh) if err != nil { return nil, err } @@ -118,13 +117,13 @@ func (w Wrapper) Block(height *int64) (*ctypes.ResultBlock, error) { // This is the foundation for all other verification in this module func (w Wrapper) Commit(height *int64) (*ctypes.ResultCommit, error) { rpcclient.WaitForHeight(w.Client, *height, nil) - r, err := w.Client.Commit(height) + res, err := w.Client.Commit(height) // if we got it, then certify it if err == nil { - check := certclient.CommitFromResult(r) - err = w.cert.Certify(check) + sh := res.SignedHeader + err = w.cert.Certify(sh) } - return r, err + return res, err } // // WrappedSwitch creates a websocket connection that auto-verifies any info diff --git a/lite/static_certifier.go b/lite/static_certifier.go deleted file mode 100644 index 1ec3b809..00000000 --- a/lite/static_certifier.go +++ /dev/null @@ -1,73 +0,0 @@ -package lite - -import ( - "bytes" - - "github.com/pkg/errors" - - "github.com/tendermint/tendermint/types" - - liteErr "github.com/tendermint/tendermint/lite/errors" -) - -var _ Certifier = (*StaticCertifier)(nil) - -// StaticCertifier assumes a static set of validators, set on -// initilization and checks against them. -// The signatures on every header is checked for > 2/3 votes -// against the known validator set upon Certify -// -// Good for testing or really simple chains. Building block -// to support real-world functionality. -type StaticCertifier struct { - chainID string - vSet *types.ValidatorSet - vhash []byte -} - -// NewStaticCertifier returns a new certifier with a static validator set. -func NewStaticCertifier(chainID string, vals *types.ValidatorSet) *StaticCertifier { - return &StaticCertifier{ - chainID: chainID, - vSet: vals, - } -} - -// ChainID returns the chain id. -// Implements Certifier. -func (sc *StaticCertifier) ChainID() string { - return sc.chainID -} - -// Validators returns the validator set. -func (sc *StaticCertifier) Validators() *types.ValidatorSet { - return sc.vSet -} - -// Hash returns the hash of the validator set. -func (sc *StaticCertifier) Hash() []byte { - if len(sc.vhash) == 0 { - sc.vhash = sc.vSet.Hash() - } - return sc.vhash -} - -// Certify makes sure that the commit is valid. -// Implements Certifier. -func (sc *StaticCertifier) Certify(commit Commit) error { - // do basic sanity checks - err := commit.ValidateBasic(sc.chainID) - if err != nil { - return err - } - - // make sure it has the same validator set we have (static means static) - if !bytes.Equal(sc.Hash(), commit.Header.ValidatorsHash) { - return liteErr.ErrValidatorsChanged() - } - - // then make sure we have the proper signatures for this - err = sc.vSet.VerifyCommit(sc.chainID, commit.Commit.BlockID, - commit.Header.Height, commit.Commit) - return errors.WithStack(err) -} diff --git a/lite/types.go b/lite/types.go new file mode 100644 index 00000000..1f479799 --- /dev/null +++ b/lite/types.go @@ -0,0 +1,13 @@ +package lite + +import ( + "github.com/tendermint/tendermint/types" +) + +// Certifier checks the votes to make sure the block really is signed properly. +// Certifier must know the current or recent set of validitors by some other +// means. +type Certifier interface { + Certify(sheader types.SignedHeader) error + ChainID() string +} diff --git a/privval/priv_validator_test.go b/privval/priv_validator_test.go index 4fc8f97f..31410163 100644 --- a/privval/priv_validator_test.go +++ b/privval/priv_validator_test.go @@ -183,7 +183,7 @@ func TestDifferByTimestamp(t *testing.T) { assert.NoError(t, err, "expected no error signing proposal") signBytes := proposal.SignBytes(chainID) sig := proposal.Signature - timeStamp := clipToMS(proposal.Timestamp) + timeStamp := proposal.Timestamp // manipulate the timestamp. should get changed back proposal.Timestamp = proposal.Timestamp.Add(time.Millisecond) @@ -207,7 +207,7 @@ func TestDifferByTimestamp(t *testing.T) { signBytes := vote.SignBytes(chainID) sig := vote.Signature - timeStamp := clipToMS(vote.Timestamp) + timeStamp := vote.Timestamp // manipulate the timestamp. should get changed back vote.Timestamp = vote.Timestamp.Add(time.Millisecond) @@ -242,10 +242,3 @@ func newProposal(height int64, round int, partsHeader types.PartSetHeader) *type Timestamp: time.Now().UTC(), } } - -func clipToMS(t time.Time) time.Time { - nano := t.UnixNano() - million := int64(1000000) - nano = (nano / million) * million - return time.Unix(0, nano).UTC() -} diff --git a/privval/socket_test.go b/privval/socket_test.go index fcf21e0c..1813893a 100644 --- a/privval/socket_test.go +++ b/privval/socket_test.go @@ -119,7 +119,7 @@ func TestSocketPVAcceptDeadline(t *testing.T) { SocketPVAcceptDeadline(time.Millisecond)(sc) - assert.Equal(t, sc.Start().(cmn.Error).Cause(), ErrConnWaitTimeout) + assert.Equal(t, sc.Start().(cmn.Error).Data(), ErrConnWaitTimeout) } func TestSocketPVDeadline(t *testing.T) { @@ -165,7 +165,7 @@ func TestSocketPVDeadline(t *testing.T) { time.Sleep(20 * time.Microsecond) _, err := sc.getPubKey() - assert.Equal(t, err.(cmn.Error).Cause(), ErrConnTimeout) + assert.Equal(t, err.(cmn.Error).Data(), ErrConnTimeout) } func TestSocketPVWait(t *testing.T) { @@ -178,7 +178,7 @@ func TestSocketPVWait(t *testing.T) { SocketPVConnWait(time.Millisecond)(sc) - assert.Equal(t, sc.Start().(cmn.Error).Cause(), ErrConnWaitTimeout) + assert.Equal(t, sc.Start().(cmn.Error).Data(), ErrConnWaitTimeout) } func TestRemoteSignerRetry(t *testing.T) { @@ -221,7 +221,7 @@ func TestRemoteSignerRetry(t *testing.T) { RemoteSignerConnDeadline(time.Millisecond)(rs) RemoteSignerConnRetries(retries)(rs) - assert.Equal(t, rs.Start().(cmn.Error).Cause(), ErrDialRetryMax) + assert.Equal(t, rs.Start().(cmn.Error).Data(), ErrDialRetryMax) select { case attempts := <-attemptc: diff --git a/rpc/core/blocks.go b/rpc/core/blocks.go index a5ad5b4c..4cf44914 100644 --- a/rpc/core/blocks.go +++ b/rpc/core/blocks.go @@ -349,16 +349,16 @@ func BlockResults(heightPtr *int64) (*ctypes.ResultBlockResults, error) { return res, nil } -func getHeight(storeHeight int64, heightPtr *int64) (int64, error) { +func getHeight(currentHeight int64, heightPtr *int64) (int64, error) { if heightPtr != nil { height := *heightPtr if height <= 0 { return 0, fmt.Errorf("Height must be greater than 0") } - if height > storeHeight { + if height > currentHeight { return 0, fmt.Errorf("Height must be less than or equal to the current blockchain height") } return height, nil } - return storeHeight, nil + return currentHeight, nil } diff --git a/rpc/core/consensus.go b/rpc/core/consensus.go index c026cd91..4e4c54de 100644 --- a/rpc/core/consensus.go +++ b/rpc/core/consensus.go @@ -44,8 +44,10 @@ import ( // } // ``` func Validators(heightPtr *int64) (*ctypes.ResultValidators, error) { - storeHeight := blockStore.Height() - height, err := getHeight(storeHeight, heightPtr) + // The latest validator that we know is the + // NextValidator of the last block. + height := consensusState.GetState().LastBlockHeight + 1 + height, err := getHeight(height, heightPtr) if err != nil { return nil, err } diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 27302be1..516eced0 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -33,10 +33,8 @@ type ResultBlock struct { // Commit and Header type ResultCommit struct { - // SignedHeader is header and commit, embedded so we only have - // one level in the json output - types.SignedHeader - CanonicalCommit bool `json:"canonical"` + types.SignedHeader `json:"signed_header"` + CanonicalCommit bool `json:"canonical"` } // ABCI results from a block diff --git a/rpc/lib/server/http_server.go b/rpc/lib/server/http_server.go index 9bdb4dff..8d011ce5 100644 --- a/rpc/lib/server/http_server.go +++ b/rpc/lib/server/http_server.go @@ -55,7 +55,7 @@ func StartHTTPServer( listener, RecoverAndLogHandler(handler, logger), ) - logger.Error("RPC HTTP server stopped", "err", err) + logger.Info("RPC HTTP server stopped", "err", err) }() return listener, nil } diff --git a/scripts/install_abci_apps.sh b/scripts/install_abci_apps.sh index eb70070d..ee4b9dde 100644 --- a/scripts/install_abci_apps.sh +++ b/scripts/install_abci_apps.sh @@ -4,8 +4,8 @@ COMMIT=$(bash scripts/dep_utils/parse.sh abci) echo "Checking out vendored commit for abci: $COMMIT" -go get -d github.com/tendermint/abci -cd "$GOPATH/src/github.com/tendermint/abci" || exit +go get -d github.com/tendermint/tendermint/abci +cd "$GOPATH/src/github.com/tendermint/tendermint/abci" || exit git checkout "$COMMIT" make get_tools make get_vendor_deps diff --git a/test/app/grpc_client.go b/test/app/grpc_client.go index c55713c7..efcac0f0 100644 --- a/test/app/grpc_client.go +++ b/test/app/grpc_client.go @@ -2,12 +2,12 @@ package main import ( "encoding/hex" - "encoding/json" "fmt" "os" "context" + "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/rpc/grpc" ) @@ -33,7 +33,7 @@ func main() { os.Exit(1) } - bz, err := json.Marshal(res) + bz, err := amino.NewCodec().MarshalJSON(res) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/types/block.go b/types/block.go index e72b5fc7..0faa24db 100644 --- a/types/block.go +++ b/types/block.go @@ -360,6 +360,7 @@ func (commit *Commit) IsCommit() bool { } // ValidateBasic performs basic validation that doesn't involve state data. +// Does not actually check the cryptographic signatures. func (commit *Commit) ValidateBasic() error { if commit.BlockID.IsZero() { return errors.New("Commit cannot be for nil block") @@ -369,23 +370,23 @@ func (commit *Commit) ValidateBasic() error { } height, round := commit.Height(), commit.Round() - // validate the precommits + // Validate the precommits. for _, precommit := range commit.Precommits { // It's OK for precommits to be missing. if precommit == nil { continue } - // Ensure that all votes are precommits + // Ensure that all votes are precommits. if precommit.Type != VoteTypePrecommit { return fmt.Errorf("Invalid commit vote. Expected precommit, got %v", precommit.Type) } - // Ensure that all heights are the same + // Ensure that all heights are the same. if precommit.Height != height { return fmt.Errorf("Invalid commit precommit height. Expected %v, got %v", height, precommit.Height) } - // Ensure that all rounds are the same + // Ensure that all rounds are the same. if precommit.Round != round { return fmt.Errorf("Invalid commit precommit round. Expected %v, got %v", round, precommit.Round) @@ -417,19 +418,77 @@ func (commit *Commit) StringIndented(indent string) string { } return fmt.Sprintf(`Commit{ %s BlockID: %v -%s Precommits: %v +%s Precommits: +%s %v %s}#%v`, indent, commit.BlockID, - indent, strings.Join(precommitStrings, "\n"+indent+" "), + indent, + indent, strings.Join(precommitStrings, "\n"+indent+" "), indent, commit.hash) } //----------------------------------------------------------------------------- -// SignedHeader is a header along with the commits that prove it +// SignedHeader is a header along with the commits that prove it. type SignedHeader struct { - Header *Header `json:"header"` - Commit *Commit `json:"commit"` + *Header `json:"header"` + Commit *Commit `json:"commit"` +} + +// ValidateBasic does basic consistency checks and makes sure the header +// and commit are consistent. +// +// NOTE: This does not actually check the cryptographic signatures. Make +// sure to use a Certifier to validate the signatures actually provide a +// significantly strong proof for this header's validity. +func (sh SignedHeader) ValidateBasic(chainID string) error { + + // Make sure the header is consistent with the commit. + if sh.Header == nil { + return errors.New("SignedHeader missing header.") + } + if sh.Commit == nil { + return errors.New("SignedHeader missing commit (precommit votes).") + } + // Check ChainID. + if sh.ChainID != chainID { + return fmt.Errorf("Header belongs to another chain '%s' not '%s'", + sh.ChainID, chainID) + } + // Check Height. + if sh.Commit.Height() != sh.Height { + return fmt.Errorf("SignedHeader header and commit height mismatch: %v vs %v", + sh.Height, sh.Commit.Height()) + } + // Check Hash. + hhash := sh.Hash() + chash := sh.Commit.BlockID.Hash + if !bytes.Equal(hhash, chash) { + return fmt.Errorf("SignedHeader commit signs block %X, header is block %X", + chash, hhash) + } + // ValidateBasic on the Commit. + err := sh.Commit.ValidateBasic() + if err != nil { + return cmn.ErrorWrap(err, "commit.ValidateBasic failed during SignedHeader.ValidateBasic") + } + return nil +} + +func (sh SignedHeader) String() string { + return sh.StringIndented("") +} + +// StringIndented returns a string representation of the SignedHeader. +func (sh SignedHeader) StringIndented(indent string) string { + return fmt.Sprintf(`SignedHeader{ +%s %v +%s %v +%s}`, + indent, sh.Header.StringIndented(indent+" "), + indent, sh.Commit.StringIndented(indent+" "), + indent) + return "" } //----------------------------------------------------------------------------- diff --git a/types/canonical_json.go b/types/canonical_json.go index 258f7714..14881f62 100644 --- a/types/canonical_json.go +++ b/types/canonical_json.go @@ -9,7 +9,7 @@ import ( // Canonical json is amino's json for structs with fields in alphabetical order // TimeFormat is used for generating the sigs -const TimeFormat = "2006-01-02T15:04:05.000Z" +const TimeFormat = time.RFC3339Nano type CanonicalJSONBlockID struct { Hash cmn.HexBytes `json:"hash,omitempty"` @@ -110,5 +110,5 @@ func CanonicalTime(t time.Time) string { // Note that sending time over amino resets it to // local time, we need to force UTC here, so the // signatures match - return t.UTC().Format(TimeFormat) + return t.Round(0).UTC().Format(TimeFormat) } diff --git a/types/proposal.go b/types/proposal.go index 52ce8756..964ca0ca 100644 --- a/types/proposal.go +++ b/types/proposal.go @@ -34,7 +34,7 @@ func NewProposal(height int64, round int, blockPartsHeader PartSetHeader, polRou return &Proposal{ Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: time.Now().Round(0).UTC(), BlockPartsHeader: blockPartsHeader, POLRound: polRound, POLBlockID: polBlockID, diff --git a/types/validator_set.go b/types/validator_set.go index 8f085090..dc1d0e88 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -29,48 +29,51 @@ type ValidatorSet struct { totalVotingPower int64 } -func NewValidatorSet(vals []*Validator) *ValidatorSet { - validators := make([]*Validator, len(vals)) - for i, val := range vals { +func NewValidatorSet(valz []*Validator) *ValidatorSet { + if valz != nil && len(valz) == 0 { + panic("validator set initialization slice cannot be an empty slice (but it can be nil)") + } + validators := make([]*Validator, len(valz)) + for i, val := range valz { validators[i] = val.Copy() } sort.Sort(ValidatorsByAddress(validators)) - vs := &ValidatorSet{ + vals := &ValidatorSet{ Validators: validators, } - - if vals != nil { - vs.IncrementAccum(1) + if valz != nil { + vals.IncrementAccum(1) } - return vs + return vals } // Increment Accum and update the proposer on a copy, and return it. -func (valSet *ValidatorSet) CopyIncrementAccum(times int) *ValidatorSet { - copy := valSet.Copy() +func (vals *ValidatorSet) CopyIncrementAccum(times int) *ValidatorSet { + copy := vals.Copy() copy.IncrementAccum(times) return copy } // Increment Accum and update the proposer. -func (valSet *ValidatorSet) IncrementAccum(times int) { +func (vals *ValidatorSet) IncrementAccum(times int) { + // Add VotingPower * times to each validator and order into heap. validatorsHeap := cmn.NewHeap() - for _, val := range valSet.Validators { - // check for overflow both multiplication and sum + for _, val := range vals.Validators { + // Check for overflow both multiplication and sum. val.Accum = safeAddClip(val.Accum, safeMulClip(val.VotingPower, int64(times))) validatorsHeap.PushComparable(val, accumComparable{val}) } - // Decrement the validator with most accum times times + // Decrement the validator with most accum times times. for i := 0; i < times; i++ { mostest := validatorsHeap.Peek().(*Validator) // mind underflow - mostest.Accum = safeSubClip(mostest.Accum, valSet.TotalVotingPower()) + mostest.Accum = safeSubClip(mostest.Accum, vals.TotalVotingPower()) if i == times-1 { - valSet.Proposer = mostest + vals.Proposer = mostest } else { validatorsHeap.Update(mostest, accumComparable{mostest}) } @@ -78,36 +81,36 @@ func (valSet *ValidatorSet) IncrementAccum(times int) { } // Copy each validator into a new ValidatorSet -func (valSet *ValidatorSet) Copy() *ValidatorSet { - validators := make([]*Validator, len(valSet.Validators)) - for i, val := range valSet.Validators { +func (vals *ValidatorSet) Copy() *ValidatorSet { + validators := make([]*Validator, len(vals.Validators)) + for i, val := range vals.Validators { // NOTE: must copy, since IncrementAccum updates in place. validators[i] = val.Copy() } return &ValidatorSet{ Validators: validators, - Proposer: valSet.Proposer, - totalVotingPower: valSet.totalVotingPower, + Proposer: vals.Proposer, + totalVotingPower: vals.totalVotingPower, } } // HasAddress returns true if address given is in the validator set, false - // otherwise. -func (valSet *ValidatorSet) HasAddress(address []byte) bool { - idx := sort.Search(len(valSet.Validators), func(i int) bool { - return bytes.Compare(address, valSet.Validators[i].Address) <= 0 +func (vals *ValidatorSet) HasAddress(address []byte) bool { + idx := sort.Search(len(vals.Validators), func(i int) bool { + return bytes.Compare(address, vals.Validators[i].Address) <= 0 }) - return idx < len(valSet.Validators) && bytes.Equal(valSet.Validators[idx].Address, address) + return idx < len(vals.Validators) && bytes.Equal(vals.Validators[idx].Address, address) } // GetByAddress returns an index of the validator with address and validator // itself if found. Otherwise, -1 and nil are returned. -func (valSet *ValidatorSet) GetByAddress(address []byte) (index int, val *Validator) { - idx := sort.Search(len(valSet.Validators), func(i int) bool { - return bytes.Compare(address, valSet.Validators[i].Address) <= 0 +func (vals *ValidatorSet) GetByAddress(address []byte) (index int, val *Validator) { + idx := sort.Search(len(vals.Validators), func(i int) bool { + return bytes.Compare(address, vals.Validators[i].Address) <= 0 }) - if idx < len(valSet.Validators) && bytes.Equal(valSet.Validators[idx].Address, address) { - return idx, valSet.Validators[idx].Copy() + if idx < len(vals.Validators) && bytes.Equal(vals.Validators[idx].Address, address) { + return idx, vals.Validators[idx].Copy() } return -1, nil } @@ -115,45 +118,45 @@ func (valSet *ValidatorSet) GetByAddress(address []byte) (index int, val *Valida // GetByIndex returns the validator's address and validator itself by index. // It returns nil values if index is less than 0 or greater or equal to // len(ValidatorSet.Validators). -func (valSet *ValidatorSet) GetByIndex(index int) (address []byte, val *Validator) { - if index < 0 || index >= len(valSet.Validators) { +func (vals *ValidatorSet) GetByIndex(index int) (address []byte, val *Validator) { + if index < 0 || index >= len(vals.Validators) { return nil, nil } - val = valSet.Validators[index] + val = vals.Validators[index] return val.Address, val.Copy() } // Size returns the length of the validator set. -func (valSet *ValidatorSet) Size() int { - return len(valSet.Validators) +func (vals *ValidatorSet) Size() int { + return len(vals.Validators) } // TotalVotingPower returns the sum of the voting powers of all validators. -func (valSet *ValidatorSet) TotalVotingPower() int64 { - if valSet.totalVotingPower == 0 { - for _, val := range valSet.Validators { +func (vals *ValidatorSet) TotalVotingPower() int64 { + if vals.totalVotingPower == 0 { + for _, val := range vals.Validators { // mind overflow - valSet.totalVotingPower = safeAddClip(valSet.totalVotingPower, val.VotingPower) + vals.totalVotingPower = safeAddClip(vals.totalVotingPower, val.VotingPower) } } - return valSet.totalVotingPower + return vals.totalVotingPower } // GetProposer returns the current proposer. If the validator set is empty, nil // is returned. -func (valSet *ValidatorSet) GetProposer() (proposer *Validator) { - if len(valSet.Validators) == 0 { +func (vals *ValidatorSet) GetProposer() (proposer *Validator) { + if len(vals.Validators) == 0 { return nil } - if valSet.Proposer == nil { - valSet.Proposer = valSet.findProposer() + if vals.Proposer == nil { + vals.Proposer = vals.findProposer() } - return valSet.Proposer.Copy() + return vals.Proposer.Copy() } -func (valSet *ValidatorSet) findProposer() *Validator { +func (vals *ValidatorSet) findProposer() *Validator { var proposer *Validator - for _, val := range valSet.Validators { + for _, val := range vals.Validators { if proposer == nil || !bytes.Equal(val.Address, proposer.Address) { proposer = proposer.CompareAccum(val) } @@ -163,12 +166,12 @@ func (valSet *ValidatorSet) findProposer() *Validator { // Hash returns the Merkle root hash build using validators (as leaves) in the // set. -func (valSet *ValidatorSet) Hash() []byte { - if len(valSet.Validators) == 0 { +func (vals *ValidatorSet) Hash() []byte { + if len(vals.Validators) == 0 { return nil } - hashers := make([]merkle.Hasher, len(valSet.Validators)) - for i, val := range valSet.Validators { + hashers := make([]merkle.Hasher, len(vals.Validators)) + for i, val := range vals.Validators { hashers[i] = val } return merkle.SimpleHashFromHashers(hashers) @@ -176,70 +179,70 @@ func (valSet *ValidatorSet) Hash() []byte { // Add adds val to the validator set and returns true. It returns false if val // is already in the set. -func (valSet *ValidatorSet) Add(val *Validator) (added bool) { +func (vals *ValidatorSet) Add(val *Validator) (added bool) { val = val.Copy() - idx := sort.Search(len(valSet.Validators), func(i int) bool { - return bytes.Compare(val.Address, valSet.Validators[i].Address) <= 0 + idx := sort.Search(len(vals.Validators), func(i int) bool { + return bytes.Compare(val.Address, vals.Validators[i].Address) <= 0 }) - if idx >= len(valSet.Validators) { - valSet.Validators = append(valSet.Validators, val) + if idx >= len(vals.Validators) { + vals.Validators = append(vals.Validators, val) // Invalidate cache - valSet.Proposer = nil - valSet.totalVotingPower = 0 + vals.Proposer = nil + vals.totalVotingPower = 0 return true - } else if bytes.Equal(valSet.Validators[idx].Address, val.Address) { + } else if bytes.Equal(vals.Validators[idx].Address, val.Address) { return false } else { - newValidators := make([]*Validator, len(valSet.Validators)+1) - copy(newValidators[:idx], valSet.Validators[:idx]) + newValidators := make([]*Validator, len(vals.Validators)+1) + copy(newValidators[:idx], vals.Validators[:idx]) newValidators[idx] = val - copy(newValidators[idx+1:], valSet.Validators[idx:]) - valSet.Validators = newValidators + copy(newValidators[idx+1:], vals.Validators[idx:]) + vals.Validators = newValidators // Invalidate cache - valSet.Proposer = nil - valSet.totalVotingPower = 0 + vals.Proposer = nil + vals.totalVotingPower = 0 return true } } // Update updates val and returns true. It returns false if val is not present // in the set. -func (valSet *ValidatorSet) Update(val *Validator) (updated bool) { - index, sameVal := valSet.GetByAddress(val.Address) +func (vals *ValidatorSet) Update(val *Validator) (updated bool) { + index, sameVal := vals.GetByAddress(val.Address) if sameVal == nil { return false } - valSet.Validators[index] = val.Copy() + vals.Validators[index] = val.Copy() // Invalidate cache - valSet.Proposer = nil - valSet.totalVotingPower = 0 + vals.Proposer = nil + vals.totalVotingPower = 0 return true } // Remove deletes the validator with address. It returns the validator removed // and true. If returns nil and false if validator is not present in the set. -func (valSet *ValidatorSet) Remove(address []byte) (val *Validator, removed bool) { - idx := sort.Search(len(valSet.Validators), func(i int) bool { - return bytes.Compare(address, valSet.Validators[i].Address) <= 0 +func (vals *ValidatorSet) Remove(address []byte) (val *Validator, removed bool) { + idx := sort.Search(len(vals.Validators), func(i int) bool { + return bytes.Compare(address, vals.Validators[i].Address) <= 0 }) - if idx >= len(valSet.Validators) || !bytes.Equal(valSet.Validators[idx].Address, address) { + if idx >= len(vals.Validators) || !bytes.Equal(vals.Validators[idx].Address, address) { return nil, false } - removedVal := valSet.Validators[idx] - newValidators := valSet.Validators[:idx] - if idx+1 < len(valSet.Validators) { - newValidators = append(newValidators, valSet.Validators[idx+1:]...) + removedVal := vals.Validators[idx] + newValidators := vals.Validators[:idx] + if idx+1 < len(vals.Validators) { + newValidators = append(newValidators, vals.Validators[idx+1:]...) } - valSet.Validators = newValidators + vals.Validators = newValidators // Invalidate cache - valSet.Proposer = nil - valSet.totalVotingPower = 0 + vals.Proposer = nil + vals.totalVotingPower = 0 return removedVal, true } // Iterate will run the given function over the set. -func (valSet *ValidatorSet) Iterate(fn func(index int, val *Validator) bool) { - for i, val := range valSet.Validators { +func (vals *ValidatorSet) Iterate(fn func(index int, val *Validator) bool) { + for i, val := range vals.Validators { stop := fn(i, val.Copy()) if stop { break @@ -247,87 +250,106 @@ func (valSet *ValidatorSet) Iterate(fn func(index int, val *Validator) bool) { } } -// Verify that +2/3 of the set had signed the given signBytes -func (valSet *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height int64, commit *Commit) error { - if valSet.Size() != len(commit.Precommits) { - return fmt.Errorf("Invalid commit -- wrong set size: %v vs %v", valSet.Size(), len(commit.Precommits)) +// Verify that +2/3 of the set had signed the given signBytes. +func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height int64, commit *Commit) error { + if vals.Size() != len(commit.Precommits) { + return fmt.Errorf("Invalid commit -- wrong set size: %v vs %v", vals.Size(), len(commit.Precommits)) } if height != commit.Height() { return fmt.Errorf("Invalid commit -- wrong height: %v vs %v", height, commit.Height()) } + if !blockID.Equals(commit.BlockID) { + return fmt.Errorf("Invalid commit -- wrong block id: want %v got %v", + blockID, commit.BlockID) + } talliedVotingPower := int64(0) round := commit.Round() for idx, precommit := range commit.Precommits { - // may be nil if validator skipped. if precommit == nil { - continue + continue // OK, some precommits can be missing. } if precommit.Height != height { - return fmt.Errorf("Invalid commit -- wrong height: %v vs %v", height, precommit.Height) + return fmt.Errorf("Invalid commit -- wrong height: want %v got %v", height, precommit.Height) } if precommit.Round != round { - return fmt.Errorf("Invalid commit -- wrong round: %v vs %v", round, precommit.Round) + return fmt.Errorf("Invalid commit -- wrong round: want %v got %v", round, precommit.Round) } if precommit.Type != VoteTypePrecommit { return fmt.Errorf("Invalid commit -- not precommit @ index %v", idx) } - _, val := valSet.GetByIndex(idx) - // Validate signature + // NOTE: This will go away when we refactor Commit. + if !blockID.Equals(precommit.BlockID) { + return fmt.Errorf("Invalid commit -- wrong block id @ index %v: want %v got %v", + idx, blockID, precommit.BlockID) + } + _, val := vals.GetByIndex(idx) + // Validate signature. precommitSignBytes := precommit.SignBytes(chainID) if !val.PubKey.VerifyBytes(precommitSignBytes, precommit.Signature) { return fmt.Errorf("Invalid commit -- invalid signature: %v", precommit) } - if !blockID.Equals(precommit.BlockID) { - continue // Not an error, but doesn't count - } // Good precommit! talliedVotingPower += val.VotingPower } - if talliedVotingPower > valSet.TotalVotingPower()*2/3 { + if talliedVotingPower > vals.TotalVotingPower()*2/3 { return nil } return fmt.Errorf("Invalid commit -- insufficient voting power: got %v, needed %v", - talliedVotingPower, (valSet.TotalVotingPower()*2/3 + 1)) + talliedVotingPower, (vals.TotalVotingPower()*2/3 + 1)) } -// VerifyCommitAny will check to see if the set would -// be valid with a different validator set. +// VerifyFutureCommit will check to see if the set would be valid with a different +// validator set. // -// valSet is the validator set that we know -// * over 2/3 of the power in old signed this block +// vals is the old validator set that we know. Over 2/3 of the power in old +// signed this block. // -// newSet is the validator set that signed this block -// * only votes from old are sufficient for 2/3 majority -// in the new set as well +// In Tendermint, 1/3 of the voting power can halt or fork the chain, but 1/3 +// can't make arbitrary state transitions. You still need > 2/3 Byzantine to +// make arbitrary state transitions. // -// That means that: -// * 10% of the valset can't just declare themselves kings -// * If the validator set is 3x old size, we need more proof to trust -func (valSet *ValidatorSet) VerifyCommitAny(newSet *ValidatorSet, chainID string, +// To preserve this property in the light client, we also require > 2/3 of the +// old vals to sign the future commit at H, that way we preserve the property +// that if they weren't being truthful about the validator set at H (block hash +// -> vals hash) or about the app state (block hash -> app hash) we can slash +// > 2/3. Otherwise, the lite client isn't providing the same security +// guarantees. +// +// Even if we added a slashing condition that if you sign a block header with +// the wrong validator set, then we would only need > 1/3 of signatures from +// the old vals on the new commit, it wouldn't be sufficient because the new +// vals can be arbitrary and commit some arbitrary app hash. +// +// newSet is the validator set that signed this block. Only votes from new are +// sufficient for 2/3 majority in the new set as well, for it to be a valid +// commit. +// +// NOTE: This doesn't check whether the commit is a future commit, because the +// current height isn't part of the ValidatorSet. Caller must check that the +// commit height is greater than the height for this validator set. +func (vals *ValidatorSet) VerifyFutureCommit(newSet *ValidatorSet, chainID string, blockID BlockID, height int64, commit *Commit) error { + oldVals := vals - if newSet.Size() != len(commit.Precommits) { - return cmn.NewError("Invalid commit -- wrong set size: %v vs %v", newSet.Size(), len(commit.Precommits)) - } - if height != commit.Height() { - return cmn.NewError("Invalid commit -- wrong height: %v vs %v", height, commit.Height()) + // Commit must be a valid commit for newSet. + err := newSet.VerifyCommit(chainID, blockID, height, commit) + if err != nil { + return err } + // Check old voting power. oldVotingPower := int64(0) - newVotingPower := int64(0) seen := map[int]bool{} round := commit.Round() for idx, precommit := range commit.Precommits { - // first check as in VerifyCommit if precommit == nil { continue } if precommit.Height != height { - // return certerr.ErrHeightMismatch(height, precommit.Height) return cmn.NewError("Blocks don't match - %d vs %d", round, precommit.Round) } if precommit.Round != round { @@ -336,54 +358,45 @@ func (valSet *ValidatorSet) VerifyCommitAny(newSet *ValidatorSet, chainID string if precommit.Type != VoteTypePrecommit { return cmn.NewError("Invalid commit -- not precommit @ index %v", idx) } + // NOTE: This will go away when we refactor Commit. if !blockID.Equals(precommit.BlockID) { - continue // Not an error, but doesn't count + return fmt.Errorf("Invalid commit -- wrong block id @ index %v: want %v got %v", + idx, blockID, precommit.BlockID) } - - // we only grab by address, ignoring unknown validators - vi, ov := valSet.GetByAddress(precommit.ValidatorAddress) - if ov == nil || seen[vi] { + // See if this validator is in oldVals. + idx, val := oldVals.GetByAddress(precommit.ValidatorAddress) + if val == nil || seen[idx] { continue // missing or double vote... } - seen[vi] = true + seen[idx] = true - // Validate signature old school + // Validate signature. precommitSignBytes := precommit.SignBytes(chainID) - if !ov.PubKey.VerifyBytes(precommitSignBytes, precommit.Signature) { + if !val.PubKey.VerifyBytes(precommitSignBytes, precommit.Signature) { return cmn.NewError("Invalid commit -- invalid signature: %v", precommit) } // Good precommit! - oldVotingPower += ov.VotingPower - - // check new school - _, cv := newSet.GetByIndex(idx) - if cv.PubKey.Equals(ov.PubKey) { - // make sure this is properly set in the current block as well - newVotingPower += cv.VotingPower - } + oldVotingPower += val.VotingPower } - if oldVotingPower <= valSet.TotalVotingPower()*2/3 { + if oldVotingPower <= oldVals.TotalVotingPower()*2/3 { return cmn.NewError("Invalid commit -- insufficient old voting power: got %v, needed %v", - oldVotingPower, (valSet.TotalVotingPower()*2/3 + 1)) - } else if newVotingPower <= newSet.TotalVotingPower()*2/3 { - return cmn.NewError("Invalid commit -- insufficient cur voting power: got %v, needed %v", - newVotingPower, (newSet.TotalVotingPower()*2/3 + 1)) + oldVotingPower, (oldVals.TotalVotingPower()*2/3 + 1)) } return nil } -func (valSet *ValidatorSet) String() string { - return valSet.StringIndented("") +func (vals *ValidatorSet) String() string { + return vals.StringIndented("") } // String -func (valSet *ValidatorSet) StringIndented(indent string) string { - if valSet == nil { +func (vals *ValidatorSet) StringIndented(indent string) string { + if vals == nil { return "nil-ValidatorSet" } valStrings := []string{} - valSet.Iterate(func(index int, val *Validator) bool { + vals.Iterate(func(index int, val *Validator) bool { valStrings = append(valStrings, val.String()) return false }) @@ -392,7 +405,7 @@ func (valSet *ValidatorSet) StringIndented(indent string) string { %s Validators: %s %v %s}`, - indent, valSet.GetProposer().String(), + indent, vals.GetProposer().String(), indent, indent, strings.Join(valStrings, "\n"+indent+" "), indent) @@ -405,18 +418,18 @@ func (valSet *ValidatorSet) StringIndented(indent string) string { // Sort validators by address type ValidatorsByAddress []*Validator -func (vs ValidatorsByAddress) Len() int { - return len(vs) +func (valz ValidatorsByAddress) Len() int { + return len(valz) } -func (vs ValidatorsByAddress) Less(i, j int) bool { - return bytes.Compare(vs[i].Address, vs[j].Address) == -1 +func (valz ValidatorsByAddress) Less(i, j int) bool { + return bytes.Compare(valz[i].Address, valz[j].Address) == -1 } -func (vs ValidatorsByAddress) Swap(i, j int) { - it := vs[i] - vs[i] = vs[j] - vs[j] = it +func (valz ValidatorsByAddress) Swap(i, j int) { + it := valz[i] + valz[i] = valz[j] + valz[j] = it } //------------------------------------- @@ -440,16 +453,16 @@ func (ac accumComparable) Less(o interface{}) bool { // NOTE: PrivValidator are in order. // UNSTABLE func RandValidatorSet(numValidators int, votingPower int64) (*ValidatorSet, []PrivValidator) { - vals := make([]*Validator, numValidators) + valz := make([]*Validator, numValidators) privValidators := make([]PrivValidator, numValidators) for i := 0; i < numValidators; i++ { val, privValidator := RandValidator(false, votingPower) - vals[i] = val + valz[i] = val privValidators[i] = privValidator } - valSet := NewValidatorSet(vals) + vals := NewValidatorSet(valz) sort.Sort(PrivValidatorsByAddress(privValidators)) - return valSet, privValidators + return vals, privValidators } /////////////////////////////////////////////////////////////////////////////// diff --git a/types/vote_set.go b/types/vote_set.go index a60d95da..1c7fac19 100644 --- a/types/vote_set.go +++ b/types/vote_set.go @@ -170,7 +170,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) { "Cannot find validator %d in valSet of size %d", valIndex, voteSet.valSet.Size()) } - // Ensure that the signer has the right address + // Ensure that the signer has the right address. if !bytes.Equal(valAddr, lookupAddr) { return false, errors.Wrapf(ErrVoteInvalidValidatorAddress, "vote.ValidatorAddress (%X) does not match address (%X) for vote.ValidatorIndex (%d)\nEnsure the genesis file is correct across all validators.", @@ -190,7 +190,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) { return false, errors.Wrapf(err, "Failed to verify vote with ChainID %s and PubKey %s", voteSet.chainID, val.PubKey) } - // Add vote and get conflicting vote if any + // Add vote and get conflicting vote if any. added, conflicting := voteSet.addVerifiedVote(vote, blockKey, val.VotingPower) if conflicting != nil { return added, NewConflictingVoteError(val, conflicting, vote) @@ -201,7 +201,7 @@ func (voteSet *VoteSet) addVote(vote *Vote) (added bool, err error) { return added, nil } -// Returns (vote, true) if vote exists for valIndex and blockKey +// Returns (vote, true) if vote exists for valIndex and blockKey. func (voteSet *VoteSet) getVote(valIndex int, blockKey string) (vote *Vote, ok bool) { if existing := voteSet.votes[valIndex]; existing != nil && existing.BlockID.Key() == blockKey { return existing, true From 242a6037e88475eb5270382358060f13e2d24469 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 19 Jun 2018 23:55:15 -0700 Subject: [PATCH 003/149] Fixes from review --- consensus/reactor_test.go | 2 +- consensus/replay.go | 4 ++-- lite/client/provider.go | 8 ++++---- lite/commit.go | 4 ++-- lite/dbprovider.go | 6 +++--- lite/helpers.go | 14 +++++++------- lite/inquiring_certifier.go | 4 ++-- lite/inquiring_certifier_test.go | 8 ++++---- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 70af588a..6faea3f0 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -419,7 +419,7 @@ func waitForAndValidateBlock(t *testing.T, n int, activeVals map[string]struct{} err := validateBlock(newBlock, activeVals) assert.Nil(t, err) for _, tx := range txs { - css[j].mempool.CheckTx(tx, nil) + err := css[j].mempool.CheckTx(tx, nil) assert.Nil(t, err) } }, css) diff --git a/consensus/replay.go b/consensus/replay.go index 75173061..8ecf88b8 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -266,13 +266,13 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - nvals := types.TM2PB.Validators(state.Validators) // state.Validators would work too. + nextVals := types.TM2PB.Validators(state.Validators) // state.Validators would work too. csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime.Unix(), // TODO ChainId: h.genDoc.ChainID, ConsensusParams: csParams, - Validators: nvals, + Validators: nextVals, AppStateBytes: h.genDoc.AppStateJSON, } res, err := proxyApp.Consensus().InitChainSync(req) diff --git a/lite/client/provider.go b/lite/client/provider.go index 188ce7d0..1612ddd7 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -53,7 +53,7 @@ func (p *provider) LatestFullCommit(chainID string, minHeight, maxHeight int64) return } if maxHeight != 0 && maxHeight < minHeight { - err = fmt.Errorf("need maxHeight == 0 or minHeight <= maxHeight, got %v and %v", + err = fmt.Errorf("need maxHeight == 0 or minHeight <= maxHeight, got min %v and max %v", minHeight, maxHeight) return } @@ -95,7 +95,7 @@ func (p *provider) getValidatorSet(chainID string, height int64) (valset *types. return } if height < 1 { - err = fmt.Errorf("expected height >= 1, got %v", height) + err = fmt.Errorf("expected height >= 1, got height %v", height) return } heightPtr := new(int64) @@ -122,11 +122,11 @@ func (p *provider) fillFullCommit(signedHeader types.SignedHeader) (fc lite.Full fc.Validators = valset // Get the next validators. - nvalset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height+1) + nextValset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height+1) if err != nil { return lite.FullCommit{}, err } else { - fc.NextValidators = nvalset + fc.NextValidators = nextValset } return fc, nil diff --git a/lite/commit.go b/lite/commit.go index 8449bf69..e62bd166 100644 --- a/lite/commit.go +++ b/lite/commit.go @@ -20,11 +20,11 @@ type FullCommit struct { } // NewFullCommit returns a new FullCommit. -func NewFullCommit(signedHeader types.SignedHeader, valset, nvalset *types.ValidatorSet) FullCommit { +func NewFullCommit(signedHeader types.SignedHeader, valset, nextValset *types.ValidatorSet) FullCommit { return FullCommit{ SignedHeader: signedHeader, Validators: valset, - NextValidators: nvalset, + NextValidators: nextValset, } } diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 834bab66..149a0ed3 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -148,14 +148,14 @@ func (dbp *DBProvider) getValidatorSet(chainID string, height int64) (valset *ty func (dbp *DBProvider) fillFullCommit(sh types.SignedHeader) (FullCommit, error) { var chainID = sh.ChainID var height = sh.Height - var valset, nvalset *types.ValidatorSet + var valset, nextValset *types.ValidatorSet // Load the validator set. valset, err := dbp.getValidatorSet(chainID, height) if err != nil { return FullCommit{}, err } // Load the next validator set. - nvalset, err = dbp.getValidatorSet(chainID, height+1) + nextValset, err = dbp.getValidatorSet(chainID, height+1) if err != nil { return FullCommit{}, err } @@ -163,6 +163,6 @@ func (dbp *DBProvider) fillFullCommit(sh types.SignedHeader) (FullCommit, error) return FullCommit{ SignedHeader: sh, Validators: valset, - NextValidators: nvalset, + NextValidators: nextValset, }, nil } diff --git a/lite/helpers.go b/lite/helpers.go index 764df507..de02b739 100644 --- a/lite/helpers.go +++ b/lite/helpers.go @@ -96,7 +96,7 @@ func makeVote(header *types.Header, valset *types.ValidatorSet, key crypto.PrivK } func genHeader(chainID string, height int64, txs types.Txs, - valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte) *types.Header { + valset, nextValset *types.ValidatorSet, appHash, consHash, resHash []byte) *types.Header { return &types.Header{ ChainID: chainID, @@ -107,7 +107,7 @@ func genHeader(chainID string, height int64, txs types.Txs, // LastBlockID // LastCommitHash ValidatorsHash: valset.Hash(), - NextValidatorsHash: nvalset.Hash(), + NextValidatorsHash: nextValset.Hash(), DataHash: txs.Hash(), AppHash: appHash, ConsensusHash: consHash, @@ -117,9 +117,9 @@ func genHeader(chainID string, height int64, txs types.Txs, // GenSignedHeader calls genHeader and signHeader and combines them into a SignedHeader. func (pkz privKeys) GenSignedHeader(chainID string, height int64, txs types.Txs, - valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) types.SignedHeader { + valset, nextValset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) types.SignedHeader { - header := genHeader(chainID, height, txs, valset, nvalset, appHash, consHash, resHash) + header := genHeader(chainID, height, txs, valset, nextValset, appHash, consHash, resHash) check := types.SignedHeader{ Header: header, Commit: pkz.signHeader(header, first, last), @@ -129,12 +129,12 @@ func (pkz privKeys) GenSignedHeader(chainID string, height int64, txs types.Txs, // GenFullCommit calls genHeader and signHeader and combines them into a FullCommit. func (pkz privKeys) GenFullCommit(chainID string, height int64, txs types.Txs, - valset, nvalset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) FullCommit { + valset, nextValset *types.ValidatorSet, appHash, consHash, resHash []byte, first, last int) FullCommit { - header := genHeader(chainID, height, txs, valset, nvalset, appHash, consHash, resHash) + header := genHeader(chainID, height, txs, valset, nextValset, appHash, consHash, resHash) commit := types.SignedHeader{ Header: header, Commit: pkz.signHeader(header, first, last), } - return NewFullCommit(commit, valset, nvalset) + return NewFullCommit(commit, valset, nextValset) } diff --git a/lite/inquiring_certifier.go b/lite/inquiring_certifier.go index 049cd728..3e61b958 100644 --- a/lite/inquiring_certifier.go +++ b/lite/inquiring_certifier.go @@ -95,7 +95,7 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { } // Get the next validator set. - nvalset, err := ic.source.ValidatorSet(ic.chainID, shdr.Height+1) + nextValset, err := ic.source.ValidatorSet(ic.chainID, shdr.Height+1) if lerr.IsErrMissingValidators(err) { // Ignore this error. return nil @@ -106,7 +106,7 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { nfc := FullCommit{ SignedHeader: shdr, Validators: tfc.NextValidators, - NextValidators: nvalset, + NextValidators: nextValset, } // Validate the full commit. This checks the cryptographic // signatures of Commit against Validators. diff --git a/lite/inquiring_certifier_test.go b/lite/inquiring_certifier_test.go index b3d8edea..8da5a7c1 100644 --- a/lite/inquiring_certifier_test.go +++ b/lite/inquiring_certifier_test.go @@ -28,12 +28,12 @@ func TestInquirerValidPath(t *testing.T) { fcz := make([]FullCommit, count) for i := 0; i < count; i++ { vals := keys.ToValidators(vote, 0) - nvals := nkeys.ToValidators(vote, 0) + nextVals := nkeys.ToValidators(vote, 0) h := int64(1 + i) appHash := []byte(fmt.Sprintf("h=%d", h)) fcz[i] = keys.GenFullCommit( chainID, h, nil, - vals, nvals, + vals, nextVals, appHash, consHash, resHash, 0, len(keys)) // Extend the keys by 1 each time. keys = nkeys @@ -85,13 +85,13 @@ func TestInquirerVerifyHistorical(t *testing.T) { fcz := make([]FullCommit, count) for i := 0; i < count; i++ { vals := keys.ToValidators(vote, 0) - nvals := nkeys.ToValidators(vote, 0) + nextVals := nkeys.ToValidators(vote, 0) h := int64(1 + i) appHash := []byte(fmt.Sprintf("h=%d", h)) resHash := []byte(fmt.Sprintf("res=%d", h)) fcz[i] = keys.GenFullCommit( chainID, h, nil, - vals, nvals, + vals, nextVals, appHash, consHash, resHash, 0, len(keys)) // Extend the keys by 1 each time. keys = nkeys From c3296f2e01000b45f033fa355d5e477bece4b599 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 20 Jun 2018 01:42:37 -0700 Subject: [PATCH 004/149] Garbage collect DBProvider (unoptimized); Certifier creation takes a client --- cmd/tendermint/commands/lite.go | 2 +- lite/dbprovider.go | 117 +++++++++++++++++++++++++------- lite/proxy/certifier.go | 24 ++++--- 3 files changed, 105 insertions(+), 38 deletions(-) diff --git a/cmd/tendermint/commands/lite.go b/cmd/tendermint/commands/lite.go index 6987b7f1..53b3ec18 100644 --- a/cmd/tendermint/commands/lite.go +++ b/cmd/tendermint/commands/lite.go @@ -68,7 +68,7 @@ func runProxy(cmd *cobra.Command, args []string) error { // First, connect a client node := rpcclient.NewHTTP(nodeAddr, "/websocket") - cert, err := proxy.GetCertifier(chainID, home, nodeAddr) + cert, err := proxy.GetCertifier(chainID, home, node) if err != nil { return err } diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 149a0ed3..81710c9e 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -12,36 +12,11 @@ import ( dbm "github.com/tendermint/tmlibs/db" ) -func signedHeaderKey(chainID string, height int64) []byte { - return []byte(fmt.Sprintf("%s/%010d/sh", chainID, height)) -} - -var signedHeaderKeyPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/sh`) - -func parseSignedHeaderKey(key []byte) (chainID string, height int64, ok bool) { - submatch := signedHeaderKeyPattern.FindSubmatch(key) - if submatch == nil { - return "", 0, false - } - chainID = string(submatch[1]) - heightStr := string(submatch[2]) - heightInt, err := strconv.Atoi(heightStr) - if err != nil { - return "", 0, false - } - height = int64(heightInt) - ok = true // good! - return -} - -func validatorSetKey(chainID string, height int64) []byte { - return []byte(fmt.Sprintf("%s/%010d/vs", chainID, height)) -} - type DBProvider struct { chainID string db dbm.DB cdc *amino.Codec + limit int } func NewDBProvider(db dbm.DB) *DBProvider { @@ -52,6 +27,11 @@ func NewDBProvider(db dbm.DB) *DBProvider { return dbp } +func (dbp *DBProvider) SetLimit(limit int) *DBProvider { + dbp.limit = limit + return dbp +} + // Implements PersistentProvider. func (dbp *DBProvider) SaveFullCommit(fc FullCommit) error { @@ -85,6 +65,13 @@ func (dbp *DBProvider) SaveFullCommit(fc FullCommit) error { // And write sync. batch.WriteSync() + + // Garbage collect. + // TODO: optimize later. + if dbp.limit > 0 { + dbp.deleteAfterN(fc.ChainID(), dbp.limit) + } + return nil } @@ -166,3 +153,81 @@ func (dbp *DBProvider) fillFullCommit(sh types.SignedHeader) (FullCommit, error) NextValidators: nextValset, }, nil } + +func (dbp *DBProvider) deleteAfterN(chainID string, after int) error { + itr := dbp.db.ReverseIterator( + signedHeaderKey(chainID, 1<<63-1), + signedHeaderKey(chainID, 0), + ) + defer itr.Close() + + var lastHeight int64 = 1<<63 - 1 + var numSeen = 0 + + for itr.Valid() { + key := itr.Key() + _, height, ok := parseChainKeyPrefix(key) + if !ok { + return fmt.Errorf("unexpected key %v", key) + } else { + if height < lastHeight { + lastHeight = height + numSeen += 1 + } + if numSeen > after { + dbp.db.Delete(key) + } + } + } + return nil +} + +//---------------------------------------- + +func signedHeaderKey(chainID string, height int64) []byte { + return []byte(fmt.Sprintf("%s/%010d/sh", chainID, height)) +} + +var signedHeaderKeyPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/sh`) + +func parseSignedHeaderKey(key []byte) (chainID string, height int64, ok bool) { + submatch := signedHeaderKeyPattern.FindSubmatch(key) + if submatch == nil { + return "", 0, false + } + chainID = string(submatch[1]) + heightStr := string(submatch[2]) + heightInt, err := strconv.Atoi(heightStr) + if err != nil { + return "", 0, false + } + height = int64(heightInt) + ok = true // good! + return +} + +func validatorSetKey(chainID string, height int64) []byte { + return []byte(fmt.Sprintf("%s/%010d/vs", chainID, height)) +} + +func chainKeyPrefix(chainID string, height int64) []byte { + return []byte(fmt.Sprintf("%s/%010d/", chainID, height)) +} + +var chainKeyPrefixPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/`) + +func parseChainKeyPrefix(key []byte) (chainID string, height int64, ok bool) { + submatch := chainKeyPrefixPattern.FindSubmatch(key) + if submatch == nil { + return "", 0, false + } + chainID = string(submatch[1]) + heightStr := string(submatch[2]) + heightInt, err := strconv.Atoi(heightStr) + if err != nil { + return "", 0, false + } + height = int64(heightInt) + ok = true // good! + return +} diff --git a/lite/proxy/certifier.go b/lite/proxy/certifier.go index a6765402..772af58f 100644 --- a/lite/proxy/certifier.go +++ b/lite/proxy/certifier.go @@ -6,22 +6,24 @@ import ( dbm "github.com/tendermint/tmlibs/db" ) -func GetCertifier(chainID, rootDir, nodeAddr string) (*lite.InquiringCertifier, error) { +func GetCertifier(chainID, rootDir string, client lclient.SignStatusClient) (*lite.InquiringCertifier, error) { trust := lite.NewMultiProvider( - lite.NewDBProvider(dbm.NewMemDB()), + lite.NewDBProvider(dbm.NewMemDB()).SetLimit(10), lite.NewDBProvider(dbm.NewDB("trust-base", dbm.LevelDBBackend, rootDir)), ) + source := lclient.NewProvider(chainID, client) - source := lclient.NewHTTPProvider(chainID, nodeAddr) - - // XXX: total insecure hack to avoid `init` - fc, err := source.LatestFullCommit(chainID, 1, 1) + // TODO: Make this more secure, e.g. make it interactive in the console? + _, err := trust.LatestFullCommit(chainID, 1, 1<<63-1) if err != nil { - return nil, err - } - err = trust.SaveFullCommit(fc) - if err != nil { - return nil, err + fc, err := source.LatestFullCommit(chainID, 1, 1) + if err != nil { + return nil, err + } + err = trust.SaveFullCommit(fc) + if err != nil { + return nil, err + } } cert, err := lite.NewInquiringCertifier(chainID, trust, source) From 538c410bcdd9fbd8792c070554bd211e642e2f45 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 25 Jun 2018 16:31:59 -0700 Subject: [PATCH 005/149] Fixes from review --- Gopkg.lock | 31 +++------------- Gopkg.toml | 2 +- consensus/replay.go | 2 +- lite/client/provider.go | 7 +--- lite/client/provider_test.go | 2 +- lite/commit.go | 4 +-- lite/inquiring_certifier.go | 70 ++++++++++++++++++------------------ 7 files changed, 46 insertions(+), 72 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 9dfc2a5f..496e8967 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -7,12 +7,6 @@ packages = ["quantile"] revision = "3a771d992973f24aa725d07868b467d1ddfceafb" -[[projects]] - branch = "master" - name = "github.com/brejski/hid" - packages = ["."] - revision = "06112dcfcc50a7e0e4fd06e17f9791e788fdaafc" - [[projects]] branch = "master" name = "github.com/btcsuite/btcd" @@ -290,17 +284,7 @@ "leveldb/table", "leveldb/util" ] - revision = "e2150783cd35f5b607daca48afd8c57ec54cc995" - -[[projects]] - name = "github.com/tendermint/abci" - packages = [ - "example/code", - "example/kvstore", - "types" - ] - revision = "198dccf0ddfd1bb176f87657e3286a05a6ed9540" - version = "v0.12.0" + revision = "0d5a0ceb10cf9ab89fdd744cc8c50a83134f6697" [[projects]] branch = "master" @@ -333,13 +317,8 @@ "merkle/tmhash", "test" ] - revision = "fb7ec62b2925f48de159aeea73b254ae8c58a738" - version = "v0.9.0-rc1" - -[[projects]] - name = "github.com/zondax/ledger-goclient" - packages = ["."] - revision = "3e2146609cdb97894c064d59e9d00accd8c2b1dd" + revision = "49596e0a1f48866603813df843c9409fc19805c6" + version = "v0.9.0" [[projects]] branch = "master" @@ -374,7 +353,7 @@ "netutil", "trace" ] - revision = "db08ff08e8622530d9ed3a0e8ac279f6d4c02196" + revision = "afe8f62b1d6bbd81f31868121a50b06d8188e1f9" [[projects]] branch = "master" @@ -444,6 +423,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "fcc5b0344f1e328b6abefa1a937d1161e14bbaef603e6f2065e6690531bc5de1" + inputs-digest = "c25289282b94abc7f0c390e592e5e1636b7f26cb4773863ac39cde7fdc7b5bdf" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index d892405b..dc56ae29 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -79,7 +79,7 @@ [[override]] name = "github.com/tendermint/tmlibs" - version = "0.9.0-rc1" + version = "~0.9.0" [[constraint]] name = "google.golang.org/grpc" diff --git a/consensus/replay.go b/consensus/replay.go index 8ecf88b8..6fdd9c0b 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -266,7 +266,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - nextVals := types.TM2PB.Validators(state.Validators) // state.Validators would work too. + nextVals := types.TM2PB.Validators(state.NextValidators) // state.Validators would work too. csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime.Unix(), // TODO diff --git a/lite/client/provider.go b/lite/client/provider.go index 1612ddd7..8175c5b5 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -106,28 +106,23 @@ func (p *provider) getValidatorSet(chainID string, height int64) (valset *types. return nil, lerr.ErrMissingValidators(chainID, height) } valset = types.NewValidatorSet(res.Validators) - valset.TotalVotingPower() // to test deep equality. return } // This does no validation. func (p *provider) fillFullCommit(signedHeader types.SignedHeader) (fc lite.FullCommit, err error) { - fc.SignedHeader = signedHeader // Get the validators. valset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height) if err != nil { return lite.FullCommit{}, err } - fc.Validators = valset // Get the next validators. nextValset, err := p.getValidatorSet(signedHeader.ChainID, signedHeader.Height+1) if err != nil { return lite.FullCommit{}, err - } else { - fc.NextValidators = nextValset } - return fc, nil + return lite.NewFullCommit(signedHeader, valset, nextValset), nil } diff --git a/lite/client/provider_test.go b/lite/client/provider_test.go index 2385bbbe..f4da423f 100644 --- a/lite/client/provider_test.go +++ b/lite/client/provider_test.go @@ -51,7 +51,7 @@ func TestProvider(t *testing.T) { assert.True(sh < 5000) // let's check this is valid somehow - assert.Nil(fc.ValidateBasic(chainID)) + assert.Nil(fc.ValidateFull(chainID)) // historical queries now work :) lower := sh - 5 diff --git a/lite/commit.go b/lite/commit.go index e62bd166..40c3534c 100644 --- a/lite/commit.go +++ b/lite/commit.go @@ -12,7 +12,7 @@ import ( // the validator set which signed the commit, and the next validator set. The // next validator set (which is proven from the block header) allows us to // revert to block-by-block updating of lite certifier's latest validator set, -// even in the face of arbitrarily power changes. +// even in the face of arbitrarily large power changes. type FullCommit struct { SignedHeader types.SignedHeader `json:"signed_header"` Validators *types.ValidatorSet `json:"validator_set"` @@ -33,7 +33,7 @@ func NewFullCommit(signedHeader types.SignedHeader, valset, nextValset *types.Va // signed the SignedHeader.Commit. // If > 2/3 did not sign the Commit from fc.Validators, it // is not a valid commit! -func (fc FullCommit) ValidateBasic(chainID string) error { +func (fc FullCommit) ValidateFull(chainID string) error { // Ensure that Validators exists and matches the header. if fc.Validators.Size() == 0 { return errors.New("need FullCommit.Validators") diff --git a/lite/inquiring_certifier.go b/lite/inquiring_certifier.go index 3e61b958..c4c6173b 100644 --- a/lite/inquiring_certifier.go +++ b/lite/inquiring_certifier.go @@ -101,21 +101,21 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { return nil } else if err != nil { return err - } else { - // Create filled FullCommit. - nfc := FullCommit{ - SignedHeader: shdr, - Validators: tfc.NextValidators, - NextValidators: nextValset, - } - // Validate the full commit. This checks the cryptographic - // signatures of Commit against Validators. - if err := nfc.ValidateBasic(ic.chainID); err != nil { - return err - } - // Trust it. - return ic.trusted.SaveFullCommit(nfc) } + + // Create filled FullCommit. + nfc := FullCommit{ + SignedHeader: shdr, + Validators: tfc.NextValidators, + NextValidators: nextValset, + } + // Validate the full commit. This checks the cryptographic + // signatures of Commit against Validators. + if err := nfc.ValidateFull(ic.chainID); err != nil { + return err + } + // Trust it. + return ic.trusted.SaveFullCommit(nfc) } // verifyAndSave will verify if this is a valid source full commit given the @@ -139,7 +139,7 @@ func (ic *InquiringCertifier) verifyAndSave(tfc, sfc FullCommit) error { } // updateToHeight will use divide-and-conquer to find a path to h. -// Returns nil iff we successfully verify and persist a full commit +// Returns nil error iff we successfully verify and persist a full commit // for height h, using repeated applications of bisection if necessary. // // Returns ErrCommitNotFound if source provider doesn't have the commit for h. @@ -153,7 +153,7 @@ func (ic *InquiringCertifier) updateToHeight(h int64) (FullCommit, error) { // Validate the full commit. This checks the cryptographic // signatures of Commit against Validators. - if err := sfc.ValidateBasic(ic.chainID); err != nil { + if err := sfc.ValidateFull(ic.chainID); err != nil { return FullCommit{}, err } @@ -169,9 +169,9 @@ FOR_LOOP: if err != nil { return FullCommit{}, err } - // Maybe we have nothing to do. + // We have nothing to do. if tfc.Height() == h { - return FullCommit{}, nil + return tfc, nil } // Try to update to full commit with checks. @@ -179,24 +179,24 @@ FOR_LOOP: if err == nil { // All good! return sfc, nil - } else { - // Handle special case when err is ErrTooMuchChange. - if lerr.IsErrTooMuchChange(err) { - // Divide and conquer. - start, end := tfc.Height(), sfc.Height() - if !(start < end) { - panic("should not happen") - } - mid := (start + end) / 2 - _, err = ic.updateToHeight(mid) - if err != nil { - return FullCommit{}, err - } - // If we made it to mid, we retry. - continue FOR_LOOP - } - return FullCommit{}, err } + + // Handle special case when err is ErrTooMuchChange. + if lerr.IsErrTooMuchChange(err) { + // Divide and conquer. + start, end := tfc.Height(), sfc.Height() + if !(start < end) { + panic("should not happen") + } + mid := (start + end) / 2 + _, err = ic.updateToHeight(mid) + if err != nil { + return FullCommit{}, err + } + // If we made it to mid, we retry. + continue FOR_LOOP + } + return FullCommit{}, err } } From 7f4498f8b1b2eee693a4d378fa8ef03a5e580b7e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 26 Jun 2018 11:10:54 +0400 Subject: [PATCH 006/149] remove no longer needed install_abci_apps script Fixes https://circleci.com/gh/tendermint/tendermint/12923?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link --- scripts/dep_utils/parse.sh | 14 -------------- scripts/install_abci_apps.sh | 12 ------------ test/docker/Dockerfile | 7 +++---- 3 files changed, 3 insertions(+), 30 deletions(-) delete mode 100644 scripts/dep_utils/parse.sh delete mode 100644 scripts/install_abci_apps.sh diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh deleted file mode 100644 index e6519efa..00000000 --- a/scripts/dep_utils/parse.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash - -set +u -if [[ "$DEP" == "" ]]; then - DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock -fi -set -u - - -set -euo pipefail - -LIB=$1 - -grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2 diff --git a/scripts/install_abci_apps.sh b/scripts/install_abci_apps.sh deleted file mode 100644 index ee4b9dde..00000000 --- a/scripts/install_abci_apps.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash - -# get the abci commit used by tendermint -COMMIT=$(bash scripts/dep_utils/parse.sh abci) -echo "Checking out vendored commit for abci: $COMMIT" - -go get -d github.com/tendermint/tendermint/abci -cd "$GOPATH/src/github.com/tendermint/tendermint/abci" || exit -git checkout "$COMMIT" -make get_tools -make get_vendor_deps -make install diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index bc211ea4..70570e75 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -21,14 +21,13 @@ ADD Makefile Makefile RUN make get_tools RUN make get_vendor_deps -# Install the apps -ADD scripts scripts -RUN bash scripts/install_abci_apps.sh - # Now copy in the code # NOTE: this will overwrite whatever is in vendor/ COPY . $REPO +# install ABCI CLI +RUN cd abci && make install && cd - + RUN go install ./cmd/tendermint # expose the volume for debugging From 37ef5485b43e22eb2fdfa4b935308ca718affdfc Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 16:52:38 -0700 Subject: [PATCH 007/149] Add logs to lite/*; Fix rpc status to return consensus height, not blockstore height --- .gitignore | 1 + cmd/tendermint/commands/lite.go | 13 +++++---- consensus/state.go | 9 +++++++ lite/client/provider.go | 24 +++++++++++------ lite/dbprovider.go | 45 +++++++++++++++++++++++++++----- lite/doc.go | 5 ++-- lite/inquiring_certifier.go | 19 +++++++++----- lite/inquiring_certifier_test.go | 17 ++++++------ lite/multiprovider.go | 31 +++++++++++++++------- lite/provider.go | 4 +++ lite/provider_test.go | 10 ++++--- lite/proxy/certifier.go | 26 +++++++++++------- lite/proxy/wrapper.go | 28 +++++++++++++++----- rpc/core/pipe.go | 3 ++- rpc/core/status.go | 7 ++++- 15 files changed, 174 insertions(+), 68 deletions(-) diff --git a/.gitignore b/.gitignore index bcfd36db..269066e3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ scripts/cutWALUntil/cutWALUntil libs/pubsub/query/fuzz_test/output shunit2 +.tendermint-lite diff --git a/cmd/tendermint/commands/lite.go b/cmd/tendermint/commands/lite.go index 53b3ec18..5fe99d36 100644 --- a/cmd/tendermint/commands/lite.go +++ b/cmd/tendermint/commands/lite.go @@ -6,10 +6,9 @@ import ( "github.com/spf13/cobra" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tendermint/lite/proxy" rpcclient "github.com/tendermint/tendermint/rpc/client" + cmn "github.com/tendermint/tmlibs/common" ) // LiteCmd represents the base command when called without any subcommands @@ -66,17 +65,21 @@ func runProxy(cmd *cobra.Command, args []string) error { } // First, connect a client + logger.Info("Connecting to source HTTP client...") node := rpcclient.NewHTTP(nodeAddr, "/websocket") - cert, err := proxy.GetCertifier(chainID, home, node) + logger.Info("Constructing certifier...") + cert, err := proxy.NewCertifier(chainID, home, node, logger) if err != nil { - return err + return cmn.ErrorWrap(err, "constructing certifier") } + cert.SetLogger(logger) sc := proxy.SecureClient(node, cert) + logger.Info("Starting proxy...") err = proxy.StartProxy(sc, listenAddr, logger) if err != nil { - return err + return cmn.ErrorWrap(err, "starting proxy") } cmn.TrapSignal(func() { diff --git a/consensus/state.go b/consensus/state.go index 93e1f6b4..7c18d8b0 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -196,6 +196,15 @@ func (cs *ConsensusState) GetState() sm.State { return cs.state.Copy() } +// GetLastHeight returns the last height committed. +// If there were no blocks, returns 0. +func (cs *ConsensusState) GetLastHeight() int64 { + cs.mtx.Lock() + defer cs.mtx.Unlock() + + return cs.RoundState.Height - 1 +} + // GetRoundState returns a shallow copy of the internal consensus state. func (cs *ConsensusState) GetRoundState() *cstypes.RoundState { cs.mtx.Lock() diff --git a/lite/client/provider.go b/lite/client/provider.go index 8175c5b5..3ef15344 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -8,12 +8,12 @@ package client import ( "fmt" + "github.com/tendermint/tendermint/lite" + lerr "github.com/tendermint/tendermint/lite/errors" rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - - "github.com/tendermint/tendermint/lite" - lerr "github.com/tendermint/tendermint/lite/errors" + log "github.com/tendermint/tmlibs/log" ) // SignStatusClient combines a SignClient and StatusClient. @@ -23,22 +23,30 @@ type SignStatusClient interface { } type provider struct { + logger log.Logger chainID string client SignStatusClient } // NewProvider implements Provider (but not PersistentProvider). func NewProvider(chainID string, client SignStatusClient) lite.Provider { - return &provider{chainID: chainID, client: client} + return &provider{ + logger: log.NewNopLogger(), + chainID: chainID, + client: client, + } } // NewHTTPProvider can connect to a tendermint json-rpc endpoint // at the given url, and uses that as a read-only provider. func NewHTTPProvider(chainID, remote string) lite.Provider { - return &provider{ - chainID: chainID, - client: rpcclient.NewHTTP(remote, "/websocket"), - } + return NewProvider(chainID, rpcclient.NewHTTP(remote, "/websocket")) +} + +// Implements Provider. +func (p *provider) SetLogger(logger log.Logger) { + logger = logger.With("module", "lite/client") + p.logger = logger } // StatusClient returns the internal client as a StatusClient diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 81710c9e..f39f033c 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -10,23 +10,34 @@ import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tmlibs/db" + log "github.com/tendermint/tmlibs/log" ) type DBProvider struct { - chainID string - db dbm.DB - cdc *amino.Codec - limit int + logger log.Logger + label string + db dbm.DB + cdc *amino.Codec + limit int } -func NewDBProvider(db dbm.DB) *DBProvider { +func NewDBProvider(label string, db dbm.DB) *DBProvider { //db = dbm.NewDebugDB("db provider "+cmn.RandStr(4), db) cdc := amino.NewCodec() crypto.RegisterAmino(cdc) - dbp := &DBProvider{db: db, cdc: cdc} + dbp := &DBProvider{ + logger: log.NewNopLogger(), + label: label, + db: db, + cdc: cdc, + } return dbp } +func (dbp *DBProvider) SetLogger(logger log.Logger) { + dbp.logger = logger.With("label", dbp.label) +} + func (dbp *DBProvider) SetLimit(limit int) *DBProvider { dbp.limit = limit return dbp @@ -35,6 +46,7 @@ func (dbp *DBProvider) SetLimit(limit int) *DBProvider { // Implements PersistentProvider. func (dbp *DBProvider) SaveFullCommit(fc FullCommit) error { + dbp.logger.Info("DBProvider.SaveFullCommit()...", "fc", fc) batch := dbp.db.NewBatch() // Save the fc.validators. @@ -79,6 +91,9 @@ func (dbp *DBProvider) SaveFullCommit(fc FullCommit) error { func (dbp *DBProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) ( FullCommit, error) { + dbp.logger.Info("DBProvider.LatestFullCommit()...", + "chainID", chainID, "minHeight", minHeight, "maxHeight", maxHeight) + if minHeight <= 0 { minHeight = 1 } @@ -107,7 +122,15 @@ func (dbp *DBProvider) LatestFullCommit(chainID string, minHeight, maxHeight int if err != nil { return FullCommit{}, err } else { - return dbp.fillFullCommit(sh) + lfc, err := dbp.fillFullCommit(sh) + if err == nil { + dbp.logger.Info("DBProvider.LatestFullCommit() found latest.", "height", lfc.Height()) + return lfc, nil + } else { + dbp.logger.Info("DBProvider.LatestFullCommit() got error", "lfc", lfc) + dbp.logger.Info(fmt.Sprintf("%+v", err)) + return lfc, err + } } } } @@ -155,6 +178,9 @@ func (dbp *DBProvider) fillFullCommit(sh types.SignedHeader) (FullCommit, error) } func (dbp *DBProvider) deleteAfterN(chainID string, after int) error { + + dbp.logger.Info("DBProvider.deleteAfterN()...", "chainID", chainID, "after", after) + itr := dbp.db.ReverseIterator( signedHeaderKey(chainID, 1<<63-1), signedHeaderKey(chainID, 0), @@ -163,6 +189,7 @@ func (dbp *DBProvider) deleteAfterN(chainID string, after int) error { var lastHeight int64 = 1<<63 - 1 var numSeen = 0 + var numDeleted = 0 for itr.Valid() { key := itr.Key() @@ -176,9 +203,13 @@ func (dbp *DBProvider) deleteAfterN(chainID string, after int) error { } if numSeen > after { dbp.db.Delete(key) + numDeleted += 1 } } + itr.Next() } + + dbp.logger.Info(fmt.Sprintf("DBProvider.deleteAfterN() deleted %v items\n", numDeleted)) return nil } diff --git a/lite/doc.go b/lite/doc.go index 881880f6..07977ebe 100644 --- a/lite/doc.go +++ b/lite/doc.go @@ -92,8 +92,9 @@ type PersistentProvider interface { * MultiProvider - combine multiple providers. The suggested use for local light clients is client.NewHTTPProvider(...) for -getting new data (Source), and NewMultiProvider(NewDBProvider(dbm.NewMemDB()), -NewDBProvider(db.NewFileDB(...))) to store confirmed full commits (Trusted) +getting new data (Source), and NewMultiProvider(NewDBProvider("label", +dbm.NewMemDB()), NewDBProvider("label", db.NewFileDB(...))) to store confirmed +full commits (Trusted) # How We Track Validators diff --git a/lite/inquiring_certifier.go b/lite/inquiring_certifier.go index c4c6173b..f030ec57 100644 --- a/lite/inquiring_certifier.go +++ b/lite/inquiring_certifier.go @@ -3,9 +3,9 @@ package lite import ( "bytes" - "github.com/tendermint/tendermint/types" - lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" + log "github.com/tendermint/tmlibs/log" ) var _ Certifier = (*InquiringCertifier)(nil) @@ -15,6 +15,7 @@ var _ Certifier = (*InquiringCertifier)(nil) // validator set changes. It stores properly validated data on the // "trusted" local system. type InquiringCertifier struct { + logger log.Logger chainID string // These are only properly validated data, from local system. trusted PersistentProvider @@ -28,14 +29,20 @@ type InquiringCertifier struct { // // The trusted provider should a CacheProvider, MemProvider or // files.Provider. The source provider should be a client.HTTPProvider. -func NewInquiringCertifier(chainID string, trusted PersistentProvider, source Provider) ( - *InquiringCertifier, error) { - +func NewInquiringCertifier(chainID string, trusted PersistentProvider, source Provider) *InquiringCertifier { return &InquiringCertifier{ + logger: log.NewNopLogger(), chainID: chainID, trusted: trusted, source: source, - }, nil + } +} + +func (ic *InquiringCertifier) SetLogger(logger log.Logger) { + logger = logger.With("module", "lite") + ic.logger = logger + ic.trusted.SetLogger(logger) + ic.source.SetLogger(logger) } // Implements Certifier. diff --git a/lite/inquiring_certifier_test.go b/lite/inquiring_certifier_test.go index 8da5a7c1..23cb5488 100644 --- a/lite/inquiring_certifier_test.go +++ b/lite/inquiring_certifier_test.go @@ -8,12 +8,13 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tmlibs/db" + log "github.com/tendermint/tmlibs/log" ) func TestInquirerValidPath(t *testing.T) { assert, require := assert.New(t), require.New(t) - trust := NewDBProvider(dbm.NewMemDB()) - source := NewDBProvider(dbm.NewMemDB()) + trust := NewDBProvider("trust", dbm.NewMemDB()) + source := NewDBProvider("source", dbm.NewMemDB()) // Set up the validators to generate test blocks. var vote int64 = 10 @@ -43,8 +44,8 @@ func TestInquirerValidPath(t *testing.T) { // Initialize a certifier with the initial state. err := trust.SaveFullCommit(fcz[0]) require.Nil(err) - cert, err := NewInquiringCertifier(chainID, trust, source) - require.Nil(err) + cert := NewInquiringCertifier(chainID, trust, source) + cert.SetLogger(log.TestingLogger()) // This should fail validation: sh := fcz[count-1].SignedHeader @@ -70,8 +71,8 @@ func TestInquirerValidPath(t *testing.T) { func TestInquirerVerifyHistorical(t *testing.T) { assert, require := assert.New(t), require.New(t) - trust := NewDBProvider(dbm.NewMemDB()) - source := NewDBProvider(dbm.NewMemDB()) + trust := NewDBProvider("trust", dbm.NewMemDB()) + source := NewDBProvider("source", dbm.NewMemDB()) // Set up the validators to generate test blocks. var vote int64 = 10 @@ -101,8 +102,8 @@ func TestInquirerVerifyHistorical(t *testing.T) { // Initialize a certifier with the initial state. err := trust.SaveFullCommit(fcz[0]) require.Nil(err) - cert, err := NewInquiringCertifier(chainID, trust, source) - require.Nil(err) + cert := NewInquiringCertifier(chainID, trust, source) + cert.SetLogger(log.TestingLogger()) // Store a few full commits as trust. for _, i := range []int{2, 5} { diff --git a/lite/multiprovider.go b/lite/multiprovider.go index dcfd1318..8ff523b4 100644 --- a/lite/multiprovider.go +++ b/lite/multiprovider.go @@ -3,24 +3,35 @@ package lite import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" + log "github.com/tendermint/tmlibs/log" ) // multiProvider allows you to place one or more caches in front of a source // Provider. It runs through them in order until a match is found. type multiProvider struct { - Providers []PersistentProvider + logger log.Logger + providers []PersistentProvider } // NewMultiProvider returns a new provider which wraps multiple other providers. -func NewMultiProvider(providers ...PersistentProvider) multiProvider { - return multiProvider{ - Providers: providers, +func NewMultiProvider(providers ...PersistentProvider) *multiProvider { + return &multiProvider{ + logger: log.NewNopLogger(), + providers: providers, + } +} + +// SetLogger sets logger on self and all subproviders. +func (mc *multiProvider) SetLogger(logger log.Logger) { + mc.logger = logger + for _, p := range mc.providers { + p.SetLogger(logger) } } // SaveFullCommit saves on all providers, and aborts on the first error. -func (mc multiProvider) SaveFullCommit(fc FullCommit) (err error) { - for _, p := range mc.Providers { +func (mc *multiProvider) SaveFullCommit(fc FullCommit) (err error) { + for _, p := range mc.providers { err = p.SaveFullCommit(fc) if err != nil { return @@ -32,8 +43,8 @@ func (mc multiProvider) SaveFullCommit(fc FullCommit) (err error) { // LatestFullCommit loads the latest from all providers and provides // the latest FullCommit that satisfies the conditions. // Returns the first error encountered. -func (mc multiProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) (fc FullCommit, err error) { - for _, p := range mc.Providers { +func (mc *multiProvider) LatestFullCommit(chainID string, minHeight, maxHeight int64) (fc FullCommit, err error) { + for _, p := range mc.providers { var fc_ FullCommit fc_, err = p.LatestFullCommit(chainID, minHeight, maxHeight) if lerr.IsErrCommitNotFound(err) { @@ -60,8 +71,8 @@ func (mc multiProvider) LatestFullCommit(chainID string, minHeight, maxHeight in // ValidatorSet returns validator set at height as provided by the first // provider which has it, or an error otherwise. -func (mc multiProvider) ValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { - for _, p := range mc.Providers { +func (mc *multiProvider) ValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { + for _, p := range mc.providers { valset, err = p.ValidatorSet(chainID, height) if err == nil { // TODO Log unexpected types of errors. diff --git a/lite/provider.go b/lite/provider.go index 34ba40d4..c31b2da4 100644 --- a/lite/provider.go +++ b/lite/provider.go @@ -2,6 +2,7 @@ package lite import ( "github.com/tendermint/tendermint/types" + log "github.com/tendermint/tmlibs/log" ) // Provider provides information for the lite client to sync validators. @@ -16,6 +17,9 @@ type Provider interface { // Get the valset that corresponds to chainID and height and return. // Height must be >= 1. ValidatorSet(chainID string, height int64) (*types.ValidatorSet, error) + + // Set a logger. + SetLogger(logger log.Logger) } // A provider that can also persist new information. diff --git a/lite/provider_test.go b/lite/provider_test.go index 96523d94..09e8119b 100644 --- a/lite/provider_test.go +++ b/lite/provider_test.go @@ -10,6 +10,7 @@ import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tmlibs/db" + log "github.com/tendermint/tmlibs/log" ) // missingProvider doesn't store anything, always a miss. @@ -28,16 +29,17 @@ func (missingProvider) LatestFullCommit(chainID string, minHeight, maxHeight int func (missingProvider) ValidatorSet(chainID string, height int64) (*types.ValidatorSet, error) { return nil, errors.New("missing validator set") } +func (missingProvider) SetLogger(_ log.Logger) {} func TestMemProvider(t *testing.T) { - p := NewDBProvider(dbm.NewMemDB()) + p := NewDBProvider("mem", dbm.NewMemDB()) checkProvider(t, p, "test-mem", "empty") } func TestMultiProvider(t *testing.T) { p := NewMultiProvider( NewMissingProvider(), - NewDBProvider(dbm.NewMemDB()), + NewDBProvider("mem", dbm.NewMemDB()), NewMissingProvider(), ) checkProvider(t, p, "test-cache", "kjfhekfhkewhgit") @@ -105,8 +107,8 @@ func TestMultiLatestFullCommit(t *testing.T) { // We will write data to the second level of the cache (p2), and see what // gets cached/stored in. - p := NewDBProvider(dbm.NewMemDB()) - p2 := NewDBProvider(dbm.NewMemDB()) + p := NewDBProvider("mem1", dbm.NewMemDB()) + p2 := NewDBProvider("mem2", dbm.NewMemDB()) cp := NewMultiProvider(p, p2) chainID := "cache-best-height" diff --git a/lite/proxy/certifier.go b/lite/proxy/certifier.go index 772af58f..a1ab02c5 100644 --- a/lite/proxy/certifier.go +++ b/lite/proxy/certifier.go @@ -3,33 +3,39 @@ package proxy import ( "github.com/tendermint/tendermint/lite" lclient "github.com/tendermint/tendermint/lite/client" + cmn "github.com/tendermint/tmlibs/common" dbm "github.com/tendermint/tmlibs/db" + log "github.com/tendermint/tmlibs/log" ) -func GetCertifier(chainID, rootDir string, client lclient.SignStatusClient) (*lite.InquiringCertifier, error) { +func NewCertifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger) (*lite.InquiringCertifier, error) { + + logger = logger.With("module", "lite/proxy") + logger.Info("lite/proxy/NewCertifier()...", "chainID", chainID, "rootDir", rootDir, "client", client) + + memProvider := lite.NewDBProvider("trusted.mem", dbm.NewMemDB()).SetLimit(10) + lvlProvider := lite.NewDBProvider("trusted.lvl", dbm.NewDB("trust-base", dbm.LevelDBBackend, rootDir)) trust := lite.NewMultiProvider( - lite.NewDBProvider(dbm.NewMemDB()).SetLimit(10), - lite.NewDBProvider(dbm.NewDB("trust-base", dbm.LevelDBBackend, rootDir)), + memProvider, + lvlProvider, ) source := lclient.NewProvider(chainID, client) + cert := lite.NewInquiringCertifier(chainID, trust, source) + cert.SetLogger(logger) // Sets logger recursively. // TODO: Make this more secure, e.g. make it interactive in the console? _, err := trust.LatestFullCommit(chainID, 1, 1<<63-1) if err != nil { + logger.Info("lite/proxy/NewCertifier found no trusted full commit, initializing from source from height 1...") fc, err := source.LatestFullCommit(chainID, 1, 1) if err != nil { - return nil, err + return nil, cmn.ErrorWrap(err, "fetching source full commit @ height 1") } err = trust.SaveFullCommit(fc) if err != nil { - return nil, err + return nil, cmn.ErrorWrap(err, "saving full commit to trusted") } } - cert, err := lite.NewInquiringCertifier(chainID, trust, source) - if err != nil { - return nil, err - } - return cert, nil } diff --git a/lite/proxy/wrapper.go b/lite/proxy/wrapper.go index 83fc96a1..82b1fb09 100644 --- a/lite/proxy/wrapper.go +++ b/lite/proxy/wrapper.go @@ -89,33 +89,49 @@ func (w Wrapper) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlock // Block returns an entire block and verifies all signatures func (w Wrapper) Block(height *int64) (*ctypes.ResultBlock, error) { - r, err := w.Client.Block(height) + resBlock, err := w.Client.Block(height) if err != nil { return nil, err } // get a checkpoint to verify from - res, err := w.Commit(height) + resCommit, err := w.Commit(height) if err != nil { return nil, err } - sh := res.SignedHeader + sh := resCommit.SignedHeader // now verify - err = ValidateBlockMeta(r.BlockMeta, sh) + err = ValidateBlockMeta(resBlock.BlockMeta, sh) if err != nil { return nil, err } - err = ValidateBlock(r.Block, sh) + err = ValidateBlock(resBlock.Block, sh) if err != nil { return nil, err } - return r, nil + return resBlock, nil } // Commit downloads the Commit and certifies it with the lite. // // This is the foundation for all other verification in this module func (w Wrapper) Commit(height *int64) (*ctypes.ResultCommit, error) { + if height == nil { + resStatus, err := w.Client.Status() + if err != nil { + return nil, err + } + // NOTE: If resStatus.CatchingUp, there is a race + // condition where the validator set for the next height + // isn't available until some time after the blockstore + // has height h on the remote node. This isn't an issue + // once the node has caught up, and a syncing node likely + // won't have this issue esp with the implementation we + // have here, but we may have to address this at some + // point. + height = new(int64) + *height = resStatus.SyncInfo.LatestBlockHeight + } rpcclient.WaitForHeight(w.Client, *height, nil) res, err := w.Client.Commit(height) // if we got it, then certify it diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index 9fcb75e1..52fe1b55 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -3,8 +3,8 @@ package core import ( "time" - crypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/consensus" + crypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/proxy" sm "github.com/tendermint/tendermint/state" @@ -28,6 +28,7 @@ var subscribeTimeout = 5 * time.Second type Consensus interface { GetState() sm.State GetValidators() (int64, []*types.Validator) + GetLastHeight() int64 GetRoundStateJSON() ([]byte, error) GetRoundStateSimpleJSON() ([]byte, error) } diff --git a/rpc/core/status.go b/rpc/core/status.go index 5738685b..00a14c54 100644 --- a/rpc/core/status.go +++ b/rpc/core/status.go @@ -64,7 +64,12 @@ import ( //} // ``` func Status() (*ctypes.ResultStatus, error) { - latestHeight := blockStore.Height() + var latestHeight int64 = -1 + if consensusReactor.FastSync() { + latestHeight = blockStore.Height() + } else { + latestHeight = consensusState.GetLastHeight() + } var ( latestBlockMeta *types.BlockMeta latestBlockHash cmn.HexBytes From acd976ad5b64e3952459353cb84b14af86d85bf9 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 23:42:00 -0700 Subject: [PATCH 008/149] bump circle --- bump | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bump diff --git a/bump b/bump new file mode 100644 index 00000000..e69de29b From 19fc4ac47c40f12567652abee3afe70cd5c5970c Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 23:58:47 -0700 Subject: [PATCH 009/149] remove abci from gopkg.toml --- Gopkg.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index dc56ae29..18e2767a 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -69,10 +69,6 @@ name = "github.com/stretchr/testify" version = "~1.2.1" -[[constraint]] - name = "github.com/tendermint/abci" - version = "~0.12.0" - [[constraint]] name = "github.com/tendermint/go-amino" version = "~0.10.1" From 835c2ee74a07814d690166bae3ee0bbc81b02f3e Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:09:04 -0700 Subject: [PATCH 010/149] Print --- test/p2p/basic/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/p2p/basic/test.sh b/test/p2p/basic/test.sh index caf66512..423b5b01 100755 --- a/test/p2p/basic/test.sh +++ b/test/p2p/basic/test.sh @@ -56,6 +56,7 @@ for i in `seq 1 $N`; do # - assert block height is greater than 1 BLOCK_HEIGHT=`curl -s $addr/status | jq .result.sync_info.latest_block_height | jq fromjson` COUNT=0 + echo "$$BLOCK_HEIGHT IS $BLOCK_HEIGHT" while [ "$BLOCK_HEIGHT" -le 1 ]; do echo "Waiting for node $i to commit a block ..." sleep 1 From 8163b99a75f34a3eefc19bf0449405a701b82378 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:37:53 -0700 Subject: [PATCH 011/149] print docker output to console to debug circle --- test/p2p/kill_all/check_peers.sh | 4 ++-- test/p2p/peer.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/p2p/kill_all/check_peers.sh b/test/p2p/kill_all/check_peers.sh index 87a76811..95da7484 100644 --- a/test/p2p/kill_all/check_peers.sh +++ b/test/p2p/kill_all/check_peers.sh @@ -23,7 +23,7 @@ set -e # get the first peer's height addr=$(test/p2p/ip.sh 1):26657 -h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) +h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "1st peer is on height $h1" echo "Waiting until other peers reporting a height higher than the 1st one" @@ -33,7 +33,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do while [[ $hi -le $h1 ]] ; do addr=$(test/p2p/ip.sh "$i"):26657 - hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) + hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "... peer $i is on height $hi" diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 15d44ff3..59b55b1e 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,7 +14,7 @@ echo "starting tendermint peer ID=$ID" # start tendermint container on the network # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. -docker run -d \ +docker run \ --net="$NETWORK_NAME" \ --ip=$(test/p2p/ip.sh "$ID") \ --name "local_testnet_$ID" \ @@ -24,4 +24,4 @@ docker run -d \ --log-opt syslog-address=udp://127.0.0.1:5514 \ --log-opt syslog-facility=daemon \ --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & From ad1b722898aa435bb022b1641ebbc25365a17fac Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 00:41:50 -0700 Subject: [PATCH 012/149] bump for circle --- bump | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bump b/bump index e69de29b..729353f7 100644 --- a/bump +++ b/bump @@ -0,0 +1,2 @@ + +booop From 363146dacf803a065d7bbe35994b145fae746ef3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 02:03:15 -0700 Subject: [PATCH 013/149] just print node1 --- test/p2p/peer.sh | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 59b55b1e..a718fd49 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,14 +14,33 @@ echo "starting tendermint peer ID=$ID" # start tendermint container on the network # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. -docker run \ - --net="$NETWORK_NAME" \ - --ip=$(test/p2p/ip.sh "$ID") \ - --name "local_testnet_$ID" \ - --entrypoint tendermint \ - -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ - --log-driver=syslog \ - --log-opt syslog-address=udp://127.0.0.1:5514 \ - --log-opt syslog-facility=daemon \ - --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & + + + +if [[ "$ID" == "1" ]]; then + docker run \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & +else + docker run -d \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" +fi From 9184733261efc20d9c4b5328df03c8da8f2ff1ec Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 02:34:11 -0700 Subject: [PATCH 014/149] try it with new consensus? --- consensus/state.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 7c18d8b0..19c17f33 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1587,7 +1587,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, if prevotes.HasTwoThirdsMajority() { cs.enterPrecommit(height, vote.Round) } else { - cs.enterPrevote(height, vote.Round) // if the vote is ahead of us + cs.enterPropose(height, vote.Round) // we can't prevote until we wait for the proposal. cs.enterPrevoteWait(height, vote.Round) } } else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round { @@ -1621,7 +1621,8 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, } } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { cs.enterNewRound(height, vote.Round) - cs.enterPrecommit(height, vote.Round) + cs.enterPrevote(height, vote.Round) + cs.enterPrevoteWait(height, vote.Round) cs.enterPrecommitWait(height, vote.Round) } default: From cfcbc614498b5c16e49e064eacb8dba168cb78c3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 04:04:33 -0700 Subject: [PATCH 015/149] oops --- consensus/state.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/consensus/state.go b/consensus/state.go index 19c17f33..e3c9054a 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1021,9 +1021,11 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) - } + /* + if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { + cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) + } + */ logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { From 8524a8da7fdb52e5396b360a8862d3466be9e2e8 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 26 Jun 2018 23:42:00 -0700 Subject: [PATCH 016/149] Try to fix circle... --- Gopkg.toml | 4 ---- bump | 2 ++ consensus/state.go | 13 ++++++---- foo.sh | 1 + test/p2p/basic/test.sh | 1 + test/p2p/kill_all/check_peers.sh | 4 ++-- test/p2p/peer.sh | 41 +++++++++++++++++++++++--------- types/validator_set.go | 24 +++++++++---------- 8 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 bump create mode 100644 foo.sh diff --git a/Gopkg.toml b/Gopkg.toml index dc56ae29..18e2767a 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -69,10 +69,6 @@ name = "github.com/stretchr/testify" version = "~1.2.1" -[[constraint]] - name = "github.com/tendermint/abci" - version = "~0.12.0" - [[constraint]] name = "github.com/tendermint/go-amino" version = "~0.10.1" diff --git a/bump b/bump new file mode 100644 index 00000000..729353f7 --- /dev/null +++ b/bump @@ -0,0 +1,2 @@ + +booop diff --git a/consensus/state.go b/consensus/state.go index 7c18d8b0..e3c9054a 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1021,9 +1021,11 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) - } + /* + if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { + cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) + } + */ logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { @@ -1587,7 +1589,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, if prevotes.HasTwoThirdsMajority() { cs.enterPrecommit(height, vote.Round) } else { - cs.enterPrevote(height, vote.Round) // if the vote is ahead of us + cs.enterPropose(height, vote.Round) // we can't prevote until we wait for the proposal. cs.enterPrevoteWait(height, vote.Round) } } else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round { @@ -1621,7 +1623,8 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, } } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { cs.enterNewRound(height, vote.Round) - cs.enterPrecommit(height, vote.Round) + cs.enterPrevote(height, vote.Round) + cs.enterPrevoteWait(height, vote.Round) cs.enterPrecommitWait(height, vote.Round) } default: diff --git a/foo.sh b/foo.sh new file mode 100644 index 00000000..be8b9d78 --- /dev/null +++ b/foo.sh @@ -0,0 +1 @@ +docker run -ti tester find diff --git a/test/p2p/basic/test.sh b/test/p2p/basic/test.sh index caf66512..423b5b01 100755 --- a/test/p2p/basic/test.sh +++ b/test/p2p/basic/test.sh @@ -56,6 +56,7 @@ for i in `seq 1 $N`; do # - assert block height is greater than 1 BLOCK_HEIGHT=`curl -s $addr/status | jq .result.sync_info.latest_block_height | jq fromjson` COUNT=0 + echo "$$BLOCK_HEIGHT IS $BLOCK_HEIGHT" while [ "$BLOCK_HEIGHT" -le 1 ]; do echo "Waiting for node $i to commit a block ..." sleep 1 diff --git a/test/p2p/kill_all/check_peers.sh b/test/p2p/kill_all/check_peers.sh index 87a76811..95da7484 100644 --- a/test/p2p/kill_all/check_peers.sh +++ b/test/p2p/kill_all/check_peers.sh @@ -23,7 +23,7 @@ set -e # get the first peer's height addr=$(test/p2p/ip.sh 1):26657 -h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) +h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "1st peer is on height $h1" echo "Waiting until other peers reporting a height higher than the 1st one" @@ -33,7 +33,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do while [[ $hi -le $h1 ]] ; do addr=$(test/p2p/ip.sh "$i"):26657 - hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height) + hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g") echo "... peer $i is on height $hi" diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index 15d44ff3..a718fd49 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -14,14 +14,33 @@ echo "starting tendermint peer ID=$ID" # start tendermint container on the network # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. -docker run -d \ - --net="$NETWORK_NAME" \ - --ip=$(test/p2p/ip.sh "$ID") \ - --name "local_testnet_$ID" \ - --entrypoint tendermint \ - -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ - --log-driver=syslog \ - --log-opt syslog-address=udp://127.0.0.1:5514 \ - --log-opt syslog-facility=daemon \ - --log-opt tag="{{.Name}}" \ - "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" + + + +if [[ "$ID" == "1" ]]; then + docker run \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" & +else + docker run -d \ + --net="$NETWORK_NAME" \ + --ip=$(test/p2p/ip.sh "$ID") \ + --name "local_testnet_$ID" \ + --entrypoint tendermint \ + -e TMHOME="/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core" \ + -e GOMAXPROCS=1 \ + --log-driver=syslog \ + --log-opt syslog-address=udp://127.0.0.1:5514 \ + --log-opt syslog-facility=daemon \ + --log-opt tag="{{.Name}}" \ + "$DOCKER_IMAGE" node $NODE_FLAGS --log_level=debug --proxy_app="$APP_PROXY" +fi diff --git a/types/validator_set.go b/types/validator_set.go index dc1d0e88..636c046a 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -279,11 +279,6 @@ func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height i if precommit.Type != VoteTypePrecommit { return fmt.Errorf("Invalid commit -- not precommit @ index %v", idx) } - // NOTE: This will go away when we refactor Commit. - if !blockID.Equals(precommit.BlockID) { - return fmt.Errorf("Invalid commit -- wrong block id @ index %v: want %v got %v", - idx, blockID, precommit.BlockID) - } _, val := vals.GetByIndex(idx) // Validate signature. precommitSignBytes := precommit.SignBytes(chainID) @@ -291,7 +286,12 @@ func (vals *ValidatorSet) VerifyCommit(chainID string, blockID BlockID, height i return fmt.Errorf("Invalid commit -- invalid signature: %v", precommit) } // Good precommit! - talliedVotingPower += val.VotingPower + if blockID.Equals(precommit.BlockID) { + talliedVotingPower += val.VotingPower + } else { + // It's OK that the BlockID doesn't match. We include stray + // precommits to measure validator availability. + } } if talliedVotingPower > vals.TotalVotingPower()*2/3 { @@ -358,11 +358,6 @@ func (vals *ValidatorSet) VerifyFutureCommit(newSet *ValidatorSet, chainID strin if precommit.Type != VoteTypePrecommit { return cmn.NewError("Invalid commit -- not precommit @ index %v", idx) } - // NOTE: This will go away when we refactor Commit. - if !blockID.Equals(precommit.BlockID) { - return fmt.Errorf("Invalid commit -- wrong block id @ index %v: want %v got %v", - idx, blockID, precommit.BlockID) - } // See if this validator is in oldVals. idx, val := oldVals.GetByAddress(precommit.ValidatorAddress) if val == nil || seen[idx] { @@ -376,7 +371,12 @@ func (vals *ValidatorSet) VerifyFutureCommit(newSet *ValidatorSet, chainID strin return cmn.NewError("Invalid commit -- invalid signature: %v", precommit) } // Good precommit! - oldVotingPower += val.VotingPower + if blockID.Equals(precommit.BlockID) { + oldVotingPower += val.VotingPower + } else { + // It's OK that the BlockID doesn't match. We include stray + // precommits to measure validator availability. + } } if oldVotingPower <= oldVals.TotalVotingPower()*2/3 { From b51ed132f7ac13792dd9b5d7dbb7c806364fdcc9 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Wed, 27 Jun 2018 14:31:42 -0700 Subject: [PATCH 017/149] Fix test/p2p/pex circle tests; update consensus --- .gitignore | 1 + consensus/state.go | 2 +- lite/commit.go | 8 +------- lite/dbprovider.go | 4 ---- test/p2p/peer.sh | 4 +--- test/p2p/pex/test_addrbook.sh | 15 ++++++++++++--- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 269066e3..9337de17 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ scripts/cutWALUntil/cutWALUntil libs/pubsub/query/fuzz_test/output shunit2 .tendermint-lite +addrbook.json diff --git a/consensus/state.go b/consensus/state.go index e3c9054a..4bb47045 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1623,7 +1623,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, } } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { cs.enterNewRound(height, vote.Round) - cs.enterPrevote(height, vote.Round) + cs.enterPropose(height, vote.Round) cs.enterPrevoteWait(height, vote.Round) cs.enterPrecommitWait(height, vote.Round) } diff --git a/lite/commit.go b/lite/commit.go index 40c3534c..89f04417 100644 --- a/lite/commit.go +++ b/lite/commit.go @@ -65,15 +65,9 @@ func (fc FullCommit) ValidateFull(chainID string) error { } // Validate the signatures on the commit. hdr, cmt := fc.SignedHeader.Header, fc.SignedHeader.Commit - err = fc.Validators.VerifyCommit( + return fc.Validators.VerifyCommit( hdr.ChainID, cmt.BlockID, hdr.Height, cmt) - if err != nil { - return err - } - - // All good! - return nil } // Height returns the height of the header. diff --git a/lite/dbprovider.go b/lite/dbprovider.go index f39f033c..3ee3b062 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -241,10 +241,6 @@ func validatorSetKey(chainID string, height int64) []byte { return []byte(fmt.Sprintf("%s/%010d/vs", chainID, height)) } -func chainKeyPrefix(chainID string, height int64) []byte { - return []byte(fmt.Sprintf("%s/%010d/", chainID, height)) -} - var chainKeyPrefixPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/`) func parseChainKeyPrefix(key []byte) (chainID string, height int64, ok bool) { diff --git a/test/p2p/peer.sh b/test/p2p/peer.sh index a718fd49..ad04d000 100644 --- a/test/p2p/peer.sh +++ b/test/p2p/peer.sh @@ -15,9 +15,7 @@ echo "starting tendermint peer ID=$ID" # NOTE: $NODE_FLAGS should be unescaped (no quotes). otherwise it will be # treated as one flag. - - -if [[ "$ID" == "1" ]]; then +if [[ "$ID" == "x" ]]; then # Set "x" to "1" to print to console. docker run \ --net="$NETWORK_NAME" \ --ip=$(test/p2p/ip.sh "$ID") \ diff --git a/test/p2p/pex/test_addrbook.sh b/test/p2p/pex/test_addrbook.sh index d54bcf42..9c58db30 100644 --- a/test/p2p/pex/test_addrbook.sh +++ b/test/p2p/pex/test_addrbook.sh @@ -16,6 +16,7 @@ CLIENT_NAME="pex_addrbook_$ID" echo "1. restart peer $ID" docker stop "local_testnet_$ID" +echo "stopped local_testnet_$ID" # preserve addrbook.json docker cp "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/config/addrbook.json" "/tmp/addrbook.json" set +e #CIRCLE @@ -24,6 +25,13 @@ set -e # NOTE that we do not provide persistent_peers bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe" +echo "started local_testnet_$ID" + +# if the client runs forever, it means addrbook wasn't saved or was empty +bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$CLIENT_NAME" "test/p2p/pex/check_peer.sh $ID $N" + +# Now we know that the node is up. + docker cp "/tmp/addrbook.json" "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/config/addrbook.json" echo "with the following addrbook:" cat /tmp/addrbook.json @@ -31,9 +39,6 @@ cat /tmp/addrbook.json # docker exec "local_testnet_$ID" cat "/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/config/addrbook.json" echo "" -# if the client runs forever, it means addrbook wasn't saved or was empty -bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$CLIENT_NAME" "test/p2p/pex/check_peer.sh $ID $N" - echo "----------------------------------------------------------------------" echo "Testing other peers connect to us if we have neither persistent_peers nor the addrbook" echo "(assuming peers are started with pex enabled)" @@ -42,16 +47,20 @@ CLIENT_NAME="pex_no_addrbook_$ID" echo "1. restart peer $ID" docker stop "local_testnet_$ID" +echo "stopped local_testnet_$ID" set +e #CIRCLE docker rm -vf "local_testnet_$ID" set -e # NOTE that we do not provide persistent_peers bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe" +echo "started local_testnet_$ID" # if the client runs forever, it means other peers have removed us from their books (which should not happen) bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$CLIENT_NAME" "test/p2p/pex/check_peer.sh $ID $N" +# Now we know that the node is up. + echo "" echo "PASS" echo "" From 9018acde5f4e77368490c6d497f0364ea396dd2a Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 2 Jul 2018 14:58:07 -0400 Subject: [PATCH 018/149] tmlibs -> tendermint/libs --- lite/base_certifier.go | 2 +- lite/client/provider.go | 2 +- lite/dbprovider.go | 4 ++-- lite/errors/errors.go | 2 +- lite/inquiring_certifier.go | 2 +- lite/inquiring_certifier_test.go | 4 ++-- lite/multiprovider.go | 2 +- lite/provider.go | 2 +- lite/provider_test.go | 4 ++-- lite/proxy/certifier.go | 6 +++--- lite/proxy/errors.go | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lite/base_certifier.go b/lite/base_certifier.go index 6f2b3da9..0f9faba3 100644 --- a/lite/base_certifier.go +++ b/lite/base_certifier.go @@ -5,7 +5,7 @@ import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tmlibs/common" + cmn "github.com/tendermint/tendermint/libs/common" ) var _ Certifier = (*BaseCertifier)(nil) diff --git a/lite/client/provider.go b/lite/client/provider.go index 3ef15344..8087be71 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -13,7 +13,7 @@ import ( rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tmlibs/log" + log "github.com/tendermint/tendermint/libs/log" ) // SignStatusClient combines a SignClient and StatusClient. diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 3ee3b062..13ad2c61 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -9,8 +9,8 @@ import ( crypto "github.com/tendermint/tendermint/crypto" lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tmlibs/db" - log "github.com/tendermint/tmlibs/log" + dbm "github.com/tendermint/tendermint/libs/db" + log "github.com/tendermint/tendermint/libs/log" ) type DBProvider struct { diff --git a/lite/errors/errors.go b/lite/errors/errors.go index c38ecf88..96a5a02a 100644 --- a/lite/errors/errors.go +++ b/lite/errors/errors.go @@ -3,7 +3,7 @@ package errors import ( "fmt" - cmn "github.com/tendermint/tmlibs/common" + cmn "github.com/tendermint/tendermint/libs/common" ) //---------------------------------------- diff --git a/lite/inquiring_certifier.go b/lite/inquiring_certifier.go index f030ec57..31637447 100644 --- a/lite/inquiring_certifier.go +++ b/lite/inquiring_certifier.go @@ -5,7 +5,7 @@ import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tmlibs/log" + log "github.com/tendermint/tendermint/libs/log" ) var _ Certifier = (*InquiringCertifier)(nil) diff --git a/lite/inquiring_certifier_test.go b/lite/inquiring_certifier_test.go index 23cb5488..5eb63727 100644 --- a/lite/inquiring_certifier_test.go +++ b/lite/inquiring_certifier_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - dbm "github.com/tendermint/tmlibs/db" - log "github.com/tendermint/tmlibs/log" + dbm "github.com/tendermint/tendermint/libs/db" + log "github.com/tendermint/tendermint/libs/log" ) func TestInquirerValidPath(t *testing.T) { diff --git a/lite/multiprovider.go b/lite/multiprovider.go index 8ff523b4..991a12d7 100644 --- a/lite/multiprovider.go +++ b/lite/multiprovider.go @@ -3,7 +3,7 @@ package lite import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tmlibs/log" + log "github.com/tendermint/tendermint/libs/log" ) // multiProvider allows you to place one or more caches in front of a source diff --git a/lite/provider.go b/lite/provider.go index c31b2da4..59e36a67 100644 --- a/lite/provider.go +++ b/lite/provider.go @@ -2,7 +2,7 @@ package lite import ( "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tmlibs/log" + log "github.com/tendermint/tendermint/libs/log" ) // Provider provides information for the lite client to sync validators. diff --git a/lite/provider_test.go b/lite/provider_test.go index 09e8119b..e5547022 100644 --- a/lite/provider_test.go +++ b/lite/provider_test.go @@ -9,8 +9,8 @@ import ( lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tmlibs/db" - log "github.com/tendermint/tmlibs/log" + dbm "github.com/tendermint/tendermint/libs/db" + log "github.com/tendermint/tendermint/libs/log" ) // missingProvider doesn't store anything, always a miss. diff --git a/lite/proxy/certifier.go b/lite/proxy/certifier.go index a1ab02c5..bd09b1ab 100644 --- a/lite/proxy/certifier.go +++ b/lite/proxy/certifier.go @@ -3,9 +3,9 @@ package proxy import ( "github.com/tendermint/tendermint/lite" lclient "github.com/tendermint/tendermint/lite/client" - cmn "github.com/tendermint/tmlibs/common" - dbm "github.com/tendermint/tmlibs/db" - log "github.com/tendermint/tmlibs/log" + cmn "github.com/tendermint/tendermint/libs/common" + dbm "github.com/tendermint/tendermint/libs/db" + log "github.com/tendermint/tendermint/libs/log" ) func NewCertifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger) (*lite.InquiringCertifier, error) { diff --git a/lite/proxy/errors.go b/lite/proxy/errors.go index 9af72a54..6a7c2354 100644 --- a/lite/proxy/errors.go +++ b/lite/proxy/errors.go @@ -1,7 +1,7 @@ package proxy import ( - cmn "github.com/tendermint/tmlibs/common" + cmn "github.com/tendermint/tendermint/libs/common" ) type errNoData struct{} From f1093edbe2143cf89125052c119598c7acb5eed0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 23 Jul 2018 23:11:53 -0400 Subject: [PATCH 019/149] remove accidental files --- bump | 2 -- foo.sh | 1 - 2 files changed, 3 deletions(-) delete mode 100644 bump delete mode 100644 foo.sh diff --git a/bump b/bump deleted file mode 100644 index 729353f7..00000000 --- a/bump +++ /dev/null @@ -1,2 +0,0 @@ - -booop diff --git a/foo.sh b/foo.sh deleted file mode 100644 index be8b9d78..00000000 --- a/foo.sh +++ /dev/null @@ -1 +0,0 @@ -docker run -ti tester find From f6705f02c7df53b9dc036a290ed0c31cc2f030e4 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 23 Jul 2018 23:31:47 -0400 Subject: [PATCH 020/149] fixes post merge --- lite/dbprovider.go | 8 ++-- lite/helpers.go | 4 +- lite/proxy/validate_test.go | 11 +---- types/validator_set_test.go | 95 +++++++++++++++++++------------------ 4 files changed, 56 insertions(+), 62 deletions(-) diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 13ad2c61..8392fcea 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -6,11 +6,11 @@ import ( "strconv" amino "github.com/tendermint/go-amino" - crypto "github.com/tendermint/tendermint/crypto" - lerr "github.com/tendermint/tendermint/lite/errors" - "github.com/tendermint/tendermint/types" + cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" dbm "github.com/tendermint/tendermint/libs/db" log "github.com/tendermint/tendermint/libs/log" + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" ) type DBProvider struct { @@ -24,7 +24,7 @@ type DBProvider struct { func NewDBProvider(label string, db dbm.DB) *DBProvider { //db = dbm.NewDebugDB("db provider "+cmn.RandStr(4), db) cdc := amino.NewCodec() - crypto.RegisterAmino(cdc) + cryptoAmino.RegisterAmino(cdc) dbp := &DBProvider{ logger: log.NewNopLogger(), label: label, diff --git a/lite/helpers.go b/lite/helpers.go index c6fe1760..9265aeea 100644 --- a/lite/helpers.go +++ b/lite/helpers.go @@ -44,7 +44,7 @@ func (pkz privKeys) Extend(n int) privKeys { // GenSecpPrivKeys produces an array of secp256k1 private keys to generate commits. func GenSecpPrivKeys(n int) privKeys { - res := make(privKey, n) + res := make(privKeys, n) for i := range res { res[i] = secp256k1.GenPrivKey() } @@ -54,7 +54,7 @@ func GenSecpPrivKeys(n int) privKeys { // ExtendSecp adds n more secp256k1 keys (to remove, just take a slice). func (pkz privKeys) ExtendSecp(n int) privKeys { extra := GenSecpPrivKeys(n) - return append(v, extra...) + return append(pkz, extra...) } // ToValidators produces a valset from the set of keys. diff --git a/lite/proxy/validate_test.go b/lite/proxy/validate_test.go index 6ca9035c..1ce4d667 100644 --- a/lite/proxy/validate_test.go +++ b/lite/proxy/validate_test.go @@ -33,10 +33,7 @@ func TestValidateBlock(t *testing.T) { block: nil, wantErr: "non-nil Block", }, { - block: &types.Block{}, wantErr: "nil Header", - }, - { - block: &types.Block{Header: new(types.Header)}, wantErr: "unexpected empty SignedHeader", + block: &types.Block{}, wantErr: "unexpected empty SignedHeader", }, // Start Header.Height mismatch test @@ -115,11 +112,7 @@ func TestValidateBlockMeta(t *testing.T) { meta: nil, wantErr: "non-nil BlockMeta", }, { - meta: &types.BlockMeta{}, wantErr: "non-nil Header", - }, - { - meta: &types.BlockMeta{Header: new(types.Header)}, wantErr: "unexpected empty SignedHeader", - // meta: &types.BlockMeta{}, + meta: &types.BlockMeta{}, wantErr: "unexpected empty SignedHeader", }, // Start Header.Height mismatch test diff --git a/types/validator_set_test.go b/types/validator_set_test.go index 1756f789..ba5fefa2 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -16,57 +16,58 @@ import ( ) func TestValidatorSetBasic(t *testing.T) { - for _, vset := range []*ValidatorSet{NewValidatorSet([]*Validator{}), NewValidatorSet(nil)} { - assert.Panics(t, func() { vset.IncrementAccum(1) }) + assert.Panics(t, func() { NewValidatorSet([]*Validator{}) }) - assert.EqualValues(t, vset, vset.Copy()) - assert.False(t, vset.HasAddress([]byte("some val"))) - idx, val := vset.GetByAddress([]byte("some val")) - assert.Equal(t, -1, idx) - assert.Nil(t, val) - addr, val := vset.GetByIndex(-100) - assert.Nil(t, addr) - assert.Nil(t, val) - addr, val = vset.GetByIndex(0) - assert.Nil(t, addr) - assert.Nil(t, val) - addr, val = vset.GetByIndex(100) - assert.Nil(t, addr) - assert.Nil(t, val) - assert.Zero(t, vset.Size()) - assert.Equal(t, int64(0), vset.TotalVotingPower()) - assert.Nil(t, vset.GetProposer()) - assert.Nil(t, vset.Hash()) + vset := NewValidatorSet(nil) + assert.Panics(t, func() { vset.IncrementAccum(1) }) - // add - val = randValidator_() - assert.True(t, vset.Add(val)) - assert.True(t, vset.HasAddress(val.Address)) - idx, val2 := vset.GetByAddress(val.Address) - assert.Equal(t, 0, idx) - assert.Equal(t, val, val2) - addr, val2 = vset.GetByIndex(0) - assert.Equal(t, []byte(val.Address), addr) - assert.Equal(t, val, val2) - assert.Equal(t, 1, vset.Size()) - assert.Equal(t, val.VotingPower, vset.TotalVotingPower()) - assert.Equal(t, val, vset.GetProposer()) - assert.NotNil(t, vset.Hash()) - assert.NotPanics(t, func() { vset.IncrementAccum(1) }) + assert.EqualValues(t, vset, vset.Copy()) + assert.False(t, vset.HasAddress([]byte("some val"))) + idx, val := vset.GetByAddress([]byte("some val")) + assert.Equal(t, -1, idx) + assert.Nil(t, val) + addr, val := vset.GetByIndex(-100) + assert.Nil(t, addr) + assert.Nil(t, val) + addr, val = vset.GetByIndex(0) + assert.Nil(t, addr) + assert.Nil(t, val) + addr, val = vset.GetByIndex(100) + assert.Nil(t, addr) + assert.Nil(t, val) + assert.Zero(t, vset.Size()) + assert.Equal(t, int64(0), vset.TotalVotingPower()) + assert.Nil(t, vset.GetProposer()) + assert.Nil(t, vset.Hash()) - // update - assert.False(t, vset.Update(randValidator_())) - val.VotingPower = 100 - assert.True(t, vset.Update(val)) + // add + val = randValidator_() + assert.True(t, vset.Add(val)) + assert.True(t, vset.HasAddress(val.Address)) + idx, val2 := vset.GetByAddress(val.Address) + assert.Equal(t, 0, idx) + assert.Equal(t, val, val2) + addr, val2 = vset.GetByIndex(0) + assert.Equal(t, []byte(val.Address), addr) + assert.Equal(t, val, val2) + assert.Equal(t, 1, vset.Size()) + assert.Equal(t, val.VotingPower, vset.TotalVotingPower()) + assert.Equal(t, val, vset.GetProposer()) + assert.NotNil(t, vset.Hash()) + assert.NotPanics(t, func() { vset.IncrementAccum(1) }) - // remove - val2, removed := vset.Remove(randValidator_().Address) - assert.Nil(t, val2) - assert.False(t, removed) - val2, removed = vset.Remove(val.Address) - assert.Equal(t, val.Address, val2.Address) - assert.True(t, removed) - } + // update + assert.False(t, vset.Update(randValidator_())) + val.VotingPower = 100 + assert.True(t, vset.Update(val)) + + // remove + val2, removed := vset.Remove(randValidator_().Address) + assert.Nil(t, val2) + assert.False(t, removed) + val2, removed = vset.Remove(val.Address) + assert.Equal(t, val.Address, val2.Address) + assert.True(t, removed) } func TestCopy(t *testing.T) { From a657870b3d9d0cbda6387f373827b43d1e06dc21 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 24 Jul 2018 09:42:08 -0400 Subject: [PATCH 021/149] update dockerfile --- test/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 7351ec9d..e2fc3da1 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -26,10 +26,10 @@ RUN make get_vendor_deps COPY . $REPO # install ABCI CLI -RUN cd abci && make install && cd - +RUN make install_abci -RUN go install ./cmd/tendermint -RUN go install ./abci/cmd/abci-cli +# install Tendermint +RUN make install # expose the volume for debugging VOLUME $REPO From 24ae878b9fdd8cbe02359e02ad24aefd9c2885bd Mon Sep 17 00:00:00 2001 From: Ismail Khoffi Date: Wed, 1 Aug 2018 13:29:41 +0200 Subject: [PATCH 022/149] update encoding test to how amino skips empty pointers --- Gopkg.lock | 173 ++++++++++++++++++++++++++++++++++++++----- types/proto3_test.go | 5 -- 2 files changed, 155 insertions(+), 23 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index bf98a0af..bf48ae38 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,48 +3,63 @@ [[projects]] branch = "master" + digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "UT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] branch = "master" + digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" name = "github.com/btcsuite/btcd" packages = ["btcec"] + pruneopts = "UT" revision = "9a2f9524024889e129a5422aca2cff73cb3eabf6" [[projects]] + digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" name = "github.com/btcsuite/btcutil" packages = [ "base58", - "bech32" + "bech32", ] + pruneopts = "UT" revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4" [[projects]] + digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "UT" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] + digest = "1:c7644c73a3d23741fdba8a99b1464e021a224b7e205be497271a8003a15ca41b" name = "github.com/ebuchman/fail-test" packages = ["."] + pruneopts = "UT" revision = "95f809107225be108efcf10a3509e4ea6ceef3c4" [[projects]] + digest = "1:544229a3ca0fb2dd5ebc2896d3d2ff7ce096d9751635301e44e37e761349ee70" name = "github.com/fortytw2/leaktest" packages = ["."] + pruneopts = "UT" revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e" version = "v1.2.0" [[projects]] + digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "github.com/fsnotify/fsnotify" packages = ["."] + pruneopts = "UT" revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" version = "v1.4.7" [[projects]] + digest = "1:a6910e76d4a4aad1481edf7efb7831bd0aae11dddf2f21e5c3f1fe8c7046d3bd" name = "github.com/go-kit/kit" packages = [ "log", @@ -53,24 +68,30 @@ "metrics", "metrics/discard", "metrics/internal/lv", - "metrics/prometheus" + "metrics/prometheus", ] + pruneopts = "UT" revision = "ca4112baa34cb55091301bdc13b1420a122b1b9e" version = "v0.7.0" [[projects]] + digest = "1:31a18dae27a29aa074515e43a443abfd2ba6deb6d69309d8d7ce789c45f34659" name = "github.com/go-logfmt/logfmt" packages = ["."] + pruneopts = "UT" revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" version = "v0.3.0" [[projects]] + digest = "1:c4a2528ccbcabf90f9f3c464a5fc9e302d592861bbfd0b7135a7de8a943d0406" name = "github.com/go-stack/stack" packages = ["."] + pruneopts = "UT" revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc" version = "v1.7.0" [[projects]] + digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -78,37 +99,45 @@ "proto", "protoc-gen-gogo/descriptor", "sortkeys", - "types" + "types", ] + pruneopts = "UT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] + digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" name = "github.com/golang/protobuf" packages = [ "proto", "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "UT" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:4a0c6bb4805508a6287675fac876be2ac1182539ca8a32468d8128882e9d5009" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "UT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] + digest = "1:43dd08a10854b2056e615d1b1d22ac94559d822e1f8b6fcc92c1a1057e85188e" name = "github.com/gorilla/websocket" packages = ["."] + pruneopts = "UT" revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" version = "v1.2.0" [[projects]] branch = "master" + digest = "1:a361611b8c8c75a1091f00027767f7779b29cb37c456a71b8f2604c88057ab40" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -120,153 +149,197 @@ "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] + pruneopts = "UT" revision = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168" [[projects]] + digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] + pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] + digest = "1:39b27d1381a30421f9813967a5866fba35dc1d4df43a6eefe3b7a5444cb07214" name = "github.com/jmhodges/levigo" packages = ["."] + pruneopts = "UT" revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" [[projects]] branch = "master" + digest = "1:a64e323dc06b73892e5bb5d040ced475c4645d456038333883f58934abbf6f72" name = "github.com/kr/logfmt" packages = ["."] + pruneopts = "UT" revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" [[projects]] + digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7" name = "github.com/magiconair/properties" packages = ["."] + pruneopts = "UT" revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" [[projects]] + digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "UT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] branch = "master" + digest = "1:5ab79470a1d0fb19b041a624415612f8236b3c06070161a910562f2b2d064355" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac" [[projects]] + digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e" name = "github.com/pelletier/go-toml" packages = ["."] + pruneopts = "UT" revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" version = "v1.2.0" [[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] + digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "UT" revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632" [[projects]] branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "UT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" + digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "UT" revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" [[projects]] branch = "master" + digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs" + "xfs", ] + pruneopts = "UT" revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] + digest = "1:c4556a44e350b50a490544d9b06e9fba9c286c21d6c0e47f54f3a9214597298c" name = "github.com/rcrowley/go-metrics" packages = ["."] + pruneopts = "UT" revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] + digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" name = "github.com/spf13/afero" packages = [ ".", - "mem" + "mem", ] + pruneopts = "UT" revision = "787d034dfe70e44075ccc060d346146ef53270ad" version = "v1.1.1" [[projects]] + digest = "1:516e71bed754268937f57d4ecb190e01958452336fa73dbac880894164e91c1f" name = "github.com/spf13/cast" packages = ["."] + pruneopts = "UT" revision = "8965335b8c7107321228e3e3702cab9832751bac" version = "v1.2.0" [[projects]] + digest = "1:645cabccbb4fa8aab25a956cbcbdf6a6845ca736b2c64e197ca7cbb9d210b939" name = "github.com/spf13/cobra" packages = ["."] + pruneopts = "UT" revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" version = "v0.0.3" [[projects]] branch = "master" + digest = "1:080e5f630945ad754f4b920e60b4d3095ba0237ebf88dc462eb28002932e3805" name = "github.com/spf13/jwalterweatherman" packages = ["."] + pruneopts = "UT" revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" [[projects]] + digest = "1:9424f440bba8f7508b69414634aef3b2b3a877e522d8a4624692412805407bb7" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "UT" revision = "583c0c0531f06d5278b7d917446061adc344b5cd" version = "v1.0.1" [[projects]] + digest = "1:59e7dceb53b4a1e57eb1eb0bf9951ff0c25912df7660004a789b62b4e8cdca3b" name = "github.com/spf13/viper" packages = ["."] + pruneopts = "UT" revision = "b5e8006cbee93ec955a89ab31e0e3ce3204f3736" version = "v1.0.2" [[projects]] + digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e" name = "github.com/stretchr/testify" packages = [ "assert", - "require" + "require", ] + pruneopts = "UT" revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" [[projects]] branch = "master" + digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -280,28 +353,34 @@ "leveldb/opt", "leveldb/storage", "leveldb/table", - "leveldb/util" + "leveldb/util", ] + pruneopts = "UT" revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445" [[projects]] branch = "master" + digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" name = "github.com/tendermint/ed25519" packages = [ ".", "edwards25519", - "extra25519" + "extra25519", ] + pruneopts = "UT" revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" [[projects]] branch = "jae/writeemptyptr" + digest = "1:2851f999161ce484d09df830edace38654b711228155d476680577f47f2a5bff" name = "github.com/tendermint/go-amino" packages = ["."] + pruneopts = "UT" revision = "8202139066d340b77084a583e176e29fb28b42e9" [[projects]] branch = "master" + digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -317,11 +396,13 @@ "openpgp/errors", "poly1305", "ripemd160", - "salsa20/salsa" + "salsa20/salsa", ] + pruneopts = "UT" revision = "c126467f60eb25f8f27e5a981f32a87e3965053f" [[projects]] + digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" name = "golang.org/x/net" packages = [ "context", @@ -331,20 +412,24 @@ "idna", "internal/timeseries", "netutil", - "trace" + "trace", ] + pruneopts = "UT" revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f" [[projects]] branch = "master" + digest = "1:5a955fee84608f39d7d6474a62cc8d5ec3f4a311b7f21e79c2ba4e1e16169d34" name = "golang.org/x/sys" packages = [ "cpu", - "unix" + "unix", ] + pruneopts = "UT" revision = "bd9dbc187b6e1dacfdd2722a87e83093c2d7bd6e" [[projects]] + digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" name = "golang.org/x/text" packages = [ "collate", @@ -360,17 +445,21 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable" + "unicode/rangetable", ] + pruneopts = "UT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] + digest = "1:cd018653a358d4b743a9d3bee89e825521f2ab2f2ec0770164bf7632d8d73ab7" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] + pruneopts = "UT" revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200" [[projects]] + digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" name = "google.golang.org/grpc" packages = [ ".", @@ -397,20 +486,68 @@ "stats", "status", "tap", - "transport" + "transport", ] + pruneopts = "UT" revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" version = "v1.13.0" [[projects]] + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "cb44aec2727610e0547ee75e2b4602266d85026bb47747f4fb8bdcef4709bdd1" + input-imports = [ + "github.com/btcsuite/btcd/btcec", + "github.com/btcsuite/btcutil/base58", + "github.com/btcsuite/btcutil/bech32", + "github.com/ebuchman/fail-test", + "github.com/fortytw2/leaktest", + "github.com/go-kit/kit/log", + "github.com/go-kit/kit/log/level", + "github.com/go-kit/kit/log/term", + "github.com/go-kit/kit/metrics", + "github.com/go-kit/kit/metrics/discard", + "github.com/go-kit/kit/metrics/prometheus", + "github.com/go-logfmt/logfmt", + "github.com/gogo/protobuf/gogoproto", + "github.com/gogo/protobuf/jsonpb", + "github.com/gogo/protobuf/proto", + "github.com/golang/protobuf/proto", + "github.com/gorilla/websocket", + "github.com/jmhodges/levigo", + "github.com/pkg/errors", + "github.com/prometheus/client_golang/prometheus", + "github.com/prometheus/client_golang/prometheus/promhttp", + "github.com/rcrowley/go-metrics", + "github.com/spf13/cobra", + "github.com/spf13/viper", + "github.com/stretchr/testify/assert", + "github.com/stretchr/testify/require", + "github.com/syndtr/goleveldb/leveldb", + "github.com/syndtr/goleveldb/leveldb/errors", + "github.com/syndtr/goleveldb/leveldb/iterator", + "github.com/syndtr/goleveldb/leveldb/opt", + "github.com/tendermint/ed25519", + "github.com/tendermint/ed25519/extra25519", + "github.com/tendermint/go-amino", + "golang.org/x/crypto/bcrypt", + "golang.org/x/crypto/chacha20poly1305", + "golang.org/x/crypto/hkdf", + "golang.org/x/crypto/nacl/box", + "golang.org/x/crypto/nacl/secretbox", + "golang.org/x/crypto/openpgp/armor", + "golang.org/x/crypto/ripemd160", + "golang.org/x/net/context", + "golang.org/x/net/netutil", + "google.golang.org/grpc", + "google.golang.org/grpc/credentials", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/types/proto3_test.go b/types/proto3_test.go index 19a624a6..50645abf 100644 --- a/types/proto3_test.go +++ b/types/proto3_test.go @@ -67,11 +67,6 @@ func TestProto3Compatibility(t *testing.T) { Height: 150, Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos}, NumTxs: 7, - // This is not fully skipped in amino (yet) although it is empty: - LastBlockID: &proto3.BlockID{ - PartsHeader: &proto3.PartSetHeader{ - }, - }, TotalTxs: 100, LastCommitHash: []byte("commit hash"), DataHash: []byte("data hash"), From f2f53442c6fbf493f92bc8f4fa1efd862f1a89c3 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 1 Aug 2018 16:20:59 +0400 Subject: [PATCH 023/149] reorder `BaseConfig` according to generated version also, add `priv_validator_laddr` to the template --- config/config.go | 57 ++++++++++++++++++++++++------------------------ config/toml.go | 4 ++++ 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/config/config.go b/config/config.go index fb8e7908..27503f53 100644 --- a/config/config.go +++ b/config/config.go @@ -94,7 +94,6 @@ func (cfg *Config) SetRoot(root string) *Config { // BaseConfig defines the base configuration for a Tendermint node type BaseConfig struct { - // chainID is unexposed and immutable but here for convenience chainID string @@ -102,49 +101,49 @@ type BaseConfig struct { // This should be set in viper so it can unmarshal into this struct RootDir string `mapstructure:"home"` - // Path to the JSON file containing the initial validator set and other meta data - Genesis string `mapstructure:"genesis_file"` - - // Path to the JSON file containing the private key to use as a validator in the consensus protocol - PrivValidator string `mapstructure:"priv_validator_file"` - - // A JSON file containing the private key to use for p2p authenticated encryption - NodeKey string `mapstructure:"node_key_file"` - - // A custom human readable name for this node - Moniker string `mapstructure:"moniker"` - - // TCP or UNIX socket address for Tendermint to listen on for - // connections from an external PrivValidator process - PrivValidatorListenAddr string `mapstructure:"priv_validator_laddr"` - // TCP or UNIX socket address of the ABCI application, // or the name of an ABCI application compiled in with the Tendermint binary ProxyApp string `mapstructure:"proxy_app"` - // Mechanism to connect to the ABCI application: socket | grpc - ABCI string `mapstructure:"abci"` - - // Output level for logging - LogLevel string `mapstructure:"log_level"` - - // TCP or UNIX socket address for the profiling server to listen on - ProfListenAddress string `mapstructure:"prof_laddr"` + // A custom human readable name for this node + Moniker string `mapstructure:"moniker"` // If this node is many blocks behind the tip of the chain, FastSync // allows them to catchup quickly by downloading blocks in parallel // and verifying their commits FastSync bool `mapstructure:"fast_sync"` - // If true, query the ABCI app on connecting to a new peer - // so the app can decide if we should keep the connection or not - FilterPeers bool `mapstructure:"filter_peers"` // false - // Database backend: leveldb | memdb DBBackend string `mapstructure:"db_backend"` // Database directory DBPath string `mapstructure:"db_dir"` + + // Output level for logging + LogLevel string `mapstructure:"log_level"` + + // Path to the JSON file containing the initial validator set and other meta data + Genesis string `mapstructure:"genesis_file"` + + // Path to the JSON file containing the private key to use as a validator in the consensus protocol + PrivValidator string `mapstructure:"priv_validator_file"` + + // TCP or UNIX socket address for Tendermint to listen on for + // connections from an external PrivValidator process + PrivValidatorListenAddr string `mapstructure:"priv_validator_laddr"` + + // A JSON file containing the private key to use for p2p authenticated encryption + NodeKey string `mapstructure:"node_key_file"` + + // Mechanism to connect to the ABCI application: socket | grpc + ABCI string `mapstructure:"abci"` + + // TCP or UNIX socket address for the profiling server to listen on + ProfListenAddress string `mapstructure:"prof_laddr"` + + // If true, query the ABCI app on connecting to a new peer + // so the app can decide if we should keep the connection or not + FilterPeers bool `mapstructure:"filter_peers"` // false } // DefaultBaseConfig returns a default base configuration for a Tendermint node diff --git a/config/toml.go b/config/toml.go index 60ce15de..47df2fe5 100644 --- a/config/toml.go +++ b/config/toml.go @@ -94,6 +94,10 @@ genesis_file = "{{ js .BaseConfig.Genesis }}" # Path to the JSON file containing the private key to use as a validator in the consensus protocol priv_validator_file = "{{ js .BaseConfig.PrivValidator }}" +# TCP or UNIX socket address for Tendermint to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "{{ .BaseConfig.PrivValidatorListenAddr }}" + # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node_key_file = "{{ js .BaseConfig.NodeKey}}" From eb9b37e19688b435d7163dcfd134d25b84201eef Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Thu, 2 Aug 2018 01:59:46 -0700 Subject: [PATCH 024/149] Pull out consensus liveness fix, which went to #1815 --- Gopkg.lock | 173 ++++----------------------------------- consensus/common_test.go | 31 +------ consensus/state.go | 17 ++-- consensus/state_test.go | 26 +++--- 4 files changed, 38 insertions(+), 209 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index bf48ae38..bf98a0af 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,63 +3,48 @@ [[projects]] branch = "master" - digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" name = "github.com/beorn7/perks" packages = ["quantile"] - pruneopts = "UT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] branch = "master" - digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" name = "github.com/btcsuite/btcd" packages = ["btcec"] - pruneopts = "UT" revision = "9a2f9524024889e129a5422aca2cff73cb3eabf6" [[projects]] - digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" name = "github.com/btcsuite/btcutil" packages = [ "base58", - "bech32", + "bech32" ] - pruneopts = "UT" revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4" [[projects]] - digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" name = "github.com/davecgh/go-spew" packages = ["spew"] - pruneopts = "UT" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] - digest = "1:c7644c73a3d23741fdba8a99b1464e021a224b7e205be497271a8003a15ca41b" name = "github.com/ebuchman/fail-test" packages = ["."] - pruneopts = "UT" revision = "95f809107225be108efcf10a3509e4ea6ceef3c4" [[projects]] - digest = "1:544229a3ca0fb2dd5ebc2896d3d2ff7ce096d9751635301e44e37e761349ee70" name = "github.com/fortytw2/leaktest" packages = ["."] - pruneopts = "UT" revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e" version = "v1.2.0" [[projects]] - digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "github.com/fsnotify/fsnotify" packages = ["."] - pruneopts = "UT" revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" version = "v1.4.7" [[projects]] - digest = "1:a6910e76d4a4aad1481edf7efb7831bd0aae11dddf2f21e5c3f1fe8c7046d3bd" name = "github.com/go-kit/kit" packages = [ "log", @@ -68,30 +53,24 @@ "metrics", "metrics/discard", "metrics/internal/lv", - "metrics/prometheus", + "metrics/prometheus" ] - pruneopts = "UT" revision = "ca4112baa34cb55091301bdc13b1420a122b1b9e" version = "v0.7.0" [[projects]] - digest = "1:31a18dae27a29aa074515e43a443abfd2ba6deb6d69309d8d7ce789c45f34659" name = "github.com/go-logfmt/logfmt" packages = ["."] - pruneopts = "UT" revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" version = "v0.3.0" [[projects]] - digest = "1:c4a2528ccbcabf90f9f3c464a5fc9e302d592861bbfd0b7135a7de8a943d0406" name = "github.com/go-stack/stack" packages = ["."] - pruneopts = "UT" revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc" version = "v1.7.0" [[projects]] - digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -99,45 +78,37 @@ "proto", "protoc-gen-gogo/descriptor", "sortkeys", - "types", + "types" ] - pruneopts = "UT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] - digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" name = "github.com/golang/protobuf" packages = [ "proto", "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp", + "ptypes/timestamp" ] - pruneopts = "UT" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" - digest = "1:4a0c6bb4805508a6287675fac876be2ac1182539ca8a32468d8128882e9d5009" name = "github.com/golang/snappy" packages = ["."] - pruneopts = "UT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] - digest = "1:43dd08a10854b2056e615d1b1d22ac94559d822e1f8b6fcc92c1a1057e85188e" name = "github.com/gorilla/websocket" packages = ["."] - pruneopts = "UT" revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" version = "v1.2.0" [[projects]] branch = "master" - digest = "1:a361611b8c8c75a1091f00027767f7779b29cb37c456a71b8f2604c88057ab40" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -149,197 +120,153 @@ "hcl/token", "json/parser", "json/scanner", - "json/token", + "json/token" ] - pruneopts = "UT" revision = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168" [[projects]] - digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] - pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] - digest = "1:39b27d1381a30421f9813967a5866fba35dc1d4df43a6eefe3b7a5444cb07214" name = "github.com/jmhodges/levigo" packages = ["."] - pruneopts = "UT" revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" [[projects]] branch = "master" - digest = "1:a64e323dc06b73892e5bb5d040ced475c4645d456038333883f58934abbf6f72" name = "github.com/kr/logfmt" packages = ["."] - pruneopts = "UT" revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" [[projects]] - digest = "1:c568d7727aa262c32bdf8a3f7db83614f7af0ed661474b24588de635c20024c7" name = "github.com/magiconair/properties" packages = ["."] - pruneopts = "UT" revision = "c2353362d570a7bfa228149c62842019201cfb71" version = "v1.8.0" [[projects]] - digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] - pruneopts = "UT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] branch = "master" - digest = "1:5ab79470a1d0fb19b041a624415612f8236b3c06070161a910562f2b2d064355" name = "github.com/mitchellh/mapstructure" packages = ["."] - pruneopts = "UT" revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac" [[projects]] - digest = "1:95741de3af260a92cc5c7f3f3061e85273f5a81b5db20d4bd68da74bd521675e" name = "github.com/pelletier/go-toml" packages = ["."] - pruneopts = "UT" revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" version = "v1.2.0" [[projects]] - digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] - pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] - pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] - digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp", + "prometheus/promhttp" ] - pruneopts = "UT" revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632" [[projects]] branch = "master" - digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] - pruneopts = "UT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" - digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model", + "model" ] - pruneopts = "UT" revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" [[projects]] branch = "master" - digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs", + "xfs" ] - pruneopts = "UT" revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] - digest = "1:c4556a44e350b50a490544d9b06e9fba9c286c21d6c0e47f54f3a9214597298c" name = "github.com/rcrowley/go-metrics" packages = ["."] - pruneopts = "UT" revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" name = "github.com/spf13/afero" packages = [ ".", - "mem", + "mem" ] - pruneopts = "UT" revision = "787d034dfe70e44075ccc060d346146ef53270ad" version = "v1.1.1" [[projects]] - digest = "1:516e71bed754268937f57d4ecb190e01958452336fa73dbac880894164e91c1f" name = "github.com/spf13/cast" packages = ["."] - pruneopts = "UT" revision = "8965335b8c7107321228e3e3702cab9832751bac" version = "v1.2.0" [[projects]] - digest = "1:645cabccbb4fa8aab25a956cbcbdf6a6845ca736b2c64e197ca7cbb9d210b939" name = "github.com/spf13/cobra" packages = ["."] - pruneopts = "UT" revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" version = "v0.0.3" [[projects]] branch = "master" - digest = "1:080e5f630945ad754f4b920e60b4d3095ba0237ebf88dc462eb28002932e3805" name = "github.com/spf13/jwalterweatherman" packages = ["."] - pruneopts = "UT" revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" [[projects]] - digest = "1:9424f440bba8f7508b69414634aef3b2b3a877e522d8a4624692412805407bb7" name = "github.com/spf13/pflag" packages = ["."] - pruneopts = "UT" revision = "583c0c0531f06d5278b7d917446061adc344b5cd" version = "v1.0.1" [[projects]] - digest = "1:59e7dceb53b4a1e57eb1eb0bf9951ff0c25912df7660004a789b62b4e8cdca3b" name = "github.com/spf13/viper" packages = ["."] - pruneopts = "UT" revision = "b5e8006cbee93ec955a89ab31e0e3ce3204f3736" version = "v1.0.2" [[projects]] - digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e" name = "github.com/stretchr/testify" packages = [ "assert", - "require", + "require" ] - pruneopts = "UT" revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" [[projects]] branch = "master" - digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -353,34 +280,28 @@ "leveldb/opt", "leveldb/storage", "leveldb/table", - "leveldb/util", + "leveldb/util" ] - pruneopts = "UT" revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445" [[projects]] branch = "master" - digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" name = "github.com/tendermint/ed25519" packages = [ ".", "edwards25519", - "extra25519", + "extra25519" ] - pruneopts = "UT" revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" [[projects]] branch = "jae/writeemptyptr" - digest = "1:2851f999161ce484d09df830edace38654b711228155d476680577f47f2a5bff" name = "github.com/tendermint/go-amino" packages = ["."] - pruneopts = "UT" revision = "8202139066d340b77084a583e176e29fb28b42e9" [[projects]] branch = "master" - digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -396,13 +317,11 @@ "openpgp/errors", "poly1305", "ripemd160", - "salsa20/salsa", + "salsa20/salsa" ] - pruneopts = "UT" revision = "c126467f60eb25f8f27e5a981f32a87e3965053f" [[projects]] - digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" name = "golang.org/x/net" packages = [ "context", @@ -412,24 +331,20 @@ "idna", "internal/timeseries", "netutil", - "trace", + "trace" ] - pruneopts = "UT" revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f" [[projects]] branch = "master" - digest = "1:5a955fee84608f39d7d6474a62cc8d5ec3f4a311b7f21e79c2ba4e1e16169d34" name = "golang.org/x/sys" packages = [ "cpu", - "unix", + "unix" ] - pruneopts = "UT" revision = "bd9dbc187b6e1dacfdd2722a87e83093c2d7bd6e" [[projects]] - digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" name = "golang.org/x/text" packages = [ "collate", @@ -445,21 +360,17 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable", + "unicode/rangetable" ] - pruneopts = "UT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] - digest = "1:cd018653a358d4b743a9d3bee89e825521f2ab2f2ec0770164bf7632d8d73ab7" name = "google.golang.org/genproto" packages = ["googleapis/rpc/status"] - pruneopts = "UT" revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200" [[projects]] - digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" name = "google.golang.org/grpc" packages = [ ".", @@ -486,68 +397,20 @@ "stats", "status", "tap", - "transport", + "transport" ] - pruneopts = "UT" revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" version = "v1.13.0" [[projects]] - digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] - pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - input-imports = [ - "github.com/btcsuite/btcd/btcec", - "github.com/btcsuite/btcutil/base58", - "github.com/btcsuite/btcutil/bech32", - "github.com/ebuchman/fail-test", - "github.com/fortytw2/leaktest", - "github.com/go-kit/kit/log", - "github.com/go-kit/kit/log/level", - "github.com/go-kit/kit/log/term", - "github.com/go-kit/kit/metrics", - "github.com/go-kit/kit/metrics/discard", - "github.com/go-kit/kit/metrics/prometheus", - "github.com/go-logfmt/logfmt", - "github.com/gogo/protobuf/gogoproto", - "github.com/gogo/protobuf/jsonpb", - "github.com/gogo/protobuf/proto", - "github.com/golang/protobuf/proto", - "github.com/gorilla/websocket", - "github.com/jmhodges/levigo", - "github.com/pkg/errors", - "github.com/prometheus/client_golang/prometheus", - "github.com/prometheus/client_golang/prometheus/promhttp", - "github.com/rcrowley/go-metrics", - "github.com/spf13/cobra", - "github.com/spf13/viper", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/require", - "github.com/syndtr/goleveldb/leveldb", - "github.com/syndtr/goleveldb/leveldb/errors", - "github.com/syndtr/goleveldb/leveldb/iterator", - "github.com/syndtr/goleveldb/leveldb/opt", - "github.com/tendermint/ed25519", - "github.com/tendermint/ed25519/extra25519", - "github.com/tendermint/go-amino", - "golang.org/x/crypto/bcrypt", - "golang.org/x/crypto/chacha20poly1305", - "golang.org/x/crypto/hkdf", - "golang.org/x/crypto/nacl/box", - "golang.org/x/crypto/nacl/secretbox", - "golang.org/x/crypto/openpgp/armor", - "golang.org/x/crypto/ripemd160", - "golang.org/x/net/context", - "golang.org/x/net/netutil", - "google.golang.org/grpc", - "google.golang.org/grpc/credentials", - ] + inputs-digest = "cb44aec2727610e0547ee75e2b4602266d85026bb47747f4fb8bdcef4709bdd1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/consensus/common_test.go b/consensus/common_test.go index 643185ea..e6033537 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "os" "path" - "reflect" "sort" "sync" "testing" @@ -18,14 +17,14 @@ import ( bc "github.com/tendermint/tendermint/blockchain" cfg "github.com/tendermint/tendermint/config" cstypes "github.com/tendermint/tendermint/consensus/types" + cmn "github.com/tendermint/tendermint/libs/common" + dbm "github.com/tendermint/tendermint/libs/db" + "github.com/tendermint/tendermint/libs/log" mempl "github.com/tendermint/tendermint/mempool" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" - dbm "github.com/tendermint/tendermint/libs/db" - "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/abci/example/counter" "github.com/tendermint/tendermint/abci/example/kvstore" @@ -326,30 +325,6 @@ func ensureNewStep(stepCh <-chan interface{}) { } } -func ensureVote(voteCh chan interface{}, height int64, round int, voteType byte) { - timer := time.NewTimer(ensureTimeout) - select { - case <-timer.C: - break - case v := <-voteCh: - edv, ok := v.(types.EventDataVote) - if !ok { - panic(fmt.Sprintf("expected a *types.Vote, got %v. wrong subscription channel?", - reflect.TypeOf(v))) - } - vote := edv.Vote - if vote.Height != height { - panic(fmt.Sprintf("expected height %v, got %v", height, vote.Height)) - } - if vote.Round != round { - panic(fmt.Sprintf("expected round %v, got %v", round, vote.Round)) - } - if vote.Type != voteType { - panic(fmt.Sprintf("expected type %v, got %v", voteType, vote.Type)) - } - } -} - //------------------------------------------------------------------------------- // consensus nets diff --git a/consensus/state.go b/consensus/state.go index 031f5f82..add87691 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1014,11 +1014,9 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - /* - if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) - } - */ + if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { + cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) + } logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { @@ -1587,7 +1585,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, if prevotes.HasTwoThirdsMajority() { cs.enterPrecommit(height, vote.Round) } else { - cs.enterPropose(height, vote.Round) // we can't prevote until we wait for the proposal. + cs.enterPrevote(height, vote.Round) // if the vote is ahead of us cs.enterPrevoteWait(height, vote.Round) } } else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round { @@ -1603,9 +1601,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, blockID, ok := precommits.TwoThirdsMajority() if ok { if len(blockID.Hash) == 0 { - cs.enterNewRound(height, vote.Round) - cs.enterPrecommit(height, vote.Round) - cs.enterPrecommitWait(height, vote.Round) + cs.enterNewRound(height, vote.Round+1) } else { cs.enterNewRound(height, vote.Round) cs.enterPrecommit(height, vote.Round) @@ -1621,8 +1617,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, } } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() { cs.enterNewRound(height, vote.Round) - cs.enterPrevote(height, vote.Round) - cs.enterPrevoteWait(height, vote.Round) + cs.enterPrecommit(height, vote.Round) cs.enterPrecommitWait(height, vote.Round) } default: diff --git a/consensus/state_test.go b/consensus/state_test.go index 425f6fad..6a14e17b 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -64,22 +64,22 @@ func TestStateProposerSelection0(t *testing.T) { startTestRound(cs1, height, round) - // Wait for new round so proposer is set. + // wait for new round so proposer is set <-newRoundCh - // Commit a block and ensure proposer for the next height is correct. + // lets commit a block and ensure proposer for the next height is correct prop := cs1.GetRoundState().Validators.GetProposer() if !bytes.Equal(prop.Address, cs1.privValidator.GetAddress()) { t.Fatalf("expected proposer to be validator %d. Got %X", 0, prop.Address) } - // Wait for complete proposal. + // wait for complete proposal <-proposalCh rs := cs1.GetRoundState() signAddVotes(cs1, types.VoteTypePrecommit, rs.ProposalBlock.Hash(), rs.ProposalBlockParts.Header(), vss[1:]...) - // Wait for new round so next validator is set. + // wait for new round so next validator is set <-newRoundCh prop = cs1.GetRoundState().Validators.GetProposer() @@ -718,8 +718,6 @@ func TestStateLockPOLUnlock(t *testing.T) { func TestStateLockPOLSafety1(t *testing.T) { cs1, vss := randConsensusState(4) vs2, vs3, vs4 := vss[1], vss[2], vss[3] - h := cs1.GetRoundState().Height - r := cs1.GetRoundState().Round partSize := cs1.state.ConsensusParams.BlockPartSizeBytes @@ -736,7 +734,7 @@ func TestStateLockPOLSafety1(t *testing.T) { rs := re.(types.EventDataRoundState).RoundState.(*cstypes.RoundState) propBlock := rs.ProposalBlock - ensureVote(voteCh, h, r, types.VoteTypePrevote) + <-voteCh // prevote validatePrevote(t, cs1, 0, vss[0], propBlock.Hash()) @@ -757,11 +755,6 @@ func TestStateLockPOLSafety1(t *testing.T) { // we do see them precommit nil signAddVotes(cs1, types.VoteTypePrecommit, nil, types.PartSetHeader{}, vs2, vs3, vs4) - ensureVote(voteCh, h, r, types.VoteTypePrecommit) - - <-newRoundCh - t.Log("### ONTO ROUND 1") - prop, propBlock := decideProposal(cs1, vs2, vs2.Height, vs2.Round+1) propBlockHash := propBlock.Hash() propBlockParts := propBlock.MakePartSet(partSize) @@ -772,6 +765,9 @@ func TestStateLockPOLSafety1(t *testing.T) { if err := cs1.SetProposalAndBlock(prop, propBlock, propBlockParts, "some peer"); err != nil { t.Fatal(err) } + + <-newRoundCh + t.Log("### ONTO ROUND 1") /*Round2 // we timeout and prevote our lock // a polka happened but we didn't see it! @@ -792,13 +788,13 @@ func TestStateLockPOLSafety1(t *testing.T) { } t.Logf("new prop hash %v", fmt.Sprintf("%X", propBlockHash)) // go to prevote, prevote for proposal block - ensureVote(voteCh, h, r+1, types.VoteTypePrevote) + <-voteCh validatePrevote(t, cs1, 1, vss[0], propBlockHash) // now we see the others prevote for it, so we should lock on it signAddVotes(cs1, types.VoteTypePrevote, propBlockHash, propBlockParts.Header(), vs2, vs3, vs4) - ensureVote(voteCh, h, r+1, types.VoteTypePrecommit) + <-voteCh // precommit // we should have precommitted validatePrecommit(t, cs1, 1, 1, vss[0], propBlockHash, propBlockHash) @@ -820,7 +816,7 @@ func TestStateLockPOLSafety1(t *testing.T) { <-timeoutProposeCh // finish prevote - ensureVote(voteCh, h, r+2, types.VoteTypePrevote) + <-voteCh // we should prevote what we're locked on validatePrevote(t, cs1, 2, vss[0], propBlockHash) From e719a93d1d1490a5f724978c09c8d084c0790c21 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Thu, 2 Aug 2018 03:10:50 -0700 Subject: [PATCH 025/149] Addressed review for #1815 except those marked as 'TODO make issue' --- CHANGELOG.md | 2 +- Gopkg.lock | 4 +- cmd/tendermint/commands/lite.go | 6 +- lite/{base_certifier.go => base_verifier.go} | 30 +++---- ...ertifier_test.go => base_verifier_test.go} | 6 +- lite/client/provider.go | 8 +- lite/client/provider_test.go | 12 --- lite/commit.go | 2 +- lite/dbprovider.go | 64 +++++++------ lite/doc.go | 18 ++-- ...iring_certifier.go => dynamic_verifier.go} | 90 +++++++++---------- ...ifier_test.go => dynamic_verifier_test.go} | 8 +- lite/errors/errors.go | 16 ++-- lite/multiprovider.go | 4 +- lite/proxy/query.go | 8 +- lite/proxy/query_test.go | 4 +- lite/proxy/{certifier.go => verifier.go} | 8 +- lite/proxy/wrapper.go | 8 +- lite/types.go | 6 +- types/block.go | 2 +- types/validator_set.go | 5 ++ 21 files changed, 154 insertions(+), 157 deletions(-) rename lite/{base_certifier.go => base_verifier.go} (63%) rename lite/{base_certifier_test.go => base_verifier_test.go} (89%) rename lite/{inquiring_certifier.go => dynamic_verifier.go} (64%) rename lite/{inquiring_certifier_test.go => dynamic_verifier_test.go} (95%) rename lite/proxy/{certifier.go => verifier.go} (73%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d5656b..99c51a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -556,7 +556,7 @@ BREAKING CHANGES: - use scripts/wal2json to convert to json for debugging FEATURES: - - new `certifiers` pkg contains the tendermint light-client library (name subject to change)! + - new `Verifiers` pkg contains the tendermint light-client library (name subject to change)! - rpc: `/genesis` includes the `app_options` . - rpc: `/abci_query` takes an additional `height` parameter to support historical queries. - rpc/client: new ABCIQueryWithOptions supports options like `trusted` (set false to get a proof) and `height` to query a historical height. diff --git a/Gopkg.lock b/Gopkg.lock index bf98a0af..31d04b36 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,7 +11,7 @@ branch = "master" name = "github.com/btcsuite/btcd" packages = ["btcec"] - revision = "9a2f9524024889e129a5422aca2cff73cb3eabf6" + revision = "f5e261fc9ec3437697fb31d8b38453c293204b29" [[projects]] name = "github.com/btcsuite/btcutil" @@ -342,7 +342,7 @@ "cpu", "unix" ] - revision = "bd9dbc187b6e1dacfdd2722a87e83093c2d7bd6e" + revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" [[projects]] name = "golang.org/x/text" diff --git a/cmd/tendermint/commands/lite.go b/cmd/tendermint/commands/lite.go index 14d584b7..edad4fbb 100644 --- a/cmd/tendermint/commands/lite.go +++ b/cmd/tendermint/commands/lite.go @@ -68,10 +68,10 @@ func runProxy(cmd *cobra.Command, args []string) error { logger.Info("Connecting to source HTTP client...") node := rpcclient.NewHTTP(nodeAddr, "/websocket") - logger.Info("Constructing certifier...") - cert, err := proxy.NewCertifier(chainID, home, node, logger) + logger.Info("Constructing Verifier...") + cert, err := proxy.NewVerifier(chainID, home, node, logger) if err != nil { - return cmn.ErrorWrap(err, "constructing certifier") + return cmn.ErrorWrap(err, "constructing Verifier") } cert.SetLogger(logger) sc := proxy.SecureClient(node, cert) diff --git a/lite/base_certifier.go b/lite/base_verifier.go similarity index 63% rename from lite/base_certifier.go rename to lite/base_verifier.go index 0f9faba3..e60d3953 100644 --- a/lite/base_certifier.go +++ b/lite/base_verifier.go @@ -3,48 +3,48 @@ package lite import ( "bytes" + cmn "github.com/tendermint/tendermint/libs/common" lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) -var _ Certifier = (*BaseCertifier)(nil) +var _ Verifier = (*BaseVerifier)(nil) -// BaseCertifier lets us check the validity of SignedHeaders at height or +// BaseVerifier lets us check the validity of SignedHeaders at height or // later, requiring sufficient votes (> 2/3) from the given valset. // To certify blocks produced by a blockchain with mutable validator sets, -// use the InquiringCertifier. +// use the DynamicVerifier. // TODO: Handle unbonding time. -type BaseCertifier struct { +type BaseVerifier struct { chainID string height int64 valset *types.ValidatorSet } -// NewBaseCertifier returns a new certifier initialized with a validator set at +// NewBaseVerifier returns a new Verifier initialized with a validator set at // some height. -func NewBaseCertifier(chainID string, height int64, valset *types.ValidatorSet) *BaseCertifier { - if valset == nil || len(valset.Hash()) == 0 { - panic("NewBaseCertifier requires a valid valset") +func NewBaseVerifier(chainID string, height int64, valset *types.ValidatorSet) *BaseVerifier { + if valset.IsNilOrEmpty() { + panic("NewBaseVerifier requires a valid valset") } - return &BaseCertifier{ + return &BaseVerifier{ chainID: chainID, height: height, valset: valset, } } -// Implements Certifier. -func (bc *BaseCertifier) ChainID() string { +// Implements Verifier. +func (bc *BaseVerifier) ChainID() string { return bc.chainID } -// Implements Certifier. -func (bc *BaseCertifier) Certify(signedHeader types.SignedHeader) error { +// Implements Verifier. +func (bc *BaseVerifier) Certify(signedHeader types.SignedHeader) error { // We can't certify commits older than bc.height. if signedHeader.Height < bc.height { - return cmn.NewError("BaseCertifier height is %v, cannot certify height %v", + return cmn.NewError("BaseVerifier height is %v, cannot certify height %v", bc.height, signedHeader.Height) } diff --git a/lite/base_certifier_test.go b/lite/base_verifier_test.go similarity index 89% rename from lite/base_certifier_test.go rename to lite/base_verifier_test.go index 20342c90..dab7885f 100644 --- a/lite/base_certifier_test.go +++ b/lite/base_verifier_test.go @@ -10,16 +10,14 @@ import ( ) func TestBaseCert(t *testing.T) { - // assert, require := assert.New(t), require.New(t) assert := assert.New(t) - // require := require.New(t) keys := genPrivKeys(4) // 20, 30, 40, 50 - the first 3 don't have 2/3, the last 3 do! vals := keys.ToValidators(20, 10) - // and a certifier based on our known set + // and a Verifier based on our known set chainID := "test-static" - cert := NewBaseCertifier(chainID, 2, vals) + cert := NewBaseVerifier(chainID, 2, vals) cases := []struct { keys privKeys diff --git a/lite/client/provider.go b/lite/client/provider.go index 8087be71..e0c0a331 100644 --- a/lite/client/provider.go +++ b/lite/client/provider.go @@ -8,12 +8,12 @@ package client import ( "fmt" + log "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/lite" lerr "github.com/tendermint/tendermint/lite/errors" rpcclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tendermint/libs/log" ) // SignStatusClient combines a SignClient and StatusClient. @@ -106,12 +106,10 @@ func (p *provider) getValidatorSet(chainID string, height int64) (valset *types. err = fmt.Errorf("expected height >= 1, got height %v", height) return } - heightPtr := new(int64) - *heightPtr = height - res, err := p.client.Validators(heightPtr) + res, err := p.client.Validators(&height) if err != nil { // TODO pass through other types of errors. - return nil, lerr.ErrMissingValidators(chainID, height) + return nil, lerr.ErrUnknownValidators(chainID, height) } valset = types.NewValidatorSet(res.Validators) return diff --git a/lite/client/provider_test.go b/lite/client/provider_test.go index f4da423f..d8704a52 100644 --- a/lite/client/provider_test.go +++ b/lite/client/provider_test.go @@ -13,7 +13,6 @@ import ( "github.com/tendermint/tendermint/types" ) -// TODO fix tests!! func TestMain(m *testing.M) { app := kvstore.NewKVStoreApplication() node := rpctest.StartTendermint(app) @@ -59,15 +58,4 @@ func TestProvider(t *testing.T) { assert.Nil(err, "%+v", err) assert.Equal(lower, fc.Height()) - /* - // also get by hash (given the match) - fc, err = p.GetByHash(vhash) - require.Nil(err, "%+v", err) - require.Equal(vhash, fc.Header.ValidatorsHash) - - // get by hash fails without match - fc, err = p.GetByHash([]byte("foobar")) - assert.NotNil(err) - assert.True(liteErr.IsCommitNotFoundErr(err)) - */ } diff --git a/lite/commit.go b/lite/commit.go index 89f04417..25efb8dc 100644 --- a/lite/commit.go +++ b/lite/commit.go @@ -11,7 +11,7 @@ import ( // FullCommit is a signed header (the block header and a commit that signs it), // the validator set which signed the commit, and the next validator set. The // next validator set (which is proven from the block header) allows us to -// revert to block-by-block updating of lite certifier's latest validator set, +// revert to block-by-block updating of lite Verifier's latest validator set, // even in the face of arbitrarily large power changes. type FullCommit struct { SignedHeader types.SignedHeader `json:"signed_header"` diff --git a/lite/dbprovider.go b/lite/dbprovider.go index 8392fcea..cab695b4 100644 --- a/lite/dbprovider.go +++ b/lite/dbprovider.go @@ -22,7 +22,10 @@ type DBProvider struct { } func NewDBProvider(label string, db dbm.DB) *DBProvider { + + // NOTE: when debugging, this type of construction might be useful. //db = dbm.NewDebugDB("db provider "+cmn.RandStr(4), db) + cdc := amino.NewCodec() cryptoAmino.RegisterAmino(cdc) dbp := &DBProvider{ @@ -127,8 +130,8 @@ func (dbp *DBProvider) LatestFullCommit(chainID string, minHeight, maxHeight int dbp.logger.Info("DBProvider.LatestFullCommit() found latest.", "height", lfc.Height()) return lfc, nil } else { - dbp.logger.Info("DBProvider.LatestFullCommit() got error", "lfc", lfc) - dbp.logger.Info(fmt.Sprintf("%+v", err)) + dbp.logger.Error("DBProvider.LatestFullCommit() got error", "lfc", lfc) + dbp.logger.Error(fmt.Sprintf("%+v", err)) return lfc, err } } @@ -144,14 +147,19 @@ func (dbp *DBProvider) ValidatorSet(chainID string, height int64) (valset *types func (dbp *DBProvider) getValidatorSet(chainID string, height int64) (valset *types.ValidatorSet, err error) { vsBz := dbp.db.Get(validatorSetKey(chainID, height)) if vsBz == nil { - err = lerr.ErrMissingValidators(chainID, height) + err = lerr.ErrUnknownValidators(chainID, height) return } err = dbp.cdc.UnmarshalBinary(vsBz, &valset) if err != nil { return } - valset.TotalVotingPower() // to test deep equality. + + // To test deep equality. This makes it easier to test for e.g. valset + // equivalence using assert.Equal (tests for deep equality) in our tests, + // which also tests for unexported/private field equivalence. + valset.TotalVotingPower() + return } @@ -209,52 +217,52 @@ func (dbp *DBProvider) deleteAfterN(chainID string, after int) error { itr.Next() } - dbp.logger.Info(fmt.Sprintf("DBProvider.deleteAfterN() deleted %v items\n", numDeleted)) + dbp.logger.Info(fmt.Sprintf("DBProvider.deleteAfterN() deleted %v items", numDeleted)) return nil } //---------------------------------------- +// key encoding func signedHeaderKey(chainID string, height int64) []byte { return []byte(fmt.Sprintf("%s/%010d/sh", chainID, height)) } -var signedHeaderKeyPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/sh`) - -func parseSignedHeaderKey(key []byte) (chainID string, height int64, ok bool) { - submatch := signedHeaderKeyPattern.FindSubmatch(key) - if submatch == nil { - return "", 0, false - } - chainID = string(submatch[1]) - heightStr := string(submatch[2]) - heightInt, err := strconv.Atoi(heightStr) - if err != nil { - return "", 0, false - } - height = int64(heightInt) - ok = true // good! - return -} - func validatorSetKey(chainID string, height int64) []byte { return []byte(fmt.Sprintf("%s/%010d/vs", chainID, height)) } -var chainKeyPrefixPattern = regexp.MustCompile(`([^/]+)/([0-9]*)/`) +//---------------------------------------- +// key parsing -func parseChainKeyPrefix(key []byte) (chainID string, height int64, ok bool) { - submatch := chainKeyPrefixPattern.FindSubmatch(key) +var keyPattern = regexp.MustCompile(`^([^/]+)/([0-9]*)/(.*)$`) + +func parseKey(key []byte) (chainID string, height int64, part string, ok bool) { + submatch := keyPattern.FindSubmatch(key) if submatch == nil { - return "", 0, false + return "", 0, "", false } chainID = string(submatch[1]) heightStr := string(submatch[2]) heightInt, err := strconv.Atoi(heightStr) if err != nil { - return "", 0, false + return "", 0, "", false } height = int64(heightInt) + part = string(submatch[3]) ok = true // good! return } + +func parseSignedHeaderKey(key []byte) (chainID string, height int64, ok bool) { + chainID, height, part, ok := parseKey(key) + if part != "sh" { + return "", 0, false + } + return chainID, height, true +} + +func parseChainKeyPrefix(key []byte) (chainID string, height int64, ok bool) { + chainID, height, _, ok = parseKey(key) + return chainID, height, true +} diff --git a/lite/doc.go b/lite/doc.go index 07977ebe..59f77056 100644 --- a/lite/doc.go +++ b/lite/doc.go @@ -35,29 +35,29 @@ change on the chain. In practice, most applications will not have frequent drastic updates to the validator set, so the logic defined in this package for lite client syncing is optimized to use intelligent bisection and block-skipping for efficient sourcing and verification of these data structures -and updates to the validator set (see the InquiringCertifier for more +and updates to the validator set (see the DynamicVerifier for more information). The FullCommit is also declared in this package as a convenience structure, which includes the SignedHeader along with the full current and next ValidatorSets. -## Certifier +## Verifier -A Certifier validates a new SignedHeader given the currently known state. There -are two different types of Certifiers provided. +A Verifier validates a new SignedHeader given the currently known state. There +are two different types of Verifiers provided. -BaseCertifier - given a validator set and a height, this Certifier verifies +BaseVerifier - given a validator set and a height, this Verifier verifies that > 2/3 of the voting power of the given validator set had signed the SignedHeader, and that the SignedHeader was to be signed by the exact given validator set, and that the height of the commit is at least height (or greater). SignedHeader.Commit may be signed by a different validator set, it can get -certified with a BaseCertifier as long as sufficient signatures from the +certified with a BaseVerifier as long as sufficient signatures from the previous validator set are present in the commit. -InquiringCertifier - this certifier implements an auto-update and persistence +DynamicVerifier - this Verifier implements an auto-update and persistence strategy to certify any SignedHeader of the blockchain. ## Provider and PersistentProvider @@ -77,7 +77,7 @@ type Provider interface { * client.NewHTTPProvider - query Tendermint rpc. A PersistentProvider is a Provider that also allows for saving state. This is -used by the InquiringCertifier for persistence. +used by the DynamicVerifier for persistence. ```go type PersistentProvider interface { @@ -131,7 +131,7 @@ important to verify that you have the proper validator set when initializing the client, as that is the root of all trust. The software currently assumes that the unbonding period is infinite in -duration. If the InquiringCertifier hasn't been updated in a while, you should +duration. If the DynamicVerifier hasn't been updated in a while, you should manually verify the block headers using other sources. TODO: Update the software to handle cases around the unbonding period. diff --git a/lite/inquiring_certifier.go b/lite/dynamic_verifier.go similarity index 64% rename from lite/inquiring_certifier.go rename to lite/dynamic_verifier.go index 31637447..3d1a70f2 100644 --- a/lite/inquiring_certifier.go +++ b/lite/dynamic_verifier.go @@ -3,18 +3,18 @@ package lite import ( "bytes" + log "github.com/tendermint/tendermint/libs/log" lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tendermint/libs/log" ) -var _ Certifier = (*InquiringCertifier)(nil) +var _ Verifier = (*DynamicVerifier)(nil) -// InquiringCertifier implements an auto-updating certifier. It uses a +// DynamicVerifier implements an auto-updating Verifier. It uses a // "source" provider to obtain the needed FullCommits to securely sync with // validator set changes. It stores properly validated data on the // "trusted" local system. -type InquiringCertifier struct { +type DynamicVerifier struct { logger log.Logger chainID string // These are only properly validated data, from local system. @@ -23,14 +23,14 @@ type InquiringCertifier struct { source Provider } -// NewInquiringCertifier returns a new InquiringCertifier. It uses the +// NewDynamicVerifier returns a new DynamicVerifier. It uses the // trusted provider to store validated data and the source provider to // obtain missing data (e.g. FullCommits). // // The trusted provider should a CacheProvider, MemProvider or // files.Provider. The source provider should be a client.HTTPProvider. -func NewInquiringCertifier(chainID string, trusted PersistentProvider, source Provider) *InquiringCertifier { - return &InquiringCertifier{ +func NewDynamicVerifier(chainID string, trusted PersistentProvider, source Provider) *DynamicVerifier { + return &DynamicVerifier{ logger: log.NewNopLogger(), chainID: chainID, trusted: trusted, @@ -38,64 +38,64 @@ func NewInquiringCertifier(chainID string, trusted PersistentProvider, source Pr } } -func (ic *InquiringCertifier) SetLogger(logger log.Logger) { +func (ic *DynamicVerifier) SetLogger(logger log.Logger) { logger = logger.With("module", "lite") ic.logger = logger ic.trusted.SetLogger(logger) ic.source.SetLogger(logger) } -// Implements Certifier. -func (ic *InquiringCertifier) ChainID() string { +// Implements Verifier. +func (ic *DynamicVerifier) ChainID() string { return ic.chainID } -// Implements Certifier. +// Implements Verifier. // -// If the validators have changed since the last know time, it looks to +// If the validators have changed since the last known time, it looks to // ic.trusted and ic.source to prove the new validators. On success, it will // try to store the SignedHeader in ic.trusted if the next // validator can be sourced. -func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { +func (ic *DynamicVerifier) Certify(shdr types.SignedHeader) error { // Get the latest known full commit <= h-1 from our trusted providers. // The full commit at h-1 contains the valset to sign for h. h := shdr.Height - 1 - tfc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) + trustedFC, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) if err != nil { return err } - if tfc.Height() == h { + if trustedFC.Height() == h { // Return error if valset doesn't match. if !bytes.Equal( - tfc.NextValidators.Hash(), + trustedFC.NextValidators.Hash(), shdr.Header.ValidatorsHash) { return lerr.ErrUnexpectedValidators( - tfc.NextValidators.Hash(), + trustedFC.NextValidators.Hash(), shdr.Header.ValidatorsHash) } } else { // If valset doesn't match... - if !bytes.Equal(tfc.NextValidators.Hash(), + if !bytes.Equal(trustedFC.NextValidators.Hash(), shdr.Header.ValidatorsHash) { // ... update. - tfc, err = ic.updateToHeight(h) + trustedFC, err = ic.updateToHeight(h) if err != nil { return err } // Return error if valset _still_ doesn't match. - if !bytes.Equal(tfc.NextValidators.Hash(), + if !bytes.Equal(trustedFC.NextValidators.Hash(), shdr.Header.ValidatorsHash) { return lerr.ErrUnexpectedValidators( - tfc.NextValidators.Hash(), + trustedFC.NextValidators.Hash(), shdr.Header.ValidatorsHash) } } } // Certify the signed header using the matching valset. - cert := NewBaseCertifier(ic.chainID, tfc.Height()+1, tfc.NextValidators) + cert := NewBaseVerifier(ic.chainID, trustedFC.Height()+1, trustedFC.NextValidators) err = cert.Certify(shdr) if err != nil { return err @@ -103,7 +103,7 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { // Get the next validator set. nextValset, err := ic.source.ValidatorSet(ic.chainID, shdr.Height+1) - if lerr.IsErrMissingValidators(err) { + if lerr.IsErrUnknownValidators(err) { // Ignore this error. return nil } else if err != nil { @@ -113,7 +113,7 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { // Create filled FullCommit. nfc := FullCommit{ SignedHeader: shdr, - Validators: tfc.NextValidators, + Validators: trustedFC.NextValidators, NextValidators: nextValset, } // Validate the full commit. This checks the cryptographic @@ -127,22 +127,22 @@ func (ic *InquiringCertifier) Certify(shdr types.SignedHeader) error { // verifyAndSave will verify if this is a valid source full commit given the // best match trusted full commit, and if good, persist to ic.trusted. -// Returns ErrTooMuchChange when >2/3 of tfc did not sign sfc. -// Panics if tfc.Height() >= sfc.Height(). -func (ic *InquiringCertifier) verifyAndSave(tfc, sfc FullCommit) error { - if tfc.Height() >= sfc.Height() { +// Returns ErrTooMuchChange when >2/3 of trustedFC did not sign sourceFC. +// Panics if trustedFC.Height() >= sourceFC.Height(). +func (ic *DynamicVerifier) verifyAndSave(trustedFC, sourceFC FullCommit) error { + if trustedFC.Height() >= sourceFC.Height() { panic("should not happen") } - err := tfc.NextValidators.VerifyFutureCommit( - sfc.Validators, - ic.chainID, sfc.SignedHeader.Commit.BlockID, - sfc.SignedHeader.Height, sfc.SignedHeader.Commit, + err := trustedFC.NextValidators.VerifyFutureCommit( + sourceFC.Validators, + ic.chainID, sourceFC.SignedHeader.Commit.BlockID, + sourceFC.SignedHeader.Height, sourceFC.SignedHeader.Commit, ) if err != nil { return err } - return ic.trusted.SaveFullCommit(sfc) + return ic.trusted.SaveFullCommit(sourceFC) } // updateToHeight will use divide-and-conquer to find a path to h. @@ -150,48 +150,48 @@ func (ic *InquiringCertifier) verifyAndSave(tfc, sfc FullCommit) error { // for height h, using repeated applications of bisection if necessary. // // Returns ErrCommitNotFound if source provider doesn't have the commit for h. -func (ic *InquiringCertifier) updateToHeight(h int64) (FullCommit, error) { +func (ic *DynamicVerifier) updateToHeight(h int64) (FullCommit, error) { // Fetch latest full commit from source. - sfc, err := ic.source.LatestFullCommit(ic.chainID, h, h) + sourceFC, err := ic.source.LatestFullCommit(ic.chainID, h, h) if err != nil { return FullCommit{}, err } // Validate the full commit. This checks the cryptographic // signatures of Commit against Validators. - if err := sfc.ValidateFull(ic.chainID); err != nil { + if err := sourceFC.ValidateFull(ic.chainID); err != nil { return FullCommit{}, err } - // If sfc.Height() != h, we can't do it. - if sfc.Height() != h { + // If sourceFC.Height() != h, we can't do it. + if sourceFC.Height() != h { return FullCommit{}, lerr.ErrCommitNotFound() } FOR_LOOP: for { // Fetch latest full commit from trusted. - tfc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) + trustedFC, err := ic.trusted.LatestFullCommit(ic.chainID, 1, h) if err != nil { return FullCommit{}, err } // We have nothing to do. - if tfc.Height() == h { - return tfc, nil + if trustedFC.Height() == h { + return trustedFC, nil } // Try to update to full commit with checks. - err = ic.verifyAndSave(tfc, sfc) + err = ic.verifyAndSave(trustedFC, sourceFC) if err == nil { // All good! - return sfc, nil + return sourceFC, nil } // Handle special case when err is ErrTooMuchChange. if lerr.IsErrTooMuchChange(err) { // Divide and conquer. - start, end := tfc.Height(), sfc.Height() + start, end := trustedFC.Height(), sourceFC.Height() if !(start < end) { panic("should not happen") } @@ -207,7 +207,7 @@ FOR_LOOP: } } -func (ic *InquiringCertifier) LastTrustedHeight() int64 { +func (ic *DynamicVerifier) LastTrustedHeight() int64 { fc, err := ic.trusted.LatestFullCommit(ic.chainID, 1, 1<<63-1) if err != nil { panic("should not happen") diff --git a/lite/inquiring_certifier_test.go b/lite/dynamic_verifier_test.go similarity index 95% rename from lite/inquiring_certifier_test.go rename to lite/dynamic_verifier_test.go index 5eb63727..74e2d55a 100644 --- a/lite/inquiring_certifier_test.go +++ b/lite/dynamic_verifier_test.go @@ -41,10 +41,10 @@ func TestInquirerValidPath(t *testing.T) { nkeys = nkeys.Extend(1) } - // Initialize a certifier with the initial state. + // Initialize a Verifier with the initial state. err := trust.SaveFullCommit(fcz[0]) require.Nil(err) - cert := NewInquiringCertifier(chainID, trust, source) + cert := NewDynamicVerifier(chainID, trust, source) cert.SetLogger(log.TestingLogger()) // This should fail validation: @@ -99,10 +99,10 @@ func TestInquirerVerifyHistorical(t *testing.T) { nkeys = nkeys.Extend(1) } - // Initialize a certifier with the initial state. + // Initialize a Verifier with the initial state. err := trust.SaveFullCommit(fcz[0]) require.Nil(err) - cert := NewInquiringCertifier(chainID, trust, source) + cert := NewDynamicVerifier(chainID, trust, source) cert.SetLogger(log.TestingLogger()) // Store a few full commits as trust. diff --git a/lite/errors/errors.go b/lite/errors/errors.go index 96a5a02a..61426b23 100644 --- a/lite/errors/errors.go +++ b/lite/errors/errors.go @@ -31,12 +31,12 @@ func (e errTooMuchChange) Error() string { return "Insufficient signatures to validate due to valset changes" } -type errMissingValidators struct { +type errUnknownValidators struct { chainID string height int64 } -func (e errMissingValidators) Error() string { +func (e errUnknownValidators) Error() string { return fmt.Sprintf("Validators are unknown or missing for chain %s and height %d", e.chainID, e.height) } @@ -96,16 +96,16 @@ func IsErrTooMuchChange(err error) bool { } //----------------- -// ErrMissingValidators +// ErrUnknownValidators -// ErrMissingValidators indicates that some validator set was missing or unknown. -func ErrMissingValidators(chainID string, height int64) error { - return cmn.ErrorWrap(errMissingValidators{chainID, height}, "") +// ErrUnknownValidators indicates that some validator set was missing or unknown. +func ErrUnknownValidators(chainID string, height int64) error { + return cmn.ErrorWrap(errUnknownValidators{chainID, height}, "") } -func IsErrMissingValidators(err error) bool { +func IsErrUnknownValidators(err error) bool { if err_, ok := err.(cmn.Error); ok { - _, ok := err_.Data().(errMissingValidators) + _, ok := err_.Data().(errUnknownValidators) return ok } return false diff --git a/lite/multiprovider.go b/lite/multiprovider.go index 991a12d7..734d042c 100644 --- a/lite/multiprovider.go +++ b/lite/multiprovider.go @@ -1,9 +1,9 @@ package lite import ( + log "github.com/tendermint/tendermint/libs/log" lerr "github.com/tendermint/tendermint/lite/errors" "github.com/tendermint/tendermint/types" - log "github.com/tendermint/tendermint/libs/log" ) // multiProvider allows you to place one or more caches in front of a source @@ -79,5 +79,5 @@ func (mc *multiProvider) ValidatorSet(chainID string, height int64) (valset *typ return valset, nil } } - return nil, lerr.ErrMissingValidators(chainID, height) + return nil, lerr.ErrUnknownValidators(chainID, height) } diff --git a/lite/proxy/query.go b/lite/proxy/query.go index a7132223..6f5a2899 100644 --- a/lite/proxy/query.go +++ b/lite/proxy/query.go @@ -28,13 +28,13 @@ type KeyProof interface { } // GetWithProof will query the key on the given node, and verify it has -// a valid proof, as defined by the certifier. +// a valid proof, as defined by the Verifier. // // If there is any error in checking, returns an error. // If val is non-empty, proof should be KeyExistsProof // If val is empty, proof should be KeyMissingProof func GetWithProof(key []byte, reqHeight int64, node rpcclient.Client, - cert lite.Certifier) ( + cert lite.Verifier) ( val cmn.HexBytes, height int64, proof KeyProof, err error) { if reqHeight < 0 { @@ -54,7 +54,7 @@ func GetWithProof(key []byte, reqHeight int64, node rpcclient.Client, // GetWithProofOptions is useful if you want full access to the ABCIQueryOptions func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOptions, - node rpcclient.Client, cert lite.Certifier) ( + node rpcclient.Client, cert lite.Verifier) ( *ctypes.ResultABCIQuery, KeyProof, error) { _resp, err := node.ABCIQueryWithOptions(path, key, opts) @@ -128,7 +128,7 @@ func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOption // GetCertifiedCommit gets the signed header for a given height and certifies // it. Returns error if unable to get a proven header. -func GetCertifiedCommit(h int64, client rpcclient.Client, cert lite.Certifier) (types.SignedHeader, error) { +func GetCertifiedCommit(h int64, client rpcclient.Client, cert lite.Verifier) (types.SignedHeader, error) { // FIXME: cannot use cert.GetByHeight for now, as it also requires // Validators and will fail on querying tendermint for non-current height. diff --git a/lite/proxy/query_test.go b/lite/proxy/query_test.go index fcc6659a..7f759cc6 100644 --- a/lite/proxy/query_test.go +++ b/lite/proxy/query_test.go @@ -58,7 +58,7 @@ func _TestAppProofs(t *testing.T) { source := certclient.NewProvider(chainID, cl) seed, err := source.LatestFullCommit(chainID, brh-2, brh-2) require.NoError(err, "%+v", err) - cert := lite.NewBaseCertifier("my-chain", seed.Height(), seed.Validators) + cert := lite.NewBaseVerifier("my-chain", seed.Height(), seed.Validators) client.WaitForHeight(cl, 3, nil) latest, err := source.LatestFullCommit(chainID, 1, 1<<63-1) @@ -117,7 +117,7 @@ func _TestTxProofs(t *testing.T) { source := certclient.NewProvider(chainID, cl) seed, err := source.LatestFullCommit(chainID, brh-2, brh-2) require.NoError(err, "%+v", err) - cert := lite.NewBaseCertifier("my-chain", seed.Height(), seed.Validators) + cert := lite.NewBaseVerifier("my-chain", seed.Height(), seed.Validators) // First let's make sure a bogus transaction hash returns a valid non-existence proof. key := types.Tx([]byte("bogus")).Hash() diff --git a/lite/proxy/certifier.go b/lite/proxy/verifier.go similarity index 73% rename from lite/proxy/certifier.go rename to lite/proxy/verifier.go index bd09b1ab..6686def0 100644 --- a/lite/proxy/certifier.go +++ b/lite/proxy/verifier.go @@ -8,10 +8,10 @@ import ( log "github.com/tendermint/tendermint/libs/log" ) -func NewCertifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger) (*lite.InquiringCertifier, error) { +func NewVerifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger) (*lite.DynamicVerifier, error) { logger = logger.With("module", "lite/proxy") - logger.Info("lite/proxy/NewCertifier()...", "chainID", chainID, "rootDir", rootDir, "client", client) + logger.Info("lite/proxy/NewVerifier()...", "chainID", chainID, "rootDir", rootDir, "client", client) memProvider := lite.NewDBProvider("trusted.mem", dbm.NewMemDB()).SetLimit(10) lvlProvider := lite.NewDBProvider("trusted.lvl", dbm.NewDB("trust-base", dbm.LevelDBBackend, rootDir)) @@ -20,13 +20,13 @@ func NewCertifier(chainID, rootDir string, client lclient.SignStatusClient, logg lvlProvider, ) source := lclient.NewProvider(chainID, client) - cert := lite.NewInquiringCertifier(chainID, trust, source) + cert := lite.NewDynamicVerifier(chainID, trust, source) cert.SetLogger(logger) // Sets logger recursively. // TODO: Make this more secure, e.g. make it interactive in the console? _, err := trust.LatestFullCommit(chainID, 1, 1<<63-1) if err != nil { - logger.Info("lite/proxy/NewCertifier found no trusted full commit, initializing from source from height 1...") + logger.Info("lite/proxy/NewVerifier found no trusted full commit, initializing from source from height 1...") fc, err := source.LatestFullCommit(chainID, 1, 1) if err != nil { return nil, cmn.ErrorWrap(err, "fetching source full commit @ height 1") diff --git a/lite/proxy/wrapper.go b/lite/proxy/wrapper.go index ac1d1dbc..522511a8 100644 --- a/lite/proxy/wrapper.go +++ b/lite/proxy/wrapper.go @@ -10,18 +10,18 @@ import ( var _ rpcclient.Client = Wrapper{} -// Wrapper wraps a rpcclient with a Certifier and double-checks any input that is +// Wrapper wraps a rpcclient with a Verifier and double-checks any input that is // provable before passing it along. Allows you to make any rpcclient fully secure. type Wrapper struct { rpcclient.Client - cert *lite.InquiringCertifier + cert *lite.DynamicVerifier } -// SecureClient uses a given certifier to wrap an connection to an untrusted +// SecureClient uses a given Verifier to wrap an connection to an untrusted // host and return a cryptographically secure rpc client. // // If it is wrapping an HTTP rpcclient, it will also wrap the websocket interface -func SecureClient(c rpcclient.Client, cert *lite.InquiringCertifier) Wrapper { +func SecureClient(c rpcclient.Client, cert *lite.DynamicVerifier) Wrapper { wrap := Wrapper{c, cert} // TODO: no longer possible as no more such interface exposed.... // if we wrap http client, then we can swap out the event switch to filter diff --git a/lite/types.go b/lite/types.go index 1f479799..7228c74a 100644 --- a/lite/types.go +++ b/lite/types.go @@ -4,10 +4,10 @@ import ( "github.com/tendermint/tendermint/types" ) -// Certifier checks the votes to make sure the block really is signed properly. -// Certifier must know the current or recent set of validitors by some other +// Verifier checks the votes to make sure the block really is signed properly. +// Verifier must know the current or recent set of validitors by some other // means. -type Certifier interface { +type Verifier interface { Certify(sheader types.SignedHeader) error ChainID() string } diff --git a/types/block.go b/types/block.go index 0b64c7b8..c112ee50 100644 --- a/types/block.go +++ b/types/block.go @@ -446,7 +446,7 @@ type SignedHeader struct { // and commit are consistent. // // NOTE: This does not actually check the cryptographic signatures. Make -// sure to use a Certifier to validate the signatures actually provide a +// sure to use a Verifier to validate the signatures actually provide a // significantly strong proof for this header's validity. func (sh SignedHeader) ValidateBasic(chainID string) error { diff --git a/types/validator_set.go b/types/validator_set.go index 6d580ace..4dab4d84 100644 --- a/types/validator_set.go +++ b/types/validator_set.go @@ -48,6 +48,11 @@ func NewValidatorSet(valz []*Validator) *ValidatorSet { return vals } +// Nil or empty validator sets are invalid. +func (vals *ValidatorSet) IsNilOrEmpty() bool { + return vals == nil || len(vals.Validators) == 0 +} + // Increment Accum and update the proposer on a copy, and return it. func (vals *ValidatorSet) CopyIncrementAccum(times int) *ValidatorSet { copy := vals.Copy() From 00ebdcd5819c0be39ceb08f276cf4f9c9f425ddd Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 24 Jul 2018 10:27:20 -0400 Subject: [PATCH 026/149] update pending changelog --- CHANGELOG_PENDING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index c51a2ab6..1e002049 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -3,6 +3,12 @@ BREAKING CHANGES: - [types] CanonicalTime uses nanoseconds instead of clipping to ms - breaks serialization/signing of all messages with a timestamp +- [types] Header ... +- [state] Add NextValidatorSet, changes on-disk representation of state +- [state] Validator set changes are delayed by one block (!) +- [lite] Complete refactor of the package +- [rpc] `/commit` returns a `signed_header` field instead of everything being + top-level IMPROVEMENTS: - [blockchain] Improve fast-sync logic From fe5e7808f283203a7fa3db5ddee30255a35f1675 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 2 Aug 2018 19:15:32 -0400 Subject: [PATCH 027/149] fix Gopkg.lock --- Gopkg.lock | 111 ++++++++++++++--------------------------------------- 1 file changed, 29 insertions(+), 82 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index fc34e799..8e567aaf 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,18 +11,14 @@ [[projects]] branch = "master" - digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" + digest = "1:6aabc1566d6351115d561d038da82a4c19b46c3b6e17f4a0a2fa60260663dc79" name = "github.com/btcsuite/btcd" packages = ["btcec"] -<<<<<<< HEAD - revision = "f5e261fc9ec3437697fb31d8b38453c293204b29" -======= pruneopts = "UT" - revision = "9a2f9524024889e129a5422aca2cff73cb3eabf6" ->>>>>>> origin/develop + revision = "cf05f92c3f815bbd5091ed6c73eff51f7b1945e8" [[projects]] - digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" + digest = "1:df684ed7fed3fb406ec421424aaf5fc9c63ccc2f428b25b842da78e634482e4b" name = "github.com/btcsuite/btcutil" packages = [ "base58", @@ -63,7 +59,7 @@ version = "v1.4.7" [[projects]] - digest = "1:fdf5169073fb0ad6dc12a70c249145e30f4058647bea25f0abd48b6d9f228a11" + digest = "1:fa30c0652956e159cdb97dcb2ef8b8db63ed668c02a5c3a40961c8f0641252fe" name = "github.com/go-kit/kit" packages = [ "log", @@ -74,14 +70,9 @@ "metrics/internal/lv", "metrics/prometheus", ] -<<<<<<< HEAD - revision = "ca4112baa34cb55091301bdc13b1420a122b1b9e" - version = "v0.7.0" -======= pruneopts = "UT" revision = "4dc7be5d2d12881735283bcab7352178e190fc71" version = "v0.6.0" ->>>>>>> origin/develop [[projects]] digest = "1:31a18dae27a29aa074515e43a443abfd2ba6deb6d69309d8d7ce789c45f34659" @@ -100,7 +91,7 @@ version = "v1.7.0" [[projects]] - digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" + digest = "1:212285efb97b9ec2e20550d81f0446cb7897e57cbdfd7301b1363ab113d8be45" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -110,15 +101,12 @@ "sortkeys", "types", ] -<<<<<<< HEAD -======= pruneopts = "UT" ->>>>>>> origin/develop revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] - digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" + digest = "1:cb22af0ed7c72d495d8be1106233ee553898950f15fd3f5404406d44c2e86888" name = "github.com/golang/protobuf" packages = [ "proto", @@ -149,13 +137,12 @@ [[projects]] branch = "master" - digest = "1:12247a2e99a060cc692f6680e5272c8adf0b8f572e6bce0d7095e624c958a240" + digest = "1:8951fe6e358876736d8fa1f3992624fdbb2dec6bc49401c1381d1ef8abbb544f" name = "github.com/hashicorp/hcl" packages = [ ".", "hcl/ast", "hcl/parser", - "hcl/printer", "hcl/scanner", "hcl/strconv", "hcl/token", @@ -207,8 +194,10 @@ [[projects]] branch = "master" + digest = "1:5ab79470a1d0fb19b041a624415612f8236b3c06070161a910562f2b2d064355" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "f15292f7a699fcc1a38a80977f80a046874ba8ac" [[projects]] @@ -236,7 +225,7 @@ version = "v1.0.0" [[projects]] - digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" + digest = "1:98225904b7abff96c052b669b25788f18225a36673fba022fb93514bb9a2a64e" name = "github.com/prometheus/client_golang" packages = [ "prometheus", @@ -247,33 +236,27 @@ [[projects]] branch = "master" -<<<<<<< HEAD -======= - digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" ->>>>>>> origin/develop + digest = "1:0f37e09b3e92aaeda5991581311f8dbf38944b36a3edec61cc2d1991f527554a" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "UT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" - digest = "1:e469cd65badf7694aeb44874518606d93c1d59e7735d3754ad442782437d3cc3" + digest = "1:dad2e5a2153ee7a6c9ab8fc13673a16ee4fb64434a7da980965a3741b0c981a3" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", "model", ] -<<<<<<< HEAD - revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" -======= pruneopts = "UT" - revision = "7600349dcfe1abd18d72d3a1770870d9800a7801" ->>>>>>> origin/develop + revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" [[projects]] branch = "master" - digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" + digest = "1:a37c98f4b7a66bb5c539c0539f0915a74ef1c8e0b3b6f45735289d94cae92bfd" name = "github.com/prometheus/procfs" packages = [ ".", @@ -281,10 +264,7 @@ "nfs", "xfs", ] -<<<<<<< HEAD -======= pruneopts = "UT" ->>>>>>> origin/develop revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] @@ -295,7 +275,7 @@ revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" + digest = "1:37ace7f35375adec11634126944bdc45a673415e2fcc07382d03b75ec76ea94c" name = "github.com/spf13/afero" packages = [ ".", @@ -314,17 +294,12 @@ version = "v1.2.0" [[projects]] - digest = "1:7ffc0983035bc7e297da3688d9fe19d60a420e9c38bef23f845c53788ed6a05e" + digest = "1:627ab2f549a6a55c44f46fa24a4307f4d0da81bfc7934ed0473bf38b24051d26" name = "github.com/spf13/cobra" packages = ["."] -<<<<<<< HEAD - revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" - version = "v0.0.3" -======= pruneopts = "UT" revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" version = "v0.0.1" ->>>>>>> origin/develop [[projects]] branch = "master" @@ -346,34 +321,24 @@ digest = "1:f8e1a678a2571e265f4bf91a3e5e32aa6b1474a55cb0ea849750cc177b664d96" name = "github.com/spf13/viper" packages = ["."] -<<<<<<< HEAD - revision = "b5e8006cbee93ec955a89ab31e0e3ce3204f3736" - version = "v1.0.2" -======= pruneopts = "UT" revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7" version = "v1.0.0" ->>>>>>> origin/develop [[projects]] - digest = "1:7e8d267900c7fa7f35129a2a37596e38ed0f11ca746d6d9ba727980ee138f9f6" + digest = "1:73697231b93fb74a73ebd8384b68b9a60c57ea6b13c56d2425414566a72c8e6d" name = "github.com/stretchr/testify" packages = [ "assert", "require", ] -<<<<<<< HEAD - revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" - version = "v1.2.2" -======= pruneopts = "UT" revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" ->>>>>>> origin/develop [[projects]] branch = "master" - digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" + digest = "1:922191411ad8f61bcd8018ac127589bb489712c1d1a0ab2497aca4b16de417d2" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -394,7 +359,7 @@ [[projects]] branch = "master" - digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" + digest = "1:203b409c21115233a576f99e8f13d8e07ad82b25500491f7e1cca12588fb3232" name = "github.com/tendermint/ed25519" packages = [ ".", @@ -405,23 +370,16 @@ revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" [[projects]] -<<<<<<< HEAD branch = "jae/writeemptyptr" - name = "github.com/tendermint/go-amino" - packages = ["."] - revision = "8202139066d340b77084a583e176e29fb28b42e9" -======= - digest = "1:e9113641c839c21d8eaeb2c907c7276af1eddeed988df8322168c56b7e06e0e1" + digest = "1:2851f999161ce484d09df830edace38654b711228155d476680577f47f2a5bff" name = "github.com/tendermint/go-amino" packages = ["."] pruneopts = "UT" - revision = "2106ca61d91029c931fd54968c2bb02dc96b1412" - version = "0.10.1" ->>>>>>> origin/develop + revision = "8202139066d340b77084a583e176e29fb28b42e9" [[projects]] branch = "master" - digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" + digest = "1:df132ec33d5acb4a1ab58d637f1bc3557be49456ca59b9198f5c1e7fa32e0d31" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -439,14 +397,11 @@ "ripemd160", "salsa20/salsa", ] -<<<<<<< HEAD -======= pruneopts = "UT" ->>>>>>> origin/develop - revision = "c126467f60eb25f8f27e5a981f32a87e3965053f" + revision = "56440b844dfe139a8ac053f4ecac0b20b79058f4" [[projects]] - digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" + digest = "1:04dda8391c3e2397daf254ac68003f30141c069b228d06baec8324a5f81dc1e9" name = "golang.org/x/net" packages = [ "context", @@ -463,21 +418,17 @@ [[projects]] branch = "master" - digest = "1:12ff7b51d336ea7e8b182aa3313679a37d53de64f84d2c3cbfd6a0237877e20a" + digest = "1:8cf61f10625f94b618d574224a437fc22ca0f300a3bc03ecab23ab81d478e95c" name = "golang.org/x/sys" packages = [ "cpu", "unix", ] -<<<<<<< HEAD - revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" -======= pruneopts = "UT" - revision = "e072cadbbdc8dd3d3ffa82b8b4b9304c261d9311" ->>>>>>> origin/develop + revision = "0ffbfd41fbef8ffcf9b62b0b0aa3a5873ed7a4fe" [[projects]] - digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" + digest = "1:7509ba4347d1f8de6ae9be8818b0cd1abc3deeffe28aeaf4be6d4b6b5178d9ca" name = "golang.org/x/text" packages = [ "collate", @@ -507,7 +458,7 @@ revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200" [[projects]] - digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" + digest = "1:4515e3030c440845b046354fd5d57671238428b820deebce2e9dabb5cd3c51ac" name = "google.golang.org/grpc" packages = [ ".", @@ -551,9 +502,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 -<<<<<<< HEAD - inputs-digest = "cb44aec2727610e0547ee75e2b4602266d85026bb47747f4fb8bdcef4709bdd1" -======= input-imports = [ "github.com/btcsuite/btcd/btcec", "github.com/btcsuite/btcutil/base58", @@ -603,6 +551,5 @@ "google.golang.org/grpc", "google.golang.org/grpc/credentials", ] ->>>>>>> origin/develop solver-name = "gps-cdcl" solver-version = 1 From 96fdec0fcadd2260277f16ad7d96ed342d6110d1 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Thu, 2 Aug 2018 23:18:09 -0700 Subject: [PATCH 028/149] crypto: Add compact bit array for intended usage in the multisig This is in a separate PR for ease of review. --- crypto/multisig/compact_bit_array.go | 218 ++++++++++++++++++++++ crypto/multisig/compact_bit_array_test.go | 169 +++++++++++++++++ 2 files changed, 387 insertions(+) create mode 100644 crypto/multisig/compact_bit_array.go create mode 100644 crypto/multisig/compact_bit_array_test.go diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go new file mode 100644 index 00000000..d14dd8e6 --- /dev/null +++ b/crypto/multisig/compact_bit_array.go @@ -0,0 +1,218 @@ +package multisig + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "regexp" + "strings" +) + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after amino encoding. +// This is not thread safe, and is not intended for concurrent usage. +type CompactBitArray struct { + ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. + Elems []byte `json:"bits"` +} + +// NewCompactBitArray returns a new compact bit array. +// It returns nil if the number of bits is zero. +func NewCompactBitArray(bits int) *CompactBitArray { + if bits <= 0 { + return nil + } + return &CompactBitArray{ + ExtraBitsStored: byte(bits % 8), + Elems: make([]byte, (bits+7)/8), + } +} + +// Size returns the number of bits in the bitarray +func (bA *CompactBitArray) Size() int { + if bA == nil { + return 0 + } else if bA.ExtraBitsStored == byte(0) { + return len(bA.Elems) * 8 + } + return (len(bA.Elems)-1)*8 + int(bA.ExtraBitsStored) +} + +// GetIndex returns the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) GetIndex(i int) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + return bA.Elems[i>>3]&(uint8(1)< 0 +} + +// SetIndex sets the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) SetIndex(i int, v bool) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + if v { + bA.Elems[i>>3] |= (uint8(1) << uint8(7-(i%8))) + } else { + bA.Elems[i>>3] &= ^(uint8(1) << uint8(7-(i%8))) + } + return true +} + +// Copy returns a copy of the provided bit array. +func (bA *CompactBitArray) Copy() *CompactBitArray { + if bA == nil { + return nil + } + c := make([]byte, len(bA.Elems)) + copy(c, bA.Elems) + return &CompactBitArray{ + ExtraBitsStored: bA.ExtraBitsStored, + Elems: c, + } +} + +// String returns a string representation of CompactBitArray: BA{}, +// where is a sequence of 'x' (1) and '_' (0). +// The includes spaces and newlines to help people. +// For a simple sequence of 'x' and '_' characters with no spaces or newlines, +// see the MarshalJSON() method. +// Example: "BA{_x_}" or "nil-BitArray" for nil. +func (bA *CompactBitArray) String() string { + return bA.StringIndented("") +} + +// StringIndented returns the same thing as String(), but applies the indent +// at every 10th bit, and twice at every 50th bit. +func (bA *CompactBitArray) StringIndented(indent string) string { + if bA == nil { + return "nil-BitArray" + } + lines := []string{} + bits := "" + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += "x" + } else { + bits += "_" + } + if i%100 == 99 { + lines = append(lines, bits) + bits = "" + } + if i%10 == 9 { + bits += indent + } + if i%50 == 49 { + bits += indent + } + } + if len(bits) > 0 { + lines = append(lines, bits) + } + return fmt.Sprintf("BA{%v:%v}", size, strings.Join(lines, indent)) +} + +// MarshalJSON implements json.Marshaler interface by marshaling bit array +// using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit. +func (bA *CompactBitArray) MarshalJSON() ([]byte, error) { + if bA == nil { + return []byte("null"), nil + } + + bits := `"` + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += `x` + } else { + bits += `_` + } + } + bits += `"` + return []byte(bits), nil +} + +var bitArrayJSONRegexp = regexp.MustCompile(`\A"([_x]*)"\z`) + +// UnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom +// JSON description. +func (bA *CompactBitArray) UnmarshalJSON(bz []byte) error { + b := string(bz) + if b == "null" { + // This is required e.g. for encoding/json when decoding + // into a pointer with pre-allocated BitArray. + bA.ExtraBitsStored = 0 + bA.Elems = nil + return nil + } + + // Validate 'b'. + match := bitArrayJSONRegexp.FindStringSubmatch(b) + if match == nil { + return fmt.Errorf("BitArray in JSON should be a string of format %q but got %s", bitArrayJSONRegexp.String(), b) + } + bits := match[1] + + // Construct new CompactBitArray and copy over. + numBits := len(bits) + bA2 := NewCompactBitArray(numBits) + for i := 0; i < numBits; i++ { + if bits[i] == 'x' { + bA2.SetIndex(i, true) + } + } + *bA = *bA2 + return nil +} + +// CompactMarshal is a space efficient encoding for CompactBitArray. +// It is not amino compatible. +func (bA *CompactBitArray) CompactMarshal() []byte { + size := bA.Size() + if size <= 0 { + return []byte("null") + } + bz := make([]byte, 0, size/8) + // length prefix number of bits, not number of bytes. This difference + // takes 3-4 bits in encoding, as opposed to instead encoding the number of + // bytes (saving 3-4 bits) and including the offset as a full byte. + bz = appendUvarint(bz, uint64(size)) + bz = append(bz, bA.Elems...) + return bz +} + +// CompactUnmarshal is a space efficient decoding for CompactBitArray. +// It is not amino compatible. +func CompactUnmarshal(bz []byte) (*CompactBitArray, error) { + if len(bz) < 2 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } else if bytes.Equal(bz, []byte("null")) { + return NewCompactBitArray(0), nil + } + size, n := binary.Uvarint(bz) + bz = bz[n:] + if len(bz) != int(size+7)/8 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } + + bA := &CompactBitArray{byte(int(size % 8)), bz} + return bA, nil +} + +func appendUvarint(b []byte, x uint64) []byte { + var a [binary.MaxVarintLen64]byte + n := binary.PutUvarint(a[:], x) + return append(b, a[:n]...) +} diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go new file mode 100644 index 00000000..91a82192 --- /dev/null +++ b/crypto/multisig/compact_bit_array_test.go @@ -0,0 +1,169 @@ +package multisig + +import ( + "encoding/json" + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + cmn "github.com/tendermint/tendermint/libs/common" +) + +func randCompactBitArray(bits int) (*CompactBitArray, []byte) { + numBytes := (bits + 7) / 8 + src := cmn.RandBytes((bits + 7) / 8) + bA := NewCompactBitArray(bits) + + for i := 0; i < numBytes-1; i++ { + for j := uint8(0); j < 8; j++ { + bA.SetIndex(i*8+int(j), src[i]&(uint8(1)<<(8-j)) > 0) + } + } + // Set remaining bits + for i := uint8(0); i < 8-uint8(bA.ExtraBitsStored); i++ { + bA.SetIndex(numBytes*8+int(i), src[numBytes-1]&(uint8(1)<<(8-i)) > 0) + } + return bA, src +} + +func TestNewBitArrayNeverCrashesOnNegatives(t *testing.T) { + bitList := []int{-127, -128, -1 << 31} + for _, bits := range bitList { + _ = NewCompactBitArray(bits) + } +} + +func TestJSONMarshalUnmarshal(t *testing.T) { + + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA string + }{ + {nil, `null`}, + {bA1, `null`}, + {bA2, `"_"`}, + {bA3, `"x"`}, + {bA4, `"xx___"`}, + {bA5, `"xx______x"`}, + {bA6, `"xx_____________x"`}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz, err := json.Marshal(tc.bA) + require.NoError(t, err) + + assert.Equal(t, tc.marshalledBA, string(bz)) + + var unmarshalledBA *CompactBitArray + err = json.Unmarshal(bz, &unmarshalledBA) + require.NoError(t, err) + + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactMarshalUnmarshal(t *testing.T) { + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA []byte + }{ + {nil, []byte("null")}, + {bA1, []byte("null")}, + {bA2, []byte{byte(1), byte(0)}}, + {bA3, []byte{byte(1), byte(128)}}, + {bA4, []byte{byte(5), byte(192)}}, + {bA5, []byte{byte(9), byte(192), byte(128)}}, + {bA6, []byte{byte(16), byte(192), byte(1)}}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz := tc.bA.CompactMarshal() + + assert.Equal(t, tc.marshalledBA, bz) + + unmarshalledBA, err := CompactUnmarshal(bz) + require.NoError(t, err) + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactBitArrayGetSetIndex(t *testing.T) { + r := rand.New(rand.NewSource(100)) + numTests := 10 + numBitsPerArr := 100 + for i := 0; i < numTests; i++ { + bits := r.Intn(1000) + bA, _ := randCompactBitArray(bits) + + for j := 0; j < numBitsPerArr; j++ { + copy := bA.Copy() + index := r.Intn(bits) + val := (r.Int63() % 2) == 0 + bA.SetIndex(index, val) + require.Equal(t, val, bA.GetIndex(index), "bA.SetIndex(%d, %v) failed on bit array: %s", index, val, copy) + } + } +} From ae2238efe64457b5b832998042ec2b5802b59c64 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 3 Aug 2018 20:21:40 -0400 Subject: [PATCH 029/149] adr: protocol versioning --- .../architecture/adr-016-protocol-versions.md | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 docs/architecture/adr-016-protocol-versions.md diff --git a/docs/architecture/adr-016-protocol-versions.md b/docs/architecture/adr-016-protocol-versions.md new file mode 100644 index 00000000..636cb181 --- /dev/null +++ b/docs/architecture/adr-016-protocol-versions.md @@ -0,0 +1,306 @@ +# ADR 016: Protocol Versions + +## TODO + +- How to / should we version the authenticated encryption handshake itself (ie. + upfront protocol negotiation for the P2PVersion) + +## Changelog + +- 03-08-2018: Updates from discussion with Jae: + - ProtocolVersion contains Block/AppVersion, not Current/Next + - signal upgrades to Tendermint using EndBlock fields + - dont restrict peer compatibilty by version to simplify syncing old nodes +- 28-07-2018: Updates from review + - split into two ADRs - one for protocol, one for chains + - include signalling for upgrades in header +- 16-07-2018: Initial draft - was originally joint ADR for protocol and chain +versions + +## Context + +The Software Version is covered by SemVer and described elsewhere. +It is not relevant to the protocol description, suffice to say that if any protocol version +changes, the software version changes, but not necessarily vice versa. + +Software version shoudl be included in NodeInfo for convenience/diagnostics. + +We are also interested in versioning across different blockchains in a +meaningful way, for instance to differentiate branches of a contentious +hard-fork. We leave that for a later ADR. + +Here we focus on protocol versions. + +## Requirements + +We need to version components of the blockchain that may be independently upgraded. +We need to do it in a way that is scalable and maintainable - we can't just litter +the code with conditionals. + +We can consider the complete version of the protocol to contain the following sub-versions: +BlockVersion, P2PVersion, AppVersion. These versions reflect the major sub-components +of the software that are likely to evolve together, at different rates, and in different ways, +as described below. + +The BlockVersion defines the core of the blockchain data structures and +should change infrequently. + +The P2PVersion defines how peers connect and communicate with eachother - it's +not part of the blockchain data structures, but defines the protocols used to build the +blockchain. It may change gradually. + +The AppVersion determines how we compute app specific information, like the +AppHash and the Results. + +All of these versions may change over the life of a blockchain, and we need to +be able to help new nodes sync up across version changes. This means we must be willing +to connect to peers with older version. + +### BlockVersion + +- All tendermint hashed data-structures (headers, votes, txs, responses, etc.). + - Note the semantic meaning of a transaction may change according to the AppVersion, + but the way txs are merklized into the header is part of the BlockVersion +- It should be the least frequent/likely to change. + - Tendermint should be stabilizing - it's just Atomic Broadcast. + - We can start considering for Tendermint v2.0 in a year +- It's easy to determine the version of a block from its serialized form + +### P2PVersion + +- All p2p and reactor messaging (messages, detectable behaviour) +- Will change gradually as reactors evolve to improve performance and support new features + - eg proposed new message types BatchTx in the mempool and HasBlockPart in the consensus +- It's easy to determine the version of a peer from its first serialized message/s +- New versions must be compatible with at least one old version to allow gradual upgrades + +### AppVersion + +- The ABCI state machine (txs, begin/endblock behaviour, commit hashing) +- Behaviour and message types will change abruptly in the course of the life of a chain +- Need to minimize complexity of the code for supporting different AppVersions at different heights +- Ideally, each version of the software supports only a *single* AppVersion at one time + - this means we checkout different versions of the software at different heights instead of littering the code + with conditionals + - minimize the number of data migrations required across AppVersion (ie. most AppVersion should be able to read the same state from disk as previous AppVersion). + +## Ideal + +Each component of the software is independently versioned in a modular way and its easy to mix and match and upgrade. + +Good luck pal ;) + +## Proposal + +Each of BlockVersion, AppVersion, P2PVersion is a monotonically increasing int64. + +To use these versions, we need to update the block Header, the p2p NodeInfo, and the ABCI. + +### Header + +Block Header should include a `Version` struct as its first field like: + +``` +type Version struct { + CurrentVersion ProtocolVersion + ChainID string + + NextVersion ProtocolVersion +} + +type ProtocolVersion struct { + BlockVersion int64 + AppVersion int64 +} +``` + +Note this effectively makes BlockVersion the first field in the block Header. +Since we have settled on a proto3 header, the ability to read the BlockVersion out of the serialized header is unanimous. + +Using a Version struct gives us more flexibility to add fields without breaking +the header. + +The ProtocolVersion struct includes both the Block and App versions - it should +serve as a complete description of the consensus-critical protocol. +Using the `NextVersion` field, proposer's can signal their readiness to upgrade +to a new Block and/or App version. + + +### NodeInfo + +NodeInfo should include a Version struct as its first field like: + +``` +type Version struct { + P2PVersion int64 + + ChainID string + BlockVersion int64 + AppVersion int64 + SoftwareVersion string +} +``` + +Note this effectively makes P2PVersion the first field in the NodeInfo, so it +should be easy to read this out of the serialized header if need be to facilitate an upgrade. + +The SoftwareVersion here should include the name of the software client and +it's SemVer version - this is for convenience only. Eg. +`tendermint-core/v0.22.8`. + +The other versions and ChainID will determine peer compatibility (described below). + + +### ABCI + +Since the ABCI is responsible for keeping Tendermint and the App in sync, we +need to communicate version information through it. + +On startup, we use Info to perform a basic handshake. It should include all the +version information. + +We also need to be able to update versions in the life of a blockchain. The +natural place to do this is EndBlock. + +#### Info + +RequestInfo should add support for protocol versions like: + +``` +message RequestInfo { + string software_version + int64 block_version + int64 p2p_version +} +``` + +Similarly, ResponseInfo should return the versions: + +``` +message ResponseInfo { + string data + + string software_version + int64 app_version + + int64 last_block_height + bytes last_block_app_hash +} +``` + +#### EndBlock + +Updating the version could be done either with new fields or by using the +existing `tags`. Since we're trying to communicate information that will be +included in Tendermint block Headers, it should be native to the ABCI, and not +something embedded through some scheme in the tags. + +ResponseEndBlock will include a new field `version_updates`: + +``` +message ResponseEndBlock { + repeated Validator validator_updates + ConsensusParams consensus_param_updates + repeated common.KVPair tags + + VersionUpdates version_updates +} + +message VersionUpdates { + ProtocolVersion current_version + ProtocolVersion next_version +} + +message ProtocolVersion { + int64 block_version + int64 app_version +} +``` + +Tendermint will use the information in VersionUpdates for the next block it +proposes. + +### BlockVersion + +BlockVersion is included in both the Header and the NodeInfo. + +Changing BlockVersion should happen quite infrequently and ideally only for extreme emergency. + +Note Ethereum has not had to make an upgrade like this (everything has been at state machine level, AFAIK). + +### P2PVersion + +P2PVersion is not included in the block Header, just the NodeInfo. + +P2PVersion is the first field in the NodeInfo. NodeInfo is also proto3 so this is easy to read out. + +Note we need the peer/reactor protocols to take the versions of peers into account when sending messages: + +- don't send messages they don't understand +- don't send messages they don't expect + +Doing this will be specific to the upgrades being made. + +Note we also include the list of reactor channels in the NodeInfo and already don't send messages for channels the peer doesn't understand. +If upgrades always use new channels, this simplifies the development cost of backwards compatibility. + +Note NodeInfo is only exchanged after the authenticated encryption handshake to ensure that it's private. +Doing any version exchange before encrypting could be considered information leakage, though I'm not sure +how much that matters compared to being able to upgrade the protocol. + +XXX: if needed, can we change the meaning of the first byte of the first message to encode a handshake version? +this is the first byte of a 32-byte ed25519 pubkey. + +### AppVersion + +AppVersion is also included in the block Header and the NodeInfo. + +AppVersion essentially defines how the AppHash and Results are computed. + +### Peer Compatibility + +Restricting peer compatibility based on version is complicated by the need to +help old peers, possibly on older versions, sync the blockchain. + +We might be tempted to say that we only connect to peers with the same +AppVersion and BlockVersion (since these define the consensus critical +computations), and a select list of P2PVersions (ie. those compatible with +ours), but then we'd need to make accomodations for connecting to peers with the +right Block/AppVersion for the height they're on. + +For now, we will connect to peers with any version and restrict compatibility +solely based on the ChainID. We leave more restrictive rules on peer +compatibiltiy to a future proposal. + +### Future Changes + +It may be valuable to support an `/unsafe_stop?height=_` endpoint to tell Tendermint to shutdown at a given height. +This could be use by an external manager process that oversees upgrades by +checking out and installing new software versions and restarting the process. It +would subscribe to the relevant upgrade event (needs to be implemented) and call `/unsafe_stop` at +the correct height (of course only after getting approval from its user!) + + +## Consequences + +### Positive + +- Make tendermint and application versions native to the ABCI to more clearly + communicate about them +- Distinguish clearly between protocol versions and software version to + facilitate implementations in other languages +- Versions included in key data structures in easy to discern way +- Allows proposers to signal for upgrades and apps to decide when to actually change the + version (and start signalling for a new version) + +### Neutral + +- Unclear how to version the initial P2P handshake itself +- Versions aren't being used (yet) to restrict peer compatibility +- Signalling for a new version happens through the proposer and must be + tallied/tracked in the app. + +### Negative + +- Adds more fields to the ABCI +- Implies that a single codebase must be able to handle multiple versions From 0f80a7da825e7734af007a0678e0925739689d69 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 3 Aug 2018 20:23:37 -0400 Subject: [PATCH 030/149] adr: chain-versions --- docs/architecture/adr-017-chain-versions.md | 100 ++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 docs/architecture/adr-017-chain-versions.md diff --git a/docs/architecture/adr-017-chain-versions.md b/docs/architecture/adr-017-chain-versions.md new file mode 100644 index 00000000..4be7e6e5 --- /dev/null +++ b/docs/architecture/adr-017-chain-versions.md @@ -0,0 +1,100 @@ +# ADR 017: Chain Versions + +## TODO + +- clarify how to handle slashing when ChainID changes + +## Changelog + +- 28-07-2018: Updates from review + - split into two ADRs - one for protocol, one for chains +- 16-07-2018: Initial draft - was originally joint ADR for protocol and chain +versions + +## Context + +Software and Protocol versions are covered in a separate ADR. + +Here we focus on chain versions. + +## Requirements + +We need to version blockchains across protocols, networks, forks, etc. +We need chain identifiers and descriptions so we can talk about a multitude of chains, +and especially the differences between them, in a meaningful way. + +### Networks + +We need to support many independent networks running the same version of the software, +even possibly starting from the same initial state. +They must have distinct identifiers so that peers know which one they are joining and so +validators and users can prevent replay attacks. + +Call this the `NetworkName` (note we currently call this `ChainID` in the software. In this +ADR, ChainID has a different meaning). +It represents both the application being run and the community or intention +of running it. + +Peers only connect to other peers with the same NetworkName. + +### Forks + +We need to support existing networks upgrading and forking, wherein they may do any of: + + - revert back to some height, continue with the same versions but new blocks + - arbitrarily mutate state at some height, continue with the same versions (eg. Dao Fork) + - change the AppVersion at some height + +Note because of Tendermint's voting power threshold rules, a chain can only be extended under the "original" rules and under the new rules +if 1/3 or more is double signing, which is expressly prohibited, and is supposed to result in their punishment on both chains. Since they can censor +the punishment, the chain is expected to be hardforked to remove the validators. Thus, if both branches are to continue after a fork, +they will each require a new identifier, and the old chain identifier will be retired (ie. only useful for syncing history, not for new blocks).. + + TODO: explain how to handle slashing when chain id changed! + +We need a consistent way to describe forks. + + +## Proposal + +### ChainDescription + +ChainDescription is a complete immutable description of a blockchain. It takes the following form: + +``` +ChainDescription = ///// +``` + +Here, StateHash is the merkle root of the initial state, ValHash is the merkle root of the initial Tendermint validator set, +and ConsensusParamsHash is the merkle root of the initial Tendermint consensus parameters. + +The `genesis.json` file must contain enough information to compute this value. It need not contain the StateHash or ValHash itself, +but contain the state from which they can be computed with the given protocol versions. + +NOTE: consider splitting NetworkName into NetworkName and AppName - this allows +folks to independently use the same application for different networks (ie we +could imagine multiple communities of validators wanting to put up a Hub using +the same app but having a distinct network name. Arguably not needed if +differences will come via different initial state / validators). + +#### ChainID + +Define `ChainID = TMHASH(ChainDescriptor)`. It's the unique ID of a blockchain. + +It should be Bech32 encoded when handled by users, eg. with `cosmoschain` prefix. + +#### Forks and Uprades + +When a chain forks or upgrades but continues the same history, it takes a new ChainDescription as follows: + +``` +ChainDescription = /x// +``` + +Where + - ChainID is the ChainID from the previous ChainDescription (ie. its hash) + - `x` denotes that a change occured + - `Height` is the height the change occured + - ForkDescription has the same form as ChainDescription but for the fork + - this allows forks to specify new versions for tendermint or the app, as well as arbitrary changes to the state or validator set + From ca9d07e5e46309473218e5ff0458da3e572df9b0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 5 Aug 2018 12:39:08 -0400 Subject: [PATCH 031/149] update deps for amaino v0.12.0-rc0 --- Gopkg.lock | 6 +++--- Gopkg.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 8e567aaf..db035fc0 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -370,12 +370,12 @@ revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" [[projects]] - branch = "jae/writeemptyptr" - digest = "1:2851f999161ce484d09df830edace38654b711228155d476680577f47f2a5bff" + digest = "1:e0a2a4be1e20c305badc2b0a7a9ab7fef6da500763bec23ab81df3b5f9eec9ee" name = "github.com/tendermint/go-amino" packages = ["."] pruneopts = "UT" - revision = "8202139066d340b77084a583e176e29fb28b42e9" + revision = "a8328986c1608950fa5d3d1c0472cccc4f8fc02c" + version = "v0.12.0-rc0" [[projects]] branch = "master" diff --git a/Gopkg.toml b/Gopkg.toml index a4d71aa8..5ec6a47c 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -58,7 +58,7 @@ [[constraint]] name = "github.com/tendermint/go-amino" - branch = "jae/writeemptyptr" + version = "v0.12.0-rc0" [[constraint]] name = "google.golang.org/grpc" From 279259ec8efb75d4dd2ebd5095c06892ff327804 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 5 Aug 2018 12:40:12 -0400 Subject: [PATCH 032/149] adr-018: abci validators --- docs/architecture/adr-018-ABCI-Validators.md | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 docs/architecture/adr-018-ABCI-Validators.md diff --git a/docs/architecture/adr-018-ABCI-Validators.md b/docs/architecture/adr-018-ABCI-Validators.md new file mode 100644 index 00000000..2f1060b9 --- /dev/null +++ b/docs/architecture/adr-018-ABCI-Validators.md @@ -0,0 +1,95 @@ +# ADR 018: ABCI Validator Improvements + +## Changelog + +05-08-2018: Initial draft + +## Context + +ADR 009 introduced major improvements to the ABCI around validators and the use +of Amino. Here we follow up with some additional changes to improve the naming +and expected use of Validator messages. + +We also fix how we communicate the commit round - there is no defined commit +round, as validators can commit the same block in different rounds, so we +should communicate the round each validator committed in. + +## Decision + +### Validator + +Currently a Validator contains address and `pub_key`, and one or the other is +optional/not-sent depending on the use case. Instead, we should have a +Validator (with just the address) and a ValidatorUpdate (with the pubkey): + +``` +message Validator { + bytes address + int64 power +} + +message ValidatorUpdate { + PubKey pub_key + int64 power +} +``` + +### RequestBeginBlock + +LastCommitInfo currently has an array of `SigningValidator` that contains +information for each validator in the entire validator set. +Instead, this should be called `VoteInfo`, since it is information about the +validator votes. + +Additionally, we have a single CommitRound in the LastCommitInfo, +but such a round does not exist. Instead, we +should include the round associated with each commit vote: + +``` +message LastCommitInfo { + repeated VoteInfo commit_votes +} + +message VoteInfo { + Validator validator + bool signed_last_block + int64 round +} +``` + +### ResponseEndBlock + +Use ValidatorUpdates instead of Validators. Then it's clear we don't need an +address, and we do need a pubkey. + +### InitChain + +Use ValidatorUpdates for both Request and Response. InitChain +is about setting/updating the initial validator set, unlike BeginBlock +which is just informational. + +## Status + +Proposal. + +## Consequences + +### Positive + +- Easier for developers to build on and understand the ABCI +- Apps get more information about the votes (ie. the round they're from) + +### Negative + +- There are two validator types + +### Neutral + +- + +## References + +- [Latest ABCI Spec](https://github.com/tendermint/tendermint/blob/v0.22.8/docs/app-dev/abci-spec.md) +- [ADR-009](https://github.com/tendermint/tendermint/blob/v0.22.8/docs/architecture/adr-009-ABCI-design.md) +- [Issue #1712 - Don't send PubKey in + RequestBeginBlock](https://github.com/tendermint/tendermint/issues/1712) From bec9d5cba90aa16003d3e1d8f8aa936ec111622a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 30 Jul 2018 12:59:16 +0400 Subject: [PATCH 033/149] add proposer address to block's Header Refs #1134 Validation: - ignored in block.ValidateBasic since it's stateful information - checked in blockExec.ValidateBlock --- CHANGELOG_PENDING.md | 1 + abci/types/types.pb.go | 396 +++++++++++++++-------------- abci/types/types.proto | 2 +- docs/spec/blockchain/blockchain.md | 8 +- state/state.go | 5 +- state/state_test.go | 11 + state/validation.go | 65 ++++- state/validation_test.go | 7 + types/block.go | 39 ++- types/block_test.go | 1 + types/protobuf.go | 2 +- types/protobuf_test.go | 8 +- 12 files changed, 319 insertions(+), 226 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index be90fc19..daa4931c 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -14,6 +14,7 @@ BREAKING CHANGES: - [p2p] Remove salsa and ripemd primitives, in favor of using chacha as a stream cipher, and hkdf - [abci] Changed time format from int64 to google.protobuf.Timestamp - [abci] Changed Validators to LastCommitInfo in RequestBeginBlock +- [abci] Added address of the original proposer of the block to Header. FEATURES: - [tools] Added `make check_dep` diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index ac71d91c..c7473075 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -59,7 +59,7 @@ func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{0} + return fileDescriptor_types_2abffab37bc29540, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -481,7 +481,7 @@ func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{1} + return fileDescriptor_types_2abffab37bc29540, []int{1} } func (m *RequestEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +527,7 @@ func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{2} + return fileDescriptor_types_2abffab37bc29540, []int{2} } func (m *RequestFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -567,7 +567,7 @@ func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{3} + return fileDescriptor_types_2abffab37bc29540, []int{3} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -616,7 +616,7 @@ func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{4} + return fileDescriptor_types_2abffab37bc29540, []int{4} } func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -674,7 +674,7 @@ func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{5} + return fileDescriptor_types_2abffab37bc29540, []int{5} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +752,7 @@ func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{6} + return fileDescriptor_types_2abffab37bc29540, []int{6} } func (m *RequestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -824,7 +824,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{7} + return fileDescriptor_types_2abffab37bc29540, []int{7} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -892,7 +892,7 @@ func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{8} + return fileDescriptor_types_2abffab37bc29540, []int{8} } func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -939,7 +939,7 @@ func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{9} + return fileDescriptor_types_2abffab37bc29540, []int{9} } func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -986,7 +986,7 @@ func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{10} + return fileDescriptor_types_2abffab37bc29540, []int{10} } func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1032,7 +1032,7 @@ func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{11} + return fileDescriptor_types_2abffab37bc29540, []int{11} } func (m *RequestCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1085,7 +1085,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{12} + return fileDescriptor_types_2abffab37bc29540, []int{12} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1538,7 +1538,7 @@ func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{13} + return fileDescriptor_types_2abffab37bc29540, []int{13} } func (m *ResponseException) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1585,7 +1585,7 @@ func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{14} + return fileDescriptor_types_2abffab37bc29540, []int{14} } func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1631,7 +1631,7 @@ func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{15} + return fileDescriptor_types_2abffab37bc29540, []int{15} } func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1674,7 +1674,7 @@ func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{16} + return fileDescriptor_types_2abffab37bc29540, []int{16} } func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1746,7 +1746,7 @@ func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{17} + return fileDescriptor_types_2abffab37bc29540, []int{17} } func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1808,7 +1808,7 @@ func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{18} + return fileDescriptor_types_2abffab37bc29540, []int{18} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1870,7 +1870,7 @@ func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{19} + return fileDescriptor_types_2abffab37bc29540, []int{19} } func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1966,7 +1966,7 @@ func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{20} + return fileDescriptor_types_2abffab37bc29540, []int{20} } func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2019,7 +2019,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{21} + return fileDescriptor_types_2abffab37bc29540, []int{21} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2114,7 +2114,7 @@ func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{22} + return fileDescriptor_types_2abffab37bc29540, []int{22} } func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2205,7 +2205,7 @@ func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{23} + return fileDescriptor_types_2abffab37bc29540, []int{23} } func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2267,7 +2267,7 @@ func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{24} + return fileDescriptor_types_2abffab37bc29540, []int{24} } func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2318,7 +2318,7 @@ func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } func (*ConsensusParams) ProtoMessage() {} func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{25} + return fileDescriptor_types_2abffab37bc29540, []int{25} } func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2382,7 +2382,7 @@ func (m *BlockSize) Reset() { *m = BlockSize{} } func (m *BlockSize) String() string { return proto.CompactTextString(m) } func (*BlockSize) ProtoMessage() {} func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{26} + return fileDescriptor_types_2abffab37bc29540, []int{26} } func (m *BlockSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2445,7 +2445,7 @@ func (m *TxSize) Reset() { *m = TxSize{} } func (m *TxSize) String() string { return proto.CompactTextString(m) } func (*TxSize) ProtoMessage() {} func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{27} + return fileDescriptor_types_2abffab37bc29540, []int{27} } func (m *TxSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2502,7 +2502,7 @@ func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{28} + return fileDescriptor_types_2abffab37bc29540, []int{28} } func (m *BlockGossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2550,7 +2550,7 @@ func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{29} + return fileDescriptor_types_2abffab37bc29540, []int{29} } func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2607,17 +2607,17 @@ type Header struct { ValidatorsHash []byte `protobuf:"bytes,7,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` AppHash []byte `protobuf:"bytes,8,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // consensus - Proposer Validator `protobuf:"bytes,9,opt,name=proposer" json:"proposer"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ProposerAddress []byte `protobuf:"bytes,9,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{30} + return fileDescriptor_types_2abffab37bc29540, []int{30} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2702,11 +2702,11 @@ func (m *Header) GetAppHash() []byte { return nil } -func (m *Header) GetProposer() Validator { +func (m *Header) GetProposerAddress() []byte { if m != nil { - return m.Proposer + return m.ProposerAddress } - return Validator{} + return nil } // Validator @@ -2723,7 +2723,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{31} + return fileDescriptor_types_2abffab37bc29540, []int{31} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2786,7 +2786,7 @@ func (m *SigningValidator) Reset() { *m = SigningValidator{} } func (m *SigningValidator) String() string { return proto.CompactTextString(m) } func (*SigningValidator) ProtoMessage() {} func (*SigningValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{32} + return fileDescriptor_types_2abffab37bc29540, []int{32} } func (m *SigningValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2841,7 +2841,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{33} + return fileDescriptor_types_2abffab37bc29540, []int{33} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2899,7 +2899,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_d8da2202f45d32c0, []int{34} + return fileDescriptor_types_2abffab37bc29540, []int{34} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4620,7 +4620,7 @@ func (this *Header) Equal(that interface{}) bool { if !bytes.Equal(this.AppHash, that1.AppHash) { return false } - if !this.Proposer.Equal(&that1.Proposer) { + if !bytes.Equal(this.ProposerAddress, that1.ProposerAddress) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { @@ -6675,14 +6675,12 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) i += copy(dAtA[i:], m.AppHash) } - dAtA[i] = 0x4a - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Proposer.Size())) - n36, err := m.Proposer.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.ProposerAddress) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i += copy(dAtA[i:], m.ProposerAddress) } - i += n36 if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } @@ -6713,11 +6711,11 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) - n37, err := m.PubKey.MarshalTo(dAtA[i:]) + n36, err := m.PubKey.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n36 if m.Power != 0 { dAtA[i] = 0x18 i++ @@ -6747,11 +6745,11 @@ func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintTypes(dAtA, i, uint64(m.Validator.Size())) - n38, err := m.Validator.MarshalTo(dAtA[i:]) + n37, err := m.Validator.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n37 if m.SignedLastBlock { dAtA[i] = 0x10 i++ @@ -6825,11 +6823,11 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(m.Validator.Size())) - n39, err := m.Validator.MarshalTo(dAtA[i:]) + n38, err := m.Validator.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n38 if m.Height != 0 { dAtA[i] = 0x18 i++ @@ -6838,11 +6836,11 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) - n40, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) + n39, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n39 if m.TotalVotingPower != 0 { dAtA[i] = 0x28 i++ @@ -7545,8 +7543,11 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { for i := 0; i < v37; i++ { this.AppHash[i] = byte(r.Intn(256)) } - v38 := NewPopulatedValidator(r, easy) - this.Proposer = *v38 + v38 := r.Intn(100) + this.ProposerAddress = make([]byte, v38) + for i := 0; i < v38; i++ { + this.ProposerAddress[i] = byte(r.Intn(256)) + } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedTypes(r, 10) } @@ -8470,8 +8471,10 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - l = m.Proposer.Size() - n += 1 + l + sovTypes(uint64(l)) + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -12930,9 +12933,9 @@ func (m *Header) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -12942,20 +12945,21 @@ func (m *Header) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ProposerAddress == nil { + m.ProposerAddress = []byte{} } iNdEx = postIndex default: @@ -13606,134 +13610,134 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_d8da2202f45d32c0) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_2abffab37bc29540) } func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_d8da2202f45d32c0) + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_2abffab37bc29540) } -var fileDescriptor_types_d8da2202f45d32c0 = []byte{ - // 1959 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x1b, 0x49, - 0x15, 0xf7, 0xc8, 0xb2, 0xa4, 0x79, 0xb2, 0x2d, 0xa7, 0x9d, 0xd8, 0x8a, 0x16, 0xec, 0x30, 0x45, - 0x65, 0x1d, 0xd6, 0x2b, 0x83, 0x97, 0x6c, 0x39, 0xbb, 0xb0, 0x85, 0xe5, 0x0d, 0x2b, 0xd7, 0x2e, - 0x60, 0x26, 0xd9, 0x50, 0xc5, 0x45, 0xd5, 0xd2, 0xb4, 0x47, 0x53, 0x91, 0x66, 0x66, 0xa7, 0x5b, - 0x5e, 0x39, 0x1f, 0x81, 0xda, 0xa2, 0xb8, 0x71, 0xe6, 0xc6, 0x17, 0xa0, 0x8a, 0x23, 0x27, 0x6a, - 0x8f, 0x1c, 0xa0, 0xe0, 0x14, 0xc0, 0x5b, 0x5c, 0xf8, 0x04, 0x1c, 0xa9, 0xd7, 0xdd, 0xf3, 0xd7, - 0xa3, 0x54, 0x12, 0x6e, 0x5c, 0xa4, 0xee, 0x7e, 0xef, 0xf5, 0xf4, 0x7b, 0xfd, 0xde, 0xfb, 0xbd, - 0xd7, 0xb0, 0x45, 0x87, 0x23, 0xef, 0x40, 0x5c, 0x86, 0x8c, 0xab, 0xdf, 0x6e, 0x18, 0x05, 0x22, - 0x20, 0x2b, 0x72, 0xd2, 0x79, 0xdb, 0xf5, 0xc4, 0x78, 0x36, 0xec, 0x8e, 0x82, 0xe9, 0x81, 0x1b, - 0xb8, 0xc1, 0x81, 0xa4, 0x0e, 0x67, 0xe7, 0x72, 0x26, 0x27, 0x72, 0xa4, 0xa4, 0x3a, 0xbb, 0x6e, - 0x10, 0xb8, 0x13, 0x96, 0x72, 0x09, 0x6f, 0xca, 0xb8, 0xa0, 0xd3, 0x50, 0x33, 0x1c, 0x65, 0xf6, - 0x13, 0xcc, 0x77, 0x58, 0x34, 0xf5, 0x7c, 0x91, 0x1d, 0x4e, 0xbc, 0x21, 0x3f, 0x18, 0x05, 0xd3, - 0x69, 0xe0, 0x67, 0x0f, 0x64, 0xfd, 0xb1, 0x0a, 0x75, 0x9b, 0x7d, 0x36, 0x63, 0x5c, 0x90, 0x3d, - 0xa8, 0xb2, 0xd1, 0x38, 0x68, 0x57, 0xee, 0x18, 0x7b, 0xcd, 0x43, 0xd2, 0x55, 0x7c, 0x9a, 0xfa, - 0x70, 0x34, 0x0e, 0xfa, 0x4b, 0xb6, 0xe4, 0x20, 0x6f, 0xc1, 0xca, 0xf9, 0x64, 0xc6, 0xc7, 0xed, - 0x65, 0xc9, 0xba, 0x99, 0x67, 0xfd, 0x21, 0x92, 0xfa, 0x4b, 0xb6, 0xe2, 0xc1, 0x6d, 0x3d, 0xff, - 0x3c, 0x68, 0x57, 0xcb, 0xb6, 0x3d, 0xf5, 0xcf, 0xe5, 0xb6, 0xc8, 0x41, 0x8e, 0x00, 0x38, 0x13, - 0x83, 0x20, 0x14, 0x5e, 0xe0, 0xb7, 0x57, 0x24, 0xff, 0x76, 0x9e, 0xff, 0x11, 0x13, 0x3f, 0x91, - 0xe4, 0xfe, 0x92, 0x6d, 0xf2, 0x78, 0x82, 0x92, 0x9e, 0xef, 0x89, 0xc1, 0x68, 0x4c, 0x3d, 0xbf, - 0x5d, 0x2b, 0x93, 0x3c, 0xf5, 0x3d, 0x71, 0x82, 0x64, 0x94, 0xf4, 0xe2, 0x09, 0xaa, 0xf2, 0xd9, - 0x8c, 0x45, 0x97, 0xed, 0x7a, 0x99, 0x2a, 0x3f, 0x45, 0x12, 0xaa, 0x22, 0x79, 0xc8, 0xfb, 0xd0, - 0x1c, 0x32, 0xd7, 0xf3, 0x07, 0xc3, 0x49, 0x30, 0x7a, 0xda, 0x6e, 0x48, 0x91, 0x76, 0x5e, 0xa4, - 0x87, 0x0c, 0x3d, 0xa4, 0xf7, 0x97, 0x6c, 0x18, 0x26, 0x33, 0x72, 0x08, 0x8d, 0xd1, 0x98, 0x8d, - 0x9e, 0x0e, 0xc4, 0xbc, 0x6d, 0x4a, 0xc9, 0x5b, 0x79, 0xc9, 0x13, 0xa4, 0x3e, 0x9e, 0xf7, 0x97, - 0xec, 0xfa, 0x48, 0x0d, 0xc9, 0x7d, 0x30, 0x99, 0xef, 0xe8, 0xcf, 0x35, 0xa5, 0xd0, 0x56, 0xe1, - 0x5e, 0x7c, 0x27, 0xfe, 0x58, 0x83, 0xe9, 0x31, 0xe9, 0x42, 0x0d, 0xef, 0xda, 0x13, 0xed, 0x55, - 0x29, 0x73, 0xb3, 0xf0, 0x21, 0x49, 0xeb, 0x2f, 0xd9, 0x9a, 0x0b, 0xcd, 0xe7, 0xb0, 0x89, 0x77, - 0xc1, 0x22, 0x3c, 0xdc, 0x66, 0x99, 0xf9, 0x3e, 0x54, 0x74, 0x79, 0x3c, 0xd3, 0x89, 0x27, 0xbd, - 0x3a, 0xac, 0x5c, 0xd0, 0xc9, 0x8c, 0x59, 0x6f, 0x42, 0x33, 0xe3, 0x29, 0xa4, 0x0d, 0xf5, 0x29, - 0xe3, 0x9c, 0xba, 0xac, 0x6d, 0xdc, 0x31, 0xf6, 0x4c, 0x3b, 0x9e, 0x5a, 0xeb, 0xb0, 0x9a, 0xf5, - 0x93, 0x8c, 0x20, 0xfa, 0x02, 0x0a, 0x5e, 0xb0, 0x88, 0xa3, 0x03, 0x68, 0x41, 0x3d, 0xb5, 0xde, - 0x83, 0x8d, 0xa2, 0x13, 0x90, 0x0d, 0x58, 0x7e, 0xca, 0x2e, 0x35, 0x27, 0x0e, 0xc9, 0x4d, 0x7d, - 0x20, 0xe9, 0xc5, 0xa6, 0xad, 0x4f, 0xf7, 0x8b, 0x4a, 0x22, 0x9c, 0xf8, 0x01, 0x39, 0x82, 0x2a, - 0x06, 0x92, 0x94, 0x6e, 0x1e, 0x76, 0xba, 0x2a, 0xca, 0xba, 0x71, 0x94, 0x75, 0x1f, 0xc7, 0x51, - 0xd6, 0x6b, 0x7c, 0xf9, 0x7c, 0x77, 0xe9, 0x57, 0x7f, 0xdf, 0x35, 0x6c, 0x29, 0x41, 0x6e, 0xe3, - 0x55, 0x52, 0xcf, 0x1f, 0x78, 0x8e, 0xfe, 0x4e, 0x5d, 0xce, 0x4f, 0x1d, 0x72, 0x0c, 0x1b, 0xa3, - 0xc0, 0xe7, 0xcc, 0xe7, 0x33, 0x3e, 0x08, 0x69, 0x44, 0xa7, 0x5c, 0x47, 0x49, 0x7c, 0x71, 0x27, - 0x31, 0xf9, 0x4c, 0x52, 0xed, 0xd6, 0x28, 0xbf, 0x40, 0xde, 0x05, 0xb8, 0xa0, 0x13, 0xcf, 0xa1, - 0x22, 0x88, 0x78, 0xbb, 0x7a, 0x67, 0x79, 0xaf, 0x79, 0xb8, 0xa1, 0x85, 0x9f, 0xc4, 0x84, 0x5e, - 0x15, 0xcf, 0x64, 0x67, 0x38, 0xc9, 0x5d, 0x68, 0xd1, 0x30, 0x1c, 0x70, 0x41, 0x05, 0x1b, 0x0c, - 0x2f, 0x05, 0xe3, 0x32, 0x86, 0x56, 0xed, 0x35, 0x1a, 0x86, 0x8f, 0x70, 0xb5, 0x87, 0x8b, 0x96, - 0x93, 0xdc, 0x80, 0x74, 0x6f, 0x42, 0xa0, 0xea, 0x50, 0x41, 0xa5, 0x1d, 0x56, 0x6d, 0x39, 0xc6, - 0xb5, 0x90, 0x8a, 0xb1, 0xd6, 0x4e, 0x8e, 0xc9, 0x16, 0xd4, 0xc6, 0xcc, 0x73, 0xc7, 0x42, 0x2a, - 0xb4, 0x6c, 0xeb, 0x19, 0x9a, 0x3c, 0x8c, 0x82, 0x0b, 0x26, 0x23, 0xbc, 0x61, 0xab, 0x89, 0xf5, - 0x2f, 0x03, 0x6e, 0x5c, 0x0b, 0x09, 0xdc, 0x77, 0x4c, 0xf9, 0x38, 0xfe, 0x16, 0x8e, 0xc9, 0x5b, - 0xb8, 0x2f, 0x75, 0x58, 0xa4, 0x33, 0xcf, 0x9a, 0xd6, 0xb5, 0x2f, 0x17, 0xb5, 0xa2, 0x9a, 0x85, - 0x3c, 0x84, 0x8d, 0x09, 0xe5, 0x62, 0xa0, 0x3c, 0x77, 0x20, 0x33, 0xcb, 0x72, 0x2e, 0x9a, 0x3e, - 0xa1, 0xb1, 0x87, 0xa3, 0x43, 0x69, 0xf1, 0xf5, 0x49, 0x6e, 0x95, 0xf4, 0xe1, 0xe6, 0xf0, 0xf2, - 0x19, 0xf5, 0x85, 0xe7, 0xb3, 0xc1, 0x35, 0x6b, 0xb7, 0xf4, 0x56, 0x0f, 0x2f, 0x3c, 0x87, 0xf9, - 0x23, 0xa6, 0x37, 0xd9, 0x4c, 0x44, 0x92, 0x6b, 0xe0, 0xd6, 0x1d, 0x58, 0xcf, 0xc7, 0x2f, 0x59, - 0x87, 0x8a, 0x98, 0x6b, 0x0d, 0x2b, 0x62, 0x6e, 0x59, 0x89, 0xef, 0x25, 0x41, 0x74, 0x8d, 0xe7, - 0x1e, 0xb4, 0x0a, 0x01, 0x9d, 0x31, 0xb7, 0x91, 0x35, 0xb7, 0xd5, 0x82, 0xb5, 0x5c, 0x1c, 0x5b, - 0x5f, 0xac, 0x40, 0xc3, 0x66, 0x3c, 0x44, 0x37, 0x22, 0x47, 0x60, 0xb2, 0xf9, 0x88, 0xa9, 0x14, - 0x6a, 0x14, 0x12, 0x94, 0xe2, 0x79, 0x18, 0xd3, 0x31, 0x94, 0x13, 0x66, 0x72, 0x2f, 0x97, 0xfe, - 0x37, 0x8b, 0x42, 0xd9, 0xfc, 0xbf, 0x9f, 0xcf, 0xff, 0x37, 0x0b, 0xbc, 0x05, 0x00, 0xb8, 0x97, - 0x03, 0x80, 0xe2, 0xc6, 0x39, 0x04, 0x78, 0x50, 0x82, 0x00, 0xc5, 0xe3, 0x2f, 0x80, 0x80, 0x07, - 0x25, 0x10, 0xd0, 0xbe, 0xf6, 0xad, 0x52, 0x0c, 0xd8, 0xcf, 0x63, 0x40, 0x51, 0x9d, 0x02, 0x08, - 0x7c, 0xaf, 0x0c, 0x04, 0x6e, 0x17, 0x64, 0x16, 0xa2, 0xc0, 0x3b, 0xd7, 0x50, 0x60, 0xab, 0x20, - 0x5a, 0x02, 0x03, 0x0f, 0x72, 0xf9, 0x19, 0x4a, 0x75, 0x2b, 0x4f, 0xd0, 0xe4, 0xdd, 0xeb, 0x08, - 0xb2, 0x5d, 0xbc, 0xda, 0x32, 0x08, 0x39, 0x28, 0x40, 0xc8, 0xad, 0xe2, 0x29, 0x0b, 0x18, 0x92, - 0x22, 0xc1, 0x3d, 0x8c, 0xfb, 0x82, 0xa7, 0x61, 0x8e, 0x60, 0x51, 0x14, 0x44, 0x3a, 0x55, 0xab, - 0x89, 0xb5, 0x87, 0x99, 0x28, 0xf5, 0xaf, 0x17, 0xa0, 0x86, 0x74, 0xfa, 0x8c, 0x77, 0x59, 0xbf, - 0x36, 0x52, 0x59, 0x19, 0xd1, 0xd9, 0x2c, 0x66, 0xea, 0x2c, 0x96, 0x01, 0x93, 0x4a, 0x0e, 0x4c, - 0xc8, 0xb7, 0xe0, 0x86, 0x4c, 0x23, 0xd2, 0x2e, 0x83, 0x5c, 0x5a, 0x6b, 0x21, 0x41, 0x19, 0x44, - 0xe5, 0xb7, 0xb7, 0x61, 0x33, 0xc3, 0x8b, 0x29, 0x56, 0xa6, 0xb0, 0xaa, 0x0c, 0xde, 0x8d, 0x84, - 0xfb, 0x38, 0x0c, 0xfb, 0x94, 0x8f, 0xad, 0x1f, 0xa5, 0xfa, 0xa7, 0x40, 0x45, 0xa0, 0x3a, 0x0a, - 0x1c, 0xa5, 0xd6, 0x9a, 0x2d, 0xc7, 0x08, 0x5e, 0x93, 0xc0, 0x95, 0x5f, 0x35, 0x6d, 0x1c, 0x22, - 0x57, 0x12, 0x29, 0xa6, 0x0a, 0x09, 0xeb, 0x97, 0x46, 0xba, 0x5f, 0x8a, 0x5d, 0x65, 0x30, 0x63, - 0xfc, 0x2f, 0x30, 0x53, 0x79, 0x59, 0x98, 0xb1, 0x7e, 0x67, 0xa4, 0x77, 0x91, 0x00, 0xc8, 0xeb, - 0x29, 0x87, 0x6e, 0xe1, 0xf9, 0x0e, 0x9b, 0xcb, 0x50, 0x5f, 0xb6, 0xd5, 0x24, 0x46, 0xf5, 0x9a, - 0x34, 0x70, 0x1e, 0xd5, 0xeb, 0x72, 0x4d, 0x4d, 0x34, 0xf0, 0x04, 0xe7, 0x32, 0x06, 0x57, 0x6d, - 0x35, 0xc9, 0xe4, 0x4d, 0x33, 0x97, 0x37, 0xcf, 0x80, 0x5c, 0x8f, 0x4e, 0xf2, 0x1e, 0x54, 0x05, - 0x75, 0xd1, 0x78, 0xa8, 0xff, 0x7a, 0x57, 0xd5, 0xc8, 0xdd, 0x8f, 0x9f, 0x9c, 0x51, 0x2f, 0xea, - 0x6d, 0xa1, 0xf6, 0xff, 0x7e, 0xbe, 0xbb, 0x8e, 0x3c, 0xfb, 0xc1, 0xd4, 0x13, 0x6c, 0x1a, 0x8a, - 0x4b, 0x5b, 0xca, 0x58, 0x7f, 0x31, 0x30, 0x6b, 0xe7, 0xa2, 0xb6, 0xd4, 0x16, 0xb1, 0x6b, 0x56, - 0x32, 0x00, 0xfb, 0x72, 0xf6, 0xf9, 0x3a, 0x80, 0x4b, 0xf9, 0xe0, 0x73, 0xea, 0x0b, 0xe6, 0x68, - 0x23, 0x99, 0x2e, 0xe5, 0x3f, 0x93, 0x0b, 0x58, 0x87, 0x20, 0x79, 0xc6, 0x99, 0x23, 0xad, 0xb5, - 0x6c, 0xd7, 0x5d, 0xca, 0x3f, 0xe5, 0xcc, 0x49, 0xf4, 0xaa, 0xbf, 0x86, 0x5e, 0x7f, 0xcd, 0xb8, - 0x5c, 0x0a, 0x59, 0xff, 0x0f, 0x9a, 0x7d, 0x65, 0x20, 0x16, 0xe7, 0xd3, 0x1e, 0x39, 0x81, 0x1b, - 0x89, 0x7b, 0x0f, 0x66, 0xa1, 0x43, 0xb1, 0x72, 0x32, 0x5e, 0x18, 0x0f, 0x1b, 0x89, 0xc0, 0xa7, - 0x8a, 0x9f, 0xfc, 0x18, 0xb6, 0x0b, 0x01, 0x99, 0x6c, 0x55, 0x79, 0x61, 0x5c, 0xde, 0xca, 0xc7, - 0x65, 0xbc, 0x5f, 0xac, 0xe5, 0xf2, 0x6b, 0x68, 0xf9, 0x4d, 0x2c, 0x49, 0xb2, 0x69, 0xba, 0xec, - 0x9e, 0xac, 0xdf, 0x18, 0xd0, 0x2a, 0x1c, 0x86, 0x1c, 0x00, 0xa8, 0x2c, 0xc7, 0xbd, 0x67, 0x71, - 0x61, 0x1c, 0xdb, 0x40, 0x1a, 0xeb, 0x91, 0xf7, 0x8c, 0xd9, 0xe6, 0x30, 0x1e, 0x92, 0xbb, 0x50, - 0x17, 0x73, 0xc5, 0x9d, 0x2f, 0xde, 0x1e, 0xcf, 0x25, 0x6b, 0x4d, 0xc8, 0x7f, 0x72, 0x1f, 0x56, - 0xd5, 0xc6, 0x6e, 0xc0, 0xb9, 0x17, 0xea, 0xc2, 0x81, 0x64, 0xb7, 0xfe, 0x48, 0x52, 0xec, 0xe6, - 0x30, 0x9d, 0x58, 0x3f, 0x07, 0x33, 0xf9, 0x2c, 0x79, 0x03, 0xcc, 0x29, 0x9d, 0xeb, 0xca, 0x16, - 0xcf, 0xb6, 0x62, 0x37, 0xa6, 0x74, 0x2e, 0x8b, 0x5a, 0xb2, 0x0d, 0x75, 0x24, 0x8a, 0xb9, 0xb2, - 0xf7, 0x8a, 0x5d, 0x9b, 0xd2, 0xf9, 0xe3, 0x79, 0x42, 0x70, 0x29, 0x8f, 0xcb, 0xd6, 0x29, 0x9d, - 0x7f, 0x44, 0xb9, 0xf5, 0x01, 0xd4, 0xd4, 0x21, 0x5f, 0x6a, 0x63, 0x94, 0xaf, 0xe4, 0xe4, 0x7f, - 0x00, 0xcd, 0xcc, 0xb9, 0xc9, 0x77, 0xe0, 0x96, 0xd2, 0x30, 0xa4, 0x91, 0x90, 0x16, 0xc9, 0x6d, - 0x48, 0x24, 0xf1, 0x8c, 0x46, 0x02, 0x3f, 0xa9, 0x0a, 0xf1, 0x08, 0xd6, 0xf3, 0xc5, 0x2a, 0xf9, - 0x06, 0xac, 0xea, 0xc2, 0x36, 0x0a, 0x66, 0xbe, 0xa3, 0x65, 0x9b, 0x6a, 0xcd, 0xc6, 0x25, 0xf2, - 0xfd, 0x92, 0xb4, 0x1d, 0x23, 0xfa, 0x23, 0xcf, 0xf5, 0x3d, 0xdf, 0x7d, 0x51, 0xf6, 0xfe, 0x5b, - 0x05, 0x6a, 0xaa, 0xb0, 0x26, 0x77, 0x33, 0x5d, 0x8c, 0x44, 0xcd, 0x5e, 0xf3, 0xea, 0xf9, 0x6e, - 0x5d, 0x02, 0xcc, 0xe9, 0x87, 0x69, 0x4b, 0x93, 0x26, 0xd4, 0x4a, 0xae, 0xee, 0x8f, 0xfb, 0xa7, - 0xe5, 0x57, 0xee, 0x9f, 0xb6, 0xa1, 0xee, 0xcf, 0xa6, 0xf2, 0xb2, 0xaa, 0xea, 0xb2, 0xfc, 0xd9, - 0x14, 0x2f, 0xeb, 0x0d, 0x30, 0x45, 0x20, 0xe8, 0x44, 0x92, 0x54, 0x52, 0x68, 0xc8, 0x05, 0x24, - 0xde, 0x85, 0x56, 0x16, 0xb3, 0x11, 0x83, 0x15, 0x44, 0xac, 0xa5, 0x88, 0x8d, 0xfd, 0xc4, 0x9b, - 0xd0, 0x4a, 0x15, 0x56, 0x7c, 0x0a, 0x36, 0xd6, 0xd3, 0x65, 0xc9, 0x78, 0x1b, 0x1a, 0x09, 0x9a, - 0x2b, 0x08, 0xa9, 0x53, 0x05, 0xe2, 0xd8, 0xac, 0x87, 0x51, 0x10, 0x06, 0x9c, 0x45, 0xba, 0x4c, - 0x5b, 0x94, 0x0a, 0x12, 0x3e, 0xcb, 0x03, 0x33, 0x21, 0x62, 0xe9, 0x41, 0x1d, 0x27, 0x62, 0x9c, - 0xeb, 0x2a, 0x3f, 0x9e, 0x92, 0x7d, 0xa8, 0x87, 0xb3, 0xe1, 0x00, 0x11, 0x2e, 0x1f, 0x32, 0x67, - 0xb3, 0xe1, 0xc7, 0xec, 0x32, 0xee, 0x77, 0x42, 0x39, 0x93, 0x18, 0x17, 0x7c, 0xce, 0x22, 0xed, - 0xbc, 0x6a, 0x62, 0x09, 0xd8, 0x28, 0xde, 0x35, 0xf9, 0x2e, 0x98, 0x89, 0x7e, 0x85, 0xd0, 0x2d, - 0x9e, 0x39, 0x65, 0xc4, 0x42, 0x88, 0x7b, 0xae, 0xcf, 0x9c, 0x41, 0x6a, 0x5b, 0x79, 0xae, 0x86, - 0xdd, 0x52, 0x84, 0x4f, 0x62, 0xe3, 0x5a, 0xdf, 0x86, 0x9a, 0x3a, 0x23, 0xe6, 0x13, 0xdc, 0x39, - 0x2e, 0xb6, 0x70, 0x5c, 0x9a, 0x63, 0xfe, 0x6c, 0x40, 0x23, 0x6e, 0xa2, 0x4a, 0x85, 0x72, 0x87, - 0xae, 0xbc, 0xec, 0xa1, 0x17, 0x75, 0xa2, 0xb1, 0x47, 0x56, 0x5f, 0xd9, 0x23, 0xf7, 0x81, 0x28, - 0xc7, 0xbb, 0x08, 0x84, 0xe7, 0xbb, 0x03, 0x65, 0x73, 0xe5, 0x81, 0x1b, 0x92, 0xf2, 0x44, 0x12, - 0xce, 0x70, 0xfd, 0xf0, 0x8b, 0x15, 0x68, 0x1d, 0xf7, 0x4e, 0x4e, 0x8f, 0xc3, 0x70, 0xe2, 0x8d, - 0xa8, 0xac, 0xf0, 0x0e, 0xa0, 0x2a, 0x6b, 0xd8, 0x92, 0x77, 0xb3, 0x4e, 0x59, 0x33, 0x45, 0x0e, - 0x61, 0x45, 0x96, 0xb2, 0xa4, 0xec, 0xf9, 0xac, 0x53, 0xda, 0x53, 0xe1, 0x47, 0x54, 0xb1, 0x7b, - 0xfd, 0x15, 0xad, 0x53, 0xd6, 0x58, 0x91, 0x0f, 0xc0, 0x4c, 0x8b, 0xd0, 0x45, 0x6f, 0x69, 0x9d, - 0x85, 0x2d, 0x16, 0xca, 0xa7, 0x15, 0xc0, 0xa2, 0x27, 0xa1, 0xce, 0xc2, 0x5e, 0x84, 0x1c, 0x41, - 0x3d, 0xae, 0x8c, 0xca, 0x5f, 0xbb, 0x3a, 0x0b, 0xda, 0x1f, 0x34, 0x8f, 0xaa, 0x2e, 0xcb, 0x9e, - 0xe4, 0x3a, 0xa5, 0x3d, 0x1a, 0xb9, 0x0f, 0x35, 0x0d, 0x78, 0xa5, 0x2f, 0x5e, 0x9d, 0xf2, 0x26, - 0x06, 0x95, 0x4c, 0x2b, 0xeb, 0x45, 0xcf, 0x86, 0x9d, 0x85, 0xcd, 0x24, 0x39, 0x06, 0xc8, 0x54, - 0x94, 0x0b, 0xdf, 0x03, 0x3b, 0x8b, 0x9b, 0x44, 0xf2, 0x3e, 0x34, 0xd2, 0xc6, 0xbf, 0xfc, 0x85, - 0xaf, 0xb3, 0xa8, 0x6f, 0xeb, 0x7d, 0xed, 0x3f, 0xff, 0xdc, 0x31, 0x7e, 0x7b, 0xb5, 0x63, 0xfc, - 0xfe, 0x6a, 0xc7, 0xf8, 0xf2, 0x6a, 0xc7, 0xf8, 0xd3, 0xd5, 0x8e, 0xf1, 0x8f, 0xab, 0x1d, 0xe3, - 0x0f, 0x5f, 0xed, 0x18, 0xc3, 0x9a, 0x74, 0xff, 0x77, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xc1, - 0xc2, 0x93, 0xfb, 0x94, 0x16, 0x00, 0x00, +var fileDescriptor_types_2abffab37bc29540 = []byte{ + // 1964 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x23, 0x47, + 0x15, 0xf7, 0xc8, 0xfa, 0x37, 0x4f, 0xb6, 0xa5, 0xb4, 0x77, 0x6d, 0xad, 0x02, 0xf6, 0x32, 0x45, + 0x6d, 0x6c, 0xe2, 0xc8, 0xe0, 0xb0, 0x29, 0x6f, 0x02, 0x29, 0x2c, 0x67, 0x89, 0x5c, 0x09, 0x60, + 0x66, 0x37, 0x4b, 0x15, 0x97, 0xa9, 0x96, 0xa6, 0x3d, 0x9a, 0x5a, 0x69, 0x66, 0x32, 0xdd, 0x72, + 0xe4, 0xfd, 0x08, 0x54, 0x8a, 0xe2, 0xc6, 0x99, 0x1b, 0x5f, 0x80, 0x2a, 0x8e, 0x9c, 0xa8, 0xdc, + 0xe0, 0x00, 0xc5, 0x6d, 0x01, 0xa7, 0xb8, 0xf0, 0x09, 0x38, 0x52, 0xaf, 0x7b, 0xfe, 0x7b, 0xb4, + 0xb5, 0x59, 0x6e, 0x5c, 0xa4, 0xee, 0x7e, 0xef, 0xf5, 0xf4, 0x7b, 0xfd, 0xde, 0xfb, 0xbd, 0xd7, + 0xb0, 0x45, 0x47, 0x63, 0xf7, 0x50, 0x5c, 0x05, 0x8c, 0xab, 0xdf, 0x7e, 0x10, 0xfa, 0xc2, 0x27, + 0x35, 0x39, 0xe9, 0xbd, 0xe5, 0xb8, 0x62, 0x32, 0x1f, 0xf5, 0xc7, 0xfe, 0xec, 0xd0, 0xf1, 0x1d, + 0xff, 0x50, 0x52, 0x47, 0xf3, 0x0b, 0x39, 0x93, 0x13, 0x39, 0x52, 0x52, 0xbd, 0x5d, 0xc7, 0xf7, + 0x9d, 0x29, 0x4b, 0xb9, 0x84, 0x3b, 0x63, 0x5c, 0xd0, 0x59, 0x10, 0x31, 0x1c, 0x67, 0xf6, 0x13, + 0xcc, 0xb3, 0x59, 0x38, 0x73, 0x3d, 0x91, 0x1d, 0x4e, 0xdd, 0x11, 0x3f, 0x1c, 0xfb, 0xb3, 0x99, + 0xef, 0x65, 0x0f, 0x64, 0xfc, 0xb1, 0x0a, 0x0d, 0x93, 0x7d, 0x3a, 0x67, 0x5c, 0x90, 0x3d, 0xa8, + 0xb2, 0xf1, 0xc4, 0xef, 0x56, 0xee, 0x6a, 0x7b, 0xad, 0x23, 0xd2, 0x57, 0x7c, 0x11, 0xf5, 0xe1, + 0x78, 0xe2, 0x0f, 0x57, 0x4c, 0xc9, 0x41, 0xde, 0x84, 0xda, 0xc5, 0x74, 0xce, 0x27, 0xdd, 0x55, + 0xc9, 0xba, 0x99, 0x67, 0xfd, 0x21, 0x92, 0x86, 0x2b, 0xa6, 0xe2, 0xc1, 0x6d, 0x5d, 0xef, 0xc2, + 0xef, 0x56, 0xcb, 0xb6, 0x3d, 0xf3, 0x2e, 0xe4, 0xb6, 0xc8, 0x41, 0x8e, 0x01, 0x38, 0x13, 0x96, + 0x1f, 0x08, 0xd7, 0xf7, 0xba, 0x35, 0xc9, 0xbf, 0x9d, 0xe7, 0x7f, 0xc4, 0xc4, 0x4f, 0x24, 0x79, + 0xb8, 0x62, 0xea, 0x3c, 0x9e, 0xa0, 0xa4, 0xeb, 0xb9, 0xc2, 0x1a, 0x4f, 0xa8, 0xeb, 0x75, 0xeb, + 0x65, 0x92, 0x67, 0x9e, 0x2b, 0x4e, 0x91, 0x8c, 0x92, 0x6e, 0x3c, 0x41, 0x55, 0x3e, 0x9d, 0xb3, + 0xf0, 0xaa, 0xdb, 0x28, 0x53, 0xe5, 0xa7, 0x48, 0x42, 0x55, 0x24, 0x0f, 0x79, 0x0f, 0x5a, 0x23, + 0xe6, 0xb8, 0x9e, 0x35, 0x9a, 0xfa, 0xe3, 0xa7, 0xdd, 0xa6, 0x14, 0xe9, 0xe6, 0x45, 0x06, 0xc8, + 0x30, 0x40, 0xfa, 0x70, 0xc5, 0x84, 0x51, 0x32, 0x23, 0x47, 0xd0, 0x1c, 0x4f, 0xd8, 0xf8, 0xa9, + 0x25, 0x16, 0x5d, 0x5d, 0x4a, 0xde, 0xce, 0x4b, 0x9e, 0x22, 0xf5, 0xf1, 0x62, 0xb8, 0x62, 0x36, + 0xc6, 0x6a, 0x48, 0xee, 0x83, 0xce, 0x3c, 0x3b, 0xfa, 0x5c, 0x4b, 0x0a, 0x6d, 0x15, 0xee, 0xc5, + 0xb3, 0xe3, 0x8f, 0x35, 0x59, 0x34, 0x26, 0x7d, 0xa8, 0xe3, 0x5d, 0xbb, 0xa2, 0xbb, 0x26, 0x65, + 0x6e, 0x15, 0x3e, 0x24, 0x69, 0xc3, 0x15, 0x33, 0xe2, 0x42, 0xf3, 0xd9, 0x6c, 0xea, 0x5e, 0xb2, + 0x10, 0x0f, 0xb7, 0x59, 0x66, 0xbe, 0x0f, 0x14, 0x5d, 0x1e, 0x4f, 0xb7, 0xe3, 0xc9, 0xa0, 0x01, + 0xb5, 0x4b, 0x3a, 0x9d, 0x33, 0xe3, 0x0d, 0x68, 0x65, 0x3c, 0x85, 0x74, 0xa1, 0x31, 0x63, 0x9c, + 0x53, 0x87, 0x75, 0xb5, 0xbb, 0xda, 0x9e, 0x6e, 0xc6, 0x53, 0x63, 0x03, 0xd6, 0xb2, 0x7e, 0x92, + 0x11, 0x44, 0x5f, 0x40, 0xc1, 0x4b, 0x16, 0x72, 0x74, 0x80, 0x48, 0x30, 0x9a, 0x1a, 0xef, 0x42, + 0xa7, 0xe8, 0x04, 0xa4, 0x03, 0xab, 0x4f, 0xd9, 0x55, 0xc4, 0x89, 0x43, 0x72, 0x2b, 0x3a, 0x90, + 0xf4, 0x62, 0xdd, 0x8c, 0x4e, 0xf7, 0x8b, 0x4a, 0x22, 0x9c, 0xf8, 0x01, 0x39, 0x86, 0x2a, 0x06, + 0x92, 0x94, 0x6e, 0x1d, 0xf5, 0xfa, 0x2a, 0xca, 0xfa, 0x71, 0x94, 0xf5, 0x1f, 0xc7, 0x51, 0x36, + 0x68, 0x7e, 0xf1, 0x7c, 0x77, 0xe5, 0x57, 0x7f, 0xdf, 0xd5, 0x4c, 0x29, 0x41, 0xee, 0xe0, 0x55, + 0x52, 0xd7, 0xb3, 0x5c, 0x3b, 0xfa, 0x4e, 0x43, 0xce, 0xcf, 0x6c, 0x72, 0x02, 0x9d, 0xb1, 0xef, + 0x71, 0xe6, 0xf1, 0x39, 0xb7, 0x02, 0x1a, 0xd2, 0x19, 0x8f, 0xa2, 0x24, 0xbe, 0xb8, 0xd3, 0x98, + 0x7c, 0x2e, 0xa9, 0x66, 0x7b, 0x9c, 0x5f, 0x20, 0xef, 0x00, 0x5c, 0xd2, 0xa9, 0x6b, 0x53, 0xe1, + 0x87, 0xbc, 0x5b, 0xbd, 0xbb, 0xba, 0xd7, 0x3a, 0xea, 0x44, 0xc2, 0x4f, 0x62, 0xc2, 0xa0, 0x8a, + 0x67, 0x32, 0x33, 0x9c, 0xe4, 0x1e, 0xb4, 0x69, 0x10, 0x58, 0x5c, 0x50, 0xc1, 0xac, 0xd1, 0x95, + 0x60, 0x5c, 0xc6, 0xd0, 0x9a, 0xb9, 0x4e, 0x83, 0xe0, 0x11, 0xae, 0x0e, 0x70, 0xd1, 0xb0, 0x93, + 0x1b, 0x90, 0xee, 0x4d, 0x08, 0x54, 0x6d, 0x2a, 0xa8, 0xb4, 0xc3, 0x9a, 0x29, 0xc7, 0xb8, 0x16, + 0x50, 0x31, 0x89, 0xb4, 0x93, 0x63, 0xb2, 0x05, 0xf5, 0x09, 0x73, 0x9d, 0x89, 0x90, 0x0a, 0xad, + 0x9a, 0xd1, 0x0c, 0x4d, 0x1e, 0x84, 0xfe, 0x25, 0x93, 0x11, 0xde, 0x34, 0xd5, 0xc4, 0xf8, 0x97, + 0x06, 0xaf, 0xdd, 0x08, 0x09, 0xdc, 0x77, 0x42, 0xf9, 0x24, 0xfe, 0x16, 0x8e, 0xc9, 0x9b, 0xb8, + 0x2f, 0xb5, 0x59, 0x18, 0x65, 0x9e, 0xf5, 0x48, 0xd7, 0xa1, 0x5c, 0x8c, 0x14, 0x8d, 0x58, 0xc8, + 0x43, 0xe8, 0x4c, 0x29, 0x17, 0x96, 0xf2, 0x5c, 0x4b, 0x66, 0x96, 0xd5, 0x5c, 0x34, 0x7d, 0x4c, + 0x63, 0x0f, 0x47, 0x87, 0x8a, 0xc4, 0x37, 0xa6, 0xb9, 0x55, 0x32, 0x84, 0x5b, 0xa3, 0xab, 0x67, + 0xd4, 0x13, 0xae, 0xc7, 0xac, 0x1b, 0xd6, 0x6e, 0x47, 0x5b, 0x3d, 0xbc, 0x74, 0x6d, 0xe6, 0x8d, + 0x59, 0xb4, 0xc9, 0x66, 0x22, 0x92, 0x5c, 0x03, 0x37, 0xee, 0xc2, 0x46, 0x3e, 0x7e, 0xc9, 0x06, + 0x54, 0xc4, 0x22, 0xd2, 0xb0, 0x22, 0x16, 0x86, 0x91, 0xf8, 0x5e, 0x12, 0x44, 0x37, 0x78, 0xf6, + 0xa1, 0x5d, 0x08, 0xe8, 0x8c, 0xb9, 0xb5, 0xac, 0xb9, 0x8d, 0x36, 0xac, 0xe7, 0xe2, 0xd8, 0xf8, + 0xbc, 0x06, 0x4d, 0x93, 0xf1, 0x00, 0xdd, 0x88, 0x1c, 0x83, 0xce, 0x16, 0x63, 0xa6, 0x52, 0xa8, + 0x56, 0x48, 0x50, 0x8a, 0xe7, 0x61, 0x4c, 0xc7, 0x50, 0x4e, 0x98, 0xc9, 0x7e, 0x2e, 0xfd, 0x6f, + 0x16, 0x85, 0xb2, 0xf9, 0xff, 0x20, 0x9f, 0xff, 0x6f, 0x15, 0x78, 0x0b, 0x00, 0xb0, 0x9f, 0x03, + 0x80, 0xe2, 0xc6, 0x39, 0x04, 0x78, 0x50, 0x82, 0x00, 0xc5, 0xe3, 0x2f, 0x81, 0x80, 0x07, 0x25, + 0x10, 0xd0, 0xbd, 0xf1, 0xad, 0x52, 0x0c, 0x38, 0xc8, 0x63, 0x40, 0x51, 0x9d, 0x02, 0x08, 0x7c, + 0xaf, 0x0c, 0x04, 0xee, 0x14, 0x64, 0x96, 0xa2, 0xc0, 0xdb, 0x37, 0x50, 0x60, 0xab, 0x20, 0x5a, + 0x02, 0x03, 0x0f, 0x72, 0xf9, 0x19, 0x4a, 0x75, 0x2b, 0x4f, 0xd0, 0xe4, 0x9d, 0x9b, 0x08, 0xb2, + 0x5d, 0xbc, 0xda, 0x32, 0x08, 0x39, 0x2c, 0x40, 0xc8, 0xed, 0xe2, 0x29, 0x0b, 0x18, 0x92, 0x22, + 0xc1, 0x3e, 0xc6, 0x7d, 0xc1, 0xd3, 0x30, 0x47, 0xb0, 0x30, 0xf4, 0xc3, 0x28, 0x55, 0xab, 0x89, + 0xb1, 0x87, 0x99, 0x28, 0xf5, 0xaf, 0x17, 0xa0, 0x86, 0x74, 0xfa, 0x8c, 0x77, 0x19, 0xbf, 0xd6, + 0x52, 0x59, 0x19, 0xd1, 0xd9, 0x2c, 0xa6, 0x47, 0x59, 0x2c, 0x03, 0x26, 0x95, 0x1c, 0x98, 0x90, + 0x6f, 0xc1, 0x6b, 0x32, 0x8d, 0x48, 0xbb, 0x58, 0xb9, 0xb4, 0xd6, 0x46, 0x82, 0x32, 0x88, 0xca, + 0x6f, 0x6f, 0xc1, 0x66, 0x86, 0x17, 0x53, 0xac, 0x4c, 0x61, 0x55, 0x19, 0xbc, 0x9d, 0x84, 0xfb, + 0x24, 0x08, 0x86, 0x94, 0x4f, 0x8c, 0x1f, 0xa5, 0xfa, 0xa7, 0x40, 0x45, 0xa0, 0x3a, 0xf6, 0x6d, + 0xa5, 0xd6, 0xba, 0x29, 0xc7, 0x08, 0x5e, 0x53, 0xdf, 0x91, 0x5f, 0xd5, 0x4d, 0x1c, 0x22, 0x57, + 0x12, 0x29, 0xba, 0x0a, 0x09, 0xe3, 0x97, 0x5a, 0xba, 0x5f, 0x8a, 0x5d, 0x65, 0x30, 0xa3, 0xfd, + 0x2f, 0x30, 0x53, 0x79, 0x59, 0x98, 0x31, 0x7e, 0xa7, 0xa5, 0x77, 0x91, 0x00, 0xc8, 0xab, 0x29, + 0x87, 0x6e, 0xe1, 0x7a, 0x36, 0x5b, 0xc8, 0x50, 0x5f, 0x35, 0xd5, 0x24, 0x46, 0xf5, 0xba, 0x34, + 0x70, 0x1e, 0xd5, 0x1b, 0x72, 0x4d, 0x4d, 0x22, 0xe0, 0xf1, 0x2f, 0x64, 0x0c, 0xae, 0x99, 0x6a, + 0x92, 0xc9, 0x9b, 0x7a, 0x2e, 0x6f, 0x9e, 0x03, 0xb9, 0x19, 0x9d, 0xe4, 0x5d, 0xa8, 0x0a, 0xea, + 0xa0, 0xf1, 0x50, 0xff, 0x8d, 0xbe, 0xaa, 0x91, 0xfb, 0x1f, 0x3d, 0x39, 0xa7, 0x6e, 0x38, 0xd8, + 0x42, 0xed, 0xff, 0xfd, 0x7c, 0x77, 0x03, 0x79, 0x0e, 0xfc, 0x99, 0x2b, 0xd8, 0x2c, 0x10, 0x57, + 0xa6, 0x94, 0x31, 0xfe, 0xaa, 0x61, 0xd6, 0xce, 0x45, 0x6d, 0xa9, 0x2d, 0x62, 0xd7, 0xac, 0x64, + 0x00, 0xf6, 0xe5, 0xec, 0xf3, 0x75, 0x00, 0x87, 0x72, 0xeb, 0x33, 0xea, 0x09, 0x66, 0x47, 0x46, + 0xd2, 0x1d, 0xca, 0x7f, 0x26, 0x17, 0xb0, 0x0e, 0x41, 0xf2, 0x9c, 0x33, 0x5b, 0x5a, 0x6b, 0xd5, + 0x6c, 0x38, 0x94, 0x7f, 0xc2, 0x99, 0x9d, 0xe8, 0xd5, 0x78, 0x05, 0xbd, 0xfe, 0x96, 0x71, 0xb9, + 0x14, 0xb2, 0xfe, 0x1f, 0x34, 0xfb, 0x52, 0x43, 0x2c, 0xce, 0xa7, 0x3d, 0x72, 0x0a, 0xaf, 0x25, + 0xee, 0x6d, 0xcd, 0x03, 0x9b, 0x62, 0xe5, 0xa4, 0xbd, 0x30, 0x1e, 0x3a, 0x89, 0xc0, 0x27, 0x8a, + 0x9f, 0xfc, 0x18, 0xb6, 0x0b, 0x01, 0x99, 0x6c, 0x55, 0x79, 0x61, 0x5c, 0xde, 0xce, 0xc7, 0x65, + 0xbc, 0x5f, 0xac, 0xe5, 0xea, 0x2b, 0x68, 0xf9, 0x4d, 0x2c, 0x49, 0xb2, 0x69, 0xba, 0xec, 0x9e, + 0x8c, 0xdf, 0x68, 0xd0, 0x2e, 0x1c, 0x86, 0x1c, 0x02, 0xa8, 0x2c, 0xc7, 0xdd, 0x67, 0x71, 0x61, + 0x1c, 0xdb, 0x40, 0x1a, 0xeb, 0x91, 0xfb, 0x8c, 0x99, 0xfa, 0x28, 0x1e, 0x92, 0x7b, 0xd0, 0x10, + 0x0b, 0xc5, 0x9d, 0x2f, 0xde, 0x1e, 0x2f, 0x24, 0x6b, 0x5d, 0xc8, 0x7f, 0x72, 0x1f, 0xd6, 0xd4, + 0xc6, 0x8e, 0xcf, 0xb9, 0x1b, 0x44, 0x85, 0x03, 0xc9, 0x6e, 0xfd, 0xa1, 0xa4, 0x98, 0xad, 0x51, + 0x3a, 0x31, 0x7e, 0x0e, 0x7a, 0xf2, 0x59, 0xf2, 0x3a, 0xe8, 0x33, 0xba, 0x88, 0x2a, 0x5b, 0x3c, + 0x5b, 0xcd, 0x6c, 0xce, 0xe8, 0x42, 0x16, 0xb5, 0x64, 0x1b, 0x1a, 0x48, 0x14, 0x0b, 0x65, 0xef, + 0x9a, 0x59, 0x9f, 0xd1, 0xc5, 0xe3, 0x45, 0x42, 0x70, 0x28, 0x8f, 0xcb, 0xd6, 0x19, 0x5d, 0x7c, + 0x48, 0xb9, 0xf1, 0x3e, 0xd4, 0xd5, 0x21, 0x5f, 0x6a, 0x63, 0x94, 0xaf, 0xe4, 0xe4, 0x7f, 0x00, + 0xad, 0xcc, 0xb9, 0xc9, 0x77, 0xe0, 0xb6, 0xd2, 0x30, 0xa0, 0xa1, 0x90, 0x16, 0xc9, 0x6d, 0x48, + 0x24, 0xf1, 0x9c, 0x86, 0x02, 0x3f, 0xa9, 0x0a, 0xf1, 0x10, 0x36, 0xf2, 0xc5, 0x2a, 0xf9, 0x06, + 0xac, 0x45, 0x85, 0x6d, 0xe8, 0xcf, 0x3d, 0x3b, 0x92, 0x6d, 0xa9, 0x35, 0x13, 0x97, 0xc8, 0xf7, + 0x4b, 0xd2, 0x76, 0x8c, 0xe8, 0x8f, 0x5c, 0xc7, 0x73, 0x3d, 0xe7, 0x45, 0xd9, 0xfb, 0x4f, 0x15, + 0xa8, 0xab, 0xc2, 0x9a, 0xdc, 0xcb, 0x74, 0x31, 0x12, 0x35, 0x07, 0xad, 0xeb, 0xe7, 0xbb, 0x0d, + 0x09, 0x30, 0x67, 0x1f, 0xa4, 0x2d, 0x4d, 0x9a, 0x50, 0x2b, 0xb9, 0xba, 0x3f, 0xee, 0x9f, 0x56, + 0xbf, 0x72, 0xff, 0xb4, 0x0d, 0x0d, 0x6f, 0x3e, 0x93, 0x97, 0x55, 0x55, 0x97, 0xe5, 0xcd, 0x67, + 0x78, 0x59, 0xaf, 0x83, 0x2e, 0x7c, 0x41, 0xa7, 0x92, 0xa4, 0x92, 0x42, 0x53, 0x2e, 0x20, 0xf1, + 0x1e, 0xb4, 0xb3, 0x98, 0x8d, 0x18, 0xac, 0x20, 0x62, 0x3d, 0x45, 0x6c, 0xec, 0x27, 0xde, 0x80, + 0x76, 0xaa, 0xb0, 0xe2, 0x53, 0xb0, 0xb1, 0x91, 0x2e, 0x4b, 0xc6, 0x3b, 0xd0, 0x4c, 0xd0, 0x5c, + 0x41, 0x48, 0x83, 0x2a, 0x10, 0x27, 0xfb, 0xd0, 0x09, 0x42, 0x3f, 0xf0, 0x39, 0x0b, 0x2d, 0x6a, + 0xdb, 0x21, 0xe3, 0x5c, 0xc2, 0xc9, 0x9a, 0xd9, 0x8e, 0xd7, 0x4f, 0xd4, 0xb2, 0xe1, 0x82, 0x9e, + 0x18, 0x1c, 0x2b, 0x8e, 0x98, 0x5d, 0x8b, 0x76, 0x54, 0x53, 0x72, 0x00, 0x8d, 0x60, 0x3e, 0xb2, + 0x10, 0xd8, 0xf2, 0x91, 0x72, 0x3e, 0x1f, 0x7d, 0xc4, 0xae, 0xe2, 0x36, 0x27, 0x90, 0x33, 0x09, + 0x6d, 0xfe, 0x67, 0x2c, 0x8c, 0x7c, 0x56, 0x4d, 0x0c, 0x01, 0x9d, 0xe2, 0x15, 0x93, 0xef, 0x82, + 0x9e, 0xa8, 0x55, 0x88, 0xd8, 0xa2, 0x1f, 0xa4, 0x8c, 0x58, 0xff, 0x70, 0xd7, 0xf1, 0x98, 0x6d, + 0xa5, 0x26, 0x95, 0xe7, 0x6a, 0x9a, 0x6d, 0x45, 0xf8, 0x38, 0xb6, 0xa9, 0xf1, 0x6d, 0xa8, 0xab, + 0x33, 0x62, 0x1a, 0xc1, 0x9d, 0xe3, 0x1a, 0x0b, 0xc7, 0xa5, 0xa9, 0xe5, 0x2f, 0x1a, 0x34, 0xe3, + 0xde, 0xa9, 0x54, 0x28, 0x77, 0xe8, 0xca, 0xcb, 0x1e, 0x7a, 0x59, 0x03, 0x1a, 0x3b, 0x62, 0xf5, + 0x2b, 0x3b, 0xe2, 0x01, 0x10, 0xe5, 0x6f, 0x97, 0xbe, 0x70, 0x3d, 0xc7, 0x52, 0x36, 0x57, 0x8e, + 0xd7, 0x91, 0x94, 0x27, 0x92, 0x70, 0x8e, 0xeb, 0x47, 0x9f, 0xd7, 0xa0, 0x7d, 0x32, 0x38, 0x3d, + 0x3b, 0x09, 0x82, 0xa9, 0x3b, 0xa6, 0xb2, 0xb0, 0x3b, 0x84, 0xaa, 0x2c, 0x5d, 0x4b, 0x9e, 0xcb, + 0x7a, 0x65, 0x3d, 0x14, 0x39, 0x82, 0x9a, 0xac, 0x60, 0x49, 0xd9, 0xab, 0x59, 0xaf, 0xb4, 0x95, + 0xc2, 0x8f, 0xa8, 0x1a, 0xf7, 0xe6, 0xe3, 0x59, 0xaf, 0xac, 0x9f, 0x22, 0xef, 0x83, 0x9e, 0xd6, + 0x9e, 0xcb, 0x9e, 0xd0, 0x7a, 0x4b, 0x3b, 0x2b, 0x94, 0x4f, 0x81, 0x7f, 0xd9, 0x4b, 0x50, 0x6f, + 0x69, 0x0b, 0x42, 0x8e, 0xa1, 0x11, 0x17, 0x44, 0xe5, 0x8f, 0x5c, 0xbd, 0x25, 0x5d, 0x0f, 0x9a, + 0x47, 0x15, 0x95, 0x65, 0x2f, 0x71, 0xbd, 0xd2, 0xd6, 0x8c, 0xdc, 0x87, 0x7a, 0x84, 0x73, 0xa5, + 0x0f, 0x5d, 0xbd, 0xf2, 0xde, 0x05, 0x95, 0x4c, 0x0b, 0xea, 0x65, 0xaf, 0x85, 0xbd, 0xa5, 0x3d, + 0x24, 0x39, 0x01, 0xc8, 0x14, 0x92, 0x4b, 0x9f, 0x01, 0x7b, 0xcb, 0x7b, 0x43, 0xf2, 0x1e, 0x34, + 0xd3, 0x7e, 0xbf, 0xfc, 0x61, 0xaf, 0xb7, 0xac, 0x5d, 0x1b, 0x7c, 0xed, 0x3f, 0xff, 0xdc, 0xd1, + 0x7e, 0x7b, 0xbd, 0xa3, 0xfd, 0xfe, 0x7a, 0x47, 0xfb, 0xe2, 0x7a, 0x47, 0xfb, 0xf3, 0xf5, 0x8e, + 0xf6, 0x8f, 0xeb, 0x1d, 0xed, 0x0f, 0x5f, 0xee, 0x68, 0xa3, 0xba, 0x74, 0xff, 0xb7, 0xff, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0x79, 0xfd, 0x53, 0xad, 0x8b, 0x16, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index 6e6b1cd3..c64ece24 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -249,7 +249,7 @@ message Header { bytes app_hash = 8; // consensus - Validator proposer = 9 [(gogoproto.nullable)=false]; + bytes proposer_address = 9; } // Validator diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index e3171818..eab3acdf 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -57,8 +57,8 @@ type Header struct { ConsensusParamsHash []byte // SimpleMerkle of the ConsensusParams // consensus - Proposer []byte // Address of the block proposer EvidenceHash []byte // SimpleMerkle of []Evidence + ProposerAddress []byte // Address of the original proposer of the block } ``` @@ -300,13 +300,13 @@ block.ConsensusParamsHash == SimpleMerkleRoot(state.ConsensusParams) Simple Merkle root of the consensus parameters. May be updated by the application. -### Proposer +### ProposerAddress ```go -block.Header.Proposer in state.Validators +block.Header.ProposerAddress in state.Validators ``` -Original proposer of the block. Must be a current validator. +Address of the original proposer of the block. Must be a current validator. NOTE: we also need to track the round. diff --git a/state/state.go b/state/state.go index 8a813056..ec3fd1a0 100644 --- a/state/state.go +++ b/state/state.go @@ -98,7 +98,8 @@ func (state State) IsEmpty() bool { //------------------------------------------------------------------------ // Create a block from the latest state -// MakeBlock builds a block from the current state with the given txs, commit, and evidence. +// MakeBlock builds a block from the current state with the given txs, commit, +// and evidence. func (state State) MakeBlock( height int64, txs []types.Tx, @@ -121,6 +122,8 @@ func (state State) MakeBlock( block.AppHash = state.AppHash block.LastResultsHash = state.LastResultsHash + block.ProposerAddress = state.Validators.GetProposer().Address + return block, block.MakePartSet(state.ConsensusParams.BlockGossip.BlockPartSizeBytes) } diff --git a/state/state_test.go b/state/state_test.go index ad28b0a9..90f1cfcd 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -301,6 +301,17 @@ func genValSet(size int) *types.ValidatorSet { return types.NewValidatorSet(vals) } +func TestStateMakeBlock(t *testing.T) { + tearDown, _, state := setupTestCase(t) + defer tearDown(t) + + proposerAddress := state.Validators.GetProposer().Address + block := makeBlock(state, 2) + + // test we set proposer address + assert.Equal(t, proposerAddress, block.ProposerAddress) +} + // TestConsensusParamsChangesSaveLoad tests saving and loading consensus params // with changes. func TestConsensusParamsChangesSaveLoad(t *testing.T) { diff --git a/state/validation.go b/state/validation.go index 85d0ce90..0aacf58d 100644 --- a/state/validation.go +++ b/state/validation.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tendermint/libs/db" + "github.com/tendermint/tendermint/types" ) //----------------------------------------------------- @@ -20,10 +20,18 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { // Validate basic info. if block.ChainID != state.ChainID { - return fmt.Errorf("Wrong Block.Header.ChainID. Expected %v, got %v", state.ChainID, block.ChainID) + return fmt.Errorf( + "Wrong Block.Header.ChainID. Expected %v, got %v", + state.ChainID, + block.ChainID, + ) } if block.Height != state.LastBlockHeight+1 { - return fmt.Errorf("Wrong Block.Header.Height. Expected %v, got %v", state.LastBlockHeight+1, block.Height) + return fmt.Errorf( + "Wrong Block.Header.Height. Expected %v, got %v", + state.LastBlockHeight+1, + block.Height, + ) } /* TODO: Determine bounds for Time See blockchain/reactor "stopSyncingDurationMinutes" @@ -35,25 +43,49 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { // Validate prev block info. if !block.LastBlockID.Equals(state.LastBlockID) { - return fmt.Errorf("Wrong Block.Header.LastBlockID. Expected %v, got %v", state.LastBlockID, block.LastBlockID) + return fmt.Errorf( + "Wrong Block.Header.LastBlockID. Expected %v, got %v", + state.LastBlockID, + block.LastBlockID, + ) } newTxs := int64(len(block.Data.Txs)) if block.TotalTxs != state.LastBlockTotalTx+newTxs { - return fmt.Errorf("Wrong Block.Header.TotalTxs. Expected %v, got %v", state.LastBlockTotalTx+newTxs, block.TotalTxs) + return fmt.Errorf( + "Wrong Block.Header.TotalTxs. Expected %v, got %v", + state.LastBlockTotalTx+newTxs, + block.TotalTxs, + ) } // Validate app info if !bytes.Equal(block.AppHash, state.AppHash) { - return fmt.Errorf("Wrong Block.Header.AppHash. Expected %X, got %v", state.AppHash, block.AppHash) + return fmt.Errorf( + "Wrong Block.Header.AppHash. Expected %X, got %v", + state.AppHash, + block.AppHash, + ) } if !bytes.Equal(block.ConsensusHash, state.ConsensusParams.Hash()) { - return fmt.Errorf("Wrong Block.Header.ConsensusHash. Expected %X, got %v", state.ConsensusParams.Hash(), block.ConsensusHash) + return fmt.Errorf( + "Wrong Block.Header.ConsensusHash. Expected %X, got %v", + state.ConsensusParams.Hash(), + block.ConsensusHash, + ) } if !bytes.Equal(block.LastResultsHash, state.LastResultsHash) { - return fmt.Errorf("Wrong Block.Header.LastResultsHash. Expected %X, got %v", state.LastResultsHash, block.LastResultsHash) + return fmt.Errorf( + "Wrong Block.Header.LastResultsHash. Expected %X, got %v", + state.LastResultsHash, + block.LastResultsHash, + ) } if !bytes.Equal(block.ValidatorsHash, state.Validators.Hash()) { - return fmt.Errorf("Wrong Block.Header.ValidatorsHash. Expected %X, got %v", state.Validators.Hash(), block.ValidatorsHash) + return fmt.Errorf( + "Wrong Block.Header.ValidatorsHash. Expected %X, got %v", + state.Validators.Hash(), + block.ValidatorsHash, + ) } if !bytes.Equal(block.NextValidatorsHash, state.NextValidators.Hash()) { return fmt.Errorf("Wrong Block.Header.NextValidatorsHash. Expected %X, got %v", state.NextValidators.Hash(), block.NextValidatorsHash) @@ -66,8 +98,11 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } } else { if len(block.LastCommit.Precommits) != state.LastValidators.Size() { - return fmt.Errorf("Invalid block commit size. Expected %v, got %v", - state.LastValidators.Size(), len(block.LastCommit.Precommits)) + return fmt.Errorf( + "Invalid block commit size. Expected %v, got %v", + state.LastValidators.Size(), + len(block.LastCommit.Precommits), + ) } err := state.LastValidators.VerifyCommit( state.ChainID, state.LastBlockID, block.Height-1, block.LastCommit) @@ -86,6 +121,14 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } } + if !bytes.Equal(block.ProposerAddress, state.Validators.GetProposer().Address) { + return fmt.Errorf( + "Wrong Block.Header.ProposerAddress. Expected %X, got %v", + state.Validators.GetProposer().Address, + block.ProposerAddress, + ) + } + return nil } diff --git a/state/validation_test.go b/state/validation_test.go index 362a4073..b4829b00 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/ed25519" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" ) @@ -65,4 +66,10 @@ func TestValidateBlock(t *testing.T) { block.ValidatorsHash = []byte("wrong validators hash") err = blockExec.ValidateBlock(state, block) require.Error(t, err) + + // wrong proposer address + block = makeBlock(state, 1) + block.ProposerAddress = ed25519.GenPrivKey().PubKey().Address() + err = blockExec.ValidateBlock(state, block) + require.Error(t, err) } diff --git a/types/block.go b/types/block.go index fe3a2bbc..bb816963 100644 --- a/types/block.go +++ b/types/block.go @@ -23,9 +23,10 @@ type Block struct { LastCommit *Commit `json:"last_commit"` } -// MakeBlock returns a new block with an empty header, except what can be computed from itself. -// It populates the same set of fields validated by ValidateBasic -func MakeBlock(height int64, txs []Tx, commit *Commit, evidence []Evidence) *Block { +// MakeBlock returns a new block with an empty header, except what can be +// computed from itself. +// It populates the same set of fields validated by ValidateBasic. +func MakeBlock(height int64, txs []Tx, lastCommit *Commit, evidence []Evidence) *Block { block := &Block{ Header: Header{ Height: height, @@ -36,7 +37,7 @@ func MakeBlock(height int64, txs []Tx, commit *Commit, evidence []Evidence) *Blo Txs: txs, }, Evidence: EvidenceData{Evidence: evidence}, - LastCommit: commit, + LastCommit: lastCommit, } block.fillHeader() return block @@ -53,10 +54,18 @@ func (b *Block) ValidateBasic() error { newTxs := int64(len(b.Data.Txs)) if b.NumTxs != newTxs { - return fmt.Errorf("Wrong Block.Header.NumTxs. Expected %v, got %v", newTxs, b.NumTxs) + return fmt.Errorf( + "Wrong Block.Header.NumTxs. Expected %v, got %v", + newTxs, + b.NumTxs, + ) } if !bytes.Equal(b.LastCommitHash, b.LastCommit.Hash()) { - return fmt.Errorf("Wrong Block.Header.LastCommitHash. Expected %v, got %v", b.LastCommitHash, b.LastCommit.Hash()) + return fmt.Errorf( + "Wrong Block.Header.LastCommitHash. Expected %v, got %v", + b.LastCommitHash, + b.LastCommit.Hash(), + ) } if b.Header.Height != 1 { if err := b.LastCommit.ValidateBasic(); err != nil { @@ -64,10 +73,18 @@ func (b *Block) ValidateBasic() error { } } if !bytes.Equal(b.DataHash, b.Data.Hash()) { - return fmt.Errorf("Wrong Block.Header.DataHash. Expected %v, got %v", b.DataHash, b.Data.Hash()) + return fmt.Errorf( + "Wrong Block.Header.DataHash. Expected %v, got %v", + b.DataHash, + b.Data.Hash(), + ) } if !bytes.Equal(b.EvidenceHash, b.Evidence.Hash()) { - return errors.New(cmn.Fmt("Wrong Block.Header.EvidenceHash. Expected %v, got %v", b.EvidenceHash, b.Evidence.Hash())) + return fmt.Errorf( + "Wrong Block.Header.EvidenceHash. Expected %v, got %v", + b.EvidenceHash, + b.Evidence.Hash(), + ) } return nil } @@ -200,7 +217,8 @@ type Header struct { LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block // consensus info - EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block + EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block + ProposerAddress Address `json:"proposer_address"` // original proposer of the block } // Hash returns the hash of the header. @@ -226,6 +244,7 @@ func (h *Header) Hash() cmn.HexBytes { "Consensus": aminoHasher(h.ConsensusHash), "Results": aminoHasher(h.LastResultsHash), "Evidence": aminoHasher(h.EvidenceHash), + "Proposer": aminoHasher(h.ProposerAddress), }) } @@ -249,6 +268,7 @@ func (h *Header) StringIndented(indent string) string { %s Consensus: %v %s Results: %v %s Evidence: %v +%s Proposer: %v %s}#%v`, indent, h.ChainID, indent, h.Height, @@ -264,6 +284,7 @@ func (h *Header) StringIndented(indent string) string { indent, h.ConsensusHash, indent, h.LastResultsHash, indent, h.EvidenceHash, + indent, h.ProposerAddress, indent, h.Hash()) } diff --git a/types/block_test.go b/types/block_test.go index 50695c84..8e595776 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -44,6 +44,7 @@ func TestBlockValidateBasic(t *testing.T) { block := MakeBlock(h, txs, commit, evList) require.NotNil(t, block) + block.ProposerAddress = valSet.GetProposer().Address // proper block must pass err = block.ValidateBasic() diff --git a/types/protobuf.go b/types/protobuf.go index 01d4ebf0..57161915 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -46,7 +46,7 @@ func (tm2pb) Header(header *Header) abci.Header { ValidatorsHash: header.ValidatorsHash, AppHash: header.AppHash, - // Proposer: TODO + ProposerAddress: header.ProposerAddress, } } diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 8711974e..b1c01290 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -76,13 +76,15 @@ func TestABCIConsensusParams(t *testing.T) { func TestABCIHeader(t *testing.T) { header := &Header{ - Height: int64(3), - Time: time.Now(), - NumTxs: int64(10), + Height: int64(3), + Time: time.Now(), + NumTxs: int64(10), + ProposerAddress: []byte("cloak"), } abciHeader := TM2PB.Header(header) assert.Equal(t, int64(3), abciHeader.Height) + assert.Equal(t, []byte("cloak"), abciHeader.ProposerAddress) } func TestABCIEvidence(t *testing.T) { From 4d998b7c0397f0513609249d8876078de2d0f92c Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 4 Aug 2018 22:42:39 -0400 Subject: [PATCH 034/149] consensus: failing test for ProposerAddress --- consensus/state_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/consensus/state_test.go b/consensus/state_test.go index 6a14e17b..8ffdb903 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -8,10 +8,10 @@ import ( "time" cstypes "github.com/tendermint/tendermint/consensus/types" - tmpubsub "github.com/tendermint/tendermint/libs/pubsub" - "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" + tmpubsub "github.com/tendermint/tendermint/libs/pubsub" + "github.com/tendermint/tendermint/types" ) func init() { @@ -104,8 +104,13 @@ func TestStateProposerSelection2(t *testing.T) { // everyone just votes nil. we get a new proposer each round for i := 0; i < len(vss); i++ { prop := cs1.GetRoundState().Validators.GetProposer() - if !bytes.Equal(prop.Address, vss[(i+2)%len(vss)].GetAddress()) { - panic(cmn.Fmt("expected proposer to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) + correctProposer := vss[(i+2)%len(vss)].GetAddress() + if !bytes.Equal(prop.Address, correctProposer) { + panic(cmn.Fmt("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) + } + block, _ := cs1.createProposalBlock() + if !bytes.Equal(block.ProposerAddress, correctProposer) { + panic(cmn.Fmt("expected block.ProposerAddress to be validator %d. Got %X", (i+2)%len(vss), block.ProposerAddress)) } rs := cs1.GetRoundState() From e1062a657f36bb93bc384751a05a81ddbf34cc60 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 4 Aug 2018 23:01:02 -0400 Subject: [PATCH 035/149] fixes for ProposerAddress - state.MakeBlock takes a proposerAddr - validateBlock only checks that the ProposerAddress is in the validator set - fix raceyness from bad proposer test: - use privValidator to get the proposer address (instead of racy state) - note we had to remove the test that checked the correct proposer was included for higher rounds because we don't have a good way to test this with multiple consensus states and not using the privValidator.Address while calling createProposalBlock was a hack! --- blockchain/reactor_test.go | 2 +- consensus/state.go | 3 ++- consensus/state_test.go | 4 ---- state/execution_test.go | 6 +++--- state/state.go | 8 ++++++-- state/validation.go | 10 +++++++--- state/validation_test.go | 3 +++ 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/blockchain/reactor_test.go b/blockchain/reactor_test.go index 11991bda..f590fd52 100644 --- a/blockchain/reactor_test.go +++ b/blockchain/reactor_test.go @@ -156,7 +156,7 @@ func makeTxs(height int64) (txs []types.Tx) { } func makeBlock(height int64, state sm.State) *types.Block { - block, _ := state.MakeBlock(height, makeTxs(height), new(types.Commit), nil) + block, _ := state.MakeBlock(height, makeTxs(height), new(types.Commit), nil, state.Validators.GetProposer().Address) return block } diff --git a/consensus/state.go b/consensus/state.go index 97734d08..a5ade13c 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -949,7 +949,8 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts // Mempool validated transactions txs := cs.mempool.Reap(cs.state.ConsensusParams.BlockSize.MaxTxs) evidence := cs.evpool.PendingEvidence() - block, parts := cs.state.MakeBlock(cs.Height, txs, commit, evidence) + proposerAddr := cs.privValidator.GetAddress() + block, parts := cs.state.MakeBlock(cs.Height, txs, commit, evidence, proposerAddr) return block, parts } diff --git a/consensus/state_test.go b/consensus/state_test.go index 8ffdb903..d943be87 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -108,10 +108,6 @@ func TestStateProposerSelection2(t *testing.T) { if !bytes.Equal(prop.Address, correctProposer) { panic(cmn.Fmt("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) } - block, _ := cs1.createProposalBlock() - if !bytes.Equal(block.ProposerAddress, correctProposer) { - panic(cmn.Fmt("expected block.ProposerAddress to be validator %d. Got %X", (i+2)%len(vss), block.ProposerAddress)) - } rs := cs1.GetRoundState() signAddVotes(cs1, types.VoteTypePrecommit, nil, rs.ProposalBlockParts.Header(), vss[1:]...) diff --git a/state/execution_test.go b/state/execution_test.go index 53c5c882..d5b0dda0 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -79,7 +79,7 @@ func TestBeginBlockValidators(t *testing.T) { lastCommit := &types.Commit{BlockID: prevBlockID, Precommits: tc.lastCommitPrecommits} // block for height 2 - block, _ := state.MakeBlock(2, makeTxs(2), lastCommit, nil) + block, _ := state.MakeBlock(2, makeTxs(2), lastCommit, nil, state.Validators.GetProposer().Address) _, err = ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), state.Validators, stateDB) require.Nil(t, err, tc.desc) @@ -138,7 +138,7 @@ func TestBeginBlockByzantineValidators(t *testing.T) { lastCommit := &types.Commit{BlockID: prevBlockID, Precommits: votes} for _, tc := range testCases { - block, _ := state.MakeBlock(10, makeTxs(2), lastCommit, nil) + block, _ := state.MakeBlock(10, makeTxs(2), lastCommit, nil, state.Validators.GetProposer().Address) block.Time = now block.Evidence.Evidence = tc.evidence _, err = ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), state.Validators, stateDB) @@ -269,7 +269,7 @@ func state(nVals, height int) (State, dbm.DB) { } func makeBlock(state State, height int64) *types.Block { - block, _ := state.MakeBlock(height, makeTxs(state.LastBlockHeight), new(types.Commit), nil) + block, _ := state.MakeBlock(height, makeTxs(state.LastBlockHeight), new(types.Commit), nil, state.Validators.GetProposer().Address) return block } diff --git a/state/state.go b/state/state.go index ec3fd1a0..0315e734 100644 --- a/state/state.go +++ b/state/state.go @@ -99,12 +99,14 @@ func (state State) IsEmpty() bool { // Create a block from the latest state // MakeBlock builds a block from the current state with the given txs, commit, -// and evidence. +// and evidence. Note it also takes a proposerAddress because the state does not +// track rounds, and hence doesn't know the correct proposer. TODO: alleviate this! func (state State) MakeBlock( height int64, txs []types.Tx, commit *types.Commit, evidence []types.Evidence, + proposerAddress []byte, ) (*types.Block, *types.PartSet) { // Build base block with block data. @@ -122,7 +124,9 @@ func (state State) MakeBlock( block.AppHash = state.AppHash block.LastResultsHash = state.LastResultsHash - block.ProposerAddress = state.Validators.GetProposer().Address + // NOTE: we can't use the state.Validators because we don't + // IncrementAccum for rounds there. + block.ProposerAddress = proposerAddress return block, block.MakePartSet(state.ConsensusParams.BlockGossip.BlockPartSizeBytes) } diff --git a/state/validation.go b/state/validation.go index 0aacf58d..4686d82b 100644 --- a/state/validation.go +++ b/state/validation.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" + "github.com/tendermint/go-crypto/tmhash" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/types" ) @@ -121,10 +122,13 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } } - if !bytes.Equal(block.ProposerAddress, state.Validators.GetProposer().Address) { + // NOTE: We can't actually verify it's the right proposer because we dont + // know what round the block was first proposed. So just check that it's + // a legit address and a known validator. + if len(block.ProposerAddress) != tmhash.Size || + !state.Validators.HasAddress(block.ProposerAddress) { return fmt.Errorf( - "Wrong Block.Header.ProposerAddress. Expected %X, got %v", - state.Validators.GetProposer().Address, + "Block.Header.ProposerAddress, %X, is not a validator", block.ProposerAddress, ) } diff --git a/state/validation_test.go b/state/validation_test.go index b4829b00..ba76a72b 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -72,4 +72,7 @@ func TestValidateBlock(t *testing.T) { block.ProposerAddress = ed25519.GenPrivKey().PubKey().Address() err = blockExec.ValidateBlock(state, block) require.Error(t, err) + block.ProposerAddress = []byte("wrong size") + err = blockExec.ValidateBlock(state, block) + require.Error(t, err) } From d7035abe73666e0ee16b456954654a7a71e6c6ad Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 31 Jul 2018 13:27:27 +0400 Subject: [PATCH 036/149] change ABCI header to match Tendermint exactly Now that Tendermint Amino will be compatible with proto3, the Header in ABCI should exactly match the Tendermint header - they will then be encoded identically in ABCI and in Tendermint Core. Refs #265 --- CHANGELOG_PENDING.md | 1 + Gopkg.lock | 1 - abci/types/types.pb.go | 1276 +++++++++++++++++++++++++++++------- abci/types/types.proto | 38 +- abci/types/typespb_test.go | 248 +++++++ types/block.go | 10 +- types/proto3/block.pb.go | 238 ++++--- types/proto3/block.proto | 5 +- types/protobuf.go | 34 +- 9 files changed, 1514 insertions(+), 337 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 776986d9..84848754 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -8,6 +8,7 @@ BREAKING CHANGES: - [rpc] `/commit` returns a `signed_header` field instead of everything being top-level - [abci] Added address of the original proposer of the block to Header. +- [abci] Change ABCI Header to match Tendermint exactly FEATURES: diff --git a/Gopkg.lock b/Gopkg.lock index df455e8d..33580824 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -519,7 +519,6 @@ "github.com/gogo/protobuf/gogoproto", "github.com/gogo/protobuf/jsonpb", "github.com/gogo/protobuf/proto", - "github.com/gogo/protobuf/types", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index c7473075..e28b422b 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -59,7 +59,7 @@ func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{0} + return fileDescriptor_types_7077ff64ad2a8940, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -481,7 +481,7 @@ func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{1} + return fileDescriptor_types_7077ff64ad2a8940, []int{1} } func (m *RequestEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +527,7 @@ func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{2} + return fileDescriptor_types_7077ff64ad2a8940, []int{2} } func (m *RequestFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -567,7 +567,7 @@ func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{3} + return fileDescriptor_types_7077ff64ad2a8940, []int{3} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -616,7 +616,7 @@ func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{4} + return fileDescriptor_types_7077ff64ad2a8940, []int{4} } func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -674,7 +674,7 @@ func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{5} + return fileDescriptor_types_7077ff64ad2a8940, []int{5} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +752,7 @@ func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{6} + return fileDescriptor_types_7077ff64ad2a8940, []int{6} } func (m *RequestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -824,7 +824,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{7} + return fileDescriptor_types_7077ff64ad2a8940, []int{7} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -892,7 +892,7 @@ func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{8} + return fileDescriptor_types_7077ff64ad2a8940, []int{8} } func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -939,7 +939,7 @@ func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{9} + return fileDescriptor_types_7077ff64ad2a8940, []int{9} } func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -986,7 +986,7 @@ func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{10} + return fileDescriptor_types_7077ff64ad2a8940, []int{10} } func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1032,7 +1032,7 @@ func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{11} + return fileDescriptor_types_7077ff64ad2a8940, []int{11} } func (m *RequestCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1085,7 +1085,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{12} + return fileDescriptor_types_7077ff64ad2a8940, []int{12} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1538,7 +1538,7 @@ func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{13} + return fileDescriptor_types_7077ff64ad2a8940, []int{13} } func (m *ResponseException) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1585,7 +1585,7 @@ func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{14} + return fileDescriptor_types_7077ff64ad2a8940, []int{14} } func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1631,7 +1631,7 @@ func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{15} + return fileDescriptor_types_7077ff64ad2a8940, []int{15} } func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1674,7 +1674,7 @@ func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{16} + return fileDescriptor_types_7077ff64ad2a8940, []int{16} } func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1746,7 +1746,7 @@ func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{17} + return fileDescriptor_types_7077ff64ad2a8940, []int{17} } func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1808,7 +1808,7 @@ func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{18} + return fileDescriptor_types_7077ff64ad2a8940, []int{18} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1870,7 +1870,7 @@ func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{19} + return fileDescriptor_types_7077ff64ad2a8940, []int{19} } func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1966,7 +1966,7 @@ func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{20} + return fileDescriptor_types_7077ff64ad2a8940, []int{20} } func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2019,7 +2019,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{21} + return fileDescriptor_types_7077ff64ad2a8940, []int{21} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2114,7 +2114,7 @@ func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{22} + return fileDescriptor_types_7077ff64ad2a8940, []int{22} } func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2205,7 +2205,7 @@ func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{23} + return fileDescriptor_types_7077ff64ad2a8940, []int{23} } func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2267,7 +2267,7 @@ func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{24} + return fileDescriptor_types_7077ff64ad2a8940, []int{24} } func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2318,7 +2318,7 @@ func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } func (*ConsensusParams) ProtoMessage() {} func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{25} + return fileDescriptor_types_7077ff64ad2a8940, []int{25} } func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2382,7 +2382,7 @@ func (m *BlockSize) Reset() { *m = BlockSize{} } func (m *BlockSize) String() string { return proto.CompactTextString(m) } func (*BlockSize) ProtoMessage() {} func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{26} + return fileDescriptor_types_7077ff64ad2a8940, []int{26} } func (m *BlockSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2445,7 +2445,7 @@ func (m *TxSize) Reset() { *m = TxSize{} } func (m *TxSize) String() string { return proto.CompactTextString(m) } func (*TxSize) ProtoMessage() {} func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{27} + return fileDescriptor_types_7077ff64ad2a8940, []int{27} } func (m *TxSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2502,7 +2502,7 @@ func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{28} + return fileDescriptor_types_7077ff64ad2a8940, []int{28} } func (m *BlockGossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2550,7 +2550,7 @@ func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{29} + return fileDescriptor_types_7077ff64ad2a8940, []int{29} } func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2593,21 +2593,26 @@ func (m *LastCommitInfo) GetValidators() []SigningValidator { return nil } -// just the minimum the app might need type Header struct { - // basics - ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,3,opt,name=time,stdtime" json:"time"` - // txs - NumTxs int32 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` - TotalTxs int64 `protobuf:"varint,5,opt,name=total_txs,json=totalTxs,proto3" json:"total_txs,omitempty"` - // hashes - LastBlockHash []byte `protobuf:"bytes,6,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty"` - ValidatorsHash []byte `protobuf:"bytes,7,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - AppHash []byte `protobuf:"bytes,8,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - // consensus - ProposerAddress []byte `protobuf:"bytes,9,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + // basic block info + ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,3,opt,name=time,stdtime" json:"time"` + NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` + TotalTxs int64 `protobuf:"varint,5,opt,name=total_txs,json=totalTxs,proto3" json:"total_txs,omitempty"` + // prev block info + LastBlockId BlockID `protobuf:"bytes,6,opt,name=last_block_id,json=lastBlockId" json:"last_block_id"` + // hashes of block data + LastCommitHash []byte `protobuf:"bytes,7,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` + DataHash []byte `protobuf:"bytes,8,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + // hashes from the app output from the prev block + ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + // consensus info + EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` + ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2617,7 +2622,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{30} + return fileDescriptor_types_7077ff64ad2a8940, []int{30} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2667,7 +2672,7 @@ func (m *Header) GetTime() time.Time { return time.Time{} } -func (m *Header) GetNumTxs() int32 { +func (m *Header) GetNumTxs() int64 { if m != nil { return m.NumTxs } @@ -2681,9 +2686,23 @@ func (m *Header) GetTotalTxs() int64 { return 0 } -func (m *Header) GetLastBlockHash() []byte { +func (m *Header) GetLastBlockId() BlockID { if m != nil { - return m.LastBlockHash + return m.LastBlockId + } + return BlockID{} +} + +func (m *Header) GetLastCommitHash() []byte { + if m != nil { + return m.LastCommitHash + } + return nil +} + +func (m *Header) GetDataHash() []byte { + if m != nil { + return m.DataHash } return nil } @@ -2695,6 +2714,13 @@ func (m *Header) GetValidatorsHash() []byte { return nil } +func (m *Header) GetConsensusHash() []byte { + if m != nil { + return m.ConsensusHash + } + return nil +} + func (m *Header) GetAppHash() []byte { if m != nil { return m.AppHash @@ -2702,6 +2728,20 @@ func (m *Header) GetAppHash() []byte { return nil } +func (m *Header) GetLastResultsHash() []byte { + if m != nil { + return m.LastResultsHash + } + return nil +} + +func (m *Header) GetEvidenceHash() []byte { + if m != nil { + return m.EvidenceHash + } + return nil +} + func (m *Header) GetProposerAddress() []byte { if m != nil { return m.ProposerAddress @@ -2709,6 +2749,116 @@ func (m *Header) GetProposerAddress() []byte { return nil } +type BlockID struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader" json:"parts_header"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockID) Reset() { *m = BlockID{} } +func (m *BlockID) String() string { return proto.CompactTextString(m) } +func (*BlockID) ProtoMessage() {} +func (*BlockID) Descriptor() ([]byte, []int) { + return fileDescriptor_types_7077ff64ad2a8940, []int{31} +} +func (m *BlockID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockID) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockID.Merge(dst, src) +} +func (m *BlockID) XXX_Size() int { + return m.Size() +} +func (m *BlockID) XXX_DiscardUnknown() { + xxx_messageInfo_BlockID.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockID proto.InternalMessageInfo + +func (m *BlockID) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlockID) GetPartsHeader() PartSetHeader { + if m != nil { + return m.PartsHeader + } + return PartSetHeader{} +} + +type PartSetHeader struct { + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_types_7077ff64ad2a8940, []int{32} +} +func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *PartSetHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartSetHeader.Merge(dst, src) +} +func (m *PartSetHeader) XXX_Size() int { + return m.Size() +} +func (m *PartSetHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PartSetHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo + +func (m *PartSetHeader) GetTotal() int32 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *PartSetHeader) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + // Validator type Validator struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` @@ -2723,7 +2873,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{31} + return fileDescriptor_types_7077ff64ad2a8940, []int{33} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2786,7 +2936,7 @@ func (m *SigningValidator) Reset() { *m = SigningValidator{} } func (m *SigningValidator) String() string { return proto.CompactTextString(m) } func (*SigningValidator) ProtoMessage() {} func (*SigningValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{32} + return fileDescriptor_types_7077ff64ad2a8940, []int{34} } func (m *SigningValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2841,7 +2991,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{33} + return fileDescriptor_types_7077ff64ad2a8940, []int{35} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2899,7 +3049,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_2abffab37bc29540, []int{34} + return fileDescriptor_types_7077ff64ad2a8940, []int{36} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3026,6 +3176,10 @@ func init() { golang_proto.RegisterType((*LastCommitInfo)(nil), "types.LastCommitInfo") proto.RegisterType((*Header)(nil), "types.Header") golang_proto.RegisterType((*Header)(nil), "types.Header") + proto.RegisterType((*BlockID)(nil), "types.BlockID") + golang_proto.RegisterType((*BlockID)(nil), "types.BlockID") + proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") + golang_proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") golang_proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterType((*SigningValidator)(nil), "types.SigningValidator") @@ -4611,15 +4765,30 @@ func (this *Header) Equal(that interface{}) bool { if this.TotalTxs != that1.TotalTxs { return false } - if !bytes.Equal(this.LastBlockHash, that1.LastBlockHash) { + if !this.LastBlockId.Equal(&that1.LastBlockId) { + return false + } + if !bytes.Equal(this.LastCommitHash, that1.LastCommitHash) { + return false + } + if !bytes.Equal(this.DataHash, that1.DataHash) { return false } if !bytes.Equal(this.ValidatorsHash, that1.ValidatorsHash) { return false } + if !bytes.Equal(this.ConsensusHash, that1.ConsensusHash) { + return false + } if !bytes.Equal(this.AppHash, that1.AppHash) { return false } + if !bytes.Equal(this.LastResultsHash, that1.LastResultsHash) { + return false + } + if !bytes.Equal(this.EvidenceHash, that1.EvidenceHash) { + return false + } if !bytes.Equal(this.ProposerAddress, that1.ProposerAddress) { return false } @@ -4628,6 +4797,66 @@ func (this *Header) Equal(that interface{}) bool { } return true } +func (this *BlockID) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*BlockID) + if !ok { + that2, ok := that.(BlockID) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Hash, that1.Hash) { + return false + } + if !this.PartsHeader.Equal(&that1.PartsHeader) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PartSetHeader) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PartSetHeader) + if !ok { + that2, ok := that.(PartSetHeader) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Total != that1.Total { + return false + } + if !bytes.Equal(this.Hash, that1.Hash) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} func (this *Validator) Equal(that interface{}) bool { if that == nil { return this == nil @@ -6657,26 +6886,58 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.TotalTxs)) } - if len(m.LastBlockHash) > 0 { - dAtA[i] = 0x32 + dAtA[i] = 0x32 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.LastBlockId.Size())) + n36, err := m.LastBlockId.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n36 + if len(m.LastCommitHash) > 0 { + dAtA[i] = 0x3a i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastBlockHash))) - i += copy(dAtA[i:], m.LastBlockHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LastCommitHash))) + i += copy(dAtA[i:], m.LastCommitHash) + } + if len(m.DataHash) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.DataHash))) + i += copy(dAtA[i:], m.DataHash) } if len(m.ValidatorsHash) > 0 { - dAtA[i] = 0x3a + dAtA[i] = 0x4a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) i += copy(dAtA[i:], m.ValidatorsHash) } + if len(m.ConsensusHash) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) + i += copy(dAtA[i:], m.ConsensusHash) + } if len(m.AppHash) > 0 { - dAtA[i] = 0x42 + dAtA[i] = 0x5a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) i += copy(dAtA[i:], m.AppHash) } + if len(m.LastResultsHash) > 0 { + dAtA[i] = 0x62 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) + i += copy(dAtA[i:], m.LastResultsHash) + } + if len(m.EvidenceHash) > 0 { + dAtA[i] = 0x6a + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) + i += copy(dAtA[i:], m.EvidenceHash) + } if len(m.ProposerAddress) > 0 { - dAtA[i] = 0x4a + dAtA[i] = 0x72 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) i += copy(dAtA[i:], m.ProposerAddress) @@ -6687,6 +6948,73 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *BlockID) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.PartsHeader.Size())) + n37, err := m.PartsHeader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n37 + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Total != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Total)) + } + if len(m.Hash) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *Validator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6711,11 +7039,11 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) - n36, err := m.PubKey.MarshalTo(dAtA[i:]) + n38, err := m.PubKey.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n38 if m.Power != 0 { dAtA[i] = 0x18 i++ @@ -6745,11 +7073,11 @@ func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintTypes(dAtA, i, uint64(m.Validator.Size())) - n37, err := m.Validator.MarshalTo(dAtA[i:]) + n39, err := m.Validator.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n39 if m.SignedLastBlock { dAtA[i] = 0x10 i++ @@ -6823,11 +7151,11 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(m.Validator.Size())) - n38, err := m.Validator.MarshalTo(dAtA[i:]) + n40, err := m.Validator.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n40 if m.Height != 0 { dAtA[i] = 0x18 i++ @@ -6836,11 +7164,11 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) - n39, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) + n41, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n41 if m.TotalVotingPower != 0 { dAtA[i] = 0x28 i++ @@ -7520,7 +7848,7 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { } v34 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) this.Time = *v34 - this.NumTxs = int32(r.Int31()) + this.NumTxs = int64(r.Int63()) if r.Intn(2) == 0 { this.NumTxs *= -1 } @@ -7528,41 +7856,95 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { if r.Intn(2) == 0 { this.TotalTxs *= -1 } - v35 := r.Intn(100) - this.LastBlockHash = make([]byte, v35) - for i := 0; i < v35; i++ { - this.LastBlockHash[i] = byte(r.Intn(256)) - } + v35 := NewPopulatedBlockID(r, easy) + this.LastBlockId = *v35 v36 := r.Intn(100) - this.ValidatorsHash = make([]byte, v36) + this.LastCommitHash = make([]byte, v36) for i := 0; i < v36; i++ { - this.ValidatorsHash[i] = byte(r.Intn(256)) + this.LastCommitHash[i] = byte(r.Intn(256)) } v37 := r.Intn(100) - this.AppHash = make([]byte, v37) + this.DataHash = make([]byte, v37) for i := 0; i < v37; i++ { - this.AppHash[i] = byte(r.Intn(256)) + this.DataHash[i] = byte(r.Intn(256)) } v38 := r.Intn(100) - this.ProposerAddress = make([]byte, v38) + this.ValidatorsHash = make([]byte, v38) for i := 0; i < v38; i++ { + this.ValidatorsHash[i] = byte(r.Intn(256)) + } + v39 := r.Intn(100) + this.ConsensusHash = make([]byte, v39) + for i := 0; i < v39; i++ { + this.ConsensusHash[i] = byte(r.Intn(256)) + } + v40 := r.Intn(100) + this.AppHash = make([]byte, v40) + for i := 0; i < v40; i++ { + this.AppHash[i] = byte(r.Intn(256)) + } + v41 := r.Intn(100) + this.LastResultsHash = make([]byte, v41) + for i := 0; i < v41; i++ { + this.LastResultsHash[i] = byte(r.Intn(256)) + } + v42 := r.Intn(100) + this.EvidenceHash = make([]byte, v42) + for i := 0; i < v42; i++ { + this.EvidenceHash[i] = byte(r.Intn(256)) + } + v43 := r.Intn(100) + this.ProposerAddress = make([]byte, v43) + for i := 0; i < v43; i++ { this.ProposerAddress[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 10) + this.XXX_unrecognized = randUnrecognizedTypes(r, 15) + } + return this +} + +func NewPopulatedBlockID(r randyTypes, easy bool) *BlockID { + this := &BlockID{} + v44 := r.Intn(100) + this.Hash = make([]byte, v44) + for i := 0; i < v44; i++ { + this.Hash[i] = byte(r.Intn(256)) + } + v45 := NewPopulatedPartSetHeader(r, easy) + this.PartsHeader = *v45 + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) + } + return this +} + +func NewPopulatedPartSetHeader(r randyTypes, easy bool) *PartSetHeader { + this := &PartSetHeader{} + this.Total = int32(r.Int31()) + if r.Intn(2) == 0 { + this.Total *= -1 + } + v46 := r.Intn(100) + this.Hash = make([]byte, v46) + for i := 0; i < v46; i++ { + this.Hash[i] = byte(r.Intn(256)) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } func NewPopulatedValidator(r randyTypes, easy bool) *Validator { this := &Validator{} - v39 := r.Intn(100) - this.Address = make([]byte, v39) - for i := 0; i < v39; i++ { + v47 := r.Intn(100) + this.Address = make([]byte, v47) + for i := 0; i < v47; i++ { this.Address[i] = byte(r.Intn(256)) } - v40 := NewPopulatedPubKey(r, easy) - this.PubKey = *v40 + v48 := NewPopulatedPubKey(r, easy) + this.PubKey = *v48 this.Power = int64(r.Int63()) if r.Intn(2) == 0 { this.Power *= -1 @@ -7575,8 +7957,8 @@ func NewPopulatedValidator(r randyTypes, easy bool) *Validator { func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { this := &SigningValidator{} - v41 := NewPopulatedValidator(r, easy) - this.Validator = *v41 + v49 := NewPopulatedValidator(r, easy) + this.Validator = *v49 this.SignedLastBlock = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedTypes(r, 3) @@ -7587,9 +7969,9 @@ func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { this := &PubKey{} this.Type = string(randStringTypes(r)) - v42 := r.Intn(100) - this.Data = make([]byte, v42) - for i := 0; i < v42; i++ { + v50 := r.Intn(100) + this.Data = make([]byte, v50) + for i := 0; i < v50; i++ { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { @@ -7601,14 +7983,14 @@ func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { func NewPopulatedEvidence(r randyTypes, easy bool) *Evidence { this := &Evidence{} this.Type = string(randStringTypes(r)) - v43 := NewPopulatedValidator(r, easy) - this.Validator = *v43 + v51 := NewPopulatedValidator(r, easy) + this.Validator = *v51 this.Height = int64(r.Int63()) if r.Intn(2) == 0 { this.Height *= -1 } - v44 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) - this.Time = *v44 + v52 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) + this.Time = *v52 this.TotalVotingPower = int64(r.Int63()) if r.Intn(2) == 0 { this.TotalVotingPower *= -1 @@ -7638,9 +8020,9 @@ func randUTF8RuneTypes(r randyTypes) rune { return rune(ru + 61) } func randStringTypes(r randyTypes) string { - v45 := r.Intn(100) - tmps := make([]rune, v45) - for i := 0; i < v45; i++ { + v53 := r.Intn(100) + tmps := make([]rune, v53) + for i := 0; i < v53; i++ { tmps[i] = randUTF8RuneTypes(r) } return string(tmps) @@ -7662,11 +8044,11 @@ func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte switch wire { case 0: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) - v46 := r.Int63() + v54 := r.Int63() if r.Intn(2) == 0 { - v46 *= -1 + v54 *= -1 } - dAtA = encodeVarintPopulateTypes(dAtA, uint64(v46)) + dAtA = encodeVarintPopulateTypes(dAtA, uint64(v54)) case 1: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -8459,7 +8841,13 @@ func (m *Header) Size() (n int) { if m.TotalTxs != 0 { n += 1 + sovTypes(uint64(m.TotalTxs)) } - l = len(m.LastBlockHash) + l = m.LastBlockId.Size() + n += 1 + l + sovTypes(uint64(l)) + l = len(m.LastCommitHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.DataHash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } @@ -8467,10 +8855,22 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = len(m.ConsensusHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } l = len(m.AppHash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = len(m.LastResultsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.EvidenceHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } l = len(m.ProposerAddress) if l > 0 { n += 1 + l + sovTypes(uint64(l)) @@ -8481,6 +8881,37 @@ func (m *Header) Size() (n int) { return n } +func (m *BlockID) Size() (n int) { + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = m.PartsHeader.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PartSetHeader) Size() (n int) { + var l int + _ = l + if m.Total != 0 { + n += 1 + sovTypes(uint64(m.Total)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *Validator) Size() (n int) { var l int _ = l @@ -12814,7 +13245,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumTxs |= (int32(b) & 0x7F) << shift + m.NumTxs |= (int64(b) & 0x7F) << shift if b < 0x80 { break } @@ -12840,7 +13271,37 @@ func (m *Header) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -12864,12 +13325,43 @@ func (m *Header) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LastBlockHash = append(m.LastBlockHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastBlockHash == nil { - m.LastBlockHash = []byte{} + m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastCommitHash == nil { + m.LastCommitHash = []byte{} } iNdEx = postIndex - case 7: + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) + if m.DataHash == nil { + m.DataHash = []byte{} + } + iNdEx = postIndex + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) } @@ -12900,7 +13392,38 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.ValidatorsHash = []byte{} } iNdEx = postIndex - case 8: + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) + if m.ConsensusHash == nil { + m.ConsensusHash = []byte{} + } + iNdEx = postIndex + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } @@ -12931,7 +13454,69 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.AppHash = []byte{} } iNdEx = postIndex - case 9: + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastResultsHash == nil { + m.LastResultsHash = []byte{} + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) + if m.EvidenceHash == nil { + m.EvidenceHash = []byte{} + } + iNdEx = postIndex + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } @@ -12984,6 +13569,219 @@ func (m *Header) Unmarshal(dAtA []byte) error { } return nil } +func (m *BlockID) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartsHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PartsHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PartSetHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PartSetHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Validator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -13610,134 +14408,142 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_2abffab37bc29540) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) } func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_2abffab37bc29540) + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) } -var fileDescriptor_types_2abffab37bc29540 = []byte{ - // 1964 bytes of a gzipped FileDescriptorProto +var fileDescriptor_types_7077ff64ad2a8940 = []byte{ + // 2090 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x23, 0x47, - 0x15, 0xf7, 0xc8, 0xfa, 0x37, 0x4f, 0xb6, 0xa5, 0xb4, 0x77, 0x6d, 0xad, 0x02, 0xf6, 0x32, 0x45, - 0x6d, 0x6c, 0xe2, 0xc8, 0xe0, 0xb0, 0x29, 0x6f, 0x02, 0x29, 0x2c, 0x67, 0x89, 0x5c, 0x09, 0x60, - 0x66, 0x37, 0x4b, 0x15, 0x97, 0xa9, 0x96, 0xa6, 0x3d, 0x9a, 0x5a, 0x69, 0x66, 0x32, 0xdd, 0x72, - 0xe4, 0xfd, 0x08, 0x54, 0x8a, 0xe2, 0xc6, 0x99, 0x1b, 0x5f, 0x80, 0x2a, 0x8e, 0x9c, 0xa8, 0xdc, - 0xe0, 0x00, 0xc5, 0x6d, 0x01, 0xa7, 0xb8, 0xf0, 0x09, 0x38, 0x52, 0xaf, 0x7b, 0xfe, 0x7b, 0xb4, - 0xb5, 0x59, 0x6e, 0x5c, 0xa4, 0xee, 0x7e, 0xef, 0xf5, 0xf4, 0x7b, 0xfd, 0xde, 0xfb, 0xbd, 0xd7, - 0xb0, 0x45, 0x47, 0x63, 0xf7, 0x50, 0x5c, 0x05, 0x8c, 0xab, 0xdf, 0x7e, 0x10, 0xfa, 0xc2, 0x27, - 0x35, 0x39, 0xe9, 0xbd, 0xe5, 0xb8, 0x62, 0x32, 0x1f, 0xf5, 0xc7, 0xfe, 0xec, 0xd0, 0xf1, 0x1d, - 0xff, 0x50, 0x52, 0x47, 0xf3, 0x0b, 0x39, 0x93, 0x13, 0x39, 0x52, 0x52, 0xbd, 0x5d, 0xc7, 0xf7, - 0x9d, 0x29, 0x4b, 0xb9, 0x84, 0x3b, 0x63, 0x5c, 0xd0, 0x59, 0x10, 0x31, 0x1c, 0x67, 0xf6, 0x13, - 0xcc, 0xb3, 0x59, 0x38, 0x73, 0x3d, 0x91, 0x1d, 0x4e, 0xdd, 0x11, 0x3f, 0x1c, 0xfb, 0xb3, 0x99, - 0xef, 0x65, 0x0f, 0x64, 0xfc, 0xb1, 0x0a, 0x0d, 0x93, 0x7d, 0x3a, 0x67, 0x5c, 0x90, 0x3d, 0xa8, - 0xb2, 0xf1, 0xc4, 0xef, 0x56, 0xee, 0x6a, 0x7b, 0xad, 0x23, 0xd2, 0x57, 0x7c, 0x11, 0xf5, 0xe1, - 0x78, 0xe2, 0x0f, 0x57, 0x4c, 0xc9, 0x41, 0xde, 0x84, 0xda, 0xc5, 0x74, 0xce, 0x27, 0xdd, 0x55, - 0xc9, 0xba, 0x99, 0x67, 0xfd, 0x21, 0x92, 0x86, 0x2b, 0xa6, 0xe2, 0xc1, 0x6d, 0x5d, 0xef, 0xc2, - 0xef, 0x56, 0xcb, 0xb6, 0x3d, 0xf3, 0x2e, 0xe4, 0xb6, 0xc8, 0x41, 0x8e, 0x01, 0x38, 0x13, 0x96, - 0x1f, 0x08, 0xd7, 0xf7, 0xba, 0x35, 0xc9, 0xbf, 0x9d, 0xe7, 0x7f, 0xc4, 0xc4, 0x4f, 0x24, 0x79, - 0xb8, 0x62, 0xea, 0x3c, 0x9e, 0xa0, 0xa4, 0xeb, 0xb9, 0xc2, 0x1a, 0x4f, 0xa8, 0xeb, 0x75, 0xeb, - 0x65, 0x92, 0x67, 0x9e, 0x2b, 0x4e, 0x91, 0x8c, 0x92, 0x6e, 0x3c, 0x41, 0x55, 0x3e, 0x9d, 0xb3, - 0xf0, 0xaa, 0xdb, 0x28, 0x53, 0xe5, 0xa7, 0x48, 0x42, 0x55, 0x24, 0x0f, 0x79, 0x0f, 0x5a, 0x23, - 0xe6, 0xb8, 0x9e, 0x35, 0x9a, 0xfa, 0xe3, 0xa7, 0xdd, 0xa6, 0x14, 0xe9, 0xe6, 0x45, 0x06, 0xc8, - 0x30, 0x40, 0xfa, 0x70, 0xc5, 0x84, 0x51, 0x32, 0x23, 0x47, 0xd0, 0x1c, 0x4f, 0xd8, 0xf8, 0xa9, - 0x25, 0x16, 0x5d, 0x5d, 0x4a, 0xde, 0xce, 0x4b, 0x9e, 0x22, 0xf5, 0xf1, 0x62, 0xb8, 0x62, 0x36, - 0xc6, 0x6a, 0x48, 0xee, 0x83, 0xce, 0x3c, 0x3b, 0xfa, 0x5c, 0x4b, 0x0a, 0x6d, 0x15, 0xee, 0xc5, - 0xb3, 0xe3, 0x8f, 0x35, 0x59, 0x34, 0x26, 0x7d, 0xa8, 0xe3, 0x5d, 0xbb, 0xa2, 0xbb, 0x26, 0x65, - 0x6e, 0x15, 0x3e, 0x24, 0x69, 0xc3, 0x15, 0x33, 0xe2, 0x42, 0xf3, 0xd9, 0x6c, 0xea, 0x5e, 0xb2, - 0x10, 0x0f, 0xb7, 0x59, 0x66, 0xbe, 0x0f, 0x14, 0x5d, 0x1e, 0x4f, 0xb7, 0xe3, 0xc9, 0xa0, 0x01, - 0xb5, 0x4b, 0x3a, 0x9d, 0x33, 0xe3, 0x0d, 0x68, 0x65, 0x3c, 0x85, 0x74, 0xa1, 0x31, 0x63, 0x9c, - 0x53, 0x87, 0x75, 0xb5, 0xbb, 0xda, 0x9e, 0x6e, 0xc6, 0x53, 0x63, 0x03, 0xd6, 0xb2, 0x7e, 0x92, - 0x11, 0x44, 0x5f, 0x40, 0xc1, 0x4b, 0x16, 0x72, 0x74, 0x80, 0x48, 0x30, 0x9a, 0x1a, 0xef, 0x42, - 0xa7, 0xe8, 0x04, 0xa4, 0x03, 0xab, 0x4f, 0xd9, 0x55, 0xc4, 0x89, 0x43, 0x72, 0x2b, 0x3a, 0x90, - 0xf4, 0x62, 0xdd, 0x8c, 0x4e, 0xf7, 0x8b, 0x4a, 0x22, 0x9c, 0xf8, 0x01, 0x39, 0x86, 0x2a, 0x06, - 0x92, 0x94, 0x6e, 0x1d, 0xf5, 0xfa, 0x2a, 0xca, 0xfa, 0x71, 0x94, 0xf5, 0x1f, 0xc7, 0x51, 0x36, - 0x68, 0x7e, 0xf1, 0x7c, 0x77, 0xe5, 0x57, 0x7f, 0xdf, 0xd5, 0x4c, 0x29, 0x41, 0xee, 0xe0, 0x55, - 0x52, 0xd7, 0xb3, 0x5c, 0x3b, 0xfa, 0x4e, 0x43, 0xce, 0xcf, 0x6c, 0x72, 0x02, 0x9d, 0xb1, 0xef, - 0x71, 0xe6, 0xf1, 0x39, 0xb7, 0x02, 0x1a, 0xd2, 0x19, 0x8f, 0xa2, 0x24, 0xbe, 0xb8, 0xd3, 0x98, - 0x7c, 0x2e, 0xa9, 0x66, 0x7b, 0x9c, 0x5f, 0x20, 0xef, 0x00, 0x5c, 0xd2, 0xa9, 0x6b, 0x53, 0xe1, - 0x87, 0xbc, 0x5b, 0xbd, 0xbb, 0xba, 0xd7, 0x3a, 0xea, 0x44, 0xc2, 0x4f, 0x62, 0xc2, 0xa0, 0x8a, - 0x67, 0x32, 0x33, 0x9c, 0xe4, 0x1e, 0xb4, 0x69, 0x10, 0x58, 0x5c, 0x50, 0xc1, 0xac, 0xd1, 0x95, - 0x60, 0x5c, 0xc6, 0xd0, 0x9a, 0xb9, 0x4e, 0x83, 0xe0, 0x11, 0xae, 0x0e, 0x70, 0xd1, 0xb0, 0x93, - 0x1b, 0x90, 0xee, 0x4d, 0x08, 0x54, 0x6d, 0x2a, 0xa8, 0xb4, 0xc3, 0x9a, 0x29, 0xc7, 0xb8, 0x16, - 0x50, 0x31, 0x89, 0xb4, 0x93, 0x63, 0xb2, 0x05, 0xf5, 0x09, 0x73, 0x9d, 0x89, 0x90, 0x0a, 0xad, - 0x9a, 0xd1, 0x0c, 0x4d, 0x1e, 0x84, 0xfe, 0x25, 0x93, 0x11, 0xde, 0x34, 0xd5, 0xc4, 0xf8, 0x97, - 0x06, 0xaf, 0xdd, 0x08, 0x09, 0xdc, 0x77, 0x42, 0xf9, 0x24, 0xfe, 0x16, 0x8e, 0xc9, 0x9b, 0xb8, - 0x2f, 0xb5, 0x59, 0x18, 0x65, 0x9e, 0xf5, 0x48, 0xd7, 0xa1, 0x5c, 0x8c, 0x14, 0x8d, 0x58, 0xc8, - 0x43, 0xe8, 0x4c, 0x29, 0x17, 0x96, 0xf2, 0x5c, 0x4b, 0x66, 0x96, 0xd5, 0x5c, 0x34, 0x7d, 0x4c, - 0x63, 0x0f, 0x47, 0x87, 0x8a, 0xc4, 0x37, 0xa6, 0xb9, 0x55, 0x32, 0x84, 0x5b, 0xa3, 0xab, 0x67, - 0xd4, 0x13, 0xae, 0xc7, 0xac, 0x1b, 0xd6, 0x6e, 0x47, 0x5b, 0x3d, 0xbc, 0x74, 0x6d, 0xe6, 0x8d, - 0x59, 0xb4, 0xc9, 0x66, 0x22, 0x92, 0x5c, 0x03, 0x37, 0xee, 0xc2, 0x46, 0x3e, 0x7e, 0xc9, 0x06, - 0x54, 0xc4, 0x22, 0xd2, 0xb0, 0x22, 0x16, 0x86, 0x91, 0xf8, 0x5e, 0x12, 0x44, 0x37, 0x78, 0xf6, - 0xa1, 0x5d, 0x08, 0xe8, 0x8c, 0xb9, 0xb5, 0xac, 0xb9, 0x8d, 0x36, 0xac, 0xe7, 0xe2, 0xd8, 0xf8, - 0xbc, 0x06, 0x4d, 0x93, 0xf1, 0x00, 0xdd, 0x88, 0x1c, 0x83, 0xce, 0x16, 0x63, 0xa6, 0x52, 0xa8, - 0x56, 0x48, 0x50, 0x8a, 0xe7, 0x61, 0x4c, 0xc7, 0x50, 0x4e, 0x98, 0xc9, 0x7e, 0x2e, 0xfd, 0x6f, - 0x16, 0x85, 0xb2, 0xf9, 0xff, 0x20, 0x9f, 0xff, 0x6f, 0x15, 0x78, 0x0b, 0x00, 0xb0, 0x9f, 0x03, - 0x80, 0xe2, 0xc6, 0x39, 0x04, 0x78, 0x50, 0x82, 0x00, 0xc5, 0xe3, 0x2f, 0x81, 0x80, 0x07, 0x25, - 0x10, 0xd0, 0xbd, 0xf1, 0xad, 0x52, 0x0c, 0x38, 0xc8, 0x63, 0x40, 0x51, 0x9d, 0x02, 0x08, 0x7c, - 0xaf, 0x0c, 0x04, 0xee, 0x14, 0x64, 0x96, 0xa2, 0xc0, 0xdb, 0x37, 0x50, 0x60, 0xab, 0x20, 0x5a, - 0x02, 0x03, 0x0f, 0x72, 0xf9, 0x19, 0x4a, 0x75, 0x2b, 0x4f, 0xd0, 0xe4, 0x9d, 0x9b, 0x08, 0xb2, - 0x5d, 0xbc, 0xda, 0x32, 0x08, 0x39, 0x2c, 0x40, 0xc8, 0xed, 0xe2, 0x29, 0x0b, 0x18, 0x92, 0x22, - 0xc1, 0x3e, 0xc6, 0x7d, 0xc1, 0xd3, 0x30, 0x47, 0xb0, 0x30, 0xf4, 0xc3, 0x28, 0x55, 0xab, 0x89, - 0xb1, 0x87, 0x99, 0x28, 0xf5, 0xaf, 0x17, 0xa0, 0x86, 0x74, 0xfa, 0x8c, 0x77, 0x19, 0xbf, 0xd6, - 0x52, 0x59, 0x19, 0xd1, 0xd9, 0x2c, 0xa6, 0x47, 0x59, 0x2c, 0x03, 0x26, 0x95, 0x1c, 0x98, 0x90, - 0x6f, 0xc1, 0x6b, 0x32, 0x8d, 0x48, 0xbb, 0x58, 0xb9, 0xb4, 0xd6, 0x46, 0x82, 0x32, 0x88, 0xca, - 0x6f, 0x6f, 0xc1, 0x66, 0x86, 0x17, 0x53, 0xac, 0x4c, 0x61, 0x55, 0x19, 0xbc, 0x9d, 0x84, 0xfb, - 0x24, 0x08, 0x86, 0x94, 0x4f, 0x8c, 0x1f, 0xa5, 0xfa, 0xa7, 0x40, 0x45, 0xa0, 0x3a, 0xf6, 0x6d, - 0xa5, 0xd6, 0xba, 0x29, 0xc7, 0x08, 0x5e, 0x53, 0xdf, 0x91, 0x5f, 0xd5, 0x4d, 0x1c, 0x22, 0x57, - 0x12, 0x29, 0xba, 0x0a, 0x09, 0xe3, 0x97, 0x5a, 0xba, 0x5f, 0x8a, 0x5d, 0x65, 0x30, 0xa3, 0xfd, - 0x2f, 0x30, 0x53, 0x79, 0x59, 0x98, 0x31, 0x7e, 0xa7, 0xa5, 0x77, 0x91, 0x00, 0xc8, 0xab, 0x29, - 0x87, 0x6e, 0xe1, 0x7a, 0x36, 0x5b, 0xc8, 0x50, 0x5f, 0x35, 0xd5, 0x24, 0x46, 0xf5, 0xba, 0x34, - 0x70, 0x1e, 0xd5, 0x1b, 0x72, 0x4d, 0x4d, 0x22, 0xe0, 0xf1, 0x2f, 0x64, 0x0c, 0xae, 0x99, 0x6a, - 0x92, 0xc9, 0x9b, 0x7a, 0x2e, 0x6f, 0x9e, 0x03, 0xb9, 0x19, 0x9d, 0xe4, 0x5d, 0xa8, 0x0a, 0xea, - 0xa0, 0xf1, 0x50, 0xff, 0x8d, 0xbe, 0xaa, 0x91, 0xfb, 0x1f, 0x3d, 0x39, 0xa7, 0x6e, 0x38, 0xd8, - 0x42, 0xed, 0xff, 0xfd, 0x7c, 0x77, 0x03, 0x79, 0x0e, 0xfc, 0x99, 0x2b, 0xd8, 0x2c, 0x10, 0x57, - 0xa6, 0x94, 0x31, 0xfe, 0xaa, 0x61, 0xd6, 0xce, 0x45, 0x6d, 0xa9, 0x2d, 0x62, 0xd7, 0xac, 0x64, - 0x00, 0xf6, 0xe5, 0xec, 0xf3, 0x75, 0x00, 0x87, 0x72, 0xeb, 0x33, 0xea, 0x09, 0x66, 0x47, 0x46, - 0xd2, 0x1d, 0xca, 0x7f, 0x26, 0x17, 0xb0, 0x0e, 0x41, 0xf2, 0x9c, 0x33, 0x5b, 0x5a, 0x6b, 0xd5, - 0x6c, 0x38, 0x94, 0x7f, 0xc2, 0x99, 0x9d, 0xe8, 0xd5, 0x78, 0x05, 0xbd, 0xfe, 0x96, 0x71, 0xb9, - 0x14, 0xb2, 0xfe, 0x1f, 0x34, 0xfb, 0x52, 0x43, 0x2c, 0xce, 0xa7, 0x3d, 0x72, 0x0a, 0xaf, 0x25, - 0xee, 0x6d, 0xcd, 0x03, 0x9b, 0x62, 0xe5, 0xa4, 0xbd, 0x30, 0x1e, 0x3a, 0x89, 0xc0, 0x27, 0x8a, - 0x9f, 0xfc, 0x18, 0xb6, 0x0b, 0x01, 0x99, 0x6c, 0x55, 0x79, 0x61, 0x5c, 0xde, 0xce, 0xc7, 0x65, - 0xbc, 0x5f, 0xac, 0xe5, 0xea, 0x2b, 0x68, 0xf9, 0x4d, 0x2c, 0x49, 0xb2, 0x69, 0xba, 0xec, 0x9e, - 0x8c, 0xdf, 0x68, 0xd0, 0x2e, 0x1c, 0x86, 0x1c, 0x02, 0xa8, 0x2c, 0xc7, 0xdd, 0x67, 0x71, 0x61, - 0x1c, 0xdb, 0x40, 0x1a, 0xeb, 0x91, 0xfb, 0x8c, 0x99, 0xfa, 0x28, 0x1e, 0x92, 0x7b, 0xd0, 0x10, - 0x0b, 0xc5, 0x9d, 0x2f, 0xde, 0x1e, 0x2f, 0x24, 0x6b, 0x5d, 0xc8, 0x7f, 0x72, 0x1f, 0xd6, 0xd4, - 0xc6, 0x8e, 0xcf, 0xb9, 0x1b, 0x44, 0x85, 0x03, 0xc9, 0x6e, 0xfd, 0xa1, 0xa4, 0x98, 0xad, 0x51, - 0x3a, 0x31, 0x7e, 0x0e, 0x7a, 0xf2, 0x59, 0xf2, 0x3a, 0xe8, 0x33, 0xba, 0x88, 0x2a, 0x5b, 0x3c, - 0x5b, 0xcd, 0x6c, 0xce, 0xe8, 0x42, 0x16, 0xb5, 0x64, 0x1b, 0x1a, 0x48, 0x14, 0x0b, 0x65, 0xef, - 0x9a, 0x59, 0x9f, 0xd1, 0xc5, 0xe3, 0x45, 0x42, 0x70, 0x28, 0x8f, 0xcb, 0xd6, 0x19, 0x5d, 0x7c, - 0x48, 0xb9, 0xf1, 0x3e, 0xd4, 0xd5, 0x21, 0x5f, 0x6a, 0x63, 0x94, 0xaf, 0xe4, 0xe4, 0x7f, 0x00, - 0xad, 0xcc, 0xb9, 0xc9, 0x77, 0xe0, 0xb6, 0xd2, 0x30, 0xa0, 0xa1, 0x90, 0x16, 0xc9, 0x6d, 0x48, - 0x24, 0xf1, 0x9c, 0x86, 0x02, 0x3f, 0xa9, 0x0a, 0xf1, 0x10, 0x36, 0xf2, 0xc5, 0x2a, 0xf9, 0x06, - 0xac, 0x45, 0x85, 0x6d, 0xe8, 0xcf, 0x3d, 0x3b, 0x92, 0x6d, 0xa9, 0x35, 0x13, 0x97, 0xc8, 0xf7, - 0x4b, 0xd2, 0x76, 0x8c, 0xe8, 0x8f, 0x5c, 0xc7, 0x73, 0x3d, 0xe7, 0x45, 0xd9, 0xfb, 0x4f, 0x15, - 0xa8, 0xab, 0xc2, 0x9a, 0xdc, 0xcb, 0x74, 0x31, 0x12, 0x35, 0x07, 0xad, 0xeb, 0xe7, 0xbb, 0x0d, - 0x09, 0x30, 0x67, 0x1f, 0xa4, 0x2d, 0x4d, 0x9a, 0x50, 0x2b, 0xb9, 0xba, 0x3f, 0xee, 0x9f, 0x56, - 0xbf, 0x72, 0xff, 0xb4, 0x0d, 0x0d, 0x6f, 0x3e, 0x93, 0x97, 0x55, 0x55, 0x97, 0xe5, 0xcd, 0x67, - 0x78, 0x59, 0xaf, 0x83, 0x2e, 0x7c, 0x41, 0xa7, 0x92, 0xa4, 0x92, 0x42, 0x53, 0x2e, 0x20, 0xf1, - 0x1e, 0xb4, 0xb3, 0x98, 0x8d, 0x18, 0xac, 0x20, 0x62, 0x3d, 0x45, 0x6c, 0xec, 0x27, 0xde, 0x80, - 0x76, 0xaa, 0xb0, 0xe2, 0x53, 0xb0, 0xb1, 0x91, 0x2e, 0x4b, 0xc6, 0x3b, 0xd0, 0x4c, 0xd0, 0x5c, - 0x41, 0x48, 0x83, 0x2a, 0x10, 0x27, 0xfb, 0xd0, 0x09, 0x42, 0x3f, 0xf0, 0x39, 0x0b, 0x2d, 0x6a, - 0xdb, 0x21, 0xe3, 0x5c, 0xc2, 0xc9, 0x9a, 0xd9, 0x8e, 0xd7, 0x4f, 0xd4, 0xb2, 0xe1, 0x82, 0x9e, - 0x18, 0x1c, 0x2b, 0x8e, 0x98, 0x5d, 0x8b, 0x76, 0x54, 0x53, 0x72, 0x00, 0x8d, 0x60, 0x3e, 0xb2, - 0x10, 0xd8, 0xf2, 0x91, 0x72, 0x3e, 0x1f, 0x7d, 0xc4, 0xae, 0xe2, 0x36, 0x27, 0x90, 0x33, 0x09, - 0x6d, 0xfe, 0x67, 0x2c, 0x8c, 0x7c, 0x56, 0x4d, 0x0c, 0x01, 0x9d, 0xe2, 0x15, 0x93, 0xef, 0x82, - 0x9e, 0xa8, 0x55, 0x88, 0xd8, 0xa2, 0x1f, 0xa4, 0x8c, 0x58, 0xff, 0x70, 0xd7, 0xf1, 0x98, 0x6d, - 0xa5, 0x26, 0x95, 0xe7, 0x6a, 0x9a, 0x6d, 0x45, 0xf8, 0x38, 0xb6, 0xa9, 0xf1, 0x6d, 0xa8, 0xab, - 0x33, 0x62, 0x1a, 0xc1, 0x9d, 0xe3, 0x1a, 0x0b, 0xc7, 0xa5, 0xa9, 0xe5, 0x2f, 0x1a, 0x34, 0xe3, - 0xde, 0xa9, 0x54, 0x28, 0x77, 0xe8, 0xca, 0xcb, 0x1e, 0x7a, 0x59, 0x03, 0x1a, 0x3b, 0x62, 0xf5, - 0x2b, 0x3b, 0xe2, 0x01, 0x10, 0xe5, 0x6f, 0x97, 0xbe, 0x70, 0x3d, 0xc7, 0x52, 0x36, 0x57, 0x8e, - 0xd7, 0x91, 0x94, 0x27, 0x92, 0x70, 0x8e, 0xeb, 0x47, 0x9f, 0xd7, 0xa0, 0x7d, 0x32, 0x38, 0x3d, - 0x3b, 0x09, 0x82, 0xa9, 0x3b, 0xa6, 0xb2, 0xb0, 0x3b, 0x84, 0xaa, 0x2c, 0x5d, 0x4b, 0x9e, 0xcb, - 0x7a, 0x65, 0x3d, 0x14, 0x39, 0x82, 0x9a, 0xac, 0x60, 0x49, 0xd9, 0xab, 0x59, 0xaf, 0xb4, 0x95, - 0xc2, 0x8f, 0xa8, 0x1a, 0xf7, 0xe6, 0xe3, 0x59, 0xaf, 0xac, 0x9f, 0x22, 0xef, 0x83, 0x9e, 0xd6, - 0x9e, 0xcb, 0x9e, 0xd0, 0x7a, 0x4b, 0x3b, 0x2b, 0x94, 0x4f, 0x81, 0x7f, 0xd9, 0x4b, 0x50, 0x6f, - 0x69, 0x0b, 0x42, 0x8e, 0xa1, 0x11, 0x17, 0x44, 0xe5, 0x8f, 0x5c, 0xbd, 0x25, 0x5d, 0x0f, 0x9a, - 0x47, 0x15, 0x95, 0x65, 0x2f, 0x71, 0xbd, 0xd2, 0xd6, 0x8c, 0xdc, 0x87, 0x7a, 0x84, 0x73, 0xa5, - 0x0f, 0x5d, 0xbd, 0xf2, 0xde, 0x05, 0x95, 0x4c, 0x0b, 0xea, 0x65, 0xaf, 0x85, 0xbd, 0xa5, 0x3d, - 0x24, 0x39, 0x01, 0xc8, 0x14, 0x92, 0x4b, 0x9f, 0x01, 0x7b, 0xcb, 0x7b, 0x43, 0xf2, 0x1e, 0x34, - 0xd3, 0x7e, 0xbf, 0xfc, 0x61, 0xaf, 0xb7, 0xac, 0x5d, 0x1b, 0x7c, 0xed, 0x3f, 0xff, 0xdc, 0xd1, - 0x7e, 0x7b, 0xbd, 0xa3, 0xfd, 0xfe, 0x7a, 0x47, 0xfb, 0xe2, 0x7a, 0x47, 0xfb, 0xf3, 0xf5, 0x8e, - 0xf6, 0x8f, 0xeb, 0x1d, 0xed, 0x0f, 0x5f, 0xee, 0x68, 0xa3, 0xba, 0x74, 0xff, 0xb7, 0xff, 0x1b, - 0x00, 0x00, 0xff, 0xff, 0x79, 0xfd, 0x53, 0xad, 0x8b, 0x16, 0x00, 0x00, + 0x15, 0xf7, 0xc8, 0xb2, 0xa4, 0x79, 0x92, 0x25, 0x6d, 0x7b, 0xd7, 0xd6, 0x2a, 0x60, 0x2f, 0x03, + 0x6c, 0x6c, 0xe2, 0xd8, 0xe0, 0xb0, 0x29, 0x6f, 0x42, 0x52, 0x58, 0xde, 0x25, 0x76, 0x25, 0x80, + 0x99, 0xdd, 0x2c, 0x55, 0x14, 0x55, 0xaa, 0x96, 0xa6, 0x2d, 0x4d, 0xad, 0x34, 0x33, 0x99, 0x6e, + 0x39, 0xf2, 0x7e, 0x04, 0x2a, 0x45, 0x71, 0xe3, 0x0a, 0x37, 0xbe, 0x00, 0x55, 0x1c, 0x39, 0x51, + 0x39, 0x72, 0x80, 0xe2, 0xb6, 0x80, 0x53, 0x5c, 0xf8, 0x04, 0x1c, 0xa9, 0x7e, 0xdd, 0xf3, 0xd7, + 0xa3, 0xad, 0xcd, 0x72, 0xe3, 0x22, 0x4d, 0xf7, 0x7b, 0xaf, 0xbb, 0xdf, 0xeb, 0xf7, 0xde, 0xef, + 0xbd, 0x86, 0x75, 0x3a, 0x18, 0xba, 0xfb, 0xe2, 0x32, 0x60, 0x5c, 0xfd, 0xee, 0x05, 0xa1, 0x2f, + 0x7c, 0xb2, 0x82, 0x83, 0xee, 0x9b, 0x23, 0x57, 0x8c, 0x67, 0x83, 0xbd, 0xa1, 0x3f, 0xdd, 0x1f, + 0xf9, 0x23, 0x7f, 0x1f, 0xa9, 0x83, 0xd9, 0x39, 0x8e, 0x70, 0x80, 0x5f, 0x4a, 0xaa, 0xbb, 0x35, + 0xf2, 0xfd, 0xd1, 0x84, 0x25, 0x5c, 0xc2, 0x9d, 0x32, 0x2e, 0xe8, 0x34, 0xd0, 0x0c, 0x87, 0xa9, + 0xf5, 0x04, 0xf3, 0x1c, 0x16, 0x4e, 0x5d, 0x4f, 0xa4, 0x3f, 0x27, 0xee, 0x80, 0xef, 0x0f, 0xfd, + 0xe9, 0xd4, 0xf7, 0xd2, 0x07, 0xb2, 0xfe, 0x54, 0x86, 0xaa, 0xcd, 0x3e, 0x99, 0x31, 0x2e, 0xc8, + 0x36, 0x94, 0xd9, 0x70, 0xec, 0x77, 0x4a, 0x77, 0x8c, 0xed, 0xfa, 0x01, 0xd9, 0x53, 0x7c, 0x9a, + 0xfa, 0x70, 0x38, 0xf6, 0x4f, 0x96, 0x6c, 0xe4, 0x20, 0x6f, 0xc0, 0xca, 0xf9, 0x64, 0xc6, 0xc7, + 0x9d, 0x65, 0x64, 0x5d, 0xcb, 0xb2, 0xfe, 0x40, 0x92, 0x4e, 0x96, 0x6c, 0xc5, 0x23, 0x97, 0x75, + 0xbd, 0x73, 0xbf, 0x53, 0x2e, 0x5a, 0xf6, 0xd4, 0x3b, 0xc7, 0x65, 0x25, 0x07, 0x39, 0x04, 0xe0, + 0x4c, 0xf4, 0xfd, 0x40, 0xb8, 0xbe, 0xd7, 0x59, 0x41, 0xfe, 0x8d, 0x2c, 0xff, 0x23, 0x26, 0x7e, + 0x8c, 0xe4, 0x93, 0x25, 0xdb, 0xe4, 0xd1, 0x40, 0x4a, 0xba, 0x9e, 0x2b, 0xfa, 0xc3, 0x31, 0x75, + 0xbd, 0x4e, 0xa5, 0x48, 0xf2, 0xd4, 0x73, 0xc5, 0xb1, 0x24, 0x4b, 0x49, 0x37, 0x1a, 0x48, 0x55, + 0x3e, 0x99, 0xb1, 0xf0, 0xb2, 0x53, 0x2d, 0x52, 0xe5, 0x27, 0x92, 0x24, 0x55, 0x41, 0x1e, 0xf2, + 0x2e, 0xd4, 0x07, 0x6c, 0xe4, 0x7a, 0xfd, 0xc1, 0xc4, 0x1f, 0x3e, 0xed, 0xd4, 0x50, 0xa4, 0x93, + 0x15, 0xe9, 0x49, 0x86, 0x9e, 0xa4, 0x9f, 0x2c, 0xd9, 0x30, 0x88, 0x47, 0xe4, 0x00, 0x6a, 0xc3, + 0x31, 0x1b, 0x3e, 0xed, 0x8b, 0x79, 0xc7, 0x44, 0xc9, 0x5b, 0x59, 0xc9, 0x63, 0x49, 0x7d, 0x3c, + 0x3f, 0x59, 0xb2, 0xab, 0x43, 0xf5, 0x49, 0xee, 0x81, 0xc9, 0x3c, 0x47, 0x6f, 0x57, 0x47, 0xa1, + 0xf5, 0xdc, 0xbd, 0x78, 0x4e, 0xb4, 0x59, 0x8d, 0xe9, 0x6f, 0xb2, 0x07, 0x15, 0x79, 0xd7, 0xae, + 0xe8, 0x34, 0x50, 0xe6, 0x66, 0x6e, 0x23, 0xa4, 0x9d, 0x2c, 0xd9, 0x9a, 0x4b, 0x9a, 0xcf, 0x61, + 0x13, 0xf7, 0x82, 0x85, 0xf2, 0x70, 0x6b, 0x45, 0xe6, 0x7b, 0xa0, 0xe8, 0x78, 0x3c, 0xd3, 0x89, + 0x06, 0xbd, 0x2a, 0xac, 0x5c, 0xd0, 0xc9, 0x8c, 0x59, 0xaf, 0x43, 0x3d, 0xe5, 0x29, 0xa4, 0x03, + 0xd5, 0x29, 0xe3, 0x9c, 0x8e, 0x58, 0xc7, 0xb8, 0x63, 0x6c, 0x9b, 0x76, 0x34, 0xb4, 0x9a, 0xd0, + 0x48, 0xfb, 0x49, 0x4a, 0x50, 0xfa, 0x82, 0x14, 0xbc, 0x60, 0x21, 0x97, 0x0e, 0xa0, 0x05, 0xf5, + 0xd0, 0x7a, 0x07, 0xda, 0x79, 0x27, 0x20, 0x6d, 0x58, 0x7e, 0xca, 0x2e, 0x35, 0xa7, 0xfc, 0x24, + 0x37, 0xf5, 0x81, 0xd0, 0x8b, 0x4d, 0x5b, 0x9f, 0xee, 0x17, 0xa5, 0x58, 0x38, 0xf6, 0x03, 0x72, + 0x08, 0x65, 0x19, 0x48, 0x28, 0x5d, 0x3f, 0xe8, 0xee, 0xa9, 0x28, 0xdb, 0x8b, 0xa2, 0x6c, 0xef, + 0x71, 0x14, 0x65, 0xbd, 0xda, 0xe7, 0xcf, 0xb7, 0x96, 0x7e, 0xf5, 0xf7, 0x2d, 0xc3, 0x46, 0x09, + 0x72, 0x5b, 0x5e, 0x25, 0x75, 0xbd, 0xbe, 0xeb, 0xe8, 0x7d, 0xaa, 0x38, 0x3e, 0x75, 0xc8, 0x11, + 0xb4, 0x87, 0xbe, 0xc7, 0x99, 0xc7, 0x67, 0xbc, 0x1f, 0xd0, 0x90, 0x4e, 0xb9, 0x8e, 0x92, 0xe8, + 0xe2, 0x8e, 0x23, 0xf2, 0x19, 0x52, 0xed, 0xd6, 0x30, 0x3b, 0x41, 0xde, 0x06, 0xb8, 0xa0, 0x13, + 0xd7, 0xa1, 0xc2, 0x0f, 0x79, 0xa7, 0x7c, 0x67, 0x79, 0xbb, 0x7e, 0xd0, 0xd6, 0xc2, 0x4f, 0x22, + 0x42, 0xaf, 0x2c, 0xcf, 0x64, 0xa7, 0x38, 0xc9, 0x5d, 0x68, 0xd1, 0x20, 0xe8, 0x73, 0x41, 0x05, + 0xeb, 0x0f, 0x2e, 0x05, 0xe3, 0x18, 0x43, 0x0d, 0x7b, 0x95, 0x06, 0xc1, 0x23, 0x39, 0xdb, 0x93, + 0x93, 0x96, 0x13, 0xdf, 0x00, 0xba, 0x37, 0x21, 0x50, 0x76, 0xa8, 0xa0, 0x68, 0x87, 0x86, 0x8d, + 0xdf, 0x72, 0x2e, 0xa0, 0x62, 0xac, 0xb5, 0xc3, 0x6f, 0xb2, 0x0e, 0x95, 0x31, 0x73, 0x47, 0x63, + 0x81, 0x0a, 0x2d, 0xdb, 0x7a, 0x24, 0x4d, 0x1e, 0x84, 0xfe, 0x05, 0xc3, 0x08, 0xaf, 0xd9, 0x6a, + 0x60, 0xfd, 0xcb, 0x80, 0x1b, 0xd7, 0x42, 0x42, 0xae, 0x3b, 0xa6, 0x7c, 0x1c, 0xed, 0x25, 0xbf, + 0xc9, 0x1b, 0x72, 0x5d, 0xea, 0xb0, 0x50, 0x67, 0x9e, 0x55, 0xad, 0xeb, 0x09, 0x4e, 0x6a, 0x45, + 0x35, 0x0b, 0x79, 0x08, 0xed, 0x09, 0xe5, 0xa2, 0xaf, 0x3c, 0xb7, 0x8f, 0x99, 0x65, 0x39, 0x13, + 0x4d, 0x1f, 0xd1, 0xc8, 0xc3, 0xa5, 0x43, 0x69, 0xf1, 0xe6, 0x24, 0x33, 0x4b, 0x4e, 0xe0, 0xe6, + 0xe0, 0xf2, 0x19, 0xf5, 0x84, 0xeb, 0xb1, 0xfe, 0x35, 0x6b, 0xb7, 0xf4, 0x52, 0x0f, 0x2f, 0x5c, + 0x87, 0x79, 0x43, 0xa6, 0x17, 0x59, 0x8b, 0x45, 0xe2, 0x6b, 0xe0, 0xd6, 0x1d, 0x68, 0x66, 0xe3, + 0x97, 0x34, 0xa1, 0x24, 0xe6, 0x5a, 0xc3, 0x92, 0x98, 0x5b, 0x56, 0xec, 0x7b, 0x71, 0x10, 0x5d, + 0xe3, 0xd9, 0x81, 0x56, 0x2e, 0xa0, 0x53, 0xe6, 0x36, 0xd2, 0xe6, 0xb6, 0x5a, 0xb0, 0x9a, 0x89, + 0x63, 0xeb, 0xb3, 0x15, 0xa8, 0xd9, 0x8c, 0x07, 0xd2, 0x8d, 0xc8, 0x21, 0x98, 0x6c, 0x3e, 0x64, + 0x2a, 0x85, 0x1a, 0xb9, 0x04, 0xa5, 0x78, 0x1e, 0x46, 0x74, 0x19, 0xca, 0x31, 0x33, 0xd9, 0xc9, + 0xa4, 0xff, 0xb5, 0xbc, 0x50, 0x3a, 0xff, 0xef, 0x66, 0xf3, 0xff, 0xcd, 0x1c, 0x6f, 0x0e, 0x00, + 0x76, 0x32, 0x00, 0x90, 0x5f, 0x38, 0x83, 0x00, 0xf7, 0x0b, 0x10, 0x20, 0x7f, 0xfc, 0x05, 0x10, + 0x70, 0xbf, 0x00, 0x02, 0x3a, 0xd7, 0xf6, 0x2a, 0xc4, 0x80, 0xdd, 0x2c, 0x06, 0xe4, 0xd5, 0xc9, + 0x81, 0xc0, 0xf7, 0x8a, 0x40, 0xe0, 0x76, 0x4e, 0x66, 0x21, 0x0a, 0xbc, 0x75, 0x0d, 0x05, 0xd6, + 0x73, 0xa2, 0x05, 0x30, 0x70, 0x3f, 0x93, 0x9f, 0xa1, 0x50, 0xb7, 0xe2, 0x04, 0x4d, 0xde, 0xbe, + 0x8e, 0x20, 0x1b, 0xf9, 0xab, 0x2d, 0x82, 0x90, 0xfd, 0x1c, 0x84, 0xdc, 0xca, 0x9f, 0x32, 0x87, + 0x21, 0x09, 0x12, 0xec, 0xc8, 0xb8, 0xcf, 0x79, 0x9a, 0xcc, 0x11, 0x2c, 0x0c, 0xfd, 0x50, 0xa7, + 0x6a, 0x35, 0xb0, 0xb6, 0x65, 0x26, 0x4a, 0xfc, 0xeb, 0x05, 0xa8, 0x81, 0x4e, 0x9f, 0xf2, 0x2e, + 0xeb, 0xd7, 0x46, 0x22, 0x8b, 0x11, 0x9d, 0xce, 0x62, 0xa6, 0xce, 0x62, 0x29, 0x30, 0x29, 0x65, + 0xc0, 0x84, 0x7c, 0x0b, 0x6e, 0x60, 0x1a, 0x41, 0xbb, 0xf4, 0x33, 0x69, 0xad, 0x25, 0x09, 0xca, + 0x20, 0x2a, 0xbf, 0xbd, 0x09, 0x6b, 0x29, 0x5e, 0x99, 0x62, 0x31, 0x85, 0x95, 0x31, 0x78, 0xdb, + 0x31, 0xf7, 0x51, 0x10, 0x9c, 0x50, 0x3e, 0xb6, 0x7e, 0x98, 0xe8, 0x9f, 0x00, 0x15, 0x81, 0xf2, + 0xd0, 0x77, 0x94, 0x5a, 0xab, 0x36, 0x7e, 0x4b, 0xf0, 0x9a, 0xf8, 0x23, 0xdc, 0xd5, 0xb4, 0xe5, + 0xa7, 0xe4, 0x8a, 0x23, 0xc5, 0x54, 0x21, 0x61, 0xfd, 0xd2, 0x48, 0xd6, 0x4b, 0xb0, 0xab, 0x08, + 0x66, 0x8c, 0xff, 0x05, 0x66, 0x4a, 0x2f, 0x0b, 0x33, 0xd6, 0xef, 0x8d, 0xe4, 0x2e, 0x62, 0x00, + 0x79, 0x35, 0xe5, 0xa4, 0x5b, 0xb8, 0x9e, 0xc3, 0xe6, 0x18, 0xea, 0xcb, 0xb6, 0x1a, 0x44, 0xa8, + 0x5e, 0x41, 0x03, 0x67, 0x51, 0xbd, 0x8a, 0x73, 0x6a, 0xa0, 0x81, 0xc7, 0x3f, 0xc7, 0x18, 0x6c, + 0xd8, 0x6a, 0x90, 0xca, 0x9b, 0x66, 0x26, 0x6f, 0x9e, 0x01, 0xb9, 0x1e, 0x9d, 0xe4, 0x1d, 0x28, + 0x0b, 0x3a, 0x92, 0xc6, 0x93, 0xfa, 0x37, 0xf7, 0x54, 0x8d, 0xbc, 0xf7, 0xe1, 0x93, 0x33, 0xea, + 0x86, 0xbd, 0x75, 0xa9, 0xfd, 0xbf, 0x9f, 0x6f, 0x35, 0x25, 0xcf, 0xae, 0x3f, 0x75, 0x05, 0x9b, + 0x06, 0xe2, 0xd2, 0x46, 0x19, 0xeb, 0xaf, 0x86, 0xcc, 0xda, 0x99, 0xa8, 0x2d, 0xb4, 0x45, 0xe4, + 0x9a, 0xa5, 0x14, 0xc0, 0xbe, 0x9c, 0x7d, 0xbe, 0x0a, 0x30, 0xa2, 0xbc, 0xff, 0x29, 0xf5, 0x04, + 0x73, 0xb4, 0x91, 0xcc, 0x11, 0xe5, 0x3f, 0xc5, 0x09, 0x59, 0x87, 0x48, 0xf2, 0x8c, 0x33, 0x07, + 0xad, 0xb5, 0x6c, 0x57, 0x47, 0x94, 0x7f, 0xcc, 0x99, 0x13, 0xeb, 0x55, 0x7d, 0x05, 0xbd, 0xfe, + 0x96, 0x72, 0xb9, 0x04, 0xb2, 0xfe, 0x1f, 0x34, 0xfb, 0xc2, 0x90, 0x58, 0x9c, 0x4d, 0x7b, 0xe4, + 0x18, 0x6e, 0xc4, 0xee, 0xdd, 0x9f, 0x05, 0x0e, 0x95, 0x95, 0x93, 0xf1, 0xc2, 0x78, 0x68, 0xc7, + 0x02, 0x1f, 0x2b, 0x7e, 0xf2, 0x23, 0xd8, 0xc8, 0x05, 0x64, 0xbc, 0x54, 0xe9, 0x85, 0x71, 0x79, + 0x2b, 0x1b, 0x97, 0xd1, 0x7a, 0x91, 0x96, 0xcb, 0xaf, 0xa0, 0xe5, 0x37, 0x64, 0x49, 0x92, 0x4e, + 0xd3, 0x45, 0xf7, 0x64, 0xfd, 0xd6, 0x80, 0x56, 0xee, 0x30, 0x64, 0x1f, 0x40, 0x65, 0x39, 0xee, + 0x3e, 0x8b, 0x0a, 0xe3, 0xc8, 0x06, 0x68, 0xac, 0x47, 0xee, 0x33, 0x66, 0x9b, 0x83, 0xe8, 0x93, + 0xdc, 0x85, 0xaa, 0x98, 0x2b, 0xee, 0x6c, 0xf1, 0xf6, 0x78, 0x8e, 0xac, 0x15, 0x81, 0xff, 0xe4, + 0x1e, 0x34, 0xd4, 0xc2, 0x23, 0x9f, 0x73, 0x37, 0xd0, 0x85, 0x03, 0x49, 0x2f, 0xfd, 0x01, 0x52, + 0xec, 0xfa, 0x20, 0x19, 0x58, 0x3f, 0x03, 0x33, 0xde, 0x96, 0xbc, 0x06, 0xe6, 0x94, 0xce, 0x75, + 0x65, 0x2b, 0xcf, 0xb6, 0x62, 0xd7, 0xa6, 0x74, 0x8e, 0x45, 0x2d, 0xd9, 0x80, 0xaa, 0x24, 0x8a, + 0xb9, 0xb2, 0xf7, 0x8a, 0x5d, 0x99, 0xd2, 0xf9, 0xe3, 0x79, 0x4c, 0x18, 0x51, 0x1e, 0x95, 0xad, + 0x53, 0x3a, 0xff, 0x80, 0x72, 0xeb, 0x7d, 0xa8, 0xa8, 0x43, 0xbe, 0xd4, 0xc2, 0x52, 0xbe, 0x94, + 0x91, 0xff, 0x3e, 0xd4, 0x53, 0xe7, 0x26, 0xdf, 0x81, 0x5b, 0x4a, 0xc3, 0x80, 0x86, 0x02, 0x2d, + 0x92, 0x59, 0x90, 0x20, 0xf1, 0x8c, 0x86, 0x42, 0x6e, 0xa9, 0x0a, 0xf1, 0x10, 0x9a, 0xd9, 0x62, + 0x95, 0x7c, 0x0d, 0x1a, 0xba, 0xb0, 0x0d, 0xfd, 0x99, 0xe7, 0x68, 0xd9, 0xba, 0x9a, 0xb3, 0xe5, + 0x14, 0x79, 0xaf, 0x20, 0x6d, 0x47, 0x88, 0xfe, 0xc8, 0x1d, 0x79, 0xae, 0x37, 0x7a, 0x51, 0xf6, + 0xfe, 0x4d, 0x19, 0x2a, 0xaa, 0xb0, 0x26, 0x77, 0x53, 0x5d, 0x0c, 0xa2, 0x66, 0xaf, 0x7e, 0xf5, + 0x7c, 0xab, 0x8a, 0x00, 0x73, 0xfa, 0x20, 0x69, 0x69, 0x92, 0x84, 0x5a, 0xca, 0xd4, 0xfd, 0x51, + 0xff, 0xb4, 0xfc, 0xa5, 0xfb, 0xa7, 0x0d, 0xa8, 0x7a, 0xb3, 0x29, 0x5e, 0x56, 0x59, 0x2d, 0xe9, + 0xcd, 0xa6, 0xf2, 0xb2, 0x5e, 0x03, 0x53, 0xf8, 0x82, 0x4e, 0x90, 0xa4, 0x92, 0x42, 0x0d, 0x27, + 0x24, 0xf1, 0x10, 0x56, 0x53, 0x38, 0xec, 0x3a, 0xba, 0xc8, 0x6b, 0xa6, 0x9d, 0xe8, 0xf4, 0x81, + 0xd6, 0xb9, 0x1e, 0xe3, 0xf2, 0xa9, 0x43, 0xb6, 0xb3, 0x4d, 0x03, 0xc2, 0xb7, 0x42, 0x92, 0x54, + 0x5f, 0x20, 0xc1, 0x5b, 0x1e, 0x40, 0x06, 0x87, 0x62, 0x51, 0xb0, 0x52, 0x93, 0x13, 0x48, 0x7c, + 0x1d, 0x5a, 0x89, 0x25, 0x15, 0x8b, 0xa9, 0x56, 0x49, 0xa6, 0x91, 0xf1, 0x9b, 0xd0, 0x4c, 0x92, + 0x01, 0xf2, 0x81, 0x6a, 0xc4, 0xe2, 0x59, 0x64, 0xbb, 0x0d, 0xb5, 0xb8, 0x9a, 0xa8, 0x23, 0x43, + 0x95, 0xaa, 0x22, 0x22, 0xae, 0x4f, 0x42, 0xc6, 0x67, 0x13, 0xa1, 0x17, 0x69, 0x20, 0x0f, 0xd6, + 0x27, 0xb6, 0x9a, 0x47, 0xde, 0xaf, 0xc3, 0x2a, 0xd3, 0x8d, 0x8a, 0xe2, 0x5b, 0x45, 0xbe, 0x46, + 0x34, 0x89, 0x4c, 0x3b, 0xd0, 0x0e, 0x42, 0x3f, 0xf0, 0x39, 0x0b, 0xfb, 0xd4, 0x71, 0x42, 0xc6, + 0x79, 0xa7, 0xa9, 0xd6, 0x8b, 0xe6, 0x8f, 0xd4, 0xb4, 0xf5, 0x73, 0xa8, 0x6a, 0x5b, 0x16, 0xb6, + 0x6b, 0xef, 0x41, 0x43, 0xba, 0x38, 0xef, 0x67, 0x9a, 0xb6, 0xa8, 0x68, 0x46, 0x0f, 0x67, 0x22, + 0xd3, 0xbb, 0xd5, 0x91, 0x5f, 0x4d, 0x59, 0xf7, 0x61, 0x35, 0xc3, 0x23, 0x51, 0x1c, 0xaf, 0x58, + 0x3b, 0xbb, 0x1a, 0xc4, 0x3b, 0x97, 0x92, 0x9d, 0x2d, 0x17, 0xcc, 0xd8, 0xb5, 0x65, 0x6d, 0x17, + 0xe9, 0x61, 0x68, 0xdb, 0xa9, 0x21, 0xd9, 0x85, 0x6a, 0x30, 0x1b, 0xf4, 0x65, 0x09, 0x91, 0xcd, + 0x49, 0x67, 0xb3, 0xc1, 0x87, 0xec, 0x32, 0x6a, 0x28, 0x03, 0x1c, 0x61, 0x11, 0xe1, 0x7f, 0xca, + 0x42, 0x9d, 0x1d, 0xd4, 0xc0, 0x12, 0xd0, 0xce, 0x07, 0x13, 0xf9, 0x2e, 0x98, 0xf1, 0x3d, 0xe7, + 0x72, 0x63, 0x3e, 0xe2, 0x12, 0x46, 0x79, 0x93, 0xdc, 0x1d, 0x79, 0xcc, 0xe9, 0x27, 0xce, 0x8b, + 0xe7, 0xaa, 0xd9, 0x2d, 0x45, 0xf8, 0x28, 0xf2, 0x54, 0xeb, 0xdb, 0x50, 0x51, 0x67, 0x94, 0xea, + 0xcb, 0x95, 0xa3, 0x6a, 0x56, 0x7e, 0x17, 0x26, 0xf1, 0xbf, 0x18, 0x50, 0x8b, 0xba, 0xd4, 0x42, + 0xa1, 0xcc, 0xa1, 0x4b, 0x2f, 0x7b, 0xe8, 0x45, 0xad, 0x7e, 0x14, 0xf2, 0xe5, 0x2f, 0x1d, 0xf2, + 0xbb, 0x40, 0x54, 0x64, 0x5f, 0xf8, 0xc2, 0xf5, 0x46, 0x7d, 0x65, 0x73, 0x15, 0xe2, 0x6d, 0xa4, + 0x3c, 0x41, 0xc2, 0x99, 0x9c, 0x3f, 0xf8, 0x6c, 0x05, 0x5a, 0x47, 0xbd, 0xe3, 0xd3, 0xa3, 0x20, + 0x98, 0xb8, 0x43, 0x8a, 0x25, 0xf4, 0x3e, 0x94, 0xb1, 0x49, 0x28, 0x78, 0x98, 0xec, 0x16, 0x75, + 0xab, 0xe4, 0x00, 0x56, 0xb0, 0x57, 0x20, 0x45, 0xef, 0x93, 0xdd, 0xc2, 0xa6, 0x55, 0x6e, 0xa2, + 0xba, 0x89, 0xeb, 0xcf, 0x94, 0xdd, 0xa2, 0xce, 0x95, 0xbc, 0x0f, 0x66, 0x52, 0xe5, 0x2f, 0x7a, + 0xac, 0xec, 0x2e, 0xec, 0x61, 0xa5, 0x7c, 0x52, 0x62, 0x2d, 0x7a, 0x73, 0xeb, 0x2e, 0x6c, 0xf6, + 0xc8, 0x21, 0x54, 0xa3, 0xd2, 0xb3, 0xf8, 0x39, 0xb1, 0xbb, 0xa0, 0xbf, 0x94, 0xe6, 0x51, 0xe5, + 0x7b, 0xd1, 0x9b, 0x67, 0xb7, 0xb0, 0x09, 0x26, 0xf7, 0xa0, 0xa2, 0x2b, 0x8a, 0xc2, 0x27, 0xc5, + 0x6e, 0x71, 0x97, 0x28, 0x95, 0x4c, 0x5a, 0x97, 0x45, 0xef, 0xb2, 0xdd, 0x85, 0xdd, 0x3a, 0x39, + 0x02, 0x48, 0x95, 0xec, 0x0b, 0x1f, 0x5c, 0xbb, 0x8b, 0xbb, 0x70, 0xf2, 0x2e, 0xd4, 0x92, 0x97, + 0x95, 0xe2, 0x27, 0xd4, 0xee, 0xa2, 0xc6, 0xb8, 0xf7, 0x95, 0xff, 0xfc, 0x73, 0xd3, 0xf8, 0xdd, + 0xd5, 0xa6, 0xf1, 0x87, 0xab, 0x4d, 0xe3, 0xf3, 0xab, 0x4d, 0xe3, 0xcf, 0x57, 0x9b, 0xc6, 0x3f, + 0xae, 0x36, 0x8d, 0x3f, 0x7e, 0xb1, 0x69, 0x0c, 0x2a, 0xe8, 0xfe, 0x6f, 0xfd, 0x37, 0x00, 0x00, + 0xff, 0xff, 0x85, 0x43, 0xc2, 0x26, 0xf5, 0x17, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index c64ece24..45b62a77 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -232,24 +232,40 @@ message LastCommitInfo { //---------------------------------------- // Blockchain Types -// just the minimum the app might need message Header { - // basics + // basic block info string chain_id = 1 [(gogoproto.customname)="ChainID"]; int64 height = 2; google.protobuf.Timestamp time = 3 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true]; - - // txs - int32 num_txs = 4; + int64 num_txs = 4; int64 total_txs = 5; - // hashes - bytes last_block_hash = 6; - bytes validators_hash = 7; - bytes app_hash = 8; + // prev block info + BlockID last_block_id = 6 [(gogoproto.nullable)=false]; - // consensus - bytes proposer_address = 9; + // hashes of block data + bytes last_commit_hash = 7; // commit from validators from the last block + bytes data_hash = 8; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 9; // validators for the current block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12;// root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block +} + +message BlockID { + bytes hash = 1; + PartSetHeader parts_header = 2 [(gogoproto.nullable)=false]; +} + +message PartSetHeader { + int32 total = 1; + bytes hash = 2; } // Validator diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index 33a368af..b32c827d 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -1758,6 +1758,118 @@ func TestHeaderMarshalTo(t *testing.T) { } } +func TestBlockIDProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, false) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &BlockID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(dAtA)) + copy(littlefuzz, dAtA) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestBlockIDMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, false) + size := p.Size() + dAtA := make([]byte, size) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(dAtA) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &BlockID{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestPartSetHeaderProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, false) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &PartSetHeader{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(dAtA)) + copy(littlefuzz, dAtA) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + } +} + +func TestPartSetHeaderMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, false) + size := p.Size() + dAtA := make([]byte, size) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(dAtA) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &PartSetHeader{} + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + func TestValidatorProto(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -2540,6 +2652,42 @@ func TestHeaderJSON(t *testing.T) { t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } +func TestBlockIDJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &BlockID{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) + } +} +func TestPartSetHeaderJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, true) + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &PartSetHeader{} + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) + } +} func TestValidatorJSON(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -3480,6 +3628,62 @@ func TestHeaderProtoCompactText(t *testing.T) { } } +func TestBlockIDProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, true) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &BlockID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestBlockIDProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, true) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &BlockID{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestPartSetHeaderProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, true) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + msg := &PartSetHeader{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestPartSetHeaderProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, true) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + msg := &PartSetHeader{} + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + func TestValidatorProtoText(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) @@ -4274,6 +4478,50 @@ func TestHeaderSize(t *testing.T) { } } +func TestBlockIDSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedBlockID(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(dAtA) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func TestPartSetHeaderSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := math_rand.New(math_rand.NewSource(seed)) + p := NewPopulatedPartSetHeader(popr, true) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(dAtA) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := github_com_gogo_protobuf_proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + func TestValidatorSize(t *testing.T) { seed := time.Now().UnixNano() popr := math_rand.New(math_rand.NewSource(seed)) diff --git a/types/block.go b/types/block.go index bb816963..8588d557 100644 --- a/types/block.go +++ b/types/block.go @@ -196,14 +196,14 @@ func (b *Block) StringShort() string { // NOTE: changes to the Header should be duplicated in the abci Header type Header struct { // basic block info - ChainID string `json:"chain_id"` - Height int64 `json:"height"` - Time time.Time `json:"time"` - NumTxs int64 `json:"num_txs"` + ChainID string `json:"chain_id"` + Height int64 `json:"height"` + Time time.Time `json:"time"` + NumTxs int64 `json:"num_txs"` + TotalTxs int64 `json:"total_txs"` // prev block info LastBlockID BlockID `json:"last_block_id"` - TotalTxs int64 `json:"total_txs"` // hashes of block data LastCommitHash cmn.HexBytes `json:"last_commit_hash"` // commit from validators from the last block diff --git a/types/proto3/block.pb.go b/types/proto3/block.pb.go index 805828f8..ab1c66cf 100644 --- a/types/proto3/block.pb.go +++ b/types/proto3/block.pb.go @@ -1,18 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: block.proto +// source: types/proto3/block.proto -/* -Package proto3 is a generated protocol buffer package. - -It is generated from these files: - block.proto - -It has these top-level messages: - PartSetHeader - BlockID - Header - Timestamp -*/ +//nolint package proto3 import proto "github.com/golang/protobuf/proto" @@ -31,14 +20,36 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type PartSetHeader struct { - Total int32 `protobuf:"zigzag32,1,opt,name=Total" json:"Total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"` + Total int32 `protobuf:"zigzag32,1,opt,name=Total,proto3" json:"Total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=Hash,proto3" json:"Hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } -func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } -func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_block_c8c1dcbe91697ccd, []int{0} +} +func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PartSetHeader.Unmarshal(m, b) +} +func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) +} +func (dst *PartSetHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartSetHeader.Merge(dst, src) +} +func (m *PartSetHeader) XXX_Size() int { + return xxx_messageInfo_PartSetHeader.Size(m) +} +func (m *PartSetHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PartSetHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo func (m *PartSetHeader) GetTotal() int32 { if m != nil { @@ -55,14 +66,36 @@ func (m *PartSetHeader) GetHash() []byte { } type BlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"` - PartsHeader *PartSetHeader `protobuf:"bytes,2,opt,name=PartsHeader" json:"PartsHeader,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"` + PartsHeader *PartSetHeader `protobuf:"bytes,2,opt,name=PartsHeader,proto3" json:"PartsHeader,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockID) Reset() { *m = BlockID{} } -func (m *BlockID) String() string { return proto.CompactTextString(m) } -func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (m *BlockID) Reset() { *m = BlockID{} } +func (m *BlockID) String() string { return proto.CompactTextString(m) } +func (*BlockID) ProtoMessage() {} +func (*BlockID) Descriptor() ([]byte, []int) { + return fileDescriptor_block_c8c1dcbe91697ccd, []int{1} +} +func (m *BlockID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockID.Unmarshal(m, b) +} +func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) +} +func (dst *BlockID) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockID.Merge(dst, src) +} +func (m *BlockID) XXX_Size() int { + return xxx_messageInfo_BlockID.Size(m) +} +func (m *BlockID) XXX_DiscardUnknown() { + xxx_messageInfo_BlockID.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockID proto.InternalMessageInfo func (m *BlockID) GetHash() []byte { if m != nil { @@ -80,13 +113,13 @@ func (m *BlockID) GetPartsHeader() *PartSetHeader { type Header struct { // basic block info - ChainID string `protobuf:"bytes,1,opt,name=ChainID" json:"ChainID,omitempty"` - Height int64 `protobuf:"zigzag64,2,opt,name=Height" json:"Height,omitempty"` - Time *Timestamp `protobuf:"bytes,3,opt,name=Time" json:"Time,omitempty"` - NumTxs int64 `protobuf:"zigzag64,4,opt,name=NumTxs" json:"NumTxs,omitempty"` + ChainID string `protobuf:"bytes,1,opt,name=ChainID,proto3" json:"ChainID,omitempty"` + Height int64 `protobuf:"zigzag64,2,opt,name=Height,proto3" json:"Height,omitempty"` + Time *Timestamp `protobuf:"bytes,3,opt,name=Time,proto3" json:"Time,omitempty"` + NumTxs int64 `protobuf:"zigzag64,4,opt,name=NumTxs,proto3" json:"NumTxs,omitempty"` + TotalTxs int64 `protobuf:"zigzag64,5,opt,name=TotalTxs,proto3" json:"TotalTxs,omitempty"` // prev block info - LastBlockID *BlockID `protobuf:"bytes,5,opt,name=LastBlockID" json:"LastBlockID,omitempty"` - TotalTxs int64 `protobuf:"zigzag64,6,opt,name=TotalTxs" json:"TotalTxs,omitempty"` + LastBlockID *BlockID `protobuf:"bytes,6,opt,name=LastBlockID,proto3" json:"LastBlockID,omitempty"` // hashes of block data LastCommitHash []byte `protobuf:"bytes,7,opt,name=LastCommitHash,proto3" json:"LastCommitHash,omitempty"` DataHash []byte `protobuf:"bytes,8,opt,name=DataHash,proto3" json:"DataHash,omitempty"` @@ -96,13 +129,36 @@ type Header struct { AppHash []byte `protobuf:"bytes,11,opt,name=AppHash,proto3" json:"AppHash,omitempty"` LastResultsHash []byte `protobuf:"bytes,12,opt,name=LastResultsHash,proto3" json:"LastResultsHash,omitempty"` // consensus info - EvidenceHash []byte `protobuf:"bytes,13,opt,name=EvidenceHash,proto3" json:"EvidenceHash,omitempty"` + EvidenceHash []byte `protobuf:"bytes,13,opt,name=EvidenceHash,proto3" json:"EvidenceHash,omitempty"` + ProposerAddress []byte `protobuf:"bytes,14,opt,name=ProposerAddress,proto3" json:"ProposerAddress,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { + return fileDescriptor_block_c8c1dcbe91697ccd, []int{2} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Header.Unmarshal(m, b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) +} +func (dst *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(dst, src) +} +func (m *Header) XXX_Size() int { + return xxx_messageInfo_Header.Size(m) +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo func (m *Header) GetChainID() string { if m != nil { @@ -132,13 +188,6 @@ func (m *Header) GetNumTxs() int64 { return 0 } -func (m *Header) GetLastBlockID() *BlockID { - if m != nil { - return m.LastBlockID - } - return nil -} - func (m *Header) GetTotalTxs() int64 { if m != nil { return m.TotalTxs @@ -146,6 +195,13 @@ func (m *Header) GetTotalTxs() int64 { return 0 } +func (m *Header) GetLastBlockID() *BlockID { + if m != nil { + return m.LastBlockID + } + return nil +} + func (m *Header) GetLastCommitHash() []byte { if m != nil { return m.LastCommitHash @@ -195,19 +251,48 @@ func (m *Header) GetEvidenceHash() []byte { return nil } +func (m *Header) GetProposerAddress() []byte { + if m != nil { + return m.ProposerAddress + } + return nil +} + // Timestamp wraps how amino encodes time. Note that this is different from the protobuf well-known type // protobuf/timestamp.proto in the sense that there seconds and nanos are varint encoded. See: // https://github.com/google/protobuf/blob/d2980062c859649523d5fd51d6b55ab310e47482/src/google/protobuf/timestamp.proto#L123-L135 // Also nanos do not get skipped if they are zero in amino. type Timestamp struct { - Seconds int64 `protobuf:"fixed64,1,opt,name=seconds" json:"seconds,omitempty"` - Nanos int32 `protobuf:"fixed32,2,opt,name=nanos" json:"nanos,omitempty"` + Seconds int64 `protobuf:"fixed64,1,opt,name=seconds,proto3" json:"seconds,omitempty"` + Nanos int32 `protobuf:"fixed32,2,opt,name=nanos,proto3" json:"nanos,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Timestamp) Reset() { *m = Timestamp{} } -func (m *Timestamp) String() string { return proto.CompactTextString(m) } -func (*Timestamp) ProtoMessage() {} -func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (m *Timestamp) Reset() { *m = Timestamp{} } +func (m *Timestamp) String() string { return proto.CompactTextString(m) } +func (*Timestamp) ProtoMessage() {} +func (*Timestamp) Descriptor() ([]byte, []int) { + return fileDescriptor_block_c8c1dcbe91697ccd, []int{3} +} +func (m *Timestamp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Timestamp.Unmarshal(m, b) +} +func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) +} +func (dst *Timestamp) XXX_Merge(src proto.Message) { + xxx_messageInfo_Timestamp.Merge(dst, src) +} +func (m *Timestamp) XXX_Size() int { + return xxx_messageInfo_Timestamp.Size(m) +} +func (m *Timestamp) XXX_DiscardUnknown() { + xxx_messageInfo_Timestamp.DiscardUnknown(m) +} + +var xxx_messageInfo_Timestamp proto.InternalMessageInfo func (m *Timestamp) GetSeconds() int64 { if m != nil { @@ -230,32 +315,33 @@ func init() { proto.RegisterType((*Timestamp)(nil), "proto3.Timestamp") } -func init() { proto.RegisterFile("block.proto", fileDescriptor0) } +func init() { proto.RegisterFile("types/proto3/block.proto", fileDescriptor_block_c8c1dcbe91697ccd) } -var fileDescriptor0 = []byte{ - // 372 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x4f, 0x6b, 0xe3, 0x30, - 0x10, 0xc5, 0xf1, 0xe6, 0xff, 0x38, 0xd9, 0x6c, 0x86, 0xdd, 0xc5, 0xf4, 0x14, 0x4c, 0x5b, 0x72, - 0x0a, 0xb4, 0x39, 0x94, 0xd2, 0x53, 0x9b, 0x14, 0x12, 0x28, 0xa5, 0xa8, 0x21, 0x77, 0x25, 0x16, - 0x8d, 0xa9, 0x2d, 0x19, 0x4b, 0x29, 0xfd, 0x7c, 0xfd, 0x64, 0x45, 0x23, 0xdb, 0x8d, 0x73, 0x4a, - 0xde, 0x9b, 0x37, 0xbf, 0x91, 0x47, 0x02, 0x7f, 0x9b, 0xa8, 0xdd, 0xfb, 0x34, 0xcb, 0x95, 0x51, - 0xd8, 0xa6, 0x9f, 0x59, 0x78, 0x0b, 0x83, 0x17, 0x9e, 0x9b, 0x57, 0x61, 0x96, 0x82, 0x47, 0x22, - 0xc7, 0xbf, 0xd0, 0x5a, 0x2b, 0xc3, 0x93, 0xc0, 0x1b, 0x7b, 0x93, 0x11, 0x73, 0x02, 0x11, 0x9a, - 0x4b, 0xae, 0xf7, 0xc1, 0xaf, 0xb1, 0x37, 0xe9, 0x33, 0xfa, 0x1f, 0x6e, 0xa0, 0xf3, 0x60, 0x89, - 0xab, 0x45, 0x55, 0xf6, 0x7e, 0xca, 0x78, 0x03, 0xbe, 0x25, 0x6b, 0xc7, 0xa5, 0x4e, 0xff, 0xfa, - 0x9f, 0x1b, 0x3f, 0x9b, 0xd6, 0x86, 0xb2, 0xe3, 0x64, 0xf8, 0xd5, 0x80, 0x76, 0x71, 0x98, 0x00, - 0x3a, 0xf3, 0x3d, 0x8f, 0xe5, 0x6a, 0x41, 0xe8, 0x1e, 0x2b, 0x25, 0xfe, 0xb7, 0x99, 0xf8, 0x6d, - 0x6f, 0x08, 0x8c, 0xac, 0x50, 0x78, 0x01, 0xcd, 0x75, 0x9c, 0x8a, 0xa0, 0x41, 0xe3, 0x46, 0xe5, - 0x38, 0xeb, 0x69, 0xc3, 0xd3, 0x8c, 0x51, 0xd9, 0xb6, 0x3f, 0x1f, 0xd2, 0xf5, 0xa7, 0x0e, 0x9a, - 0xae, 0xdd, 0x29, 0xbc, 0x02, 0xff, 0x89, 0x6b, 0x53, 0x7c, 0x57, 0xd0, 0x22, 0xca, 0xb0, 0xa4, - 0x14, 0x36, 0x3b, 0xce, 0xe0, 0x19, 0x74, 0x69, 0x47, 0x16, 0xd6, 0x26, 0x58, 0xa5, 0xf1, 0x12, - 0x7e, 0xdb, 0xe8, 0x5c, 0xa5, 0x69, 0x6c, 0x68, 0x43, 0x1d, 0xda, 0xd0, 0x89, 0x6b, 0x19, 0x0b, - 0x6e, 0x38, 0x25, 0xba, 0x94, 0xa8, 0xb4, 0x65, 0x6c, 0x78, 0x12, 0x47, 0xdc, 0xa8, 0x5c, 0x53, - 0xa2, 0xe7, 0x18, 0x75, 0x17, 0xcf, 0x61, 0x30, 0x57, 0x52, 0x0b, 0xa9, 0x0f, 0x2e, 0x06, 0x14, - 0xab, 0x9b, 0x76, 0xa3, 0xf7, 0x59, 0x46, 0x75, 0x9f, 0xea, 0xa5, 0xc4, 0x09, 0x0c, 0xed, 0xa9, - 0x98, 0xd0, 0x87, 0xc4, 0x38, 0x42, 0x9f, 0x12, 0xa7, 0x36, 0x86, 0xd0, 0x7f, 0xfc, 0x88, 0x23, - 0x21, 0x77, 0x82, 0x62, 0x03, 0x8a, 0xd5, 0xbc, 0xf0, 0x0e, 0x7a, 0xd5, 0xce, 0xed, 0x50, 0x2d, - 0x76, 0x4a, 0x46, 0x9a, 0xae, 0xf1, 0x0f, 0x2b, 0xa5, 0x7d, 0x6d, 0x92, 0x4b, 0xa5, 0xe9, 0x16, - 0x87, 0xcc, 0x89, 0x6d, 0xf1, 0x38, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x74, 0x2f, 0xbd, - 0xb2, 0x02, 0x00, 0x00, +var fileDescriptor_block_c8c1dcbe91697ccd = []byte{ + // 395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0x4b, 0x8b, 0xdb, 0x30, + 0x10, 0xc6, 0xcd, 0x7b, 0x9c, 0x47, 0x23, 0xda, 0x22, 0x7a, 0x0a, 0xa6, 0x2d, 0x39, 0x25, 0xb4, + 0x39, 0x94, 0xd2, 0x53, 0x9a, 0x14, 0x12, 0x28, 0x25, 0x68, 0x43, 0xee, 0x4a, 0x2c, 0x36, 0x66, + 0x6d, 0xcb, 0x78, 0x94, 0x65, 0xf7, 0x3f, 0xef, 0x8f, 0x58, 0x34, 0xb2, 0xbd, 0x71, 0x6e, 0xfe, + 0x1e, 0xfa, 0x3e, 0x79, 0x46, 0xc0, 0xcd, 0x73, 0xa6, 0x70, 0x9e, 0xe5, 0xda, 0xe8, 0xc5, 0xfc, + 0x18, 0xeb, 0xd3, 0xc3, 0x8c, 0x00, 0x6b, 0x3b, 0x2e, 0xf8, 0x05, 0x83, 0x9d, 0xcc, 0xcd, 0x9d, + 0x32, 0x1b, 0x25, 0x43, 0x95, 0xb3, 0x0f, 0xd0, 0xda, 0x6b, 0x23, 0x63, 0xee, 0x4d, 0xbc, 0xe9, + 0x58, 0x38, 0xc0, 0x18, 0x34, 0x37, 0x12, 0xcf, 0xfc, 0xdd, 0xc4, 0x9b, 0xf6, 0x05, 0x7d, 0x07, + 0x07, 0xe8, 0xfc, 0xb1, 0x89, 0xdb, 0x75, 0x25, 0x7b, 0x6f, 0x32, 0xfb, 0x09, 0xbe, 0x4d, 0x46, + 0x97, 0x4b, 0x27, 0xfd, 0x1f, 0x1f, 0x5d, 0xfd, 0x62, 0x56, 0x2b, 0x15, 0xd7, 0xce, 0xe0, 0xa5, + 0x01, 0xed, 0xe2, 0x32, 0x1c, 0x3a, 0xab, 0xb3, 0x8c, 0xd2, 0xed, 0x9a, 0xa2, 0x7b, 0xa2, 0x84, + 0xec, 0x93, 0xf5, 0x44, 0xf7, 0x67, 0x43, 0xc1, 0x4c, 0x14, 0x88, 0x7d, 0x85, 0xe6, 0x3e, 0x4a, + 0x14, 0x6f, 0x50, 0xdd, 0xb8, 0xac, 0xb3, 0x1c, 0x1a, 0x99, 0x64, 0x82, 0x64, 0x7b, 0xfc, 0xff, + 0x25, 0xd9, 0x3f, 0x21, 0x6f, 0xba, 0xe3, 0x0e, 0xb1, 0xcf, 0xd0, 0xa5, 0x1f, 0xb6, 0x4a, 0x8b, + 0x94, 0x0a, 0xb3, 0xef, 0xe0, 0xff, 0x93, 0x68, 0x8a, 0x7f, 0xe6, 0x6d, 0x6a, 0x18, 0x95, 0x0d, + 0x05, 0x2d, 0xae, 0x3d, 0xec, 0x1b, 0x0c, 0x2d, 0x5c, 0xe9, 0x24, 0x89, 0x0c, 0x4d, 0xa8, 0x43, + 0x13, 0xba, 0x61, 0x6d, 0xed, 0x5a, 0x1a, 0x49, 0x8e, 0x2e, 0x39, 0x2a, 0x6c, 0x33, 0x0e, 0x32, + 0x8e, 0x42, 0x69, 0x74, 0x8e, 0xe4, 0xe8, 0xb9, 0x8c, 0x3a, 0xcb, 0xbe, 0xc0, 0x60, 0xa5, 0x53, + 0x54, 0x29, 0x5e, 0x9c, 0x0d, 0xc8, 0x56, 0x27, 0xed, 0x44, 0x97, 0x59, 0x46, 0xba, 0x4f, 0x7a, + 0x09, 0xd9, 0x14, 0x46, 0xf6, 0x56, 0x42, 0xe1, 0x25, 0x36, 0x2e, 0xa1, 0x4f, 0x8e, 0x5b, 0x9a, + 0x05, 0xd0, 0xff, 0xfb, 0x18, 0x85, 0x2a, 0x3d, 0x29, 0xb2, 0x0d, 0xc8, 0x56, 0xe3, 0x6c, 0xda, + 0x2e, 0xd7, 0x99, 0x46, 0x95, 0x2f, 0xc3, 0x30, 0x57, 0x88, 0x7c, 0xe8, 0xd2, 0x6e, 0xe8, 0xe0, + 0x37, 0xf4, 0xaa, 0xed, 0xd8, 0xeb, 0xa1, 0x3a, 0xe9, 0x34, 0x44, 0x5a, 0xf8, 0x7b, 0x51, 0x42, + 0xfb, 0x2e, 0x53, 0x99, 0x6a, 0xa4, 0x7d, 0x8f, 0x84, 0x03, 0xc7, 0xe2, 0x19, 0xbf, 0x06, 0x00, + 0x00, 0xff, 0xff, 0xde, 0x29, 0x34, 0x75, 0xe9, 0x02, 0x00, 0x00, } diff --git a/types/proto3/block.proto b/types/proto3/block.proto index bc3cf874..cefd180d 100644 --- a/types/proto3/block.proto +++ b/types/proto3/block.proto @@ -19,10 +19,10 @@ message Header { sint64 Height = 2; Timestamp Time = 3; sint64 NumTxs = 4; + sint64 TotalTxs = 5; // prev block info - BlockID LastBlockID = 5; - sint64 TotalTxs = 6; + BlockID LastBlockID = 6; // hashes of block data bytes LastCommitHash = 7; // commit from validators from the last block @@ -36,6 +36,7 @@ message Header { // consensus info bytes EvidenceHash = 13; // evidence included in the block + bytes ProposerAddress = 14; // original proposer of the block } // Timestamp wraps how amino encodes time. Note that this is different from the protobuf well-known type diff --git a/types/protobuf.go b/types/protobuf.go index 57161915..1681dd37 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -35,17 +35,23 @@ type tm2pb struct{} func (tm2pb) Header(header *Header) abci.Header { return abci.Header{ - ChainID: header.ChainID, - Height: header.Height, - + ChainID: header.ChainID, + Height: header.Height, Time: header.Time, - NumTxs: int32(header.NumTxs), // XXX: overflow + NumTxs: header.NumTxs, TotalTxs: header.TotalTxs, - LastBlockHash: header.LastBlockID.Hash, - ValidatorsHash: header.ValidatorsHash, - AppHash: header.AppHash, + LastBlockId: TM2PB.BlockID(header.LastBlockID), + LastCommitHash: header.LastCommitHash, + DataHash: header.DataHash, + + ValidatorsHash: header.ValidatorsHash, + ConsensusHash: header.ConsensusHash, + AppHash: header.AppHash, + LastResultsHash: header.LastResultsHash, + + EvidenceHash: header.EvidenceHash, ProposerAddress: header.ProposerAddress, } } @@ -57,6 +63,20 @@ func (tm2pb) ValidatorWithoutPubKey(val *Validator) abci.Validator { } } +func (tm2pb) BlockID(blockID BlockID) abci.BlockID { + return abci.BlockID{ + Hash: blockID.Hash, + PartsHeader: TM2PB.PartSetHeader(blockID.PartsHeader), + } +} + +func (tm2pb) PartSetHeader(header PartSetHeader) abci.PartSetHeader { + return abci.PartSetHeader{ + Total: int32(header.Total), + Hash: header.Hash, + } +} + // XXX: panics on unknown pubkey type func (tm2pb) Validator(val *Validator) abci.Validator { return abci.Validator{ From 087b657008a1a7ac62ae78d6e907f60ada4f389a Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 5 Aug 2018 16:50:53 -0400 Subject: [PATCH 037/149] speed up some tests. ref #2038 --- abci/example/example_test.go | 6 +++--- libs/clist/clist_test.go | 10 +++++----- p2p/conn/connection_test.go | 2 -- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/abci/example/example_test.go b/abci/example/example_test.go index 8fa3ae02..677a2a48 100644 --- a/abci/example/example_test.go +++ b/abci/example/example_test.go @@ -39,7 +39,7 @@ func TestGRPC(t *testing.T) { } func testStream(t *testing.T, app types.Application) { - numDeliverTxs := 200000 + numDeliverTxs := 20000 // Start the listener server := abciserver.NewSocketServer("unix://test.sock", app) @@ -72,7 +72,7 @@ func testStream(t *testing.T, app types.Application) { } if counter == numDeliverTxs { go func() { - time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow + time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow close(done) }() return @@ -148,7 +148,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Log("response", counter) if counter == numDeliverTxs { go func() { - time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow + time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow }() } diff --git a/libs/clist/clist_test.go b/libs/clist/clist_test.go index dbdf2f02..f6653d22 100644 --- a/libs/clist/clist_test.go +++ b/libs/clist/clist_test.go @@ -149,8 +149,8 @@ func _TestGCRandom(t *testing.T) { func TestScanRightDeleteRandom(t *testing.T) { - const numElements = 10000 - const numTimes = 1000 + const numElements = 1000 + const numTimes = 100 const numScanners = 10 l := New() @@ -209,7 +209,7 @@ func TestScanRightDeleteRandom(t *testing.T) { // Stop scanners close(stop) - time.Sleep(time.Second * 1) + // time.Sleep(time.Second * 1) // And remove all the elements. for el := l.Front(); el != nil; el = el.Next() { @@ -244,7 +244,7 @@ func TestWaitChan(t *testing.T) { for i := 1; i < 100; i++ { l.PushBack(i) pushed++ - time.Sleep(time.Duration(cmn.RandIntn(100)) * time.Millisecond) + time.Sleep(time.Duration(cmn.RandIntn(25)) * time.Millisecond) } close(done) }() @@ -283,7 +283,7 @@ FOR_LOOP2: if prev == nil { t.Fatal("expected PrevWaitChan to block forever on nil when reached first elem") } - case <-time.After(5 * time.Second): + case <-time.After(3 * time.Second): break FOR_LOOP2 } } diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index 19e05fbc..95b5488a 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -433,7 +433,6 @@ func TestMConnectionReadErrorLongMessage(t *testing.T) { _, err = client.Write(buf.Bytes()) assert.Nil(t, err) assert.True(t, expectSend(chOnRcv), "msg just right") - assert.False(t, expectSend(chOnErr), "msg just right") // send msg thats too long buf = new(bytes.Buffer) @@ -446,7 +445,6 @@ func TestMConnectionReadErrorLongMessage(t *testing.T) { assert.Nil(t, err) _, err = client.Write(buf.Bytes()) assert.NotNil(t, err) - assert.False(t, expectSend(chOnRcv), "msg too long") assert.True(t, expectSend(chOnErr), "msg too long") } From 21448bcf4f434f74bd1768e1bf3ba4a001db953e Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Thu, 2 Aug 2018 23:18:09 -0700 Subject: [PATCH 038/149] crypto: Add compact bit array for intended usage in the multisig This is in a separate PR for ease of review. --- crypto/multisig/compact_bit_array.go | 218 ++++++++++++++++++++++ crypto/multisig/compact_bit_array_test.go | 169 +++++++++++++++++ 2 files changed, 387 insertions(+) create mode 100644 crypto/multisig/compact_bit_array.go create mode 100644 crypto/multisig/compact_bit_array_test.go diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go new file mode 100644 index 00000000..d14dd8e6 --- /dev/null +++ b/crypto/multisig/compact_bit_array.go @@ -0,0 +1,218 @@ +package multisig + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "regexp" + "strings" +) + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after amino encoding. +// This is not thread safe, and is not intended for concurrent usage. +type CompactBitArray struct { + ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. + Elems []byte `json:"bits"` +} + +// NewCompactBitArray returns a new compact bit array. +// It returns nil if the number of bits is zero. +func NewCompactBitArray(bits int) *CompactBitArray { + if bits <= 0 { + return nil + } + return &CompactBitArray{ + ExtraBitsStored: byte(bits % 8), + Elems: make([]byte, (bits+7)/8), + } +} + +// Size returns the number of bits in the bitarray +func (bA *CompactBitArray) Size() int { + if bA == nil { + return 0 + } else if bA.ExtraBitsStored == byte(0) { + return len(bA.Elems) * 8 + } + return (len(bA.Elems)-1)*8 + int(bA.ExtraBitsStored) +} + +// GetIndex returns the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) GetIndex(i int) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + return bA.Elems[i>>3]&(uint8(1)< 0 +} + +// SetIndex sets the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) SetIndex(i int, v bool) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + if v { + bA.Elems[i>>3] |= (uint8(1) << uint8(7-(i%8))) + } else { + bA.Elems[i>>3] &= ^(uint8(1) << uint8(7-(i%8))) + } + return true +} + +// Copy returns a copy of the provided bit array. +func (bA *CompactBitArray) Copy() *CompactBitArray { + if bA == nil { + return nil + } + c := make([]byte, len(bA.Elems)) + copy(c, bA.Elems) + return &CompactBitArray{ + ExtraBitsStored: bA.ExtraBitsStored, + Elems: c, + } +} + +// String returns a string representation of CompactBitArray: BA{}, +// where is a sequence of 'x' (1) and '_' (0). +// The includes spaces and newlines to help people. +// For a simple sequence of 'x' and '_' characters with no spaces or newlines, +// see the MarshalJSON() method. +// Example: "BA{_x_}" or "nil-BitArray" for nil. +func (bA *CompactBitArray) String() string { + return bA.StringIndented("") +} + +// StringIndented returns the same thing as String(), but applies the indent +// at every 10th bit, and twice at every 50th bit. +func (bA *CompactBitArray) StringIndented(indent string) string { + if bA == nil { + return "nil-BitArray" + } + lines := []string{} + bits := "" + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += "x" + } else { + bits += "_" + } + if i%100 == 99 { + lines = append(lines, bits) + bits = "" + } + if i%10 == 9 { + bits += indent + } + if i%50 == 49 { + bits += indent + } + } + if len(bits) > 0 { + lines = append(lines, bits) + } + return fmt.Sprintf("BA{%v:%v}", size, strings.Join(lines, indent)) +} + +// MarshalJSON implements json.Marshaler interface by marshaling bit array +// using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit. +func (bA *CompactBitArray) MarshalJSON() ([]byte, error) { + if bA == nil { + return []byte("null"), nil + } + + bits := `"` + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += `x` + } else { + bits += `_` + } + } + bits += `"` + return []byte(bits), nil +} + +var bitArrayJSONRegexp = regexp.MustCompile(`\A"([_x]*)"\z`) + +// UnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom +// JSON description. +func (bA *CompactBitArray) UnmarshalJSON(bz []byte) error { + b := string(bz) + if b == "null" { + // This is required e.g. for encoding/json when decoding + // into a pointer with pre-allocated BitArray. + bA.ExtraBitsStored = 0 + bA.Elems = nil + return nil + } + + // Validate 'b'. + match := bitArrayJSONRegexp.FindStringSubmatch(b) + if match == nil { + return fmt.Errorf("BitArray in JSON should be a string of format %q but got %s", bitArrayJSONRegexp.String(), b) + } + bits := match[1] + + // Construct new CompactBitArray and copy over. + numBits := len(bits) + bA2 := NewCompactBitArray(numBits) + for i := 0; i < numBits; i++ { + if bits[i] == 'x' { + bA2.SetIndex(i, true) + } + } + *bA = *bA2 + return nil +} + +// CompactMarshal is a space efficient encoding for CompactBitArray. +// It is not amino compatible. +func (bA *CompactBitArray) CompactMarshal() []byte { + size := bA.Size() + if size <= 0 { + return []byte("null") + } + bz := make([]byte, 0, size/8) + // length prefix number of bits, not number of bytes. This difference + // takes 3-4 bits in encoding, as opposed to instead encoding the number of + // bytes (saving 3-4 bits) and including the offset as a full byte. + bz = appendUvarint(bz, uint64(size)) + bz = append(bz, bA.Elems...) + return bz +} + +// CompactUnmarshal is a space efficient decoding for CompactBitArray. +// It is not amino compatible. +func CompactUnmarshal(bz []byte) (*CompactBitArray, error) { + if len(bz) < 2 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } else if bytes.Equal(bz, []byte("null")) { + return NewCompactBitArray(0), nil + } + size, n := binary.Uvarint(bz) + bz = bz[n:] + if len(bz) != int(size+7)/8 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } + + bA := &CompactBitArray{byte(int(size % 8)), bz} + return bA, nil +} + +func appendUvarint(b []byte, x uint64) []byte { + var a [binary.MaxVarintLen64]byte + n := binary.PutUvarint(a[:], x) + return append(b, a[:n]...) +} diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go new file mode 100644 index 00000000..91a82192 --- /dev/null +++ b/crypto/multisig/compact_bit_array_test.go @@ -0,0 +1,169 @@ +package multisig + +import ( + "encoding/json" + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + cmn "github.com/tendermint/tendermint/libs/common" +) + +func randCompactBitArray(bits int) (*CompactBitArray, []byte) { + numBytes := (bits + 7) / 8 + src := cmn.RandBytes((bits + 7) / 8) + bA := NewCompactBitArray(bits) + + for i := 0; i < numBytes-1; i++ { + for j := uint8(0); j < 8; j++ { + bA.SetIndex(i*8+int(j), src[i]&(uint8(1)<<(8-j)) > 0) + } + } + // Set remaining bits + for i := uint8(0); i < 8-uint8(bA.ExtraBitsStored); i++ { + bA.SetIndex(numBytes*8+int(i), src[numBytes-1]&(uint8(1)<<(8-i)) > 0) + } + return bA, src +} + +func TestNewBitArrayNeverCrashesOnNegatives(t *testing.T) { + bitList := []int{-127, -128, -1 << 31} + for _, bits := range bitList { + _ = NewCompactBitArray(bits) + } +} + +func TestJSONMarshalUnmarshal(t *testing.T) { + + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA string + }{ + {nil, `null`}, + {bA1, `null`}, + {bA2, `"_"`}, + {bA3, `"x"`}, + {bA4, `"xx___"`}, + {bA5, `"xx______x"`}, + {bA6, `"xx_____________x"`}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz, err := json.Marshal(tc.bA) + require.NoError(t, err) + + assert.Equal(t, tc.marshalledBA, string(bz)) + + var unmarshalledBA *CompactBitArray + err = json.Unmarshal(bz, &unmarshalledBA) + require.NoError(t, err) + + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactMarshalUnmarshal(t *testing.T) { + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA []byte + }{ + {nil, []byte("null")}, + {bA1, []byte("null")}, + {bA2, []byte{byte(1), byte(0)}}, + {bA3, []byte{byte(1), byte(128)}}, + {bA4, []byte{byte(5), byte(192)}}, + {bA5, []byte{byte(9), byte(192), byte(128)}}, + {bA6, []byte{byte(16), byte(192), byte(1)}}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz := tc.bA.CompactMarshal() + + assert.Equal(t, tc.marshalledBA, bz) + + unmarshalledBA, err := CompactUnmarshal(bz) + require.NoError(t, err) + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactBitArrayGetSetIndex(t *testing.T) { + r := rand.New(rand.NewSource(100)) + numTests := 10 + numBitsPerArr := 100 + for i := 0; i < numTests; i++ { + bits := r.Intn(1000) + bA, _ := randCompactBitArray(bits) + + for j := 0; j < numBitsPerArr; j++ { + copy := bA.Copy() + index := r.Intn(bits) + val := (r.Int63() % 2) == 0 + bA.SetIndex(index, val) + require.Equal(t, val, bA.GetIndex(index), "bA.SetIndex(%d, %v) failed on bit array: %s", index, val, copy) + } + } +} From e7dd76c28d9eb3ff9b30f0dd1303e25bd16bca9b Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 6 Aug 2018 21:17:38 -0500 Subject: [PATCH 039/149] crypto: Threshold multisig implementation --- crypto/multisig/compact_bit_array.go | 15 +++++ crypto/multisig/compact_bit_array_test.go | 26 ++++++++ crypto/multisig/multisignature.go | 60 +++++++++++++++++ crypto/multisig/threshold_multisig.go | 78 ++++++++++++++++++++++ crypto/multisig/threshold_multisig_test.go | 73 ++++++++++++++++++++ crypto/multisig/wire.go | 26 ++++++++ 6 files changed, 278 insertions(+) create mode 100644 crypto/multisig/multisignature.go create mode 100644 crypto/multisig/threshold_multisig.go create mode 100644 crypto/multisig/threshold_multisig_test.go create mode 100644 crypto/multisig/wire.go diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go index d14dd8e6..f7f508ce 100644 --- a/crypto/multisig/compact_bit_array.go +++ b/crypto/multisig/compact_bit_array.go @@ -69,6 +69,21 @@ func (bA *CompactBitArray) SetIndex(i int, v bool) bool { return true } +// trueIndex returns the location of the given index, among the +// values in the bit array that are set to true. +// e.g. if bA = _XX_X_X, trueIndex(4) = 2, since +// the value at index 4 of the bit array is the third +// value that is true. (And it is 0-indexed) +func (bA *CompactBitArray) trueIndex(index int) int { + numTrueValues := 0 + for i := 0; i < index; i++ { + if bA.GetIndex(i) { + numTrueValues++ + } + } + return numTrueValues +} + // Copy returns a copy of the provided bit array. func (bA *CompactBitArray) Copy() *CompactBitArray { if bA == nil { diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go index 91a82192..dd3bed76 100644 --- a/crypto/multisig/compact_bit_array_test.go +++ b/crypto/multisig/compact_bit_array_test.go @@ -150,6 +150,32 @@ func TestCompactMarshalUnmarshal(t *testing.T) { } } +func TestCompactBitArrayTrueIndex(t *testing.T) { + testCases := []struct { + marshalledBA string + bAIndex []int + trueValueIndex []int + }{ + {`"_____"`, []int{0, 1, 2, 3, 4}, []int{0, 0, 0, 0, 0}}, + {`"x"`, []int{0}, []int{0}}, + {`"_x"`, []int{1}, []int{0}}, + {`"x___xxxx"`, []int{0, 4, 5, 6, 7}, []int{0, 1, 2, 3, 4}}, + {`"__x_xx_x__x_x___"`, []int{2, 4, 5, 7, 10, 12}, []int{0, 1, 2, 3, 4, 5}}, + {`"______________xx"`, []int{14, 15}, []int{0, 1}}, + } + for tcIndex, tc := range testCases { + t.Run(tc.marshalledBA, func(t *testing.T) { + var bA *CompactBitArray + err := json.Unmarshal([]byte(tc.marshalledBA), &bA) + require.NoError(t, err) + + for i := 0; i < len(tc.bAIndex); i++ { + require.Equal(t, tc.trueValueIndex[i], bA.trueIndex(tc.bAIndex[i]), "tc %d, i %d", tcIndex, i) + } + }) + } +} + func TestCompactBitArrayGetSetIndex(t *testing.T) { r := rand.New(rand.NewSource(100)) numTests := 10 diff --git a/crypto/multisig/multisignature.go b/crypto/multisig/multisignature.go new file mode 100644 index 00000000..60300ef5 --- /dev/null +++ b/crypto/multisig/multisignature.go @@ -0,0 +1,60 @@ +package multisig + +import "github.com/tendermint/tendermint/crypto" + +// Multisignature is used to represent the signature object used in the multisigs. +// Sigs is a list of signatures, sorted by corresponding index. +type Multisignature struct { + BitArray *CompactBitArray + Sigs [][]byte +} + +// NewMultisig returns a new Multisignature of size n. +func NewMultisig(n int) *Multisignature { + // Default the signature list to have a capacity of two, since we can + // expect that most multisigs will require multiple signers. + return &Multisignature{NewCompactBitArray(n), make([][]byte, 0, 2)} +} + +// GetIndex returns the index of pk in keys. Returns -1 if not found +func GetIndex(pk crypto.PubKey, keys []crypto.PubKey) int { + for i := 0; i < len(keys); i++ { + if pk.Equals(keys[i]) { + return i + } + } + return -1 +} + +// AddSignature adds a signature to the multisig, at the corresponding index. +func (mSig *Multisignature) AddSignature(sig []byte, index int) { + i := mSig.BitArray.trueIndex(index) + // Signature already exists, just replace the value there + if mSig.BitArray.GetIndex(index) { + mSig.Sigs[i] = sig + return + } + mSig.BitArray.SetIndex(index, true) + // Optimization if the index is the greatest index + if i > len(mSig.Sigs) { + mSig.Sigs = append(mSig.Sigs, sig) + return + } + // Expand slice by one with a dummy element, move all elements after i + // over by one, then place the new signature in that gap. + mSig.Sigs = append(mSig.Sigs, make([]byte, 0)) + copy(mSig.Sigs[i+1:], mSig.Sigs[i:]) + mSig.Sigs[i] = sig +} + +// AddSignatureFromPubkey adds a signature to the multisig, +// at the index in keys corresponding to the provided pubkey. +func (mSig *Multisignature) AddSignatureFromPubkey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) { + index := GetIndex(pubkey, keys) + mSig.AddSignature(sig, index) +} + +// Marshal the multisignature with amino +func (mSig *Multisignature) Marshal() []byte { + return cdc.MustMarshalBinary(mSig) +} diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go new file mode 100644 index 00000000..79438f89 --- /dev/null +++ b/crypto/multisig/threshold_multisig.go @@ -0,0 +1,78 @@ +package multisig + +import ( + "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/tmhash" +) + +// ThresholdMultiSignaturePubKey implements a K of N threshold multisig +type ThresholdMultiSignaturePubKey struct { + K uint `json:"threshold"` + Pubkeys []crypto.PubKey `json:"pubkeys"` +} + +var _ crypto.PubKey = &ThresholdMultiSignaturePubKey{} + +// NewThresholdMultiSignaturePubKey returns a new ThresholdMultiSignaturePubKey. +func NewThresholdMultiSignaturePubKey(k int, pubkeys []crypto.PubKey) crypto.PubKey { + if len(pubkeys) < k { + panic("threshold k of n multisignature: len(pubkeys) < k") + } + return &ThresholdMultiSignaturePubKey{uint(k), pubkeys} +} + +// VerifyBytes expects sig to be an amino encoded version of a MultiSignature. +// Returns true iff the multisignature contains k or more signatures +// for the correct corresponding keys, +// and all signatures are valid. (Not just k of the signatures) +// The multisig uses a bitarray, so multiple signatures for the same key is not +// a concern. +func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig []byte) bool { + var sig *Multisignature + err := cdc.UnmarshalBinary(marshalledSig, &sig) + if err != nil { + return false + } + size := sig.BitArray.Size() + if len(sig.Sigs) < int(pk.K) || len(pk.Pubkeys) != size { + return false + } + // index in the list of signatures which we are concerned with. + sigIndex := 0 + for i := 0; i < size; i++ { + if sig.BitArray.GetIndex(i) { + if !pk.Pubkeys[i].VerifyBytes(msg, sig.Sigs[sigIndex]) { + return false + } + sigIndex++ + } + } + return true +} + +// Bytes returns the amino encoded version of the ThresholdMultiSignaturePubKey +func (pk *ThresholdMultiSignaturePubKey) Bytes() []byte { + return cdc.MustMarshalBinary(pk) +} + +// Address returns tmhash(ThresholdMultiSignaturePubKey.Bytes()) +func (pk *ThresholdMultiSignaturePubKey) Address() crypto.Address { + return crypto.Address(tmhash.Sum(pk.Bytes())) +} + +// Equals returns true iff pk and other both have the same number of keys, and +// all constituent keys are the same, and in the same order. +func (pk *ThresholdMultiSignaturePubKey) Equals(other crypto.PubKey) bool { + if otherKey, ok := other.(*ThresholdMultiSignaturePubKey); ok { + if pk.K != otherKey.K { + return false + } + for i := uint(0); i < pk.K; i++ { + if !pk.Pubkeys[i].Equals(otherKey.Pubkeys[i]) { + return false + } + } + return true + } + return false +} diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_multisig_test.go new file mode 100644 index 00000000..31da1319 --- /dev/null +++ b/crypto/multisig/threshold_multisig_test.go @@ -0,0 +1,73 @@ +package multisig + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/tendermint/tendermint/crypto/secp256k1" +) + +func TestThresholdMultisig(t *testing.T) { + msg := []byte{1, 2, 3, 4} + pubkeys, sigs := generatePubKeysAndSignatures(5, msg) + multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) + multisignature := NewMultisig(5) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + // Make sure adding the same signature twice doesn't make the signature pass + multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + + // Adding two signatures should make it pass, as k = 2 + multisignature.AddSignatureFromPubkey(sigs[3], pubkeys[3], pubkeys) + require.True(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + + // Adding a third invalid signature should make verification fail. + multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[4], pubkeys) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + + // try adding the invalid signature one signature before + // first reset the multisig + multisignature.BitArray.SetIndex(4, false) + multisignature.Sigs = multisignature.Sigs[:2] + multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[2], pubkeys) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) +} + +func TestMultiSigPubkeyEquality(t *testing.T) { + msg := []byte{1, 2, 3, 4} + pubkeys, _ := generatePubKeysAndSignatures(5, msg) + multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) + var unmarshalledMultisig *ThresholdMultiSignaturePubKey + cdc.MustUnmarshalBinary(multisigKey.Bytes(), &unmarshalledMultisig) + require.Equal(t, multisigKey, unmarshalledMultisig) + + // Ensure that reordering pubkeys is treated as a different pubkey + pubkeysCpy := make([]crypto.PubKey, 5) + copy(pubkeysCpy, pubkeys) + pubkeysCpy[4] = pubkeys[3] + pubkeysCpy[3] = pubkeys[4] + multisigKey2 := NewThresholdMultiSignaturePubKey(2, pubkeysCpy) + require.NotEqual(t, multisigKey, multisigKey2) +} + +func generatePubKeysAndSignatures(n int, msg []byte) (pubkeys []crypto.PubKey, signatures [][]byte) { + pubkeys = make([]crypto.PubKey, n) + signatures = make([][]byte, n) + for i := 0; i < n; i++ { + var privkey crypto.PrivKey + if rand.Int63()%2 == 0 { + privkey = ed25519.GenPrivKey() + } else { + privkey = secp256k1.GenPrivKey() + } + pubkeys[i] = privkey.PubKey() + signatures[i], _ = privkey.Sign(msg) + } + return +} diff --git a/crypto/multisig/wire.go b/crypto/multisig/wire.go new file mode 100644 index 00000000..e0cb2a59 --- /dev/null +++ b/crypto/multisig/wire.go @@ -0,0 +1,26 @@ +package multisig + +import ( + amino "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/tendermint/tendermint/crypto/secp256k1" +) + +// TODO: Figure out API for others to either add their own pubkey types, or +// to make verify / marshal accept a cdc. +const ( + ThresholdPubkeyAminoRoute = "tendermint/ThresholdMultisigPubkey" +) + +var cdc = amino.NewCodec() + +func init() { + cdc.RegisterInterface((*crypto.PubKey)(nil), nil) + cdc.RegisterConcrete(ThresholdMultiSignaturePubKey{}, + ThresholdPubkeyAminoRoute, nil) + cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, + ed25519.Ed25519PubKeyAminoRoute, nil) + cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, + secp256k1.Secp256k1PubKeyAminoRoute, nil) +} From 67b6d51ff4333c209aee515c3e0cf85318d1d043 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Tue, 7 Aug 2018 10:42:47 -0500 Subject: [PATCH 040/149] (squash this) address PR comments + fix bug in equality check --- crypto/multisig/compact_bit_array.go | 6 ++--- crypto/multisig/compact_bit_array_test.go | 4 ++-- crypto/multisig/multisignature.go | 26 ++++++++++++++-------- crypto/multisig/threshold_multisig.go | 6 ++--- crypto/multisig/threshold_multisig_test.go | 4 ++-- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go index f7f508ce..2d9fe72a 100644 --- a/crypto/multisig/compact_bit_array.go +++ b/crypto/multisig/compact_bit_array.go @@ -69,12 +69,12 @@ func (bA *CompactBitArray) SetIndex(i int, v bool) bool { return true } -// trueIndex returns the location of the given index, among the +// NumOfTrueBitsBefore returns the location of the given index, among the // values in the bit array that are set to true. -// e.g. if bA = _XX_X_X, trueIndex(4) = 2, since +// e.g. if bA = _XX_X_X, NumOfTrueBitsBefore(4) = 2, since // the value at index 4 of the bit array is the third // value that is true. (And it is 0-indexed) -func (bA *CompactBitArray) trueIndex(index int) int { +func (bA *CompactBitArray) NumOfTrueBitsBefore(index int) int { numTrueValues := 0 for i := 0; i < index; i++ { if bA.GetIndex(i) { diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go index dd3bed76..3382c8b9 100644 --- a/crypto/multisig/compact_bit_array_test.go +++ b/crypto/multisig/compact_bit_array_test.go @@ -150,7 +150,7 @@ func TestCompactMarshalUnmarshal(t *testing.T) { } } -func TestCompactBitArrayTrueIndex(t *testing.T) { +func TestCompactBitArrayNumOfTrueBitsBefore(t *testing.T) { testCases := []struct { marshalledBA string bAIndex []int @@ -170,7 +170,7 @@ func TestCompactBitArrayTrueIndex(t *testing.T) { require.NoError(t, err) for i := 0; i < len(tc.bAIndex); i++ { - require.Equal(t, tc.trueValueIndex[i], bA.trueIndex(tc.bAIndex[i]), "tc %d, i %d", tcIndex, i) + require.Equal(t, tc.trueValueIndex[i], bA.NumOfTrueBitsBefore(tc.bAIndex[i]), "tc %d, i %d", tcIndex, i) } }) } diff --git a/crypto/multisig/multisignature.go b/crypto/multisig/multisignature.go index 60300ef5..bd2398b8 100644 --- a/crypto/multisig/multisignature.go +++ b/crypto/multisig/multisignature.go @@ -1,6 +1,10 @@ package multisig -import "github.com/tendermint/tendermint/crypto" +import ( + "errors" + + "github.com/tendermint/tendermint/crypto" +) // Multisignature is used to represent the signature object used in the multisigs. // Sigs is a list of signatures, sorted by corresponding index. @@ -17,7 +21,7 @@ func NewMultisig(n int) *Multisignature { } // GetIndex returns the index of pk in keys. Returns -1 if not found -func GetIndex(pk crypto.PubKey, keys []crypto.PubKey) int { +func getIndex(pk crypto.PubKey, keys []crypto.PubKey) int { for i := 0; i < len(keys); i++ { if pk.Equals(keys[i]) { return i @@ -28,30 +32,34 @@ func GetIndex(pk crypto.PubKey, keys []crypto.PubKey) int { // AddSignature adds a signature to the multisig, at the corresponding index. func (mSig *Multisignature) AddSignature(sig []byte, index int) { - i := mSig.BitArray.trueIndex(index) + newSigIndex := mSig.BitArray.NumOfTrueBitsBefore(index) // Signature already exists, just replace the value there if mSig.BitArray.GetIndex(index) { - mSig.Sigs[i] = sig + mSig.Sigs[newSigIndex] = sig return } mSig.BitArray.SetIndex(index, true) // Optimization if the index is the greatest index - if i > len(mSig.Sigs) { + if newSigIndex == len(mSig.Sigs) { mSig.Sigs = append(mSig.Sigs, sig) return } // Expand slice by one with a dummy element, move all elements after i // over by one, then place the new signature in that gap. mSig.Sigs = append(mSig.Sigs, make([]byte, 0)) - copy(mSig.Sigs[i+1:], mSig.Sigs[i:]) - mSig.Sigs[i] = sig + copy(mSig.Sigs[newSigIndex+1:], mSig.Sigs[newSigIndex:]) + mSig.Sigs[newSigIndex] = sig } // AddSignatureFromPubkey adds a signature to the multisig, // at the index in keys corresponding to the provided pubkey. -func (mSig *Multisignature) AddSignatureFromPubkey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) { - index := GetIndex(pubkey, keys) +func (mSig *Multisignature) AddSignatureFromPubkey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) error { + index := getIndex(pubkey, keys) + if index == -1 { + return errors.New("provided key didn't exist in pubkeys") + } mSig.AddSignature(sig, index) + return nil } // Marshal the multisignature with amino diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go index 79438f89..4ea69050 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_multisig.go @@ -5,7 +5,7 @@ import ( "github.com/tendermint/tendermint/crypto/tmhash" ) -// ThresholdMultiSignaturePubKey implements a K of N threshold multisig +// ThresholdMultiSignaturePubKey implements a K of N threshold multisig. type ThresholdMultiSignaturePubKey struct { K uint `json:"threshold"` Pubkeys []crypto.PubKey `json:"pubkeys"` @@ -64,10 +64,10 @@ func (pk *ThresholdMultiSignaturePubKey) Address() crypto.Address { // all constituent keys are the same, and in the same order. func (pk *ThresholdMultiSignaturePubKey) Equals(other crypto.PubKey) bool { if otherKey, ok := other.(*ThresholdMultiSignaturePubKey); ok { - if pk.K != otherKey.K { + if pk.K != otherKey.K || len(pk.Pubkeys) != len(otherKey.Pubkeys) { return false } - for i := uint(0); i < pk.K; i++ { + for i := 0; i < len(pk.Pubkeys); i++ { if !pk.Pubkeys[i].Equals(otherKey.Pubkeys[i]) { return false } diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_multisig_test.go index 31da1319..c3c4263f 100644 --- a/crypto/multisig/threshold_multisig_test.go +++ b/crypto/multisig/threshold_multisig_test.go @@ -45,7 +45,7 @@ func TestMultiSigPubkeyEquality(t *testing.T) { multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) var unmarshalledMultisig *ThresholdMultiSignaturePubKey cdc.MustUnmarshalBinary(multisigKey.Bytes(), &unmarshalledMultisig) - require.Equal(t, multisigKey, unmarshalledMultisig) + require.True(t, multisigKey.Equals(unmarshalledMultisig)) // Ensure that reordering pubkeys is treated as a different pubkey pubkeysCpy := make([]crypto.PubKey, 5) @@ -53,7 +53,7 @@ func TestMultiSigPubkeyEquality(t *testing.T) { pubkeysCpy[4] = pubkeys[3] pubkeysCpy[3] = pubkeys[4] multisigKey2 := NewThresholdMultiSignaturePubKey(2, pubkeysCpy) - require.NotEqual(t, multisigKey, multisigKey2) + require.False(t, multisigKey.Equals(multisigKey2)) } func generatePubKeysAndSignatures(n int, msg []byte) (pubkeys []crypto.PubKey, signatures [][]byte) { From 4e7bf10b599ab15e951daa0cbe77df68a8c56659 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Tue, 7 Aug 2018 11:37:42 -0500 Subject: [PATCH 041/149] (squash this) squashed bug with multiple signatures at same index. --- crypto/multisig/threshold_multisig.go | 2 +- crypto/multisig/threshold_multisig_test.go | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go index 4ea69050..adc5fd12 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_multisig.go @@ -34,7 +34,7 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ return false } size := sig.BitArray.Size() - if len(sig.Sigs) < int(pk.K) || len(pk.Pubkeys) != size { + if len(sig.Sigs) < int(pk.K) || len(pk.Pubkeys) != size || sig.BitArray.NumOfTrueBitsBefore(size) < int(pk.K) { return false } // index in the list of signatures which we are concerned with. diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_multisig_test.go index c3c4263f..cbd447a2 100644 --- a/crypto/multisig/threshold_multisig_test.go +++ b/crypto/multisig/threshold_multisig_test.go @@ -19,9 +19,9 @@ func TestThresholdMultisig(t *testing.T) { require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - // Make sure adding the same signature twice doesn't make the signature pass + // Make sure adding the same signature twice doesn't increase number of signatures multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) - require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + require.Equal(t, 1, len(multisignature.Sigs)) // Adding two signatures should make it pass, as k = 2 multisignature.AddSignatureFromPubkey(sigs[3], pubkeys[3], pubkeys) @@ -39,6 +39,18 @@ func TestThresholdMultisig(t *testing.T) { require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) } +func TestThresholdMultisigDuplicateSignatures(t *testing.T) { + msg := []byte{1, 2, 3, 4, 5} + pubkeys, sigs := generatePubKeysAndSignatures(5, msg) + multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) + multisignature := NewMultisig(5) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) + // Add second signature manually + multisignature.Sigs = append(multisignature.Sigs, sigs[0]) + require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) +} + func TestMultiSigPubkeyEquality(t *testing.T) { msg := []byte{1, 2, 3, 4} pubkeys, _ := generatePubKeysAndSignatures(5, msg) From e1b9bf7c81974986c8a1baa47d2a36159b9c61fe Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Wed, 8 Aug 2018 01:50:10 +0900 Subject: [PATCH 042/149] set capacity of txsmap (#2166) --- mempool/mempool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mempool/mempool.go b/mempool/mempool.go index e1ed4f26..5acb6f0d 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -401,7 +401,7 @@ func (mem *Mempool) collectTxs(maxTxs int) types.Txs { // NOTE: unsafe; Lock/Unlock must be managed by caller func (mem *Mempool) Update(height int64, txs types.Txs) error { // First, create a lookup map of txns in new txs. - txsMap := make(map[string]struct{}) + txsMap := make(map[string]struct{}, len(txs)) for _, tx := range txs { txsMap[string(tx)] = struct{}{} } From b30596b3a1e63e10b6ea34b881a7e58a4f19037d Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Tue, 7 Aug 2018 18:40:11 -0400 Subject: [PATCH 043/149] docs: fix links & other imrpvoements --- docs/README.md | 8 +- docs/app-dev/abci-cli.md | 4 +- docs/app-dev/app-architecture.md | 5 +- docs/{assets => imgs}/a_plus_t.png | Bin docs/{assets => imgs}/abci.png | Bin docs/{assets => imgs}/consensus_logic.png | Bin .../tm-application-example.png | Bin docs/{assets => imgs}/tm-transaction-flow.png | Bin docs/{assets => imgs}/tmint-logo-blue.png | Bin docs/introduction/introduction.md | 10 +- docs/introduction/quick-start.md | 11 +- docs/networks/deploy-testnets.md | 2 +- docs/spec/p2p/connection.md | 2 +- docs/spec/reactors/mempool/reactor.md | 4 +- docs/spec/software/abci.md | 2 +- docs/spec/software/wal.md | 3 +- docs/tendermint-core/how-to-read-logs.md | 10 +- docs/tendermint-core/rpc.md | 2 + docs/tendermint-core/running-in-production.md | 19 +- docs/tendermint-core/secure-p2p.md | 4 - docs/tendermint-core/using-tendermint.md | 14 +- docs/tools/monitoring.md | 2 +- docs/yarn.lock | 2507 ----------------- 23 files changed, 48 insertions(+), 2561 deletions(-) rename docs/{assets => imgs}/a_plus_t.png (100%) rename docs/{assets => imgs}/abci.png (100%) rename docs/{assets => imgs}/consensus_logic.png (100%) rename docs/{assets => imgs}/tm-application-example.png (100%) rename docs/{assets => imgs}/tm-transaction-flow.png (100%) rename docs/{assets => imgs}/tmint-logo-blue.png (100%) delete mode 100644 docs/yarn.lock diff --git a/docs/README.md b/docs/README.md index 16ea708a..8c6c5d10 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,17 +11,17 @@ replicates it on many machines. In other words, a blockchain. Tendermint requires an application running over the Application Blockchain Interface (ABCI) - and comes packaged with an example application to do so. -Follow the [installation instructions](./introduction/install) to get up and running -quickly. For more details on [using tendermint](./tendermint-core/using-tendermint) see that +Follow the [installation instructions](./introduction/install.md) to get up and running +quickly. For more details on [using tendermint](./tendermint-core/using-tendermint.md) see that and the following sections. ## Networks Testnets can be setup manually on one or more machines, or automatically on one or more machine, using a variety of methods described in the [deploy testnets -section](./networks/deploy-testnets). +section](./networks/deploy-testnets.md). ## Application Development The first step to building application on Tendermint is to [install -ABCI-CLI](./app-dev/getting-started) and play with the example applications. +ABCI-CLI](./app-dev/getting-started.md) and play with the example applications. diff --git a/docs/app-dev/abci-cli.md b/docs/app-dev/abci-cli.md index 4f9019fd..263c2c5e 100644 --- a/docs/app-dev/abci-cli.md +++ b/docs/app-dev/abci-cli.md @@ -36,7 +36,7 @@ Available Commands: console Start an interactive abci console for multiple commands counter ABCI demo example deliver_tx Deliver a new tx to the application - kvstore ABCI demo example + kvstore ABCI demo example echo Have the application echo a message help Help about any command info Get some info about the application @@ -140,7 +140,7 @@ response. The server may be generic for a particular language, and we provide a [reference implementation in Golang](https://github.com/tendermint/tendermint/tree/develop/abci/server). See the -[list of other ABCI implementations](./ecosystem.html) for servers in +[list of other ABCI implementations](./ecosystem.md) for servers in other languages. The handler is specific to the application, and may be arbitrary, so diff --git a/docs/app-dev/app-architecture.md b/docs/app-dev/app-architecture.md index 9ce0fae9..b141c0f3 100644 --- a/docs/app-dev/app-architecture.md +++ b/docs/app-dev/app-architecture.md @@ -46,6 +46,5 @@ See the following for more extensive documentation: - [Interchain Standard for the Light-Client REST API](https://github.com/cosmos/cosmos-sdk/pull/1028) - [Tendermint RPC Docs](https://tendermint.github.io/slate/) -- [Tendermint in Production](https://github.com/tendermint/tendermint/pull/1618) -- [Tendermint Basics](https://tendermint.readthedocs.io/en/master/using-tendermint.html) -- [ABCI spec](https://github.com/tendermint/tendermint/blob/develop/abci/docs/abci-spec.md) +- [Tendermint in Production](../tendermint-core/running-in-production.md) +- [ABCI spec](./abci-spec.md) diff --git a/docs/assets/a_plus_t.png b/docs/imgs/a_plus_t.png similarity index 100% rename from docs/assets/a_plus_t.png rename to docs/imgs/a_plus_t.png diff --git a/docs/assets/abci.png b/docs/imgs/abci.png similarity index 100% rename from docs/assets/abci.png rename to docs/imgs/abci.png diff --git a/docs/assets/consensus_logic.png b/docs/imgs/consensus_logic.png similarity index 100% rename from docs/assets/consensus_logic.png rename to docs/imgs/consensus_logic.png diff --git a/docs/assets/tm-application-example.png b/docs/imgs/tm-application-example.png similarity index 100% rename from docs/assets/tm-application-example.png rename to docs/imgs/tm-application-example.png diff --git a/docs/assets/tm-transaction-flow.png b/docs/imgs/tm-transaction-flow.png similarity index 100% rename from docs/assets/tm-transaction-flow.png rename to docs/imgs/tm-transaction-flow.png diff --git a/docs/assets/tmint-logo-blue.png b/docs/imgs/tmint-logo-blue.png similarity index 100% rename from docs/assets/tmint-logo-blue.png rename to docs/imgs/tmint-logo-blue.png diff --git a/docs/introduction/introduction.md b/docs/introduction/introduction.md index d43fa9b2..19763256 100644 --- a/docs/introduction/introduction.md +++ b/docs/introduction/introduction.md @@ -90,7 +90,7 @@ it can be used as a plug-and-play replacement for the consensus engines of other blockchain software. So one can take the current Ethereum code base, whether in Rust, or Go, or Haskell, and run it as a ABCI application using Tendermint consensus. Indeed, [we did that with -Ethereum](https://github.com/tendermint/ethermint). And we plan to do +Ethereum](https://github.com/cosmos/ethermint). And we plan to do the same for Bitcoin, ZCash, and various other deterministic applications as well. @@ -227,7 +227,7 @@ design their message handlers to create a blockchain that does anything useful but this architecture provides a place to start. The diagram below illustrates the flow of messages via ABCI. -![](assets/abci.png) +![](imgs/abci.png) ## A Note on Determinism @@ -263,7 +263,7 @@ Tendermint is an easy-to-understand, mostly asynchronous, BFT consensus protocol. The protocol follows a simple state machine that looks like this: -![](assets/consensus_logic.png) +![](imgs/consensus_logic.png) Participants in the protocol are called **validators**; they take turns proposing blocks of transactions and voting on them. Blocks are @@ -321,7 +321,7 @@ consensus protocol. This adds an economic element to the security of the protocol, allowing one to quantify the cost of violating the assumption that less than one-third of voting power is Byzantine. -The [Cosmos Network](http://cosmos.network) is designed to use this +The [Cosmos Network](https://cosmos.network) is designed to use this Proof-of-Stake mechanism across an array of cryptocurrencies implemented as ABCI applications. @@ -329,4 +329,4 @@ The following diagram is Tendermint in a (technical) nutshell. [See here for high resolution version](https://github.com/mobfoundry/hackatom/blob/master/tminfo.pdf). -![](assets/tm-transaction-flow.png) +![](imgs/tm-transaction-flow.png) diff --git a/docs/introduction/quick-start.md b/docs/introduction/quick-start.md index 8e490878..c10ba10a 100644 --- a/docs/introduction/quick-start.md +++ b/docs/introduction/quick-start.md @@ -26,7 +26,7 @@ Requires: - `go` minimum version 1.10 - `$GOPATH` environment variable must be set -- `$GOPATH/bin` must be on your `$PATH` (see https://github.com/tendermint/tendermint/wiki/Setting-GOPATH) +- `$GOPATH/bin` must be on your `$PATH` (see [here](https://github.com/tendermint/tendermint/wiki/Setting-GOPATH)) To install Tendermint, run: @@ -43,9 +43,12 @@ Confirm installation: ``` $ tendermint version -0.23.0-dev +0.23.0 ``` +Note: see the [releases page](https://github.com/tendermint/tendermint/releases) and the latest version +should match what you see above. + ## Initialization Running: @@ -142,8 +145,6 @@ tendermint node --home ./mytestnet/node3 --proxy_app=kvstore --p2p.persistent_pe Note that after the third node is started, blocks will start to stream in because >2/3 of validators (defined in the `genesis.json`) have come online. -Seeds can also be specified in the `config.toml`. See [this -PR](https://github.com/tendermint/tendermint/pull/792) for more information -about configuration options. +Seeds can also be specified in the `config.toml`. See [here](../tendermint-core/configuration.md) for more information about configuration options. Transactions can then be sent as covered in the single, local node example above. diff --git a/docs/networks/deploy-testnets.md b/docs/networks/deploy-testnets.md index 88e5c6f7..04f95310 100644 --- a/docs/networks/deploy-testnets.md +++ b/docs/networks/deploy-testnets.md @@ -71,4 +71,4 @@ local testnet. Review the target in the Makefile to debug any problems. ### Cloud -See the [next section](./terraform-and-ansible.html) for details. +See the [next section](./terraform-and-ansible.md) for details. diff --git a/docs/spec/p2p/connection.md b/docs/spec/p2p/connection.md index 9b5e4967..f6322fe8 100644 --- a/docs/spec/p2p/connection.md +++ b/docs/spec/p2p/connection.md @@ -38,7 +38,7 @@ type msgPacket struct { } ``` -The `msgPacket` is serialized using [go-wire](https://github.com/tendermint/go-wire) and prefixed with 0x3. +The `msgPacket` is serialized using [go-amino](https://github.com/tendermint/go-amino) and prefixed with 0x3. The received `Bytes` of a sequential set of packets are appended together until a packet with `EOF=1` is received, then the complete serialized message is returned for processing by the `onReceive` function of the corresponding channel. diff --git a/docs/spec/reactors/mempool/reactor.md b/docs/spec/reactors/mempool/reactor.md index 2bdbd895..fa25eeb3 100644 --- a/docs/spec/reactors/mempool/reactor.md +++ b/docs/spec/reactors/mempool/reactor.md @@ -2,12 +2,12 @@ ## Channels -[#1503](https://github.com/tendermint/tendermint/issues/1503) +See [this issue](https://github.com/tendermint/tendermint/issues/1503) Mempool maintains a cache of the last 10000 transactions to prevent replaying old transactions (plus transactions coming from other validators, who are continually exchanging transactions). Read [Replay -Protection](https://tendermint.readthedocs.io/projects/tools/en/master/app-development.html?#replay-protection) +Protection](../../../../app-development.md#replay-protection) for details. Sending incorrectly encoded data or data exceeding `maxMsgSize` will result diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index 613e181f..093f3ac1 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -7,7 +7,7 @@ The ABCI message types are defined in a [protobuf file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). For full details on the ABCI message types and protocol, see the [ABCI -specification](https://github.com/tendermint/tendermint/blob/develop/docs/abci-spec.md). +specification](https://github.com/tendermint/tendermint/blob/develop/docs/app-dev/abci-spec.md). Be sure to read the specification if you're trying to build an ABCI app! For additional details on server implementation, see the [ABCI diff --git a/docs/spec/software/wal.md b/docs/spec/software/wal.md index a2e03137..1f5d712c 100644 --- a/docs/spec/software/wal.md +++ b/docs/spec/software/wal.md @@ -28,6 +28,5 @@ WAL. Then it will go to precommit, and that time it will work because the private validator contains the `LastSignBytes` and then we’ll replay the precommit from the WAL. -Make sure to read about [WAL -corruption](https://tendermint.readthedocs.io/projects/tools/en/master/specification/corruption.html#wal-corruption) +Make sure to read about [WAL corruption](../../../tendermint-core/running-in-production.md#wal-corruption) and recovery strategies. diff --git a/docs/tendermint-core/how-to-read-logs.md b/docs/tendermint-core/how-to-read-logs.md index 83dab387..bf9b4925 100644 --- a/docs/tendermint-core/how-to-read-logs.md +++ b/docs/tendermint-core/how-to-read-logs.md @@ -63,8 +63,8 @@ Next follows a standard block creation cycle, where we enter a new round, propose a block, receive more than 2/3 of prevotes, then precommits and finally have a chance to commit a block. For details, please refer to [Consensus -Overview](./introduction.md#consensus-overview) or [Byzantine Consensus -Algorithm](./spec/consensus). +Overview](../introduction/introduction.md#consensus-overview) or [Byzantine Consensus +Algorithm](../spec/consensus/consensus.md). ``` I[10-04|13:54:30.393] enterNewRound(91/0). Current: 91/0/RoundStepNewHeight module=consensus @@ -112,7 +112,7 @@ I[10-04|13:54:30.410] Recheck txs module=mempoo Here is the list of modules you may encounter in Tendermint's log and a little overview what they do. -- `abci-client` As mentioned in [Application Development Guide](./app-development.md), Tendermint acts as an ABCI +- `abci-client` As mentioned in [Application Development Guide](../app-dev/app-development.md), Tendermint acts as an ABCI client with respect to the application and maintains 3 connections: mempool, consensus and query. The code used by Tendermint Core can be found [here](https://github.com/tendermint/tendermint/tree/develop/abci/client). @@ -133,9 +133,9 @@ little overview what they do. - `p2p` Provides an abstraction around peer-to-peer communication. For more details, please check out the [README](https://github.com/tendermint/tendermint/blob/master/p2p/README.md). -- `rpc` [Tendermint's RPC](./specification/rpc.md). +- `rpc` [Tendermint's RPC](./rpc.md). - `rpc-server` RPC server. For implementation details, please read the - [README](https://github.com/tendermint/tendermint/blob/master/rpc/lib/README.md). + [doc.go](https://github.com/tendermint/tendermint/blob/master/rpc/lib/doc.go). - `state` Represents the latest state and execution submodule, which executes blocks against the application. - `types` A collection of the publicly exposed types and methods to diff --git a/docs/tendermint-core/rpc.md b/docs/tendermint-core/rpc.md index 2f3a72c7..51f34fc2 100644 --- a/docs/tendermint-core/rpc.md +++ b/docs/tendermint-core/rpc.md @@ -1,3 +1,5 @@ # RPC The RPC documentation is hosted [here](https://tendermint.github.io/slate) and is generated by the CI from our [Slate repo](https://github.com/tendermint/slate). To update the documentation, edit the relevant `godoc` comments in the [rpc/core directory](https://github.com/tendermint/tendermint/tree/develop/rpc/core). + +NOTE: We will be moving the RPC documentation into the website in the near future. Stay tuned! diff --git a/docs/tendermint-core/running-in-production.md b/docs/tendermint-core/running-in-production.md index 09473432..0c7ed4e2 100644 --- a/docs/tendermint-core/running-in-production.md +++ b/docs/tendermint-core/running-in-production.md @@ -28,7 +28,7 @@ send & receive rate per connection (`SendRate`, `RecvRate`). ### RPC Endpoints returning multiple entries are limited by default to return 30 -elements (100 max). +elements (100 max). See [here](./rpc.md) for more information about the RPC. Rate-limiting and authentication are another key aspects to help protect against DOS attacks. While in the future we may implement these @@ -40,12 +40,12 @@ to achieve the same things. ## Debugging Tendermint If you ever have to debug Tendermint, the first thing you should -probably do is to check out the logs. See ["How to read -logs"](./how-to-read-logs.md), where we explain what certain log +probably do is to check out the logs. See [How to read +logs](./how-to-read-logs.md), where we explain what certain log statements mean. If, after skimming through the logs, things are not clear still, the -second TODO is to query the /status RPC endpoint. It provides the +next thing to try is query the /status RPC endpoint. It provides the necessary info: whenever the node is syncing or not, what height it is on, etc. @@ -80,7 +80,7 @@ Other useful endpoints include mentioned earlier `/status`, `/net_info` and We have a small tool, called `tm-monitor`, which outputs information from the endpoints above plus some statistics. The tool can be found -[here](https://github.com/tendermint/tools/tree/master/tm-monitor). +[here](https://github.com/tendermint/tendermint/tree/master/tools/tm-monitor). Tendermint also can report and serve Prometheus metrics. See [Metrics](./metrics.md). @@ -206,14 +206,15 @@ operation systems (like Mac OS). ### Miscellaneous NOTE: if you are going to use Tendermint in a public domain, make sure -you read [hardware recommendations (see "4. -Hardware")](https://cosmos.network/validators) for a validator in the +you read [hardware recommendations](https://cosmos.network/validators) for a validator in the Cosmos network. ## Configuration parameters -- `p2p.flush_throttle_timeout` `p2p.max_packet_msg_payload_size` - `p2p.send_rate` `p2p.recv_rate` +- `p2p.flush_throttle_timeout` +- `p2p.max_packet_msg_payload_size` +- `p2p.send_rate` +- `p2p.recv_rate` If you are going to use Tendermint in a private domain and you have a private high-speed network among your peers, it makes sense to lower diff --git a/docs/tendermint-core/secure-p2p.md b/docs/tendermint-core/secure-p2p.md index aad5eac4..692fe9ef 100644 --- a/docs/tendermint-core/secure-p2p.md +++ b/docs/tendermint-core/secure-p2p.md @@ -3,10 +3,6 @@ The Tendermint p2p protocol uses an authenticated encryption scheme based on the [Station-to-Station Protocol](https://en.wikipedia.org/wiki/Station-to-Station_protocol). -The implementation uses -[golang's](https://godoc.org/golang.org/x/crypto/nacl/box) [nacl -box](http://nacl.cr.yp.to/box.html) for the actual authenticated -encryption algorithm. Each peer generates an ED25519 key-pair to use as a persistent (long-term) id. diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index 11949c79..db997611 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -151,7 +151,7 @@ and the `latest_app_hash` in particular: curl http://localhost:26657/status | json_pp | grep latest_app_hash ``` -Visit http://localhost:26657> in your browser to see the list of other +Visit http://localhost:26657 in your browser to see the list of other endpoints. Some take no arguments (like `/status`), while others specify the argument name and use `_` as a placeholder. @@ -224,7 +224,7 @@ new blockchain will not make any blocks. ## Configuration Tendermint uses a `config.toml` for configuration. For details, see [the -config specification](./specification/configuration.md). +config specification](./tendermint-core/configuration.md). Notable options include the socket address of the application (`proxy_app`), the listening address of the Tendermint peer @@ -235,8 +235,7 @@ Some fields from the config file can be overwritten with flags. ## No Empty Blocks -This much requested feature was implemented in version 0.10.3. While the -default behaviour of `tendermint` is still to create blocks +While the default behaviour of `tendermint` is still to create blocks approximately once per second, it is possible to disable empty blocks or set a block creation interval. In the former case, blocks will be created when there are new transactions or when the AppHash changes. @@ -365,10 +364,7 @@ case, the genesis file contains the public key of our root directory will be able to make progress. Voting power uses an int64 but must be positive, thus the range is: 0 through 9223372036854775807. Because of how the current proposer selection algorithm works, we do not -recommend having voting powers greater than 10\^12 (ie. 1 trillion) (see -[Proposals section of Byzantine Consensus -Algorithm](./specification/byzantine-consensus-algorithm.md#proposals) -for details). +recommend having voting powers greater than 10\^12 (ie. 1 trillion). If we want to add more nodes to the network, we have two choices: we can add a new validator node, who will also participate in the consensus by @@ -520,7 +516,7 @@ failing, you need at least four validator nodes (e.g., 2/3). Updating validators in a live network is supported but must be explicitly programmed by the application developer. See the [application -developers guide](./app-development.md) for more details. +developers guide](../app-dev/app-development.md) for more details. ### Local Network diff --git a/docs/tools/monitoring.md b/docs/tools/monitoring.md index 5cc2ad3b..5b0ffd07 100644 --- a/docs/tools/monitoring.md +++ b/docs/tools/monitoring.md @@ -3,7 +3,7 @@ Tendermint blockchain monitoring tool; watches over one or more nodes, collecting and providing various statistics to the user: -- https://github.com/tendermint/tools/tree/master/tm-monitor +- https://github.com/tendermint/tendermint/tree/master/tools/tm-monitor ## Quick Start diff --git a/docs/yarn.lock b/docs/yarn.lock deleted file mode 100644 index 5591b8fa..00000000 --- a/docs/yarn.lock +++ /dev/null @@ -1,2507 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@azu/format-text@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@azu/format-text/-/format-text-1.0.1.tgz#6967350a94640f6b02855169bd897ce54d6cebe2" - -"@azu/style-format@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@azu/style-format/-/style-format-1.0.0.tgz#e70187f8a862e191b1bce6c0268f13acd3a56b20" - dependencies: - "@azu/format-text" "^1.0.1" - -"@sindresorhus/is@^0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" - -"@textlint/ast-node-types@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@textlint/ast-node-types/-/ast-node-types-4.0.2.tgz#5386a15187798efb48eb71fa1cbf6ca2770b206a" - -"@textlint/ast-traverse@^2.0.8": - version "2.0.8" - resolved "https://registry.yarnpkg.com/@textlint/ast-traverse/-/ast-traverse-2.0.8.tgz#c180fe23dc3b8a6aa68539be70efb4ff17c38a3a" - dependencies: - "@textlint/ast-node-types" "^4.0.2" - -"@textlint/feature-flag@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@textlint/feature-flag/-/feature-flag-3.0.4.tgz#4290a4bb53da28c1f5f1d5ce0f4ae6630ab939ea" - dependencies: - map-like "^2.0.0" - -"@textlint/fixer-formatter@^3.0.7": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@textlint/fixer-formatter/-/fixer-formatter-3.0.7.tgz#4ef15d5e606e2d32b89257afd382ed9dbb218846" - dependencies: - "@textlint/kernel" "^2.0.9" - chalk "^1.1.3" - debug "^2.1.0" - diff "^2.2.2" - interop-require "^1.0.0" - is-file "^1.0.0" - string-width "^1.0.1" - text-table "^0.2.0" - try-resolve "^1.0.1" - -"@textlint/kernel@^2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@textlint/kernel/-/kernel-2.0.9.tgz#a4471b7969e192551230c35ea9fae32d80128ee0" - dependencies: - "@textlint/ast-node-types" "^4.0.2" - "@textlint/ast-traverse" "^2.0.8" - "@textlint/feature-flag" "^3.0.4" - "@types/bluebird" "^3.5.18" - bluebird "^3.5.1" - debug "^2.6.6" - deep-equal "^1.0.1" - object-assign "^4.1.1" - structured-source "^3.0.2" - -"@textlint/linter-formatter@^3.0.7": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@textlint/linter-formatter/-/linter-formatter-3.0.7.tgz#66716cac94c047d94627a7e6af427a0d199eda7c" - dependencies: - "@azu/format-text" "^1.0.1" - "@azu/style-format" "^1.0.0" - "@textlint/kernel" "^2.0.9" - chalk "^1.0.0" - concat-stream "^1.5.1" - js-yaml "^3.2.4" - optionator "^0.8.1" - pluralize "^2.0.0" - string-width "^1.0.1" - string.prototype.padstart "^3.0.0" - strip-ansi "^3.0.1" - table "^3.7.8" - text-table "^0.2.0" - try-resolve "^1.0.1" - xml-escape "^1.0.0" - -"@textlint/markdown-to-ast@^6.0.8": - version "6.0.8" - resolved "https://registry.yarnpkg.com/@textlint/markdown-to-ast/-/markdown-to-ast-6.0.8.tgz#baa509c42f842b4dba36ad91547a288c063396b8" - dependencies: - "@textlint/ast-node-types" "^4.0.2" - debug "^2.1.3" - remark-frontmatter "^1.2.0" - remark-parse "^5.0.0" - structured-source "^3.0.2" - traverse "^0.6.6" - unified "^6.1.6" - -"@textlint/text-to-ast@^3.0.8": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@textlint/text-to-ast/-/text-to-ast-3.0.8.tgz#6211977f369cec484447867f10dc155120f4c082" - dependencies: - "@textlint/ast-node-types" "^4.0.2" - -"@textlint/textlint-plugin-markdown@^4.0.10": - version "4.0.10" - resolved "https://registry.yarnpkg.com/@textlint/textlint-plugin-markdown/-/textlint-plugin-markdown-4.0.10.tgz#a99b4a308067597e89439a9e87bc1c4a7f4d076b" - dependencies: - "@textlint/markdown-to-ast" "^6.0.8" - -"@textlint/textlint-plugin-text@^3.0.10": - version "3.0.10" - resolved "https://registry.yarnpkg.com/@textlint/textlint-plugin-text/-/textlint-plugin-text-3.0.10.tgz#619600bdc352d33a68e7a73d77d58b0c52b2a44f" - dependencies: - "@textlint/text-to-ast" "^3.0.8" - -"@types/bluebird@^3.5.18": - version "3.5.21" - resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.21.tgz#567615589cc913e84a28ecf9edb031732bdf2634" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -aggregate-error@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-1.0.0.tgz#888344dad0220a72e3af50906117f48771925fac" - dependencies: - clean-stack "^1.0.0" - indent-string "^3.0.0" - -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - -ajv@^4.7.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -ajv@^5.1.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - dependencies: - color-convert "^1.9.0" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -array-iterate@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.2.tgz#f66a57e84426f8097f4197fbb6c051b8e5cdf7d8" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - -aws4@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" - -bail@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.3.tgz#63cfb9ddbac829b02a3128cd53224be78e6c21a3" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - dependencies: - tweetnacl "^0.14.3" - -binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" - -bluebird@^3.0.5, bluebird@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" - -boundary@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/boundary/-/boundary-1.0.1.tgz#4d67dc2602c0cc16dd9bce7ebf87e948290f5812" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -buffer-from@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -cacheable-request@^2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" - dependencies: - clone-response "1.0.2" - get-stream "3.0.0" - http-cache-semantics "3.8.1" - keyv "3.0.0" - lowercase-keys "1.0.0" - normalize-url "2.0.1" - responselike "1.0.2" - -camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - -capture-stack-trace@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -ccount@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.3.tgz#f1cec43f332e2ea5a569fd46f9f5bde4e6102aff" - -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -character-entities-html4@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.2.tgz#c44fdde3ce66b52e8d321d6c1bf46101f0150610" - -character-entities-legacy@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz#7c6defb81648498222c9855309953d05f4d63a9c" - -character-entities@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.2.tgz#58c8f371c0774ef0ba9b2aca5f00d8f100e6e363" - -character-reference-invalid@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz#21e421ad3d84055952dab4a43a04e73cd425d3ed" - -charenc@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - -chokidar@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chownr@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - -clean-stack@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" - -clone-response@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - dependencies: - mimic-response "^1.0.0" - -co@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/co/-/co-3.1.0.tgz#4ea54ea5a08938153185e15210c68d9092bc1b78" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -collapse-white-space@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.4.tgz#ce05cf49e54c3277ae573036a26851ba430a0091" - -color-convert@^1.9.0: - version "1.9.2" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" - dependencies: - color-name "1.1.1" - -color-name@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" - -combined-stream@1.0.6, combined-stream@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@^1.5.1: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - dependencies: - capture-stack-trace "^1.0.0" - -crypt@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -debug@^2.1.0, debug@^2.1.2, debug@^2.1.3, debug@^2.2.0, debug@^2.6.6: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - dependencies: - mimic-response "^1.0.0" - -deep-equal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" - dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -diff@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" - -dns-packet@^1.1.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" - dependencies: - ip "^1.1.0" - safe-buffer "^5.0.1" - -dns-socket@^1.6.2: - version "1.6.3" - resolved "https://registry.yarnpkg.com/dns-socket/-/dns-socket-1.6.3.tgz#5268724fad4aa46ad9c5ca4ffcd16e1de5342aab" - dependencies: - dns-packet "^1.1.0" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - -ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - dependencies: - jsbn "~0.1.0" - -error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.4.3: - version "1.12.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - -extend@^3.0.0, extend@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -fault@^1.0.0, fault@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.2.tgz#c3d0fec202f172a3a4d414042ad2bb5e2a3ffbaa" - dependencies: - format "^0.2.2" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" - -flat-cache@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -fn-name@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" - -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - -format@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" - -from2@^2.1.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -function-bind@^1.0.2, function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - -get-stream@3.0.0, get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - -glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" - -got@^8.0.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" - dependencies: - "@sindresorhus/is" "^0.7.0" - cacheable-request "^2.1.1" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - into-stream "^3.1.0" - is-retry-allowed "^1.1.0" - isurl "^1.0.0-alpha5" - lowercase-keys "^1.0.0" - mimic-response "^1.0.0" - p-cancelable "^0.4.0" - p-timeout "^2.0.1" - pify "^3.0.0" - safe-buffer "^5.1.1" - timed-out "^4.0.1" - url-parse-lax "^3.0.0" - url-to-options "^1.0.1" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - -has-symbol-support-x@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - -has-to-string-tag-x@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - dependencies: - has-symbol-support-x "^1.4.1" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -has@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - dependencies: - function-bind "^1.1.1" - -hosted-git-info@^2.1.4: - version "2.6.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.1.tgz#6e4cee78b01bb849dcf93527708c69fdbee410df" - -http-cache-semantics@3.8.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -iconv-lite@^0.4.4: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - dependencies: - minimatch "^3.0.4" - -ignore@^3.2.0: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -interop-require@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/interop-require/-/interop-require-1.0.0.tgz#e53103679944c88d7e6105b62a9f4475c783971e" - -into-stream@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" - dependencies: - from2 "^2.1.1" - p-is-promise "^1.1.0" - -ip-regex@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - -ip@^1.1.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - -is-absolute-url@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" - -is-alphabetical@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.2.tgz#1fa6e49213cb7885b75d15862fb3f3d96c884f41" - -is-alphanumeric@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" - -is-alphanumerical@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz#1138e9ae5040158dc6ff76b820acd6b7a181fd40" - dependencies: - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.4, is-buffer@^1.1.5, is-buffer@~1.1.1: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - -is-decimal@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.2.tgz#894662d6a8709d307f3a276ca4339c8fa5dff0ff" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-empty@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-empty/-/is-empty-1.2.0.tgz#de9bb5b278738a05a0b09a57e1fb4d4a341a9f6b" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -is-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-file/-/is-file-1.0.0.tgz#28a44cfbd9d3db193045f22b65fce8edf9620596" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - -is-hexadecimal@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz#b6e710d7d07bb66b98cb8cece5c9b4921deeb835" - -is-hidden@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-hidden/-/is-hidden-1.1.1.tgz#82ee6a93aeef3fb007ad5b9457c0584d45329f38" - -is-ip@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-2.0.0.tgz#68eea07e8a0a0a94c2d080dd674c731ab2a461ab" - dependencies: - ip-regex "^2.0.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - -is-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" - -is-online@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-online/-/is-online-7.0.0.tgz#7e2408c0ae1e7e37ba8d50bdb237260d32bfd96e" - dependencies: - got "^6.7.1" - p-any "^1.0.0" - p-timeout "^1.0.0" - public-ip "^2.3.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - dependencies: - path-is-inside "^1.0.1" - -is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" - -is-relative-url@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-relative-url/-/is-relative-url-2.0.0.tgz#72902d7fe04b3d4792e7db15f9db84b7204c9cef" - dependencies: - is-absolute-url "^2.0.0" - -is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - -is-stream@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - -is-whitespace-character@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed" - -is-word-character@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.2.tgz#46a5dac3f2a1840898b91e576cd40d493f3ae553" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isemail@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.2.tgz#937cf919002077999a73ea8b1951d590e84e01dd" - dependencies: - punycode "2.x.x" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - -isurl@^1.0.0-alpha5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - dependencies: - has-to-string-tag-x "^1.2.0" - is-object "^1.0.1" - -js-yaml@^3.2.4, js-yaml@^3.6.1: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - -json5@^0.5.0, json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -keyv@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" - dependencies: - json-buffer "3.0.0" - -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -link-check@^4.1.0: - version "4.4.4" - resolved "https://registry.yarnpkg.com/link-check/-/link-check-4.4.4.tgz#08dbb881b70c23f1c173889c3a34d682c2e68c1a" - dependencies: - is-relative-url "^2.0.0" - isemail "^3.1.2" - ms "^2.1.1" - request "^2.87.0" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -load-plugin@^2.0.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/load-plugin/-/load-plugin-2.2.2.tgz#ebc7599491ff33e5077719fbe051d5725a9f7a89" - dependencies: - npm-prefix "^1.2.0" - resolve-from "^4.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash@^4.0.0: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" - dependencies: - chalk "^1.0.0" - -longest-streak@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.2.tgz#2421b6ba939a443bb9ffebf596585a50b4c38e2e" - -lowercase-keys@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" - -lowercase-keys@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - -map-like@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/map-like/-/map-like-2.0.0.tgz#94496d49ad333c0dc3234b27adbbd1e8535953b4" - -markdown-escapes@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.2.tgz#e639cbde7b99c841c0bacc8a07982873b46d2122" - -markdown-extensions@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" - -markdown-table@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.2.tgz#c78db948fa879903a41bce522e3b96f801c63786" - -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - -md5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" - dependencies: - charenc "~0.0.1" - crypt "~0.0.1" - is-buffer "~1.1.1" - -mdast-util-compact@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz#cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a" - dependencies: - unist-util-modify-children "^1.0.0" - unist-util-visit "^1.1.0" - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - -mime-types@^2.1.12, mime-types@~2.1.17: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - dependencies: - mime-db "~1.33.0" - -mimic-response@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" - dependencies: - minipass "^2.2.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -nan@^2.9.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - -needle@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -node-pre-gyp@^0.10.0: - version "0.10.2" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.2.tgz#e8945c20ef6795a20aac2b44f036eb13cf5146e3" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.0" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-url@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" - dependencies: - prepend-http "^2.0.0" - query-string "^5.0.1" - sort-keys "^2.0.0" - -npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" - -npm-packlist@^1.1.6: - version "1.1.10" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npm-prefix@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/npm-prefix/-/npm-prefix-1.2.0.tgz#e619455f7074ba54cc66d6d0d37dd9f1be6bcbc0" - dependencies: - rc "^1.1.0" - shellsubstitute "^1.1.0" - untildify "^2.1.0" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-keys@^1.0.8, object-keys@^1.0.9: - version "1.0.12" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optionator@^0.8.0, optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-tmpdir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-any@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-any/-/p-any-1.1.0.tgz#1d03835c7eed1e34b8e539c47b7b60d0d015d4e1" - dependencies: - p-some "^2.0.0" - -p-cancelable@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - -p-is-promise@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - dependencies: - p-try "^1.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - -p-some@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-some/-/p-some-2.0.1.tgz#65d87c8b154edbcf5221d167778b6d2e150f6f06" - dependencies: - aggregate-error "^1.0.0" - -p-timeout@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - dependencies: - p-finally "^1.0.0" - -p-timeout@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" - dependencies: - p-finally "^1.0.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - -parse-entities@^1.0.2, parse-entities@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.2.tgz#9eaf719b29dc3bd62246b4332009072e01527777" - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -path-exists@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-to-glob-pattern@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-to-glob-pattern/-/path-to-glob-pattern-1.0.2.tgz#473e6a3a292a9d13fbae3edccee72d3baba8c619" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - dependencies: - pify "^3.0.0" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pluralize@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-2.0.0.tgz#72b726aa6fac1edeee42256c7d8dc256b335677f" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - -prettier@^1.13.7: - version "1.13.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - -public-ip@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/public-ip/-/public-ip-2.4.0.tgz#f00c028a15366d8c798e47efab6acd09a17666da" - dependencies: - dns-socket "^1.6.2" - got "^8.0.0" - is-ip "^2.0.0" - pify "^3.0.0" - -punycode@2.x.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -qs@~6.5.1: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - -query-string@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -randomatic@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -rc-config-loader@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/rc-config-loader/-/rc-config-loader-2.0.1.tgz#8c8452f59bdd10d448a67762dccf7c1b247db860" - dependencies: - debug "^2.2.0" - js-yaml "^3.6.1" - json5 "^0.5.0" - object-assign "^4.1.0" - object-keys "^1.0.9" - path-exists "^2.1.0" - require-from-string "^2.0.1" - -rc@^1.1.0, rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - -remark-cli@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/remark-cli/-/remark-cli-5.0.0.tgz#9feefd06474f3d0ff132df21b5334c546df12ab6" - dependencies: - markdown-extensions "^1.1.0" - remark "^9.0.0" - unified-args "^5.0.0" - -remark-frontmatter@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-1.2.0.tgz#67905d178c0fe531ed12c57b98759f101fc2c1b5" - dependencies: - fault "^1.0.1" - xtend "^4.0.1" - -remark-lint-no-dead-urls@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-0.3.0.tgz#b640ecbb4ccaf780afe28c8d13e79f5dc6769449" - dependencies: - is-online "^7.0.0" - is-relative-url "^2.0.0" - link-check "^4.1.0" - unified-lint-rule "^1.0.1" - unist-util-visit "^1.1.3" - -remark-parse@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" - dependencies: - collapse-white-space "^1.0.2" - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - is-word-character "^1.0.0" - markdown-escapes "^1.0.0" - parse-entities "^1.1.0" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - trim "0.0.1" - trim-trailing-lines "^1.0.0" - unherit "^1.0.4" - unist-util-remove-position "^1.0.0" - vfile-location "^2.0.0" - xtend "^4.0.1" - -remark-stringify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-5.0.0.tgz#336d3a4d4a6a3390d933eeba62e8de4bd280afba" - dependencies: - ccount "^1.0.0" - is-alphanumeric "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - longest-streak "^2.0.1" - markdown-escapes "^1.0.0" - markdown-table "^1.1.0" - mdast-util-compact "^1.0.0" - parse-entities "^1.0.2" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - stringify-entities "^1.0.1" - unherit "^1.0.4" - xtend "^4.0.1" - -remark@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-9.0.0.tgz#c5cfa8ec535c73a67c4b0f12bfdbd3a67d8b2f60" - dependencies: - remark-parse "^5.0.0" - remark-stringify "^5.0.0" - unified "^6.0.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -replace-ext@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - -request@^2.87.0: - version "2.87.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -require-from-string@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - -responselike@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - dependencies: - lowercase-keys "^1.0.0" - -rimraf@^2.2.8, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -shellsubstitute@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shellsubstitute/-/shellsubstitute-1.2.0.tgz#e4f702a50c518b0f6fe98451890d705af29b6b70" - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - -sliced@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" - -sort-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" - dependencies: - is-plain-obj "^1.0.0" - -spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -sshpk@^1.7.0: - version "1.14.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - safer-buffer "^2.0.2" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - -state-toggle@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.1.tgz#c3cb0974f40a6a0f8e905b96789eb41afa1cde3a" - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - -string-width@^1.0.0, string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string.prototype.padstart@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.padstart/-/string.prototype.padstart-3.0.0.tgz#5bcfad39f4649bb2d031292e19bcf0b510d4b242" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.4.3" - function-bind "^1.0.2" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - dependencies: - safe-buffer "~5.1.0" - -stringify-entities@^1.0.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.2.tgz#a98417e5471fd227b3e45d3db1861c11caf668f7" - dependencies: - character-entities-html4 "^1.0.0" - character-entities-legacy "^1.0.0" - is-alphanumerical "^1.0.0" - is-hexadecimal "^1.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -structured-source@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/structured-source/-/structured-source-3.0.2.tgz#dd802425e0f53dc4a6e7aca3752901a1ccda7af5" - dependencies: - boundary "^1.0.1" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -supports-color@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - dependencies: - has-flag "^2.0.0" - -supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - dependencies: - has-flag "^3.0.0" - -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -tar@^4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" - dependencies: - chownr "^1.0.1" - fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -textlint@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/textlint/-/textlint-10.2.1.tgz#ee22b7967d59cef7c74a04a5f4e8883134e5c79d" - dependencies: - "@textlint/ast-node-types" "^4.0.2" - "@textlint/ast-traverse" "^2.0.8" - "@textlint/feature-flag" "^3.0.4" - "@textlint/fixer-formatter" "^3.0.7" - "@textlint/kernel" "^2.0.9" - "@textlint/linter-formatter" "^3.0.7" - "@textlint/textlint-plugin-markdown" "^4.0.10" - "@textlint/textlint-plugin-text" "^3.0.10" - "@types/bluebird" "^3.5.18" - bluebird "^3.0.5" - debug "^2.1.0" - deep-equal "^1.0.1" - file-entry-cache "^2.0.0" - get-stdin "^5.0.1" - glob "^7.1.1" - interop-require "^1.0.0" - is-file "^1.0.0" - log-symbols "^1.0.2" - map-like "^2.0.0" - md5 "^2.2.1" - mkdirp "^0.5.0" - object-assign "^4.0.1" - optionator "^0.8.0" - path-to-glob-pattern "^1.0.2" - rc-config-loader "^2.0.1" - read-pkg "^1.1.0" - read-pkg-up "^3.0.0" - structured-source "^3.0.2" - try-resolve "^1.0.1" - unique-concat "^0.2.2" - -timed-out@^4.0.0, timed-out@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - -to-vfile@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-2.2.0.tgz#342d1705e6df526d569b1fc8bfa29f1f36d6c416" - dependencies: - is-buffer "^1.1.4" - vfile "^2.0.0" - x-is-function "^1.0.4" - -tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -traverse@^0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" - -trim-trailing-lines@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz#e0ec0810fd3c3f1730516b45f49083caaf2774d9" - -trim@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" - -trough@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.2.tgz#7f1663ec55c480139e2de5e486c6aef6cc24a535" - -try-resolve@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -unherit@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.1.tgz#132748da3e88eab767e08fabfbb89c5e9d28628c" - dependencies: - inherits "^2.0.1" - xtend "^4.0.1" - -unified-args@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/unified-args/-/unified-args-5.1.0.tgz#1889200e072998a662e6e84d817d6f4b5f448dd1" - dependencies: - camelcase "^4.0.0" - chalk "^2.0.0" - chokidar "^1.5.1" - json5 "^0.5.1" - minimist "^1.2.0" - text-table "^0.2.0" - unified-engine "^5.1.0" - -unified-engine@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/unified-engine/-/unified-engine-5.1.0.tgz#30db83bcc76c821f773bb5a8a491aa0e2471e3d1" - dependencies: - concat-stream "^1.5.1" - debug "^3.1.0" - fault "^1.0.0" - fn-name "^2.0.1" - glob "^7.0.3" - ignore "^3.2.0" - is-empty "^1.0.0" - is-hidden "^1.0.1" - is-object "^1.0.1" - js-yaml "^3.6.1" - load-plugin "^2.0.0" - parse-json "^4.0.0" - to-vfile "^2.0.0" - trough "^1.0.0" - unist-util-inspect "^4.1.2" - vfile-reporter "^4.0.0" - vfile-statistics "^1.1.0" - x-is-function "^1.0.4" - x-is-string "^0.1.0" - xtend "^4.0.1" - -unified-lint-rule@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/unified-lint-rule/-/unified-lint-rule-1.0.3.tgz#e302b0c4a7ac428c0980e049a500e59528001299" - dependencies: - wrapped "^1.0.1" - -unified@^6.0.0, unified@^6.1.6: - version "6.2.0" - resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-plain-obj "^1.1.0" - trough "^1.0.0" - vfile "^2.0.0" - x-is-string "^0.1.0" - -unique-concat@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/unique-concat/-/unique-concat-0.2.2.tgz#9210f9bdcaacc5e1e3929490d7c019df96f18712" - -unist-util-inspect@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/unist-util-inspect/-/unist-util-inspect-4.1.3.tgz#39470e6d77485db285966df78431219aa1287822" - dependencies: - is-empty "^1.0.0" - -unist-util-is@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.2.tgz#1193fa8f2bfbbb82150633f3a8d2eb9a1c1d55db" - -unist-util-modify-children@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.2.tgz#c7f1b91712554ee59c47a05b551ed3e052a4e2d1" - dependencies: - array-iterate "^1.0.0" - -unist-util-remove-position@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz#86b5dad104d0bbfbeb1db5f5c92f3570575c12cb" - dependencies: - unist-util-visit "^1.1.0" - -unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" - -unist-util-visit@^1.1.0, unist-util-visit@^1.1.3: - version "1.3.1" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.3.1.tgz#c019ac9337a62486be58531bc27e7499ae7d55c7" - dependencies: - unist-util-is "^2.1.1" - -untildify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/untildify/-/untildify-2.1.0.tgz#17eb2807987f76952e9c0485fc311d06a826a2e0" - dependencies: - os-homedir "^1.0.0" - -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - dependencies: - prepend-http "^1.0.1" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - dependencies: - prepend-http "^2.0.0" - -url-to-options@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -uuid@^3.1.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - -validate-npm-package-license@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vfile-location@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.3.tgz#083ba80e50968e8d420be49dd1ea9a992131df77" - -vfile-message@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.0.1.tgz#51a2ccd8a6b97a7980bb34efb9ebde9632e93677" - dependencies: - unist-util-stringify-position "^1.1.1" - -vfile-reporter@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-4.0.0.tgz#ea6f0ae1342f4841573985e05f941736f27de9da" - dependencies: - repeat-string "^1.5.0" - string-width "^1.0.0" - supports-color "^4.1.0" - unist-util-stringify-position "^1.0.0" - vfile-statistics "^1.1.0" - -vfile-statistics@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.1.tgz#a22fd4eb844c9eaddd781ad3b3246db88375e2e3" - -vfile@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" - dependencies: - is-buffer "^1.1.4" - replace-ext "1.0.0" - unist-util-stringify-position "^1.0.0" - vfile-message "^1.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrapped@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wrapped/-/wrapped-1.0.1.tgz#c783d9d807b273e9b01e851680a938c87c907242" - dependencies: - co "3.1.0" - sliced "^1.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -x-is-function@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" - -x-is-string@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" - -xml-escape@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xml-escape/-/xml-escape-1.1.0.tgz#3904c143fa8eb3a0030ec646d2902a2f1b706c44" - -xtend@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" From 37ea7040eff2e330de6de99155c19d2b064c61d6 Mon Sep 17 00:00:00 2001 From: Jordan Bibla Date: Wed, 8 Aug 2018 05:03:00 -0400 Subject: [PATCH 044/149] remove JB from codeowners file (#2174) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9586a870..9d2fc15b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ * @ebuchman @melekes @xla # Precious documentation -/docs/ @zramsay @jolesbi +/docs/ @zramsay From 1fbca09e3c5c3540df04a5604bb5077c3703f3ce Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Wed, 8 Aug 2018 14:10:33 -0500 Subject: [PATCH 045/149] [ADR] Proposal for multisignature encoding (#1960) * ADR: Proposal for multisignature encoding This proposal is partially tied to the resolution of #1957. * Change title to Encoding standard for multisignatures * ADR: Change multisigs ADR now that amino must be used for pubkeys * Address PR comments --- docs/architecture/adr-019-multisigs.md | 150 +++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 docs/architecture/adr-019-multisigs.md diff --git a/docs/architecture/adr-019-multisigs.md b/docs/architecture/adr-019-multisigs.md new file mode 100644 index 00000000..98bb5ec0 --- /dev/null +++ b/docs/architecture/adr-019-multisigs.md @@ -0,0 +1,150 @@ +# ADR 019: Encoding standard for Multisignatures + +## Changelog + +06-08-2018: Minor updates + +27-07-2018: Update draft to use amino encoding + +11-07-2018: Initial Draft + +## Context + +Multisignatures, or technically _Accountable Subgroup Multisignatures_ (ASM), +are signature schemes which enable any subgroup of a set of signers to sign any message, +and reveal to the verifier exactly who the signers were. +This allows for complex conditionals of when to validate a signature. + +Suppose the set of signers is of size _n_. +If we validate a signature if any subgroup of size _k_ signs a message, +this becomes what is commonly reffered to as a _k of n multisig_ in Bitcoin. + +This ADR specifies the encoding standard for general accountable subgroup multisignatures, +k of n accountable subgroup multisignatures, and its weighted variant. + +In the future, we can also allow for more complex conditionals on the accountable subgroup. + +## Proposed Solution + +### New structs + +Every ASM will then have its own struct, implementing the crypto.Pubkey interface. + +This ADR assumes that [replacing crypto.Signature with []bytes](https://github.com/tendermint/tendermint/issues/1957) has been accepted. + +#### K of N threshold signature + +The pubkey is the following struct: + +```golang +type ThresholdMultiSignaturePubKey struct { // K of N threshold multisig + K uint `json:"threshold"` + Pubkeys []crypto.Pubkey `json:"pubkeys"` +} +``` +We will derive N from the length of pubkeys. (For spatial efficiency in encoding) + +`Verify` will expect an `[]byte` encoded version of the Multisignature. +(Multisignature is described in the next section) +The multisignature will be rejected if the bitmap has less than k indices, +or if any signature at any of the k indices is not a valid signature from +the kth public key on the message. +(If more than k signatures are included, all must be valid) + +`Bytes` will be the amino encoded version of the pubkey. + +Address will be `Hash(amino_encoded_pubkey)` + +The reason this doesn't use `log_8(n)` bytes per signer is because that heavily optimizes for the case where a very small number of signers are required. +e.g. for `n` of size `24`, that would only be more space efficient for `k < 3`. +This seems less likely, and that it should not be the case optimized for. + +#### Weighted threshold signature + +The pubkey is the following struct: + +```golang +type WeightedThresholdMultiSignaturePubKey struct { + Weights []uint `json:"weights"` + Threshold uint `json:"threshold"` + Pubkeys []crypto.Pubkey `json:"pubkeys"` +} +``` +Weights and Pubkeys must be of the same length. +Everything else proceeds identically to the K of N multisig, +except the multisig fails if the sum of the weights is less than the threshold. + +#### Multisignature + +The inter-mediate phase of the signatures (as it accrues more signatures) will be the following struct: +```golang +type Multisignature struct { + BitArray CryptoBitArray // Documented later + Sigs [][]byte +``` + +It is important to recall that each private key will output a signature on the provided message itself. +So no signing algorithm ever outputs the multisignature. +The UI will take a signature, cast into a multisignature, and then keep adding +new signatures into it, and when done marshal into `[]byte`. +This will require the following helper methods: +```golang +func SigToMultisig(sig []byte, n int) +func GetIndex(pk crypto.Pubkey, []crypto.Pubkey) +func AddSignature(sig Signature, index int, multiSig *Multisignature) +``` +The multisignature will be converted to an `[]byte` using amino.MarshalBinaryBare. \* + +#### Bit Array +We would be using a new implementation of a bitarray. The struct it would be encoded/decoded from is +```golang +type CryptoBitArray struct { + ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. + Elems []byte `json:"elems"` +} +``` +The reason for not using the BitArray currently implemented in `libs/common/bit_array.go` +is that it is less space efficient, due to a space / time trade-off. +Evidence for this is outlined in [this issue](https://github.com/tendermint/tendermint/issues/2077). + +In the multisig, we will not be performing arithmetic operations, +so there is no performance increase with the current implementation, +and just loss of spatial efficiency. +Implementing this new bit array with `[]byte` _should_ be simple, as no +arithmetic operations between bit arrays are required, and save a couple of bytes. +(Explained in that same issue) + +When this bit array encoded, the number of elements is encoded due to amino. +However we may be encoding a full byte for what we actually only need 1-7 bits for. +We store that difference in ExtraBitsStored. +This allows for us to have an unbounded number of signers, and is more space efficient than what is currently used in `libs/common`. +Again the implementation of this space saving feature is straight forward. + +### Encoding the structs + +We will use straight forward amino encoding. This is chosen for ease of compatibility in other languages. + +### Future points of discussion + +If desired, we can use ed25519 batch verification for all ed25519 keys. +This is a future point of discussion, but would be backwards compatible as this information won't need to be marshalled. +(There may even be cofactor concerns without ristretto) +Aggregation of pubkeys / sigs in Schnorr sigs / BLS sigs is not backwards compatible, and would need to be a new ASM type. + +## Status + +Proposed. + +## Consequences + +### Positive +* Supports multisignatures, in a way that won't require any special cases in our downstream verification code. +* Easy to serialize / deserialize +* Unbounded number of signers + +### Negative +* Larger codebase, however this should reside in a subfolder of tendermint/crypto, as it provides no new interfaces. (Ref #https://github.com/tendermint/go-crypto/issues/136) +* Space inefficient due to utilization of amino encoding +* Suggested implementation requires a new struct for every ASM. + +### Neutral From 3c98cec2c28584c71f7019f8a8afc13dfc0e14af Mon Sep 17 00:00:00 2001 From: Ian Tan Date: Thu, 9 Aug 2018 03:12:36 +0800 Subject: [PATCH 046/149] Add ADR entry for `ProposeTx` (#1813) This adds an ADR entry addressing the implementation of a `ProposeTx` method in the ABCI proposed in #1776. Fundamentally, this proposal gives some control of block proposals to the application. The initial use case is to support the Minimal Viable Plasma specification. --- docs/architecture/adr-012-ABCI-propose-tx.md | 183 +++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 docs/architecture/adr-012-ABCI-propose-tx.md diff --git a/docs/architecture/adr-012-ABCI-propose-tx.md b/docs/architecture/adr-012-ABCI-propose-tx.md new file mode 100644 index 00000000..4ea290f0 --- /dev/null +++ b/docs/architecture/adr-012-ABCI-propose-tx.md @@ -0,0 +1,183 @@ +# ADR 012: ABCI `ProposeTx` Method + +## Changelog + +25-06-2018: Initial draft based on [#1776](https://github.com/tendermint/tendermint/issues/1776) + +## Context + +[#1776](https://github.com/tendermint/tendermint/issues/1776) was +opened in relation to implementation of a Plasma child chain using Tendermint +Core as consensus/replication engine. + +Due to the requirements of [Minimal Viable Plasma (MVP)](https://ethresear.ch/t/minimal-viable-plasma/426) and [Plasma Cash](https://ethresear.ch/t/plasma-cash-plasma-with-much-less-per-user-data-checking/1298), it is necessary for ABCI apps to have a mechanism to handle the following cases (more may emerge in the near future): + +1. `deposit` transactions on the Root Chain, which must consist of a block + with a single transaction, where there are no inputs and only one output + made in favour of the depositor. In this case, a `block` consists of + a transaction with the following shape: + + ``` + [0, 0, 0, 0, #input1 - zeroed out + 0, 0, 0, 0, #input2 - zeroed out + , , #output1 - in favour of depositor + 0, 0, #output2 - zeroed out + , + ] + ``` + + `exit` transactions may also be treated in a similar manner, wherein the + input is the UTXO being exited on the Root Chain, and the output belongs to + a reserved "burn" address, e.g., `0x0`. In such cases, it is favourable for + the containing block to only hold a single transaction that may receive + special treatment. + +2. Other "internal" transactions on the child chain, which may be initiated + unilaterally. The most basic example of is a coinbase transaction + implementing validator node incentives, but may also be app-specific. In + these cases, it may be favourable for such transactions to + be ordered in a specific manner, e.g., coinbase transactions will always be + at index 0. In general, such strategies increase the determinism and + predictability of blockchain applications. + +While it is possible to deal with the cases enumerated above using the +existing ABCI, currently available result in suboptimal workarounds. Two are +explained in greater detail below. + +### Solution 1: App state-based Plasma chain + +In this work around, the app maintains a `PlasmaStore` with a corresponding +`Keeper`. The PlasmaStore is responsible for maintaing a second, separate +blockchain that complies with the MVP specification, including `deposit` +blocks and other "internal" transactions. These "virtual" blocks are then broadcasted +to the Root Chain. + +This naive approach is, however, fundamentally flawed, as it by definition +diverges from the canonical chain maintained by Tendermint. This is further +exacerbated if the business logic for generating such transactions is +potentially non-deterministic, as this should not even be done in +`Begin/EndBlock`, which may, as a result, break consensus guarantees. + +Additinoally, this has serious implications for "watchers" - independent third parties, +or even an auxilliary blockchain, responsible for ensuring that blocks recorded +on the Root Chain are consistent with the Plasma chain's. Since, in this case, +the Plasma chain is inconsistent with the canonical one maintained by Tendermint +Core, it seems that there exists no compact means of verifying the legitimacy of +the Plasma chain without replaying every state transition from genesis (!). + +### Solution 2: Broadcast to Tendermint Core from ABCI app + +This approach is inspired by `tendermint`, in which Ethereum transactions are +relayed to Tendermint Core. It requires the app to maintain a client connection +to the consensus engine. + +Whenever an "internal" transaction needs to be created, the proposer of the +current block broadcasts the transaction or transactions to Tendermint as +needed in order to ensure that the Tendermint chain and Plasma chain are +completely consistent. + +This allows "internal" transactions to pass through the full consensus +process, and can be validated in methods like `CheckTx`, i.e., signed by the +proposer, is the semantically correct, etc. Note that this involves informing +the ABCI app of the block proposer, which was temporarily hacked in as a means +of conducting this experiment, although this should not be necessary when the +current proposer is passed to `BeginBlock`. + +It is much easier to relay these transactions directly to the Root +Chain smart contract and/or maintain a "compressed" auxiliary chain comprised +of Plasma-friendly blocks that 100% reflect the canonical (Tendermint) +blockchain. Unfortunately, this approach not idiomatic (i.e., utilises the +Tendermint consensus engine in unintended ways). Additionally, it does not +allow the application developer to: + +- Control the _ordering_ of transactions in the proposed block (e.g., index 0, +or 0 to `n` for coinbase transactions) +- Control the _number_ of transactions in the block (e.g., when a `deposit` +block is required) + +Since determinism is of utmost importance in blockchain engineering, this approach, +while more viable, should also not be considered as fit for production. + +## Decision + +### `ProposeTx` + +In order to address the difficulties described above, the ABCI interface must +expose an additional method, tentatively named `ProposeTx`. + +It should have the following signature: + +``` +ProposeTx(RequestProposeTx) ResponseProposeTx +``` + +Where `RequestProposeTx` and `ResponseProposeTx` are `message`s with the +following shapes: + +``` +message RequestProposeTx { + int64 next_block_height = 1; // height of the block the proposed tx would be part of + Validator proposer = 2; // the proposer details +} + +message ResponseProposeTx { + int64 num_tx = 1; // the number of tx to include in proposed block + repeated bytes txs = 2; // ordered transaction data to include in block + bool exclusive = 3; // whether the block should include other transactions (from `mempool`) +} +``` + +`ProposeTx` would be called by before `mempool.Reap` at this +[line](https://github.com/tendermint/tendermint/blob/master/consensus/state.go#L906). +Depending on whether `exclusive` is `true` or `false`, the proposed +transactions are then pushed on top of the transactions received from +`mempool.Reap`. + +### `DeliverTx` + +Since the list of `tx` received from `ProposeTx` are _not_ passed through `CheckTx`, +it is probably a good idea to provide a means of differentiatiating "internal" transactions +from user-generated ones, in case the app developer needs/wants to take extra measures to +ensure validity of the proposed transactions. + +Therefore, the `RequestDeliverTx` message should be changed to provide an additional flag, like so: + +``` +message RequestDeliverTx { + bytes tx = 1; + bool internal = 2; +} +``` + +Alternatively, an additional method `DeliverProposeTx` may be added as an accompanient to +`ProposeTx`. However, it is not clear at this stage if this additional overhead is necessary +to preserve consensus guarantees given that a simple flag may suffice for now. + +## Status + +Pending + +## Consequences + +### Positive + +- Tendermint ABCI apps will be able to function as minimally viable Plasma chains. +- It will thereby become possible to add an extension to `cosmos-sdk` to enable + ABCI apps to support both IBC and Plasma, maximising interop. +- ABCI apps will have great control and flexibility in managing blockchain state, + without having to resort to non-deterministic hacks and/or unsafe workarounds + +### Negative + +- Maintenance overhead of exposing additional ABCI method +- Potential security issues that may have been overlooked and must now be tested extensively + +### Neutral + +- ABCI developers must deal with increased (albeit nominal) API surface area. + +## References + +- [#1776 Plasma and "Internal" Transactions in ABCI Apps](https://github.com/tendermint/tendermint/issues/1776) +- [Minimal Viable Plasma](https://ethresear.ch/t/minimal-viable-plasma/426) +- [Plasma Cash: Plasma with much less per-user data checking](https://ethresear.ch/t/plasma-cash-plasma-with-much-less-per-user-data-checking/1298) From 5a8fe612008d8209886c1551c685d5846f6094b1 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 9 Aug 2018 00:38:23 -0500 Subject: [PATCH 047/149] crypto: Add compact bit array for intended usage in the multisig (#2140) * crypto: Add compact bit array for intended usage in the multisig This is in a separate PR for ease of review. * (squash this) add comment --- crypto/multisig/compact_bit_array.go | 220 ++++++++++++++++++++++ crypto/multisig/compact_bit_array_test.go | 169 +++++++++++++++++ 2 files changed, 389 insertions(+) create mode 100644 crypto/multisig/compact_bit_array.go create mode 100644 crypto/multisig/compact_bit_array_test.go diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go new file mode 100644 index 00000000..ff6ecd64 --- /dev/null +++ b/crypto/multisig/compact_bit_array.go @@ -0,0 +1,220 @@ +package multisig + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "regexp" + "strings" +) + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after amino encoding. +// This is not thread safe, and is not intended for concurrent usage. +type CompactBitArray struct { + ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. + Elems []byte `json:"bits"` +} + +// NewCompactBitArray returns a new compact bit array. +// It returns nil if the number of bits is zero. +func NewCompactBitArray(bits int) *CompactBitArray { + if bits <= 0 { + return nil + } + return &CompactBitArray{ + ExtraBitsStored: byte(bits % 8), + Elems: make([]byte, (bits+7)/8), + } +} + +// Size returns the number of bits in the bitarray +func (bA *CompactBitArray) Size() int { + if bA == nil { + return 0 + } else if bA.ExtraBitsStored == byte(0) { + return len(bA.Elems) * 8 + } + // num_bits = 8*num_full_bytes + overflow_in_last_byte + // num_full_bytes = (len(bA.Elems)-1) + return (len(bA.Elems)-1)*8 + int(bA.ExtraBitsStored) +} + +// GetIndex returns the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) GetIndex(i int) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + return bA.Elems[i>>3]&(uint8(1)< 0 +} + +// SetIndex sets the bit at index i within the bit array. +// The behavior is undefined if i >= bA.Size() +func (bA *CompactBitArray) SetIndex(i int, v bool) bool { + if bA == nil { + return false + } + if i >= bA.Size() { + return false + } + if v { + bA.Elems[i>>3] |= (uint8(1) << uint8(7-(i%8))) + } else { + bA.Elems[i>>3] &= ^(uint8(1) << uint8(7-(i%8))) + } + return true +} + +// Copy returns a copy of the provided bit array. +func (bA *CompactBitArray) Copy() *CompactBitArray { + if bA == nil { + return nil + } + c := make([]byte, len(bA.Elems)) + copy(c, bA.Elems) + return &CompactBitArray{ + ExtraBitsStored: bA.ExtraBitsStored, + Elems: c, + } +} + +// String returns a string representation of CompactBitArray: BA{}, +// where is a sequence of 'x' (1) and '_' (0). +// The includes spaces and newlines to help people. +// For a simple sequence of 'x' and '_' characters with no spaces or newlines, +// see the MarshalJSON() method. +// Example: "BA{_x_}" or "nil-BitArray" for nil. +func (bA *CompactBitArray) String() string { + return bA.StringIndented("") +} + +// StringIndented returns the same thing as String(), but applies the indent +// at every 10th bit, and twice at every 50th bit. +func (bA *CompactBitArray) StringIndented(indent string) string { + if bA == nil { + return "nil-BitArray" + } + lines := []string{} + bits := "" + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += "x" + } else { + bits += "_" + } + if i%100 == 99 { + lines = append(lines, bits) + bits = "" + } + if i%10 == 9 { + bits += indent + } + if i%50 == 49 { + bits += indent + } + } + if len(bits) > 0 { + lines = append(lines, bits) + } + return fmt.Sprintf("BA{%v:%v}", size, strings.Join(lines, indent)) +} + +// MarshalJSON implements json.Marshaler interface by marshaling bit array +// using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit. +func (bA *CompactBitArray) MarshalJSON() ([]byte, error) { + if bA == nil { + return []byte("null"), nil + } + + bits := `"` + size := bA.Size() + for i := 0; i < size; i++ { + if bA.GetIndex(i) { + bits += `x` + } else { + bits += `_` + } + } + bits += `"` + return []byte(bits), nil +} + +var bitArrayJSONRegexp = regexp.MustCompile(`\A"([_x]*)"\z`) + +// UnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom +// JSON description. +func (bA *CompactBitArray) UnmarshalJSON(bz []byte) error { + b := string(bz) + if b == "null" { + // This is required e.g. for encoding/json when decoding + // into a pointer with pre-allocated BitArray. + bA.ExtraBitsStored = 0 + bA.Elems = nil + return nil + } + + // Validate 'b'. + match := bitArrayJSONRegexp.FindStringSubmatch(b) + if match == nil { + return fmt.Errorf("BitArray in JSON should be a string of format %q but got %s", bitArrayJSONRegexp.String(), b) + } + bits := match[1] + + // Construct new CompactBitArray and copy over. + numBits := len(bits) + bA2 := NewCompactBitArray(numBits) + for i := 0; i < numBits; i++ { + if bits[i] == 'x' { + bA2.SetIndex(i, true) + } + } + *bA = *bA2 + return nil +} + +// CompactMarshal is a space efficient encoding for CompactBitArray. +// It is not amino compatible. +func (bA *CompactBitArray) CompactMarshal() []byte { + size := bA.Size() + if size <= 0 { + return []byte("null") + } + bz := make([]byte, 0, size/8) + // length prefix number of bits, not number of bytes. This difference + // takes 3-4 bits in encoding, as opposed to instead encoding the number of + // bytes (saving 3-4 bits) and including the offset as a full byte. + bz = appendUvarint(bz, uint64(size)) + bz = append(bz, bA.Elems...) + return bz +} + +// CompactUnmarshal is a space efficient decoding for CompactBitArray. +// It is not amino compatible. +func CompactUnmarshal(bz []byte) (*CompactBitArray, error) { + if len(bz) < 2 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } else if bytes.Equal(bz, []byte("null")) { + return NewCompactBitArray(0), nil + } + size, n := binary.Uvarint(bz) + bz = bz[n:] + if len(bz) != int(size+7)/8 { + return nil, errors.New("compact bit array: invalid compact unmarshal size") + } + + bA := &CompactBitArray{byte(int(size % 8)), bz} + return bA, nil +} + +func appendUvarint(b []byte, x uint64) []byte { + var a [binary.MaxVarintLen64]byte + n := binary.PutUvarint(a[:], x) + return append(b, a[:n]...) +} diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go new file mode 100644 index 00000000..91a82192 --- /dev/null +++ b/crypto/multisig/compact_bit_array_test.go @@ -0,0 +1,169 @@ +package multisig + +import ( + "encoding/json" + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + cmn "github.com/tendermint/tendermint/libs/common" +) + +func randCompactBitArray(bits int) (*CompactBitArray, []byte) { + numBytes := (bits + 7) / 8 + src := cmn.RandBytes((bits + 7) / 8) + bA := NewCompactBitArray(bits) + + for i := 0; i < numBytes-1; i++ { + for j := uint8(0); j < 8; j++ { + bA.SetIndex(i*8+int(j), src[i]&(uint8(1)<<(8-j)) > 0) + } + } + // Set remaining bits + for i := uint8(0); i < 8-uint8(bA.ExtraBitsStored); i++ { + bA.SetIndex(numBytes*8+int(i), src[numBytes-1]&(uint8(1)<<(8-i)) > 0) + } + return bA, src +} + +func TestNewBitArrayNeverCrashesOnNegatives(t *testing.T) { + bitList := []int{-127, -128, -1 << 31} + for _, bits := range bitList { + _ = NewCompactBitArray(bits) + } +} + +func TestJSONMarshalUnmarshal(t *testing.T) { + + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA string + }{ + {nil, `null`}, + {bA1, `null`}, + {bA2, `"_"`}, + {bA3, `"x"`}, + {bA4, `"xx___"`}, + {bA5, `"xx______x"`}, + {bA6, `"xx_____________x"`}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz, err := json.Marshal(tc.bA) + require.NoError(t, err) + + assert.Equal(t, tc.marshalledBA, string(bz)) + + var unmarshalledBA *CompactBitArray + err = json.Unmarshal(bz, &unmarshalledBA) + require.NoError(t, err) + + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactMarshalUnmarshal(t *testing.T) { + bA1 := NewCompactBitArray(0) + bA2 := NewCompactBitArray(1) + + bA3 := NewCompactBitArray(1) + bA3.SetIndex(0, true) + + bA4 := NewCompactBitArray(5) + bA4.SetIndex(0, true) + bA4.SetIndex(1, true) + + bA5 := NewCompactBitArray(9) + bA5.SetIndex(0, true) + bA5.SetIndex(1, true) + bA5.SetIndex(8, true) + + bA6 := NewCompactBitArray(16) + bA6.SetIndex(0, true) + bA6.SetIndex(1, true) + bA6.SetIndex(8, false) + bA6.SetIndex(15, true) + + testCases := []struct { + bA *CompactBitArray + marshalledBA []byte + }{ + {nil, []byte("null")}, + {bA1, []byte("null")}, + {bA2, []byte{byte(1), byte(0)}}, + {bA3, []byte{byte(1), byte(128)}}, + {bA4, []byte{byte(5), byte(192)}}, + {bA5, []byte{byte(9), byte(192), byte(128)}}, + {bA6, []byte{byte(16), byte(192), byte(1)}}, + } + + for _, tc := range testCases { + t.Run(tc.bA.String(), func(t *testing.T) { + bz := tc.bA.CompactMarshal() + + assert.Equal(t, tc.marshalledBA, bz) + + unmarshalledBA, err := CompactUnmarshal(bz) + require.NoError(t, err) + if tc.bA == nil { + require.Nil(t, unmarshalledBA) + } else { + require.NotNil(t, unmarshalledBA) + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + if assert.EqualValues(t, tc.bA.String(), unmarshalledBA.String()) { + assert.EqualValues(t, tc.bA.Elems, unmarshalledBA.Elems) + } + } + }) + } +} + +func TestCompactBitArrayGetSetIndex(t *testing.T) { + r := rand.New(rand.NewSource(100)) + numTests := 10 + numBitsPerArr := 100 + for i := 0; i < numTests; i++ { + bits := r.Intn(1000) + bA, _ := randCompactBitArray(bits) + + for j := 0; j < numBitsPerArr; j++ { + copy := bA.Copy() + index := r.Intn(bits) + val := (r.Int63() % 2) == 0 + bA.SetIndex(index, val) + require.Equal(t, val, bA.GetIndex(index), "bA.SetIndex(%d, %v) failed on bit array: %s", index, val, copy) + } + } +} From 785786bec4ea26668c6ec31f4058e7a6128e7213 Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Fri, 10 Aug 2018 13:09:40 +0800 Subject: [PATCH 048/149] add json2wal & fix wal2json (#2196) * add json2wal & fix wal2json * fix bug * Update main.go * add wal2JsonTest file * Delete wal2JsonTest --- docs/tendermint-core/running-in-production.md | 2 +- scripts/json2wal/main.go | 75 +++++++++++++++++++ scripts/wal2json/main.go | 13 +++- 3 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 scripts/json2wal/main.go diff --git a/docs/tendermint-core/running-in-production.md b/docs/tendermint-core/running-in-production.md index 0c7ed4e2..eeab25c3 100644 --- a/docs/tendermint-core/running-in-production.md +++ b/docs/tendermint-core/running-in-production.md @@ -164,7 +164,7 @@ $EDITOR /tmp/corrupted_wal 5. After editing, convert this file back into binary form by running: ``` -./scripts/json2wal/json2wal /tmp/corrupted_wal > "$TMHOME/data/cs.wal/wal" +./scripts/json2wal/json2wal /tmp/corrupted_wal $TMHOME/data/cs.wal/wal ``` ## Hardware diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go new file mode 100644 index 00000000..9b593f89 --- /dev/null +++ b/scripts/json2wal/main.go @@ -0,0 +1,75 @@ +/* + json2wal converts JSON file to binary WAL file. + + Usage: + json2wal +*/ + +package main + +import ( + "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/types" + cs "github.com/tendermint/tendermint/consensus" + "fmt" + "os" + "io" + "bufio" + "strings" +) + +var cdc = amino.NewCodec() + +func init() { + cs.RegisterConsensusMessages(cdc) + cs.RegisterWALMessages(cdc) + types.RegisterBlockAmino(cdc) +} + + +func main() { + if len(os.Args) < 3 { + fmt.Fprintln(os.Stderr, "missing arguments: Usage:json2wal ") + os.Exit(1) + } + + f, err := os.Open(os.Args[1]) + if err != nil { + panic(fmt.Errorf("failed to open WAL file: %v", err)) + } + defer f.Close() + + walFile, err := os.OpenFile(os.Args[2],os.O_EXCL|os.O_WRONLY|os.O_CREATE,0666) + if err != nil { + panic(fmt.Errorf("failed to open WAL file: %v", err)) + } + defer walFile.Close() + + br := bufio.NewReader(f) + dec := cs.NewWALEncoder(walFile) + + for { + msgJson, _, err := br.ReadLine() + if err == io.EOF{ + break + }else if err != nil { + panic(fmt.Errorf("failed to read file: %v", err)) + } + // ignore the ENDHEIGHT in json.File + if strings.HasPrefix(string(msgJson),"ENDHEIGHT"){ + continue + } + + var msg cs.TimedWALMessage + err = cdc.UnmarshalJSON(msgJson,&msg) + if err != nil{ + panic(fmt.Errorf("failed to unmarshal json: %v", err)) + } + + err = dec.Encode(&msg) + if err != nil{ + panic(fmt.Errorf("failed to encode msg: %v", err)) + } + } +} + diff --git a/scripts/wal2json/main.go b/scripts/wal2json/main.go index f6ffea43..80181bb1 100644 --- a/scripts/wal2json/main.go +++ b/scripts/wal2json/main.go @@ -8,14 +8,23 @@ package main import ( - "encoding/json" "fmt" "io" "os" cs "github.com/tendermint/tendermint/consensus" + "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/types" ) +var cdc = amino.NewCodec() + +func init() { + cs.RegisterConsensusMessages(cdc) + cs.RegisterWALMessages(cdc) + types.RegisterBlockAmino(cdc) +} + func main() { if len(os.Args) < 2 { fmt.Println("missing one argument: ") @@ -37,7 +46,7 @@ func main() { panic(fmt.Errorf("failed to decode msg: %v", err)) } - json, err := json.Marshal(msg) + json, err := cdc.MarshalJSON(msg) if err != nil { panic(fmt.Errorf("failed to marshal msg: %v", err)) } From fc7c298cc0cd34fede7e80cba67136d24dc55095 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 10 Aug 2018 09:14:17 +0400 Subject: [PATCH 049/149] Remove gogoproto from Makefile's TOOLS (#2198) * remove gogoproto from tools because it's not a binary * update protobuf version to 3.6.1 in `make get_protoc` * update libs/common/types.pb.go and rpc/grpc/types.pb.go * fix app tests --- Gopkg.lock | 45 +++--- Makefile | 13 +- abci/example/kvstore/kvstore.go | 4 +- abci/types/messages_test.go | 4 +- abci/types/types.pb.go | 11 +- libs/common/types.pb.go | 126 +++++++++++++---- libs/common/typespb_test.go | 91 ++++++------ rpc/grpc/grpc_test.go | 2 +- rpc/grpc/types.pb.go | 239 ++++++++++++++++++++++++++------ rpc/grpc/typespb_test.go | 169 +++++++++++----------- state/state_test.go | 4 +- state/txindex/kv/kv_test.go | 4 +- test/app/grpc_client.go | 6 +- types/event_bus_test.go | 2 +- 14 files changed, 474 insertions(+), 246 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 33580824..36d6f0df 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,14 +11,14 @@ [[projects]] branch = "master" - digest = "1:6aabc1566d6351115d561d038da82a4c19b46c3b6e17f4a0a2fa60260663dc79" + digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" name = "github.com/btcsuite/btcd" packages = ["btcec"] pruneopts = "UT" revision = "f5e261fc9ec3437697fb31d8b38453c293204b29" [[projects]] - digest = "1:df684ed7fed3fb406ec421424aaf5fc9c63ccc2f428b25b842da78e634482e4b" + digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" name = "github.com/btcsuite/btcutil" packages = [ "base58", @@ -59,7 +59,7 @@ version = "v1.4.7" [[projects]] - digest = "1:fa30c0652956e159cdb97dcb2ef8b8db63ed668c02a5c3a40961c8f0641252fe" + digest = "1:fdf5169073fb0ad6dc12a70c249145e30f4058647bea25f0abd48b6d9f228a11" name = "github.com/go-kit/kit" packages = [ "log", @@ -91,7 +91,7 @@ version = "v1.7.0" [[projects]] - digest = "1:212285efb97b9ec2e20550d81f0446cb7897e57cbdfd7301b1363ab113d8be45" + digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -106,7 +106,7 @@ version = "v1.1.1" [[projects]] - digest = "1:cb22af0ed7c72d495d8be1106233ee553898950f15fd3f5404406d44c2e86888" + digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" name = "github.com/golang/protobuf" packages = [ "proto", @@ -137,7 +137,7 @@ [[projects]] branch = "master" - digest = "1:8951fe6e358876736d8fa1f3992624fdbb2dec6bc49401c1381d1ef8abbb544f" + digest = "1:12247a2e99a060cc692f6680e5272c8adf0b8f572e6bce0d7095e624c958a240" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -225,7 +225,7 @@ version = "v1.0.0" [[projects]] - digest = "1:98225904b7abff96c052b669b25788f18225a36673fba022fb93514bb9a2a64e" + digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" name = "github.com/prometheus/client_golang" packages = [ "prometheus", @@ -236,7 +236,7 @@ [[projects]] branch = "master" - digest = "1:0f37e09b3e92aaeda5991581311f8dbf38944b36a3edec61cc2d1991f527554a" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] pruneopts = "UT" @@ -256,7 +256,7 @@ [[projects]] branch = "master" - digest = "1:a37c98f4b7a66bb5c539c0539f0915a74ef1c8e0b3b6f45735289d94cae92bfd" + digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" name = "github.com/prometheus/procfs" packages = [ ".", @@ -275,7 +275,7 @@ revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - digest = "1:37ace7f35375adec11634126944bdc45a673415e2fcc07382d03b75ec76ea94c" + digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" name = "github.com/spf13/afero" packages = [ ".", @@ -294,7 +294,7 @@ version = "v1.2.0" [[projects]] - digest = "1:627ab2f549a6a55c44f46fa24a4307f4d0da81bfc7934ed0473bf38b24051d26" + digest = "1:7ffc0983035bc7e297da3688d9fe19d60a420e9c38bef23f845c53788ed6a05e" name = "github.com/spf13/cobra" packages = ["."] pruneopts = "UT" @@ -326,7 +326,7 @@ version = "v1.0.0" [[projects]] - digest = "1:73697231b93fb74a73ebd8384b68b9a60c57ea6b13c56d2425414566a72c8e6d" + digest = "1:7e8d267900c7fa7f35129a2a37596e38ed0f11ca746d6d9ba727980ee138f9f6" name = "github.com/stretchr/testify" packages = [ "assert", @@ -338,7 +338,7 @@ [[projects]] branch = "master" - digest = "1:922191411ad8f61bcd8018ac127589bb489712c1d1a0ab2497aca4b16de417d2" + digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -359,7 +359,7 @@ [[projects]] branch = "master" - digest = "1:203b409c21115233a576f99e8f13d8e07ad82b25500491f7e1cca12588fb3232" + digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" name = "github.com/tendermint/ed25519" packages = [ ".", @@ -377,9 +377,17 @@ revision = "a8328986c1608950fa5d3d1c0472cccc4f8fc02c" version = "v0.12.0-rc0" +[[projects]] + digest = "1:cefd237469d443fe56cbeadf68a1baf46cef293f071dc0e317f8b8062c3ffe72" + name = "github.com/tendermint/go-crypto" + packages = ["tmhash"] + pruneopts = "UT" + revision = "6a6b591a3d7592a04b46af95451cb5be3b114f76" + version = "v0.9.0" + [[projects]] branch = "master" - digest = "1:df132ec33d5acb4a1ab58d637f1bc3557be49456ca59b9198f5c1e7fa32e0d31" + digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -401,7 +409,7 @@ revision = "56440b844dfe139a8ac053f4ecac0b20b79058f4" [[projects]] - digest = "1:04dda8391c3e2397daf254ac68003f30141c069b228d06baec8324a5f81dc1e9" + digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" name = "golang.org/x/net" packages = [ "context", @@ -428,7 +436,7 @@ revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" [[projects]] - digest = "1:7509ba4347d1f8de6ae9be8818b0cd1abc3deeffe28aeaf4be6d4b6b5178d9ca" + digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" name = "golang.org/x/text" packages = [ "collate", @@ -459,7 +467,7 @@ revision = "daca94659cb50e9f37c1b834680f2e46358f10b0" [[projects]] - digest = "1:4515e3030c440845b046354fd5d57671238428b820deebce2e9dabb5cd3c51ac" + digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" name = "google.golang.org/grpc" packages = [ ".", @@ -538,6 +546,7 @@ "github.com/tendermint/ed25519", "github.com/tendermint/ed25519/extra25519", "github.com/tendermint/go-amino", + "github.com/tendermint/go-crypto/tmhash", "golang.org/x/crypto/bcrypt", "golang.org/x/crypto/chacha20poly1305", "golang.org/x/crypto/curve25519", diff --git a/Makefile b/Makefile index d2cec275..ff1232d0 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ GOTOOLS = \ github.com/golang/dep/cmd/dep \ gopkg.in/alecthomas/gometalinter.v2 \ github.com/gogo/protobuf/protoc-gen-gogo \ - github.com/gogo/protobuf/gogoproto \ github.com/square/certstrap PACKAGES=$(shell go list ./...) @@ -75,7 +74,7 @@ get_tools: update_tools: @echo "--> Updating tools" - @go get -u $(GOTOOLS) + go get -u -v $(GOTOOLS) #Update dependencies get_vendor_deps: @@ -85,13 +84,15 @@ get_vendor_deps: #For ABCI and libs get_protoc: @# https://github.com/google/protobuf/releases - curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \ - cd protobuf-3.4.1 && \ + curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gz | tar xvz && \ + cd protobuf-3.6.1 && \ DIST_LANG=cpp ./configure && \ make && \ - make install && \ + make check && \ + sudo make install && \ + sudo ldconfig && \ cd .. && \ - rm -rf protobuf-3.4.1 + rm -rf protobuf-3.6.1 draw_deps: @# requires brew install graphviz or apt-get install graphviz diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 0f72b44e..d8d18d5e 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -81,8 +81,8 @@ func (app *KVStoreApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { app.state.Size += 1 tags := []cmn.KVPair{ - {[]byte("app.creator"), []byte("jae")}, - {[]byte("app.key"), key}, + {Key: []byte("app.creator"), Value: []byte("jae")}, + {Key: []byte("app.key"), Value: key}, } return types.ResponseDeliverTx{Code: code.CodeTypeOK, Tags: tags} } diff --git a/abci/types/messages_test.go b/abci/types/messages_test.go index 603e602a..14bc5718 100644 --- a/abci/types/messages_test.go +++ b/abci/types/messages_test.go @@ -22,7 +22,7 @@ func TestMarshalJSON(t *testing.T) { Data: []byte("hello"), GasWanted: 43, Tags: []cmn.KVPair{ - {[]byte("pho"), []byte("bo")}, + {Key: []byte("pho"), Value: []byte("bo")}, }, } b, err = json.Marshal(&r1) @@ -83,7 +83,7 @@ func TestWriteReadMessage2(t *testing.T) { Log: phrase, GasWanted: 10, Tags: []cmn.KVPair{ - cmn.KVPair{[]byte("abc"), []byte("def")}, + cmn.KVPair{Key: []byte("abc"), Value: []byte("def")}, }, }, // TODO: add the rest diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index e28b422b..ae619ecc 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -16,8 +16,10 @@ import time "time" import bytes "bytes" -import context "golang.org/x/net/context" -import grpc "google.golang.org/grpc" +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -4998,8 +5000,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for ABCIApplication service - +// ABCIApplicationClient is the client API for ABCIApplication service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ABCIApplicationClient interface { Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) diff --git a/libs/common/types.pb.go b/libs/common/types.pb.go index 6442daeb..9cd62273 100644 --- a/libs/common/types.pb.go +++ b/libs/common/types.pb.go @@ -1,16 +1,6 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: libs/common/types.proto -/* - Package common is a generated protocol buffer package. - - It is generated from these files: - libs/common/types.proto - - It has these top-level messages: - KVPair - KI64Pair -*/ //nolint package common @@ -38,14 +28,45 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package // Define these here for compatibility but use tmlibs/common.KVPair. type KVPair struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *KVPair) Reset() { *m = KVPair{} } -func (m *KVPair) String() string { return proto.CompactTextString(m) } -func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } +func (m *KVPair) Reset() { *m = KVPair{} } +func (m *KVPair) String() string { return proto.CompactTextString(m) } +func (*KVPair) ProtoMessage() {} +func (*KVPair) Descriptor() ([]byte, []int) { + return fileDescriptor_types_611b4364a8604338, []int{0} +} +func (m *KVPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KVPair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *KVPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_KVPair.Merge(dst, src) +} +func (m *KVPair) XXX_Size() int { + return m.Size() +} +func (m *KVPair) XXX_DiscardUnknown() { + xxx_messageInfo_KVPair.DiscardUnknown(m) +} + +var xxx_messageInfo_KVPair proto.InternalMessageInfo func (m *KVPair) GetKey() []byte { if m != nil { @@ -63,14 +84,45 @@ func (m *KVPair) GetValue() []byte { // Define these here for compatibility but use tmlibs/common.KI64Pair. type KI64Pair struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *KI64Pair) Reset() { *m = KI64Pair{} } -func (m *KI64Pair) String() string { return proto.CompactTextString(m) } -func (*KI64Pair) ProtoMessage() {} -func (*KI64Pair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } +func (m *KI64Pair) Reset() { *m = KI64Pair{} } +func (m *KI64Pair) String() string { return proto.CompactTextString(m) } +func (*KI64Pair) ProtoMessage() {} +func (*KI64Pair) Descriptor() ([]byte, []int) { + return fileDescriptor_types_611b4364a8604338, []int{1} +} +func (m *KI64Pair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KI64Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KI64Pair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *KI64Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_KI64Pair.Merge(dst, src) +} +func (m *KI64Pair) XXX_Size() int { + return m.Size() +} +func (m *KI64Pair) XXX_DiscardUnknown() { + xxx_messageInfo_KI64Pair.DiscardUnknown(m) +} + +var xxx_messageInfo_KI64Pair proto.InternalMessageInfo func (m *KI64Pair) GetKey() []byte { if m != nil { @@ -117,6 +169,9 @@ func (this *KVPair) Equal(that interface{}) bool { if !bytes.Equal(this.Value, that1.Value) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *KI64Pair) Equal(that interface{}) bool { @@ -144,6 +199,9 @@ func (this *KI64Pair) Equal(that interface{}) bool { if this.Value != that1.Value { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (m *KVPair) Marshal() (dAtA []byte, err error) { @@ -173,6 +231,9 @@ func (m *KVPair) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -202,6 +263,9 @@ func (m *KI64Pair) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Value)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -227,6 +291,7 @@ func NewPopulatedKVPair(r randyTypes, easy bool) *KVPair { this.Value[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -243,6 +308,7 @@ func NewPopulatedKI64Pair(r randyTypes, easy bool) *KI64Pair { this.Value *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -330,6 +396,9 @@ func (m *KVPair) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -343,6 +412,9 @@ func (m *KI64Pair) Size() (n int) { if m.Value != 0 { n += 1 + sovTypes(uint64(m.Value)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -462,6 +534,7 @@ func (m *KVPair) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -562,6 +635,7 @@ func (m *KI64Pair) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -676,10 +750,12 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptorTypes) } -func init() { golang_proto.RegisterFile("libs/common/types.proto", fileDescriptorTypes) } +func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptor_types_611b4364a8604338) } +func init() { + golang_proto.RegisterFile("libs/common/types.proto", fileDescriptor_types_611b4364a8604338) +} -var fileDescriptorTypes = []byte{ +var fileDescriptor_types_611b4364a8604338 = []byte{ // 174 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, diff --git a/libs/common/typespb_test.go b/libs/common/typespb_test.go index 583c9050..439cc127 100644 --- a/libs/common/typespb_test.go +++ b/libs/common/typespb_test.go @@ -1,23 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: libs/common/types.proto -/* -Package common is a generated protocol buffer package. - -It is generated from these files: - libs/common/types.proto - -It has these top-level messages: - KVPair - KI64Pair -*/ package common import testing "testing" -import rand "math/rand" +import math_rand "math/rand" import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import proto "github.com/gogo/protobuf/proto" -import jsonpb "github.com/gogo/protobuf/jsonpb" import golang_proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" @@ -31,14 +22,14 @@ var _ = math.Inf func TestKVPairProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KVPair{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -56,13 +47,13 @@ func TestKVPairProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestKVPairMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -74,7 +65,7 @@ func TestKVPairMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KVPair{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -87,14 +78,14 @@ func TestKVPairMarshalTo(t *testing.T) { func TestKI64PairProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KI64Pair{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -112,13 +103,13 @@ func TestKI64PairProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestKI64PairMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -130,7 +121,7 @@ func TestKI64PairMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KI64Pair{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -143,15 +134,15 @@ func TestKI64PairMarshalTo(t *testing.T) { func TestKVPairJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KVPair{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -161,15 +152,15 @@ func TestKVPairJSON(t *testing.T) { } func TestKI64PairJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &KI64Pair{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -179,11 +170,11 @@ func TestKI64PairJSON(t *testing.T) { } func TestKVPairProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &KVPair{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -193,11 +184,11 @@ func TestKVPairProtoText(t *testing.T) { func TestKVPairProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &KVPair{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -207,11 +198,11 @@ func TestKVPairProtoCompactText(t *testing.T) { func TestKI64PairProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &KI64Pair{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -221,11 +212,11 @@ func TestKI64PairProtoText(t *testing.T) { func TestKI64PairProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &KI64Pair{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -235,10 +226,10 @@ func TestKI64PairProtoCompactText(t *testing.T) { func TestKVPairSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKVPair(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -249,7 +240,7 @@ func TestKVPairSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -257,10 +248,10 @@ func TestKVPairSize(t *testing.T) { func TestKI64PairSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedKI64Pair(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -271,7 +262,7 @@ func TestKI64PairSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } diff --git a/rpc/grpc/grpc_test.go b/rpc/grpc/grpc_test.go index fe979c54..eda3896f 100644 --- a/rpc/grpc/grpc_test.go +++ b/rpc/grpc/grpc_test.go @@ -26,7 +26,7 @@ func TestMain(m *testing.M) { func TestBroadcastTx(t *testing.T) { require := require.New(t) - res, err := rpctest.GetGRPCClient().BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{[]byte("this is a tx")}) + res, err := rpctest.GetGRPCClient().BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{Tx: []byte("this is a tx")}) require.Nil(err, "%+v", err) require.EqualValues(0, res.CheckTx.Code) require.EqualValues(0, res.DeliverTx.Code) diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index 8bc9761a..b33397da 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -1,18 +1,6 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: rpc/grpc/types.proto -/* - Package core_grpc is a generated protocol buffer package. - - It is generated from these files: - rpc/grpc/types.proto - - It has these top-level messages: - RequestPing - RequestBroadcastTx - ResponsePing - ResponseBroadcastTx -*/ //nolint package core_grpc @@ -25,8 +13,10 @@ import types "github.com/tendermint/tendermint/abci/types" import bytes "bytes" -import context "golang.org/x/net/context" -import grpc "google.golang.org/grpc" +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) import io "io" @@ -43,21 +33,83 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type RequestPing struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestPing) Reset() { *m = RequestPing{} } -func (m *RequestPing) String() string { return proto.CompactTextString(m) } -func (*RequestPing) ProtoMessage() {} -func (*RequestPing) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } +func (m *RequestPing) Reset() { *m = RequestPing{} } +func (m *RequestPing) String() string { return proto.CompactTextString(m) } +func (*RequestPing) ProtoMessage() {} +func (*RequestPing) Descriptor() ([]byte, []int) { + return fileDescriptor_types_48bb8d9591d37e66, []int{0} +} +func (m *RequestPing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestPing.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestPing) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestPing.Merge(dst, src) +} +func (m *RequestPing) XXX_Size() int { + return m.Size() +} +func (m *RequestPing) XXX_DiscardUnknown() { + xxx_messageInfo_RequestPing.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestPing proto.InternalMessageInfo type RequestBroadcastTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestBroadcastTx) Reset() { *m = RequestBroadcastTx{} } -func (m *RequestBroadcastTx) String() string { return proto.CompactTextString(m) } -func (*RequestBroadcastTx) ProtoMessage() {} -func (*RequestBroadcastTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } +func (m *RequestBroadcastTx) Reset() { *m = RequestBroadcastTx{} } +func (m *RequestBroadcastTx) String() string { return proto.CompactTextString(m) } +func (*RequestBroadcastTx) ProtoMessage() {} +func (*RequestBroadcastTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_48bb8d9591d37e66, []int{1} +} +func (m *RequestBroadcastTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestBroadcastTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestBroadcastTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestBroadcastTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestBroadcastTx.Merge(dst, src) +} +func (m *RequestBroadcastTx) XXX_Size() int { + return m.Size() +} +func (m *RequestBroadcastTx) XXX_DiscardUnknown() { + xxx_messageInfo_RequestBroadcastTx.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestBroadcastTx proto.InternalMessageInfo func (m *RequestBroadcastTx) GetTx() []byte { if m != nil { @@ -67,22 +119,84 @@ func (m *RequestBroadcastTx) GetTx() []byte { } type ResponsePing struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponsePing) Reset() { *m = ResponsePing{} } -func (m *ResponsePing) String() string { return proto.CompactTextString(m) } -func (*ResponsePing) ProtoMessage() {} -func (*ResponsePing) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} } +func (m *ResponsePing) Reset() { *m = ResponsePing{} } +func (m *ResponsePing) String() string { return proto.CompactTextString(m) } +func (*ResponsePing) ProtoMessage() {} +func (*ResponsePing) Descriptor() ([]byte, []int) { + return fileDescriptor_types_48bb8d9591d37e66, []int{2} +} +func (m *ResponsePing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponsePing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponsePing.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponsePing) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponsePing.Merge(dst, src) +} +func (m *ResponsePing) XXX_Size() int { + return m.Size() +} +func (m *ResponsePing) XXX_DiscardUnknown() { + xxx_messageInfo_ResponsePing.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponsePing proto.InternalMessageInfo type ResponseBroadcastTx struct { - CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx" json:"check_tx,omitempty"` - DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx" json:"deliver_tx,omitempty"` + CheckTx *types.ResponseCheckTx `protobuf:"bytes,1,opt,name=check_tx,json=checkTx" json:"check_tx,omitempty"` + DeliverTx *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=deliver_tx,json=deliverTx" json:"deliver_tx,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } -func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) } -func (*ResponseBroadcastTx) ProtoMessage() {} -func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} } +func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} } +func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) } +func (*ResponseBroadcastTx) ProtoMessage() {} +func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_48bb8d9591d37e66, []int{3} +} +func (m *ResponseBroadcastTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseBroadcastTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseBroadcastTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseBroadcastTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseBroadcastTx.Merge(dst, src) +} +func (m *ResponseBroadcastTx) XXX_Size() int { + return m.Size() +} +func (m *ResponseBroadcastTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseBroadcastTx.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseBroadcastTx proto.InternalMessageInfo func (m *ResponseBroadcastTx) GetCheckTx() *types.ResponseCheckTx { if m != nil { @@ -127,6 +241,9 @@ func (this *RequestPing) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestBroadcastTx) Equal(that interface{}) bool { @@ -151,6 +268,9 @@ func (this *RequestBroadcastTx) Equal(that interface{}) bool { if !bytes.Equal(this.Tx, that1.Tx) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponsePing) Equal(that interface{}) bool { @@ -172,6 +292,9 @@ func (this *ResponsePing) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseBroadcastTx) Equal(that interface{}) bool { @@ -199,6 +322,9 @@ func (this *ResponseBroadcastTx) Equal(that interface{}) bool { if !this.DeliverTx.Equal(that1.DeliverTx) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } @@ -210,8 +336,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for BroadcastAPI service - +// BroadcastAPIClient is the client API for BroadcastAPI service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BroadcastAPIClient interface { Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) @@ -227,7 +354,7 @@ func NewBroadcastAPIClient(cc *grpc.ClientConn) BroadcastAPIClient { func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error) { out := new(ResponsePing) - err := grpc.Invoke(ctx, "/core_grpc.BroadcastAPI/Ping", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/core_grpc.BroadcastAPI/Ping", in, out, opts...) if err != nil { return nil, err } @@ -236,7 +363,7 @@ func (c *broadcastAPIClient) Ping(ctx context.Context, in *RequestPing, opts ... func (c *broadcastAPIClient) BroadcastTx(ctx context.Context, in *RequestBroadcastTx, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) { out := new(ResponseBroadcastTx) - err := grpc.Invoke(ctx, "/core_grpc.BroadcastAPI/BroadcastTx", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/core_grpc.BroadcastAPI/BroadcastTx", in, out, opts...) if err != nil { return nil, err } @@ -322,6 +449,9 @@ func (m *RequestPing) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -346,6 +476,9 @@ func (m *RequestBroadcastTx) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) i += copy(dAtA[i:], m.Tx) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -364,6 +497,9 @@ func (m *ResponsePing) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -402,6 +538,9 @@ func (m *ResponseBroadcastTx) MarshalTo(dAtA []byte) (int, error) { } i += n2 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -417,6 +556,7 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { func NewPopulatedRequestPing(r randyTypes, easy bool) *RequestPing { this := &RequestPing{} if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -429,6 +569,7 @@ func NewPopulatedRequestBroadcastTx(r randyTypes, easy bool) *RequestBroadcastTx this.Tx[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -436,6 +577,7 @@ func NewPopulatedRequestBroadcastTx(r randyTypes, easy bool) *RequestBroadcastTx func NewPopulatedResponsePing(r randyTypes, easy bool) *ResponsePing { this := &ResponsePing{} if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -449,6 +591,7 @@ func NewPopulatedResponseBroadcastTx(r randyTypes, easy bool) *ResponseBroadcast this.DeliverTx = types.NewPopulatedResponseDeliverTx(r, easy) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -528,6 +671,9 @@ func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte { func (m *RequestPing) Size() (n int) { var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -538,12 +684,18 @@ func (m *RequestBroadcastTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResponsePing) Size() (n int) { var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -558,6 +710,9 @@ func (m *ResponseBroadcastTx) Size() (n int) { l = m.DeliverTx.Size() n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -615,6 +770,7 @@ func (m *RequestPing) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -696,6 +852,7 @@ func (m *RequestBroadcastTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -746,6 +903,7 @@ func (m *ResponsePing) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -862,6 +1020,7 @@ func (m *ResponseBroadcastTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -976,10 +1135,10 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("rpc/grpc/types.proto", fileDescriptorTypes) } -func init() { golang_proto.RegisterFile("rpc/grpc/types.proto", fileDescriptorTypes) } +func init() { proto.RegisterFile("rpc/grpc/types.proto", fileDescriptor_types_48bb8d9591d37e66) } +func init() { golang_proto.RegisterFile("rpc/grpc/types.proto", fileDescriptor_types_48bb8d9591d37e66) } -var fileDescriptorTypes = []byte{ +var fileDescriptor_types_48bb8d9591d37e66 = []byte{ // 321 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x2a, 0x48, 0xd6, 0x4f, 0x07, 0x11, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, diff --git a/rpc/grpc/typespb_test.go b/rpc/grpc/typespb_test.go index 3d28002b..da076bf6 100644 --- a/rpc/grpc/typespb_test.go +++ b/rpc/grpc/typespb_test.go @@ -1,25 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: rpc/grpc/types.proto -/* -Package core_grpc is a generated protocol buffer package. - -It is generated from these files: - rpc/grpc/types.proto - -It has these top-level messages: - RequestPing - RequestBroadcastTx - ResponsePing - ResponseBroadcastTx -*/ package core_grpc import testing "testing" -import rand "math/rand" +import math_rand "math/rand" import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import proto "github.com/gogo/protobuf/proto" -import jsonpb "github.com/gogo/protobuf/jsonpb" import golang_proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" @@ -34,14 +23,14 @@ var _ = math.Inf func TestRequestPingProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestPing{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -59,13 +48,13 @@ func TestRequestPingProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestPingMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -77,7 +66,7 @@ func TestRequestPingMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestPing{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -90,14 +79,14 @@ func TestRequestPingMarshalTo(t *testing.T) { func TestRequestBroadcastTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBroadcastTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -115,13 +104,13 @@ func TestRequestBroadcastTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestBroadcastTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -133,7 +122,7 @@ func TestRequestBroadcastTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBroadcastTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -146,14 +135,14 @@ func TestRequestBroadcastTxMarshalTo(t *testing.T) { func TestResponsePingProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponsePing{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -171,13 +160,13 @@ func TestResponsePingProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponsePingMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -189,7 +178,7 @@ func TestResponsePingMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponsePing{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -202,14 +191,14 @@ func TestResponsePingMarshalTo(t *testing.T) { func TestResponseBroadcastTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBroadcastTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -227,13 +216,13 @@ func TestResponseBroadcastTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseBroadcastTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -245,7 +234,7 @@ func TestResponseBroadcastTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBroadcastTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -258,15 +247,15 @@ func TestResponseBroadcastTxMarshalTo(t *testing.T) { func TestRequestPingJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestPing{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -276,15 +265,15 @@ func TestRequestPingJSON(t *testing.T) { } func TestRequestBroadcastTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBroadcastTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -294,15 +283,15 @@ func TestRequestBroadcastTxJSON(t *testing.T) { } func TestResponsePingJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponsePing{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -312,15 +301,15 @@ func TestResponsePingJSON(t *testing.T) { } func TestResponseBroadcastTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBroadcastTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -330,11 +319,11 @@ func TestResponseBroadcastTxJSON(t *testing.T) { } func TestRequestPingProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestPing{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -344,11 +333,11 @@ func TestRequestPingProtoText(t *testing.T) { func TestRequestPingProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestPing{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -358,11 +347,11 @@ func TestRequestPingProtoCompactText(t *testing.T) { func TestRequestBroadcastTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestBroadcastTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -372,11 +361,11 @@ func TestRequestBroadcastTxProtoText(t *testing.T) { func TestRequestBroadcastTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestBroadcastTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -386,11 +375,11 @@ func TestRequestBroadcastTxProtoCompactText(t *testing.T) { func TestResponsePingProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponsePing{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -400,11 +389,11 @@ func TestResponsePingProtoText(t *testing.T) { func TestResponsePingProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponsePing{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -414,11 +403,11 @@ func TestResponsePingProtoCompactText(t *testing.T) { func TestResponseBroadcastTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseBroadcastTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -428,11 +417,11 @@ func TestResponseBroadcastTxProtoText(t *testing.T) { func TestResponseBroadcastTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseBroadcastTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -442,10 +431,10 @@ func TestResponseBroadcastTxProtoCompactText(t *testing.T) { func TestRequestPingSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestPing(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -456,7 +445,7 @@ func TestRequestPingSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -464,10 +453,10 @@ func TestRequestPingSize(t *testing.T) { func TestRequestBroadcastTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBroadcastTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -478,7 +467,7 @@ func TestRequestBroadcastTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -486,10 +475,10 @@ func TestRequestBroadcastTxSize(t *testing.T) { func TestResponsePingSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponsePing(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -500,7 +489,7 @@ func TestResponsePingSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -508,10 +497,10 @@ func TestResponsePingSize(t *testing.T) { func TestResponseBroadcastTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBroadcastTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -522,7 +511,7 @@ func TestResponseBroadcastTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } diff --git a/state/state_test.go b/state/state_test.go index 90f1cfcd..93ae8ca9 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -119,8 +119,8 @@ func TestABCIResponsesSaveLoad2(t *testing.T) { {Code: 383}, {Data: []byte("Gotcha!"), Tags: []cmn.KVPair{ - cmn.KVPair{[]byte("a"), []byte("1")}, - cmn.KVPair{[]byte("build"), []byte("stuff")}, + cmn.KVPair{Key: []byte("a"), Value: []byte("1")}, + cmn.KVPair{Key: []byte("build"), Value: []byte("stuff")}, }}, }, types.ABCIResults{ diff --git a/state/txindex/kv/kv_test.go b/state/txindex/kv/kv_test.go index c32c827d..67fdf9e2 100644 --- a/state/txindex/kv/kv_test.go +++ b/state/txindex/kv/kv_test.go @@ -156,8 +156,8 @@ func TestIndexAllTags(t *testing.T) { indexer := NewTxIndex(db.NewMemDB(), IndexAllTags()) txResult := txResultWithTags([]cmn.KVPair{ - cmn.KVPair{[]byte("account.owner"), []byte("Ivan")}, - cmn.KVPair{[]byte("account.number"), []byte("1")}, + cmn.KVPair{Key: []byte("account.owner"), Value: []byte("Ivan")}, + cmn.KVPair{Key: []byte("account.number"), Value: []byte("1")}, }) err := indexer.Index(txResult) diff --git a/test/app/grpc_client.go b/test/app/grpc_client.go index efcac0f0..51c0d9b7 100644 --- a/test/app/grpc_client.go +++ b/test/app/grpc_client.go @@ -7,8 +7,8 @@ import ( "context" - "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/rpc/grpc" + amino "github.com/tendermint/go-amino" + core_grpc "github.com/tendermint/tendermint/rpc/grpc" ) var grpcAddr = "tcp://localhost:36656" @@ -27,7 +27,7 @@ func main() { } clientGRPC := core_grpc.StartGRPCClient(grpcAddr) - res, err := clientGRPC.BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{txBytes}) + res, err := clientGRPC.BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{Tx: txBytes}) if err != nil { fmt.Println(err) os.Exit(1) diff --git a/types/event_bus_test.go b/types/event_bus_test.go index 907c69d3..2ee9f886 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -22,7 +22,7 @@ func TestEventBusPublishEventTx(t *testing.T) { defer eventBus.Stop() tx := Tx("foo") - result := abci.ResponseDeliverTx{Data: []byte("bar"), Tags: []cmn.KVPair{{[]byte("baz"), []byte("1")}}} + result := abci.ResponseDeliverTx{Data: []byte("bar"), Tags: []cmn.KVPair{{Key: []byte("baz"), Value: []byte("1")}}} txEventsCh := make(chan interface{}) From 2756be5a5930071a1e03aeea33f0b820066648ea Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Fri, 10 Aug 2018 00:25:57 -0500 Subject: [PATCH 050/149] libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) * libs: Remove usage of custom Fmt, in favor of fmt.Sprintf Closes #2193 * Fix bug that was masked by custom Fmt! --- CHANGELOG_PENDING.md | 1 + Gopkg.lock | 5 +- abci/example/counter/counter.go | 11 ++- abci/example/kvstore/kvstore_test.go | 5 +- abci/example/kvstore/persistent_kvstore.go | 3 +- benchmarks/simu/counter.go | 2 +- blockchain/pool.go | 6 +- blockchain/reactor.go | 14 ++-- blockchain/store.go | 8 +-- cmd/tendermint/commands/gen_node_key.go | 2 +- cmd/tendermint/commands/init.go | 5 +- .../commands/reset_priv_validator.go | 2 +- cmd/tendermint/commands/testnet.go | 12 ++-- consensus/byzantine_test.go | 7 +- consensus/common_test.go | 4 +- consensus/mempool_test.go | 7 +- consensus/reactor.go | 16 ++--- consensus/reactor_test.go | 2 +- consensus/replay.go | 4 +- consensus/replay_file.go | 12 ++-- consensus/replay_test.go | 14 ++-- consensus/state.go | 68 +++++++++---------- consensus/state_test.go | 7 +- consensus/types/height_vote_set.go | 6 +- consensus/types/height_vote_set_test.go | 4 +- consensus/types/peer_round_state.go | 2 +- consensus/types/round_state.go | 2 +- consensus/version.go | 6 +- consensus/wal.go | 6 +- consensus/wal_generator.go | 8 +-- consensus/wal_test.go | 8 +-- crypto/merkle/simple_tree_test.go | 3 +- crypto/xsalsa20symmetric/symmetric.go | 5 +- docs/app-dev/app-development.md | 2 +- evidence/pool_test.go | 2 +- evidence/store.go | 2 +- evidence/store_test.go | 2 +- libs/autofile/group.go | 4 +- libs/common/bit_array_test.go | 3 +- libs/common/colors.go | 2 +- libs/common/errors.go | 14 ++-- libs/common/os.go | 4 +- libs/common/random.go | 2 +- libs/common/service.go | 12 ++-- libs/common/string.go | 8 --- libs/db/backend_test.go | 6 +- libs/db/c_level_db_test.go | 4 +- libs/db/go_level_db_test.go | 2 +- lite/provider.go | 2 +- lite/provider_test.go | 4 +- lite/proxy/verifier.go | 4 +- mempool/mempool.go | 2 +- mempool/mempool_test.go | 3 +- node/node.go | 18 ++--- p2p/base_reactor.go | 2 +- p2p/conn/connection.go | 6 +- p2p/listener.go | 2 +- p2p/netaddress.go | 2 +- p2p/peer.go | 2 +- p2p/peer_set_test.go | 3 +- p2p/pex/addrbook.go | 15 ++-- p2p/pex/file.go | 5 +- p2p/test_util.go | 4 +- p2p/trust/store.go | 3 +- p2p/upnp/probe.go | 25 ++++--- privval/priv_validator.go | 4 +- proxy/app_conn_test.go | 9 +-- rpc/client/event_test.go | 2 +- rpc/client/httpclient.go | 2 +- rpc/client/interface.go | 2 +- rpc/client/mock/abci.go | 2 +- rpc/client/mock/abci_test.go | 2 +- rpc/client/mock/client.go | 2 +- rpc/client/mock/status_test.go | 2 +- rpc/core/mempool.go | 2 +- rpc/core/pipe.go | 4 +- rpc/lib/client/ws_client.go | 2 +- rpc/lib/server/handlers_test.go | 2 +- rpc/lib/server/http_server.go | 2 +- rpc/lib/test/main.go | 2 +- state/errors.go | 20 +++--- state/state_test.go | 8 +-- state/store.go | 14 ++-- state/validation.go | 2 +- types/genesis.go | 3 +- types/proto3_test.go | 8 +-- types/protobuf_test.go | 6 +- types/validator_set_test.go | 5 +- 88 files changed, 270 insertions(+), 275 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 84848754..2939381b 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -9,6 +9,7 @@ BREAKING CHANGES: top-level - [abci] Added address of the original proposer of the block to Header. - [abci] Change ABCI Header to match Tendermint exactly +- [libs] Remove cmn.Fmt, in favor of fmt.Sprintf FEATURES: diff --git a/Gopkg.lock b/Gopkg.lock index 36d6f0df..ff5cbcfe 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -244,7 +244,7 @@ [[projects]] branch = "master" - digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" + digest = "1:dad2e5a2153ee7a6c9ab8fc13673a16ee4fb64434a7da980965a3741b0c981a3" name = "github.com/prometheus/common" packages = [ "expfmt", @@ -426,7 +426,7 @@ [[projects]] branch = "master" - digest = "1:bb0fe59917bdd5b89f49b9a8b26e5f465e325d9223b3a8e32254314bdf51e0f1" + digest = "1:70656e26ab4a96e683a21d677630edb5239a3d60b2d54bdc861c808ab5aa42c7" name = "golang.org/x/sys" packages = [ "cpu", @@ -527,6 +527,7 @@ "github.com/gogo/protobuf/gogoproto", "github.com/gogo/protobuf/jsonpb", "github.com/gogo/protobuf/proto", + "github.com/gogo/protobuf/types", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index 857e82ba..a77e7821 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -6,7 +6,6 @@ import ( "github.com/tendermint/tendermint/abci/example/code" "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" ) type CounterApplication struct { @@ -22,7 +21,7 @@ func NewCounterApplication(serial bool) *CounterApplication { } func (app *CounterApplication) Info(req types.RequestInfo) types.ResponseInfo { - return types.ResponseInfo{Data: cmn.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} + return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } func (app *CounterApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { @@ -34,7 +33,7 @@ func (app *CounterApplication) SetOption(req types.RequestSetOption) types.Respo TODO Panic and have the ABCI server pass an exception. The client can call SetOptionSync() and get an `error`. return types.ResponseSetOption{ - Error: cmn.Fmt("Unknown key (%s) or value (%s)", key, value), + Error: fmt.Sprintf("Unknown key (%s) or value (%s)", key, value), } */ return types.ResponseSetOption{} @@ -95,10 +94,10 @@ func (app *CounterApplication) Commit() (resp types.ResponseCommit) { func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { switch reqQuery.Path { case "hash": - return types.ResponseQuery{Value: []byte(cmn.Fmt("%v", app.hashCount))} + return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.hashCount))} case "tx": - return types.ResponseQuery{Value: []byte(cmn.Fmt("%v", app.txCount))} + return types.ResponseQuery{Value: []byte(fmt.Sprintf("%v", app.txCount))} default: - return types.ResponseQuery{Log: cmn.Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} + return types.ResponseQuery{Log: fmt.Sprintf("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 6ef5a08f..33e67aaa 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -2,6 +2,7 @@ package kvstore import ( "bytes" + "fmt" "io/ioutil" "sort" "testing" @@ -207,7 +208,7 @@ func valsEqual(t *testing.T, vals1, vals2 []types.Validator) { func makeSocketClientServer(app types.Application, name string) (abcicli.Client, cmn.Service, error) { // Start the listener - socket := cmn.Fmt("unix://%s.sock", name) + socket := fmt.Sprintf("unix://%s.sock", name) logger := log.TestingLogger() server := abciserver.NewSocketServer(socket, app) @@ -229,7 +230,7 @@ func makeSocketClientServer(app types.Application, name string) (abcicli.Client, func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, cmn.Service, error) { // Start the listener - socket := cmn.Fmt("unix://%s.sock", name) + socket := fmt.Sprintf("unix://%s.sock", name) logger := log.TestingLogger() gapp := types.NewGRPCApplication(app) diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index 12ccbab7..b8a2299a 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -9,7 +9,6 @@ import ( "github.com/tendermint/tendermint/abci/example/code" "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" ) @@ -130,7 +129,7 @@ func (app *PersistentKVStoreApplication) Validators() (validators []types.Valida } func MakeValSetChangeTx(pubkey types.PubKey, power int64) []byte { - return []byte(cmn.Fmt("val:%X/%d", pubkey.Data, power)) + return []byte(fmt.Sprintf("val:%X/%d", pubkey.Data, power)) } func isValidatorTx(tx []byte) bool { diff --git a/benchmarks/simu/counter.go b/benchmarks/simu/counter.go index b7d2c4d6..c24eddf8 100644 --- a/benchmarks/simu/counter.go +++ b/benchmarks/simu/counter.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - rpcclient "github.com/tendermint/tendermint/rpc/lib/client" cmn "github.com/tendermint/tendermint/libs/common" + rpcclient "github.com/tendermint/tendermint/rpc/lib/client" ) func main() { diff --git a/blockchain/pool.go b/blockchain/pool.go index a881c7cb..c7864a64 100644 --- a/blockchain/pool.go +++ b/blockchain/pool.go @@ -365,10 +365,10 @@ func (pool *BlockPool) debug() string { nextHeight := pool.height + pool.requestersLen() for h := pool.height; h < nextHeight; h++ { if pool.requesters[h] == nil { - str += cmn.Fmt("H(%v):X ", h) + str += fmt.Sprintf("H(%v):X ", h) } else { - str += cmn.Fmt("H(%v):", h) - str += cmn.Fmt("B?(%v) ", pool.requesters[h].block != nil) + str += fmt.Sprintf("H(%v):", h) + str += fmt.Sprintf("B?(%v) ", pool.requesters[h].block != nil) } } return str diff --git a/blockchain/reactor.go b/blockchain/reactor.go index f00df50c..d480eaca 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -201,7 +201,7 @@ func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) // Got a peer status. Unverified. bcR.pool.SetPeerHeight(src.ID(), msg.Height) default: - bcR.Logger.Error(cmn.Fmt("Unknown message type %v", reflect.TypeOf(msg))) + bcR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } } @@ -321,7 +321,7 @@ FOR_LOOP: state, err = bcR.blockExec.ApplyBlock(state, firstID, first) if err != nil { // TODO This is bad, are we zombie? - cmn.PanicQ(cmn.Fmt("Failed to process committed block (%d:%X): %v", + cmn.PanicQ(fmt.Sprintf("Failed to process committed block (%d:%X): %v", first.Height, first.Hash(), err)) } blocksSynced++ @@ -378,7 +378,7 @@ type bcBlockRequestMessage struct { } func (m *bcBlockRequestMessage) String() string { - return cmn.Fmt("[bcBlockRequestMessage %v]", m.Height) + return fmt.Sprintf("[bcBlockRequestMessage %v]", m.Height) } type bcNoBlockResponseMessage struct { @@ -386,7 +386,7 @@ type bcNoBlockResponseMessage struct { } func (brm *bcNoBlockResponseMessage) String() string { - return cmn.Fmt("[bcNoBlockResponseMessage %d]", brm.Height) + return fmt.Sprintf("[bcNoBlockResponseMessage %d]", brm.Height) } //------------------------------------- @@ -396,7 +396,7 @@ type bcBlockResponseMessage struct { } func (m *bcBlockResponseMessage) String() string { - return cmn.Fmt("[bcBlockResponseMessage %v]", m.Block.Height) + return fmt.Sprintf("[bcBlockResponseMessage %v]", m.Block.Height) } //------------------------------------- @@ -406,7 +406,7 @@ type bcStatusRequestMessage struct { } func (m *bcStatusRequestMessage) String() string { - return cmn.Fmt("[bcStatusRequestMessage %v]", m.Height) + return fmt.Sprintf("[bcStatusRequestMessage %v]", m.Height) } //------------------------------------- @@ -416,5 +416,5 @@ type bcStatusResponseMessage struct { } func (m *bcStatusResponseMessage) String() string { - return cmn.Fmt("[bcStatusResponseMessage %v]", m.Height) + return fmt.Sprintf("[bcStatusResponseMessage %v]", m.Height) } diff --git a/blockchain/store.go b/blockchain/store.go index f02d4fac..fa9ee518 100644 --- a/blockchain/store.go +++ b/blockchain/store.go @@ -148,10 +148,10 @@ func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, s } height := block.Height if g, w := height, bs.Height()+1; g != w { - cmn.PanicSanity(cmn.Fmt("BlockStore can only save contiguous blocks. Wanted %v, got %v", w, g)) + cmn.PanicSanity(fmt.Sprintf("BlockStore can only save contiguous blocks. Wanted %v, got %v", w, g)) } if !blockParts.IsComplete() { - cmn.PanicSanity(cmn.Fmt("BlockStore can only save complete block part sets")) + cmn.PanicSanity(fmt.Sprintf("BlockStore can only save complete block part sets")) } // Save block meta @@ -188,7 +188,7 @@ func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, s func (bs *BlockStore) saveBlockPart(height int64, index int, part *types.Part) { if height != bs.Height()+1 { - cmn.PanicSanity(cmn.Fmt("BlockStore can only save contiguous blocks. Wanted %v, got %v", bs.Height()+1, height)) + cmn.PanicSanity(fmt.Sprintf("BlockStore can only save contiguous blocks. Wanted %v, got %v", bs.Height()+1, height)) } partBytes := cdc.MustMarshalBinaryBare(part) bs.db.Set(calcBlockPartKey(height, index), partBytes) @@ -224,7 +224,7 @@ type BlockStoreStateJSON struct { func (bsj BlockStoreStateJSON) Save(db dbm.DB) { bytes, err := cdc.MarshalJSON(bsj) if err != nil { - cmn.PanicSanity(cmn.Fmt("Could not marshal state bytes: %v", err)) + cmn.PanicSanity(fmt.Sprintf("Could not marshal state bytes: %v", err)) } db.SetSync(blockStoreKey, bytes) } diff --git a/cmd/tendermint/commands/gen_node_key.go b/cmd/tendermint/commands/gen_node_key.go index 7aedcd0d..38dc5c66 100644 --- a/cmd/tendermint/commands/gen_node_key.go +++ b/cmd/tendermint/commands/gen_node_key.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/tendermint/tendermint/p2p" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/p2p" ) // GenNodeKeyCmd allows the generation of a node key. It prints node's ID to diff --git a/cmd/tendermint/commands/init.go b/cmd/tendermint/commands/init.go index a44c73eb..d39a27da 100644 --- a/cmd/tendermint/commands/init.go +++ b/cmd/tendermint/commands/init.go @@ -1,15 +1,16 @@ package commands import ( + "fmt" "time" "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) // InitFilesCmd initialises a fresh Tendermint Core instance. @@ -52,7 +53,7 @@ func initFilesWithConfig(config *cfg.Config) error { logger.Info("Found genesis file", "path", genFile) } else { genDoc := types.GenesisDoc{ - ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)), + ChainID: fmt.Sprintf("test-chain-%v", cmn.RandStr(6)), GenesisTime: time.Now(), ConsensusParams: types.DefaultConsensusParams(), } diff --git a/cmd/tendermint/commands/reset_priv_validator.go b/cmd/tendermint/commands/reset_priv_validator.go index ef0ba301..53d34712 100644 --- a/cmd/tendermint/commands/reset_priv_validator.go +++ b/cmd/tendermint/commands/reset_priv_validator.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/privval" ) // ResetAllCmd removes the database of this Tendermint core diff --git a/cmd/tendermint/commands/testnet.go b/cmd/tendermint/commands/testnet.go index f7639fb2..69fbe1f6 100644 --- a/cmd/tendermint/commands/testnet.go +++ b/cmd/tendermint/commands/testnet.go @@ -11,10 +11,10 @@ import ( "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) var ( @@ -76,7 +76,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error { genVals := make([]types.GenesisValidator, nValidators) for i := 0; i < nValidators; i++ { - nodeDirName := cmn.Fmt("%s%d", nodeDirPrefix, i) + nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) nodeDir := filepath.Join(outputDir, nodeDirName) config.SetRoot(nodeDir) @@ -98,7 +98,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error { } for i := 0; i < nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i+nValidators)) + nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i+nValidators)) config.SetRoot(nodeDir) err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm) @@ -119,7 +119,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error { // Write genesis file. for i := 0; i < nValidators+nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i)) + nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i)) if err := genDoc.SaveAs(filepath.Join(nodeDir, config.BaseConfig.Genesis)); err != nil { _ = os.RemoveAll(outputDir) return err @@ -159,7 +159,7 @@ func hostnameOrIP(i int) string { func populatePersistentPeersInConfigAndWriteIt(config *cfg.Config) error { persistentPeers := make([]string, nValidators+nNonValidators) for i := 0; i < nValidators+nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i)) + nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i)) config.SetRoot(nodeDir) nodeKey, err := p2p.LoadNodeKey(config.NodeKeyFile()) if err != nil { @@ -170,7 +170,7 @@ func populatePersistentPeersInConfigAndWriteIt(config *cfg.Config) error { persistentPeersList := strings.Join(persistentPeers, ",") for i := 0; i < nValidators+nNonValidators; i++ { - nodeDir := filepath.Join(outputDir, cmn.Fmt("%s%d", nodeDirPrefix, i)) + nodeDir := filepath.Join(outputDir, fmt.Sprintf("%s%d", nodeDirPrefix, i)) config.SetRoot(nodeDir) config.P2P.PersistentPeers = persistentPeersList config.P2P.AddrBookStrict = false diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 5360a92c..0aba7743 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -2,14 +2,15 @@ package consensus import ( "context" + "fmt" "sync" "testing" "time" "github.com/stretchr/testify/require" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) func init() { @@ -156,8 +157,8 @@ func TestByzantine(t *testing.T) { case <-done: case <-tick.C: for i, reactor := range reactors { - t.Log(cmn.Fmt("Consensus Reactor %v", i)) - t.Log(cmn.Fmt("%v", reactor)) + t.Log(fmt.Sprintf("Consensus Reactor %v", i)) + t.Log(fmt.Sprintf("%v", reactor)) } t.Fatalf("Timed out waiting for all validators to commit first block") } diff --git a/consensus/common_test.go b/consensus/common_test.go index f4855992..81894618 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -348,7 +348,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou for i := 0; i < nValidators; i++ { stateDB := dbm.NewMemDB() // each state needs its own db state, _ := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc) - thisConfig := ResetConfig(cmn.Fmt("%s_%d", testName, i)) + thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) for _, opt := range configOpts { opt(thisConfig) } @@ -372,7 +372,7 @@ func randConsensusNetWithPeers(nValidators, nPeers int, testName string, tickerF for i := 0; i < nPeers; i++ { stateDB := dbm.NewMemDB() // each state needs its own db state, _ := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc) - thisConfig := ResetConfig(cmn.Fmt("%s_%d", testName, i)) + thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal var privVal types.PrivValidator if i < nValidators { diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index a811de73..c905f50b 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -10,7 +10,6 @@ import ( "github.com/tendermint/tendermint/abci/example/code" abci "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/types" ) @@ -89,7 +88,7 @@ func deliverTxsRange(cs *ConsensusState, start, end int) { binary.BigEndian.PutUint64(txBytes, uint64(i)) err := cs.mempool.CheckTx(txBytes, nil) if err != nil { - panic(cmn.Fmt("Error after CheckTx: %v", err)) + panic(fmt.Sprintf("Error after CheckTx: %v", err)) } } } @@ -126,7 +125,7 @@ func TestMempoolRmBadTx(t *testing.T) { binary.BigEndian.PutUint64(txBytes, uint64(0)) resDeliver := app.DeliverTx(txBytes) - assert.False(t, resDeliver.IsErr(), cmn.Fmt("expected no error. got %v", resDeliver)) + assert.False(t, resDeliver.IsErr(), fmt.Sprintf("expected no error. got %v", resDeliver)) resCommit := app.Commit() assert.True(t, len(resCommit.Data) > 0) @@ -190,7 +189,7 @@ func NewCounterApplication() *CounterApplication { } func (app *CounterApplication) Info(req abci.RequestInfo) abci.ResponseInfo { - return abci.ResponseInfo{Data: cmn.Fmt("txs:%v", app.txCount)} + return abci.ResponseInfo{Data: fmt.Sprintf("txs:%v", app.txCount)} } func (app *CounterApplication) DeliverTx(tx []byte) abci.ResponseDeliverTx { diff --git a/consensus/reactor.go b/consensus/reactor.go index 58ff42ae..88557185 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -241,7 +241,7 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) "height", hb.Height, "round", hb.Round, "sequence", hb.Sequence, "valIdx", hb.ValidatorIndex, "valAddr", hb.ValidatorAddress) default: - conR.Logger.Error(cmn.Fmt("Unknown message type %v", reflect.TypeOf(msg))) + conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case DataChannel: @@ -262,7 +262,7 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) } conR.conS.peerMsgQueue <- msgInfo{msg, src.ID()} default: - conR.Logger.Error(cmn.Fmt("Unknown message type %v", reflect.TypeOf(msg))) + conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case VoteChannel: @@ -287,7 +287,7 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) default: // don't punish (leave room for soft upgrades) - conR.Logger.Error(cmn.Fmt("Unknown message type %v", reflect.TypeOf(msg))) + conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case VoteSetBitsChannel: @@ -319,11 +319,11 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) } default: // don't punish (leave room for soft upgrades) - conR.Logger.Error(cmn.Fmt("Unknown message type %v", reflect.TypeOf(msg))) + conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } default: - conR.Logger.Error(cmn.Fmt("Unknown chId %X", chID)) + conR.Logger.Error(fmt.Sprintf("Unknown chId %X", chID)) } if err != nil { @@ -482,7 +482,7 @@ OUTER_LOOP: if prs.ProposalBlockParts == nil { blockMeta := conR.conS.blockStore.LoadBlockMeta(prs.Height) if blockMeta == nil { - cmn.PanicCrisis(cmn.Fmt("Failed to load block %d when blockStore is at %d", + cmn.PanicCrisis(fmt.Sprintf("Failed to load block %d when blockStore is at %d", prs.Height, conR.conS.blockStore.Height())) } ps.InitProposalBlockParts(blockMeta.BlockID.PartsHeader) @@ -1034,7 +1034,7 @@ func (ps *PeerState) ensureCatchupCommitRound(height int64, round int, numValida NOTE: This is wrong, 'round' could change. e.g. if orig round is not the same as block LastCommit round. if ps.CatchupCommitRound != -1 && ps.CatchupCommitRound != round { - cmn.PanicSanity(cmn.Fmt("Conflicting CatchupCommitRound. Height: %v, Orig: %v, New: %v", height, ps.CatchupCommitRound, round)) + cmn.PanicSanity(fmt.Sprintf("Conflicting CatchupCommitRound. Height: %v, Orig: %v, New: %v", height, ps.CatchupCommitRound, round)) } */ if ps.PRS.CatchupCommitRound == round { @@ -1138,7 +1138,7 @@ func (ps *PeerState) SetHasVote(vote *types.Vote) { } func (ps *PeerState) setHasVote(height int64, round int, type_ byte, index int) { - logger := ps.logger.With("peerH/R", cmn.Fmt("%d/%d", ps.PRS.Height, ps.PRS.Round), "H/R", cmn.Fmt("%d/%d", height, round)) + logger := ps.logger.With("peerH/R", fmt.Sprintf("%d/%d", ps.PRS.Height, ps.PRS.Round), "H/R", fmt.Sprintf("%d/%d", height, round)) logger.Debug("setHasVote", "type", type_, "index", index) // NOTE: some may be nil BitArrays -> no side effects. diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index a3d284d9..35502fb1 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -115,7 +115,7 @@ func TestReactorWithEvidence(t *testing.T) { for i := 0; i < nValidators; i++ { stateDB := dbm.NewMemDB() // each state needs its own db state, _ := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc) - thisConfig := ResetConfig(cmn.Fmt("%s_%d", testName, i)) + thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() vals := types.TM2PB.Validators(state.Validators) diff --git a/consensus/replay.go b/consensus/replay.go index 25859a76..cff8344b 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -304,11 +304,11 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight } else if storeBlockHeight < stateBlockHeight { // the state should never be ahead of the store (this is under tendermint's control) - cmn.PanicSanity(cmn.Fmt("StateBlockHeight (%d) > StoreBlockHeight (%d)", stateBlockHeight, storeBlockHeight)) + cmn.PanicSanity(fmt.Sprintf("StateBlockHeight (%d) > StoreBlockHeight (%d)", stateBlockHeight, storeBlockHeight)) } else if storeBlockHeight > stateBlockHeight+1 { // store should be at most one ahead of the state (this is under tendermint's control) - cmn.PanicSanity(cmn.Fmt("StoreBlockHeight (%d) > StateBlockHeight + 1 (%d)", storeBlockHeight, stateBlockHeight+1)) + cmn.PanicSanity(fmt.Sprintf("StoreBlockHeight (%d) > StateBlockHeight + 1 (%d)", storeBlockHeight, stateBlockHeight+1)) } var err error diff --git a/consensus/replay_file.go b/consensus/replay_file.go index 0c0b0dcb..e4b9f019 100644 --- a/consensus/replay_file.go +++ b/consensus/replay_file.go @@ -13,12 +13,12 @@ import ( bc "github.com/tendermint/tendermint/blockchain" cfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/proxy" - sm "github.com/tendermint/tendermint/state" - "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/proxy" + sm "github.com/tendermint/tendermint/state" + "github.com/tendermint/tendermint/types" ) const ( @@ -34,7 +34,7 @@ func RunReplayFile(config cfg.BaseConfig, csConfig *cfg.ConsensusConfig, console consensusState := newConsensusStateForReplay(config, csConfig) if err := consensusState.ReplayFile(csConfig.WalFile(), console); err != nil { - cmn.Exit(cmn.Fmt("Error during consensus replay: %v", err)) + cmn.Exit(fmt.Sprintf("Error during consensus replay: %v", err)) } } @@ -302,12 +302,12 @@ func newConsensusStateForReplay(config cfg.BaseConfig, csConfig *cfg.ConsensusCo NewHandshaker(stateDB, state, blockStore, gdoc)) err = proxyApp.Start() if err != nil { - cmn.Exit(cmn.Fmt("Error starting proxy app conns: %v", err)) + cmn.Exit(fmt.Sprintf("Error starting proxy app conns: %v", err)) } eventBus := types.NewEventBus() if err := eventBus.Start(); err != nil { - cmn.Exit(cmn.Fmt("Failed to start event bus: %v", err)) + cmn.Exit(fmt.Sprintf("Failed to start event bus: %v", err)) } mempool, evpool := sm.MockMempool{}, sm.MockEvidencePool{} diff --git a/consensus/replay_test.go b/consensus/replay_test.go index fa0ec040..c74a1ae9 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -3,7 +3,6 @@ package consensus import ( "bytes" "context" - "errors" "fmt" "io" "io/ioutil" @@ -20,15 +19,14 @@ import ( abci "github.com/tendermint/tendermint/abci/types" crypto "github.com/tendermint/tendermint/crypto" auto "github.com/tendermint/tendermint/libs/autofile" - cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" cfg "github.com/tendermint/tendermint/config" + "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/proxy" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" - "github.com/tendermint/tendermint/libs/log" ) var consensusReplayConfig *cfg.Config @@ -494,7 +492,7 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) { return nil, nil, err } if !found { - return nil, nil, errors.New(cmn.Fmt("WAL does not contain height %d.", 1)) + return nil, nil, fmt.Errorf("WAL does not contain height %d.", 1) } defer gr.Close() // nolint: errcheck @@ -531,11 +529,11 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) { panic(err) } if block.Height != height+1 { - panic(cmn.Fmt("read bad block from wal. got height %d, expected %d", block.Height, height+1)) + panic(fmt.Sprintf("read bad block from wal. got height %d, expected %d", block.Height, height+1)) } commitHeight := thisBlockCommit.Precommits[0].Height if commitHeight != height+1 { - panic(cmn.Fmt("commit doesnt match. got height %d, expected %d", commitHeight, height+1)) + panic(fmt.Sprintf("commit doesnt match. got height %d, expected %d", commitHeight, height+1)) } blocks = append(blocks, block) commits = append(commits, thisBlockCommit) @@ -564,11 +562,11 @@ func makeBlockchainFromWAL(wal WAL) ([]*types.Block, []*types.Commit, error) { panic(err) } if block.Height != height+1 { - panic(cmn.Fmt("read bad block from wal. got height %d, expected %d", block.Height, height+1)) + panic(fmt.Sprintf("read bad block from wal. got height %d, expected %d", block.Height, height+1)) } commitHeight := thisBlockCommit.Precommits[0].Height if commitHeight != height+1 { - panic(cmn.Fmt("commit doesnt match. got height %d, expected %d", commitHeight, height+1)) + panic(fmt.Sprintf("commit doesnt match. got height %d, expected %d", commitHeight, height+1)) } blocks = append(blocks, block) commits = append(commits, thisBlockCommit) diff --git a/consensus/state.go b/consensus/state.go index a5ade13c..debe94da 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -186,7 +186,7 @@ func WithMetrics(metrics *Metrics) CSOption { // String returns a string. func (cs *ConsensusState) String() string { // better not to access shared variables - return cmn.Fmt("ConsensusState") //(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step) + return fmt.Sprintf("ConsensusState") //(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step) } // GetState returns a copy of the chain state. @@ -459,7 +459,7 @@ func (cs *ConsensusState) reconstructLastCommit(state sm.State) { } added, err := lastPrecommits.AddVote(precommit) if !added || err != nil { - cmn.PanicCrisis(cmn.Fmt("Failed to reconstruct LastCommit: %v", err)) + cmn.PanicCrisis(fmt.Sprintf("Failed to reconstruct LastCommit: %v", err)) } } if !lastPrecommits.HasTwoThirdsMajority() { @@ -472,13 +472,13 @@ func (cs *ConsensusState) reconstructLastCommit(state sm.State) { // The round becomes 0 and cs.Step becomes cstypes.RoundStepNewHeight. func (cs *ConsensusState) updateToState(state sm.State) { if cs.CommitRound > -1 && 0 < cs.Height && cs.Height != state.LastBlockHeight { - cmn.PanicSanity(cmn.Fmt("updateToState() expected state height of %v but found %v", + cmn.PanicSanity(fmt.Sprintf("updateToState() expected state height of %v but found %v", cs.Height, state.LastBlockHeight)) } if !cs.state.IsEmpty() && cs.state.LastBlockHeight+1 != cs.Height { // This might happen when someone else is mutating cs.state. // Someone forgot to pass in state.Copy() somewhere?! - cmn.PanicSanity(cmn.Fmt("Inconsistent cs.state.LastBlockHeight+1 %v vs cs.Height %v", + cmn.PanicSanity(fmt.Sprintf("Inconsistent cs.state.LastBlockHeight+1 %v vs cs.Height %v", cs.state.LastBlockHeight+1, cs.Height)) } @@ -698,7 +698,7 @@ func (cs *ConsensusState) handleTimeout(ti timeoutInfo, rs cstypes.RoundState) { cs.eventBus.PublishEventTimeoutWait(cs.RoundStateEvent()) cs.enterNewRound(ti.Height, ti.Round+1) default: - panic(cmn.Fmt("Invalid timeout step: %v", ti.Step)) + panic(fmt.Sprintf("Invalid timeout step: %v", ti.Step)) } } @@ -724,7 +724,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { logger := cs.Logger.With("height", height, "round", round) if cs.Height != height || round < cs.Round || (cs.Round == round && cs.Step != cstypes.RoundStepNewHeight) { - logger.Debug(cmn.Fmt("enterNewRound(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterNewRound(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } @@ -732,7 +732,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { logger.Info("Need to set a buffer and log message here for sanity.", "startTime", cs.StartTime, "now", now) } - logger.Info(cmn.Fmt("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterNewRound(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) // Increment validators if necessary validators := cs.Validators @@ -819,10 +819,10 @@ func (cs *ConsensusState) enterPropose(height int64, round int) { logger := cs.Logger.With("height", height, "round", round) if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPropose <= cs.Step) { - logger.Debug(cmn.Fmt("enterPropose(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterPropose(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - logger.Info(cmn.Fmt("enterPropose(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterPropose(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { // Done enterPropose: @@ -902,7 +902,7 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) { cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""}) } cs.Logger.Info("Signed proposal", "height", height, "round", round, "proposal", proposal) - cs.Logger.Debug(cmn.Fmt("Signed proposal block: %v", block)) + cs.Logger.Debug(fmt.Sprintf("Signed proposal block: %v", block)) } else { if !cs.replayMode { cs.Logger.Error("enterPropose: Error signing proposal", "height", height, "round", round, "err", err) @@ -961,7 +961,7 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts // Otherwise vote nil. func (cs *ConsensusState) enterPrevote(height int64, round int) { if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevote <= cs.Step) { - cs.Logger.Debug(cmn.Fmt("enterPrevote(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + cs.Logger.Debug(fmt.Sprintf("enterPrevote(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } @@ -979,7 +979,7 @@ func (cs *ConsensusState) enterPrevote(height int64, round int) { // TODO: catchup event? } - cs.Logger.Info(cmn.Fmt("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + cs.Logger.Info(fmt.Sprintf("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) // Sign and broadcast vote as necessary cs.doPrevote(height, round) @@ -1025,13 +1025,13 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) { logger := cs.Logger.With("height", height, "round", round) if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrevoteWait <= cs.Step) { - logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } if !cs.Votes.Prevotes(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) + cmn.PanicSanity(fmt.Sprintf("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round)) } - logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { // Done enterPrevoteWait: @@ -1053,11 +1053,11 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { logger := cs.Logger.With("height", height, "round", round) if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommit <= cs.Step) { - logger.Debug(cmn.Fmt("enterPrecommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterPrecommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } - logger.Info(cmn.Fmt("enterPrecommit(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterPrecommit(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { // Done enterPrecommit: @@ -1085,7 +1085,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { // the latest POLRound should be this round. polRound, _ := cs.Votes.POLInfo() if polRound < round { - cmn.PanicSanity(cmn.Fmt("This POLRound should be %v but got %", round, polRound)) + cmn.PanicSanity(fmt.Sprintf("This POLRound should be %v but got %v", round, polRound)) } // +2/3 prevoted nil. Unlock and precommit nil. @@ -1119,7 +1119,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { logger.Info("enterPrecommit: +2/3 prevoted proposal block. Locking", "hash", blockID.Hash) // Validate the block. if err := cs.blockExec.ValidateBlock(cs.state, cs.ProposalBlock); err != nil { - cmn.PanicConsensus(cmn.Fmt("enterPrecommit: +2/3 prevoted for an invalid block: %v", err)) + cmn.PanicConsensus(fmt.Sprintf("enterPrecommit: +2/3 prevoted for an invalid block: %v", err)) } cs.LockedRound = round cs.LockedBlock = cs.ProposalBlock @@ -1149,13 +1149,13 @@ func (cs *ConsensusState) enterPrecommitWait(height int64, round int) { logger := cs.Logger.With("height", height, "round", round) if cs.Height != height || round < cs.Round || (cs.Round == round && cstypes.RoundStepPrecommitWait <= cs.Step) { - logger.Debug(cmn.Fmt("enterPrecommitWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterPrecommitWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) return } if !cs.Votes.Precommits(round).HasTwoThirdsAny() { - cmn.PanicSanity(cmn.Fmt("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round)) + cmn.PanicSanity(fmt.Sprintf("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round)) } - logger.Info(cmn.Fmt("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) defer func() { // Done enterPrecommitWait: @@ -1173,10 +1173,10 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) { logger := cs.Logger.With("height", height, "commitRound", commitRound) if cs.Height != height || cstypes.RoundStepCommit <= cs.Step { - logger.Debug(cmn.Fmt("enterCommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) + logger.Debug(fmt.Sprintf("enterCommit(%v/%v): Invalid args. Current step: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) return } - logger.Info(cmn.Fmt("enterCommit(%v/%v). Current: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) + logger.Info(fmt.Sprintf("enterCommit(%v/%v). Current: %v/%v/%v", height, commitRound, cs.Height, cs.Round, cs.Step)) defer func() { // Done enterCommit: @@ -1223,7 +1223,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int64) { logger := cs.Logger.With("height", height) if cs.Height != height { - cmn.PanicSanity(cmn.Fmt("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height)) + cmn.PanicSanity(fmt.Sprintf("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height)) } blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority() @@ -1245,7 +1245,7 @@ func (cs *ConsensusState) tryFinalizeCommit(height int64) { // Increment height and goto cstypes.RoundStepNewHeight func (cs *ConsensusState) finalizeCommit(height int64) { if cs.Height != height || cs.Step != cstypes.RoundStepCommit { - cs.Logger.Debug(cmn.Fmt("finalizeCommit(%v): Invalid args. Current step: %v/%v/%v", height, cs.Height, cs.Round, cs.Step)) + cs.Logger.Debug(fmt.Sprintf("finalizeCommit(%v): Invalid args. Current step: %v/%v/%v", height, cs.Height, cs.Round, cs.Step)) return } @@ -1253,21 +1253,21 @@ func (cs *ConsensusState) finalizeCommit(height int64) { block, blockParts := cs.ProposalBlock, cs.ProposalBlockParts if !ok { - cmn.PanicSanity(cmn.Fmt("Cannot finalizeCommit, commit does not have two thirds majority")) + cmn.PanicSanity(fmt.Sprintf("Cannot finalizeCommit, commit does not have two thirds majority")) } if !blockParts.HasHeader(blockID.PartsHeader) { - cmn.PanicSanity(cmn.Fmt("Expected ProposalBlockParts header to be commit header")) + cmn.PanicSanity(fmt.Sprintf("Expected ProposalBlockParts header to be commit header")) } if !block.HashesTo(blockID.Hash) { - cmn.PanicSanity(cmn.Fmt("Cannot finalizeCommit, ProposalBlock does not hash to commit hash")) + cmn.PanicSanity(fmt.Sprintf("Cannot finalizeCommit, ProposalBlock does not hash to commit hash")) } if err := cs.blockExec.ValidateBlock(cs.state, block); err != nil { - cmn.PanicConsensus(cmn.Fmt("+2/3 committed an invalid block: %v", err)) + cmn.PanicConsensus(fmt.Sprintf("+2/3 committed an invalid block: %v", err)) } - cs.Logger.Info(cmn.Fmt("Finalizing commit of block with %d txs", block.NumTxs), + cs.Logger.Info(fmt.Sprintf("Finalizing commit of block with %d txs", block.NumTxs), "height", block.Height, "hash", block.Hash(), "root", block.AppHash) - cs.Logger.Info(cmn.Fmt("%v", block)) + cs.Logger.Info(fmt.Sprintf("%v", block)) fail.Fail() // XXX @@ -1519,7 +1519,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, return added, err } - cs.Logger.Info(cmn.Fmt("Added to lastPrecommits: %v", cs.LastCommit.StringShort())) + cs.Logger.Info(fmt.Sprintf("Added to lastPrecommits: %v", cs.LastCommit.StringShort())) cs.eventBus.PublishEventVote(types.EventDataVote{vote}) cs.evsw.FireEvent(types.EventVote, vote) @@ -1635,7 +1635,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, cs.enterPrecommitWait(height, vote.Round) } default: - panic(cmn.Fmt("Unexpected vote type %X", vote.Type)) // go-wire should prevent this. + panic(fmt.Sprintf("Unexpected vote type %X", vote.Type)) // go-wire should prevent this. } return diff --git a/consensus/state_test.go b/consensus/state_test.go index d943be87..14cd0593 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -8,7 +8,6 @@ import ( "time" cstypes "github.com/tendermint/tendermint/consensus/types" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" tmpubsub "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/types" @@ -84,7 +83,7 @@ func TestStateProposerSelection0(t *testing.T) { prop = cs1.GetRoundState().Validators.GetProposer() if !bytes.Equal(prop.Address, vss[1].GetAddress()) { - panic(cmn.Fmt("expected proposer to be validator %d. Got %X", 1, prop.Address)) + panic(fmt.Sprintf("expected proposer to be validator %d. Got %X", 1, prop.Address)) } } @@ -106,7 +105,7 @@ func TestStateProposerSelection2(t *testing.T) { prop := cs1.GetRoundState().Validators.GetProposer() correctProposer := vss[(i+2)%len(vss)].GetAddress() if !bytes.Equal(prop.Address, correctProposer) { - panic(cmn.Fmt("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) + panic(fmt.Sprintf("expected RoundState.Validators.GetProposer() to be validator %d. Got %X", (i+2)%len(vss), prop.Address)) } rs := cs1.GetRoundState() @@ -445,7 +444,7 @@ func TestStateLockNoPOL(t *testing.T) { // now we're on a new round and are the proposer if !bytes.Equal(rs.ProposalBlock.Hash(), rs.LockedBlock.Hash()) { - panic(cmn.Fmt("Expected proposal block to be locked block. Got %v, Expected %v", rs.ProposalBlock, rs.LockedBlock)) + panic(fmt.Sprintf("Expected proposal block to be locked block. Got %v, Expected %v", rs.ProposalBlock, rs.LockedBlock)) } <-voteCh // prevote diff --git a/consensus/types/height_vote_set.go b/consensus/types/height_vote_set.go index 70a38668..1c8ac67c 100644 --- a/consensus/types/height_vote_set.go +++ b/consensus/types/height_vote_set.go @@ -6,9 +6,9 @@ import ( "strings" "sync" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) type RoundVoteSet struct { @@ -169,7 +169,7 @@ func (hvs *HeightVoteSet) getVoteSet(round int, type_ byte) *types.VoteSet { case types.VoteTypePrecommit: return rvs.Precommits default: - cmn.PanicSanity(cmn.Fmt("Unexpected vote type %X", type_)) + cmn.PanicSanity(fmt.Sprintf("Unexpected vote type %X", type_)) return nil } } @@ -219,7 +219,7 @@ func (hvs *HeightVoteSet) StringIndented(indent string) string { voteSetString = roundVoteSet.Precommits.StringShort() vsStrings = append(vsStrings, voteSetString) } - return cmn.Fmt(`HeightVoteSet{H:%v R:0~%v + return fmt.Sprintf(`HeightVoteSet{H:%v R:0~%v %s %v %s}`, hvs.height, hvs.round, diff --git a/consensus/types/height_vote_set_test.go b/consensus/types/height_vote_set_test.go index 0de65600..77b5bfcb 100644 --- a/consensus/types/height_vote_set_test.go +++ b/consensus/types/height_vote_set_test.go @@ -1,12 +1,12 @@ package types import ( + "fmt" "testing" "time" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) var config *cfg.Config // NOTE: must be reset for each _test.go file @@ -62,7 +62,7 @@ func makeVoteHR(t *testing.T, height int64, round int, privVals []types.PrivVali chainID := config.ChainID() err := privVal.SignVote(chainID, vote) if err != nil { - panic(cmn.Fmt("Error signing vote: %v", err)) + panic(fmt.Sprintf("Error signing vote: %v", err)) return nil } return vote diff --git a/consensus/types/peer_round_state.go b/consensus/types/peer_round_state.go index 7a5d69b8..e42395bc 100644 --- a/consensus/types/peer_round_state.go +++ b/consensus/types/peer_round_state.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/types" ) //----------------------------------------------------------------------------- diff --git a/consensus/types/round_state.go b/consensus/types/round_state.go index cca560cc..c22880c2 100644 --- a/consensus/types/round_state.go +++ b/consensus/types/round_state.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/types" ) //----------------------------------------------------------------------------- diff --git a/consensus/version.go b/consensus/version.go index 5c74a16d..c04d2ac7 100644 --- a/consensus/version.go +++ b/consensus/version.go @@ -1,8 +1,6 @@ package consensus -import ( - cmn "github.com/tendermint/tendermint/libs/common" -) +import "fmt" // kind of arbitrary var Spec = "1" // async @@ -10,4 +8,4 @@ var Major = "0" // var Minor = "2" // replay refactor var Revision = "2" // validation -> commit -var Version = cmn.Fmt("v%s/%s.%s.%s", Spec, Major, Minor, Revision) +var Version = fmt.Sprintf("v%s/%s.%s.%s", Spec, Major, Minor, Revision) diff --git a/consensus/wal.go b/consensus/wal.go index 8c4c10bc..5c22bb93 100644 --- a/consensus/wal.go +++ b/consensus/wal.go @@ -11,9 +11,9 @@ import ( "github.com/pkg/errors" amino "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/types" auto "github.com/tendermint/tendermint/libs/autofile" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/types" ) const ( @@ -120,7 +120,7 @@ func (wal *baseWAL) Write(msg WALMessage) { // Write the wal message if err := wal.enc.Encode(&TimedWALMessage{time.Now(), msg}); err != nil { - panic(cmn.Fmt("Error writing msg to consensus wal: %v \n\nMessage: %v", err, msg)) + panic(fmt.Sprintf("Error writing msg to consensus wal: %v \n\nMessage: %v", err, msg)) } } @@ -134,7 +134,7 @@ func (wal *baseWAL) WriteSync(msg WALMessage) { wal.Write(msg) if err := wal.group.Flush(); err != nil { - panic(cmn.Fmt("Error flushing consensus wal buf to file. Error: %v \n", err)) + panic(fmt.Sprintf("Error flushing consensus wal buf to file. Error: %v \n", err)) } } diff --git a/consensus/wal_generator.go b/consensus/wal_generator.go index f3a36580..6d889aa6 100644 --- a/consensus/wal_generator.go +++ b/consensus/wal_generator.go @@ -13,14 +13,14 @@ import ( "github.com/tendermint/tendermint/abci/example/kvstore" bc "github.com/tendermint/tendermint/blockchain" cfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/privval" - "github.com/tendermint/tendermint/proxy" - sm "github.com/tendermint/tendermint/state" - "github.com/tendermint/tendermint/types" auto "github.com/tendermint/tendermint/libs/autofile" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/privval" + "github.com/tendermint/tendermint/proxy" + sm "github.com/tendermint/tendermint/state" + "github.com/tendermint/tendermint/types" ) // WALWithNBlocks generates a consensus WAL. It does this by spining up a diff --git a/consensus/wal_test.go b/consensus/wal_test.go index 3ecb4fe8..9a101bb7 100644 --- a/consensus/wal_test.go +++ b/consensus/wal_test.go @@ -3,13 +3,13 @@ package consensus import ( "bytes" "crypto/rand" + "fmt" // "sync" "testing" "time" "github.com/tendermint/tendermint/consensus/types" tmtypes "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -54,8 +54,8 @@ func TestWALSearchForEndHeight(t *testing.T) { h := int64(3) gr, found, err := wal.SearchForEndHeight(h, &WALSearchOptions{}) - assert.NoError(t, err, cmn.Fmt("expected not to err on height %d", h)) - assert.True(t, found, cmn.Fmt("expected to find end height for %d", h)) + assert.NoError(t, err, fmt.Sprintf("expected not to err on height %d", h)) + assert.True(t, found, fmt.Sprintf("expected to find end height for %d", h)) assert.NotNil(t, gr, "expected group not to be nil") defer gr.Close() @@ -64,7 +64,7 @@ func TestWALSearchForEndHeight(t *testing.T) { assert.NoError(t, err, "expected to decode a message") rs, ok := msg.Msg.(tmtypes.EventDataRoundState) assert.True(t, ok, "expected message of type EventDataRoundState") - assert.Equal(t, rs.Height, h+1, cmn.Fmt("wrong height")) + assert.Equal(t, rs.Height, h+1, fmt.Sprintf("wrong height")) } /* diff --git a/crypto/merkle/simple_tree_test.go b/crypto/merkle/simple_tree_test.go index 488e0c90..e2dccd3b 100644 --- a/crypto/merkle/simple_tree_test.go +++ b/crypto/merkle/simple_tree_test.go @@ -6,8 +6,9 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" . "github.com/tendermint/tendermint/libs/test" - "github.com/tendermint/tendermint/crypto/tmhash" "testing" + + "github.com/tendermint/tendermint/crypto/tmhash" ) type testItem []byte diff --git a/crypto/xsalsa20symmetric/symmetric.go b/crypto/xsalsa20symmetric/symmetric.go index d2369675..aa33ee14 100644 --- a/crypto/xsalsa20symmetric/symmetric.go +++ b/crypto/xsalsa20symmetric/symmetric.go @@ -2,6 +2,7 @@ package xsalsa20symmetric import ( "errors" + "fmt" "github.com/tendermint/tendermint/crypto" cmn "github.com/tendermint/tendermint/libs/common" @@ -18,7 +19,7 @@ const secretLen = 32 // NOTE: call crypto.MixEntropy() first. func EncryptSymmetric(plaintext []byte, secret []byte) (ciphertext []byte) { if len(secret) != secretLen { - cmn.PanicSanity(cmn.Fmt("Secret must be 32 bytes long, got len %v", len(secret))) + cmn.PanicSanity(fmt.Sprintf("Secret must be 32 bytes long, got len %v", len(secret))) } nonce := crypto.CRandBytes(nonceLen) nonceArr := [nonceLen]byte{} @@ -35,7 +36,7 @@ func EncryptSymmetric(plaintext []byte, secret []byte) (ciphertext []byte) { // The ciphertext is (secretbox.Overhead + 24) bytes longer than the plaintext. func DecryptSymmetric(ciphertext []byte, secret []byte) (plaintext []byte, err error) { if len(secret) != secretLen { - cmn.PanicSanity(cmn.Fmt("Secret must be 32 bytes long, got len %v", len(secret))) + cmn.PanicSanity(fmt.Sprintf("Secret must be 32 bytes long, got len %v", len(secret))) } if len(ciphertext) <= secretbox.Overhead+nonceLen { return nil, errors.New("Ciphertext is too short") diff --git a/docs/app-dev/app-development.md b/docs/app-dev/app-development.md index d3f22362..6c2ae9ab 100644 --- a/docs/app-dev/app-development.md +++ b/docs/app-dev/app-development.md @@ -502,7 +502,7 @@ In go: ``` func (app *KVStoreApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo) { - return types.ResponseInfo{Data: cmn.Fmt("{\"size\":%v}", app.state.Size())} + return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} } ``` diff --git a/evidence/pool_test.go b/evidence/pool_test.go index 7c9f2c21..a38be0ab 100644 --- a/evidence/pool_test.go +++ b/evidence/pool_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" + dbm "github.com/tendermint/tendermint/libs/db" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tendermint/libs/db" ) var mockState = sm.State{} diff --git a/evidence/store.go b/evidence/store.go index 20b37bdb..ba2e0afd 100644 --- a/evidence/store.go +++ b/evidence/store.go @@ -3,8 +3,8 @@ package evidence import ( "fmt" - "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tendermint/libs/db" + "github.com/tendermint/tendermint/types" ) /* diff --git a/evidence/store_test.go b/evidence/store_test.go index 30dc1c4d..1eb5b7f6 100644 --- a/evidence/store_test.go +++ b/evidence/store_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tendermint/libs/db" + "github.com/tendermint/tendermint/types" ) //------------------------------------------- diff --git a/libs/autofile/group.go b/libs/autofile/group.go index e747f04d..4e35d68d 100644 --- a/libs/autofile/group.go +++ b/libs/autofile/group.go @@ -724,11 +724,11 @@ func (gr *GroupReader) SetIndex(index int) error { func MakeSimpleSearchFunc(prefix string, target int) SearchFunc { return func(line string) (int, error) { if !strings.HasPrefix(line, prefix) { - return -1, errors.New(cmn.Fmt("Marker line did not have prefix: %v", prefix)) + return -1, fmt.Errorf("Marker line did not have prefix: %v", prefix) } i, err := strconv.Atoi(line[len(prefix):]) if err != nil { - return -1, errors.New(cmn.Fmt("Failed to parse marker line: %v", err.Error())) + return -1, fmt.Errorf("Failed to parse marker line: %v", err.Error()) } if target < i { return 1, nil diff --git a/libs/common/bit_array_test.go b/libs/common/bit_array_test.go index c697ba5d..b1efd3f6 100644 --- a/libs/common/bit_array_test.go +++ b/libs/common/bit_array_test.go @@ -3,6 +3,7 @@ package common import ( "bytes" "encoding/json" + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -149,7 +150,7 @@ func TestBytes(t *testing.T) { bA.SetIndex(0, true) check := func(bA *BitArray, bz []byte) { if !bytes.Equal(bA.Bytes(), bz) { - panic(Fmt("Expected %X but got %X", bz, bA.Bytes())) + panic(fmt.Sprintf("Expected %X but got %X", bz, bA.Bytes())) } } check(bA, []byte{0x01}) diff --git a/libs/common/colors.go b/libs/common/colors.go index 049ce7a5..4837f97b 100644 --- a/libs/common/colors.go +++ b/libs/common/colors.go @@ -88,7 +88,7 @@ func ColoredBytes(data []byte, textColor, bytesColor func(...interface{}) string if 0x21 <= b && b < 0x7F { s += textColor(string(b)) } else { - s += bytesColor(Fmt("%02X", b)) + s += bytesColor(fmt.Sprintf("%02X", b)) } } return s diff --git a/libs/common/errors.go b/libs/common/errors.go index 5c31b896..1dc909e8 100644 --- a/libs/common/errors.go +++ b/libs/common/errors.go @@ -10,13 +10,13 @@ import ( func ErrorWrap(cause interface{}, format string, args ...interface{}) Error { if causeCmnError, ok := cause.(*cmnError); ok { - msg := Fmt(format, args...) + msg := fmt.Sprintf(format, args...) return causeCmnError.Stacktrace().Trace(1, msg) } else if cause == nil { return newCmnError(FmtError{format, args}).Stacktrace() } else { // NOTE: causeCmnError is a typed nil here. - msg := Fmt(format, args...) + msg := fmt.Sprintf(format, args...) return newCmnError(cause).Stacktrace().Trace(1, msg) } } @@ -98,7 +98,7 @@ func (err *cmnError) Stacktrace() Error { // Add tracing information with msg. // Set n=0 unless wrapped with some function, then n > 0. func (err *cmnError) Trace(offset int, format string, args ...interface{}) Error { - msg := Fmt(format, args...) + msg := fmt.Sprintf(format, args...) return err.doTrace(msg, offset) } @@ -221,7 +221,7 @@ func (fe FmtError) Format() string { // and some guarantee is not satisfied. // XXX DEPRECATED func PanicSanity(v interface{}) { - panic(Fmt("Panicked on a Sanity Check: %v", v)) + panic(fmt.Sprintf("Panicked on a Sanity Check: %v", v)) } // A panic here means something has gone horribly wrong, in the form of data corruption or @@ -229,18 +229,18 @@ func PanicSanity(v interface{}) { // If they do, it's indicative of a much more serious problem. // XXX DEPRECATED func PanicCrisis(v interface{}) { - panic(Fmt("Panicked on a Crisis: %v", v)) + panic(fmt.Sprintf("Panicked on a Crisis: %v", v)) } // Indicates a failure of consensus. Someone was malicious or something has // gone horribly wrong. These should really boot us into an "emergency-recover" mode // XXX DEPRECATED func PanicConsensus(v interface{}) { - panic(Fmt("Panicked on a Consensus Failure: %v", v)) + panic(fmt.Sprintf("Panicked on a Consensus Failure: %v", v)) } // For those times when we're not sure if we should panic // XXX DEPRECATED func PanicQ(v interface{}) { - panic(Fmt("Panicked questionably: %v", v)) + panic(fmt.Sprintf("Panicked questionably: %v", v)) } diff --git a/libs/common/os.go b/libs/common/os.go index b8419764..501bb564 100644 --- a/libs/common/os.go +++ b/libs/common/os.go @@ -106,7 +106,7 @@ func ReadFile(filePath string) ([]byte, error) { func MustReadFile(filePath string) []byte { fileBytes, err := ioutil.ReadFile(filePath) if err != nil { - Exit(Fmt("MustReadFile failed: %v", err)) + Exit(fmt.Sprintf("MustReadFile failed: %v", err)) return nil } return fileBytes @@ -119,7 +119,7 @@ func WriteFile(filePath string, contents []byte, mode os.FileMode) error { func MustWriteFile(filePath string, contents []byte, mode os.FileMode) { err := WriteFile(filePath, contents, mode) if err != nil { - Exit(Fmt("MustWriteFile failed: %v", err)) + Exit(fmt.Sprintf("MustWriteFile failed: %v", err)) } } diff --git a/libs/common/random.go b/libs/common/random.go index 4b0594d0..2de65945 100644 --- a/libs/common/random.go +++ b/libs/common/random.go @@ -295,7 +295,7 @@ func (r *Rand) Perm(n int) []int { // NOTE: This relies on the os's random number generator. // For real security, we should salt that with some seed. -// See github.com/tendermint/go-crypto for a more secure reader. +// See github.com/tendermint/tendermint/crypto for a more secure reader. func cRandBytes(numBytes int) []byte { b := make([]byte, numBytes) _, err := crand.Read(b) diff --git a/libs/common/service.go b/libs/common/service.go index b6f166e7..03e39285 100644 --- a/libs/common/service.go +++ b/libs/common/service.go @@ -123,10 +123,10 @@ func (bs *BaseService) SetLogger(l log.Logger) { func (bs *BaseService) Start() error { if atomic.CompareAndSwapUint32(&bs.started, 0, 1) { if atomic.LoadUint32(&bs.stopped) == 1 { - bs.Logger.Error(Fmt("Not starting %v -- already stopped", bs.name), "impl", bs.impl) + bs.Logger.Error(fmt.Sprintf("Not starting %v -- already stopped", bs.name), "impl", bs.impl) return ErrAlreadyStopped } - bs.Logger.Info(Fmt("Starting %v", bs.name), "impl", bs.impl) + bs.Logger.Info(fmt.Sprintf("Starting %v", bs.name), "impl", bs.impl) err := bs.impl.OnStart() if err != nil { // revert flag @@ -135,7 +135,7 @@ func (bs *BaseService) Start() error { } return nil } - bs.Logger.Debug(Fmt("Not starting %v -- already started", bs.name), "impl", bs.impl) + bs.Logger.Debug(fmt.Sprintf("Not starting %v -- already started", bs.name), "impl", bs.impl) return ErrAlreadyStarted } @@ -148,12 +148,12 @@ func (bs *BaseService) OnStart() error { return nil } // channel. An error will be returned if the service is already stopped. func (bs *BaseService) Stop() error { if atomic.CompareAndSwapUint32(&bs.stopped, 0, 1) { - bs.Logger.Info(Fmt("Stopping %v", bs.name), "impl", bs.impl) + bs.Logger.Info(fmt.Sprintf("Stopping %v", bs.name), "impl", bs.impl) bs.impl.OnStop() close(bs.quit) return nil } - bs.Logger.Debug(Fmt("Stopping %v (ignoring: already stopped)", bs.name), "impl", bs.impl) + bs.Logger.Debug(fmt.Sprintf("Stopping %v (ignoring: already stopped)", bs.name), "impl", bs.impl) return ErrAlreadyStopped } @@ -166,7 +166,7 @@ func (bs *BaseService) OnStop() {} // will be returned if the service is running. func (bs *BaseService) Reset() error { if !atomic.CompareAndSwapUint32(&bs.stopped, 1, 0) { - bs.Logger.Debug(Fmt("Can't reset %v. Not stopped", bs.name), "impl", bs.impl) + bs.Logger.Debug(fmt.Sprintf("Can't reset %v. Not stopped", bs.name), "impl", bs.impl) return fmt.Errorf("can't reset running %s", bs.name) } diff --git a/libs/common/string.go b/libs/common/string.go index fac1be6c..e341b49e 100644 --- a/libs/common/string.go +++ b/libs/common/string.go @@ -6,14 +6,6 @@ import ( "strings" ) -// Like fmt.Sprintf, but skips formatting if args are empty. -var Fmt = func(format string, a ...interface{}) string { - if len(a) == 0 { - return format - } - return fmt.Sprintf(format, a...) -} - // IsHex returns true for non-empty hex-string prefixed with "0x" func IsHex(s string) bool { if len(s) > 2 && strings.EqualFold(s[:2], "0x") { diff --git a/libs/db/backend_test.go b/libs/db/backend_test.go index b31b4d74..496f4c41 100644 --- a/libs/db/backend_test.go +++ b/libs/db/backend_test.go @@ -54,7 +54,7 @@ func TestBackendsGetSetDelete(t *testing.T) { } func withDB(t *testing.T, creator dbCreator, fn func(DB)) { - name := cmn.Fmt("test_%x", cmn.RandStr(12)) + name := fmt.Sprintf("test_%x", cmn.RandStr(12)) db, err := creator(name, "") defer cleanupDBDir("", name) assert.Nil(t, err) @@ -143,7 +143,7 @@ func TestBackendsNilKeys(t *testing.T) { } func TestGoLevelDBBackend(t *testing.T) { - name := cmn.Fmt("test_%x", cmn.RandStr(12)) + name := fmt.Sprintf("test_%x", cmn.RandStr(12)) db := NewDB(name, GoLevelDBBackend, "") defer cleanupDBDir("", name) @@ -160,7 +160,7 @@ func TestDBIterator(t *testing.T) { } func testDBIterator(t *testing.T, backend DBBackendType) { - name := cmn.Fmt("test_%x", cmn.RandStr(12)) + name := fmt.Sprintf("test_%x", cmn.RandStr(12)) db := NewDB(name, backend, "") defer cleanupDBDir("", name) diff --git a/libs/db/c_level_db_test.go b/libs/db/c_level_db_test.go index 2d30500d..d01a85e9 100644 --- a/libs/db/c_level_db_test.go +++ b/libs/db/c_level_db_test.go @@ -19,7 +19,7 @@ func BenchmarkRandomReadsWrites2(b *testing.B) { for i := 0; i < int(numItems); i++ { internal[int64(i)] = int64(0) } - db, err := NewCLevelDB(cmn.Fmt("test_%x", cmn.RandStr(12)), "") + db, err := NewCLevelDB(fmt.Sprintf("test_%x", cmn.RandStr(12)), "") if err != nil { b.Fatal(err.Error()) return @@ -87,7 +87,7 @@ func bytes2Int64(buf []byte) int64 { */ func TestCLevelDBBackend(t *testing.T) { - name := cmn.Fmt("test_%x", cmn.RandStr(12)) + name := fmt.Sprintf("test_%x", cmn.RandStr(12)) db := NewDB(name, LevelDBBackend, "") defer cleanupDBDir("", name) diff --git a/libs/db/go_level_db_test.go b/libs/db/go_level_db_test.go index 47be216a..e262fccd 100644 --- a/libs/db/go_level_db_test.go +++ b/libs/db/go_level_db_test.go @@ -17,7 +17,7 @@ func BenchmarkRandomReadsWrites(b *testing.B) { for i := 0; i < int(numItems); i++ { internal[int64(i)] = int64(0) } - db, err := NewGoLevelDB(cmn.Fmt("test_%x", cmn.RandStr(12)), "") + db, err := NewGoLevelDB(fmt.Sprintf("test_%x", cmn.RandStr(12)), "") if err != nil { b.Fatal(err.Error()) return diff --git a/lite/provider.go b/lite/provider.go index 59e36a67..97e06a06 100644 --- a/lite/provider.go +++ b/lite/provider.go @@ -1,8 +1,8 @@ package lite import ( - "github.com/tendermint/tendermint/types" log "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/types" ) // Provider provides information for the lite client to sync validators. diff --git a/lite/provider_test.go b/lite/provider_test.go index e5547022..94b467de 100644 --- a/lite/provider_test.go +++ b/lite/provider_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - lerr "github.com/tendermint/tendermint/lite/errors" - "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tendermint/libs/db" log "github.com/tendermint/tendermint/libs/log" + lerr "github.com/tendermint/tendermint/lite/errors" + "github.com/tendermint/tendermint/types" ) // missingProvider doesn't store anything, always a miss. diff --git a/lite/proxy/verifier.go b/lite/proxy/verifier.go index 6686def0..a93d30c7 100644 --- a/lite/proxy/verifier.go +++ b/lite/proxy/verifier.go @@ -1,11 +1,11 @@ package proxy import ( - "github.com/tendermint/tendermint/lite" - lclient "github.com/tendermint/tendermint/lite/client" cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" log "github.com/tendermint/tendermint/libs/log" + "github.com/tendermint/tendermint/lite" + lclient "github.com/tendermint/tendermint/lite/client" ) func NewVerifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger) (*lite.DynamicVerifier, error) { diff --git a/mempool/mempool.go b/mempool/mempool.go index 5acb6f0d..f03ca4e8 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -312,7 +312,7 @@ func (mem *Mempool) resCbRecheck(req *abci.Request, res *abci.Response) { case *abci.Response_CheckTx: memTx := mem.recheckCursor.Value.(*mempoolTx) if !bytes.Equal(req.GetCheckTx().Tx, memTx.tx) { - cmn.PanicSanity(cmn.Fmt("Unexpected tx response from proxy during recheck\n"+ + cmn.PanicSanity(fmt.Sprintf("Unexpected tx response from proxy during recheck\n"+ "Expected %X, got %X", r.CheckTx.Data, memTx.tx)) } if r.CheckTx.Code == abci.CodeTypeOK { diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index c0f66051..e276f11c 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -14,7 +14,6 @@ import ( "github.com/tendermint/tendermint/abci/example/counter" "github.com/tendermint/tendermint/abci/example/kvstore" abci "github.com/tendermint/tendermint/abci/types" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" cfg "github.com/tendermint/tendermint/config" @@ -151,7 +150,7 @@ func TestSerialReap(t *testing.T) { reapCheck := func(exp int) { txs := mempool.Reap(-1) - require.Equal(t, len(txs), exp, cmn.Fmt("Expected to reap %v txs but got %v", exp, len(txs))) + require.Equal(t, len(txs), exp, fmt.Sprintf("Expected to reap %v txs but got %v", exp, len(txs))) } updateRange := func(start, end int) { diff --git a/node/node.go b/node/node.go index 0c3396dc..ce0a22c9 100644 --- a/node/node.go +++ b/node/node.go @@ -327,7 +327,7 @@ func NewNode(config *cfg.Config, if config.FilterPeers { // NOTE: addr is ip:port sw.SetAddrFilter(func(addr net.Addr) error { - resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: cmn.Fmt("/p2p/filter/addr/%s", addr.String())}) + resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: fmt.Sprintf("/p2p/filter/addr/%s", addr.String())}) if err != nil { return err } @@ -337,7 +337,7 @@ func NewNode(config *cfg.Config, return nil }) sw.SetIDFilter(func(id p2p.ID) error { - resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: cmn.Fmt("/p2p/filter/id/%s", id)}) + resQuery, err := proxyApp.Query().QuerySync(abci.RequestQuery{Path: fmt.Sprintf("/p2p/filter/id/%s", id)}) if err != nil { return err } @@ -683,11 +683,11 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo { }, Moniker: n.config.Moniker, Other: []string{ - cmn.Fmt("amino_version=%v", amino.Version), - cmn.Fmt("p2p_version=%v", p2p.Version), - cmn.Fmt("consensus_version=%v", cs.Version), - cmn.Fmt("rpc_version=%v/%v", rpc.Version, rpccore.Version), - cmn.Fmt("tx_index=%v", txIndexerStatus), + fmt.Sprintf("amino_version=%v", amino.Version), + fmt.Sprintf("p2p_version=%v", p2p.Version), + fmt.Sprintf("consensus_version=%v", cs.Version), + fmt.Sprintf("rpc_version=%v/%v", rpc.Version, rpccore.Version), + fmt.Sprintf("tx_index=%v", txIndexerStatus), }, } @@ -696,7 +696,7 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo { } rpcListenAddr := n.config.RPC.ListenAddress - nodeInfo.Other = append(nodeInfo.Other, cmn.Fmt("rpc_addr=%v", rpcListenAddr)) + nodeInfo.Other = append(nodeInfo.Other, fmt.Sprintf("rpc_addr=%v", rpcListenAddr)) if !n.sw.IsListening() { return nodeInfo @@ -705,7 +705,7 @@ func (n *Node) makeNodeInfo(nodeID p2p.ID) p2p.NodeInfo { p2pListener := n.sw.Listeners()[0] p2pHost := p2pListener.ExternalAddressHost() p2pPort := p2pListener.ExternalAddress().Port - nodeInfo.ListenAddr = cmn.Fmt("%v:%v", p2pHost, p2pPort) + nodeInfo.ListenAddr = fmt.Sprintf("%v:%v", p2pHost, p2pPort) return nodeInfo } diff --git a/p2p/base_reactor.go b/p2p/base_reactor.go index da1296da..be65d2f1 100644 --- a/p2p/base_reactor.go +++ b/p2p/base_reactor.go @@ -1,8 +1,8 @@ package p2p import ( - "github.com/tendermint/tendermint/p2p/conn" cmn "github.com/tendermint/tendermint/libs/common" + "github.com/tendermint/tendermint/p2p/conn" ) type Reactor interface { diff --git a/p2p/conn/connection.go b/p2p/conn/connection.go index 9672e011..bb67eab3 100644 --- a/p2p/conn/connection.go +++ b/p2p/conn/connection.go @@ -257,7 +257,7 @@ func (c *MConnection) Send(chID byte, msgBytes []byte) bool { // Send message to channel. channel, ok := c.channelsIdx[chID] if !ok { - c.Logger.Error(cmn.Fmt("Cannot send bytes, unknown channel %X", chID)) + c.Logger.Error(fmt.Sprintf("Cannot send bytes, unknown channel %X", chID)) return false } @@ -286,7 +286,7 @@ func (c *MConnection) TrySend(chID byte, msgBytes []byte) bool { // Send message to channel. channel, ok := c.channelsIdx[chID] if !ok { - c.Logger.Error(cmn.Fmt("Cannot send bytes, unknown channel %X", chID)) + c.Logger.Error(fmt.Sprintf("Cannot send bytes, unknown channel %X", chID)) return false } @@ -311,7 +311,7 @@ func (c *MConnection) CanSend(chID byte) bool { channel, ok := c.channelsIdx[chID] if !ok { - c.Logger.Error(cmn.Fmt("Unknown channel %X", chID)) + c.Logger.Error(fmt.Sprintf("Unknown channel %X", chID)) return false } return channel.canSend() diff --git a/p2p/listener.go b/p2p/listener.go index d73b3cab..d0dd3f42 100644 --- a/p2p/listener.go +++ b/p2p/listener.go @@ -259,7 +259,7 @@ func isIpv6(ip net.IP) bool { func getNaiveExternalAddress(defaultToIPv4 bool, port int, settleForLocal bool, logger log.Logger) *NetAddress { addrs, err := net.InterfaceAddrs() if err != nil { - panic(cmn.Fmt("Could not fetch interface addresses: %v", err)) + panic(fmt.Sprintf("Could not fetch interface addresses: %v", err)) } for _, a := range addrs { diff --git a/p2p/netaddress.go b/p2p/netaddress.go index ebac8cc8..a42f0fdd 100644 --- a/p2p/netaddress.go +++ b/p2p/netaddress.go @@ -44,7 +44,7 @@ func NewNetAddress(id ID, addr net.Addr) *NetAddress { tcpAddr, ok := addr.(*net.TCPAddr) if !ok { if flag.Lookup("test.v") == nil { // normal run - cmn.PanicSanity(cmn.Fmt("Only TCPAddrs are supported. Got: %v", addr)) + cmn.PanicSanity(fmt.Sprintf("Only TCPAddrs are supported. Got: %v", addr)) } else { // in testing netAddr := NewNetAddressIPPort(net.IP("0.0.0.0"), 0) netAddr.ID = id diff --git a/p2p/peer.go b/p2p/peer.go index 4f59fef7..a5f0bbbd 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -425,7 +425,7 @@ func createMConnection( if reactor == nil { // Note that its ok to panic here as it's caught in the conn._recover, // which does onPeerError. - panic(cmn.Fmt("Unknown channel %X", chID)) + panic(fmt.Sprintf("Unknown channel %X", chID)) } reactor.Receive(chID, p, msgBytes) } diff --git a/p2p/peer_set_test.go b/p2p/peer_set_test.go index 4582ab64..a352cce0 100644 --- a/p2p/peer_set_test.go +++ b/p2p/peer_set_test.go @@ -1,6 +1,7 @@ package p2p import ( + "fmt" "net" "sync" "testing" @@ -21,7 +22,7 @@ func randPeer(ip net.IP) *peer { p := &peer{ nodeInfo: NodeInfo{ ID: nodeKey.ID(), - ListenAddr: cmn.Fmt("%v.%v.%v.%v:26656", cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256), + ListenAddr: fmt.Sprintf("%v.%v.%v.%v:26656", cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256), }, } diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index ad6e0c00..e0c0e0b9 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -7,6 +7,7 @@ package pex import ( "crypto/sha256" "encoding/binary" + "fmt" "math" "net" "sync" @@ -559,11 +560,11 @@ func (a *addrBook) addToNewBucket(ka *knownAddress, bucketIdx int) { func (a *addrBook) addToOldBucket(ka *knownAddress, bucketIdx int) bool { // Sanity check if ka.isNew() { - a.Logger.Error(cmn.Fmt("Cannot add new address to old bucket: %v", ka)) + a.Logger.Error(fmt.Sprintf("Cannot add new address to old bucket: %v", ka)) return false } if len(ka.Buckets) != 0 { - a.Logger.Error(cmn.Fmt("Cannot add already old address to another old bucket: %v", ka)) + a.Logger.Error(fmt.Sprintf("Cannot add already old address to another old bucket: %v", ka)) return false } @@ -594,7 +595,7 @@ func (a *addrBook) addToOldBucket(ka *knownAddress, bucketIdx int) bool { func (a *addrBook) removeFromBucket(ka *knownAddress, bucketType byte, bucketIdx int) { if ka.BucketType != bucketType { - a.Logger.Error(cmn.Fmt("Bucket type mismatch: %v", ka)) + a.Logger.Error(fmt.Sprintf("Bucket type mismatch: %v", ka)) return } bucket := a.getBucket(bucketType, bucketIdx) @@ -690,7 +691,7 @@ func (a *addrBook) expireNew(bucketIdx int) { for addrStr, ka := range a.bucketsNew[bucketIdx] { // If an entry is bad, throw it away if ka.isBad() { - a.Logger.Info(cmn.Fmt("expiring bad address %v", addrStr)) + a.Logger.Info(fmt.Sprintf("expiring bad address %v", addrStr)) a.removeFromBucket(ka, bucketTypeNew, bucketIdx) return } @@ -707,11 +708,11 @@ func (a *addrBook) expireNew(bucketIdx int) { func (a *addrBook) moveToOld(ka *knownAddress) { // Sanity check if ka.isOld() { - a.Logger.Error(cmn.Fmt("Cannot promote address that is already old %v", ka)) + a.Logger.Error(fmt.Sprintf("Cannot promote address that is already old %v", ka)) return } if len(ka.Buckets) == 0 { - a.Logger.Error(cmn.Fmt("Cannot promote address that isn't in any new buckets %v", ka)) + a.Logger.Error(fmt.Sprintf("Cannot promote address that isn't in any new buckets %v", ka)) return } @@ -733,7 +734,7 @@ func (a *addrBook) moveToOld(ka *knownAddress) { // Finally, add our ka to old bucket again. added = a.addToOldBucket(ka, oldBucketIdx) if !added { - a.Logger.Error(cmn.Fmt("Could not re-add ka %v to oldBucketIdx %v", ka, oldBucketIdx)) + a.Logger.Error(fmt.Sprintf("Could not re-add ka %v to oldBucketIdx %v", ka, oldBucketIdx)) } } } diff --git a/p2p/pex/file.go b/p2p/pex/file.go index 3237e125..33fec033 100644 --- a/p2p/pex/file.go +++ b/p2p/pex/file.go @@ -2,6 +2,7 @@ package pex import ( "encoding/json" + "fmt" "os" cmn "github.com/tendermint/tendermint/libs/common" @@ -53,14 +54,14 @@ func (a *addrBook) loadFromFile(filePath string) bool { // Load addrBookJSON{} r, err := os.Open(filePath) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error opening file %s: %v", filePath, err)) + cmn.PanicCrisis(fmt.Sprintf("Error opening file %s: %v", filePath, err)) } defer r.Close() // nolint: errcheck aJSON := &addrBookJSON{} dec := json.NewDecoder(r) err = dec.Decode(aJSON) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading file %s: %v", filePath, err)) + cmn.PanicCrisis(fmt.Sprintf("Error reading file %s: %v", filePath, err)) } // Restore all the fields... diff --git a/p2p/test_util.go b/p2p/test_util.go index fdf9ae76..90bcba4f 100644 --- a/p2p/test_util.go +++ b/p2p/test_util.go @@ -35,7 +35,7 @@ func CreateRandomPeer(outbound bool) *peer { func CreateRoutableAddr() (addr string, netAddr *NetAddress) { for { var err error - addr = cmn.Fmt("%X@%v.%v.%v.%v:26656", cmn.RandBytes(20), cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256) + addr = fmt.Sprintf("%X@%v.%v.%v.%v:26656", cmn.RandBytes(20), cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256, cmn.RandInt()%256) netAddr, err = NewNetAddressString(addr) if err != nil { panic(err) @@ -142,7 +142,7 @@ func MakeSwitch(cfg *config.P2PConfig, i int, network, version string, initSwitc sw = initSwitch(i, sw) ni := NodeInfo{ ID: nodeKey.ID(), - Moniker: cmn.Fmt("switch%d", i), + Moniker: fmt.Sprintf("switch%d", i), Network: network, Version: version, ListenAddr: fmt.Sprintf("127.0.0.1:%d", cmn.RandIntn(64512)+1023), diff --git a/p2p/trust/store.go b/p2p/trust/store.go index 31f659a4..d6b4c049 100644 --- a/p2p/trust/store.go +++ b/p2p/trust/store.go @@ -5,6 +5,7 @@ package trust import ( "encoding/json" + "fmt" "sync" "time" @@ -155,7 +156,7 @@ func (tms *TrustMetricStore) loadFromDB() bool { peers := make(map[string]MetricHistoryJSON) err := json.Unmarshal(bytes, &peers) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Could not unmarshal Trust Metric Store DB data: %v", err)) + cmn.PanicCrisis(fmt.Sprintf("Could not unmarshal Trust Metric Store DB data: %v", err)) } // If history data exists in the file, diff --git a/p2p/upnp/probe.go b/p2p/upnp/probe.go index 2de5e790..16a53724 100644 --- a/p2p/upnp/probe.go +++ b/p2p/upnp/probe.go @@ -5,7 +5,6 @@ import ( "net" "time" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" ) @@ -19,19 +18,19 @@ func makeUPNPListener(intPort int, extPort int, logger log.Logger) (NAT, net.Lis if err != nil { return nil, nil, nil, fmt.Errorf("NAT upnp could not be discovered: %v", err) } - logger.Info(cmn.Fmt("ourIP: %v", nat.(*upnpNAT).ourIP)) + logger.Info(fmt.Sprintf("ourIP: %v", nat.(*upnpNAT).ourIP)) ext, err := nat.GetExternalAddress() if err != nil { return nat, nil, nil, fmt.Errorf("External address error: %v", err) } - logger.Info(cmn.Fmt("External address: %v", ext)) + logger.Info(fmt.Sprintf("External address: %v", ext)) port, err := nat.AddPortMapping("tcp", extPort, intPort, "Tendermint UPnP Probe", 0) if err != nil { return nat, nil, ext, fmt.Errorf("Port mapping error: %v", err) } - logger.Info(cmn.Fmt("Port mapping mapped: %v", port)) + logger.Info(fmt.Sprintf("Port mapping mapped: %v", port)) // also run the listener, open for all remote addresses. listener, err := net.Listen("tcp", fmt.Sprintf(":%v", intPort)) @@ -46,17 +45,17 @@ func testHairpin(listener net.Listener, extAddr string, logger log.Logger) (supp go func() { inConn, err := listener.Accept() if err != nil { - logger.Info(cmn.Fmt("Listener.Accept() error: %v", err)) + logger.Info(fmt.Sprintf("Listener.Accept() error: %v", err)) return } - logger.Info(cmn.Fmt("Accepted incoming connection: %v -> %v", inConn.LocalAddr(), inConn.RemoteAddr())) + logger.Info(fmt.Sprintf("Accepted incoming connection: %v -> %v", inConn.LocalAddr(), inConn.RemoteAddr())) buf := make([]byte, 1024) n, err := inConn.Read(buf) if err != nil { - logger.Info(cmn.Fmt("Incoming connection read error: %v", err)) + logger.Info(fmt.Sprintf("Incoming connection read error: %v", err)) return } - logger.Info(cmn.Fmt("Incoming connection read %v bytes: %X", n, buf)) + logger.Info(fmt.Sprintf("Incoming connection read %v bytes: %X", n, buf)) if string(buf) == "test data" { supportsHairpin = true return @@ -66,16 +65,16 @@ func testHairpin(listener net.Listener, extAddr string, logger log.Logger) (supp // Establish outgoing outConn, err := net.Dial("tcp", extAddr) if err != nil { - logger.Info(cmn.Fmt("Outgoing connection dial error: %v", err)) + logger.Info(fmt.Sprintf("Outgoing connection dial error: %v", err)) return } n, err := outConn.Write([]byte("test data")) if err != nil { - logger.Info(cmn.Fmt("Outgoing connection write error: %v", err)) + logger.Info(fmt.Sprintf("Outgoing connection write error: %v", err)) return } - logger.Info(cmn.Fmt("Outgoing connection wrote %v bytes", n)) + logger.Info(fmt.Sprintf("Outgoing connection wrote %v bytes", n)) // Wait for data receipt time.Sleep(1 * time.Second) @@ -96,10 +95,10 @@ func Probe(logger log.Logger) (caps UPNPCapabilities, err error) { // Deferred cleanup defer func() { if err := nat.DeletePortMapping("tcp", intPort, extPort); err != nil { - logger.Error(cmn.Fmt("Port mapping delete error: %v", err)) + logger.Error(fmt.Sprintf("Port mapping delete error: %v", err)) } if err := listener.Close(); err != nil { - logger.Error(cmn.Fmt("Listener closing error: %v", err)) + logger.Error(fmt.Sprintf("Listener closing error: %v", err)) } }() diff --git a/privval/priv_validator.go b/privval/priv_validator.go index a81751a9..83fbb7e4 100644 --- a/privval/priv_validator.go +++ b/privval/priv_validator.go @@ -89,7 +89,7 @@ func LoadFilePV(filePath string) *FilePV { pv := &FilePV{} err = cdc.UnmarshalJSON(pvJSONBytes, &pv) if err != nil { - cmn.Exit(cmn.Fmt("Error reading PrivValidator from %v: %v\n", filePath, err)) + cmn.Exit(fmt.Sprintf("Error reading PrivValidator from %v: %v\n", filePath, err)) } // overwrite pubkey and address for convenience @@ -153,7 +153,7 @@ func (pv *FilePV) SignVote(chainID string, vote *types.Vote) error { pv.mtx.Lock() defer pv.mtx.Unlock() if err := pv.signVote(chainID, vote); err != nil { - return errors.New(cmn.Fmt("Error signing vote: %v", err)) + return fmt.Errorf("Error signing vote: %v", err) } return nil } diff --git a/proxy/app_conn_test.go b/proxy/app_conn_test.go index 44936056..5eadb032 100644 --- a/proxy/app_conn_test.go +++ b/proxy/app_conn_test.go @@ -1,6 +1,7 @@ package proxy import ( + "fmt" "strings" "testing" @@ -45,7 +46,7 @@ func (app *appConnTest) InfoSync(req types.RequestInfo) (*types.ResponseInfo, er var SOCKET = "socket" func TestEcho(t *testing.T) { - sockPath := cmn.Fmt("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) + sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true) // Start server @@ -70,7 +71,7 @@ func TestEcho(t *testing.T) { t.Log("Connected") for i := 0; i < 1000; i++ { - proxy.EchoAsync(cmn.Fmt("echo-%v", i)) + proxy.EchoAsync(fmt.Sprintf("echo-%v", i)) } if err := proxy.FlushSync(); err != nil { t.Error(err) @@ -79,7 +80,7 @@ func TestEcho(t *testing.T) { func BenchmarkEcho(b *testing.B) { b.StopTimer() // Initialize - sockPath := cmn.Fmt("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) + sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true) // Start server @@ -118,7 +119,7 @@ func BenchmarkEcho(b *testing.B) { } func TestInfo(t *testing.T) { - sockPath := cmn.Fmt("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) + sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6)) clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true) // Start server diff --git a/rpc/client/event_test.go b/rpc/client/event_test.go index 79c452fc..da4625d5 100644 --- a/rpc/client/event_test.go +++ b/rpc/client/event_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) var waitForEventTimeout = 5 * time.Second diff --git a/rpc/client/httpclient.go b/rpc/client/httpclient.go index 4b85bf01..a9c64f5d 100644 --- a/rpc/client/httpclient.go +++ b/rpc/client/httpclient.go @@ -7,11 +7,11 @@ import ( "github.com/pkg/errors" amino "github.com/tendermint/go-amino" + cmn "github.com/tendermint/tendermint/libs/common" tmpubsub "github.com/tendermint/tendermint/libs/pubsub" ctypes "github.com/tendermint/tendermint/rpc/core/types" rpcclient "github.com/tendermint/tendermint/rpc/lib/client" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) /* diff --git a/rpc/client/interface.go b/rpc/client/interface.go index f939c855..f34410c5 100644 --- a/rpc/client/interface.go +++ b/rpc/client/interface.go @@ -21,9 +21,9 @@ implementation. */ import ( + cmn "github.com/tendermint/tendermint/libs/common" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) // ABCIClient groups together the functionality that principally diff --git a/rpc/client/mock/abci.go b/rpc/client/mock/abci.go index 4502c087..022e4f36 100644 --- a/rpc/client/mock/abci.go +++ b/rpc/client/mock/abci.go @@ -2,11 +2,11 @@ package mock import ( abci "github.com/tendermint/tendermint/abci/types" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/version" - cmn "github.com/tendermint/tendermint/libs/common" ) // ABCIApp will send all abci related request to the named app, diff --git a/rpc/client/mock/abci_test.go b/rpc/client/mock/abci_test.go index bcf443cf..327ec9e7 100644 --- a/rpc/client/mock/abci_test.go +++ b/rpc/client/mock/abci_test.go @@ -11,11 +11,11 @@ import ( "github.com/tendermint/tendermint/abci/example/kvstore" abci "github.com/tendermint/tendermint/abci/types" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/rpc/client/mock" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) func TestABCIMock(t *testing.T) { diff --git a/rpc/client/mock/client.go b/rpc/client/mock/client.go index 955df627..c5787849 100644 --- a/rpc/client/mock/client.go +++ b/rpc/client/mock/client.go @@ -16,11 +16,11 @@ package mock import ( "reflect" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/rpc/core" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) // Client wraps arbitrary implementations of the various interfaces. diff --git a/rpc/client/mock/status_test.go b/rpc/client/mock/status_test.go index 8e3c1506..fa64c6a8 100644 --- a/rpc/client/mock/status_test.go +++ b/rpc/client/mock/status_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/rpc/client/mock" ctypes "github.com/tendermint/tendermint/rpc/core/types" - cmn "github.com/tendermint/tendermint/libs/common" ) func TestStatus(t *testing.T) { diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index ecc41ce1..47776d3e 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -8,9 +8,9 @@ import ( "github.com/pkg/errors" abci "github.com/tendermint/tendermint/abci/types" + cmn "github.com/tendermint/tendermint/libs/common" ctypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/types" - cmn "github.com/tendermint/tendermint/libs/common" ) //----------------------------------------------------------------------------- diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index 0125ffae..9c162e9e 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -5,13 +5,13 @@ import ( "github.com/tendermint/tendermint/consensus" crypto "github.com/tendermint/tendermint/crypto" + dbm "github.com/tendermint/tendermint/libs/db" + "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/proxy" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/state/txindex" "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tendermint/libs/db" - "github.com/tendermint/tendermint/libs/log" ) const ( diff --git a/rpc/lib/client/ws_client.go b/rpc/lib/client/ws_client.go index 9a07c867..cff28522 100644 --- a/rpc/lib/client/ws_client.go +++ b/rpc/lib/client/ws_client.go @@ -14,8 +14,8 @@ import ( metrics "github.com/rcrowley/go-metrics" "github.com/tendermint/go-amino" - types "github.com/tendermint/tendermint/rpc/lib/types" cmn "github.com/tendermint/tendermint/libs/common" + types "github.com/tendermint/tendermint/rpc/lib/types" ) const ( diff --git a/rpc/lib/server/handlers_test.go b/rpc/lib/server/handlers_test.go index 3471eb79..6004959a 100644 --- a/rpc/lib/server/handlers_test.go +++ b/rpc/lib/server/handlers_test.go @@ -14,9 +14,9 @@ import ( "github.com/stretchr/testify/require" amino "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/libs/log" rs "github.com/tendermint/tendermint/rpc/lib/server" types "github.com/tendermint/tendermint/rpc/lib/types" - "github.com/tendermint/tendermint/libs/log" ) ////////////////////////////////////////////////////////////////////////////// diff --git a/rpc/lib/server/http_server.go b/rpc/lib/server/http_server.go index dd95d823..ff7173a1 100644 --- a/rpc/lib/server/http_server.go +++ b/rpc/lib/server/http_server.go @@ -14,8 +14,8 @@ import ( "github.com/pkg/errors" "golang.org/x/net/netutil" - types "github.com/tendermint/tendermint/rpc/lib/types" "github.com/tendermint/tendermint/libs/log" + types "github.com/tendermint/tendermint/rpc/lib/types" ) // Config is an RPC server configuration. diff --git a/rpc/lib/test/main.go b/rpc/lib/test/main.go index cb9560e1..544284b9 100644 --- a/rpc/lib/test/main.go +++ b/rpc/lib/test/main.go @@ -6,9 +6,9 @@ import ( "os" amino "github.com/tendermint/go-amino" - rpcserver "github.com/tendermint/tendermint/rpc/lib/server" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" + rpcserver "github.com/tendermint/tendermint/rpc/lib/server" ) var routes = map[string]*rpcserver.RPCFunc{ diff --git a/state/errors.go b/state/errors.go index d40c7e14..6010ed9b 100644 --- a/state/errors.go +++ b/state/errors.go @@ -1,8 +1,6 @@ package state -import ( - cmn "github.com/tendermint/tendermint/libs/common" -) +import "fmt" type ( ErrInvalidBlock error @@ -48,32 +46,32 @@ type ( ) func (e ErrUnknownBlock) Error() string { - return cmn.Fmt("Could not find block #%d", e.Height) + return fmt.Sprintf("Could not find block #%d", e.Height) } func (e ErrBlockHashMismatch) Error() string { - return cmn.Fmt("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height) + return fmt.Sprintf("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height) } func (e ErrAppBlockHeightTooHigh) Error() string { - return cmn.Fmt("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight) + return fmt.Sprintf("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight) } func (e ErrLastStateMismatch) Error() string { - return cmn.Fmt("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App) + return fmt.Sprintf("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App) } func (e ErrStateMismatch) Error() string { - return cmn.Fmt("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected) + return fmt.Sprintf("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected) } func (e ErrNoValSetForHeight) Error() string { - return cmn.Fmt("Could not find validator set for height #%d", e.Height) + return fmt.Sprintf("Could not find validator set for height #%d", e.Height) } func (e ErrNoConsensusParamsForHeight) Error() string { - return cmn.Fmt("Could not find consensus params for height #%d", e.Height) + return fmt.Sprintf("Could not find consensus params for height #%d", e.Height) } func (e ErrNoABCIResponsesForHeight) Error() string { - return cmn.Fmt("Could not find results for height #%d", e.Height) + return fmt.Sprintf("Could not find results for height #%d", e.Height) } diff --git a/state/state_test.go b/state/state_test.go index 93ae8ca9..211d5fdc 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -40,11 +40,11 @@ func TestStateCopy(t *testing.T) { stateCopy := state.Copy() assert.True(state.Equals(stateCopy), - cmn.Fmt("expected state and its copy to be identical.\ngot: %v\nexpected: %v\n", + fmt.Sprintf("expected state and its copy to be identical.\ngot: %v\nexpected: %v\n", stateCopy, state)) stateCopy.LastBlockHeight++ - assert.False(state.Equals(stateCopy), cmn.Fmt(`expected states to be different. got same + assert.False(state.Equals(stateCopy), fmt.Sprintf(`expected states to be different. got same %v`, state)) } @@ -60,7 +60,7 @@ func TestStateSaveLoad(t *testing.T) { loadedState := LoadState(stateDB) assert.True(state.Equals(loadedState), - cmn.Fmt("expected state and its copy to be identical.\ngot: %v\nexpected: %v\n", + fmt.Sprintf("expected state and its copy to be identical.\ngot: %v\nexpected: %v\n", loadedState, state)) } @@ -86,7 +86,7 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { loadedABCIResponses, err := LoadABCIResponses(stateDB, block.Height) assert.Nil(err) assert.Equal(abciResponses, loadedABCIResponses, - cmn.Fmt("ABCIResponses don't match:\ngot: %v\nexpected: %v\n", + fmt.Sprintf("ABCIResponses don't match:\ngot: %v\nexpected: %v\n", loadedABCIResponses, abciResponses)) } diff --git a/state/store.go b/state/store.go index ea10b27c..2f90c747 100644 --- a/state/store.go +++ b/state/store.go @@ -12,15 +12,15 @@ import ( //------------------------------------------------------------------------ func calcValidatorsKey(height int64) []byte { - return []byte(cmn.Fmt("validatorsKey:%v", height)) + return []byte(fmt.Sprintf("validatorsKey:%v", height)) } func calcConsensusParamsKey(height int64) []byte { - return []byte(cmn.Fmt("consensusParamsKey:%v", height)) + return []byte(fmt.Sprintf("consensusParamsKey:%v", height)) } func calcABCIResponsesKey(height int64) []byte { - return []byte(cmn.Fmt("abciResponsesKey:%v", height)) + return []byte(fmt.Sprintf("abciResponsesKey:%v", height)) } // LoadStateFromDBOrGenesisFile loads the most recent state from the database, @@ -71,7 +71,7 @@ func loadState(db dbm.DB, key []byte) (state State) { err := cdc.UnmarshalBinaryBare(buf, &state) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - cmn.Exit(cmn.Fmt(`LoadState: Data has been corrupted or its spec has changed: + cmn.Exit(fmt.Sprintf(`LoadState: Data has been corrupted or its spec has changed: %v\n`, err)) } // TODO: ensure that buf is completely read. @@ -144,7 +144,7 @@ func LoadABCIResponses(db dbm.DB, height int64) (*ABCIResponses, error) { err := cdc.UnmarshalBinaryBare(buf, abciResponses) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - cmn.Exit(cmn.Fmt(`LoadABCIResponses: Data has been corrupted or its spec has + cmn.Exit(fmt.Sprintf(`LoadABCIResponses: Data has been corrupted or its spec has changed: %v\n`, err)) } // TODO: ensure that buf is completely read. @@ -207,7 +207,7 @@ func loadValidatorsInfo(db dbm.DB, height int64) *ValidatorsInfo { err := cdc.UnmarshalBinaryBare(buf, v) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - cmn.Exit(cmn.Fmt(`LoadValidators: Data has been corrupted or its spec has changed: + cmn.Exit(fmt.Sprintf(`LoadValidators: Data has been corrupted or its spec has changed: %v\n`, err)) } // TODO: ensure that buf is completely read. @@ -278,7 +278,7 @@ func loadConsensusParamsInfo(db dbm.DB, height int64) *ConsensusParamsInfo { err := cdc.UnmarshalBinaryBare(buf, paramsInfo) if err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - cmn.Exit(cmn.Fmt(`LoadConsensusParams: Data has been corrupted or its spec has changed: + cmn.Exit(fmt.Sprintf(`LoadConsensusParams: Data has been corrupted or its spec has changed: %v\n`, err)) } // TODO: ensure that buf is completely read. diff --git a/state/validation.go b/state/validation.go index 4686d82b..5c88d97b 100644 --- a/state/validation.go +++ b/state/validation.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/tendermint/go-crypto/tmhash" + "github.com/tendermint/tendermint/crypto/tmhash" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/types" ) diff --git a/types/genesis.go b/types/genesis.go index 220ee0e0..c4f69980 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -2,6 +2,7 @@ package types import ( "encoding/json" + "fmt" "io/ioutil" "time" @@ -107,7 +108,7 @@ func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error) { } genDoc, err := GenesisDocFromJSON(jsonBlob) if err != nil { - return nil, cmn.ErrorWrap(err, cmn.Fmt("Error reading GenesisDoc at %v", genDocFile)) + return nil, cmn.ErrorWrap(err, fmt.Sprintf("Error reading GenesisDoc at %v", genDocFile)) } return genDoc, nil } diff --git a/types/proto3_test.go b/types/proto3_test.go index 50645abf..c9dfa35a 100644 --- a/types/proto3_test.go +++ b/types/proto3_test.go @@ -63,10 +63,10 @@ func TestProto3Compatibility(t *testing.T) { assert.Equal(t, ab, pb, "encoding doesn't match") emptyLastBlockPb := proto3.Header{ - ChainID: "cosmos", - Height: 150, - Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos}, - NumTxs: 7, + ChainID: "cosmos", + Height: 150, + Time: &proto3.Timestamp{Seconds: seconds, Nanos: nanos}, + NumTxs: 7, TotalTxs: 100, LastCommitHash: []byte("commit hash"), DataHash: []byte("data hash"), diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 8c1c39f1..caad5c8f 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -111,10 +111,10 @@ func TestABCIEvidence(t *testing.T) { type pubKeyEddie struct{} -func (pubKeyEddie) Address() Address { return []byte{} } -func (pubKeyEddie) Bytes() []byte { return []byte{} } +func (pubKeyEddie) Address() Address { return []byte{} } +func (pubKeyEddie) Bytes() []byte { return []byte{} } func (pubKeyEddie) VerifyBytes(msg []byte, sig []byte) bool { return false } -func (pubKeyEddie) Equals(crypto.PubKey) bool { return false } +func (pubKeyEddie) Equals(crypto.PubKey) bool { return false } func TestABCIValidatorFromPubKeyAndPower(t *testing.T) { pubkey := ed25519.GenPrivKey().PubKey() diff --git a/types/validator_set_test.go b/types/validator_set_test.go index ba5fefa2..ad9a2b00 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "fmt" "math" "strings" "testing" @@ -219,7 +220,7 @@ func TestProposerSelection3(t *testing.T) { got := vset.GetProposer().Address expected := proposerOrder[j%4].Address if !bytes.Equal(got, expected) { - t.Fatalf(cmn.Fmt("vset.Proposer (%X) does not match expected proposer (%X) for (%d, %d)", got, expected, i, j)) + t.Fatalf(fmt.Sprintf("vset.Proposer (%X) does not match expected proposer (%X) for (%d, %d)", got, expected, i, j)) } // serialize, deserialize, check proposer @@ -229,7 +230,7 @@ func TestProposerSelection3(t *testing.T) { computed := vset.GetProposer() // findGetProposer() if i != 0 { if !bytes.Equal(got, computed.Address) { - t.Fatalf(cmn.Fmt("vset.Proposer (%X) does not match computed proposer (%X) for (%d, %d)", got, computed.Address, i, j)) + t.Fatalf(fmt.Sprintf("vset.Proposer (%X) does not match computed proposer (%X) for (%d, %d)", got, computed.Address, i, j)) } } From 93aadf160fce95f243b21d0d2135a92ba29d1f7f Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 10 Aug 2018 09:33:02 +0400 Subject: [PATCH 051/149] add missing changelog entry Refs #1954 --- CHANGELOG_PENDING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 2939381b..32389de2 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -14,5 +14,7 @@ BREAKING CHANGES: FEATURES: IMPROVEMENTS: +- [scripts] Added json2wal tool, which is supposed to help our users restore + corrupted WAL files and compose test WAL files (@bradyjoestar) BUG FIXES: From 00db469fc05a183ab0af70dcfa128f26d9acd0d7 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Fri, 10 Aug 2018 13:14:43 -0500 Subject: [PATCH 052/149] (squash this) begin addressing PR comments --- crypto/multisig/multisignature.go | 3 +- crypto/multisig/threshold_multisig.go | 36 ++++++---- crypto/multisig/threshold_multisig_test.go | 77 +++++++++++++++------- 3 files changed, 79 insertions(+), 37 deletions(-) diff --git a/crypto/multisig/multisignature.go b/crypto/multisig/multisignature.go index bd2398b8..374b5e1b 100644 --- a/crypto/multisig/multisignature.go +++ b/crypto/multisig/multisignature.go @@ -31,6 +31,7 @@ func getIndex(pk crypto.PubKey, keys []crypto.PubKey) int { } // AddSignature adds a signature to the multisig, at the corresponding index. +// If the signature already exists, replace it. func (mSig *Multisignature) AddSignature(sig []byte, index int) { newSigIndex := mSig.BitArray.NumOfTrueBitsBefore(index) // Signature already exists, just replace the value there @@ -64,5 +65,5 @@ func (mSig *Multisignature) AddSignatureFromPubkey(sig []byte, pubkey crypto.Pub // Marshal the multisignature with amino func (mSig *Multisignature) Marshal() []byte { - return cdc.MustMarshalBinary(mSig) + return cdc.MustMarshalBinaryBare(mSig) } diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go index adc5fd12..934f7d79 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_multisig.go @@ -14,7 +14,11 @@ type ThresholdMultiSignaturePubKey struct { var _ crypto.PubKey = &ThresholdMultiSignaturePubKey{} // NewThresholdMultiSignaturePubKey returns a new ThresholdMultiSignaturePubKey. +// Panics if len(pubkeys) < k or 0 >= k. func NewThresholdMultiSignaturePubKey(k int, pubkeys []crypto.PubKey) crypto.PubKey { + if k <= 0 { + panic("threshold k of n multisignature: k <= 0") + } if len(pubkeys) < k { panic("threshold k of n multisignature: len(pubkeys) < k") } @@ -29,12 +33,21 @@ func NewThresholdMultiSignaturePubKey(k int, pubkeys []crypto.PubKey) crypto.Pub // a concern. func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig []byte) bool { var sig *Multisignature - err := cdc.UnmarshalBinary(marshalledSig, &sig) + err := cdc.UnmarshalBinaryBare(marshalledSig, &sig) if err != nil { return false } size := sig.BitArray.Size() - if len(sig.Sigs) < int(pk.K) || len(pk.Pubkeys) != size || sig.BitArray.NumOfTrueBitsBefore(size) < int(pk.K) { + // ensure bit array is the correct size + if len(pk.Pubkeys) != size { + return false + } + // ensure size of signature list + if len(sig.Sigs) < int(pk.K) || len(sig.Sigs) > size { + return false + } + // ensure at least k signatures are set + if sig.BitArray.NumOfTrueBitsBefore(size) < int(pk.K) { return false } // index in the list of signatures which we are concerned with. @@ -63,16 +76,17 @@ func (pk *ThresholdMultiSignaturePubKey) Address() crypto.Address { // Equals returns true iff pk and other both have the same number of keys, and // all constituent keys are the same, and in the same order. func (pk *ThresholdMultiSignaturePubKey) Equals(other crypto.PubKey) bool { - if otherKey, ok := other.(*ThresholdMultiSignaturePubKey); ok { - if pk.K != otherKey.K || len(pk.Pubkeys) != len(otherKey.Pubkeys) { + otherKey, sameType := other.(*ThresholdMultiSignaturePubKey) + if !sameType { + return false + } + if pk.K != otherKey.K || len(pk.Pubkeys) != len(otherKey.Pubkeys) { + return false + } + for i := 0; i < len(pk.Pubkeys); i++ { + if !pk.Pubkeys[i].Equals(otherKey.Pubkeys[i]) { return false } - for i := 0; i < len(pk.Pubkeys); i++ { - if !pk.Pubkeys[i].Equals(otherKey.Pubkeys[i]) { - return false - } - } - return true } - return false + return true } diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_multisig_test.go index cbd447a2..6036554a 100644 --- a/crypto/multisig/threshold_multisig_test.go +++ b/crypto/multisig/threshold_multisig_test.go @@ -11,34 +11,60 @@ import ( "github.com/tendermint/tendermint/crypto/secp256k1" ) -func TestThresholdMultisig(t *testing.T) { - msg := []byte{1, 2, 3, 4} - pubkeys, sigs := generatePubKeysAndSignatures(5, msg) - multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) - multisignature := NewMultisig(5) - require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) - require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - // Make sure adding the same signature twice doesn't increase number of signatures - multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) - require.Equal(t, 1, len(multisignature.Sigs)) +// This tests multisig functionality, but it expects the first k signatures to be valid +// TODO: Adapt it to give more flexibility about first k signatures being valid +func TestThresholdMultisigValidCases(t *testing.T) { + pkSet1, sigSet1 := generatePubKeysAndSignatures(5, []byte{1, 2, 3, 4}) + cases := []struct { + msg []byte + k int + pubkeys []crypto.PubKey + signingIndices []int + // signatures should be the same size as signingIndices. + signatures [][]byte + passAfterKSignatures []bool + }{ + { + msg: []byte{1, 2, 3, 4}, + k: 2, + pubkeys: pkSet1, + signingIndices: []int{0, 3, 1}, + signatures: sigSet1, + passAfterKSignatures: []bool{false}, + }, + } + for tcIndex, tc := range cases { + multisigKey := NewThresholdMultiSignaturePubKey(tc.k, tc.pubkeys) + multisignature := NewMultisig(len(tc.pubkeys)) + for i := 0; i < tc.k-1; i++ { + signingIndex := tc.signingIndices[i] + multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + require.False(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), + "multisig passed when i < k, tc %d, i %d", tcIndex, i) + multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + require.Equal(t, i+1, len(multisignature.Sigs), + "adding a signature for the same pubkey twice increased signature count by 2, tc %d", tcIndex) + } + require.False(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), + "multisig passed with k - 1 sigs, tc %d", tcIndex) + multisignature.AddSignatureFromPubkey(tc.signatures[tc.signingIndices[tc.k]], tc.pubkeys[tc.signingIndices[tc.k]], tc.pubkeys) + require.True(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), + "multisig failed after k good signatures, tc %d", tcIndex) + for i := tc.k + 1; i < len(tc.signingIndices); i++ { + signingIndex := tc.signingIndices[i] + multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + require.Equal(t, tc.passAfterKSignatures[i-tc.k-1], + multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), + "multisig didn't verify as expected after k sigs, tc %d, i %d", tcIndex, i) - // Adding two signatures should make it pass, as k = 2 - multisignature.AddSignatureFromPubkey(sigs[3], pubkeys[3], pubkeys) - require.True(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - - // Adding a third invalid signature should make verification fail. - multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[4], pubkeys) - require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - - // try adding the invalid signature one signature before - // first reset the multisig - multisignature.BitArray.SetIndex(4, false) - multisignature.Sigs = multisignature.Sigs[:2] - multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[2], pubkeys) - require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) + multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + require.Equal(t, i+1, len(multisignature.Sigs), + "adding a signature for the same pubkey twice increased signature count by 2, tc %d", tcIndex) + } + } } +// TODO: Fully replace this test with table driven tests func TestThresholdMultisigDuplicateSignatures(t *testing.T) { msg := []byte{1, 2, 3, 4, 5} pubkeys, sigs := generatePubKeysAndSignatures(5, msg) @@ -51,6 +77,7 @@ func TestThresholdMultisigDuplicateSignatures(t *testing.T) { require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) } +// TODO: Fully replace this test with table driven tests func TestMultiSigPubkeyEquality(t *testing.T) { msg := []byte{1, 2, 3, 4} pubkeys, _ := generatePubKeysAndSignatures(5, msg) From 4cf1dbd67626d45691057bcbe7e8b018b8925ceb Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Fri, 10 Aug 2018 13:20:59 -0500 Subject: [PATCH 053/149] (squash this) fix amino route --- crypto/multisig/wire.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/multisig/wire.go b/crypto/multisig/wire.go index e0cb2a59..a6cda34a 100644 --- a/crypto/multisig/wire.go +++ b/crypto/multisig/wire.go @@ -10,7 +10,7 @@ import ( // TODO: Figure out API for others to either add their own pubkey types, or // to make verify / marshal accept a cdc. const ( - ThresholdPubkeyAminoRoute = "tendermint/ThresholdMultisigPubkey" + ThresholdPubkeyAminoRoute = "tendermint/PubkeyThresholdMultisig" ) var cdc = amino.NewCodec() From 8d28344e84714ccac00f5876dae344b8d76e458b Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Fri, 10 Aug 2018 13:42:23 -0500 Subject: [PATCH 054/149] (Squash this) switch to bare --- crypto/multisig/threshold_multisig.go | 2 +- crypto/multisig/threshold_multisig_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go index 934f7d79..01462d6f 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_multisig.go @@ -65,7 +65,7 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ // Bytes returns the amino encoded version of the ThresholdMultiSignaturePubKey func (pk *ThresholdMultiSignaturePubKey) Bytes() []byte { - return cdc.MustMarshalBinary(pk) + return cdc.MustMarshalBinaryBare(pk) } // Address returns tmhash(ThresholdMultiSignaturePubKey.Bytes()) diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_multisig_test.go index 6036554a..2d2fdeec 100644 --- a/crypto/multisig/threshold_multisig_test.go +++ b/crypto/multisig/threshold_multisig_test.go @@ -83,7 +83,7 @@ func TestMultiSigPubkeyEquality(t *testing.T) { pubkeys, _ := generatePubKeysAndSignatures(5, msg) multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) var unmarshalledMultisig *ThresholdMultiSignaturePubKey - cdc.MustUnmarshalBinary(multisigKey.Bytes(), &unmarshalledMultisig) + cdc.MustUnmarshalBinaryBare(multisigKey.Bytes(), &unmarshalledMultisig) require.True(t, multisigKey.Equals(unmarshalledMultisig)) // Ensure that reordering pubkeys is treated as a different pubkey From 8a1a79257e8e8b309cd35bb1fe40bf9b3330fd7d Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 13 Aug 2018 03:42:33 -0700 Subject: [PATCH 055/149] mempool: Keep cache hashmap and linked list in sync (#2188) * mempool: Keep cache hashmap and linked list in sync This removes bugs with the linked list being full, but hashmap empty * address PR comments * switch clist back to list --- CHANGELOG_PENDING.md | 2 ++ mempool/mempool.go | 22 +++++++++++------- mempool/mempool_test.go | 51 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 32389de2..48b7db0b 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -18,3 +18,5 @@ IMPROVEMENTS: corrupted WAL files and compose test WAL files (@bradyjoestar) BUG FIXES: +- [mempool] No longer possible to fill up linked list without getting caching +benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) \ No newline at end of file diff --git a/mempool/mempool.go b/mempool/mempool.go index f03ca4e8..f336585b 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -488,7 +488,7 @@ type txCache interface { type mapTxCache struct { mtx sync.Mutex size int - map_ map[string]struct{} + map_ map[string]*list.Element list *list.List // to remove oldest tx when cache gets too big } @@ -498,7 +498,7 @@ var _ txCache = (*mapTxCache)(nil) func newMapTxCache(cacheSize int) *mapTxCache { return &mapTxCache{ size: cacheSize, - map_: make(map[string]struct{}, cacheSize), + map_: make(map[string]*list.Element, cacheSize), list: list.New(), } } @@ -506,7 +506,7 @@ func newMapTxCache(cacheSize int) *mapTxCache { // Reset resets the cache to an empty state. func (cache *mapTxCache) Reset() { cache.mtx.Lock() - cache.map_ = make(map[string]struct{}, cache.size) + cache.map_ = make(map[string]*list.Element, cache.size) cache.list.Init() cache.mtx.Unlock() } @@ -524,20 +524,26 @@ func (cache *mapTxCache) Push(tx types.Tx) bool { if cache.list.Len() >= cache.size { popped := cache.list.Front() poppedTx := popped.Value.(types.Tx) - // NOTE: the tx may have already been removed from the map - // but deleting a non-existent element is fine delete(cache.map_, string(poppedTx)) - cache.list.Remove(popped) + if popped != nil { + cache.list.Remove(popped) + } } - cache.map_[string(tx)] = struct{}{} cache.list.PushBack(tx) + cache.map_[string(tx)] = cache.list.Back() return true } // Remove removes the given tx from the cache. func (cache *mapTxCache) Remove(tx types.Tx) { cache.mtx.Lock() - delete(cache.map_, string(tx)) + stx := string(tx) + popped := cache.map_[stx] + delete(cache.map_, stx) + if popped != nil { + cache.list.Remove(popped) + } + cache.mtx.Unlock() } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index e276f11c..c29578ef 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -223,6 +223,28 @@ func TestSerialReap(t *testing.T) { reapCheck(600) } +func TestCacheRemove(t *testing.T) { + cache := newMapTxCache(100) + numTxs := 10 + txs := make([][]byte, numTxs) + for i := 0; i < numTxs; i++ { + // probability of collision is 2**-256 + txBytes := make([]byte, 32) + rand.Read(txBytes) + txs[i] = txBytes + cache.Push(txBytes) + // make sure its added to both the linked list and the map + require.Equal(t, i+1, len(cache.map_)) + require.Equal(t, i+1, cache.list.Len()) + } + for i := 0; i < numTxs; i++ { + cache.Remove(txs[i]) + // make sure its removed from both the map and the linked list + require.Equal(t, numTxs-(i+1), len(cache.map_)) + require.Equal(t, numTxs-(i+1), cache.list.Len()) + } +} + func TestMempoolCloseWAL(t *testing.T) { // 1. Create the temporary directory for mempool and WAL testing. rootDir, err := ioutil.TempDir("", "mempool-test") @@ -272,6 +294,35 @@ func TestMempoolCloseWAL(t *testing.T) { require.Equal(t, 1, len(m3), "expecting the wal match in") } +func BenchmarkCacheInsertTime(b *testing.B) { + cache := newMapTxCache(b.N) + txs := make([][]byte, b.N) + for i := 0; i < b.N; i++ { + txs[i] = make([]byte, 8) + binary.BigEndian.PutUint64(txs[i], uint64(i)) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + cache.Push(txs[i]) + } +} + +// This benchmark is probably skewed, since we actually will be removing +// txs in parallel, which may cause some overhead due to mutex locking. +func BenchmarkCacheRemoveTime(b *testing.B) { + cache := newMapTxCache(b.N) + txs := make([][]byte, b.N) + for i := 0; i < b.N; i++ { + txs[i] = make([]byte, 8) + binary.BigEndian.PutUint64(txs[i], uint64(i)) + cache.Push(txs[i]) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + cache.Remove(txs[i]) + } +} + func checksumIt(data []byte) string { h := md5.New() h.Write(data) From 3624a1764290acbedd18ed4c2ed267de40a40a07 Mon Sep 17 00:00:00 2001 From: peerlink <41910053+peerlink@users.noreply.github.com> Date: Mon, 13 Aug 2018 21:40:49 +0800 Subject: [PATCH 056/149] blockchain: fix register concrete name. (#2213) --- blockchain/reactor.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blockchain/reactor.go b/blockchain/reactor.go index d480eaca..f975737c 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -356,11 +356,11 @@ type BlockchainMessage interface{} func RegisterBlockchainMessages(cdc *amino.Codec) { cdc.RegisterInterface((*BlockchainMessage)(nil), nil) - cdc.RegisterConcrete(&bcBlockRequestMessage{}, "tendermint/mempool/BlockRequest", nil) - cdc.RegisterConcrete(&bcBlockResponseMessage{}, "tendermint/mempool/BlockResponse", nil) - cdc.RegisterConcrete(&bcNoBlockResponseMessage{}, "tendermint/mempool/NoBlockResponse", nil) - cdc.RegisterConcrete(&bcStatusResponseMessage{}, "tendermint/mempool/StatusResponse", nil) - cdc.RegisterConcrete(&bcStatusRequestMessage{}, "tendermint/mempool/StatusRequest", nil) + cdc.RegisterConcrete(&bcBlockRequestMessage{}, "tendermint/blockchain/BlockRequest", nil) + cdc.RegisterConcrete(&bcBlockResponseMessage{}, "tendermint/blockchain/BlockResponse", nil) + cdc.RegisterConcrete(&bcNoBlockResponseMessage{}, "tendermint/blockchain/NoBlockResponse", nil) + cdc.RegisterConcrete(&bcStatusResponseMessage{}, "tendermint/blockchain/StatusResponse", nil) + cdc.RegisterConcrete(&bcStatusRequestMessage{}, "tendermint/blockchain/StatusRequest", nil) } func decodeMsg(bz []byte) (msg BlockchainMessage, err error) { From 6beaf6e72dd2606c74d417334f2b502da8b27421 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 13 Aug 2018 18:46:33 -0700 Subject: [PATCH 057/149] (squash this) address Jae's comments on `NumTrueBitsBefore` --- crypto/multisig/compact_bit_array.go | 10 ++++------ crypto/multisig/multisignature.go | 2 +- crypto/multisig/threshold_multisig.go | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/compact_bit_array.go index be31a5c7..94e9791c 100644 --- a/crypto/multisig/compact_bit_array.go +++ b/crypto/multisig/compact_bit_array.go @@ -71,12 +71,10 @@ func (bA *CompactBitArray) SetIndex(i int, v bool) bool { return true } -// NumOfTrueBitsBefore returns the location of the given index, among the -// values in the bit array that are set to true. -// e.g. if bA = _XX_X_X, NumOfTrueBitsBefore(4) = 2, since -// the value at index 4 of the bit array is the third -// value that is true. (And it is 0-indexed) -func (bA *CompactBitArray) NumOfTrueBitsBefore(index int) int { +// NumTrueBitsBefore returns the number of bits set to true before the +// given index. e.g. if bA = _XX__XX, NumOfTrueBitsBefore(4) = 2, since +// there are two bits set to true before index 4. +func (bA *CompactBitArray) NumTrueBitsBefore(index int) int { numTrueValues := 0 for i := 0; i < index; i++ { if bA.GetIndex(i) { diff --git a/crypto/multisig/multisignature.go b/crypto/multisig/multisignature.go index 374b5e1b..29e8a30b 100644 --- a/crypto/multisig/multisignature.go +++ b/crypto/multisig/multisignature.go @@ -33,7 +33,7 @@ func getIndex(pk crypto.PubKey, keys []crypto.PubKey) int { // AddSignature adds a signature to the multisig, at the corresponding index. // If the signature already exists, replace it. func (mSig *Multisignature) AddSignature(sig []byte, index int) { - newSigIndex := mSig.BitArray.NumOfTrueBitsBefore(index) + newSigIndex := mSig.BitArray.NumTrueBitsBefore(index) // Signature already exists, just replace the value there if mSig.BitArray.GetIndex(index) { mSig.Sigs[newSigIndex] = sig diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_multisig.go index 01462d6f..58a3ea0e 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_multisig.go @@ -47,7 +47,7 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ return false } // ensure at least k signatures are set - if sig.BitArray.NumOfTrueBitsBefore(size) < int(pk.K) { + if sig.BitArray.NumTrueBitsBefore(size) < int(pk.K) { return false } // index in the list of signatures which we are concerned with. From ed08ae73214c13406f89200b6f7f24216820b3b5 Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Tue, 14 Aug 2018 22:57:48 +0800 Subject: [PATCH 058/149] [tm-monitor] use pubkey.Equals() func instead of raw `==` (#2221) --- tools/tm-monitor/monitor/node.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/tm-monitor/monitor/node.go b/tools/tm-monitor/monitor/node.go index b9987020..8bc15a15 100644 --- a/tools/tm-monitor/monitor/node.go +++ b/tools/tm-monitor/monitor/node.go @@ -217,8 +217,7 @@ func (n *Node) checkIsValidator() { if err == nil { for _, v := range validators { key, err1 := n.getPubKey() - // TODO: use bytes.Equal - if err1 == nil && v.PubKey == key { + if err1 == nil && v.PubKey.Equals(key) { n.IsValidator = true } } From d0dcb1cde12946ca86f2a851db0202e8f6fc29c2 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 14 Aug 2018 07:59:04 -0700 Subject: [PATCH 059/149] cmap: Remove defers (#2210) All functions in cmap have just one code path. Thus there is not a reason to use defer statements. --- libs/common/cmap.go | 22 ++++++++++++---------- libs/common/cmap_test.go | 11 +++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/libs/common/cmap.go b/libs/common/cmap.go index c65c27d4..2f7720d2 100644 --- a/libs/common/cmap.go +++ b/libs/common/cmap.go @@ -16,58 +16,60 @@ func NewCMap() *CMap { func (cm *CMap) Set(key string, value interface{}) { cm.l.Lock() - defer cm.l.Unlock() cm.m[key] = value + cm.l.Unlock() } func (cm *CMap) Get(key string) interface{} { cm.l.Lock() - defer cm.l.Unlock() - return cm.m[key] + val := cm.m[key] + cm.l.Unlock() + return val } func (cm *CMap) Has(key string) bool { cm.l.Lock() - defer cm.l.Unlock() _, ok := cm.m[key] + cm.l.Unlock() return ok } func (cm *CMap) Delete(key string) { cm.l.Lock() - defer cm.l.Unlock() delete(cm.m, key) + cm.l.Unlock() } func (cm *CMap) Size() int { cm.l.Lock() - defer cm.l.Unlock() - return len(cm.m) + size := len(cm.m) + cm.l.Unlock() + return size } func (cm *CMap) Clear() { cm.l.Lock() - defer cm.l.Unlock() cm.m = make(map[string]interface{}) + cm.l.Unlock() } func (cm *CMap) Keys() []string { cm.l.Lock() - defer cm.l.Unlock() keys := []string{} for k := range cm.m { keys = append(keys, k) } + cm.l.Unlock() return keys } func (cm *CMap) Values() []interface{} { cm.l.Lock() - defer cm.l.Unlock() items := []interface{}{} for _, v := range cm.m { items = append(items, v) } + cm.l.Unlock() return items } diff --git a/libs/common/cmap_test.go b/libs/common/cmap_test.go index c665a7f3..33d9f047 100644 --- a/libs/common/cmap_test.go +++ b/libs/common/cmap_test.go @@ -51,3 +51,14 @@ func TestContains(t *testing.T) { assert.False(t, cmap.Has("key2")) assert.Nil(t, cmap.Get("key2")) } + +func BenchmarkCMapHas(b *testing.B) { + m := NewCMap() + for i := 0; i < 1000; i++ { + m.Set(string(i), i) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + m.Has(string(i)) + } +} From 89668c3179ace50437cd848afa791140e4978349 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 14 Aug 2018 08:00:22 -0700 Subject: [PATCH 060/149] clist: Speedup functions (#2208) * clist: Speedup detachNext() and detachPrev() We used unnecessary function calls, defers, and extra mutexes. These are not our friends for writing fast code in our libs. * Remove more defers from clist functions * Add more benchmarks --- libs/clist/bench_test.go | 46 +++++++++++++++++++++++++++++ libs/clist/clist.go | 62 +++++++++++++++++++++------------------- 2 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 libs/clist/bench_test.go diff --git a/libs/clist/bench_test.go b/libs/clist/bench_test.go new file mode 100644 index 00000000..95973cc7 --- /dev/null +++ b/libs/clist/bench_test.go @@ -0,0 +1,46 @@ +package clist + +import "testing" + +func BenchmarkDetaching(b *testing.B) { + lst := New() + for i := 0; i < b.N+1; i++ { + lst.PushBack(i) + } + start := lst.Front() + nxt := start.Next() + b.ResetTimer() + for i := 0; i < b.N; i++ { + start.removed = true + start.DetachNext() + start.DetachPrev() + tmp := nxt + nxt = nxt.Next() + start = tmp + } +} + +// This is used to benchmark the time of RMutex. +func BenchmarkRemoved(b *testing.B) { + lst := New() + for i := 0; i < b.N+1; i++ { + lst.PushBack(i) + } + start := lst.Front() + nxt := start.Next() + b.ResetTimer() + for i := 0; i < b.N; i++ { + start.Removed() + tmp := nxt + nxt = nxt.Next() + start = tmp + } +} + +func BenchmarkPushBack(b *testing.B) { + lst := New() + b.ResetTimer() + for i := 0; i < b.N; i++ { + lst.PushBack(i) + } +} diff --git a/libs/clist/clist.go b/libs/clist/clist.go index ccb1f577..b3e66efc 100644 --- a/libs/clist/clist.go +++ b/libs/clist/clist.go @@ -115,43 +115,42 @@ func (e *CElement) Next() *CElement { // Nonblocking, may return nil if at the end. func (e *CElement) Prev() *CElement { e.mtx.RLock() - defer e.mtx.RUnlock() - - return e.prev + prev := e.prev + e.mtx.RUnlock() + return prev } func (e *CElement) Removed() bool { e.mtx.RLock() - defer e.mtx.RUnlock() - - return e.removed + isRemoved := e.removed + e.mtx.RUnlock() + return isRemoved } func (e *CElement) DetachNext() { - if !e.Removed() { + e.mtx.Lock() + if !e.removed { + e.mtx.Unlock() panic("DetachNext() must be called after Remove(e)") } - e.mtx.Lock() - defer e.mtx.Unlock() - e.next = nil + e.mtx.Unlock() } func (e *CElement) DetachPrev() { - if !e.Removed() { + e.mtx.Lock() + if !e.removed { + e.mtx.Unlock() panic("DetachPrev() must be called after Remove(e)") } - e.mtx.Lock() - defer e.mtx.Unlock() - e.prev = nil + e.mtx.Unlock() } // NOTE: This function needs to be safe for // concurrent goroutines waiting on nextWg. func (e *CElement) SetNext(newNext *CElement) { e.mtx.Lock() - defer e.mtx.Unlock() oldNext := e.next e.next = newNext @@ -168,13 +167,13 @@ func (e *CElement) SetNext(newNext *CElement) { e.nextWg.Done() close(e.nextWaitCh) } + e.mtx.Unlock() } // NOTE: This function needs to be safe for // concurrent goroutines waiting on prevWg func (e *CElement) SetPrev(newPrev *CElement) { e.mtx.Lock() - defer e.mtx.Unlock() oldPrev := e.prev e.prev = newPrev @@ -186,11 +185,11 @@ func (e *CElement) SetPrev(newPrev *CElement) { e.prevWg.Done() close(e.prevWaitCh) } + e.mtx.Unlock() } func (e *CElement) SetRemoved() { e.mtx.Lock() - defer e.mtx.Unlock() e.removed = true @@ -203,6 +202,7 @@ func (e *CElement) SetRemoved() { e.nextWg.Done() close(e.nextWaitCh) } + e.mtx.Unlock() } //-------------------------------------------------------------------------------- @@ -221,13 +221,13 @@ type CList struct { func (l *CList) Init() *CList { l.mtx.Lock() - defer l.mtx.Unlock() l.wg = waitGroup1() l.waitCh = make(chan struct{}) l.head = nil l.tail = nil l.len = 0 + l.mtx.Unlock() return l } @@ -235,16 +235,16 @@ func New() *CList { return new(CList).Init() } func (l *CList) Len() int { l.mtx.RLock() - defer l.mtx.RUnlock() - - return l.len + len := l.len + l.mtx.RUnlock() + return len } func (l *CList) Front() *CElement { l.mtx.RLock() - defer l.mtx.RUnlock() - - return l.head + head := l.head + l.mtx.RUnlock() + return head } func (l *CList) FrontWait() *CElement { @@ -265,9 +265,9 @@ func (l *CList) FrontWait() *CElement { func (l *CList) Back() *CElement { l.mtx.RLock() - defer l.mtx.RUnlock() - - return l.tail + back := l.tail + l.mtx.RUnlock() + return back } func (l *CList) BackWait() *CElement { @@ -297,7 +297,6 @@ func (l *CList) WaitChan() <-chan struct{} { func (l *CList) PushBack(v interface{}) *CElement { l.mtx.Lock() - defer l.mtx.Unlock() // Construct a new element e := &CElement{ @@ -327,7 +326,7 @@ func (l *CList) PushBack(v interface{}) *CElement { l.tail.SetNext(e) // This will make e accessible. l.tail = e // Update the list. } - + l.mtx.Unlock() return e } @@ -335,18 +334,20 @@ func (l *CList) PushBack(v interface{}) *CElement { // NOTE: As per the contract of CList, removed elements cannot be added back. func (l *CList) Remove(e *CElement) interface{} { l.mtx.Lock() - defer l.mtx.Unlock() prev := e.Prev() next := e.Next() if l.head == nil || l.tail == nil { + l.mtx.Unlock() panic("Remove(e) on empty CList") } if prev == nil && l.head != e { + l.mtx.Unlock() panic("Remove(e) with false head") } if next == nil && l.tail != e { + l.mtx.Unlock() panic("Remove(e) with false tail") } @@ -374,6 +375,7 @@ func (l *CList) Remove(e *CElement) interface{} { // Set .Done() on e, otherwise waiters will wait forever. e.SetRemoved() + l.mtx.Unlock() return e.Value } From 0f931eeb10a7f5953e55c05e69335fefae6dfb90 Mon Sep 17 00:00:00 2001 From: b00f Date: Tue, 14 Aug 2018 23:02:53 +0800 Subject: [PATCH 061/149] types: allow genesis file to have 0 validators (#2148) * fixing issue 2015 * Remove comments for code review * Update tests --- .gitignore | 2 ++ types/genesis.go | 6 +----- types/genesis_test.go | 30 +++++++++++++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 69196fac..193a4289 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ addrbook.json terraform.tfstate terraform.tfstate.backup terraform.tfstate.d + +.vscode \ No newline at end of file diff --git a/types/genesis.go b/types/genesis.go index c4f69980..ccfd019c 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -25,7 +25,7 @@ type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"` - Validators []GenesisValidator `json:"validators"` + Validators []GenesisValidator `json:"validators,omitempty"` AppHash cmn.HexBytes `json:"app_hash"` AppState json.RawMessage `json:"app_state,omitempty"` } @@ -65,10 +65,6 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error { } } - if len(genDoc.Validators) == 0 { - return cmn.NewError("The genesis file must have at least one validator") - } - for _, v := range genDoc.Validators { if v.Power == 0 { return cmn.NewError("The genesis file cannot contain validators with no voting power: %v", v) diff --git a/types/genesis_test.go b/types/genesis_test.go index 925bba79..fb981e9c 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -14,15 +14,14 @@ import ( func TestGenesisBad(t *testing.T) { // test some bad ones from raw json testCases := [][]byte{ - []byte{}, // empty - []byte{1, 1, 1, 1, 1}, // junk - []byte(`{}`), // empty - []byte(`{"chain_id":"mychain"}`), // missing validators - []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators - []byte(`{"chain_id":"mychain","validators":[{}]}`), // missing validators - []byte(`{"chain_id":"mychain","validators":null}`), // missing validators - []byte(`{"chain_id":"mychain"}`), // missing validators - []byte(`{"validators":[{"pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},"power":"10","name":""}]}`), // missing chain_id + []byte{}, // empty + []byte{1, 1, 1, 1, 1}, // junk + []byte(`{}`), // empty + []byte(`{"chain_id":"mychain","validators":[{}]}`), // invalid validator + // missing pub_key type + []byte(`{"validators":[{"pub_key":{"value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},"power":"10","name":""}]}`), + // missing chain_id + []byte(`{"validators":[{"pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},"power":"10","name":""}]}`), } for _, testCase := range testCases { @@ -62,6 +61,19 @@ func TestGenesisGood(t *testing.T) { assert.NoError(t, err, "error marshalling genDoc") genDoc, err = GenesisDocFromJSON(genDocBytes) assert.Error(t, err, "expected error for genDoc json with block size of 0") + + // Genesis doc from raw json + missingValidatorsTestCases := [][]byte{ + []byte(`{"chain_id":"mychain"}`), // missing validators + []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators + []byte(`{"chain_id":"mychain","validators":null}`), // nil validator + []byte(`{"chain_id":"mychain"}`), // missing validators + } + + for _, tc := range missingValidatorsTestCases { + _, err := GenesisDocFromJSON(tc) + assert.NoError(t, err) + } } func TestGenesisSaveAs(t *testing.T) { From 80e49abadaaf9a78af98908c598a0325311577d1 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 14 Aug 2018 19:16:35 +0400 Subject: [PATCH 062/149] send ValidatorSetUpdates event when validator set changes (#2161) Refs #1916 --- Gopkg.lock | 13 +--- .../subscribing-to-events-via-websocket.md | 36 +++++++++ state/execution.go | 7 ++ state/execution_test.go | 68 ++++++++++++++-- types/event_bus.go | 72 ++++++++--------- types/event_bus_test.go | 4 +- types/events.go | 77 +++++++++---------- types/nop_event_bus.go | 34 ++++---- 8 files changed, 202 insertions(+), 109 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ff5cbcfe..270e9c5c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -244,7 +244,7 @@ [[projects]] branch = "master" - digest = "1:dad2e5a2153ee7a6c9ab8fc13673a16ee4fb64434a7da980965a3741b0c981a3" + digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" name = "github.com/prometheus/common" packages = [ "expfmt", @@ -377,14 +377,6 @@ revision = "a8328986c1608950fa5d3d1c0472cccc4f8fc02c" version = "v0.12.0-rc0" -[[projects]] - digest = "1:cefd237469d443fe56cbeadf68a1baf46cef293f071dc0e317f8b8062c3ffe72" - name = "github.com/tendermint/go-crypto" - packages = ["tmhash"] - pruneopts = "UT" - revision = "6a6b591a3d7592a04b46af95451cb5be3b114f76" - version = "v0.9.0" - [[projects]] branch = "master" digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" @@ -426,7 +418,7 @@ [[projects]] branch = "master" - digest = "1:70656e26ab4a96e683a21d677630edb5239a3d60b2d54bdc861c808ab5aa42c7" + digest = "1:bb0fe59917bdd5b89f49b9a8b26e5f465e325d9223b3a8e32254314bdf51e0f1" name = "golang.org/x/sys" packages = [ "cpu", @@ -547,7 +539,6 @@ "github.com/tendermint/ed25519", "github.com/tendermint/ed25519/extra25519", "github.com/tendermint/go-amino", - "github.com/tendermint/go-crypto/tmhash", "golang.org/x/crypto/bcrypt", "golang.org/x/crypto/chacha20poly1305", "golang.org/x/crypto/curve25519", diff --git a/docs/app-dev/subscribing-to-events-via-websocket.md b/docs/app-dev/subscribing-to-events-via-websocket.md index 9e7c642a..69ab59f5 100644 --- a/docs/app-dev/subscribing-to-events-via-websocket.md +++ b/docs/app-dev/subscribing-to-events-via-websocket.md @@ -26,3 +26,39 @@ more information on query syntax and other options. You can also use tags, given you had included them into DeliverTx response, to query transaction results. See [Indexing transactions](./indexing-transactions.md) for details. + +### ValidatorSetUpdates + +When validator set changes, ValidatorSetUpdates event is published. The +event carries a list of pubkey/power pairs. The list is the same +Tendermint receives from ABCI application (see [EndBlock +section](https://tendermint.com/docs/app-dev/abci-spec.html#endblock) in +the ABCI spec). + +Response: + +``` +{ + "jsonrpc": "2.0", + "id": "0#event", + "result": { + "query": "tm.event='ValidatorSetUpdates'", + "data": { + "type": "tendermint/event/ValidatorSetUpdates", + "value": { + "validator_updates": [ + { + "address": "09EAD022FD25DE3A02E64B0FE9610B1417183EE4", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "ww0z4WaZ0Xg+YI10w43wTWbBmM3dpVza4mmSQYsd0ck=" + }, + "voting_power": "10", + "accum": "0" + } + ] + } + } + } +} +``` diff --git a/state/execution.go b/state/execution.go index 54e5c950..7e7bc37a 100644 --- a/state/execution.go +++ b/state/execution.go @@ -380,6 +380,13 @@ func fireEvents(logger log.Logger, eventBus types.BlockEventPublisher, block *ty Result: *(abciResponses.DeliverTx[i]), }}) } + + if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { + // if there were an error, we would've stopped in updateValidators + updates, _ := types.PB2TM.Validators(abciResponses.EndBlock.ValidatorUpdates) + eventBus.PublishEventValidatorSetUpdates( + types.EventDataValidatorSetUpdates{ValidatorUpdates: updates}) + } } //---------------------------------------------------------------------------------------------------- diff --git a/state/execution_test.go b/state/execution_test.go index d5b0dda0..161b96f2 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -1,6 +1,7 @@ package state import ( + "context" "fmt" "testing" "time" @@ -232,6 +233,62 @@ func TestUpdateValidators(t *testing.T) { } } +// TestEndBlockValidatorUpdates ensures we update validator set and send an event. +func TestEndBlockValidatorUpdates(t *testing.T) { + app := &testApp{} + cc := proxy.NewLocalClientCreator(app) + proxyApp := proxy.NewAppConns(cc, nil) + err := proxyApp.Start() + require.Nil(t, err) + defer proxyApp.Stop() + + state, stateDB := state(1, 1) + + blockExec := NewBlockExecutor(stateDB, log.TestingLogger(), proxyApp.Consensus(), + MockMempool{}, MockEvidencePool{}) + eventBus := types.NewEventBus() + err = eventBus.Start() + require.NoError(t, err) + defer eventBus.Stop() + blockExec.SetEventBus(eventBus) + + updatesCh := make(chan interface{}, 1) + err = eventBus.Subscribe(context.Background(), "TestEndBlockValidatorUpdates", types.EventQueryValidatorSetUpdates, updatesCh) + require.NoError(t, err) + + block := makeBlock(state, 1) + blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} + + pubkey := ed25519.GenPrivKey().PubKey() + app.ValidatorUpdates = []abci.Validator{ + {PubKey: types.TM2PB.PubKey(pubkey), Power: 10}, + } + + state, err = blockExec.ApplyBlock(state, blockID, block) + require.Nil(t, err) + + // test new validator was added to NextValidators + if assert.Equal(t, state.Validators.Size()+1, state.NextValidators.Size()) { + idx, _ := state.NextValidators.GetByAddress(pubkey.Address()) + if idx < 0 { + t.Fatalf("can't find address %v in the set %v", pubkey.Address(), state.NextValidators) + } + } + + // test we threw an event + select { + case e := <-updatesCh: + event, ok := e.(types.EventDataValidatorSetUpdates) + require.True(t, ok, "Expected event of type EventDataValidatorSetUpdates, got %T", e) + if assert.NotEmpty(t, event.ValidatorUpdates) { + assert.Equal(t, pubkey, event.ValidatorUpdates[0].PubKey) + assert.EqualValues(t, 10, event.ValidatorUpdates[0].VotingPower) + } + case <-time.After(1 * time.Second): + t.Fatal("Did not receive EventValidatorSetUpdates within 1 sec.") + } +} + //---------------------------------------------------------------------------- // make some bogus txs @@ -275,18 +332,15 @@ func makeBlock(state State, height int64) *types.Block { //---------------------------------------------------------------------------- -var _ abci.Application = (*testApp)(nil) - type testApp struct { abci.BaseApplication Validators []abci.SigningValidator ByzantineValidators []abci.Evidence + ValidatorUpdates []abci.Validator } -func NewKVStoreApplication() *testApp { - return &testApp{} -} +var _ abci.Application = (*testApp)(nil) func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { return abci.ResponseInfo{} @@ -298,6 +352,10 @@ func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlo return abci.ResponseBeginBlock{} } +func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock { + return abci.ResponseEndBlock{ValidatorUpdates: app.ValidatorUpdates} +} + func (app *testApp) DeliverTx(tx []byte) abci.ResponseDeliverTx { return abci.ResponseDeliverTx{Tags: []cmn.KVPair{}} } diff --git a/types/event_bus.go b/types/event_bus.go index b4965fee..d11c6520 100644 --- a/types/event_bus.go +++ b/types/event_bus.go @@ -71,34 +71,32 @@ func (b *EventBus) Publish(eventType string, eventData TMEventData) error { return nil } -//--- block, tx, and vote events - -func (b *EventBus) PublishEventNewBlock(event EventDataNewBlock) error { - return b.Publish(EventNewBlock, event) +func (b *EventBus) PublishEventNewBlock(data EventDataNewBlock) error { + return b.Publish(EventNewBlock, data) } -func (b *EventBus) PublishEventNewBlockHeader(event EventDataNewBlockHeader) error { - return b.Publish(EventNewBlockHeader, event) +func (b *EventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error { + return b.Publish(EventNewBlockHeader, data) } -func (b *EventBus) PublishEventVote(event EventDataVote) error { - return b.Publish(EventVote, event) +func (b *EventBus) PublishEventVote(data EventDataVote) error { + return b.Publish(EventVote, data) } // PublishEventTx publishes tx event with tags from Result. Note it will add // predefined tags (EventTypeKey, TxHashKey). Existing tags with the same names // will be overwritten. -func (b *EventBus) PublishEventTx(event EventDataTx) error { +func (b *EventBus) PublishEventTx(data EventDataTx) error { // no explicit deadline for publishing events ctx := context.Background() tags := make(map[string]string) // validate and fill tags from tx result - for _, tag := range event.Result.Tags { + for _, tag := range data.Result.Tags { // basic validation if len(tag.Key) == 0 { - b.Logger.Info("Got tag with an empty key (skipping)", "tag", tag, "tx", event.Tx) + b.Logger.Info("Got tag with an empty key (skipping)", "tag", tag, "tx", data.Tx) continue } tags[string(tag.Key)] = string(tag.Value) @@ -109,55 +107,57 @@ func (b *EventBus) PublishEventTx(event EventDataTx) error { tags[EventTypeKey] = EventTx logIfTagExists(TxHashKey, tags, b.Logger) - tags[TxHashKey] = fmt.Sprintf("%X", event.Tx.Hash()) + tags[TxHashKey] = fmt.Sprintf("%X", data.Tx.Hash()) logIfTagExists(TxHeightKey, tags, b.Logger) - tags[TxHeightKey] = fmt.Sprintf("%d", event.Height) + tags[TxHeightKey] = fmt.Sprintf("%d", data.Height) - b.pubsub.PublishWithTags(ctx, event, tmpubsub.NewTagMap(tags)) + b.pubsub.PublishWithTags(ctx, data, tmpubsub.NewTagMap(tags)) return nil } -func (b *EventBus) PublishEventProposalHeartbeat(event EventDataProposalHeartbeat) error { - return b.Publish(EventProposalHeartbeat, event) +func (b *EventBus) PublishEventProposalHeartbeat(data EventDataProposalHeartbeat) error { + return b.Publish(EventProposalHeartbeat, data) } -//--- EventDataRoundState events - -func (b *EventBus) PublishEventNewRoundStep(event EventDataRoundState) error { - return b.Publish(EventNewRoundStep, event) +func (b *EventBus) PublishEventNewRoundStep(data EventDataRoundState) error { + return b.Publish(EventNewRoundStep, data) } -func (b *EventBus) PublishEventTimeoutPropose(event EventDataRoundState) error { - return b.Publish(EventTimeoutPropose, event) +func (b *EventBus) PublishEventTimeoutPropose(data EventDataRoundState) error { + return b.Publish(EventTimeoutPropose, data) } -func (b *EventBus) PublishEventTimeoutWait(event EventDataRoundState) error { - return b.Publish(EventTimeoutWait, event) +func (b *EventBus) PublishEventTimeoutWait(data EventDataRoundState) error { + return b.Publish(EventTimeoutWait, data) } -func (b *EventBus) PublishEventNewRound(event EventDataRoundState) error { - return b.Publish(EventNewRound, event) +func (b *EventBus) PublishEventNewRound(data EventDataRoundState) error { + return b.Publish(EventNewRound, data) } -func (b *EventBus) PublishEventCompleteProposal(event EventDataRoundState) error { - return b.Publish(EventCompleteProposal, event) +func (b *EventBus) PublishEventCompleteProposal(data EventDataRoundState) error { + return b.Publish(EventCompleteProposal, data) } -func (b *EventBus) PublishEventPolka(event EventDataRoundState) error { - return b.Publish(EventPolka, event) +func (b *EventBus) PublishEventPolka(data EventDataRoundState) error { + return b.Publish(EventPolka, data) } -func (b *EventBus) PublishEventUnlock(event EventDataRoundState) error { - return b.Publish(EventUnlock, event) +func (b *EventBus) PublishEventUnlock(data EventDataRoundState) error { + return b.Publish(EventUnlock, data) } -func (b *EventBus) PublishEventRelock(event EventDataRoundState) error { - return b.Publish(EventRelock, event) +func (b *EventBus) PublishEventRelock(data EventDataRoundState) error { + return b.Publish(EventRelock, data) } -func (b *EventBus) PublishEventLock(event EventDataRoundState) error { - return b.Publish(EventLock, event) +func (b *EventBus) PublishEventLock(data EventDataRoundState) error { + return b.Publish(EventLock, data) +} + +func (b *EventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error { + return b.Publish(EventValidatorSetUpdates, data) } func logIfTagExists(tag string, tags map[string]string, logger log.Logger) { diff --git a/types/event_bus_test.go b/types/event_bus_test.go index 2ee9f886..f0e825d5 100644 --- a/types/event_bus_test.go +++ b/types/event_bus_test.go @@ -68,7 +68,7 @@ func TestEventBusPublish(t *testing.T) { err = eventBus.Subscribe(context.Background(), "test", tmquery.Empty{}, eventsCh) require.NoError(t, err) - const numEventsExpected = 14 + const numEventsExpected = 15 done := make(chan struct{}) go func() { numEvents := 0 @@ -108,6 +108,8 @@ func TestEventBusPublish(t *testing.T) { require.NoError(t, err) err = eventBus.PublishEventLock(EventDataRoundState{}) require.NoError(t, err) + err = eventBus.PublishEventValidatorSetUpdates(EventDataValidatorSetUpdates{}) + require.NoError(t, err) select { case <-done: diff --git a/types/events.go b/types/events.go index c26fecb7..09f7216e 100644 --- a/types/events.go +++ b/types/events.go @@ -8,42 +8,34 @@ import ( tmquery "github.com/tendermint/tendermint/libs/pubsub/query" ) -// Reserved event types +// Reserved event types (alphabetically sorted). const ( - EventCompleteProposal = "CompleteProposal" - EventLock = "Lock" - EventNewBlock = "NewBlock" - EventNewBlockHeader = "NewBlockHeader" - EventNewRound = "NewRound" - EventNewRoundStep = "NewRoundStep" - EventPolka = "Polka" - EventRelock = "Relock" - EventTimeoutPropose = "TimeoutPropose" - EventTimeoutWait = "TimeoutWait" - EventTx = "Tx" - EventUnlock = "Unlock" - EventVote = "Vote" - EventProposalHeartbeat = "ProposalHeartbeat" + EventCompleteProposal = "CompleteProposal" + EventLock = "Lock" + EventNewBlock = "NewBlock" + EventNewBlockHeader = "NewBlockHeader" + EventNewRound = "NewRound" + EventNewRoundStep = "NewRoundStep" + EventPolka = "Polka" + EventProposalHeartbeat = "ProposalHeartbeat" + EventRelock = "Relock" + EventTimeoutPropose = "TimeoutPropose" + EventTimeoutWait = "TimeoutWait" + EventTx = "Tx" + EventUnlock = "Unlock" + EventValidatorSetUpdates = "ValidatorSetUpdates" + EventVote = "Vote" ) /////////////////////////////////////////////////////////////////////////////// // ENCODING / DECODING /////////////////////////////////////////////////////////////////////////////// -// implements events.EventData +// TMEventData implements events.EventData. type TMEventData interface { - AssertIsTMEventData() // empty interface } -func (_ EventDataNewBlock) AssertIsTMEventData() {} -func (_ EventDataNewBlockHeader) AssertIsTMEventData() {} -func (_ EventDataTx) AssertIsTMEventData() {} -func (_ EventDataRoundState) AssertIsTMEventData() {} -func (_ EventDataVote) AssertIsTMEventData() {} -func (_ EventDataProposalHeartbeat) AssertIsTMEventData() {} -func (_ EventDataString) AssertIsTMEventData() {} - func RegisterEventDatas(cdc *amino.Codec) { cdc.RegisterInterface((*TMEventData)(nil), nil) cdc.RegisterConcrete(EventDataNewBlock{}, "tendermint/event/NewBlock", nil) @@ -52,6 +44,7 @@ func RegisterEventDatas(cdc *amino.Codec) { cdc.RegisterConcrete(EventDataRoundState{}, "tendermint/event/RoundState", nil) cdc.RegisterConcrete(EventDataVote{}, "tendermint/event/Vote", nil) cdc.RegisterConcrete(EventDataProposalHeartbeat{}, "tendermint/event/ProposalHeartbeat", nil) + cdc.RegisterConcrete(EventDataValidatorSetUpdates{}, "tendermint/event/ValidatorSetUpdates", nil) cdc.RegisterConcrete(EventDataString(""), "tendermint/event/ProposalString", nil) } @@ -92,6 +85,10 @@ type EventDataVote struct { type EventDataString string +type EventDataValidatorSetUpdates struct { + ValidatorUpdates []*Validator `json:"validator_updates"` +} + /////////////////////////////////////////////////////////////////////////////// // PUBSUB /////////////////////////////////////////////////////////////////////////////// @@ -108,20 +105,21 @@ const ( ) var ( - EventQueryNewBlock = QueryForEvent(EventNewBlock) - EventQueryNewBlockHeader = QueryForEvent(EventNewBlockHeader) - EventQueryNewRound = QueryForEvent(EventNewRound) - EventQueryNewRoundStep = QueryForEvent(EventNewRoundStep) - EventQueryTimeoutPropose = QueryForEvent(EventTimeoutPropose) - EventQueryCompleteProposal = QueryForEvent(EventCompleteProposal) - EventQueryPolka = QueryForEvent(EventPolka) - EventQueryUnlock = QueryForEvent(EventUnlock) - EventQueryLock = QueryForEvent(EventLock) - EventQueryRelock = QueryForEvent(EventRelock) - EventQueryTimeoutWait = QueryForEvent(EventTimeoutWait) - EventQueryVote = QueryForEvent(EventVote) - EventQueryProposalHeartbeat = QueryForEvent(EventProposalHeartbeat) - EventQueryTx = QueryForEvent(EventTx) + EventQueryCompleteProposal = QueryForEvent(EventCompleteProposal) + EventQueryLock = QueryForEvent(EventLock) + EventQueryNewBlock = QueryForEvent(EventNewBlock) + EventQueryNewBlockHeader = QueryForEvent(EventNewBlockHeader) + EventQueryNewRound = QueryForEvent(EventNewRound) + EventQueryNewRoundStep = QueryForEvent(EventNewRoundStep) + EventQueryPolka = QueryForEvent(EventPolka) + EventQueryProposalHeartbeat = QueryForEvent(EventProposalHeartbeat) + EventQueryRelock = QueryForEvent(EventRelock) + EventQueryTimeoutPropose = QueryForEvent(EventTimeoutPropose) + EventQueryTimeoutWait = QueryForEvent(EventTimeoutWait) + EventQueryTx = QueryForEvent(EventTx) + EventQueryUnlock = QueryForEvent(EventUnlock) + EventQueryValidatorSetUpdates = QueryForEvent(EventValidatorSetUpdates) + EventQueryVote = QueryForEvent(EventVote) ) func EventQueryTxFor(tx Tx) tmpubsub.Query { @@ -137,6 +135,7 @@ type BlockEventPublisher interface { PublishEventNewBlock(block EventDataNewBlock) error PublishEventNewBlockHeader(header EventDataNewBlockHeader) error PublishEventTx(EventDataTx) error + PublishEventValidatorSetUpdates(EventDataValidatorSetUpdates) error } type TxEventPublisher interface { diff --git a/types/nop_event_bus.go b/types/nop_event_bus.go index cd1eab8c..93694da4 100644 --- a/types/nop_event_bus.go +++ b/types/nop_event_bus.go @@ -20,58 +20,58 @@ func (NopEventBus) UnsubscribeAll(ctx context.Context, subscriber string) error return nil } -//--- block, tx, and vote events - -func (NopEventBus) PublishEventNewBlock(block EventDataNewBlock) error { +func (NopEventBus) PublishEventNewBlock(data EventDataNewBlock) error { return nil } -func (NopEventBus) PublishEventNewBlockHeader(header EventDataNewBlockHeader) error { +func (NopEventBus) PublishEventNewBlockHeader(data EventDataNewBlockHeader) error { return nil } -func (NopEventBus) PublishEventVote(vote EventDataVote) error { +func (NopEventBus) PublishEventVote(data EventDataVote) error { return nil } -func (NopEventBus) PublishEventTx(tx EventDataTx) error { +func (NopEventBus) PublishEventTx(data EventDataTx) error { return nil } -//--- EventDataRoundState events - -func (NopEventBus) PublishEventNewRoundStep(rs EventDataRoundState) error { +func (NopEventBus) PublishEventNewRoundStep(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventTimeoutPropose(rs EventDataRoundState) error { +func (NopEventBus) PublishEventTimeoutPropose(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventTimeoutWait(rs EventDataRoundState) error { +func (NopEventBus) PublishEventTimeoutWait(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventNewRound(rs EventDataRoundState) error { +func (NopEventBus) PublishEventNewRound(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventCompleteProposal(rs EventDataRoundState) error { +func (NopEventBus) PublishEventCompleteProposal(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventPolka(rs EventDataRoundState) error { +func (NopEventBus) PublishEventPolka(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventUnlock(rs EventDataRoundState) error { +func (NopEventBus) PublishEventUnlock(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventRelock(rs EventDataRoundState) error { +func (NopEventBus) PublishEventRelock(data EventDataRoundState) error { return nil } -func (NopEventBus) PublishEventLock(rs EventDataRoundState) error { +func (NopEventBus) PublishEventLock(data EventDataRoundState) error { + return nil +} + +func (NopEventBus) PublishEventValidatorSetUpdates(data EventDataValidatorSetUpdates) error { return nil } From 2fe34491ba7c6d90b11f0ac2b6261bc4e8c318b1 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Tue, 14 Aug 2018 11:42:40 -0700 Subject: [PATCH 063/149] (squash this) Fix build errors --- crypto/multisig/compact_bit_array_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go index 3382c8b9..8b342b7a 100644 --- a/crypto/multisig/compact_bit_array_test.go +++ b/crypto/multisig/compact_bit_array_test.go @@ -170,7 +170,7 @@ func TestCompactBitArrayNumOfTrueBitsBefore(t *testing.T) { require.NoError(t, err) for i := 0; i < len(tc.bAIndex); i++ { - require.Equal(t, tc.trueValueIndex[i], bA.NumOfTrueBitsBefore(tc.bAIndex[i]), "tc %d, i %d", tcIndex, i) + require.Equal(t, tc.trueValueIndex[i], bA.NumTrueBitsBefore(tc.bAIndex[i]), "tc %d, i %d", tcIndex, i) } }) } From 6fad8eaf5a7d82000c3f2933ec61e0f3917d07cf Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 02:25:56 +0400 Subject: [PATCH 064/149] [p2p/pex] connect to more than 10 peers (#2169) * [p2p/pex] connect to more than 10 peers also, remove DefaultMinNumOutboundPeers because a) I am not sure it's needed b) it's super confusing look closely ``` maxPeers := sw.config.MaxNumPeers - DefaultMinNumOutboundPeers if maxPeers <= sw.peers.Size() { sw.Logger.Info("Ignoring inbound connection: already have enough peers", "address", inConn.RemoteAddr().String(), "numPeers", sw.peers.Size(), "max", maxPeers) ``` we print maxPeers = config.MaxPeers - DefaultMinNumOutboundPeers. So we may not have enough peers even though we say we have enough. Refs #2130 * update spec * replace MaxNumPeers with MaxNumInboundPeers/MaxNumOutboundPeers Refs #2130 * update changelog * make max rpc conns formula visible to users * update spec * docs: note max outbound peers excludes persistent --- CHANGELOG_PENDING.md | 1 + config/config.go | 18 +++++++++++------- config/toml.go | 11 +++++++++-- docs/spec/reactors/pex/pex.md | 21 +++++++++++++-------- docs/tendermint-core/configuration.md | 13 ++++++++++--- p2p/pex/pex_reactor.go | 5 ++--- p2p/switch.go | 23 ++++++++++++++--------- 7 files changed, 60 insertions(+), 32 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 48b7db0b..5728e558 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -10,6 +10,7 @@ BREAKING CHANGES: - [abci] Added address of the original proposer of the block to Header. - [abci] Change ABCI Header to match Tendermint exactly - [libs] Remove cmn.Fmt, in favor of fmt.Sprintf +- [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers FEATURES: diff --git a/config/config.go b/config/config.go index fb8e7908..51683ef0 100644 --- a/config/config.go +++ b/config/config.go @@ -239,6 +239,8 @@ type RPCConfig struct { // If you want to accept more significant number than the default, make sure // you increase your OS limits. // 0 - unlimited. + // Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} + // 1024 - 40 - 10 - 50 = 924 = ~900 MaxOpenConnections int `mapstructure:"max_open_connections"` } @@ -248,11 +250,9 @@ func DefaultRPCConfig() *RPCConfig { ListenAddress: "tcp://0.0.0.0:26657", GRPCListenAddress: "", - GRPCMaxOpenConnections: 900, // no ipv4 + GRPCMaxOpenConnections: 900, - Unsafe: false, - // should be < {ulimit -Sn} - {MaxNumPeers} - {N of wal, db and other open files} - // 1024 - 50 - 50 = 924 = ~900 + Unsafe: false, MaxOpenConnections: 900, } } @@ -295,8 +295,11 @@ type P2PConfig struct { // Set true for strict address routability rules AddrBookStrict bool `mapstructure:"addr_book_strict"` - // Maximum number of peers to connect to - MaxNumPeers int `mapstructure:"max_num_peers"` + // Maximum number of inbound peers + MaxNumInboundPeers int `mapstructure:"max_num_inbound_peers"` + + // Maximum number of outbound peers to connect to, excluding persistent peers + MaxNumOutboundPeers int `mapstructure:"max_num_outbound_peers"` // Time to wait before flushing messages out on the connection, in ms FlushThrottleTimeout int `mapstructure:"flush_throttle_timeout"` @@ -346,7 +349,8 @@ func DefaultP2PConfig() *P2PConfig { UPNP: false, AddrBook: defaultAddrBookPath, AddrBookStrict: true, - MaxNumPeers: 50, + MaxNumInboundPeers: 40, + MaxNumOutboundPeers: 10, FlushThrottleTimeout: 100, MaxPacketMsgPayloadSize: 1024, // 1 kB SendRate: 5120000, // 5 mB/s diff --git a/config/toml.go b/config/toml.go index 60ce15de..c85609b6 100644 --- a/config/toml.go +++ b/config/toml.go @@ -124,6 +124,8 @@ grpc_laddr = "{{ .RPC.GRPCListenAddress }}" # If you want to accept more significant number than the default, make sure # you increase your OS limits. # 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 grpc_max_open_connections = {{ .RPC.GRPCMaxOpenConnections }} # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool @@ -134,6 +136,8 @@ unsafe = {{ .RPC.Unsafe }} # If you want to accept more significant number than the default, make sure # you increase your OS limits. # 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 max_open_connections = {{ .RPC.MaxOpenConnections }} ##### peer to peer configuration options ##### @@ -166,8 +170,11 @@ addr_book_strict = {{ .P2P.AddrBookStrict }} # Time to wait before flushing messages out on the connection, in ms flush_throttle_timeout = {{ .P2P.FlushThrottleTimeout }} -# Maximum number of peers to connect to -max_num_peers = {{ .P2P.MaxNumPeers }} +# Maximum number of inbound peers +max_num_inbound_peers = {{ .P2P.MaxNumInboundPeers }} + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = {{ .P2P.MaxNumOutboundPeers }} # Maximum size of a message packet payload, in bytes max_packet_msg_payload_size = {{ .P2P.MaxPacketMsgPayloadSize }} diff --git a/docs/spec/reactors/pex/pex.md b/docs/spec/reactors/pex/pex.md index 0f13c0cb..9e00101a 100644 --- a/docs/spec/reactors/pex/pex.md +++ b/docs/spec/reactors/pex/pex.md @@ -15,6 +15,9 @@ we will not put them in the address book or gossip them to others. All peers except private peers and peers coming from them are tracked using the address book. +The rest of our peers are only distinguished by being either +inbound (they dialed our public address) or outbound (we dialed them). + ## Discovery Peer discovery begins with a list of seeds. @@ -26,15 +29,15 @@ and will attempt to maintain persistent connections with them. If the connection we will redial every 5s for a few minutes, then switch to an exponential backoff schedule, and after about a day of trying, stop dialing the peer. -So long as we have less than `MinNumOutboundPeers`, we periodically request additional peers +So long as we have less than `MaxNumOutboundPeers`, we periodically request additional peers from each of our own. If sufficient time goes by and we still can't find enough peers, we try the seeds again. ## Listening Peers listen on a configurable ListenAddr that they self-report in their -NodeInfo during handshakes with other peers. Peers accept up to (MaxNumPeers - -MinNumOutboundPeers) incoming peers. +NodeInfo during handshakes with other peers. Peers accept up to +`MaxNumInboundPeers` incoming peers. ## Address Book @@ -73,10 +76,11 @@ a trust metric (see below), but it's best to start with something simple. ## Select Peers to Dial -When we need more peers, we pick them randomly from the addrbook with some -configurable bias for unvetted peers. The bias should be lower when we have fewer peers -and can increase as we obtain more, ensuring that our first peers are more trustworthy, -but always giving us the chance to discover new good peers. +When we need more peers, we pick addresses randomly from the addrbook with some +configurable bias for unvetted peers. The bias should be lower when we have +fewer peers and can increase as we obtain more, ensuring that our first peers +are more trustworthy, but always giving us the chance to discover new good +peers. We track the last time we dialed a peer and the number of unsuccessful attempts we've made. If too many attempts are made, we mark the peer as bad. @@ -85,7 +89,8 @@ Connection attempts are made with exponential backoff (plus jitter). Because the selection process happens every `ensurePeersPeriod`, we might not end up dialing a peer for much longer than the backoff duration. -If we fail to connect to the peer after 16 tries (with exponential backoff), we remove from address book completely. +If we fail to connect to the peer after 16 tries (with exponential backoff), we +remove from address book completely. ## Select Peers to Exchange diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index ab2d7cc1..6fb72c44 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -77,6 +77,8 @@ grpc_laddr = "" # If you want to accept more significant number than the default, make sure # you increase your OS limits. # 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 grpc_max_open_connections = 900 # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool @@ -87,7 +89,9 @@ unsafe = false # If you want to accept more significant number than the default, make sure # you increase your OS limits. # 0 - unlimited. -max_open_connections = 450 +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 ##### peer to peer configuration options ##### [p2p] @@ -113,8 +117,11 @@ addr_book_strict = true # Time to wait before flushing messages out on the connection, in ms flush_throttle_timeout = 100 -# Maximum number of peers to connect to -max_num_peers = 50 +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to +max_num_outbound_peers = 10 # Maximum size of a message packet payload, in bytes max_packet_msg_payload_size = 1024 diff --git a/p2p/pex/pex_reactor.go b/p2p/pex/pex_reactor.go index 288cb0d1..b3c50a18 100644 --- a/p2p/pex/pex_reactor.go +++ b/p2p/pex/pex_reactor.go @@ -31,8 +31,7 @@ const ( maxMsgSize = maxAddressSize * maxGetSelection // ensure we have enough peers - defaultEnsurePeersPeriod = 30 * time.Second - defaultMinNumOutboundPeers = p2p.DefaultMinNumOutboundPeers + defaultEnsurePeersPeriod = 30 * time.Second // Seed/Crawler constants @@ -362,7 +361,7 @@ func (r *PEXReactor) ensurePeersRoutine() { func (r *PEXReactor) ensurePeers() { var ( out, in, dial = r.Switch.NumPeers() - numToDial = defaultMinNumOutboundPeers - (out + dial) + numToDial = r.Switch.MaxNumOutboundPeers() - (out + dial) ) r.Logger.Info( "Ensure peers", diff --git a/p2p/switch.go b/p2p/switch.go index da94fa4b..b26e1147 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -26,10 +26,6 @@ const ( // ie. 3**10 = 16hrs reconnectBackOffAttempts = 10 reconnectBackOffBaseSeconds = 3 - - // keep at least this many outbound peers - // TODO: move to config - DefaultMinNumOutboundPeers = 10 ) //----------------------------------------------------------------------------- @@ -268,6 +264,11 @@ func (sw *Switch) NumPeers() (outbound, inbound, dialing int) { return } +// MaxNumOutboundPeers returns a maximum number of outbound peers. +func (sw *Switch) MaxNumOutboundPeers() int { + return sw.config.MaxNumOutboundPeers +} + // Peers returns the set of peers that are connected to the switch. func (sw *Switch) Peers() IPeerSet { return sw.peers @@ -491,11 +492,15 @@ func (sw *Switch) listenerRoutine(l Listener) { break } - // ignore connection if we already have enough - // leave room for MinNumOutboundPeers - maxPeers := sw.config.MaxNumPeers - DefaultMinNumOutboundPeers - if maxPeers <= sw.peers.Size() { - sw.Logger.Info("Ignoring inbound connection: already have enough peers", "address", inConn.RemoteAddr().String(), "numPeers", sw.peers.Size(), "max", maxPeers) + // Ignore connection if we already have enough peers. + _, in, _ := sw.NumPeers() + if in >= sw.config.MaxNumInboundPeers { + sw.Logger.Info( + "Ignoring inbound connection: already have enough inbound peers", + "address", inConn.RemoteAddr().String(), + "have", in, + "max", sw.config.MaxNumInboundPeers, + ) inConn.Close() continue } From e10666859ffd1434156c9efc5c52eefce1533a55 Mon Sep 17 00:00:00 2001 From: Zach Date: Tue, 14 Aug 2018 18:40:05 -0400 Subject: [PATCH 065/149] Zach/automated docs (#2225) * add docs/config.js for better developer experience * update docs_readme :) --- docs/DOCS_README.md | 14 +++----- docs/config.js | 81 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 docs/config.js diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index 016bac5e..0be6e4c6 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -8,14 +8,10 @@ and built using [VuePress](https://vuepress.vuejs.org/) from the tendermint webs - https://github.com/tendermint/tendermint.com -which has a [configuration file](https://github.com/tendermint/tendermint.com/blob/develop/docs/.vuepress/config.js) for displaying -the Table of Contents that lists all the documentation. +Under the hood, Jenkins listens for changes (on develop or master) in ./docs then rebuilds +either the staging or production site depending on which branch the changes were made. -Under the hood, Jenkins listens for changes in ./docs then pushes a `docs-staging` branch to the tendermint.com repo with the latest documentation. That branch must be manually PR'd to `develop` then `master` for staging then production. This process should happen in synchrony with a release. +To update the Table of Contents (layout of the documentation sidebar), edit the +`config.js` in this directory, while the `README.md` is the landing page for the +website documentation. -The `README.md` in this directory is the landing page for -website documentation and the following folders are intentionally -ommitted: - -- `architecture/` ==> contains Architecture Design Records -- `spec/` ==> contains the detailed specification diff --git a/docs/config.js b/docs/config.js new file mode 100644 index 00000000..db17adfa --- /dev/null +++ b/docs/config.js @@ -0,0 +1,81 @@ +module.exports = { + title: "Tendermint Core", + description: "Documentation for Tendermint Core", + dest: "./site-docs", + base: "/", + markdown: { + lineNumbers: true + }, + themeConfig: { + lastUpdated: 'Last Updated', + nav: [ + { text: 'Back to Tendermint', link: 'https://tendermint.com' }, + ], + sidebar: [ + { + title: "Getting Started", + collapsable: false, + children: [ + "/introduction/quick-start", + "/introduction/install", + "/introduction/introduction", + ] + }, + { + title: "Tendermint Core", + collapsable: false, + children: [ + "/tendermint-core/using-tendermint", + "/tendermint-core/configuration", + "/tendermint-core/rpc", + "/tendermint-core/running-in-production", + "/tendermint-core/how-to-read-logs", + "/tendermint-core/block-structure", + "/tendermint-core/light-client-protocol", + "/tendermint-core/metrics", + "/tendermint-core/secure-p2p", + "/tendermint-core/validators", + ] + }, + { + title: "Tendermint Tools", + collapsable: false, + children: [ + "tools/benchmarking", + "tools/monitoring", + ] + }, + { + title: "Tendermint Networks", + collapsable: false, + children: [ + "/networks/deploy-testnets", + "/networks/terraform-and-ansible", + "/networks/fast-sync", + ] + }, + { + title: "Application Development", + collapsable: false, + children: [ + "/app-dev/getting-started", + "/app-dev/abci-cli", + "/app-dev/app-architecture", + "/app-dev/app-development", + "/app-dev/subscribing-to-events-via-websocket", + "/app-dev/indexing-transactions", + "/app-dev/abci-spec", + "/app-dev/ecosystem", + ] + }, + { + title: "Research", + collapsable: false, + children: [ + "/research/determinism", + "/research/transactional-semantics", + ] + }, + ] + } +} From 728d2ed266880958c8493a6208dc3f9c1ec9efd6 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 14 Aug 2018 16:13:25 -0700 Subject: [PATCH 066/149] crypto: Remove unnecessary prefixes from amino route variable names (#2205) * crypto: Remove unnecessary ed25519 and secp256k1 prefixes from amino routes. * (squash this) add changelog * (squash this) multisig amino fixes * (squash this) fix build error --- CHANGELOG_PENDING.md | 1 + consensus/types/round_state_test.go | 2 +- crypto/ed25519/ed25519.go | 14 +++++++------- crypto/multisig/compact_bit_array_test.go | 3 ++- crypto/multisig/wire.go | 6 +++--- crypto/secp256k1/secp256k1.go | 8 ++++---- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 5728e558..12de0034 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -10,6 +10,7 @@ BREAKING CHANGES: - [abci] Added address of the original proposer of the block to Header. - [abci] Change ABCI Header to match Tendermint exactly - [libs] Remove cmn.Fmt, in favor of fmt.Sprintf +- [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers FEATURES: diff --git a/consensus/types/round_state_test.go b/consensus/types/round_state_test.go index 0257ea2f..4d128b18 100644 --- a/consensus/types/round_state_test.go +++ b/consensus/types/round_state_test.go @@ -23,7 +23,7 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { Hash: cmn.RandBytes(20), }, } - sig := make([]byte, ed25519.SignatureEd25519Size) + sig := make([]byte, ed25519.SignatureSize) for i := 0; i < nval; i++ { precommits[i] = &types.Vote{ ValidatorAddress: types.Address(cmn.RandBytes(20)), diff --git a/crypto/ed25519/ed25519.go b/crypto/ed25519/ed25519.go index fa7526f3..c55b3588 100644 --- a/crypto/ed25519/ed25519.go +++ b/crypto/ed25519/ed25519.go @@ -18,11 +18,11 @@ import ( var _ crypto.PrivKey = PrivKeyEd25519{} const ( - Ed25519PrivKeyAminoRoute = "tendermint/PrivKeyEd25519" - Ed25519PubKeyAminoRoute = "tendermint/PubKeyEd25519" + PrivKeyAminoRoute = "tendermint/PrivKeyEd25519" + PubKeyAminoRoute = "tendermint/PubKeyEd25519" // Size of an Edwards25519 signature. Namely the size of a compressed // Edwards25519 point, and a field element. Both of which are 32 bytes. - SignatureEd25519Size = 64 + SignatureSize = 64 ) var cdc = amino.NewCodec() @@ -30,11 +30,11 @@ var cdc = amino.NewCodec() func init() { cdc.RegisterInterface((*crypto.PubKey)(nil), nil) cdc.RegisterConcrete(PubKeyEd25519{}, - Ed25519PubKeyAminoRoute, nil) + PubKeyAminoRoute, nil) cdc.RegisterInterface((*crypto.PrivKey)(nil), nil) cdc.RegisterConcrete(PrivKeyEd25519{}, - Ed25519PrivKeyAminoRoute, nil) + PrivKeyAminoRoute, nil) } // PrivKeyEd25519 implements crypto.PrivKey. @@ -158,10 +158,10 @@ func (pubKey PubKeyEd25519) Bytes() []byte { func (pubKey PubKeyEd25519) VerifyBytes(msg []byte, sig_ []byte) bool { // make sure we use the same algorithm to sign - if len(sig_) != SignatureEd25519Size { + if len(sig_) != SignatureSize { return false } - sig := new([SignatureEd25519Size]byte) + sig := new([SignatureSize]byte) copy(sig[:], sig_) pubKeyBytes := [PubKeyEd25519Size]byte(pubKey) return ed25519.Verify(&pubKeyBytes, msg, sig) diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/compact_bit_array_test.go index 8b342b7a..4684ba23 100644 --- a/crypto/multisig/compact_bit_array_test.go +++ b/crypto/multisig/compact_bit_array_test.go @@ -30,7 +30,8 @@ func randCompactBitArray(bits int) (*CompactBitArray, []byte) { func TestNewBitArrayNeverCrashesOnNegatives(t *testing.T) { bitList := []int{-127, -128, -1 << 31} for _, bits := range bitList { - _ = NewCompactBitArray(bits) + bA := NewCompactBitArray(bits) + require.Nil(t, bA) } } diff --git a/crypto/multisig/wire.go b/crypto/multisig/wire.go index a6cda34a..4c48c664 100644 --- a/crypto/multisig/wire.go +++ b/crypto/multisig/wire.go @@ -10,7 +10,7 @@ import ( // TODO: Figure out API for others to either add their own pubkey types, or // to make verify / marshal accept a cdc. const ( - ThresholdPubkeyAminoRoute = "tendermint/PubkeyThresholdMultisig" + ThresholdPubkeyAminoRoute = "tendermint/PubkeyMultisigThreshold" ) var cdc = amino.NewCodec() @@ -20,7 +20,7 @@ func init() { cdc.RegisterConcrete(ThresholdMultiSignaturePubKey{}, ThresholdPubkeyAminoRoute, nil) cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, - ed25519.Ed25519PubKeyAminoRoute, nil) + ed25519.PubKeyAminoRoute, nil) cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, - secp256k1.Secp256k1PubKeyAminoRoute, nil) + secp256k1.PubKeyAminoRoute, nil) } diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index aee5dafe..0e9ed853 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -15,8 +15,8 @@ import ( //------------------------------------- const ( - Secp256k1PrivKeyAminoRoute = "tendermint/PrivKeySecp256k1" - Secp256k1PubKeyAminoRoute = "tendermint/PubKeySecp256k1" + PrivKeyAminoRoute = "tendermint/PrivKeySecp256k1" + PubKeyAminoRoute = "tendermint/PubKeySecp256k1" ) var cdc = amino.NewCodec() @@ -24,11 +24,11 @@ var cdc = amino.NewCodec() func init() { cdc.RegisterInterface((*crypto.PubKey)(nil), nil) cdc.RegisterConcrete(PubKeySecp256k1{}, - Secp256k1PubKeyAminoRoute, nil) + PubKeyAminoRoute, nil) cdc.RegisterInterface((*crypto.PrivKey)(nil), nil) cdc.RegisterConcrete(PrivKeySecp256k1{}, - Secp256k1PrivKeyAminoRoute, nil) + PrivKeyAminoRoute, nil) } //------------------------------------- From eb98f1c3a98a8eba7ed5d0573f1c4eed69f990c6 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 03:16:18 +0400 Subject: [PATCH 067/149] add missing changelog entries (#2224) --- CHANGELOG_PENDING.md | 6 ++++-- scripts/json2wal/main.go | 28 +++++++++++++--------------- scripts/wal2json/main.go | 2 +- types/genesis_test.go | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 12de0034..305c25b2 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -10,15 +10,17 @@ BREAKING CHANGES: - [abci] Added address of the original proposer of the block to Header. - [abci] Change ABCI Header to match Tendermint exactly - [libs] Remove cmn.Fmt, in favor of fmt.Sprintf +- [blockchain] fix go-amino routes for blockchain messages - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers FEATURES: +- [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) IMPROVEMENTS: - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) BUG FIXES: -- [mempool] No longer possible to fill up linked list without getting caching -benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) \ No newline at end of file +- [mempool] No longer possible to fill up linked list without getting caching + benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go index 9b593f89..acf58603 100644 --- a/scripts/json2wal/main.go +++ b/scripts/json2wal/main.go @@ -8,13 +8,13 @@ package main import ( - "github.com/tendermint/go-amino" - "github.com/tendermint/tendermint/types" - cs "github.com/tendermint/tendermint/consensus" - "fmt" - "os" - "io" "bufio" + "fmt" + "github.com/tendermint/go-amino" + cs "github.com/tendermint/tendermint/consensus" + "github.com/tendermint/tendermint/types" + "io" + "os" "strings" ) @@ -26,7 +26,6 @@ func init() { types.RegisterBlockAmino(cdc) } - func main() { if len(os.Args) < 3 { fmt.Fprintln(os.Stderr, "missing arguments: Usage:json2wal ") @@ -39,7 +38,7 @@ func main() { } defer f.Close() - walFile, err := os.OpenFile(os.Args[2],os.O_EXCL|os.O_WRONLY|os.O_CREATE,0666) + walFile, err := os.OpenFile(os.Args[2], os.O_EXCL|os.O_WRONLY|os.O_CREATE, 0666) if err != nil { panic(fmt.Errorf("failed to open WAL file: %v", err)) } @@ -50,26 +49,25 @@ func main() { for { msgJson, _, err := br.ReadLine() - if err == io.EOF{ + if err == io.EOF { break - }else if err != nil { + } else if err != nil { panic(fmt.Errorf("failed to read file: %v", err)) } // ignore the ENDHEIGHT in json.File - if strings.HasPrefix(string(msgJson),"ENDHEIGHT"){ + if strings.HasPrefix(string(msgJson), "ENDHEIGHT") { continue } var msg cs.TimedWALMessage - err = cdc.UnmarshalJSON(msgJson,&msg) - if err != nil{ + err = cdc.UnmarshalJSON(msgJson, &msg) + if err != nil { panic(fmt.Errorf("failed to unmarshal json: %v", err)) } err = dec.Encode(&msg) - if err != nil{ + if err != nil { panic(fmt.Errorf("failed to encode msg: %v", err)) } } } - diff --git a/scripts/wal2json/main.go b/scripts/wal2json/main.go index 80181bb1..cf8ae86c 100644 --- a/scripts/wal2json/main.go +++ b/scripts/wal2json/main.go @@ -12,8 +12,8 @@ import ( "io" "os" - cs "github.com/tendermint/tendermint/consensus" "github.com/tendermint/go-amino" + cs "github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/types" ) diff --git a/types/genesis_test.go b/types/genesis_test.go index fb981e9c..50134d03 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -64,10 +64,10 @@ func TestGenesisGood(t *testing.T) { // Genesis doc from raw json missingValidatorsTestCases := [][]byte{ - []byte(`{"chain_id":"mychain"}`), // missing validators - []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators + []byte(`{"chain_id":"mychain"}`), // missing validators + []byte(`{"chain_id":"mychain","validators":[]}`), // missing validators []byte(`{"chain_id":"mychain","validators":null}`), // nil validator - []byte(`{"chain_id":"mychain"}`), // missing validators + []byte(`{"chain_id":"mychain"}`), // missing validators } for _, tc := range missingValidatorsTestCases { From ad24d667503c7fe35fec4b7abdee277c6947d87c Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Wed, 15 Aug 2018 16:28:17 +0800 Subject: [PATCH 068/149] [abci-cli] print out all the sub-commands available (#2219) --- abci/cmd/abci-cli/abci-cli.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 00bceec2..b7b8e7d7 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -477,11 +477,8 @@ func muxOnCommands(cmd *cobra.Command, pArgs []string) error { } func cmdUnimplemented(cmd *cobra.Command, args []string) error { - // TODO: Print out all the sub-commands available msg := "unimplemented command" - if err := cmd.Help(); err != nil { - msg = err.Error() - } + if len(args) > 0 { msg += fmt.Sprintf(" args: [%s]", strings.Join(args, " ")) } @@ -489,6 +486,17 @@ func cmdUnimplemented(cmd *cobra.Command, args []string) error { Code: codeBad, Log: msg, }) + + fmt.Println("Available commands:") + fmt.Printf("%s: %s\n", echoCmd.Use, echoCmd.Short) + fmt.Printf("%s: %s\n", infoCmd.Use, infoCmd.Short) + fmt.Printf("%s: %s\n", checkTxCmd.Use, checkTxCmd.Short) + fmt.Printf("%s: %s\n", deliverTxCmd.Use, deliverTxCmd.Short) + fmt.Printf("%s: %s\n", queryCmd.Use, queryCmd.Short) + fmt.Printf("%s: %s\n", commitCmd.Use, commitCmd.Short) + fmt.Printf("%s: %s\n", setOptionCmd.Use, setOptionCmd.Short) + fmt.Println("Use \"[command] --help\" for more information about a command.") + return nil } From 5446452b019b5ab00a08899d7e0497b7f37d261a Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Wed, 15 Aug 2018 16:29:45 +0800 Subject: [PATCH 069/149] pass in NodeKey to NewNode (#2212) Fixes #1544 --- node/node.go | 21 ++++++++++++--------- rpc/test/helpers.go | 7 ++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/node/node.go b/node/node.go index ce0a22c9..7f96e0e0 100644 --- a/node/node.go +++ b/node/node.go @@ -80,8 +80,14 @@ type NodeProvider func(*cfg.Config, log.Logger) (*Node, error) // PrivValidator, ClientCreator, GenesisDoc, and DBProvider. // It implements NodeProvider. func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) { + // Generate node PrivKey + nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) + if err != nil { + return nil,err + } return NewNode(config, privval.LoadOrGenFilePV(config.PrivValidatorFile()), + nodeKey, proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()), DefaultGenesisDocProviderFunc(config), DefaultDBProvider, @@ -119,6 +125,7 @@ type Node struct { // network sw *p2p.Switch // p2p connections addrBook pex.AddrBook // known peers + nodeKey *p2p.NodeKey // our node privkey // services eventBus *types.EventBus // pub/sub for services @@ -139,6 +146,7 @@ type Node struct { // NewNode returns a new, ready to go, Tendermint Node. func NewNode(config *cfg.Config, privValidator types.PrivValidator, + nodeKey *p2p.NodeKey, clientCreator proxy.ClientCreator, genesisDocProvider GenesisDocProvider, dbProvider DBProvider, @@ -293,6 +301,7 @@ func NewNode(config *cfg.Config, sw.AddReactor("BLOCKCHAIN", bcReactor) sw.AddReactor("CONSENSUS", consensusReactor) sw.AddReactor("EVIDENCE", evidenceReactor) + p2pLogger.Info("P2P Node ID", "ID", nodeKey.ID(), "file", config.NodeKeyFile()) // Optionally, start the pex reactor // @@ -392,6 +401,7 @@ func NewNode(config *cfg.Config, sw: sw, addrBook: addrBook, + nodeKey: nodeKey, stateDB: stateDB, blockStore: blockStore, @@ -424,17 +434,10 @@ func (n *Node) OnStart() error { n.Logger.With("module", "p2p")) n.sw.AddListener(l) - // Generate node PrivKey - // TODO: pass in like privValidator - nodeKey, err := p2p.LoadOrGenNodeKey(n.config.NodeKeyFile()) - if err != nil { - return err - } - n.Logger.Info("P2P Node ID", "ID", nodeKey.ID(), "file", n.config.NodeKeyFile()) - nodeInfo := n.makeNodeInfo(nodeKey.ID()) + nodeInfo := n.makeNodeInfo(n.nodeKey.ID()) n.sw.SetNodeInfo(nodeInfo) - n.sw.SetNodeKey(nodeKey) + n.sw.SetNodeKey(n.nodeKey) // Add ourselves to addrbook to prevent dialing ourselves n.addrBook.AddOurAddress(nodeInfo.NetAddress()) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 7e0cba0e..b0dd77ec 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -15,6 +15,7 @@ import ( cfg "github.com/tendermint/tendermint/config" nm "github.com/tendermint/tendermint/node" + "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/proxy" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -120,7 +121,11 @@ func NewTendermint(app abci.Application) *nm.Node { pvFile := config.PrivValidatorFile() pv := privval.LoadOrGenFilePV(pvFile) papp := proxy.NewLocalClientCreator(app) - node, err := nm.NewNode(config, pv, papp, + nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) + if err != nil { + panic(err) + } + node, err := nm.NewNode(config, pv, nodeKey, papp, nm.DefaultGenesisDocProviderFunc(config), nm.DefaultDBProvider, nm.DefaultMetricsProvider(config.Instrumentation), From a649deb6eea327ff568c1248a2a174710fb72cec Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 12:52:43 +0400 Subject: [PATCH 070/149] add a changelog entry --- CHANGELOG_PENDING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 305c25b2..40fd2644 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -13,6 +13,7 @@ BREAKING CHANGES: - [blockchain] fix go-amino routes for blockchain messages - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers +- [node] NewNode now accepts a `*p2p.NodeKey` FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) From 684e3cb4460f33c89cdd71a00a3ea588bb20aebb Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 12:53:00 +0400 Subject: [PATCH 071/149] add upgrading guides --- UPGRADING.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 UPGRADING.md diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 00000000..a290d57d --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,32 @@ +# Upgrading Tendermint Core + +This guide provides steps to be followed when you upgrade your applications to +a newer version of Tendermint Core. + +## Upgrading from 0.23.0 to 0.24.0 + +New 0.24.0 release contains a lot of changes to the state and types. It's not +compatible to the old versions. + +To reset the state do: + +``` +$ tendermint unsafe_reset_all +``` + +### Config changes + +`p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and +`p2p.max_num_outbound_peers`. + +``` +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 10 +``` + +As you can see, the default ratio of inbound/outbound peers is 4/1. The reason +as we want it to be easier for new nodes to connect to the network. You can +tweak these parameters to alter the network topology. From 4e78badac961445a07db9f573e8896f19de62645 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 15 Aug 2018 12:54:20 +0400 Subject: [PATCH 072/149] docs: note max outbound peers excludes persistent --- docs/tendermint-core/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 6fb72c44..5b5c4a29 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -120,7 +120,7 @@ flush_throttle_timeout = 100 # Maximum number of inbound peers max_num_inbound_peers = 40 -# Maximum number of outbound peers to connect to +# Maximum number of outbound peers to connect to, excluding persistent peers max_num_outbound_peers = 10 # Maximum size of a message packet payload, in bytes From 1f6c7bf22aeb6125d9ca23b10ec56dc3cf40a147 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 5 Aug 2018 23:22:09 -0400 Subject: [PATCH 073/149] make: update protoc_abci use of awk --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ff1232d0..e61f6294 100644 --- a/Makefile +++ b/Makefile @@ -36,13 +36,17 @@ protoc_all: protoc_libs protoc_abci protoc_grpc ## If you get the following error, ## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## See https://stackoverflow.com/a/25518702 + ## Note the $< here is substituted for the %.proto + ## Note the $@ here is substituted for the %.pb.go protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:. + ## Note we don't use inplace since it's not natively available on mac @echo "--> adding nolint declarations to protobuf generated files" - @awk -i inplace '/^\s*package \w+/ { print "//nolint" }1' $@ + @awk '/^\s*package \w+/ { print "//nolint" }1' $@ > $@.tmp && mv $@.tmp $@ ######################################## ### Build ABCI +# see protobuf section above protoc_abci: abci/types/types.pb.go build_abci: From f26b83f15fec3d6bbe4eda8253fc073383f8a38e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 5 Aug 2018 23:22:24 -0400 Subject: [PATCH 074/149] abci: add next_validators_hash to header --- abci/types/types.pb.go | 2592 ++++++++---------------------------- abci/types/types.proto | 11 +- abci/types/typespb_test.go | 1456 ++++++++++---------- 3 files changed, 1325 insertions(+), 2734 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index ae619ecc..a609d677 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -1,7 +1,51 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: abci/types/types.proto -//nolint +/* + Package types is a generated protocol buffer package. + + It is generated from these files: + abci/types/types.proto + + It has these top-level messages: + Request + RequestEcho + RequestFlush + RequestInfo + RequestSetOption + RequestInitChain + RequestQuery + RequestBeginBlock + RequestCheckTx + RequestDeliverTx + RequestEndBlock + RequestCommit + Response + ResponseException + ResponseEcho + ResponseFlush + ResponseInfo + ResponseSetOption + ResponseInitChain + ResponseQuery + ResponseBeginBlock + ResponseCheckTx + ResponseDeliverTx + ResponseEndBlock + ResponseCommit + ConsensusParams + BlockSize + TxSize + BlockGossip + LastCommitInfo + Header + BlockID + PartSetHeader + Validator + SigningValidator + PubKey + Evidence +*/ package types import proto "github.com/gogo/protobuf/proto" @@ -21,7 +65,7 @@ import ( grpc "google.golang.org/grpc" ) -import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" +import types1 "github.com/gogo/protobuf/types" import io "io" @@ -51,44 +95,13 @@ type Request struct { // *Request_DeliverTx // *Request_EndBlock // *Request_Commit - Value isRequest_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value isRequest_Value `protobuf_oneof:"value"` } -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{0} -} -func (m *Request) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(dst, src) -} -func (m *Request) XXX_Size() int { - return m.Size() -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } type isRequest_Value interface { isRequest_Value() @@ -412,57 +425,57 @@ func _Request_OneofSizer(msg proto.Message) (n int) { switch x := m.Value.(type) { case *Request_Echo: s := proto.Size(x.Echo) - n += 1 // tag and wire + n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_Flush: s := proto.Size(x.Flush) - n += 1 // tag and wire + n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_Info: s := proto.Size(x.Info) - n += 1 // tag and wire + n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_SetOption: s := proto.Size(x.SetOption) - n += 1 // tag and wire + n += proto.SizeVarint(5<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_InitChain: s := proto.Size(x.InitChain) - n += 1 // tag and wire + n += proto.SizeVarint(6<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_Query: s := proto.Size(x.Query) - n += 1 // tag and wire + n += proto.SizeVarint(7<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_BeginBlock: s := proto.Size(x.BeginBlock) - n += 1 // tag and wire + n += proto.SizeVarint(8<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_CheckTx: s := proto.Size(x.CheckTx) - n += 1 // tag and wire + n += proto.SizeVarint(9<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_DeliverTx: s := proto.Size(x.DeliverTx) - n += 2 // tag and wire + n += proto.SizeVarint(19<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_EndBlock: s := proto.Size(x.EndBlock) - n += 1 // tag and wire + n += proto.SizeVarint(11<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Request_Commit: s := proto.Size(x.Commit) - n += 1 // tag and wire + n += proto.SizeVarint(12<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: @@ -473,44 +486,13 @@ func _Request_OneofSizer(msg proto.Message) (n int) { } type RequestEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *RequestEcho) Reset() { *m = RequestEcho{} } -func (m *RequestEcho) String() string { return proto.CompactTextString(m) } -func (*RequestEcho) ProtoMessage() {} -func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{1} -} -func (m *RequestEcho) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestEcho.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestEcho) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestEcho.Merge(dst, src) -} -func (m *RequestEcho) XXX_Size() int { - return m.Size() -} -func (m *RequestEcho) XXX_DiscardUnknown() { - xxx_messageInfo_RequestEcho.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestEcho proto.InternalMessageInfo +func (m *RequestEcho) Reset() { *m = RequestEcho{} } +func (m *RequestEcho) String() string { return proto.CompactTextString(m) } +func (*RequestEcho) ProtoMessage() {} +func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } func (m *RequestEcho) GetMessage() string { if m != nil { @@ -520,83 +502,21 @@ func (m *RequestEcho) GetMessage() string { } type RequestFlush struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *RequestFlush) Reset() { *m = RequestFlush{} } -func (m *RequestFlush) String() string { return proto.CompactTextString(m) } -func (*RequestFlush) ProtoMessage() {} -func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{2} -} -func (m *RequestFlush) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestFlush.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestFlush) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestFlush.Merge(dst, src) -} -func (m *RequestFlush) XXX_Size() int { - return m.Size() -} -func (m *RequestFlush) XXX_DiscardUnknown() { - xxx_messageInfo_RequestFlush.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestFlush proto.InternalMessageInfo +func (m *RequestFlush) Reset() { *m = RequestFlush{} } +func (m *RequestFlush) String() string { return proto.CompactTextString(m) } +func (*RequestFlush) ProtoMessage() {} +func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} } type RequestInfo struct { - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` } -func (m *RequestInfo) Reset() { *m = RequestInfo{} } -func (m *RequestInfo) String() string { return proto.CompactTextString(m) } -func (*RequestInfo) ProtoMessage() {} -func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{3} -} -func (m *RequestInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestInfo.Merge(dst, src) -} -func (m *RequestInfo) XXX_Size() int { - return m.Size() -} -func (m *RequestInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RequestInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestInfo proto.InternalMessageInfo +func (m *RequestInfo) Reset() { *m = RequestInfo{} } +func (m *RequestInfo) String() string { return proto.CompactTextString(m) } +func (*RequestInfo) ProtoMessage() {} +func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} } func (m *RequestInfo) GetVersion() string { if m != nil { @@ -607,45 +527,14 @@ func (m *RequestInfo) GetVersion() string { // nondeterministic type RequestSetOption struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } -func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } -func (*RequestSetOption) ProtoMessage() {} -func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{4} -} -func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestSetOption.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestSetOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestSetOption.Merge(dst, src) -} -func (m *RequestSetOption) XXX_Size() int { - return m.Size() -} -func (m *RequestSetOption) XXX_DiscardUnknown() { - xxx_messageInfo_RequestSetOption.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestSetOption proto.InternalMessageInfo +func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } +func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } +func (*RequestSetOption) ProtoMessage() {} +func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{4} } func (m *RequestSetOption) GetKey() string { if m != nil { @@ -662,48 +551,17 @@ func (m *RequestSetOption) GetValue() string { } type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,4,rep,name=validators" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []Validator `protobuf:"bytes,4,rep,name=validators" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` } -func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } -func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } -func (*RequestInitChain) ProtoMessage() {} -func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{5} -} -func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestInitChain.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestInitChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestInitChain.Merge(dst, src) -} -func (m *RequestInitChain) XXX_Size() int { - return m.Size() -} -func (m *RequestInitChain) XXX_DiscardUnknown() { - xxx_messageInfo_RequestInitChain.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestInitChain proto.InternalMessageInfo +func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } +func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } +func (*RequestInitChain) ProtoMessage() {} +func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{5} } func (m *RequestInitChain) GetTime() time.Time { if m != nil { @@ -741,47 +599,16 @@ func (m *RequestInitChain) GetAppStateBytes() []byte { } type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` } -func (m *RequestQuery) Reset() { *m = RequestQuery{} } -func (m *RequestQuery) String() string { return proto.CompactTextString(m) } -func (*RequestQuery) ProtoMessage() {} -func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{6} -} -func (m *RequestQuery) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestQuery.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestQuery.Merge(dst, src) -} -func (m *RequestQuery) XXX_Size() int { - return m.Size() -} -func (m *RequestQuery) XXX_DiscardUnknown() { - xxx_messageInfo_RequestQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestQuery proto.InternalMessageInfo +func (m *RequestQuery) Reset() { *m = RequestQuery{} } +func (m *RequestQuery) String() string { return proto.CompactTextString(m) } +func (*RequestQuery) ProtoMessage() {} +func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{6} } func (m *RequestQuery) GetData() []byte { if m != nil { @@ -813,47 +640,16 @@ func (m *RequestQuery) GetProve() bool { // NOTE: validators here have empty pubkeys. type RequestBeginBlock struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header Header `protobuf:"bytes,2,opt,name=header" json:"header"` - LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo" json:"last_commit_info"` - ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header Header `protobuf:"bytes,2,opt,name=header" json:"header"` + LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo" json:"last_commit_info"` + ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators"` } -func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } -func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } -func (*RequestBeginBlock) ProtoMessage() {} -func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{7} -} -func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestBeginBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestBeginBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestBeginBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestBeginBlock.Merge(dst, src) -} -func (m *RequestBeginBlock) XXX_Size() int { - return m.Size() -} -func (m *RequestBeginBlock) XXX_DiscardUnknown() { - xxx_messageInfo_RequestBeginBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestBeginBlock proto.InternalMessageInfo +func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } +func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } +func (*RequestBeginBlock) ProtoMessage() {} +func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{7} } func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -884,44 +680,13 @@ func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { } type RequestCheckTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` } -func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } -func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{8} -} -func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestCheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestCheckTx.Merge(dst, src) -} -func (m *RequestCheckTx) XXX_Size() int { - return m.Size() -} -func (m *RequestCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestCheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestCheckTx proto.InternalMessageInfo +func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } +func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } +func (*RequestCheckTx) ProtoMessage() {} +func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} } func (m *RequestCheckTx) GetTx() []byte { if m != nil { @@ -931,44 +696,13 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestDeliverTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` } -func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } -func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } -func (*RequestDeliverTx) ProtoMessage() {} -func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{9} -} -func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestDeliverTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestDeliverTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestDeliverTx.Merge(dst, src) -} -func (m *RequestDeliverTx) XXX_Size() int { - return m.Size() -} -func (m *RequestDeliverTx) XXX_DiscardUnknown() { - xxx_messageInfo_RequestDeliverTx.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestDeliverTx proto.InternalMessageInfo +func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } +func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } +func (*RequestDeliverTx) ProtoMessage() {} +func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{9} } func (m *RequestDeliverTx) GetTx() []byte { if m != nil { @@ -978,44 +712,13 @@ func (m *RequestDeliverTx) GetTx() []byte { } type RequestEndBlock struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } -func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } -func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } -func (*RequestEndBlock) ProtoMessage() {} -func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{10} -} -func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestEndBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestEndBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestEndBlock.Merge(dst, src) -} -func (m *RequestEndBlock) XXX_Size() int { - return m.Size() -} -func (m *RequestEndBlock) XXX_DiscardUnknown() { - xxx_messageInfo_RequestEndBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestEndBlock proto.InternalMessageInfo +func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } +func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } +func (*RequestEndBlock) ProtoMessage() {} +func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{10} } func (m *RequestEndBlock) GetHeight() int64 { if m != nil { @@ -1025,43 +728,12 @@ func (m *RequestEndBlock) GetHeight() int64 { } type RequestCommit struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *RequestCommit) Reset() { *m = RequestCommit{} } -func (m *RequestCommit) String() string { return proto.CompactTextString(m) } -func (*RequestCommit) ProtoMessage() {} -func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{11} -} -func (m *RequestCommit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RequestCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RequestCommit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *RequestCommit) XXX_Merge(src proto.Message) { - xxx_messageInfo_RequestCommit.Merge(dst, src) -} -func (m *RequestCommit) XXX_Size() int { - return m.Size() -} -func (m *RequestCommit) XXX_DiscardUnknown() { - xxx_messageInfo_RequestCommit.DiscardUnknown(m) -} - -var xxx_messageInfo_RequestCommit proto.InternalMessageInfo +func (m *RequestCommit) Reset() { *m = RequestCommit{} } +func (m *RequestCommit) String() string { return proto.CompactTextString(m) } +func (*RequestCommit) ProtoMessage() {} +func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{11} } type Response struct { // Types that are valid to be assigned to Value: @@ -1077,44 +749,13 @@ type Response struct { // *Response_DeliverTx // *Response_EndBlock // *Response_Commit - Value isResponse_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value isResponse_Value `protobuf_oneof:"value"` } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{12} -} -func (m *Response) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(dst, src) -} -func (m *Response) XXX_Size() int { - return m.Size() -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{12} } type isResponse_Value interface { isResponse_Value() @@ -1463,62 +1104,62 @@ func _Response_OneofSizer(msg proto.Message) (n int) { switch x := m.Value.(type) { case *Response_Exception: s := proto.Size(x.Exception) - n += 1 // tag and wire + n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_Echo: s := proto.Size(x.Echo) - n += 1 // tag and wire + n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_Flush: s := proto.Size(x.Flush) - n += 1 // tag and wire + n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_Info: s := proto.Size(x.Info) - n += 1 // tag and wire + n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_SetOption: s := proto.Size(x.SetOption) - n += 1 // tag and wire + n += proto.SizeVarint(5<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_InitChain: s := proto.Size(x.InitChain) - n += 1 // tag and wire + n += proto.SizeVarint(6<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_Query: s := proto.Size(x.Query) - n += 1 // tag and wire + n += proto.SizeVarint(7<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_BeginBlock: s := proto.Size(x.BeginBlock) - n += 1 // tag and wire + n += proto.SizeVarint(8<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_CheckTx: s := proto.Size(x.CheckTx) - n += 1 // tag and wire + n += proto.SizeVarint(9<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_DeliverTx: s := proto.Size(x.DeliverTx) - n += 1 // tag and wire + n += proto.SizeVarint(10<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_EndBlock: s := proto.Size(x.EndBlock) - n += 1 // tag and wire + n += proto.SizeVarint(11<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Response_Commit: s := proto.Size(x.Commit) - n += 1 // tag and wire + n += proto.SizeVarint(12<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: @@ -1530,44 +1171,13 @@ func _Response_OneofSizer(msg proto.Message) (n int) { // nondeterministic type ResponseException struct { - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } -func (m *ResponseException) Reset() { *m = ResponseException{} } -func (m *ResponseException) String() string { return proto.CompactTextString(m) } -func (*ResponseException) ProtoMessage() {} -func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{13} -} -func (m *ResponseException) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseException) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseException.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseException) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseException.Merge(dst, src) -} -func (m *ResponseException) XXX_Size() int { - return m.Size() -} -func (m *ResponseException) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseException.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseException proto.InternalMessageInfo +func (m *ResponseException) Reset() { *m = ResponseException{} } +func (m *ResponseException) String() string { return proto.CompactTextString(m) } +func (*ResponseException) ProtoMessage() {} +func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{13} } func (m *ResponseException) GetError() string { if m != nil { @@ -1577,44 +1187,13 @@ func (m *ResponseException) GetError() string { } type ResponseEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } -func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } -func (*ResponseEcho) ProtoMessage() {} -func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{14} -} -func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseEcho.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseEcho) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEcho.Merge(dst, src) -} -func (m *ResponseEcho) XXX_Size() int { - return m.Size() -} -func (m *ResponseEcho) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEcho.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseEcho proto.InternalMessageInfo +func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } +func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } +func (*ResponseEcho) ProtoMessage() {} +func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{14} } func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1624,86 +1203,24 @@ func (m *ResponseEcho) GetMessage() string { } type ResponseFlush struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } -func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } -func (*ResponseFlush) ProtoMessage() {} -func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{15} -} -func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseFlush.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseFlush) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseFlush.Merge(dst, src) -} -func (m *ResponseFlush) XXX_Size() int { - return m.Size() -} -func (m *ResponseFlush) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseFlush.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseFlush proto.InternalMessageInfo +func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } +func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } +func (*ResponseFlush) ProtoMessage() {} +func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{15} } type ResponseInfo struct { - Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` + LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` } -func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } -func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } -func (*ResponseInfo) ProtoMessage() {} -func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{16} -} -func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseInfo.Merge(dst, src) -} -func (m *ResponseInfo) XXX_Size() int { - return m.Size() -} -func (m *ResponseInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseInfo proto.InternalMessageInfo +func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } +func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } +func (*ResponseInfo) ProtoMessage() {} +func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{16} } func (m *ResponseInfo) GetData() string { if m != nil { @@ -1737,45 +1254,14 @@ func (m *ResponseInfo) GetLastBlockAppHash() []byte { type ResponseSetOption struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // bytes data = 2; - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` } -func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } -func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } -func (*ResponseSetOption) ProtoMessage() {} -func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{17} -} -func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseSetOption.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseSetOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseSetOption.Merge(dst, src) -} -func (m *ResponseSetOption) XXX_Size() int { - return m.Size() -} -func (m *ResponseSetOption) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseSetOption.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseSetOption proto.InternalMessageInfo +func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } +func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } +func (*ResponseSetOption) ProtoMessage() {} +func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{17} } func (m *ResponseSetOption) GetCode() uint32 { if m != nil { @@ -1799,45 +1285,14 @@ func (m *ResponseSetOption) GetInfo() string { } type ResponseInitChain struct { - ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,2,rep,name=validators" json:"validators"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []Validator `protobuf:"bytes,2,rep,name=validators" json:"validators"` } -func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } -func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } -func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{18} -} -func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseInitChain.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseInitChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseInitChain.Merge(dst, src) -} -func (m *ResponseInitChain) XXX_Size() int { - return m.Size() -} -func (m *ResponseInitChain) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseInitChain.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseInitChain proto.InternalMessageInfo +func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } +func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } +func (*ResponseInitChain) ProtoMessage() {} +func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{18} } func (m *ResponseInitChain) GetConsensusParams() *ConsensusParams { if m != nil { @@ -1856,50 +1311,19 @@ func (m *ResponseInitChain) GetValidators() []Validator { type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // bytes data = 2; // use "value" instead. - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,8,opt,name=proof,proto3" json:"proof,omitempty"` - Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + Proof []byte `protobuf:"bytes,8,opt,name=proof,proto3" json:"proof,omitempty"` + Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` } -func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } -func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } -func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{19} -} -func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseQuery.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseQuery.Merge(dst, src) -} -func (m *ResponseQuery) XXX_Size() int { - return m.Size() -} -func (m *ResponseQuery) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseQuery proto.InternalMessageInfo +func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } +func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } +func (*ResponseQuery) ProtoMessage() {} +func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{19} } func (m *ResponseQuery) GetCode() uint32 { if m != nil { @@ -1958,44 +1382,13 @@ func (m *ResponseQuery) GetHeight() int64 { } type ResponseBeginBlock struct { - Tags []common.KVPair `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Tags []common.KVPair `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` } -func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } -func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseBeginBlock) ProtoMessage() {} -func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{20} -} -func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseBeginBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseBeginBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseBeginBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseBeginBlock.Merge(dst, src) -} -func (m *ResponseBeginBlock) XXX_Size() int { - return m.Size() -} -func (m *ResponseBeginBlock) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseBeginBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseBeginBlock proto.InternalMessageInfo +func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } +func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } +func (*ResponseBeginBlock) ProtoMessage() {} +func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{20} } func (m *ResponseBeginBlock) GetTags() []common.KVPair { if m != nil { @@ -2005,50 +1398,19 @@ func (m *ResponseBeginBlock) GetTags() []common.KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` } -func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } -func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } -func (*ResponseCheckTx) ProtoMessage() {} -func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{21} -} -func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseCheckTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseCheckTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseCheckTx.Merge(dst, src) -} -func (m *ResponseCheckTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseCheckTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseCheckTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseCheckTx proto.InternalMessageInfo +func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } +func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } +func (*ResponseCheckTx) ProtoMessage() {} +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{21} } func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { @@ -2100,50 +1462,19 @@ func (m *ResponseCheckTx) GetTags() []common.KVPair { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` } -func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } -func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } -func (*ResponseDeliverTx) ProtoMessage() {} -func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{22} -} -func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseDeliverTx.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseDeliverTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseDeliverTx.Merge(dst, src) -} -func (m *ResponseDeliverTx) XXX_Size() int { - return m.Size() -} -func (m *ResponseDeliverTx) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseDeliverTx.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseDeliverTx proto.InternalMessageInfo +func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } +func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } +func (*ResponseDeliverTx) ProtoMessage() {} +func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{22} } func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { @@ -2198,43 +1529,12 @@ type ResponseEndBlock struct { ValidatorUpdates []Validator `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } -func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{23} -} -func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseEndBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseEndBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseEndBlock.Merge(dst, src) -} -func (m *ResponseEndBlock) XXX_Size() int { - return m.Size() -} -func (m *ResponseEndBlock) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseEndBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo +func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } +func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } +func (*ResponseEndBlock) ProtoMessage() {} +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{23} } func (m *ResponseEndBlock) GetValidatorUpdates() []Validator { if m != nil { @@ -2259,44 +1559,13 @@ func (m *ResponseEndBlock) GetTags() []common.KVPair { type ResponseCommit struct { // reserve 1 - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } -func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } -func (*ResponseCommit) ProtoMessage() {} -func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{24} -} -func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResponseCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResponseCommit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ResponseCommit) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResponseCommit.Merge(dst, src) -} -func (m *ResponseCommit) XXX_Size() int { - return m.Size() -} -func (m *ResponseCommit) XXX_DiscardUnknown() { - xxx_messageInfo_ResponseCommit.DiscardUnknown(m) -} - -var xxx_messageInfo_ResponseCommit proto.InternalMessageInfo +func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } +func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } +func (*ResponseCommit) ProtoMessage() {} +func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{24} } func (m *ResponseCommit) GetData() []byte { if m != nil { @@ -2308,46 +1577,15 @@ func (m *ResponseCommit) GetData() []byte { // ConsensusParams contains all consensus-relevant parameters // that can be adjusted by the abci app type ConsensusParams struct { - BlockSize *BlockSize `protobuf:"bytes,1,opt,name=block_size,json=blockSize" json:"block_size,omitempty"` - TxSize *TxSize `protobuf:"bytes,2,opt,name=tx_size,json=txSize" json:"tx_size,omitempty"` - BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=block_gossip,json=blockGossip" json:"block_gossip,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + BlockSize *BlockSize `protobuf:"bytes,1,opt,name=block_size,json=blockSize" json:"block_size,omitempty"` + TxSize *TxSize `protobuf:"bytes,2,opt,name=tx_size,json=txSize" json:"tx_size,omitempty"` + BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=block_gossip,json=blockGossip" json:"block_gossip,omitempty"` } -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{25} -} -func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *ConsensusParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParams.Merge(dst, src) -} -func (m *ConsensusParams) XXX_Size() int { - return m.Size() -} -func (m *ConsensusParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo +func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } +func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } +func (*ConsensusParams) ProtoMessage() {} +func (*ConsensusParams) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{25} } func (m *ConsensusParams) GetBlockSize() *BlockSize { if m != nil { @@ -2372,46 +1610,15 @@ func (m *ConsensusParams) GetBlockGossip() *BlockGossip { // BlockSize contains limits on the block size. type BlockSize struct { - MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - MaxTxs int32 `protobuf:"varint,2,opt,name=max_txs,json=maxTxs,proto3" json:"max_txs,omitempty"` - MaxGas int64 `protobuf:"varint,3,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + MaxTxs int32 `protobuf:"varint,2,opt,name=max_txs,json=maxTxs,proto3" json:"max_txs,omitempty"` + MaxGas int64 `protobuf:"varint,3,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` } -func (m *BlockSize) Reset() { *m = BlockSize{} } -func (m *BlockSize) String() string { return proto.CompactTextString(m) } -func (*BlockSize) ProtoMessage() {} -func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{26} -} -func (m *BlockSize) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockSize.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *BlockSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockSize.Merge(dst, src) -} -func (m *BlockSize) XXX_Size() int { - return m.Size() -} -func (m *BlockSize) XXX_DiscardUnknown() { - xxx_messageInfo_BlockSize.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockSize proto.InternalMessageInfo +func (m *BlockSize) Reset() { *m = BlockSize{} } +func (m *BlockSize) String() string { return proto.CompactTextString(m) } +func (*BlockSize) ProtoMessage() {} +func (*BlockSize) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{26} } func (m *BlockSize) GetMaxBytes() int32 { if m != nil { @@ -2436,45 +1643,14 @@ func (m *BlockSize) GetMaxGas() int64 { // TxSize contains limits on the tx size. type TxSize struct { - MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` } -func (m *TxSize) Reset() { *m = TxSize{} } -func (m *TxSize) String() string { return proto.CompactTextString(m) } -func (*TxSize) ProtoMessage() {} -func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{27} -} -func (m *TxSize) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxSize.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *TxSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxSize.Merge(dst, src) -} -func (m *TxSize) XXX_Size() int { - return m.Size() -} -func (m *TxSize) XXX_DiscardUnknown() { - xxx_messageInfo_TxSize.DiscardUnknown(m) -} - -var xxx_messageInfo_TxSize proto.InternalMessageInfo +func (m *TxSize) Reset() { *m = TxSize{} } +func (m *TxSize) String() string { return proto.CompactTextString(m) } +func (*TxSize) ProtoMessage() {} +func (*TxSize) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } func (m *TxSize) GetMaxBytes() int32 { if m != nil { @@ -2494,44 +1670,13 @@ func (m *TxSize) GetMaxGas() int64 { // elements of how blocks are gossiped type BlockGossip struct { // Note: must not be 0 - BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=block_part_size_bytes,json=blockPartSizeBytes,proto3" json:"block_part_size_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=block_part_size_bytes,json=blockPartSizeBytes,proto3" json:"block_part_size_bytes,omitempty"` } -func (m *BlockGossip) Reset() { *m = BlockGossip{} } -func (m *BlockGossip) String() string { return proto.CompactTextString(m) } -func (*BlockGossip) ProtoMessage() {} -func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{28} -} -func (m *BlockGossip) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockGossip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockGossip.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *BlockGossip) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockGossip.Merge(dst, src) -} -func (m *BlockGossip) XXX_Size() int { - return m.Size() -} -func (m *BlockGossip) XXX_DiscardUnknown() { - xxx_messageInfo_BlockGossip.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockGossip proto.InternalMessageInfo +func (m *BlockGossip) Reset() { *m = BlockGossip{} } +func (m *BlockGossip) String() string { return proto.CompactTextString(m) } +func (*BlockGossip) ProtoMessage() {} +func (*BlockGossip) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{28} } func (m *BlockGossip) GetBlockPartSizeBytes() int32 { if m != nil { @@ -2541,45 +1686,14 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { } type LastCommitInfo struct { - CommitRound int32 `protobuf:"varint,1,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` - Validators []SigningValidator `protobuf:"bytes,2,rep,name=validators" json:"validators"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CommitRound int32 `protobuf:"varint,1,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` + Validators []SigningValidator `protobuf:"bytes,2,rep,name=validators" json:"validators"` } -func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } -func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } -func (*LastCommitInfo) ProtoMessage() {} -func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{29} -} -func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LastCommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LastCommitInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *LastCommitInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastCommitInfo.Merge(dst, src) -} -func (m *LastCommitInfo) XXX_Size() int { - return m.Size() -} -func (m *LastCommitInfo) XXX_DiscardUnknown() { - xxx_messageInfo_LastCommitInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo +func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } +func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } +func (*LastCommitInfo) ProtoMessage() {} +func (*LastCommitInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } func (m *LastCommitInfo) GetCommitRound() int32 { if m != nil { @@ -2608,50 +1722,20 @@ type Header struct { LastCommitHash []byte `protobuf:"bytes,7,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,8,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` // hashes from the app output from the prev block - ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` - AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + NextValidatorsHash []byte `protobuf:"bytes,10,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + ConsensusHash []byte `protobuf:"bytes,11,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + AppHash []byte `protobuf:"bytes,12,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,13,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` // consensus info - EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + EvidenceHash []byte `protobuf:"bytes,14,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` + ProposerAddress []byte `protobuf:"bytes,15,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` } -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{30} -} -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(dst, src) -} -func (m *Header) XXX_Size() int { - return m.Size() -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{30} } func (m *Header) GetChainID() string { if m != nil { @@ -2716,6 +1800,13 @@ func (m *Header) GetValidatorsHash() []byte { return nil } +func (m *Header) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash + } + return nil +} + func (m *Header) GetConsensusHash() []byte { if m != nil { return m.ConsensusHash @@ -2752,45 +1843,14 @@ func (m *Header) GetProposerAddress() []byte { } type BlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader" json:"parts_header"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader" json:"parts_header"` } -func (m *BlockID) Reset() { *m = BlockID{} } -func (m *BlockID) String() string { return proto.CompactTextString(m) } -func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{31} -} -func (m *BlockID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *BlockID) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockID.Merge(dst, src) -} -func (m *BlockID) XXX_Size() int { - return m.Size() -} -func (m *BlockID) XXX_DiscardUnknown() { - xxx_messageInfo_BlockID.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockID proto.InternalMessageInfo +func (m *BlockID) Reset() { *m = BlockID{} } +func (m *BlockID) String() string { return proto.CompactTextString(m) } +func (*BlockID) ProtoMessage() {} +func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{31} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -2807,45 +1867,14 @@ func (m *BlockID) GetPartsHeader() PartSetHeader { } type PartSetHeader struct { - Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } -func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } -func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{32} -} -func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *PartSetHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartSetHeader.Merge(dst, src) -} -func (m *PartSetHeader) XXX_Size() int { - return m.Size() -} -func (m *PartSetHeader) XXX_DiscardUnknown() { - xxx_messageInfo_PartSetHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{32} } func (m *PartSetHeader) GetTotal() int32 { if m != nil { @@ -2863,46 +1892,15 @@ func (m *PartSetHeader) GetHash() []byte { // Validator type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey PubKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"` - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey PubKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"` + Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` } -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{33} -} -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(dst, src) -} -func (m *Validator) XXX_Size() int { - return m.Size() -} -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) -} - -var xxx_messageInfo_Validator proto.InternalMessageInfo +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{33} } func (m *Validator) GetAddress() []byte { if m != nil { @@ -2927,45 +1925,14 @@ func (m *Validator) GetPower() int64 { // Validator with an extra bool type SigningValidator struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` + SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` } -func (m *SigningValidator) Reset() { *m = SigningValidator{} } -func (m *SigningValidator) String() string { return proto.CompactTextString(m) } -func (*SigningValidator) ProtoMessage() {} -func (*SigningValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{34} -} -func (m *SigningValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SigningValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SigningValidator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *SigningValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_SigningValidator.Merge(dst, src) -} -func (m *SigningValidator) XXX_Size() int { - return m.Size() -} -func (m *SigningValidator) XXX_DiscardUnknown() { - xxx_messageInfo_SigningValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_SigningValidator proto.InternalMessageInfo +func (m *SigningValidator) Reset() { *m = SigningValidator{} } +func (m *SigningValidator) String() string { return proto.CompactTextString(m) } +func (*SigningValidator) ProtoMessage() {} +func (*SigningValidator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{34} } func (m *SigningValidator) GetValidator() Validator { if m != nil { @@ -2982,45 +1949,14 @@ func (m *SigningValidator) GetSignedLastBlock() bool { } type PubKey struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (m *PubKey) Reset() { *m = PubKey{} } -func (m *PubKey) String() string { return proto.CompactTextString(m) } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{35} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(dst, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo +func (m *PubKey) Reset() { *m = PubKey{} } +func (m *PubKey) String() string { return proto.CompactTextString(m) } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{35} } func (m *PubKey) GetType() string { if m != nil { @@ -3037,48 +1973,17 @@ func (m *PubKey) GetData() []byte { } type Evidence struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Validator Validator `protobuf:"bytes,2,opt,name=validator" json:"validator"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,4,opt,name=time,stdtime" json:"time"` - TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Validator Validator `protobuf:"bytes,2,opt,name=validator" json:"validator"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,4,opt,name=time,stdtime" json:"time"` + TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` } -func (m *Evidence) Reset() { *m = Evidence{} } -func (m *Evidence) String() string { return proto.CompactTextString(m) } -func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_7077ff64ad2a8940, []int{36} -} -func (m *Evidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *Evidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_Evidence.Merge(dst, src) -} -func (m *Evidence) XXX_Size() int { - return m.Size() -} -func (m *Evidence) XXX_DiscardUnknown() { - xxx_messageInfo_Evidence.DiscardUnknown(m) -} - -var xxx_messageInfo_Evidence proto.InternalMessageInfo +func (m *Evidence) Reset() { *m = Evidence{} } +func (m *Evidence) String() string { return proto.CompactTextString(m) } +func (*Evidence) ProtoMessage() {} +func (*Evidence) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{36} } func (m *Evidence) GetType() string { if m != nil { @@ -3219,9 +2124,6 @@ func (this *Request) Equal(that interface{}) bool { } else if !this.Value.Equal(that1.Value) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Request_Echo) Equal(that interface{}) bool { @@ -3510,9 +2412,6 @@ func (this *RequestEcho) Equal(that interface{}) bool { if this.Message != that1.Message { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestFlush) Equal(that interface{}) bool { @@ -3534,9 +2433,6 @@ func (this *RequestFlush) Equal(that interface{}) bool { } else if this == nil { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestInfo) Equal(that interface{}) bool { @@ -3561,9 +2457,6 @@ func (this *RequestInfo) Equal(that interface{}) bool { if this.Version != that1.Version { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestSetOption) Equal(that interface{}) bool { @@ -3591,9 +2484,6 @@ func (this *RequestSetOption) Equal(that interface{}) bool { if this.Value != that1.Value { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestInitChain) Equal(that interface{}) bool { @@ -3635,9 +2525,6 @@ func (this *RequestInitChain) Equal(that interface{}) bool { if !bytes.Equal(this.AppStateBytes, that1.AppStateBytes) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestQuery) Equal(that interface{}) bool { @@ -3671,9 +2558,6 @@ func (this *RequestQuery) Equal(that interface{}) bool { if this.Prove != that1.Prove { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestBeginBlock) Equal(that interface{}) bool { @@ -3712,9 +2596,6 @@ func (this *RequestBeginBlock) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestCheckTx) Equal(that interface{}) bool { @@ -3739,9 +2620,6 @@ func (this *RequestCheckTx) Equal(that interface{}) bool { if !bytes.Equal(this.Tx, that1.Tx) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestDeliverTx) Equal(that interface{}) bool { @@ -3766,9 +2644,6 @@ func (this *RequestDeliverTx) Equal(that interface{}) bool { if !bytes.Equal(this.Tx, that1.Tx) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestEndBlock) Equal(that interface{}) bool { @@ -3793,9 +2668,6 @@ func (this *RequestEndBlock) Equal(that interface{}) bool { if this.Height != that1.Height { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *RequestCommit) Equal(that interface{}) bool { @@ -3817,9 +2689,6 @@ func (this *RequestCommit) Equal(that interface{}) bool { } else if this == nil { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Response) Equal(that interface{}) bool { @@ -3850,9 +2719,6 @@ func (this *Response) Equal(that interface{}) bool { } else if !this.Value.Equal(that1.Value) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Response_Exception) Equal(that interface{}) bool { @@ -4165,9 +3031,6 @@ func (this *ResponseException) Equal(that interface{}) bool { if this.Error != that1.Error { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseEcho) Equal(that interface{}) bool { @@ -4192,9 +3055,6 @@ func (this *ResponseEcho) Equal(that interface{}) bool { if this.Message != that1.Message { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseFlush) Equal(that interface{}) bool { @@ -4216,9 +3076,6 @@ func (this *ResponseFlush) Equal(that interface{}) bool { } else if this == nil { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseInfo) Equal(that interface{}) bool { @@ -4252,9 +3109,6 @@ func (this *ResponseInfo) Equal(that interface{}) bool { if !bytes.Equal(this.LastBlockAppHash, that1.LastBlockAppHash) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseSetOption) Equal(that interface{}) bool { @@ -4285,9 +3139,6 @@ func (this *ResponseSetOption) Equal(that interface{}) bool { if this.Info != that1.Info { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseInitChain) Equal(that interface{}) bool { @@ -4320,9 +3171,6 @@ func (this *ResponseInitChain) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseQuery) Equal(that interface{}) bool { @@ -4368,9 +3216,6 @@ func (this *ResponseQuery) Equal(that interface{}) bool { if this.Height != that1.Height { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseBeginBlock) Equal(that interface{}) bool { @@ -4400,9 +3245,6 @@ func (this *ResponseBeginBlock) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseCheckTx) Equal(that interface{}) bool { @@ -4450,9 +3292,6 @@ func (this *ResponseCheckTx) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseDeliverTx) Equal(that interface{}) bool { @@ -4500,9 +3339,6 @@ func (this *ResponseDeliverTx) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseEndBlock) Equal(that interface{}) bool { @@ -4543,9 +3379,6 @@ func (this *ResponseEndBlock) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ResponseCommit) Equal(that interface{}) bool { @@ -4570,9 +3403,6 @@ func (this *ResponseCommit) Equal(that interface{}) bool { if !bytes.Equal(this.Data, that1.Data) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *ConsensusParams) Equal(that interface{}) bool { @@ -4603,9 +3433,6 @@ func (this *ConsensusParams) Equal(that interface{}) bool { if !this.BlockGossip.Equal(that1.BlockGossip) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *BlockSize) Equal(that interface{}) bool { @@ -4636,9 +3463,6 @@ func (this *BlockSize) Equal(that interface{}) bool { if this.MaxGas != that1.MaxGas { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *TxSize) Equal(that interface{}) bool { @@ -4666,9 +3490,6 @@ func (this *TxSize) Equal(that interface{}) bool { if this.MaxGas != that1.MaxGas { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *BlockGossip) Equal(that interface{}) bool { @@ -4693,9 +3514,6 @@ func (this *BlockGossip) Equal(that interface{}) bool { if this.BlockPartSizeBytes != that1.BlockPartSizeBytes { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *LastCommitInfo) Equal(that interface{}) bool { @@ -4728,9 +3546,6 @@ func (this *LastCommitInfo) Equal(that interface{}) bool { return false } } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Header) Equal(that interface{}) bool { @@ -4779,6 +3594,9 @@ func (this *Header) Equal(that interface{}) bool { if !bytes.Equal(this.ValidatorsHash, that1.ValidatorsHash) { return false } + if !bytes.Equal(this.NextValidatorsHash, that1.NextValidatorsHash) { + return false + } if !bytes.Equal(this.ConsensusHash, that1.ConsensusHash) { return false } @@ -4794,9 +3612,6 @@ func (this *Header) Equal(that interface{}) bool { if !bytes.Equal(this.ProposerAddress, that1.ProposerAddress) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *BlockID) Equal(that interface{}) bool { @@ -4824,9 +3639,6 @@ func (this *BlockID) Equal(that interface{}) bool { if !this.PartsHeader.Equal(&that1.PartsHeader) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *PartSetHeader) Equal(that interface{}) bool { @@ -4854,9 +3666,6 @@ func (this *PartSetHeader) Equal(that interface{}) bool { if !bytes.Equal(this.Hash, that1.Hash) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Validator) Equal(that interface{}) bool { @@ -4887,9 +3696,6 @@ func (this *Validator) Equal(that interface{}) bool { if this.Power != that1.Power { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *SigningValidator) Equal(that interface{}) bool { @@ -4917,9 +3723,6 @@ func (this *SigningValidator) Equal(that interface{}) bool { if this.SignedLastBlock != that1.SignedLastBlock { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *PubKey) Equal(that interface{}) bool { @@ -4947,9 +3750,6 @@ func (this *PubKey) Equal(that interface{}) bool { if !bytes.Equal(this.Data, that1.Data) { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } func (this *Evidence) Equal(that interface{}) bool { @@ -4986,9 +3786,6 @@ func (this *Evidence) Equal(that interface{}) bool { if this.TotalVotingPower != that1.TotalVotingPower { return false } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } return true } @@ -5027,7 +3824,7 @@ func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { out := new(ResponseEcho) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5036,7 +3833,7 @@ func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { out := new(ResponseFlush) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5045,7 +3842,7 @@ func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opt func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { out := new(ResponseInfo) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5054,7 +3851,7 @@ func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) { out := new(ResponseSetOption) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5063,7 +3860,7 @@ func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *RequestSetOpt func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { out := new(ResponseDeliverTx) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5072,7 +3869,7 @@ func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDelive func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { out := new(ResponseCheckTx) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5081,7 +3878,7 @@ func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { out := new(ResponseQuery) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5090,7 +3887,7 @@ func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opt func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5099,7 +3896,7 @@ func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, o func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { out := new(ResponseInitChain) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5108,7 +3905,7 @@ func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitCh func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) { out := new(ResponseBeginBlock) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5117,7 +3914,7 @@ func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBegin func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { out := new(ResponseEndBlock) - err := c.cc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -5417,9 +4214,6 @@ func (m *Request) MarshalTo(dAtA []byte) (int, error) { } i += nn1 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5600,9 +4394,6 @@ func (m *RequestEcho) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5621,9 +4412,6 @@ func (m *RequestFlush) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5648,9 +4436,6 @@ func (m *RequestInfo) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) i += copy(dAtA[i:], m.Version) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5681,9 +4466,6 @@ func (m *RequestSetOption) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5704,8 +4486,8 @@ func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0xa i++ - i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) - n13, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) + n13, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -5744,9 +4526,6 @@ func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) i += copy(dAtA[i:], m.AppStateBytes) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5792,9 +4571,6 @@ func (m *RequestQuery) MarshalTo(dAtA []byte) (int, error) { } i++ } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5847,9 +4623,6 @@ func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5874,9 +4647,6 @@ func (m *RequestCheckTx) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) i += copy(dAtA[i:], m.Tx) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5901,9 +4671,6 @@ func (m *RequestDeliverTx) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) i += copy(dAtA[i:], m.Tx) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5927,9 +4694,6 @@ func (m *RequestEndBlock) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Height)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5948,9 +4712,6 @@ func (m *RequestCommit) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -5976,9 +4737,6 @@ func (m *Response) MarshalTo(dAtA []byte) (int, error) { } i += nn17 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6171,9 +4929,6 @@ func (m *ResponseException) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6198,9 +4953,6 @@ func (m *ResponseEcho) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6219,9 +4971,6 @@ func (m *ResponseFlush) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6263,9 +5012,6 @@ func (m *ResponseInfo) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.LastBlockAppHash))) i += copy(dAtA[i:], m.LastBlockAppHash) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6301,9 +5047,6 @@ func (m *ResponseSetOption) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) i += copy(dAtA[i:], m.Info) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6344,9 +5087,6 @@ func (m *ResponseInitChain) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6410,9 +5150,6 @@ func (m *ResponseQuery) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Height)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6443,9 +5180,6 @@ func (m *ResponseBeginBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6509,9 +5243,6 @@ func (m *ResponseCheckTx) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6575,9 +5306,6 @@ func (m *ResponseDeliverTx) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6630,9 +5358,6 @@ func (m *ResponseEndBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6657,9 +5382,6 @@ func (m *ResponseCommit) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) i += copy(dAtA[i:], m.Data) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6708,9 +5430,6 @@ func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { } i += n34 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6744,9 +5463,6 @@ func (m *BlockSize) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6775,9 +5491,6 @@ func (m *TxSize) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6801,9 +5514,6 @@ func (m *BlockGossip) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.BlockPartSizeBytes)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6839,9 +5549,6 @@ func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { i += n } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6873,8 +5580,8 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x1a i++ - i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) - n35, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) + n35, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -6915,39 +5622,42 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) i += copy(dAtA[i:], m.ValidatorsHash) } - if len(m.ConsensusHash) > 0 { + if len(m.NextValidatorsHash) > 0 { dAtA[i] = 0x52 i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i += copy(dAtA[i:], m.NextValidatorsHash) + } + if len(m.ConsensusHash) > 0 { + dAtA[i] = 0x5a + i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) i += copy(dAtA[i:], m.ConsensusHash) } if len(m.AppHash) > 0 { - dAtA[i] = 0x5a + dAtA[i] = 0x62 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) i += copy(dAtA[i:], m.AppHash) } if len(m.LastResultsHash) > 0 { - dAtA[i] = 0x62 + dAtA[i] = 0x6a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) i += copy(dAtA[i:], m.LastResultsHash) } if len(m.EvidenceHash) > 0 { - dAtA[i] = 0x6a + dAtA[i] = 0x72 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) i += copy(dAtA[i:], m.EvidenceHash) } if len(m.ProposerAddress) > 0 { - dAtA[i] = 0x72 + dAtA[i] = 0x7a i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) i += copy(dAtA[i:], m.ProposerAddress) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -6980,9 +5690,6 @@ func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n37 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7012,9 +5719,6 @@ func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) i += copy(dAtA[i:], m.Hash) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7052,9 +5756,6 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Power)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7091,9 +5792,6 @@ func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { } i++ } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7124,9 +5822,6 @@ func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) i += copy(dAtA[i:], m.Data) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7166,8 +5861,8 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x22 i++ - i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) - n41, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) + n41, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -7177,9 +5872,6 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } return i, nil } @@ -7220,7 +5912,6 @@ func NewPopulatedRequest(r randyTypes, easy bool) *Request { this.Value = NewPopulatedRequest_DeliverTx(r, easy) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 20) } return this } @@ -7284,7 +5975,6 @@ func NewPopulatedRequestEcho(r randyTypes, easy bool) *RequestEcho { this := &RequestEcho{} this.Message = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7292,7 +5982,6 @@ func NewPopulatedRequestEcho(r randyTypes, easy bool) *RequestEcho { func NewPopulatedRequestFlush(r randyTypes, easy bool) *RequestFlush { this := &RequestFlush{} if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -7301,7 +5990,6 @@ func NewPopulatedRequestInfo(r randyTypes, easy bool) *RequestInfo { this := &RequestInfo{} this.Version = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7311,14 +5999,13 @@ func NewPopulatedRequestSetOption(r randyTypes, easy bool) *RequestSetOption { this.Key = string(randStringTypes(r)) this.Value = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { this := &RequestInitChain{} - v1 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) + v1 := types1.NewPopulatedStdTime(r, easy) this.Time = *v1 this.ChainId = string(randStringTypes(r)) if r.Intn(10) != 0 { @@ -7338,7 +6025,6 @@ func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { this.AppStateBytes[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 6) } return this } @@ -7357,7 +6043,6 @@ func NewPopulatedRequestQuery(r randyTypes, easy bool) *RequestQuery { } this.Prove = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -7382,7 +6067,6 @@ func NewPopulatedRequestBeginBlock(r randyTypes, easy bool) *RequestBeginBlock { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -7395,7 +6079,6 @@ func NewPopulatedRequestCheckTx(r randyTypes, easy bool) *RequestCheckTx { this.Tx[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7408,7 +6091,6 @@ func NewPopulatedRequestDeliverTx(r randyTypes, easy bool) *RequestDeliverTx { this.Tx[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7420,7 +6102,6 @@ func NewPopulatedRequestEndBlock(r randyTypes, easy bool) *RequestEndBlock { this.Height *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7428,7 +6109,6 @@ func NewPopulatedRequestEndBlock(r randyTypes, easy bool) *RequestEndBlock { func NewPopulatedRequestCommit(r randyTypes, easy bool) *RequestCommit { this := &RequestCommit{} if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -7463,7 +6143,6 @@ func NewPopulatedResponse(r randyTypes, easy bool) *Response { this.Value = NewPopulatedResponse_Commit(r, easy) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 13) } return this } @@ -7532,7 +6211,6 @@ func NewPopulatedResponseException(r randyTypes, easy bool) *ResponseException { this := &ResponseException{} this.Error = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7541,7 +6219,6 @@ func NewPopulatedResponseEcho(r randyTypes, easy bool) *ResponseEcho { this := &ResponseEcho{} this.Message = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7549,7 +6226,6 @@ func NewPopulatedResponseEcho(r randyTypes, easy bool) *ResponseEcho { func NewPopulatedResponseFlush(r randyTypes, easy bool) *ResponseFlush { this := &ResponseFlush{} if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -7568,7 +6244,6 @@ func NewPopulatedResponseInfo(r randyTypes, easy bool) *ResponseInfo { this.LastBlockAppHash[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -7579,7 +6254,6 @@ func NewPopulatedResponseSetOption(r randyTypes, easy bool) *ResponseSetOption { this.Log = string(randStringTypes(r)) this.Info = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -7598,7 +6272,6 @@ func NewPopulatedResponseInitChain(r randyTypes, easy bool) *ResponseInitChain { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7632,7 +6305,6 @@ func NewPopulatedResponseQuery(r randyTypes, easy bool) *ResponseQuery { this.Height *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 10) } return this } @@ -7648,7 +6320,6 @@ func NewPopulatedResponseBeginBlock(r randyTypes, easy bool) *ResponseBeginBlock } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7680,7 +6351,6 @@ func NewPopulatedResponseCheckTx(r randyTypes, easy bool) *ResponseCheckTx { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 8) } return this } @@ -7712,7 +6382,6 @@ func NewPopulatedResponseDeliverTx(r randyTypes, easy bool) *ResponseDeliverTx { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 8) } return this } @@ -7739,7 +6408,6 @@ func NewPopulatedResponseEndBlock(r randyTypes, easy bool) *ResponseEndBlock { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -7752,7 +6420,6 @@ func NewPopulatedResponseCommit(r randyTypes, easy bool) *ResponseCommit { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7769,7 +6436,6 @@ func NewPopulatedConsensusParams(r randyTypes, easy bool) *ConsensusParams { this.BlockGossip = NewPopulatedBlockGossip(r, easy) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -7789,7 +6455,6 @@ func NewPopulatedBlockSize(r randyTypes, easy bool) *BlockSize { this.MaxGas *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -7805,7 +6470,6 @@ func NewPopulatedTxSize(r randyTypes, easy bool) *TxSize { this.MaxGas *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7817,7 +6481,6 @@ func NewPopulatedBlockGossip(r randyTypes, easy bool) *BlockGossip { this.BlockPartSizeBytes *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -7837,7 +6500,6 @@ func NewPopulatedLastCommitInfo(r randyTypes, easy bool) *LastCommitInfo { } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7849,7 +6511,7 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { if r.Intn(2) == 0 { this.Height *= -1 } - v34 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) + v34 := types1.NewPopulatedStdTime(r, easy) this.Time = *v34 this.NumTxs = int64(r.Int63()) if r.Intn(2) == 0 { @@ -7877,47 +6539,50 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { this.ValidatorsHash[i] = byte(r.Intn(256)) } v39 := r.Intn(100) - this.ConsensusHash = make([]byte, v39) + this.NextValidatorsHash = make([]byte, v39) for i := 0; i < v39; i++ { - this.ConsensusHash[i] = byte(r.Intn(256)) + this.NextValidatorsHash[i] = byte(r.Intn(256)) } v40 := r.Intn(100) - this.AppHash = make([]byte, v40) + this.ConsensusHash = make([]byte, v40) for i := 0; i < v40; i++ { - this.AppHash[i] = byte(r.Intn(256)) + this.ConsensusHash[i] = byte(r.Intn(256)) } v41 := r.Intn(100) - this.LastResultsHash = make([]byte, v41) + this.AppHash = make([]byte, v41) for i := 0; i < v41; i++ { - this.LastResultsHash[i] = byte(r.Intn(256)) + this.AppHash[i] = byte(r.Intn(256)) } v42 := r.Intn(100) - this.EvidenceHash = make([]byte, v42) + this.LastResultsHash = make([]byte, v42) for i := 0; i < v42; i++ { - this.EvidenceHash[i] = byte(r.Intn(256)) + this.LastResultsHash[i] = byte(r.Intn(256)) } v43 := r.Intn(100) - this.ProposerAddress = make([]byte, v43) + this.EvidenceHash = make([]byte, v43) for i := 0; i < v43; i++ { + this.EvidenceHash[i] = byte(r.Intn(256)) + } + v44 := r.Intn(100) + this.ProposerAddress = make([]byte, v44) + for i := 0; i < v44; i++ { this.ProposerAddress[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 15) } return this } func NewPopulatedBlockID(r randyTypes, easy bool) *BlockID { this := &BlockID{} - v44 := r.Intn(100) - this.Hash = make([]byte, v44) - for i := 0; i < v44; i++ { + v45 := r.Intn(100) + this.Hash = make([]byte, v45) + for i := 0; i < v45; i++ { this.Hash[i] = byte(r.Intn(256)) } - v45 := NewPopulatedPartSetHeader(r, easy) - this.PartsHeader = *v45 + v46 := NewPopulatedPartSetHeader(r, easy) + this.PartsHeader = *v46 if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7928,43 +6593,40 @@ func NewPopulatedPartSetHeader(r randyTypes, easy bool) *PartSetHeader { if r.Intn(2) == 0 { this.Total *= -1 } - v46 := r.Intn(100) - this.Hash = make([]byte, v46) - for i := 0; i < v46; i++ { + v47 := r.Intn(100) + this.Hash = make([]byte, v47) + for i := 0; i < v47; i++ { this.Hash[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } func NewPopulatedValidator(r randyTypes, easy bool) *Validator { this := &Validator{} - v47 := r.Intn(100) - this.Address = make([]byte, v47) - for i := 0; i < v47; i++ { + v48 := r.Intn(100) + this.Address = make([]byte, v48) + for i := 0; i < v48; i++ { this.Address[i] = byte(r.Intn(256)) } - v48 := NewPopulatedPubKey(r, easy) - this.PubKey = *v48 + v49 := NewPopulatedPubKey(r, easy) + this.PubKey = *v49 this.Power = int64(r.Int63()) if r.Intn(2) == 0 { this.Power *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { this := &SigningValidator{} - v49 := NewPopulatedValidator(r, easy) - this.Validator = *v49 + v50 := NewPopulatedValidator(r, easy) + this.Validator = *v50 this.SignedLastBlock = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7972,13 +6634,12 @@ func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { this := &PubKey{} this.Type = string(randStringTypes(r)) - v50 := r.Intn(100) - this.Data = make([]byte, v50) - for i := 0; i < v50; i++ { + v51 := r.Intn(100) + this.Data = make([]byte, v51) + for i := 0; i < v51; i++ { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -7986,20 +6647,19 @@ func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { func NewPopulatedEvidence(r randyTypes, easy bool) *Evidence { this := &Evidence{} this.Type = string(randStringTypes(r)) - v51 := NewPopulatedValidator(r, easy) - this.Validator = *v51 + v52 := NewPopulatedValidator(r, easy) + this.Validator = *v52 this.Height = int64(r.Int63()) if r.Intn(2) == 0 { this.Height *= -1 } - v52 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) - this.Time = *v52 + v53 := types1.NewPopulatedStdTime(r, easy) + this.Time = *v53 this.TotalVotingPower = int64(r.Int63()) if r.Intn(2) == 0 { this.TotalVotingPower *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 6) } return this } @@ -8023,9 +6683,9 @@ func randUTF8RuneTypes(r randyTypes) rune { return rune(ru + 61) } func randStringTypes(r randyTypes) string { - v53 := r.Intn(100) - tmps := make([]rune, v53) - for i := 0; i < v53; i++ { + v54 := r.Intn(100) + tmps := make([]rune, v54) + for i := 0; i < v54; i++ { tmps[i] = randUTF8RuneTypes(r) } return string(tmps) @@ -8047,11 +6707,11 @@ func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte switch wire { case 0: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) - v54 := r.Int63() + v55 := r.Int63() if r.Intn(2) == 0 { - v54 *= -1 + v55 *= -1 } - dAtA = encodeVarintPopulateTypes(dAtA, uint64(v54)) + dAtA = encodeVarintPopulateTypes(dAtA, uint64(v55)) case 1: dAtA = encodeVarintPopulateTypes(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) @@ -8082,9 +6742,6 @@ func (m *Request) Size() (n int) { if m.Value != nil { n += m.Value.Size() } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8194,18 +6851,12 @@ func (m *RequestEcho) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } func (m *RequestFlush) Size() (n int) { var l int _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8216,9 +6867,6 @@ func (m *RequestInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8233,16 +6881,13 @@ func (m *RequestSetOption) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } func (m *RequestInitChain) Size() (n int) { var l int _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + l = types1.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) l = len(m.ChainId) if l > 0 { @@ -8262,9 +6907,6 @@ func (m *RequestInitChain) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8285,9 +6927,6 @@ func (m *RequestQuery) Size() (n int) { if m.Prove { n += 2 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8308,9 +6947,6 @@ func (m *RequestBeginBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8321,9 +6957,6 @@ func (m *RequestCheckTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8334,9 +6967,6 @@ func (m *RequestDeliverTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8346,18 +6976,12 @@ func (m *RequestEndBlock) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } func (m *RequestCommit) Size() (n int) { var l int _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8367,9 +6991,6 @@ func (m *Response) Size() (n int) { if m.Value != nil { n += m.Value.Size() } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8488,9 +7109,6 @@ func (m *ResponseException) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8501,18 +7119,12 @@ func (m *ResponseEcho) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } func (m *ResponseFlush) Size() (n int) { var l int _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8534,9 +7146,6 @@ func (m *ResponseInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8554,9 +7163,6 @@ func (m *ResponseSetOption) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8573,9 +7179,6 @@ func (m *ResponseInitChain) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8611,9 +7214,6 @@ func (m *ResponseQuery) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8626,9 +7226,6 @@ func (m *ResponseBeginBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8662,9 +7259,6 @@ func (m *ResponseCheckTx) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8698,9 +7292,6 @@ func (m *ResponseDeliverTx) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8723,9 +7314,6 @@ func (m *ResponseEndBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8736,9 +7324,6 @@ func (m *ResponseCommit) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8757,9 +7342,6 @@ func (m *ConsensusParams) Size() (n int) { l = m.BlockGossip.Size() n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8775,9 +7357,6 @@ func (m *BlockSize) Size() (n int) { if m.MaxGas != 0 { n += 1 + sovTypes(uint64(m.MaxGas)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8790,9 +7369,6 @@ func (m *TxSize) Size() (n int) { if m.MaxGas != 0 { n += 1 + sovTypes(uint64(m.MaxGas)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8802,9 +7378,6 @@ func (m *BlockGossip) Size() (n int) { if m.BlockPartSizeBytes != 0 { n += 1 + sovTypes(uint64(m.BlockPartSizeBytes)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8820,9 +7393,6 @@ func (m *LastCommitInfo) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8836,7 +7406,7 @@ func (m *Header) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + l = types1.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) if m.NumTxs != 0 { n += 1 + sovTypes(uint64(m.NumTxs)) @@ -8858,6 +7428,10 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } l = len(m.ConsensusHash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) @@ -8878,9 +7452,6 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8893,9 +7464,6 @@ func (m *BlockID) Size() (n int) { } l = m.PartsHeader.Size() n += 1 + l + sovTypes(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8909,9 +7477,6 @@ func (m *PartSetHeader) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8927,9 +7492,6 @@ func (m *Validator) Size() (n int) { if m.Power != 0 { n += 1 + sovTypes(uint64(m.Power)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8941,9 +7503,6 @@ func (m *SigningValidator) Size() (n int) { if m.SignedLastBlock { n += 2 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8958,9 +7517,6 @@ func (m *PubKey) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -8976,14 +7532,11 @@ func (m *Evidence) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + l = types1.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) if m.TotalVotingPower != 0 { n += 1 + sovTypes(uint64(m.TotalVotingPower)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } return n } @@ -9393,7 +7946,6 @@ func (m *Request) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9473,7 +8025,6 @@ func (m *RequestEcho) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9524,7 +8075,6 @@ func (m *RequestFlush) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9604,7 +8154,6 @@ func (m *RequestInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9713,7 +8262,6 @@ func (m *RequestSetOption) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9778,7 +8326,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9918,7 +8466,6 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10068,7 +8615,6 @@ func (m *RequestQuery) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10241,7 +8787,6 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10323,7 +8868,6 @@ func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10405,7 +8949,6 @@ func (m *RequestDeliverTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10475,7 +9018,6 @@ func (m *RequestEndBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10526,7 +9068,6 @@ func (m *RequestCommit) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10961,7 +9502,6 @@ func (m *Response) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11041,7 +9581,6 @@ func (m *ResponseException) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11121,7 +9660,6 @@ func (m *ResponseEcho) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11172,7 +9710,6 @@ func (m *ResponseFlush) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11331,7 +9868,6 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11459,7 +9995,6 @@ func (m *ResponseSetOption) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11574,7 +10109,6 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11833,7 +10367,6 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11915,7 +10448,6 @@ func (m *ResponseBeginBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12143,7 +10675,6 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12371,7 +10902,6 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12517,7 +11047,6 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12599,7 +11128,6 @@ func (m *ResponseCommit) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12749,7 +11277,6 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12857,7 +11384,6 @@ func (m *BlockSize) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12946,7 +11472,6 @@ func (m *TxSize) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13016,7 +11541,6 @@ func (m *BlockGossip) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13117,7 +11641,6 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13230,7 +11753,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -13396,6 +11919,37 @@ func (m *Header) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) } @@ -13426,7 +11980,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.ConsensusHash = []byte{} } iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } @@ -13457,7 +12011,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.AppHash = []byte{} } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) } @@ -13488,7 +12042,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.LastResultsHash = []byte{} } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) } @@ -13519,7 +12073,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { m.EvidenceHash = []byte{} } iNdEx = postIndex - case 14: + case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) } @@ -13562,7 +12116,6 @@ func (m *Header) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13674,7 +12227,6 @@ func (m *BlockID) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13775,7 +12327,6 @@ func (m *PartSetHeader) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13906,7 +12457,6 @@ func (m *Validator) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14007,7 +12557,6 @@ func (m *SigningValidator) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14118,7 +12667,6 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14261,7 +12809,7 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -14296,7 +12844,6 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -14411,142 +12958,141 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) } -func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_7077ff64ad2a8940) -} +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) } +func init() { golang_proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) } -var fileDescriptor_types_7077ff64ad2a8940 = []byte{ - // 2090 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x23, 0x47, - 0x15, 0xf7, 0xc8, 0xb2, 0xa4, 0x79, 0x92, 0x25, 0x6d, 0x7b, 0xd7, 0xd6, 0x2a, 0x60, 0x2f, 0x03, - 0x6c, 0x6c, 0xe2, 0xd8, 0xe0, 0xb0, 0x29, 0x6f, 0x42, 0x52, 0x58, 0xde, 0x25, 0x76, 0x25, 0x80, - 0x99, 0xdd, 0x2c, 0x55, 0x14, 0x55, 0xaa, 0x96, 0xa6, 0x2d, 0x4d, 0xad, 0x34, 0x33, 0x99, 0x6e, - 0x39, 0xf2, 0x7e, 0x04, 0x2a, 0x45, 0x71, 0xe3, 0x0a, 0x37, 0xbe, 0x00, 0x55, 0x1c, 0x39, 0x51, - 0x39, 0x72, 0x80, 0xe2, 0xb6, 0x80, 0x53, 0x5c, 0xf8, 0x04, 0x1c, 0xa9, 0x7e, 0xdd, 0xf3, 0xd7, - 0xa3, 0xad, 0xcd, 0x72, 0xe3, 0x22, 0x4d, 0xf7, 0x7b, 0xaf, 0xbb, 0xdf, 0xeb, 0xf7, 0xde, 0xef, - 0xbd, 0x86, 0x75, 0x3a, 0x18, 0xba, 0xfb, 0xe2, 0x32, 0x60, 0x5c, 0xfd, 0xee, 0x05, 0xa1, 0x2f, - 0x7c, 0xb2, 0x82, 0x83, 0xee, 0x9b, 0x23, 0x57, 0x8c, 0x67, 0x83, 0xbd, 0xa1, 0x3f, 0xdd, 0x1f, - 0xf9, 0x23, 0x7f, 0x1f, 0xa9, 0x83, 0xd9, 0x39, 0x8e, 0x70, 0x80, 0x5f, 0x4a, 0xaa, 0xbb, 0x35, - 0xf2, 0xfd, 0xd1, 0x84, 0x25, 0x5c, 0xc2, 0x9d, 0x32, 0x2e, 0xe8, 0x34, 0xd0, 0x0c, 0x87, 0xa9, - 0xf5, 0x04, 0xf3, 0x1c, 0x16, 0x4e, 0x5d, 0x4f, 0xa4, 0x3f, 0x27, 0xee, 0x80, 0xef, 0x0f, 0xfd, - 0xe9, 0xd4, 0xf7, 0xd2, 0x07, 0xb2, 0xfe, 0x54, 0x86, 0xaa, 0xcd, 0x3e, 0x99, 0x31, 0x2e, 0xc8, - 0x36, 0x94, 0xd9, 0x70, 0xec, 0x77, 0x4a, 0x77, 0x8c, 0xed, 0xfa, 0x01, 0xd9, 0x53, 0x7c, 0x9a, - 0xfa, 0x70, 0x38, 0xf6, 0x4f, 0x96, 0x6c, 0xe4, 0x20, 0x6f, 0xc0, 0xca, 0xf9, 0x64, 0xc6, 0xc7, - 0x9d, 0x65, 0x64, 0x5d, 0xcb, 0xb2, 0xfe, 0x40, 0x92, 0x4e, 0x96, 0x6c, 0xc5, 0x23, 0x97, 0x75, - 0xbd, 0x73, 0xbf, 0x53, 0x2e, 0x5a, 0xf6, 0xd4, 0x3b, 0xc7, 0x65, 0x25, 0x07, 0x39, 0x04, 0xe0, - 0x4c, 0xf4, 0xfd, 0x40, 0xb8, 0xbe, 0xd7, 0x59, 0x41, 0xfe, 0x8d, 0x2c, 0xff, 0x23, 0x26, 0x7e, - 0x8c, 0xe4, 0x93, 0x25, 0xdb, 0xe4, 0xd1, 0x40, 0x4a, 0xba, 0x9e, 0x2b, 0xfa, 0xc3, 0x31, 0x75, - 0xbd, 0x4e, 0xa5, 0x48, 0xf2, 0xd4, 0x73, 0xc5, 0xb1, 0x24, 0x4b, 0x49, 0x37, 0x1a, 0x48, 0x55, - 0x3e, 0x99, 0xb1, 0xf0, 0xb2, 0x53, 0x2d, 0x52, 0xe5, 0x27, 0x92, 0x24, 0x55, 0x41, 0x1e, 0xf2, - 0x2e, 0xd4, 0x07, 0x6c, 0xe4, 0x7a, 0xfd, 0xc1, 0xc4, 0x1f, 0x3e, 0xed, 0xd4, 0x50, 0xa4, 0x93, - 0x15, 0xe9, 0x49, 0x86, 0x9e, 0xa4, 0x9f, 0x2c, 0xd9, 0x30, 0x88, 0x47, 0xe4, 0x00, 0x6a, 0xc3, - 0x31, 0x1b, 0x3e, 0xed, 0x8b, 0x79, 0xc7, 0x44, 0xc9, 0x5b, 0x59, 0xc9, 0x63, 0x49, 0x7d, 0x3c, - 0x3f, 0x59, 0xb2, 0xab, 0x43, 0xf5, 0x49, 0xee, 0x81, 0xc9, 0x3c, 0x47, 0x6f, 0x57, 0x47, 0xa1, - 0xf5, 0xdc, 0xbd, 0x78, 0x4e, 0xb4, 0x59, 0x8d, 0xe9, 0x6f, 0xb2, 0x07, 0x15, 0x79, 0xd7, 0xae, - 0xe8, 0x34, 0x50, 0xe6, 0x66, 0x6e, 0x23, 0xa4, 0x9d, 0x2c, 0xd9, 0x9a, 0x4b, 0x9a, 0xcf, 0x61, - 0x13, 0xf7, 0x82, 0x85, 0xf2, 0x70, 0x6b, 0x45, 0xe6, 0x7b, 0xa0, 0xe8, 0x78, 0x3c, 0xd3, 0x89, - 0x06, 0xbd, 0x2a, 0xac, 0x5c, 0xd0, 0xc9, 0x8c, 0x59, 0xaf, 0x43, 0x3d, 0xe5, 0x29, 0xa4, 0x03, - 0xd5, 0x29, 0xe3, 0x9c, 0x8e, 0x58, 0xc7, 0xb8, 0x63, 0x6c, 0x9b, 0x76, 0x34, 0xb4, 0x9a, 0xd0, - 0x48, 0xfb, 0x49, 0x4a, 0x50, 0xfa, 0x82, 0x14, 0xbc, 0x60, 0x21, 0x97, 0x0e, 0xa0, 0x05, 0xf5, - 0xd0, 0x7a, 0x07, 0xda, 0x79, 0x27, 0x20, 0x6d, 0x58, 0x7e, 0xca, 0x2e, 0x35, 0xa7, 0xfc, 0x24, - 0x37, 0xf5, 0x81, 0xd0, 0x8b, 0x4d, 0x5b, 0x9f, 0xee, 0x17, 0xa5, 0x58, 0x38, 0xf6, 0x03, 0x72, - 0x08, 0x65, 0x19, 0x48, 0x28, 0x5d, 0x3f, 0xe8, 0xee, 0xa9, 0x28, 0xdb, 0x8b, 0xa2, 0x6c, 0xef, - 0x71, 0x14, 0x65, 0xbd, 0xda, 0xe7, 0xcf, 0xb7, 0x96, 0x7e, 0xf5, 0xf7, 0x2d, 0xc3, 0x46, 0x09, - 0x72, 0x5b, 0x5e, 0x25, 0x75, 0xbd, 0xbe, 0xeb, 0xe8, 0x7d, 0xaa, 0x38, 0x3e, 0x75, 0xc8, 0x11, - 0xb4, 0x87, 0xbe, 0xc7, 0x99, 0xc7, 0x67, 0xbc, 0x1f, 0xd0, 0x90, 0x4e, 0xb9, 0x8e, 0x92, 0xe8, - 0xe2, 0x8e, 0x23, 0xf2, 0x19, 0x52, 0xed, 0xd6, 0x30, 0x3b, 0x41, 0xde, 0x06, 0xb8, 0xa0, 0x13, - 0xd7, 0xa1, 0xc2, 0x0f, 0x79, 0xa7, 0x7c, 0x67, 0x79, 0xbb, 0x7e, 0xd0, 0xd6, 0xc2, 0x4f, 0x22, - 0x42, 0xaf, 0x2c, 0xcf, 0x64, 0xa7, 0x38, 0xc9, 0x5d, 0x68, 0xd1, 0x20, 0xe8, 0x73, 0x41, 0x05, - 0xeb, 0x0f, 0x2e, 0x05, 0xe3, 0x18, 0x43, 0x0d, 0x7b, 0x95, 0x06, 0xc1, 0x23, 0x39, 0xdb, 0x93, - 0x93, 0x96, 0x13, 0xdf, 0x00, 0xba, 0x37, 0x21, 0x50, 0x76, 0xa8, 0xa0, 0x68, 0x87, 0x86, 0x8d, - 0xdf, 0x72, 0x2e, 0xa0, 0x62, 0xac, 0xb5, 0xc3, 0x6f, 0xb2, 0x0e, 0x95, 0x31, 0x73, 0x47, 0x63, - 0x81, 0x0a, 0x2d, 0xdb, 0x7a, 0x24, 0x4d, 0x1e, 0x84, 0xfe, 0x05, 0xc3, 0x08, 0xaf, 0xd9, 0x6a, - 0x60, 0xfd, 0xcb, 0x80, 0x1b, 0xd7, 0x42, 0x42, 0xae, 0x3b, 0xa6, 0x7c, 0x1c, 0xed, 0x25, 0xbf, - 0xc9, 0x1b, 0x72, 0x5d, 0xea, 0xb0, 0x50, 0x67, 0x9e, 0x55, 0xad, 0xeb, 0x09, 0x4e, 0x6a, 0x45, - 0x35, 0x0b, 0x79, 0x08, 0xed, 0x09, 0xe5, 0xa2, 0xaf, 0x3c, 0xb7, 0x8f, 0x99, 0x65, 0x39, 0x13, - 0x4d, 0x1f, 0xd1, 0xc8, 0xc3, 0xa5, 0x43, 0x69, 0xf1, 0xe6, 0x24, 0x33, 0x4b, 0x4e, 0xe0, 0xe6, - 0xe0, 0xf2, 0x19, 0xf5, 0x84, 0xeb, 0xb1, 0xfe, 0x35, 0x6b, 0xb7, 0xf4, 0x52, 0x0f, 0x2f, 0x5c, - 0x87, 0x79, 0x43, 0xa6, 0x17, 0x59, 0x8b, 0x45, 0xe2, 0x6b, 0xe0, 0xd6, 0x1d, 0x68, 0x66, 0xe3, - 0x97, 0x34, 0xa1, 0x24, 0xe6, 0x5a, 0xc3, 0x92, 0x98, 0x5b, 0x56, 0xec, 0x7b, 0x71, 0x10, 0x5d, - 0xe3, 0xd9, 0x81, 0x56, 0x2e, 0xa0, 0x53, 0xe6, 0x36, 0xd2, 0xe6, 0xb6, 0x5a, 0xb0, 0x9a, 0x89, - 0x63, 0xeb, 0xb3, 0x15, 0xa8, 0xd9, 0x8c, 0x07, 0xd2, 0x8d, 0xc8, 0x21, 0x98, 0x6c, 0x3e, 0x64, - 0x2a, 0x85, 0x1a, 0xb9, 0x04, 0xa5, 0x78, 0x1e, 0x46, 0x74, 0x19, 0xca, 0x31, 0x33, 0xd9, 0xc9, - 0xa4, 0xff, 0xb5, 0xbc, 0x50, 0x3a, 0xff, 0xef, 0x66, 0xf3, 0xff, 0xcd, 0x1c, 0x6f, 0x0e, 0x00, - 0x76, 0x32, 0x00, 0x90, 0x5f, 0x38, 0x83, 0x00, 0xf7, 0x0b, 0x10, 0x20, 0x7f, 0xfc, 0x05, 0x10, - 0x70, 0xbf, 0x00, 0x02, 0x3a, 0xd7, 0xf6, 0x2a, 0xc4, 0x80, 0xdd, 0x2c, 0x06, 0xe4, 0xd5, 0xc9, - 0x81, 0xc0, 0xf7, 0x8a, 0x40, 0xe0, 0x76, 0x4e, 0x66, 0x21, 0x0a, 0xbc, 0x75, 0x0d, 0x05, 0xd6, - 0x73, 0xa2, 0x05, 0x30, 0x70, 0x3f, 0x93, 0x9f, 0xa1, 0x50, 0xb7, 0xe2, 0x04, 0x4d, 0xde, 0xbe, - 0x8e, 0x20, 0x1b, 0xf9, 0xab, 0x2d, 0x82, 0x90, 0xfd, 0x1c, 0x84, 0xdc, 0xca, 0x9f, 0x32, 0x87, - 0x21, 0x09, 0x12, 0xec, 0xc8, 0xb8, 0xcf, 0x79, 0x9a, 0xcc, 0x11, 0x2c, 0x0c, 0xfd, 0x50, 0xa7, - 0x6a, 0x35, 0xb0, 0xb6, 0x65, 0x26, 0x4a, 0xfc, 0xeb, 0x05, 0xa8, 0x81, 0x4e, 0x9f, 0xf2, 0x2e, - 0xeb, 0xd7, 0x46, 0x22, 0x8b, 0x11, 0x9d, 0xce, 0x62, 0xa6, 0xce, 0x62, 0x29, 0x30, 0x29, 0x65, - 0xc0, 0x84, 0x7c, 0x0b, 0x6e, 0x60, 0x1a, 0x41, 0xbb, 0xf4, 0x33, 0x69, 0xad, 0x25, 0x09, 0xca, - 0x20, 0x2a, 0xbf, 0xbd, 0x09, 0x6b, 0x29, 0x5e, 0x99, 0x62, 0x31, 0x85, 0x95, 0x31, 0x78, 0xdb, - 0x31, 0xf7, 0x51, 0x10, 0x9c, 0x50, 0x3e, 0xb6, 0x7e, 0x98, 0xe8, 0x9f, 0x00, 0x15, 0x81, 0xf2, - 0xd0, 0x77, 0x94, 0x5a, 0xab, 0x36, 0x7e, 0x4b, 0xf0, 0x9a, 0xf8, 0x23, 0xdc, 0xd5, 0xb4, 0xe5, - 0xa7, 0xe4, 0x8a, 0x23, 0xc5, 0x54, 0x21, 0x61, 0xfd, 0xd2, 0x48, 0xd6, 0x4b, 0xb0, 0xab, 0x08, - 0x66, 0x8c, 0xff, 0x05, 0x66, 0x4a, 0x2f, 0x0b, 0x33, 0xd6, 0xef, 0x8d, 0xe4, 0x2e, 0x62, 0x00, - 0x79, 0x35, 0xe5, 0xa4, 0x5b, 0xb8, 0x9e, 0xc3, 0xe6, 0x18, 0xea, 0xcb, 0xb6, 0x1a, 0x44, 0xa8, - 0x5e, 0x41, 0x03, 0x67, 0x51, 0xbd, 0x8a, 0x73, 0x6a, 0xa0, 0x81, 0xc7, 0x3f, 0xc7, 0x18, 0x6c, - 0xd8, 0x6a, 0x90, 0xca, 0x9b, 0x66, 0x26, 0x6f, 0x9e, 0x01, 0xb9, 0x1e, 0x9d, 0xe4, 0x1d, 0x28, - 0x0b, 0x3a, 0x92, 0xc6, 0x93, 0xfa, 0x37, 0xf7, 0x54, 0x8d, 0xbc, 0xf7, 0xe1, 0x93, 0x33, 0xea, - 0x86, 0xbd, 0x75, 0xa9, 0xfd, 0xbf, 0x9f, 0x6f, 0x35, 0x25, 0xcf, 0xae, 0x3f, 0x75, 0x05, 0x9b, - 0x06, 0xe2, 0xd2, 0x46, 0x19, 0xeb, 0xaf, 0x86, 0xcc, 0xda, 0x99, 0xa8, 0x2d, 0xb4, 0x45, 0xe4, - 0x9a, 0xa5, 0x14, 0xc0, 0xbe, 0x9c, 0x7d, 0xbe, 0x0a, 0x30, 0xa2, 0xbc, 0xff, 0x29, 0xf5, 0x04, - 0x73, 0xb4, 0x91, 0xcc, 0x11, 0xe5, 0x3f, 0xc5, 0x09, 0x59, 0x87, 0x48, 0xf2, 0x8c, 0x33, 0x07, - 0xad, 0xb5, 0x6c, 0x57, 0x47, 0x94, 0x7f, 0xcc, 0x99, 0x13, 0xeb, 0x55, 0x7d, 0x05, 0xbd, 0xfe, - 0x96, 0x72, 0xb9, 0x04, 0xb2, 0xfe, 0x1f, 0x34, 0xfb, 0xc2, 0x90, 0x58, 0x9c, 0x4d, 0x7b, 0xe4, - 0x18, 0x6e, 0xc4, 0xee, 0xdd, 0x9f, 0x05, 0x0e, 0x95, 0x95, 0x93, 0xf1, 0xc2, 0x78, 0x68, 0xc7, - 0x02, 0x1f, 0x2b, 0x7e, 0xf2, 0x23, 0xd8, 0xc8, 0x05, 0x64, 0xbc, 0x54, 0xe9, 0x85, 0x71, 0x79, - 0x2b, 0x1b, 0x97, 0xd1, 0x7a, 0x91, 0x96, 0xcb, 0xaf, 0xa0, 0xe5, 0x37, 0x64, 0x49, 0x92, 0x4e, - 0xd3, 0x45, 0xf7, 0x64, 0xfd, 0xd6, 0x80, 0x56, 0xee, 0x30, 0x64, 0x1f, 0x40, 0x65, 0x39, 0xee, - 0x3e, 0x8b, 0x0a, 0xe3, 0xc8, 0x06, 0x68, 0xac, 0x47, 0xee, 0x33, 0x66, 0x9b, 0x83, 0xe8, 0x93, - 0xdc, 0x85, 0xaa, 0x98, 0x2b, 0xee, 0x6c, 0xf1, 0xf6, 0x78, 0x8e, 0xac, 0x15, 0x81, 0xff, 0xe4, - 0x1e, 0x34, 0xd4, 0xc2, 0x23, 0x9f, 0x73, 0x37, 0xd0, 0x85, 0x03, 0x49, 0x2f, 0xfd, 0x01, 0x52, - 0xec, 0xfa, 0x20, 0x19, 0x58, 0x3f, 0x03, 0x33, 0xde, 0x96, 0xbc, 0x06, 0xe6, 0x94, 0xce, 0x75, - 0x65, 0x2b, 0xcf, 0xb6, 0x62, 0xd7, 0xa6, 0x74, 0x8e, 0x45, 0x2d, 0xd9, 0x80, 0xaa, 0x24, 0x8a, - 0xb9, 0xb2, 0xf7, 0x8a, 0x5d, 0x99, 0xd2, 0xf9, 0xe3, 0x79, 0x4c, 0x18, 0x51, 0x1e, 0x95, 0xad, - 0x53, 0x3a, 0xff, 0x80, 0x72, 0xeb, 0x7d, 0xa8, 0xa8, 0x43, 0xbe, 0xd4, 0xc2, 0x52, 0xbe, 0x94, - 0x91, 0xff, 0x3e, 0xd4, 0x53, 0xe7, 0x26, 0xdf, 0x81, 0x5b, 0x4a, 0xc3, 0x80, 0x86, 0x02, 0x2d, - 0x92, 0x59, 0x90, 0x20, 0xf1, 0x8c, 0x86, 0x42, 0x6e, 0xa9, 0x0a, 0xf1, 0x10, 0x9a, 0xd9, 0x62, - 0x95, 0x7c, 0x0d, 0x1a, 0xba, 0xb0, 0x0d, 0xfd, 0x99, 0xe7, 0x68, 0xd9, 0xba, 0x9a, 0xb3, 0xe5, - 0x14, 0x79, 0xaf, 0x20, 0x6d, 0x47, 0x88, 0xfe, 0xc8, 0x1d, 0x79, 0xae, 0x37, 0x7a, 0x51, 0xf6, - 0xfe, 0x4d, 0x19, 0x2a, 0xaa, 0xb0, 0x26, 0x77, 0x53, 0x5d, 0x0c, 0xa2, 0x66, 0xaf, 0x7e, 0xf5, - 0x7c, 0xab, 0x8a, 0x00, 0x73, 0xfa, 0x20, 0x69, 0x69, 0x92, 0x84, 0x5a, 0xca, 0xd4, 0xfd, 0x51, - 0xff, 0xb4, 0xfc, 0xa5, 0xfb, 0xa7, 0x0d, 0xa8, 0x7a, 0xb3, 0x29, 0x5e, 0x56, 0x59, 0x2d, 0xe9, - 0xcd, 0xa6, 0xf2, 0xb2, 0x5e, 0x03, 0x53, 0xf8, 0x82, 0x4e, 0x90, 0xa4, 0x92, 0x42, 0x0d, 0x27, - 0x24, 0xf1, 0x10, 0x56, 0x53, 0x38, 0xec, 0x3a, 0xba, 0xc8, 0x6b, 0xa6, 0x9d, 0xe8, 0xf4, 0x81, - 0xd6, 0xb9, 0x1e, 0xe3, 0xf2, 0xa9, 0x43, 0xb6, 0xb3, 0x4d, 0x03, 0xc2, 0xb7, 0x42, 0x92, 0x54, - 0x5f, 0x20, 0xc1, 0x5b, 0x1e, 0x40, 0x06, 0x87, 0x62, 0x51, 0xb0, 0x52, 0x93, 0x13, 0x48, 0x7c, - 0x1d, 0x5a, 0x89, 0x25, 0x15, 0x8b, 0xa9, 0x56, 0x49, 0xa6, 0x91, 0xf1, 0x9b, 0xd0, 0x4c, 0x92, - 0x01, 0xf2, 0x81, 0x6a, 0xc4, 0xe2, 0x59, 0x64, 0xbb, 0x0d, 0xb5, 0xb8, 0x9a, 0xa8, 0x23, 0x43, - 0x95, 0xaa, 0x22, 0x22, 0xae, 0x4f, 0x42, 0xc6, 0x67, 0x13, 0xa1, 0x17, 0x69, 0x20, 0x0f, 0xd6, - 0x27, 0xb6, 0x9a, 0x47, 0xde, 0xaf, 0xc3, 0x2a, 0xd3, 0x8d, 0x8a, 0xe2, 0x5b, 0x45, 0xbe, 0x46, - 0x34, 0x89, 0x4c, 0x3b, 0xd0, 0x0e, 0x42, 0x3f, 0xf0, 0x39, 0x0b, 0xfb, 0xd4, 0x71, 0x42, 0xc6, - 0x79, 0xa7, 0xa9, 0xd6, 0x8b, 0xe6, 0x8f, 0xd4, 0xb4, 0xf5, 0x73, 0xa8, 0x6a, 0x5b, 0x16, 0xb6, - 0x6b, 0xef, 0x41, 0x43, 0xba, 0x38, 0xef, 0x67, 0x9a, 0xb6, 0xa8, 0x68, 0x46, 0x0f, 0x67, 0x22, - 0xd3, 0xbb, 0xd5, 0x91, 0x5f, 0x4d, 0x59, 0xf7, 0x61, 0x35, 0xc3, 0x23, 0x51, 0x1c, 0xaf, 0x58, - 0x3b, 0xbb, 0x1a, 0xc4, 0x3b, 0x97, 0x92, 0x9d, 0x2d, 0x17, 0xcc, 0xd8, 0xb5, 0x65, 0x6d, 0x17, - 0xe9, 0x61, 0x68, 0xdb, 0xa9, 0x21, 0xd9, 0x85, 0x6a, 0x30, 0x1b, 0xf4, 0x65, 0x09, 0x91, 0xcd, - 0x49, 0x67, 0xb3, 0xc1, 0x87, 0xec, 0x32, 0x6a, 0x28, 0x03, 0x1c, 0x61, 0x11, 0xe1, 0x7f, 0xca, - 0x42, 0x9d, 0x1d, 0xd4, 0xc0, 0x12, 0xd0, 0xce, 0x07, 0x13, 0xf9, 0x2e, 0x98, 0xf1, 0x3d, 0xe7, - 0x72, 0x63, 0x3e, 0xe2, 0x12, 0x46, 0x79, 0x93, 0xdc, 0x1d, 0x79, 0xcc, 0xe9, 0x27, 0xce, 0x8b, - 0xe7, 0xaa, 0xd9, 0x2d, 0x45, 0xf8, 0x28, 0xf2, 0x54, 0xeb, 0xdb, 0x50, 0x51, 0x67, 0x94, 0xea, - 0xcb, 0x95, 0xa3, 0x6a, 0x56, 0x7e, 0x17, 0x26, 0xf1, 0xbf, 0x18, 0x50, 0x8b, 0xba, 0xd4, 0x42, - 0xa1, 0xcc, 0xa1, 0x4b, 0x2f, 0x7b, 0xe8, 0x45, 0xad, 0x7e, 0x14, 0xf2, 0xe5, 0x2f, 0x1d, 0xf2, - 0xbb, 0x40, 0x54, 0x64, 0x5f, 0xf8, 0xc2, 0xf5, 0x46, 0x7d, 0x65, 0x73, 0x15, 0xe2, 0x6d, 0xa4, - 0x3c, 0x41, 0xc2, 0x99, 0x9c, 0x3f, 0xf8, 0x6c, 0x05, 0x5a, 0x47, 0xbd, 0xe3, 0xd3, 0xa3, 0x20, - 0x98, 0xb8, 0x43, 0x8a, 0x25, 0xf4, 0x3e, 0x94, 0xb1, 0x49, 0x28, 0x78, 0x98, 0xec, 0x16, 0x75, - 0xab, 0xe4, 0x00, 0x56, 0xb0, 0x57, 0x20, 0x45, 0xef, 0x93, 0xdd, 0xc2, 0xa6, 0x55, 0x6e, 0xa2, - 0xba, 0x89, 0xeb, 0xcf, 0x94, 0xdd, 0xa2, 0xce, 0x95, 0xbc, 0x0f, 0x66, 0x52, 0xe5, 0x2f, 0x7a, - 0xac, 0xec, 0x2e, 0xec, 0x61, 0xa5, 0x7c, 0x52, 0x62, 0x2d, 0x7a, 0x73, 0xeb, 0x2e, 0x6c, 0xf6, - 0xc8, 0x21, 0x54, 0xa3, 0xd2, 0xb3, 0xf8, 0x39, 0xb1, 0xbb, 0xa0, 0xbf, 0x94, 0xe6, 0x51, 0xe5, - 0x7b, 0xd1, 0x9b, 0x67, 0xb7, 0xb0, 0x09, 0x26, 0xf7, 0xa0, 0xa2, 0x2b, 0x8a, 0xc2, 0x27, 0xc5, - 0x6e, 0x71, 0x97, 0x28, 0x95, 0x4c, 0x5a, 0x97, 0x45, 0xef, 0xb2, 0xdd, 0x85, 0xdd, 0x3a, 0x39, - 0x02, 0x48, 0x95, 0xec, 0x0b, 0x1f, 0x5c, 0xbb, 0x8b, 0xbb, 0x70, 0xf2, 0x2e, 0xd4, 0x92, 0x97, - 0x95, 0xe2, 0x27, 0xd4, 0xee, 0xa2, 0xc6, 0xb8, 0xf7, 0x95, 0xff, 0xfc, 0x73, 0xd3, 0xf8, 0xdd, - 0xd5, 0xa6, 0xf1, 0x87, 0xab, 0x4d, 0xe3, 0xf3, 0xab, 0x4d, 0xe3, 0xcf, 0x57, 0x9b, 0xc6, 0x3f, - 0xae, 0x36, 0x8d, 0x3f, 0x7e, 0xb1, 0x69, 0x0c, 0x2a, 0xe8, 0xfe, 0x6f, 0xfd, 0x37, 0x00, 0x00, - 0xff, 0xff, 0x85, 0x43, 0xc2, 0x26, 0xf5, 0x17, 0x00, 0x00, +var fileDescriptorTypes = []byte{ + // 2109 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xdf, 0x6f, 0x23, 0x49, + 0xf1, 0xcf, 0x38, 0x8e, 0xed, 0x29, 0x3b, 0xb6, 0xb7, 0x37, 0x9b, 0x78, 0x7d, 0xdf, 0x6f, 0xb2, + 0x0c, 0xb0, 0x97, 0x70, 0xb9, 0xe4, 0xc8, 0xb1, 0xa7, 0xec, 0x1d, 0x77, 0x22, 0xce, 0x2e, 0x97, + 0xe8, 0x0e, 0x08, 0xb3, 0x7b, 0x8b, 0x84, 0x90, 0x46, 0x6d, 0x4f, 0x67, 0x3c, 0x5a, 0x7b, 0x66, + 0x6e, 0xa6, 0x9d, 0x73, 0xf6, 0x4f, 0x40, 0x27, 0xc4, 0x1b, 0xcf, 0xbc, 0xf1, 0x0f, 0x20, 0xf1, + 0xc8, 0x13, 0xba, 0x47, 0x84, 0x40, 0xbc, 0x2d, 0x90, 0x13, 0x2f, 0xfc, 0x05, 0x3c, 0xa2, 0xae, + 0xee, 0xf9, 0x99, 0xf1, 0x6a, 0x6f, 0x79, 0xe3, 0xc5, 0x9e, 0xee, 0xaa, 0xea, 0xee, 0xaa, 0xae, + 0xaa, 0x4f, 0x55, 0xc3, 0x3a, 0x1d, 0x8e, 0xdc, 0x7d, 0x7e, 0x19, 0xb0, 0x48, 0xfe, 0xee, 0x05, + 0xa1, 0xcf, 0x7d, 0xb2, 0x82, 0x83, 0xfe, 0x9b, 0x8e, 0xcb, 0xc7, 0xb3, 0xe1, 0xde, 0xc8, 0x9f, + 0xee, 0x3b, 0xbe, 0xe3, 0xef, 0x23, 0x75, 0x38, 0x3b, 0xc7, 0x11, 0x0e, 0xf0, 0x4b, 0x4a, 0xf5, + 0xb7, 0x1c, 0xdf, 0x77, 0x26, 0x2c, 0xe5, 0xe2, 0xee, 0x94, 0x45, 0x9c, 0x4e, 0x03, 0xc5, 0x70, + 0x98, 0x59, 0x8f, 0x33, 0xcf, 0x66, 0xe1, 0xd4, 0xf5, 0x78, 0xf6, 0x73, 0xe2, 0x0e, 0xa3, 0xfd, + 0x91, 0x3f, 0x9d, 0xfa, 0x5e, 0xf6, 0x40, 0xc6, 0x1f, 0xaa, 0x50, 0x37, 0xd9, 0xa7, 0x33, 0x16, + 0x71, 0xb2, 0x0d, 0x55, 0x36, 0x1a, 0xfb, 0xbd, 0xca, 0x1d, 0x6d, 0xbb, 0x79, 0x40, 0xf6, 0x24, + 0x9f, 0xa2, 0x3e, 0x1c, 0x8d, 0xfd, 0x93, 0x25, 0x13, 0x39, 0xc8, 0x1b, 0xb0, 0x72, 0x3e, 0x99, + 0x45, 0xe3, 0xde, 0x32, 0xb2, 0xde, 0xcc, 0xb3, 0x7e, 0x5f, 0x90, 0x4e, 0x96, 0x4c, 0xc9, 0x23, + 0x96, 0x75, 0xbd, 0x73, 0xbf, 0x57, 0x2d, 0x5b, 0xf6, 0xd4, 0x3b, 0xc7, 0x65, 0x05, 0x07, 0x39, + 0x04, 0x88, 0x18, 0xb7, 0xfc, 0x80, 0xbb, 0xbe, 0xd7, 0x5b, 0x41, 0xfe, 0x8d, 0x3c, 0xff, 0x23, + 0xc6, 0x7f, 0x84, 0xe4, 0x93, 0x25, 0x53, 0x8f, 0xe2, 0x81, 0x90, 0x74, 0x3d, 0x97, 0x5b, 0xa3, + 0x31, 0x75, 0xbd, 0x5e, 0xad, 0x4c, 0xf2, 0xd4, 0x73, 0xf9, 0xb1, 0x20, 0x0b, 0x49, 0x37, 0x1e, + 0x08, 0x55, 0x3e, 0x9d, 0xb1, 0xf0, 0xb2, 0x57, 0x2f, 0x53, 0xe5, 0xc7, 0x82, 0x24, 0x54, 0x41, + 0x1e, 0xf2, 0x1e, 0x34, 0x87, 0xcc, 0x71, 0x3d, 0x6b, 0x38, 0xf1, 0x47, 0x4f, 0x7b, 0x0d, 0x14, + 0xe9, 0xe5, 0x45, 0x06, 0x82, 0x61, 0x20, 0xe8, 0x27, 0x4b, 0x26, 0x0c, 0x93, 0x11, 0x39, 0x80, + 0xc6, 0x68, 0xcc, 0x46, 0x4f, 0x2d, 0x3e, 0xef, 0xe9, 0x28, 0x79, 0x2b, 0x2f, 0x79, 0x2c, 0xa8, + 0x8f, 0xe7, 0x27, 0x4b, 0x66, 0x7d, 0x24, 0x3f, 0xc9, 0x3d, 0xd0, 0x99, 0x67, 0xab, 0xed, 0x9a, + 0x28, 0xb4, 0x5e, 0xb8, 0x17, 0xcf, 0x8e, 0x37, 0x6b, 0x30, 0xf5, 0x4d, 0xf6, 0xa0, 0x26, 0xee, + 0xda, 0xe5, 0xbd, 0x16, 0xca, 0xac, 0x15, 0x36, 0x42, 0xda, 0xc9, 0x92, 0xa9, 0xb8, 0x84, 0xf9, + 0x6c, 0x36, 0x71, 0x2f, 0x58, 0x28, 0x0e, 0x77, 0xb3, 0xcc, 0x7c, 0x0f, 0x24, 0x1d, 0x8f, 0xa7, + 0xdb, 0xf1, 0x60, 0x50, 0x87, 0x95, 0x0b, 0x3a, 0x99, 0x31, 0xe3, 0x75, 0x68, 0x66, 0x3c, 0x85, + 0xf4, 0xa0, 0x3e, 0x65, 0x51, 0x44, 0x1d, 0xd6, 0xd3, 0xee, 0x68, 0xdb, 0xba, 0x19, 0x0f, 0x8d, + 0x36, 0xb4, 0xb2, 0x7e, 0x92, 0x11, 0x14, 0xbe, 0x20, 0x04, 0x2f, 0x58, 0x18, 0x09, 0x07, 0x50, + 0x82, 0x6a, 0x68, 0xbc, 0x0b, 0xdd, 0xa2, 0x13, 0x90, 0x2e, 0x2c, 0x3f, 0x65, 0x97, 0x8a, 0x53, + 0x7c, 0x92, 0x35, 0x75, 0x20, 0xf4, 0x62, 0xdd, 0x54, 0xa7, 0xfb, 0x79, 0x25, 0x11, 0x4e, 0xfc, + 0x80, 0x1c, 0x42, 0x55, 0x04, 0x12, 0x4a, 0x37, 0x0f, 0xfa, 0x7b, 0x32, 0xca, 0xf6, 0xe2, 0x28, + 0xdb, 0x7b, 0x1c, 0x47, 0xd9, 0xa0, 0xf1, 0xc5, 0xf3, 0xad, 0xa5, 0x5f, 0xfe, 0x6d, 0x4b, 0x33, + 0x51, 0x82, 0xdc, 0x16, 0x57, 0x49, 0x5d, 0xcf, 0x72, 0x6d, 0xb5, 0x4f, 0x1d, 0xc7, 0xa7, 0x36, + 0x39, 0x82, 0xee, 0xc8, 0xf7, 0x22, 0xe6, 0x45, 0xb3, 0xc8, 0x0a, 0x68, 0x48, 0xa7, 0x91, 0x8a, + 0x92, 0xf8, 0xe2, 0x8e, 0x63, 0xf2, 0x19, 0x52, 0xcd, 0xce, 0x28, 0x3f, 0x41, 0xde, 0x01, 0xb8, + 0xa0, 0x13, 0xd7, 0xa6, 0xdc, 0x0f, 0xa3, 0x5e, 0xf5, 0xce, 0xf2, 0x76, 0xf3, 0xa0, 0xab, 0x84, + 0x9f, 0xc4, 0x84, 0x41, 0x55, 0x9c, 0xc9, 0xcc, 0x70, 0x92, 0xbb, 0xd0, 0xa1, 0x41, 0x60, 0x45, + 0x9c, 0x72, 0x66, 0x0d, 0x2f, 0x39, 0x8b, 0x30, 0x86, 0x5a, 0xe6, 0x2a, 0x0d, 0x82, 0x47, 0x62, + 0x76, 0x20, 0x26, 0x0d, 0x3b, 0xb9, 0x01, 0x74, 0x6f, 0x42, 0xa0, 0x6a, 0x53, 0x4e, 0xd1, 0x0e, + 0x2d, 0x13, 0xbf, 0xc5, 0x5c, 0x40, 0xf9, 0x58, 0x69, 0x87, 0xdf, 0x64, 0x1d, 0x6a, 0x63, 0xe6, + 0x3a, 0x63, 0x8e, 0x0a, 0x2d, 0x9b, 0x6a, 0x24, 0x4c, 0x1e, 0x84, 0xfe, 0x05, 0xc3, 0x08, 0x6f, + 0x98, 0x72, 0x60, 0xfc, 0x53, 0x83, 0x1b, 0xd7, 0x42, 0x42, 0xac, 0x3b, 0xa6, 0xd1, 0x38, 0xde, + 0x4b, 0x7c, 0x93, 0x37, 0xc4, 0xba, 0xd4, 0x66, 0xa1, 0xca, 0x3c, 0xab, 0x4a, 0xd7, 0x13, 0x9c, + 0x54, 0x8a, 0x2a, 0x16, 0xf2, 0x10, 0xba, 0x13, 0x1a, 0x71, 0x4b, 0x7a, 0xae, 0x85, 0x99, 0x65, + 0x39, 0x17, 0x4d, 0x1f, 0xd3, 0xd8, 0xc3, 0x85, 0x43, 0x29, 0xf1, 0xf6, 0x24, 0x37, 0x4b, 0x4e, + 0x60, 0x6d, 0x78, 0xf9, 0x8c, 0x7a, 0xdc, 0xf5, 0x98, 0x75, 0xcd, 0xda, 0x1d, 0xb5, 0xd4, 0xc3, + 0x0b, 0xd7, 0x66, 0xde, 0x88, 0xa9, 0x45, 0x6e, 0x26, 0x22, 0xc9, 0x35, 0x44, 0xc6, 0x1d, 0x68, + 0xe7, 0xe3, 0x97, 0xb4, 0xa1, 0xc2, 0xe7, 0x4a, 0xc3, 0x0a, 0x9f, 0x1b, 0x46, 0xe2, 0x7b, 0x49, + 0x10, 0x5d, 0xe3, 0xd9, 0x81, 0x4e, 0x21, 0xa0, 0x33, 0xe6, 0xd6, 0xb2, 0xe6, 0x36, 0x3a, 0xb0, + 0x9a, 0x8b, 0x63, 0xe3, 0xf3, 0x15, 0x68, 0x98, 0x2c, 0x0a, 0x84, 0x1b, 0x91, 0x43, 0xd0, 0xd9, + 0x7c, 0xc4, 0x64, 0x0a, 0xd5, 0x0a, 0x09, 0x4a, 0xf2, 0x3c, 0x8c, 0xe9, 0x22, 0x94, 0x13, 0x66, + 0xb2, 0x93, 0x4b, 0xff, 0x37, 0x8b, 0x42, 0xd9, 0xfc, 0xbf, 0x9b, 0xcf, 0xff, 0x6b, 0x05, 0xde, + 0x02, 0x00, 0xec, 0xe4, 0x00, 0xa0, 0xb8, 0x70, 0x0e, 0x01, 0xee, 0x97, 0x20, 0x40, 0xf1, 0xf8, + 0x0b, 0x20, 0xe0, 0x7e, 0x09, 0x04, 0xf4, 0xae, 0xed, 0x55, 0x8a, 0x01, 0xbb, 0x79, 0x0c, 0x28, + 0xaa, 0x53, 0x00, 0x81, 0xef, 0x96, 0x81, 0xc0, 0xed, 0x82, 0xcc, 0x42, 0x14, 0x78, 0xfb, 0x1a, + 0x0a, 0xac, 0x17, 0x44, 0x4b, 0x60, 0xe0, 0x7e, 0x2e, 0x3f, 0x43, 0xa9, 0x6e, 0xe5, 0x09, 0x9a, + 0xbc, 0x73, 0x1d, 0x41, 0x36, 0x8a, 0x57, 0x5b, 0x06, 0x21, 0xfb, 0x05, 0x08, 0xb9, 0x55, 0x3c, + 0x65, 0x01, 0x43, 0x52, 0x24, 0xd8, 0x11, 0x71, 0x5f, 0xf0, 0x34, 0x91, 0x23, 0x58, 0x18, 0xfa, + 0xa1, 0x4a, 0xd5, 0x72, 0x60, 0x6c, 0x8b, 0x4c, 0x94, 0xfa, 0xd7, 0x0b, 0x50, 0x03, 0x9d, 0x3e, + 0xe3, 0x5d, 0xc6, 0xaf, 0xb4, 0x54, 0x16, 0x23, 0x3a, 0x9b, 0xc5, 0x74, 0x95, 0xc5, 0x32, 0x60, + 0x52, 0xc9, 0x81, 0x09, 0xf9, 0x16, 0xdc, 0xc0, 0x34, 0x82, 0x76, 0xb1, 0x72, 0x69, 0xad, 0x23, + 0x08, 0xd2, 0x20, 0x32, 0xbf, 0xbd, 0x09, 0x37, 0x33, 0xbc, 0x22, 0xc5, 0x62, 0x0a, 0xab, 0x62, + 0xf0, 0x76, 0x13, 0xee, 0xa3, 0x20, 0x38, 0xa1, 0xd1, 0xd8, 0xf8, 0x41, 0xaa, 0x7f, 0x0a, 0x54, + 0x04, 0xaa, 0x23, 0xdf, 0x96, 0x6a, 0xad, 0x9a, 0xf8, 0x2d, 0xc0, 0x6b, 0xe2, 0x3b, 0xb8, 0xab, + 0x6e, 0x8a, 0x4f, 0xc1, 0x95, 0x44, 0x8a, 0x2e, 0x43, 0xc2, 0xf8, 0x85, 0x96, 0xae, 0x97, 0x62, + 0x57, 0x19, 0xcc, 0x68, 0xff, 0x0d, 0xcc, 0x54, 0x5e, 0x16, 0x66, 0x8c, 0xdf, 0x6a, 0xe9, 0x5d, + 0x24, 0x00, 0xf2, 0x6a, 0xca, 0x09, 0xb7, 0x70, 0x3d, 0x9b, 0xcd, 0x31, 0xd4, 0x97, 0x4d, 0x39, + 0x88, 0x51, 0xbd, 0x86, 0x06, 0xce, 0xa3, 0x7a, 0x1d, 0xe7, 0xe4, 0x40, 0x01, 0x8f, 0x7f, 0x8e, + 0x31, 0xd8, 0x32, 0xe5, 0x20, 0x93, 0x37, 0xf5, 0x5c, 0xde, 0x3c, 0x03, 0x72, 0x3d, 0x3a, 0xc9, + 0xbb, 0x50, 0xe5, 0xd4, 0x11, 0xc6, 0x13, 0xfa, 0xb7, 0xf7, 0x64, 0x8d, 0xbc, 0xf7, 0xd1, 0x93, + 0x33, 0xea, 0x86, 0x83, 0x75, 0xa1, 0xfd, 0xbf, 0x9e, 0x6f, 0xb5, 0x05, 0xcf, 0xae, 0x3f, 0x75, + 0x39, 0x9b, 0x06, 0xfc, 0xd2, 0x44, 0x19, 0xe3, 0x2f, 0x9a, 0xc8, 0xda, 0xb9, 0xa8, 0x2d, 0xb5, + 0x45, 0xec, 0x9a, 0x95, 0x0c, 0xc0, 0xbe, 0x9c, 0x7d, 0xfe, 0x1f, 0xc0, 0xa1, 0x91, 0xf5, 0x19, + 0xf5, 0x38, 0xb3, 0x95, 0x91, 0x74, 0x87, 0x46, 0x3f, 0xc1, 0x09, 0x51, 0x87, 0x08, 0xf2, 0x2c, + 0x62, 0x36, 0x5a, 0x6b, 0xd9, 0xac, 0x3b, 0x34, 0xfa, 0x24, 0x62, 0x76, 0xa2, 0x57, 0xfd, 0x15, + 0xf4, 0xfa, 0x6b, 0xc6, 0xe5, 0x52, 0xc8, 0xfa, 0x5f, 0xd0, 0xec, 0x4b, 0x4d, 0x60, 0x71, 0x3e, + 0xed, 0x91, 0x63, 0xb8, 0x91, 0xb8, 0xb7, 0x35, 0x0b, 0x6c, 0x2a, 0x2a, 0x27, 0xed, 0x85, 0xf1, + 0xd0, 0x4d, 0x04, 0x3e, 0x91, 0xfc, 0xe4, 0x87, 0xb0, 0x51, 0x08, 0xc8, 0x64, 0xa9, 0xca, 0x0b, + 0xe3, 0xf2, 0x56, 0x3e, 0x2e, 0xe3, 0xf5, 0x62, 0x2d, 0x97, 0x5f, 0x41, 0xcb, 0x6f, 0x88, 0x92, + 0x24, 0x9b, 0xa6, 0xcb, 0xee, 0xc9, 0xf8, 0xb5, 0x06, 0x9d, 0xc2, 0x61, 0xc8, 0x3e, 0x80, 0xcc, + 0x72, 0x91, 0xfb, 0x2c, 0x2e, 0x8c, 0x63, 0x1b, 0xa0, 0xb1, 0x1e, 0xb9, 0xcf, 0x98, 0xa9, 0x0f, + 0xe3, 0x4f, 0x72, 0x17, 0xea, 0x7c, 0x2e, 0xb9, 0xf3, 0xc5, 0xdb, 0xe3, 0x39, 0xb2, 0xd6, 0x38, + 0xfe, 0x93, 0x7b, 0xd0, 0x92, 0x0b, 0x3b, 0x7e, 0x14, 0xb9, 0x81, 0x2a, 0x1c, 0x48, 0x76, 0xe9, + 0x0f, 0x91, 0x62, 0x36, 0x87, 0xe9, 0xc0, 0xf8, 0x29, 0xe8, 0xc9, 0xb6, 0xe4, 0x35, 0xd0, 0xa7, + 0x74, 0xae, 0x2a, 0x5b, 0x71, 0xb6, 0x15, 0xb3, 0x31, 0xa5, 0x73, 0x2c, 0x6a, 0xc9, 0x06, 0xd4, + 0x05, 0x91, 0xcf, 0xa5, 0xbd, 0x57, 0xcc, 0xda, 0x94, 0xce, 0x1f, 0xcf, 0x13, 0x82, 0x43, 0xa3, + 0xb8, 0x6c, 0x9d, 0xd2, 0xf9, 0x87, 0x34, 0x32, 0x3e, 0x80, 0x9a, 0x3c, 0xe4, 0x4b, 0x2d, 0x2c, + 0xe4, 0x2b, 0x39, 0xf9, 0xef, 0x41, 0x33, 0x73, 0x6e, 0xf2, 0x6d, 0xb8, 0x25, 0x35, 0x0c, 0x68, + 0xc8, 0xd1, 0x22, 0xb9, 0x05, 0x09, 0x12, 0xcf, 0x68, 0xc8, 0xc5, 0x96, 0xb2, 0x10, 0x0f, 0xa1, + 0x9d, 0x2f, 0x56, 0xc9, 0xd7, 0xa0, 0xa5, 0x0a, 0xdb, 0xd0, 0x9f, 0x79, 0xb6, 0x92, 0x6d, 0xca, + 0x39, 0x53, 0x4c, 0x91, 0xf7, 0x4b, 0xd2, 0x76, 0x8c, 0xe8, 0x8f, 0x5c, 0xc7, 0x73, 0x3d, 0xe7, + 0x45, 0xd9, 0xfb, 0x4f, 0x55, 0xa8, 0xc9, 0xc2, 0x9a, 0xdc, 0xcd, 0x74, 0x31, 0x88, 0x9a, 0x83, + 0xe6, 0xd5, 0xf3, 0xad, 0x3a, 0x02, 0xcc, 0xe9, 0x83, 0xb4, 0xa5, 0x49, 0x13, 0x6a, 0x25, 0x57, + 0xf7, 0xc7, 0xfd, 0xd3, 0xf2, 0x57, 0xee, 0x9f, 0x36, 0xa0, 0xee, 0xcd, 0xa6, 0x78, 0x59, 0x55, + 0xb9, 0xa4, 0x37, 0x9b, 0x8a, 0xcb, 0x7a, 0x0d, 0x74, 0xee, 0x73, 0x3a, 0x41, 0x92, 0x4c, 0x0a, + 0x0d, 0x9c, 0x10, 0xc4, 0x43, 0x58, 0xcd, 0xe0, 0xb0, 0x6b, 0xab, 0x22, 0xaf, 0x9d, 0x75, 0xa2, + 0xd3, 0x07, 0x4a, 0xe7, 0x66, 0x82, 0xcb, 0xa7, 0x36, 0xd9, 0xce, 0x37, 0x0d, 0x08, 0xdf, 0x12, + 0x49, 0x32, 0x7d, 0x81, 0x00, 0x6f, 0x71, 0x00, 0x11, 0x1c, 0x92, 0x45, 0xc2, 0x4a, 0x43, 0x4c, + 0x20, 0xf1, 0x75, 0xe8, 0xa4, 0x96, 0x94, 0x2c, 0xba, 0x5c, 0x25, 0x9d, 0x46, 0xc6, 0xb7, 0x60, + 0xcd, 0x63, 0x73, 0x6e, 0x15, 0xb9, 0x01, 0xb9, 0x89, 0xa0, 0x3d, 0xc9, 0x4b, 0x7c, 0x13, 0xda, + 0x69, 0xfa, 0x40, 0xde, 0xa6, 0x6c, 0xdd, 0x92, 0x59, 0x64, 0xbb, 0x0d, 0x8d, 0xa4, 0xfe, 0x68, + 0x21, 0x43, 0x9d, 0xca, 0xb2, 0x23, 0xa9, 0x68, 0x42, 0x16, 0xcd, 0x26, 0x5c, 0x2d, 0xb2, 0x8a, + 0x3c, 0x58, 0xd1, 0x98, 0x72, 0x1e, 0x79, 0xbf, 0x0e, 0xab, 0x4c, 0xb5, 0x36, 0x92, 0xaf, 0x8d, + 0x7c, 0xad, 0x78, 0x12, 0x99, 0x76, 0xa0, 0x1b, 0x84, 0x7e, 0xe0, 0x47, 0x2c, 0xb4, 0xa8, 0x6d, + 0x87, 0x2c, 0x8a, 0x7a, 0x1d, 0xb9, 0x5e, 0x3c, 0x7f, 0x24, 0xa7, 0x8d, 0x9f, 0x41, 0x5d, 0x59, + 0xbf, 0xb4, 0xc1, 0x7b, 0x1f, 0x5a, 0x22, 0x28, 0x22, 0x2b, 0xd7, 0xe6, 0xc5, 0x65, 0x36, 0xc6, + 0x04, 0xe3, 0xb9, 0x6e, 0xaf, 0x89, 0xfc, 0x72, 0xca, 0xb8, 0x0f, 0xab, 0x39, 0x1e, 0x81, 0xfb, + 0xe8, 0x14, 0x2a, 0x3c, 0xe4, 0x20, 0xd9, 0xb9, 0x92, 0xee, 0x6c, 0xb8, 0xa0, 0x27, 0x86, 0x16, + 0xd5, 0x60, 0xac, 0x87, 0xa6, 0x6c, 0x27, 0x87, 0x64, 0x17, 0xea, 0xc1, 0x6c, 0x68, 0x89, 0xa2, + 0x23, 0x9f, 0xc5, 0xce, 0x66, 0xc3, 0x8f, 0xd8, 0x65, 0xdc, 0x82, 0x06, 0x38, 0xc2, 0xb2, 0xc3, + 0xff, 0x8c, 0x85, 0x2a, 0x9f, 0xc8, 0x81, 0xc1, 0xa1, 0x5b, 0x0c, 0x3f, 0xf2, 0x1d, 0xd0, 0x13, + 0x17, 0x28, 0x64, 0xd3, 0x62, 0x8c, 0xa6, 0x8c, 0xe2, 0x26, 0x23, 0xd7, 0xf1, 0x98, 0x6d, 0xa5, + 0xee, 0x8e, 0xe7, 0x6a, 0x98, 0x1d, 0x49, 0xf8, 0x38, 0xf6, 0x6d, 0xe3, 0x2d, 0xa8, 0xc9, 0x33, + 0x0a, 0xf5, 0xc5, 0xca, 0x71, 0xfd, 0x2b, 0xbe, 0x4b, 0xd3, 0xfe, 0x9f, 0x35, 0x68, 0xc4, 0x7d, + 0x6d, 0xa9, 0x50, 0xee, 0xd0, 0x95, 0x97, 0x3d, 0xf4, 0xa2, 0xc7, 0x81, 0x38, 0x49, 0x54, 0xbf, + 0x72, 0x92, 0xd8, 0x05, 0x22, 0x73, 0xc1, 0x85, 0xcf, 0x5d, 0xcf, 0xb1, 0xa4, 0xcd, 0x65, 0x52, + 0xe8, 0x22, 0xe5, 0x09, 0x12, 0xce, 0xc4, 0xfc, 0xc1, 0xe7, 0x2b, 0xd0, 0x39, 0x1a, 0x1c, 0x9f, + 0x1e, 0x05, 0xc1, 0xc4, 0x1d, 0x51, 0x2c, 0xba, 0xf7, 0xa1, 0x8a, 0x6d, 0x45, 0xc9, 0x53, 0x66, + 0xbf, 0xac, 0xbf, 0x25, 0x07, 0xb0, 0x82, 0xdd, 0x05, 0x29, 0x7b, 0xd1, 0xec, 0x97, 0xb6, 0xb9, + 0x62, 0x13, 0xd9, 0x7f, 0x5c, 0x7f, 0xd8, 0xec, 0x97, 0xf5, 0xba, 0xe4, 0x03, 0xd0, 0xd3, 0xbe, + 0x60, 0xd1, 0xf3, 0x66, 0x7f, 0x61, 0xd7, 0x2b, 0xe4, 0xd3, 0xa2, 0x6c, 0xd1, 0x2b, 0x5d, 0x7f, + 0x61, 0x7b, 0x48, 0x0e, 0xa1, 0x1e, 0x17, 0xab, 0xe5, 0x0f, 0x90, 0xfd, 0x05, 0x1d, 0xa9, 0x30, + 0x8f, 0x2c, 0xf8, 0xcb, 0x5e, 0x49, 0xfb, 0xa5, 0x6d, 0x33, 0xb9, 0x07, 0x35, 0x55, 0x83, 0x94, + 0x3e, 0x42, 0xf6, 0xcb, 0xfb, 0x4a, 0xa1, 0x64, 0xda, 0xec, 0x2c, 0x7a, 0xc9, 0xed, 0x2f, 0xec, + 0xef, 0xc9, 0x11, 0x40, 0xa6, 0xc8, 0x5f, 0xf8, 0x44, 0xdb, 0x5f, 0xdc, 0xb7, 0x93, 0xf7, 0xa0, + 0x91, 0xbe, 0xc5, 0x94, 0x3f, 0xba, 0xf6, 0x17, 0xb5, 0xd2, 0x83, 0xff, 0xfb, 0xf7, 0x3f, 0x36, + 0xb5, 0xdf, 0x5c, 0x6d, 0x6a, 0xbf, 0xbb, 0xda, 0xd4, 0xbe, 0xb8, 0xda, 0xd4, 0xfe, 0x78, 0xb5, + 0xa9, 0xfd, 0xfd, 0x6a, 0x53, 0xfb, 0xfd, 0x97, 0x9b, 0xda, 0xb0, 0x86, 0xee, 0xff, 0xf6, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x91, 0x83, 0x9b, 0x1e, 0x27, 0x18, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index 45b62a77..fcec8888 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -249,13 +249,14 @@ message Header { // hashes from the app output from the prev block bytes validators_hash = 9; // validators for the current block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12;// root hash of all results from the txs from the previous block + bytes next_validators_hash = 10; // validators for the next block + bytes consensus_hash = 11; // consensus params for current block + bytes app_hash = 12; // state after txs from the previous block + bytes last_results_hash = 13;// root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 14; // evidence included in the block + bytes proposer_address = 15; // original proposer of the block } message BlockID { diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index b32c827d..cdff9c72 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -1,14 +1,58 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: abci/types/types.proto +/* +Package types is a generated protocol buffer package. + +It is generated from these files: + abci/types/types.proto + +It has these top-level messages: + Request + RequestEcho + RequestFlush + RequestInfo + RequestSetOption + RequestInitChain + RequestQuery + RequestBeginBlock + RequestCheckTx + RequestDeliverTx + RequestEndBlock + RequestCommit + Response + ResponseException + ResponseEcho + ResponseFlush + ResponseInfo + ResponseSetOption + ResponseInitChain + ResponseQuery + ResponseBeginBlock + ResponseCheckTx + ResponseDeliverTx + ResponseEndBlock + ResponseCommit + ConsensusParams + BlockSize + TxSize + BlockGossip + LastCommitInfo + Header + BlockID + PartSetHeader + Validator + SigningValidator + PubKey + Evidence +*/ package types import testing "testing" -import math_rand "math/rand" +import rand "math/rand" import time "time" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import proto "github.com/gogo/protobuf/proto" +import jsonpb "github.com/gogo/protobuf/jsonpb" import golang_proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" @@ -24,14 +68,14 @@ var _ = math.Inf func TestRequestProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -49,13 +93,13 @@ func TestRequestProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -67,7 +111,7 @@ func TestRequestMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -80,14 +124,14 @@ func TestRequestMarshalTo(t *testing.T) { func TestRequestEchoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -105,13 +149,13 @@ func TestRequestEchoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestEchoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -123,7 +167,7 @@ func TestRequestEchoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -136,14 +180,14 @@ func TestRequestEchoMarshalTo(t *testing.T) { func TestRequestFlushProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -161,13 +205,13 @@ func TestRequestFlushProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestFlushMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -179,7 +223,7 @@ func TestRequestFlushMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -192,14 +236,14 @@ func TestRequestFlushMarshalTo(t *testing.T) { func TestRequestInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -217,13 +261,13 @@ func TestRequestInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -235,7 +279,7 @@ func TestRequestInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -248,14 +292,14 @@ func TestRequestInfoMarshalTo(t *testing.T) { func TestRequestSetOptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -273,13 +317,13 @@ func TestRequestSetOptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestSetOptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -291,7 +335,7 @@ func TestRequestSetOptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -304,14 +348,14 @@ func TestRequestSetOptionMarshalTo(t *testing.T) { func TestRequestInitChainProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -329,13 +373,13 @@ func TestRequestInitChainProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestInitChainMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -347,7 +391,7 @@ func TestRequestInitChainMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -360,14 +404,14 @@ func TestRequestInitChainMarshalTo(t *testing.T) { func TestRequestQueryProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -385,13 +429,13 @@ func TestRequestQueryProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestQueryMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -403,7 +447,7 @@ func TestRequestQueryMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -416,14 +460,14 @@ func TestRequestQueryMarshalTo(t *testing.T) { func TestRequestBeginBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -441,13 +485,13 @@ func TestRequestBeginBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestBeginBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -459,7 +503,7 @@ func TestRequestBeginBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -472,14 +516,14 @@ func TestRequestBeginBlockMarshalTo(t *testing.T) { func TestRequestCheckTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -497,13 +541,13 @@ func TestRequestCheckTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestCheckTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -515,7 +559,7 @@ func TestRequestCheckTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -528,14 +572,14 @@ func TestRequestCheckTxMarshalTo(t *testing.T) { func TestRequestDeliverTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -553,13 +597,13 @@ func TestRequestDeliverTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestDeliverTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -571,7 +615,7 @@ func TestRequestDeliverTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -584,14 +628,14 @@ func TestRequestDeliverTxMarshalTo(t *testing.T) { func TestRequestEndBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -609,13 +653,13 @@ func TestRequestEndBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestEndBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -627,7 +671,7 @@ func TestRequestEndBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -640,14 +684,14 @@ func TestRequestEndBlockMarshalTo(t *testing.T) { func TestRequestCommitProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -665,13 +709,13 @@ func TestRequestCommitProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestRequestCommitMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -683,7 +727,7 @@ func TestRequestCommitMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -696,14 +740,14 @@ func TestRequestCommitMarshalTo(t *testing.T) { func TestResponseProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -721,13 +765,13 @@ func TestResponseProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -739,7 +783,7 @@ func TestResponseMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -752,14 +796,14 @@ func TestResponseMarshalTo(t *testing.T) { func TestResponseExceptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -777,13 +821,13 @@ func TestResponseExceptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseExceptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -795,7 +839,7 @@ func TestResponseExceptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -808,14 +852,14 @@ func TestResponseExceptionMarshalTo(t *testing.T) { func TestResponseEchoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -833,13 +877,13 @@ func TestResponseEchoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseEchoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -851,7 +895,7 @@ func TestResponseEchoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -864,14 +908,14 @@ func TestResponseEchoMarshalTo(t *testing.T) { func TestResponseFlushProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -889,13 +933,13 @@ func TestResponseFlushProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseFlushMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -907,7 +951,7 @@ func TestResponseFlushMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -920,14 +964,14 @@ func TestResponseFlushMarshalTo(t *testing.T) { func TestResponseInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -945,13 +989,13 @@ func TestResponseInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -963,7 +1007,7 @@ func TestResponseInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -976,14 +1020,14 @@ func TestResponseInfoMarshalTo(t *testing.T) { func TestResponseSetOptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1001,13 +1045,13 @@ func TestResponseSetOptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseSetOptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1019,7 +1063,7 @@ func TestResponseSetOptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1032,14 +1076,14 @@ func TestResponseSetOptionMarshalTo(t *testing.T) { func TestResponseInitChainProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1057,13 +1101,13 @@ func TestResponseInitChainProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseInitChainMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1075,7 +1119,7 @@ func TestResponseInitChainMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1088,14 +1132,14 @@ func TestResponseInitChainMarshalTo(t *testing.T) { func TestResponseQueryProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1113,13 +1157,13 @@ func TestResponseQueryProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseQueryMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1131,7 +1175,7 @@ func TestResponseQueryMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1144,14 +1188,14 @@ func TestResponseQueryMarshalTo(t *testing.T) { func TestResponseBeginBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1169,13 +1213,13 @@ func TestResponseBeginBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseBeginBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1187,7 +1231,7 @@ func TestResponseBeginBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1200,14 +1244,14 @@ func TestResponseBeginBlockMarshalTo(t *testing.T) { func TestResponseCheckTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1225,13 +1269,13 @@ func TestResponseCheckTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseCheckTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1243,7 +1287,7 @@ func TestResponseCheckTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1256,14 +1300,14 @@ func TestResponseCheckTxMarshalTo(t *testing.T) { func TestResponseDeliverTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1281,13 +1325,13 @@ func TestResponseDeliverTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseDeliverTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1299,7 +1343,7 @@ func TestResponseDeliverTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1312,14 +1356,14 @@ func TestResponseDeliverTxMarshalTo(t *testing.T) { func TestResponseEndBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1337,13 +1381,13 @@ func TestResponseEndBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseEndBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1355,7 +1399,7 @@ func TestResponseEndBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1368,14 +1412,14 @@ func TestResponseEndBlockMarshalTo(t *testing.T) { func TestResponseCommitProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1393,13 +1437,13 @@ func TestResponseCommitProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestResponseCommitMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1411,7 +1455,7 @@ func TestResponseCommitMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1424,14 +1468,14 @@ func TestResponseCommitMarshalTo(t *testing.T) { func TestConsensusParamsProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1449,13 +1493,13 @@ func TestConsensusParamsProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestConsensusParamsMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1467,7 +1511,7 @@ func TestConsensusParamsMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1480,14 +1524,14 @@ func TestConsensusParamsMarshalTo(t *testing.T) { func TestBlockSizeProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1505,13 +1549,13 @@ func TestBlockSizeProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestBlockSizeMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1523,7 +1567,7 @@ func TestBlockSizeMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1536,14 +1580,14 @@ func TestBlockSizeMarshalTo(t *testing.T) { func TestTxSizeProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1561,13 +1605,13 @@ func TestTxSizeProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestTxSizeMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1579,7 +1623,7 @@ func TestTxSizeMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1592,14 +1636,14 @@ func TestTxSizeMarshalTo(t *testing.T) { func TestBlockGossipProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1617,13 +1661,13 @@ func TestBlockGossipProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestBlockGossipMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1635,7 +1679,7 @@ func TestBlockGossipMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1648,14 +1692,14 @@ func TestBlockGossipMarshalTo(t *testing.T) { func TestLastCommitInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1673,13 +1717,13 @@ func TestLastCommitInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestLastCommitInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1691,7 +1735,7 @@ func TestLastCommitInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1704,14 +1748,14 @@ func TestLastCommitInfoMarshalTo(t *testing.T) { func TestHeaderProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1729,13 +1773,13 @@ func TestHeaderProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestHeaderMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1747,7 +1791,7 @@ func TestHeaderMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1760,14 +1804,14 @@ func TestHeaderMarshalTo(t *testing.T) { func TestBlockIDProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1785,13 +1829,13 @@ func TestBlockIDProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestBlockIDMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1803,7 +1847,7 @@ func TestBlockIDMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1816,14 +1860,14 @@ func TestBlockIDMarshalTo(t *testing.T) { func TestPartSetHeaderProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1841,13 +1885,13 @@ func TestPartSetHeaderProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestPartSetHeaderMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1859,7 +1903,7 @@ func TestPartSetHeaderMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1872,14 +1916,14 @@ func TestPartSetHeaderMarshalTo(t *testing.T) { func TestValidatorProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1897,13 +1941,13 @@ func TestValidatorProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestValidatorMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1915,7 +1959,7 @@ func TestValidatorMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1928,14 +1972,14 @@ func TestValidatorMarshalTo(t *testing.T) { func TestSigningValidatorProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SigningValidator{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1953,13 +1997,13 @@ func TestSigningValidatorProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestSigningValidatorMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1971,7 +2015,7 @@ func TestSigningValidatorMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SigningValidator{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1984,14 +2028,14 @@ func TestSigningValidatorMarshalTo(t *testing.T) { func TestPubKeyProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -2009,13 +2053,13 @@ func TestPubKeyProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestPubKeyMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2027,7 +2071,7 @@ func TestPubKeyMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2040,14 +2084,14 @@ func TestPubKeyMarshalTo(t *testing.T) { func TestEvidenceProto(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -2065,13 +2109,13 @@ func TestEvidenceProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) + _ = proto.Unmarshal(littlefuzz, msg) } } func TestEvidenceMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2083,7 +2127,7 @@ func TestEvidenceMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { + if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2096,15 +2140,15 @@ func TestEvidenceMarshalTo(t *testing.T) { func TestRequestJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2114,15 +2158,15 @@ func TestRequestJSON(t *testing.T) { } func TestRequestEchoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2132,15 +2176,15 @@ func TestRequestEchoJSON(t *testing.T) { } func TestRequestFlushJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2150,15 +2194,15 @@ func TestRequestFlushJSON(t *testing.T) { } func TestRequestInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2168,15 +2212,15 @@ func TestRequestInfoJSON(t *testing.T) { } func TestRequestSetOptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2186,15 +2230,15 @@ func TestRequestSetOptionJSON(t *testing.T) { } func TestRequestInitChainJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2204,15 +2248,15 @@ func TestRequestInitChainJSON(t *testing.T) { } func TestRequestQueryJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2222,15 +2266,15 @@ func TestRequestQueryJSON(t *testing.T) { } func TestRequestBeginBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2240,15 +2284,15 @@ func TestRequestBeginBlockJSON(t *testing.T) { } func TestRequestCheckTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2258,15 +2302,15 @@ func TestRequestCheckTxJSON(t *testing.T) { } func TestRequestDeliverTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2276,15 +2320,15 @@ func TestRequestDeliverTxJSON(t *testing.T) { } func TestRequestEndBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2294,15 +2338,15 @@ func TestRequestEndBlockJSON(t *testing.T) { } func TestRequestCommitJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2312,15 +2356,15 @@ func TestRequestCommitJSON(t *testing.T) { } func TestResponseJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2330,15 +2374,15 @@ func TestResponseJSON(t *testing.T) { } func TestResponseExceptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2348,15 +2392,15 @@ func TestResponseExceptionJSON(t *testing.T) { } func TestResponseEchoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2366,15 +2410,15 @@ func TestResponseEchoJSON(t *testing.T) { } func TestResponseFlushJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2384,15 +2428,15 @@ func TestResponseFlushJSON(t *testing.T) { } func TestResponseInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2402,15 +2446,15 @@ func TestResponseInfoJSON(t *testing.T) { } func TestResponseSetOptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2420,15 +2464,15 @@ func TestResponseSetOptionJSON(t *testing.T) { } func TestResponseInitChainJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2438,15 +2482,15 @@ func TestResponseInitChainJSON(t *testing.T) { } func TestResponseQueryJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2456,15 +2500,15 @@ func TestResponseQueryJSON(t *testing.T) { } func TestResponseBeginBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2474,15 +2518,15 @@ func TestResponseBeginBlockJSON(t *testing.T) { } func TestResponseCheckTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2492,15 +2536,15 @@ func TestResponseCheckTxJSON(t *testing.T) { } func TestResponseDeliverTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2510,15 +2554,15 @@ func TestResponseDeliverTxJSON(t *testing.T) { } func TestResponseEndBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2528,15 +2572,15 @@ func TestResponseEndBlockJSON(t *testing.T) { } func TestResponseCommitJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2546,15 +2590,15 @@ func TestResponseCommitJSON(t *testing.T) { } func TestConsensusParamsJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2564,15 +2608,15 @@ func TestConsensusParamsJSON(t *testing.T) { } func TestBlockSizeJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2582,15 +2626,15 @@ func TestBlockSizeJSON(t *testing.T) { } func TestTxSizeJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2600,15 +2644,15 @@ func TestTxSizeJSON(t *testing.T) { } func TestBlockGossipJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2618,15 +2662,15 @@ func TestBlockGossipJSON(t *testing.T) { } func TestLastCommitInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2636,15 +2680,15 @@ func TestLastCommitInfoJSON(t *testing.T) { } func TestHeaderJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2654,15 +2698,15 @@ func TestHeaderJSON(t *testing.T) { } func TestBlockIDJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2672,15 +2716,15 @@ func TestBlockIDJSON(t *testing.T) { } func TestPartSetHeaderJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2690,15 +2734,15 @@ func TestPartSetHeaderJSON(t *testing.T) { } func TestValidatorJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2708,15 +2752,15 @@ func TestValidatorJSON(t *testing.T) { } func TestSigningValidatorJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &SigningValidator{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2726,15 +2770,15 @@ func TestSigningValidatorJSON(t *testing.T) { } func TestPubKeyJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2744,15 +2788,15 @@ func TestPubKeyJSON(t *testing.T) { } func TestEvidenceJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} + marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) + err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2762,11 +2806,11 @@ func TestEvidenceJSON(t *testing.T) { } func TestRequestProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &Request{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2776,11 +2820,11 @@ func TestRequestProtoText(t *testing.T) { func TestRequestProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &Request{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2790,11 +2834,11 @@ func TestRequestProtoCompactText(t *testing.T) { func TestRequestEchoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestEcho{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2804,11 +2848,11 @@ func TestRequestEchoProtoText(t *testing.T) { func TestRequestEchoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestEcho{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2818,11 +2862,11 @@ func TestRequestEchoProtoCompactText(t *testing.T) { func TestRequestFlushProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestFlush{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2832,11 +2876,11 @@ func TestRequestFlushProtoText(t *testing.T) { func TestRequestFlushProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestFlush{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2846,11 +2890,11 @@ func TestRequestFlushProtoCompactText(t *testing.T) { func TestRequestInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2860,11 +2904,11 @@ func TestRequestInfoProtoText(t *testing.T) { func TestRequestInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2874,11 +2918,11 @@ func TestRequestInfoProtoCompactText(t *testing.T) { func TestRequestSetOptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestSetOption{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2888,11 +2932,11 @@ func TestRequestSetOptionProtoText(t *testing.T) { func TestRequestSetOptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestSetOption{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2902,11 +2946,11 @@ func TestRequestSetOptionProtoCompactText(t *testing.T) { func TestRequestInitChainProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestInitChain{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2916,11 +2960,11 @@ func TestRequestInitChainProtoText(t *testing.T) { func TestRequestInitChainProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestInitChain{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2930,11 +2974,11 @@ func TestRequestInitChainProtoCompactText(t *testing.T) { func TestRequestQueryProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestQuery{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2944,11 +2988,11 @@ func TestRequestQueryProtoText(t *testing.T) { func TestRequestQueryProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestQuery{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2958,11 +3002,11 @@ func TestRequestQueryProtoCompactText(t *testing.T) { func TestRequestBeginBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestBeginBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2972,11 +3016,11 @@ func TestRequestBeginBlockProtoText(t *testing.T) { func TestRequestBeginBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestBeginBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2986,11 +3030,11 @@ func TestRequestBeginBlockProtoCompactText(t *testing.T) { func TestRequestCheckTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestCheckTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3000,11 +3044,11 @@ func TestRequestCheckTxProtoText(t *testing.T) { func TestRequestCheckTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestCheckTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3014,11 +3058,11 @@ func TestRequestCheckTxProtoCompactText(t *testing.T) { func TestRequestDeliverTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestDeliverTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3028,11 +3072,11 @@ func TestRequestDeliverTxProtoText(t *testing.T) { func TestRequestDeliverTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestDeliverTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3042,11 +3086,11 @@ func TestRequestDeliverTxProtoCompactText(t *testing.T) { func TestRequestEndBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestEndBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3056,11 +3100,11 @@ func TestRequestEndBlockProtoText(t *testing.T) { func TestRequestEndBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestEndBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3070,11 +3114,11 @@ func TestRequestEndBlockProtoCompactText(t *testing.T) { func TestRequestCommitProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &RequestCommit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3084,11 +3128,11 @@ func TestRequestCommitProtoText(t *testing.T) { func TestRequestCommitProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &RequestCommit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3098,11 +3142,11 @@ func TestRequestCommitProtoCompactText(t *testing.T) { func TestResponseProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &Response{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3112,11 +3156,11 @@ func TestResponseProtoText(t *testing.T) { func TestResponseProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &Response{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3126,11 +3170,11 @@ func TestResponseProtoCompactText(t *testing.T) { func TestResponseExceptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseException{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3140,11 +3184,11 @@ func TestResponseExceptionProtoText(t *testing.T) { func TestResponseExceptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseException{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3154,11 +3198,11 @@ func TestResponseExceptionProtoCompactText(t *testing.T) { func TestResponseEchoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseEcho{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3168,11 +3212,11 @@ func TestResponseEchoProtoText(t *testing.T) { func TestResponseEchoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseEcho{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3182,11 +3226,11 @@ func TestResponseEchoProtoCompactText(t *testing.T) { func TestResponseFlushProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseFlush{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3196,11 +3240,11 @@ func TestResponseFlushProtoText(t *testing.T) { func TestResponseFlushProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseFlush{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3210,11 +3254,11 @@ func TestResponseFlushProtoCompactText(t *testing.T) { func TestResponseInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3224,11 +3268,11 @@ func TestResponseInfoProtoText(t *testing.T) { func TestResponseInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3238,11 +3282,11 @@ func TestResponseInfoProtoCompactText(t *testing.T) { func TestResponseSetOptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseSetOption{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3252,11 +3296,11 @@ func TestResponseSetOptionProtoText(t *testing.T) { func TestResponseSetOptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseSetOption{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3266,11 +3310,11 @@ func TestResponseSetOptionProtoCompactText(t *testing.T) { func TestResponseInitChainProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseInitChain{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3280,11 +3324,11 @@ func TestResponseInitChainProtoText(t *testing.T) { func TestResponseInitChainProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseInitChain{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3294,11 +3338,11 @@ func TestResponseInitChainProtoCompactText(t *testing.T) { func TestResponseQueryProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseQuery{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3308,11 +3352,11 @@ func TestResponseQueryProtoText(t *testing.T) { func TestResponseQueryProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseQuery{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3322,11 +3366,11 @@ func TestResponseQueryProtoCompactText(t *testing.T) { func TestResponseBeginBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseBeginBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3336,11 +3380,11 @@ func TestResponseBeginBlockProtoText(t *testing.T) { func TestResponseBeginBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseBeginBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3350,11 +3394,11 @@ func TestResponseBeginBlockProtoCompactText(t *testing.T) { func TestResponseCheckTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseCheckTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3364,11 +3408,11 @@ func TestResponseCheckTxProtoText(t *testing.T) { func TestResponseCheckTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseCheckTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3378,11 +3422,11 @@ func TestResponseCheckTxProtoCompactText(t *testing.T) { func TestResponseDeliverTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseDeliverTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3392,11 +3436,11 @@ func TestResponseDeliverTxProtoText(t *testing.T) { func TestResponseDeliverTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseDeliverTx{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3406,11 +3450,11 @@ func TestResponseDeliverTxProtoCompactText(t *testing.T) { func TestResponseEndBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseEndBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3420,11 +3464,11 @@ func TestResponseEndBlockProtoText(t *testing.T) { func TestResponseEndBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseEndBlock{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3434,11 +3478,11 @@ func TestResponseEndBlockProtoCompactText(t *testing.T) { func TestResponseCommitProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ResponseCommit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3448,11 +3492,11 @@ func TestResponseCommitProtoText(t *testing.T) { func TestResponseCommitProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ResponseCommit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3462,11 +3506,11 @@ func TestResponseCommitProtoCompactText(t *testing.T) { func TestConsensusParamsProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &ConsensusParams{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3476,11 +3520,11 @@ func TestConsensusParamsProtoText(t *testing.T) { func TestConsensusParamsProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &ConsensusParams{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3490,11 +3534,11 @@ func TestConsensusParamsProtoCompactText(t *testing.T) { func TestBlockSizeProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &BlockSize{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3504,11 +3548,11 @@ func TestBlockSizeProtoText(t *testing.T) { func TestBlockSizeProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &BlockSize{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3518,11 +3562,11 @@ func TestBlockSizeProtoCompactText(t *testing.T) { func TestTxSizeProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &TxSize{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3532,11 +3576,11 @@ func TestTxSizeProtoText(t *testing.T) { func TestTxSizeProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &TxSize{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3546,11 +3590,11 @@ func TestTxSizeProtoCompactText(t *testing.T) { func TestBlockGossipProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &BlockGossip{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3560,11 +3604,11 @@ func TestBlockGossipProtoText(t *testing.T) { func TestBlockGossipProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &BlockGossip{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3574,11 +3618,11 @@ func TestBlockGossipProtoCompactText(t *testing.T) { func TestLastCommitInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &LastCommitInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3588,11 +3632,11 @@ func TestLastCommitInfoProtoText(t *testing.T) { func TestLastCommitInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &LastCommitInfo{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3602,11 +3646,11 @@ func TestLastCommitInfoProtoCompactText(t *testing.T) { func TestHeaderProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &Header{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3616,11 +3660,11 @@ func TestHeaderProtoText(t *testing.T) { func TestHeaderProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &Header{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3630,11 +3674,11 @@ func TestHeaderProtoCompactText(t *testing.T) { func TestBlockIDProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &BlockID{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3644,11 +3688,11 @@ func TestBlockIDProtoText(t *testing.T) { func TestBlockIDProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &BlockID{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3658,11 +3702,11 @@ func TestBlockIDProtoCompactText(t *testing.T) { func TestPartSetHeaderProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &PartSetHeader{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3672,11 +3716,11 @@ func TestPartSetHeaderProtoText(t *testing.T) { func TestPartSetHeaderProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &PartSetHeader{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3686,11 +3730,11 @@ func TestPartSetHeaderProtoCompactText(t *testing.T) { func TestValidatorProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &Validator{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3700,11 +3744,11 @@ func TestValidatorProtoText(t *testing.T) { func TestValidatorProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &Validator{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3714,11 +3758,11 @@ func TestValidatorProtoCompactText(t *testing.T) { func TestSigningValidatorProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &SigningValidator{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3728,11 +3772,11 @@ func TestSigningValidatorProtoText(t *testing.T) { func TestSigningValidatorProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &SigningValidator{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3742,11 +3786,11 @@ func TestSigningValidatorProtoCompactText(t *testing.T) { func TestPubKeyProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &PubKey{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3756,11 +3800,11 @@ func TestPubKeyProtoText(t *testing.T) { func TestPubKeyProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &PubKey{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3770,11 +3814,11 @@ func TestPubKeyProtoCompactText(t *testing.T) { func TestEvidenceProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) + dAtA := proto.MarshalTextString(p) msg := &Evidence{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3784,11 +3828,11 @@ func TestEvidenceProtoText(t *testing.T) { func TestEvidenceProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) + dAtA := proto.CompactTextString(p) msg := &Evidence{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { + if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3798,10 +3842,10 @@ func TestEvidenceProtoCompactText(t *testing.T) { func TestRequestSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3812,7 +3856,7 @@ func TestRequestSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3820,10 +3864,10 @@ func TestRequestSize(t *testing.T) { func TestRequestEchoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3834,7 +3878,7 @@ func TestRequestEchoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3842,10 +3886,10 @@ func TestRequestEchoSize(t *testing.T) { func TestRequestFlushSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3856,7 +3900,7 @@ func TestRequestFlushSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3864,10 +3908,10 @@ func TestRequestFlushSize(t *testing.T) { func TestRequestInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3878,7 +3922,7 @@ func TestRequestInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3886,10 +3930,10 @@ func TestRequestInfoSize(t *testing.T) { func TestRequestSetOptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3900,7 +3944,7 @@ func TestRequestSetOptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3908,10 +3952,10 @@ func TestRequestSetOptionSize(t *testing.T) { func TestRequestInitChainSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3922,7 +3966,7 @@ func TestRequestInitChainSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3930,10 +3974,10 @@ func TestRequestInitChainSize(t *testing.T) { func TestRequestQuerySize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3944,7 +3988,7 @@ func TestRequestQuerySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3952,10 +3996,10 @@ func TestRequestQuerySize(t *testing.T) { func TestRequestBeginBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3966,7 +4010,7 @@ func TestRequestBeginBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3974,10 +4018,10 @@ func TestRequestBeginBlockSize(t *testing.T) { func TestRequestCheckTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3988,7 +4032,7 @@ func TestRequestCheckTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3996,10 +4040,10 @@ func TestRequestCheckTxSize(t *testing.T) { func TestRequestDeliverTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4010,7 +4054,7 @@ func TestRequestDeliverTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4018,10 +4062,10 @@ func TestRequestDeliverTxSize(t *testing.T) { func TestRequestEndBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4032,7 +4076,7 @@ func TestRequestEndBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4040,10 +4084,10 @@ func TestRequestEndBlockSize(t *testing.T) { func TestRequestCommitSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4054,7 +4098,7 @@ func TestRequestCommitSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4062,10 +4106,10 @@ func TestRequestCommitSize(t *testing.T) { func TestResponseSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4076,7 +4120,7 @@ func TestResponseSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4084,10 +4128,10 @@ func TestResponseSize(t *testing.T) { func TestResponseExceptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4098,7 +4142,7 @@ func TestResponseExceptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4106,10 +4150,10 @@ func TestResponseExceptionSize(t *testing.T) { func TestResponseEchoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4120,7 +4164,7 @@ func TestResponseEchoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4128,10 +4172,10 @@ func TestResponseEchoSize(t *testing.T) { func TestResponseFlushSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4142,7 +4186,7 @@ func TestResponseFlushSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4150,10 +4194,10 @@ func TestResponseFlushSize(t *testing.T) { func TestResponseInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4164,7 +4208,7 @@ func TestResponseInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4172,10 +4216,10 @@ func TestResponseInfoSize(t *testing.T) { func TestResponseSetOptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4186,7 +4230,7 @@ func TestResponseSetOptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4194,10 +4238,10 @@ func TestResponseSetOptionSize(t *testing.T) { func TestResponseInitChainSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4208,7 +4252,7 @@ func TestResponseInitChainSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4216,10 +4260,10 @@ func TestResponseInitChainSize(t *testing.T) { func TestResponseQuerySize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4230,7 +4274,7 @@ func TestResponseQuerySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4238,10 +4282,10 @@ func TestResponseQuerySize(t *testing.T) { func TestResponseBeginBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4252,7 +4296,7 @@ func TestResponseBeginBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4260,10 +4304,10 @@ func TestResponseBeginBlockSize(t *testing.T) { func TestResponseCheckTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4274,7 +4318,7 @@ func TestResponseCheckTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4282,10 +4326,10 @@ func TestResponseCheckTxSize(t *testing.T) { func TestResponseDeliverTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4296,7 +4340,7 @@ func TestResponseDeliverTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4304,10 +4348,10 @@ func TestResponseDeliverTxSize(t *testing.T) { func TestResponseEndBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4318,7 +4362,7 @@ func TestResponseEndBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4326,10 +4370,10 @@ func TestResponseEndBlockSize(t *testing.T) { func TestResponseCommitSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4340,7 +4384,7 @@ func TestResponseCommitSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4348,10 +4392,10 @@ func TestResponseCommitSize(t *testing.T) { func TestConsensusParamsSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4362,7 +4406,7 @@ func TestConsensusParamsSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4370,10 +4414,10 @@ func TestConsensusParamsSize(t *testing.T) { func TestBlockSizeSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4384,7 +4428,7 @@ func TestBlockSizeSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4392,10 +4436,10 @@ func TestBlockSizeSize(t *testing.T) { func TestTxSizeSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4406,7 +4450,7 @@ func TestTxSizeSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4414,10 +4458,10 @@ func TestTxSizeSize(t *testing.T) { func TestBlockGossipSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4428,7 +4472,7 @@ func TestBlockGossipSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4436,10 +4480,10 @@ func TestBlockGossipSize(t *testing.T) { func TestLastCommitInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4450,7 +4494,7 @@ func TestLastCommitInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4458,10 +4502,10 @@ func TestLastCommitInfoSize(t *testing.T) { func TestHeaderSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4472,7 +4516,7 @@ func TestHeaderSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4480,10 +4524,10 @@ func TestHeaderSize(t *testing.T) { func TestBlockIDSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4494,7 +4538,7 @@ func TestBlockIDSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4502,10 +4546,10 @@ func TestBlockIDSize(t *testing.T) { func TestPartSetHeaderSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4516,7 +4560,7 @@ func TestPartSetHeaderSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4524,10 +4568,10 @@ func TestPartSetHeaderSize(t *testing.T) { func TestValidatorSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4538,7 +4582,7 @@ func TestValidatorSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4546,10 +4590,10 @@ func TestValidatorSize(t *testing.T) { func TestSigningValidatorSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedSigningValidator(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4560,7 +4604,7 @@ func TestSigningValidatorSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4568,10 +4612,10 @@ func TestSigningValidatorSize(t *testing.T) { func TestPubKeySize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4582,7 +4626,7 @@ func TestPubKeySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4590,10 +4634,10 @@ func TestPubKeySize(t *testing.T) { func TestEvidenceSize(t *testing.T) { seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) + popr := rand.New(rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4604,7 +4648,7 @@ func TestEvidenceSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := github_com_gogo_protobuf_proto.Size(p) + size3 := proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } From e3f54ece2f6d2d8a0fe5fc4168247553d2a09523 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Aug 2018 00:18:24 -0400 Subject: [PATCH 075/149] abci: VoteInfo, ValidatorUpdate. See ADR-018 --- abci/example/kvstore/helpers.go | 10 +- abci/example/kvstore/kvstore_test.go | 18 +- abci/example/kvstore/persistent_kvstore.go | 12 +- abci/tests/server/client.go | 4 +- abci/types/pubkey.go | 4 +- abci/types/types.pb.go | 729 +++++++++++++-------- abci/types/types.proto | 21 +- abci/types/typespb_test.go | 161 ++++- abci/types/util.go | 41 +- consensus/common_test.go | 4 +- consensus/reactor_test.go | 2 +- consensus/replay.go | 4 +- consensus/replay_test.go | 10 +- state/execution.go | 34 +- state/execution_test.go | 18 +- state/state_test.go | 14 +- types/protobuf.go | 41 +- types/protobuf_test.go | 31 +- 18 files changed, 706 insertions(+), 452 deletions(-) diff --git a/abci/example/kvstore/helpers.go b/abci/example/kvstore/helpers.go index 0e69fab9..bb086dec 100644 --- a/abci/example/kvstore/helpers.go +++ b/abci/example/kvstore/helpers.go @@ -7,12 +7,10 @@ import ( // RandVal creates one random validator, with a key derived // from the input value -func RandVal(i int) types.Validator { - addr := cmn.RandBytes(20) +func RandVal(i int) types.ValidatorUpdate { pubkey := cmn.RandBytes(32) power := cmn.RandUint16() + 1 - v := types.Ed25519Validator(pubkey, int64(power)) - v.Address = addr + v := types.Ed25519ValidatorUpdate(pubkey, int64(power)) return v } @@ -20,8 +18,8 @@ func RandVal(i int) types.Validator { // the application. Note that the keys are deterministically // derived from the index in the array, while the power is // random (Change this if not desired) -func RandVals(cnt int) []types.Validator { - res := make([]types.Validator, cnt) +func RandVals(cnt int) []types.ValidatorUpdate { + res := make([]types.ValidatorUpdate, cnt) for i := 0; i < cnt; i++ { res[i] = RandVal(i) } diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 33e67aaa..a18fb8d3 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -122,11 +122,11 @@ func TestValUpdates(t *testing.T) { vals1, vals2 := vals[:nInit], kvstore.Validators() valsEqual(t, vals1, vals2) - var v1, v2, v3 types.Validator + var v1, v2, v3 types.ValidatorUpdate // add some validators v1, v2 = vals[nInit], vals[nInit+1] - diff := []types.Validator{v1, v2} + diff := []types.ValidatorUpdate{v1, v2} tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) @@ -140,7 +140,7 @@ func TestValUpdates(t *testing.T) { v1.Power = 0 v2.Power = 0 v3.Power = 0 - diff = []types.Validator{v1, v2, v3} + diff = []types.ValidatorUpdate{v1, v2, v3} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) @@ -158,18 +158,18 @@ func TestValUpdates(t *testing.T) { } else { v1.Power = 5 } - diff = []types.Validator{v1} + diff = []types.ValidatorUpdate{v1} tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) makeApplyBlock(t, kvstore, 3, diff, tx1) - vals1 = append([]types.Validator{v1}, vals1[1:]...) + vals1 = append([]types.ValidatorUpdate{v1}, vals1[1:]...) vals2 = kvstore.Validators() valsEqual(t, vals1, vals2) } -func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff []types.Validator, txs ...[]byte) { +func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff []types.ValidatorUpdate, txs ...[]byte) { // make and apply block height := int64(heightInt) hash := []byte("foo") @@ -191,12 +191,12 @@ func makeApplyBlock(t *testing.T, kvstore types.Application, heightInt int, diff } // order doesn't matter -func valsEqual(t *testing.T, vals1, vals2 []types.Validator) { +func valsEqual(t *testing.T, vals1, vals2 []types.ValidatorUpdate) { if len(vals1) != len(vals2) { t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) } - sort.Sort(types.Validators(vals1)) - sort.Sort(types.Validators(vals2)) + sort.Sort(types.ValidatorUpdates(vals1)) + sort.Sort(types.ValidatorUpdates(vals2)) for i, v1 := range vals1 { v2 := vals2[i] if !bytes.Equal(v1.PubKey.Data, v2.PubKey.Data) || diff --git a/abci/example/kvstore/persistent_kvstore.go b/abci/example/kvstore/persistent_kvstore.go index b8a2299a..f969eebf 100644 --- a/abci/example/kvstore/persistent_kvstore.go +++ b/abci/example/kvstore/persistent_kvstore.go @@ -25,7 +25,7 @@ type PersistentKVStoreApplication struct { app *KVStoreApplication // validator set - ValUpdates []types.Validator + ValUpdates []types.ValidatorUpdate logger log.Logger } @@ -101,7 +101,7 @@ func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) t // Track the block hash and header information func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock { // reset valset changes - app.ValUpdates = make([]types.Validator, 0) + app.ValUpdates = make([]types.ValidatorUpdate, 0) return types.ResponseBeginBlock{} } @@ -113,11 +113,11 @@ func (app *PersistentKVStoreApplication) EndBlock(req types.RequestEndBlock) typ //--------------------------------------------- // update validators -func (app *PersistentKVStoreApplication) Validators() (validators []types.Validator) { +func (app *PersistentKVStoreApplication) Validators() (validators []types.ValidatorUpdate) { itr := app.app.state.db.Iterator(nil, nil) for ; itr.Valid(); itr.Next() { if isValidatorTx(itr.Key()) { - validator := new(types.Validator) + validator := new(types.ValidatorUpdate) err := types.ReadMessage(bytes.NewBuffer(itr.Value()), validator) if err != nil { panic(err) @@ -167,11 +167,11 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon } // update - return app.updateValidator(types.Ed25519Validator(pubkey, int64(power))) + return app.updateValidator(types.Ed25519ValidatorUpdate(pubkey, int64(power))) } // add, update, or remove a validator -func (app *PersistentKVStoreApplication) updateValidator(v types.Validator) types.ResponseDeliverTx { +func (app *PersistentKVStoreApplication) updateValidator(v types.ValidatorUpdate) types.ResponseDeliverTx { key := []byte("val:" + string(v.PubKey.Data)) if v.Power == 0 { // remove validator diff --git a/abci/tests/server/client.go b/abci/tests/server/client.go index f67297cd..5daa1e6a 100644 --- a/abci/tests/server/client.go +++ b/abci/tests/server/client.go @@ -12,11 +12,11 @@ import ( func InitChain(client abcicli.Client) error { total := 10 - vals := make([]types.Validator, total) + vals := make([]types.ValidatorUpdate, total) for i := 0; i < total; i++ { pubkey := cmn.RandBytes(33) power := cmn.RandInt() - vals[i] = types.Ed25519Validator(pubkey, int64(power)) + vals[i] = types.Ed25519ValidatorUpdate(pubkey, int64(power)) } _, err := client.InitChainSync(types.RequestInitChain{ Validators: vals, diff --git a/abci/types/pubkey.go b/abci/types/pubkey.go index e5cd5fbf..46cd8c5e 100644 --- a/abci/types/pubkey.go +++ b/abci/types/pubkey.go @@ -4,8 +4,8 @@ const ( PubKeyEd25519 = "ed25519" ) -func Ed25519Validator(pubkey []byte, power int64) Validator { - return Validator{ +func Ed25519ValidatorUpdate(pubkey []byte, power int64) ValidatorUpdate { + return ValidatorUpdate{ // Address: PubKey: PubKey{ Type: PubKeyEd25519, diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index a609d677..773754c7 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -42,7 +42,8 @@ BlockID PartSetHeader Validator - SigningValidator + ValidatorUpdate + VoteInfo PubKey Evidence */ @@ -551,11 +552,11 @@ func (m *RequestSetOption) GetValue() string { } type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,4,rep,name=validators" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` } func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } @@ -584,7 +585,7 @@ func (m *RequestInitChain) GetConsensusParams() *ConsensusParams { return nil } -func (m *RequestInitChain) GetValidators() []Validator { +func (m *RequestInitChain) GetValidators() []ValidatorUpdate { if m != nil { return m.Validators } @@ -1285,8 +1286,8 @@ func (m *ResponseSetOption) GetInfo() string { } type ResponseInitChain struct { - ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []Validator `protobuf:"bytes,2,rep,name=validators" json:"validators"` + ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators" json:"validators"` } func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } @@ -1301,7 +1302,7 @@ func (m *ResponseInitChain) GetConsensusParams() *ConsensusParams { return nil } -func (m *ResponseInitChain) GetValidators() []Validator { +func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { if m != nil { return m.Validators } @@ -1526,9 +1527,9 @@ func (m *ResponseDeliverTx) GetTags() []common.KVPair { } type ResponseEndBlock struct { - ValidatorUpdates []Validator `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` - ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` - Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` + ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` + ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` + Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } @@ -1536,7 +1537,7 @@ func (m *ResponseEndBlock) String() string { return proto.CompactText func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{23} } -func (m *ResponseEndBlock) GetValidatorUpdates() []Validator { +func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { if m != nil { return m.ValidatorUpdates } @@ -1686,8 +1687,7 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { } type LastCommitInfo struct { - CommitRound int32 `protobuf:"varint,1,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` - Validators []SigningValidator `protobuf:"bytes,2,rep,name=validators" json:"validators"` + CommitVotes []VoteInfo `protobuf:"bytes,1,rep,name=commit_votes,json=commitVotes" json:"commit_votes"` } func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } @@ -1695,16 +1695,9 @@ func (m *LastCommitInfo) String() string { return proto.CompactTextSt func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } -func (m *LastCommitInfo) GetCommitRound() int32 { +func (m *LastCommitInfo) GetCommitVotes() []VoteInfo { if m != nil { - return m.CommitRound - } - return 0 -} - -func (m *LastCommitInfo) GetValidators() []SigningValidator { - if m != nil { - return m.Validators + return m.CommitVotes } return nil } @@ -1893,7 +1886,6 @@ func (m *PartSetHeader) GetHash() []byte { // Validator type Validator struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey PubKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey" json:"pub_key"` Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` } @@ -1909,13 +1901,6 @@ func (m *Validator) GetAddress() []byte { return nil } -func (m *Validator) GetPubKey() PubKey { - if m != nil { - return m.PubKey - } - return PubKey{} -} - func (m *Validator) GetPower() int64 { if m != nil { return m.Power @@ -1923,31 +1908,64 @@ func (m *Validator) GetPower() int64 { return 0 } -// Validator with an extra bool -type SigningValidator struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` +// ValidatorUpdate +type ValidatorUpdate struct { + PubKey PubKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } -func (m *SigningValidator) Reset() { *m = SigningValidator{} } -func (m *SigningValidator) String() string { return proto.CompactTextString(m) } -func (*SigningValidator) ProtoMessage() {} -func (*SigningValidator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{34} } +func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } +func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdate) ProtoMessage() {} +func (*ValidatorUpdate) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{34} } -func (m *SigningValidator) GetValidator() Validator { +func (m *ValidatorUpdate) GetPubKey() PubKey { + if m != nil { + return m.PubKey + } + return PubKey{} +} + +func (m *ValidatorUpdate) GetPower() int64 { + if m != nil { + return m.Power + } + return 0 +} + +// VoteInfo +type VoteInfo struct { + Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` + SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` + CommitRound int64 `protobuf:"varint,3,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` +} + +func (m *VoteInfo) Reset() { *m = VoteInfo{} } +func (m *VoteInfo) String() string { return proto.CompactTextString(m) } +func (*VoteInfo) ProtoMessage() {} +func (*VoteInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{35} } + +func (m *VoteInfo) GetValidator() Validator { if m != nil { return m.Validator } return Validator{} } -func (m *SigningValidator) GetSignedLastBlock() bool { +func (m *VoteInfo) GetSignedLastBlock() bool { if m != nil { return m.SignedLastBlock } return false } +func (m *VoteInfo) GetCommitRound() int64 { + if m != nil { + return m.CommitRound + } + return 0 +} + type PubKey struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -1956,7 +1974,7 @@ type PubKey struct { func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{35} } +func (*PubKey) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{36} } func (m *PubKey) GetType() string { if m != nil { @@ -1983,7 +2001,7 @@ type Evidence struct { func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{36} } +func (*Evidence) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{37} } func (m *Evidence) GetType() string { if m != nil { @@ -2089,8 +2107,10 @@ func init() { golang_proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") golang_proto.RegisterType((*Validator)(nil), "types.Validator") - proto.RegisterType((*SigningValidator)(nil), "types.SigningValidator") - golang_proto.RegisterType((*SigningValidator)(nil), "types.SigningValidator") + proto.RegisterType((*ValidatorUpdate)(nil), "types.ValidatorUpdate") + golang_proto.RegisterType((*ValidatorUpdate)(nil), "types.ValidatorUpdate") + proto.RegisterType((*VoteInfo)(nil), "types.VoteInfo") + golang_proto.RegisterType((*VoteInfo)(nil), "types.VoteInfo") proto.RegisterType((*PubKey)(nil), "types.PubKey") golang_proto.RegisterType((*PubKey)(nil), "types.PubKey") proto.RegisterType((*Evidence)(nil), "types.Evidence") @@ -3535,14 +3555,11 @@ func (this *LastCommitInfo) Equal(that interface{}) bool { } else if this == nil { return false } - if this.CommitRound != that1.CommitRound { + if len(this.CommitVotes) != len(that1.CommitVotes) { return false } - if len(this.Validators) != len(that1.Validators) { - return false - } - for i := range this.Validators { - if !this.Validators[i].Equal(&that1.Validators[i]) { + for i := range this.CommitVotes { + if !this.CommitVotes[i].Equal(&that1.CommitVotes[i]) { return false } } @@ -3690,6 +3707,30 @@ func (this *Validator) Equal(that interface{}) bool { if !bytes.Equal(this.Address, that1.Address) { return false } + if this.Power != that1.Power { + return false + } + return true +} +func (this *ValidatorUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorUpdate) + if !ok { + that2, ok := that.(ValidatorUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } if !this.PubKey.Equal(&that1.PubKey) { return false } @@ -3698,14 +3739,14 @@ func (this *Validator) Equal(that interface{}) bool { } return true } -func (this *SigningValidator) Equal(that interface{}) bool { +func (this *VoteInfo) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*SigningValidator) + that1, ok := that.(*VoteInfo) if !ok { - that2, ok := that.(SigningValidator) + that2, ok := that.(VoteInfo) if ok { that1 = &that2 } else { @@ -3723,6 +3764,9 @@ func (this *SigningValidator) Equal(that interface{}) bool { if this.SignedLastBlock != that1.SignedLastBlock { return false } + if this.CommitRound != that1.CommitRound { + return false + } return true } func (this *PubKey) Equal(that interface{}) bool { @@ -5532,14 +5576,9 @@ func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.CommitRound != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CommitRound)) - } - if len(m.Validators) > 0 { - for _, msg := range m.Validators { - dAtA[i] = 0x12 + if len(m.CommitVotes) > 0 { + for _, msg := range m.CommitVotes { + dAtA[i] = 0xa i++ i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) @@ -5743,14 +5782,6 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) i += copy(dAtA[i:], m.Address) } - dAtA[i] = 0x12 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) - n38, err := m.PubKey.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 if m.Power != 0 { dAtA[i] = 0x18 i++ @@ -5759,7 +5790,7 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *SigningValidator) Marshal() (dAtA []byte, err error) { +func (m *ValidatorUpdate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -5769,7 +5800,38 @@ func (m *SigningValidator) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { +func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.PubKey.Size())) + n38, err := m.PubKey.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n38 + if m.Power != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Power)) + } + return i, nil +} + +func (m *VoteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -5792,6 +5854,11 @@ func (m *SigningValidator) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.CommitRound != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.CommitRound)) + } return i, nil } @@ -6013,9 +6080,9 @@ func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { } if r.Intn(10) != 0 { v2 := r.Intn(5) - this.Validators = make([]Validator, v2) + this.Validators = make([]ValidatorUpdate, v2) for i := 0; i < v2; i++ { - v3 := NewPopulatedValidator(r, easy) + v3 := NewPopulatedValidatorUpdate(r, easy) this.Validators[i] = *v3 } } @@ -6265,9 +6332,9 @@ func NewPopulatedResponseInitChain(r randyTypes, easy bool) *ResponseInitChain { } if r.Intn(10) != 0 { v14 := r.Intn(5) - this.Validators = make([]Validator, v14) + this.Validators = make([]ValidatorUpdate, v14) for i := 0; i < v14; i++ { - v15 := NewPopulatedValidator(r, easy) + v15 := NewPopulatedValidatorUpdate(r, easy) this.Validators[i] = *v15 } } @@ -6390,9 +6457,9 @@ func NewPopulatedResponseEndBlock(r randyTypes, easy bool) *ResponseEndBlock { this := &ResponseEndBlock{} if r.Intn(10) != 0 { v27 := r.Intn(5) - this.ValidatorUpdates = make([]Validator, v27) + this.ValidatorUpdates = make([]ValidatorUpdate, v27) for i := 0; i < v27; i++ { - v28 := NewPopulatedValidator(r, easy) + v28 := NewPopulatedValidatorUpdate(r, easy) this.ValidatorUpdates[i] = *v28 } } @@ -6487,16 +6554,12 @@ func NewPopulatedBlockGossip(r randyTypes, easy bool) *BlockGossip { func NewPopulatedLastCommitInfo(r randyTypes, easy bool) *LastCommitInfo { this := &LastCommitInfo{} - this.CommitRound = int32(r.Int31()) - if r.Intn(2) == 0 { - this.CommitRound *= -1 - } if r.Intn(10) != 0 { v32 := r.Intn(5) - this.Validators = make([]SigningValidator, v32) + this.CommitVotes = make([]VoteInfo, v32) for i := 0; i < v32; i++ { - v33 := NewPopulatedSigningValidator(r, easy) - this.Validators[i] = *v33 + v33 := NewPopulatedVoteInfo(r, easy) + this.CommitVotes[i] = *v33 } } if !easy && r.Intn(10) != 0 { @@ -6610,6 +6673,17 @@ func NewPopulatedValidator(r randyTypes, easy bool) *Validator { for i := 0; i < v48; i++ { this.Address[i] = byte(r.Intn(256)) } + this.Power = int64(r.Int63()) + if r.Intn(2) == 0 { + this.Power *= -1 + } + if !easy && r.Intn(10) != 0 { + } + return this +} + +func NewPopulatedValidatorUpdate(r randyTypes, easy bool) *ValidatorUpdate { + this := &ValidatorUpdate{} v49 := NewPopulatedPubKey(r, easy) this.PubKey = *v49 this.Power = int64(r.Int63()) @@ -6621,11 +6695,15 @@ func NewPopulatedValidator(r randyTypes, easy bool) *Validator { return this } -func NewPopulatedSigningValidator(r randyTypes, easy bool) *SigningValidator { - this := &SigningValidator{} +func NewPopulatedVoteInfo(r randyTypes, easy bool) *VoteInfo { + this := &VoteInfo{} v50 := NewPopulatedValidator(r, easy) this.Validator = *v50 this.SignedLastBlock = bool(bool(r.Intn(2) == 0)) + this.CommitRound = int64(r.Int63()) + if r.Intn(2) == 0 { + this.CommitRound *= -1 + } if !easy && r.Intn(10) != 0 { } return this @@ -7384,11 +7462,8 @@ func (m *BlockGossip) Size() (n int) { func (m *LastCommitInfo) Size() (n int) { var l int _ = l - if m.CommitRound != 0 { - n += 1 + sovTypes(uint64(m.CommitRound)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { + if len(m.CommitVotes) > 0 { + for _, e := range m.CommitVotes { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } @@ -7487,6 +7562,15 @@ func (m *Validator) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.Power != 0 { + n += 1 + sovTypes(uint64(m.Power)) + } + return n +} + +func (m *ValidatorUpdate) Size() (n int) { + var l int + _ = l l = m.PubKey.Size() n += 1 + l + sovTypes(uint64(l)) if m.Power != 0 { @@ -7495,7 +7579,7 @@ func (m *Validator) Size() (n int) { return n } -func (m *SigningValidator) Size() (n int) { +func (m *VoteInfo) Size() (n int) { var l int _ = l l = m.Validator.Size() @@ -7503,6 +7587,9 @@ func (m *SigningValidator) Size() (n int) { if m.SignedLastBlock { n += 2 } + if m.CommitRound != 0 { + n += 1 + sovTypes(uint64(m.CommitRound)) + } return n } @@ -8418,7 +8505,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validator{}) + m.Validators = append(m.Validators, ValidatorUpdate{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -10092,7 +10179,7 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validator{}) + m.Validators = append(m.Validators, ValidatorUpdate{}) if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -10966,7 +11053,7 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorUpdates = append(m.ValidatorUpdates, Validator{}) + m.ValidatorUpdates = append(m.ValidatorUpdates, ValidatorUpdate{}) if err := m.ValidatorUpdates[len(m.ValidatorUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -11580,27 +11667,8 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitRound", wireType) - } - m.CommitRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CommitRound |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CommitVotes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11624,8 +11692,8 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, SigningValidator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.CommitVotes = append(m.CommitVotes, VoteInfo{}) + if err := m.CommitVotes[len(m.CommitVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -12396,36 +12464,6 @@ func (m *Validator) Unmarshal(dAtA []byte) error { m.Address = []byte{} } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) @@ -12466,7 +12504,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } return nil } -func (m *SigningValidator) Unmarshal(dAtA []byte) error { +func (m *ValidatorUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12489,10 +12527,109 @@ func (m *SigningValidator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SigningValidator: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorUpdate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SigningValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) + } + m.Power = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Power |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VoteInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VoteInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -12545,6 +12682,25 @@ func (m *SigningValidator) Unmarshal(dAtA []byte) error { } } m.SignedLastBlock = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitRound", wireType) + } + m.CommitRound = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommitRound |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -12962,137 +13118,138 @@ func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) func init() { golang_proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 2109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xdf, 0x6f, 0x23, 0x49, - 0xf1, 0xcf, 0x38, 0x8e, 0xed, 0x29, 0x3b, 0xb6, 0xb7, 0x37, 0x9b, 0x78, 0x7d, 0xdf, 0x6f, 0xb2, - 0x0c, 0xb0, 0x97, 0x70, 0xb9, 0xe4, 0xc8, 0xb1, 0xa7, 0xec, 0x1d, 0x77, 0x22, 0xce, 0x2e, 0x97, - 0xe8, 0x0e, 0x08, 0xb3, 0x7b, 0x8b, 0x84, 0x90, 0x46, 0x6d, 0x4f, 0x67, 0x3c, 0x5a, 0x7b, 0x66, - 0x6e, 0xa6, 0x9d, 0x73, 0xf6, 0x4f, 0x40, 0x27, 0xc4, 0x1b, 0xcf, 0xbc, 0xf1, 0x0f, 0x20, 0xf1, - 0xc8, 0x13, 0xba, 0x47, 0x84, 0x40, 0xbc, 0x2d, 0x90, 0x13, 0x2f, 0xfc, 0x05, 0x3c, 0xa2, 0xae, - 0xee, 0xf9, 0x99, 0xf1, 0x6a, 0x6f, 0x79, 0xe3, 0xc5, 0x9e, 0xee, 0xaa, 0xea, 0xee, 0xaa, 0xae, - 0xaa, 0x4f, 0x55, 0xc3, 0x3a, 0x1d, 0x8e, 0xdc, 0x7d, 0x7e, 0x19, 0xb0, 0x48, 0xfe, 0xee, 0x05, - 0xa1, 0xcf, 0x7d, 0xb2, 0x82, 0x83, 0xfe, 0x9b, 0x8e, 0xcb, 0xc7, 0xb3, 0xe1, 0xde, 0xc8, 0x9f, - 0xee, 0x3b, 0xbe, 0xe3, 0xef, 0x23, 0x75, 0x38, 0x3b, 0xc7, 0x11, 0x0e, 0xf0, 0x4b, 0x4a, 0xf5, - 0xb7, 0x1c, 0xdf, 0x77, 0x26, 0x2c, 0xe5, 0xe2, 0xee, 0x94, 0x45, 0x9c, 0x4e, 0x03, 0xc5, 0x70, - 0x98, 0x59, 0x8f, 0x33, 0xcf, 0x66, 0xe1, 0xd4, 0xf5, 0x78, 0xf6, 0x73, 0xe2, 0x0e, 0xa3, 0xfd, - 0x91, 0x3f, 0x9d, 0xfa, 0x5e, 0xf6, 0x40, 0xc6, 0x1f, 0xaa, 0x50, 0x37, 0xd9, 0xa7, 0x33, 0x16, - 0x71, 0xb2, 0x0d, 0x55, 0x36, 0x1a, 0xfb, 0xbd, 0xca, 0x1d, 0x6d, 0xbb, 0x79, 0x40, 0xf6, 0x24, - 0x9f, 0xa2, 0x3e, 0x1c, 0x8d, 0xfd, 0x93, 0x25, 0x13, 0x39, 0xc8, 0x1b, 0xb0, 0x72, 0x3e, 0x99, - 0x45, 0xe3, 0xde, 0x32, 0xb2, 0xde, 0xcc, 0xb3, 0x7e, 0x5f, 0x90, 0x4e, 0x96, 0x4c, 0xc9, 0x23, - 0x96, 0x75, 0xbd, 0x73, 0xbf, 0x57, 0x2d, 0x5b, 0xf6, 0xd4, 0x3b, 0xc7, 0x65, 0x05, 0x07, 0x39, - 0x04, 0x88, 0x18, 0xb7, 0xfc, 0x80, 0xbb, 0xbe, 0xd7, 0x5b, 0x41, 0xfe, 0x8d, 0x3c, 0xff, 0x23, - 0xc6, 0x7f, 0x84, 0xe4, 0x93, 0x25, 0x53, 0x8f, 0xe2, 0x81, 0x90, 0x74, 0x3d, 0x97, 0x5b, 0xa3, - 0x31, 0x75, 0xbd, 0x5e, 0xad, 0x4c, 0xf2, 0xd4, 0x73, 0xf9, 0xb1, 0x20, 0x0b, 0x49, 0x37, 0x1e, - 0x08, 0x55, 0x3e, 0x9d, 0xb1, 0xf0, 0xb2, 0x57, 0x2f, 0x53, 0xe5, 0xc7, 0x82, 0x24, 0x54, 0x41, - 0x1e, 0xf2, 0x1e, 0x34, 0x87, 0xcc, 0x71, 0x3d, 0x6b, 0x38, 0xf1, 0x47, 0x4f, 0x7b, 0x0d, 0x14, - 0xe9, 0xe5, 0x45, 0x06, 0x82, 0x61, 0x20, 0xe8, 0x27, 0x4b, 0x26, 0x0c, 0x93, 0x11, 0x39, 0x80, - 0xc6, 0x68, 0xcc, 0x46, 0x4f, 0x2d, 0x3e, 0xef, 0xe9, 0x28, 0x79, 0x2b, 0x2f, 0x79, 0x2c, 0xa8, - 0x8f, 0xe7, 0x27, 0x4b, 0x66, 0x7d, 0x24, 0x3f, 0xc9, 0x3d, 0xd0, 0x99, 0x67, 0xab, 0xed, 0x9a, - 0x28, 0xb4, 0x5e, 0xb8, 0x17, 0xcf, 0x8e, 0x37, 0x6b, 0x30, 0xf5, 0x4d, 0xf6, 0xa0, 0x26, 0xee, - 0xda, 0xe5, 0xbd, 0x16, 0xca, 0xac, 0x15, 0x36, 0x42, 0xda, 0xc9, 0x92, 0xa9, 0xb8, 0x84, 0xf9, - 0x6c, 0x36, 0x71, 0x2f, 0x58, 0x28, 0x0e, 0x77, 0xb3, 0xcc, 0x7c, 0x0f, 0x24, 0x1d, 0x8f, 0xa7, - 0xdb, 0xf1, 0x60, 0x50, 0x87, 0x95, 0x0b, 0x3a, 0x99, 0x31, 0xe3, 0x75, 0x68, 0x66, 0x3c, 0x85, - 0xf4, 0xa0, 0x3e, 0x65, 0x51, 0x44, 0x1d, 0xd6, 0xd3, 0xee, 0x68, 0xdb, 0xba, 0x19, 0x0f, 0x8d, - 0x36, 0xb4, 0xb2, 0x7e, 0x92, 0x11, 0x14, 0xbe, 0x20, 0x04, 0x2f, 0x58, 0x18, 0x09, 0x07, 0x50, - 0x82, 0x6a, 0x68, 0xbc, 0x0b, 0xdd, 0xa2, 0x13, 0x90, 0x2e, 0x2c, 0x3f, 0x65, 0x97, 0x8a, 0x53, - 0x7c, 0x92, 0x35, 0x75, 0x20, 0xf4, 0x62, 0xdd, 0x54, 0xa7, 0xfb, 0x79, 0x25, 0x11, 0x4e, 0xfc, - 0x80, 0x1c, 0x42, 0x55, 0x04, 0x12, 0x4a, 0x37, 0x0f, 0xfa, 0x7b, 0x32, 0xca, 0xf6, 0xe2, 0x28, - 0xdb, 0x7b, 0x1c, 0x47, 0xd9, 0xa0, 0xf1, 0xc5, 0xf3, 0xad, 0xa5, 0x5f, 0xfe, 0x6d, 0x4b, 0x33, - 0x51, 0x82, 0xdc, 0x16, 0x57, 0x49, 0x5d, 0xcf, 0x72, 0x6d, 0xb5, 0x4f, 0x1d, 0xc7, 0xa7, 0x36, - 0x39, 0x82, 0xee, 0xc8, 0xf7, 0x22, 0xe6, 0x45, 0xb3, 0xc8, 0x0a, 0x68, 0x48, 0xa7, 0x91, 0x8a, - 0x92, 0xf8, 0xe2, 0x8e, 0x63, 0xf2, 0x19, 0x52, 0xcd, 0xce, 0x28, 0x3f, 0x41, 0xde, 0x01, 0xb8, - 0xa0, 0x13, 0xd7, 0xa6, 0xdc, 0x0f, 0xa3, 0x5e, 0xf5, 0xce, 0xf2, 0x76, 0xf3, 0xa0, 0xab, 0x84, - 0x9f, 0xc4, 0x84, 0x41, 0x55, 0x9c, 0xc9, 0xcc, 0x70, 0x92, 0xbb, 0xd0, 0xa1, 0x41, 0x60, 0x45, - 0x9c, 0x72, 0x66, 0x0d, 0x2f, 0x39, 0x8b, 0x30, 0x86, 0x5a, 0xe6, 0x2a, 0x0d, 0x82, 0x47, 0x62, - 0x76, 0x20, 0x26, 0x0d, 0x3b, 0xb9, 0x01, 0x74, 0x6f, 0x42, 0xa0, 0x6a, 0x53, 0x4e, 0xd1, 0x0e, - 0x2d, 0x13, 0xbf, 0xc5, 0x5c, 0x40, 0xf9, 0x58, 0x69, 0x87, 0xdf, 0x64, 0x1d, 0x6a, 0x63, 0xe6, - 0x3a, 0x63, 0x8e, 0x0a, 0x2d, 0x9b, 0x6a, 0x24, 0x4c, 0x1e, 0x84, 0xfe, 0x05, 0xc3, 0x08, 0x6f, - 0x98, 0x72, 0x60, 0xfc, 0x53, 0x83, 0x1b, 0xd7, 0x42, 0x42, 0xac, 0x3b, 0xa6, 0xd1, 0x38, 0xde, - 0x4b, 0x7c, 0x93, 0x37, 0xc4, 0xba, 0xd4, 0x66, 0xa1, 0xca, 0x3c, 0xab, 0x4a, 0xd7, 0x13, 0x9c, - 0x54, 0x8a, 0x2a, 0x16, 0xf2, 0x10, 0xba, 0x13, 0x1a, 0x71, 0x4b, 0x7a, 0xae, 0x85, 0x99, 0x65, - 0x39, 0x17, 0x4d, 0x1f, 0xd3, 0xd8, 0xc3, 0x85, 0x43, 0x29, 0xf1, 0xf6, 0x24, 0x37, 0x4b, 0x4e, - 0x60, 0x6d, 0x78, 0xf9, 0x8c, 0x7a, 0xdc, 0xf5, 0x98, 0x75, 0xcd, 0xda, 0x1d, 0xb5, 0xd4, 0xc3, - 0x0b, 0xd7, 0x66, 0xde, 0x88, 0xa9, 0x45, 0x6e, 0x26, 0x22, 0xc9, 0x35, 0x44, 0xc6, 0x1d, 0x68, - 0xe7, 0xe3, 0x97, 0xb4, 0xa1, 0xc2, 0xe7, 0x4a, 0xc3, 0x0a, 0x9f, 0x1b, 0x46, 0xe2, 0x7b, 0x49, - 0x10, 0x5d, 0xe3, 0xd9, 0x81, 0x4e, 0x21, 0xa0, 0x33, 0xe6, 0xd6, 0xb2, 0xe6, 0x36, 0x3a, 0xb0, - 0x9a, 0x8b, 0x63, 0xe3, 0xf3, 0x15, 0x68, 0x98, 0x2c, 0x0a, 0x84, 0x1b, 0x91, 0x43, 0xd0, 0xd9, - 0x7c, 0xc4, 0x64, 0x0a, 0xd5, 0x0a, 0x09, 0x4a, 0xf2, 0x3c, 0x8c, 0xe9, 0x22, 0x94, 0x13, 0x66, - 0xb2, 0x93, 0x4b, 0xff, 0x37, 0x8b, 0x42, 0xd9, 0xfc, 0xbf, 0x9b, 0xcf, 0xff, 0x6b, 0x05, 0xde, - 0x02, 0x00, 0xec, 0xe4, 0x00, 0xa0, 0xb8, 0x70, 0x0e, 0x01, 0xee, 0x97, 0x20, 0x40, 0xf1, 0xf8, - 0x0b, 0x20, 0xe0, 0x7e, 0x09, 0x04, 0xf4, 0xae, 0xed, 0x55, 0x8a, 0x01, 0xbb, 0x79, 0x0c, 0x28, - 0xaa, 0x53, 0x00, 0x81, 0xef, 0x96, 0x81, 0xc0, 0xed, 0x82, 0xcc, 0x42, 0x14, 0x78, 0xfb, 0x1a, - 0x0a, 0xac, 0x17, 0x44, 0x4b, 0x60, 0xe0, 0x7e, 0x2e, 0x3f, 0x43, 0xa9, 0x6e, 0xe5, 0x09, 0x9a, - 0xbc, 0x73, 0x1d, 0x41, 0x36, 0x8a, 0x57, 0x5b, 0x06, 0x21, 0xfb, 0x05, 0x08, 0xb9, 0x55, 0x3c, - 0x65, 0x01, 0x43, 0x52, 0x24, 0xd8, 0x11, 0x71, 0x5f, 0xf0, 0x34, 0x91, 0x23, 0x58, 0x18, 0xfa, - 0xa1, 0x4a, 0xd5, 0x72, 0x60, 0x6c, 0x8b, 0x4c, 0x94, 0xfa, 0xd7, 0x0b, 0x50, 0x03, 0x9d, 0x3e, - 0xe3, 0x5d, 0xc6, 0xaf, 0xb4, 0x54, 0x16, 0x23, 0x3a, 0x9b, 0xc5, 0x74, 0x95, 0xc5, 0x32, 0x60, - 0x52, 0xc9, 0x81, 0x09, 0xf9, 0x16, 0xdc, 0xc0, 0x34, 0x82, 0x76, 0xb1, 0x72, 0x69, 0xad, 0x23, - 0x08, 0xd2, 0x20, 0x32, 0xbf, 0xbd, 0x09, 0x37, 0x33, 0xbc, 0x22, 0xc5, 0x62, 0x0a, 0xab, 0x62, - 0xf0, 0x76, 0x13, 0xee, 0xa3, 0x20, 0x38, 0xa1, 0xd1, 0xd8, 0xf8, 0x41, 0xaa, 0x7f, 0x0a, 0x54, - 0x04, 0xaa, 0x23, 0xdf, 0x96, 0x6a, 0xad, 0x9a, 0xf8, 0x2d, 0xc0, 0x6b, 0xe2, 0x3b, 0xb8, 0xab, - 0x6e, 0x8a, 0x4f, 0xc1, 0x95, 0x44, 0x8a, 0x2e, 0x43, 0xc2, 0xf8, 0x85, 0x96, 0xae, 0x97, 0x62, - 0x57, 0x19, 0xcc, 0x68, 0xff, 0x0d, 0xcc, 0x54, 0x5e, 0x16, 0x66, 0x8c, 0xdf, 0x6a, 0xe9, 0x5d, - 0x24, 0x00, 0xf2, 0x6a, 0xca, 0x09, 0xb7, 0x70, 0x3d, 0x9b, 0xcd, 0x31, 0xd4, 0x97, 0x4d, 0x39, - 0x88, 0x51, 0xbd, 0x86, 0x06, 0xce, 0xa3, 0x7a, 0x1d, 0xe7, 0xe4, 0x40, 0x01, 0x8f, 0x7f, 0x8e, - 0x31, 0xd8, 0x32, 0xe5, 0x20, 0x93, 0x37, 0xf5, 0x5c, 0xde, 0x3c, 0x03, 0x72, 0x3d, 0x3a, 0xc9, - 0xbb, 0x50, 0xe5, 0xd4, 0x11, 0xc6, 0x13, 0xfa, 0xb7, 0xf7, 0x64, 0x8d, 0xbc, 0xf7, 0xd1, 0x93, - 0x33, 0xea, 0x86, 0x83, 0x75, 0xa1, 0xfd, 0xbf, 0x9e, 0x6f, 0xb5, 0x05, 0xcf, 0xae, 0x3f, 0x75, - 0x39, 0x9b, 0x06, 0xfc, 0xd2, 0x44, 0x19, 0xe3, 0x2f, 0x9a, 0xc8, 0xda, 0xb9, 0xa8, 0x2d, 0xb5, - 0x45, 0xec, 0x9a, 0x95, 0x0c, 0xc0, 0xbe, 0x9c, 0x7d, 0xfe, 0x1f, 0xc0, 0xa1, 0x91, 0xf5, 0x19, - 0xf5, 0x38, 0xb3, 0x95, 0x91, 0x74, 0x87, 0x46, 0x3f, 0xc1, 0x09, 0x51, 0x87, 0x08, 0xf2, 0x2c, - 0x62, 0x36, 0x5a, 0x6b, 0xd9, 0xac, 0x3b, 0x34, 0xfa, 0x24, 0x62, 0x76, 0xa2, 0x57, 0xfd, 0x15, - 0xf4, 0xfa, 0x6b, 0xc6, 0xe5, 0x52, 0xc8, 0xfa, 0x5f, 0xd0, 0xec, 0x4b, 0x4d, 0x60, 0x71, 0x3e, - 0xed, 0x91, 0x63, 0xb8, 0x91, 0xb8, 0xb7, 0x35, 0x0b, 0x6c, 0x2a, 0x2a, 0x27, 0xed, 0x85, 0xf1, - 0xd0, 0x4d, 0x04, 0x3e, 0x91, 0xfc, 0xe4, 0x87, 0xb0, 0x51, 0x08, 0xc8, 0x64, 0xa9, 0xca, 0x0b, - 0xe3, 0xf2, 0x56, 0x3e, 0x2e, 0xe3, 0xf5, 0x62, 0x2d, 0x97, 0x5f, 0x41, 0xcb, 0x6f, 0x88, 0x92, - 0x24, 0x9b, 0xa6, 0xcb, 0xee, 0xc9, 0xf8, 0xb5, 0x06, 0x9d, 0xc2, 0x61, 0xc8, 0x3e, 0x80, 0xcc, - 0x72, 0x91, 0xfb, 0x2c, 0x2e, 0x8c, 0x63, 0x1b, 0xa0, 0xb1, 0x1e, 0xb9, 0xcf, 0x98, 0xa9, 0x0f, - 0xe3, 0x4f, 0x72, 0x17, 0xea, 0x7c, 0x2e, 0xb9, 0xf3, 0xc5, 0xdb, 0xe3, 0x39, 0xb2, 0xd6, 0x38, - 0xfe, 0x93, 0x7b, 0xd0, 0x92, 0x0b, 0x3b, 0x7e, 0x14, 0xb9, 0x81, 0x2a, 0x1c, 0x48, 0x76, 0xe9, - 0x0f, 0x91, 0x62, 0x36, 0x87, 0xe9, 0xc0, 0xf8, 0x29, 0xe8, 0xc9, 0xb6, 0xe4, 0x35, 0xd0, 0xa7, - 0x74, 0xae, 0x2a, 0x5b, 0x71, 0xb6, 0x15, 0xb3, 0x31, 0xa5, 0x73, 0x2c, 0x6a, 0xc9, 0x06, 0xd4, - 0x05, 0x91, 0xcf, 0xa5, 0xbd, 0x57, 0xcc, 0xda, 0x94, 0xce, 0x1f, 0xcf, 0x13, 0x82, 0x43, 0xa3, - 0xb8, 0x6c, 0x9d, 0xd2, 0xf9, 0x87, 0x34, 0x32, 0x3e, 0x80, 0x9a, 0x3c, 0xe4, 0x4b, 0x2d, 0x2c, - 0xe4, 0x2b, 0x39, 0xf9, 0xef, 0x41, 0x33, 0x73, 0x6e, 0xf2, 0x6d, 0xb8, 0x25, 0x35, 0x0c, 0x68, - 0xc8, 0xd1, 0x22, 0xb9, 0x05, 0x09, 0x12, 0xcf, 0x68, 0xc8, 0xc5, 0x96, 0xb2, 0x10, 0x0f, 0xa1, - 0x9d, 0x2f, 0x56, 0xc9, 0xd7, 0xa0, 0xa5, 0x0a, 0xdb, 0xd0, 0x9f, 0x79, 0xb6, 0x92, 0x6d, 0xca, - 0x39, 0x53, 0x4c, 0x91, 0xf7, 0x4b, 0xd2, 0x76, 0x8c, 0xe8, 0x8f, 0x5c, 0xc7, 0x73, 0x3d, 0xe7, - 0x45, 0xd9, 0xfb, 0x4f, 0x55, 0xa8, 0xc9, 0xc2, 0x9a, 0xdc, 0xcd, 0x74, 0x31, 0x88, 0x9a, 0x83, - 0xe6, 0xd5, 0xf3, 0xad, 0x3a, 0x02, 0xcc, 0xe9, 0x83, 0xb4, 0xa5, 0x49, 0x13, 0x6a, 0x25, 0x57, - 0xf7, 0xc7, 0xfd, 0xd3, 0xf2, 0x57, 0xee, 0x9f, 0x36, 0xa0, 0xee, 0xcd, 0xa6, 0x78, 0x59, 0x55, - 0xb9, 0xa4, 0x37, 0x9b, 0x8a, 0xcb, 0x7a, 0x0d, 0x74, 0xee, 0x73, 0x3a, 0x41, 0x92, 0x4c, 0x0a, - 0x0d, 0x9c, 0x10, 0xc4, 0x43, 0x58, 0xcd, 0xe0, 0xb0, 0x6b, 0xab, 0x22, 0xaf, 0x9d, 0x75, 0xa2, - 0xd3, 0x07, 0x4a, 0xe7, 0x66, 0x82, 0xcb, 0xa7, 0x36, 0xd9, 0xce, 0x37, 0x0d, 0x08, 0xdf, 0x12, - 0x49, 0x32, 0x7d, 0x81, 0x00, 0x6f, 0x71, 0x00, 0x11, 0x1c, 0x92, 0x45, 0xc2, 0x4a, 0x43, 0x4c, - 0x20, 0xf1, 0x75, 0xe8, 0xa4, 0x96, 0x94, 0x2c, 0xba, 0x5c, 0x25, 0x9d, 0x46, 0xc6, 0xb7, 0x60, - 0xcd, 0x63, 0x73, 0x6e, 0x15, 0xb9, 0x01, 0xb9, 0x89, 0xa0, 0x3d, 0xc9, 0x4b, 0x7c, 0x13, 0xda, - 0x69, 0xfa, 0x40, 0xde, 0xa6, 0x6c, 0xdd, 0x92, 0x59, 0x64, 0xbb, 0x0d, 0x8d, 0xa4, 0xfe, 0x68, - 0x21, 0x43, 0x9d, 0xca, 0xb2, 0x23, 0xa9, 0x68, 0x42, 0x16, 0xcd, 0x26, 0x5c, 0x2d, 0xb2, 0x8a, - 0x3c, 0x58, 0xd1, 0x98, 0x72, 0x1e, 0x79, 0xbf, 0x0e, 0xab, 0x4c, 0xb5, 0x36, 0x92, 0xaf, 0x8d, - 0x7c, 0xad, 0x78, 0x12, 0x99, 0x76, 0xa0, 0x1b, 0x84, 0x7e, 0xe0, 0x47, 0x2c, 0xb4, 0xa8, 0x6d, - 0x87, 0x2c, 0x8a, 0x7a, 0x1d, 0xb9, 0x5e, 0x3c, 0x7f, 0x24, 0xa7, 0x8d, 0x9f, 0x41, 0x5d, 0x59, - 0xbf, 0xb4, 0xc1, 0x7b, 0x1f, 0x5a, 0x22, 0x28, 0x22, 0x2b, 0xd7, 0xe6, 0xc5, 0x65, 0x36, 0xc6, - 0x04, 0xe3, 0xb9, 0x6e, 0xaf, 0x89, 0xfc, 0x72, 0xca, 0xb8, 0x0f, 0xab, 0x39, 0x1e, 0x81, 0xfb, - 0xe8, 0x14, 0x2a, 0x3c, 0xe4, 0x20, 0xd9, 0xb9, 0x92, 0xee, 0x6c, 0xb8, 0xa0, 0x27, 0x86, 0x16, - 0xd5, 0x60, 0xac, 0x87, 0xa6, 0x6c, 0x27, 0x87, 0x64, 0x17, 0xea, 0xc1, 0x6c, 0x68, 0x89, 0xa2, - 0x23, 0x9f, 0xc5, 0xce, 0x66, 0xc3, 0x8f, 0xd8, 0x65, 0xdc, 0x82, 0x06, 0x38, 0xc2, 0xb2, 0xc3, - 0xff, 0x8c, 0x85, 0x2a, 0x9f, 0xc8, 0x81, 0xc1, 0xa1, 0x5b, 0x0c, 0x3f, 0xf2, 0x1d, 0xd0, 0x13, - 0x17, 0x28, 0x64, 0xd3, 0x62, 0x8c, 0xa6, 0x8c, 0xe2, 0x26, 0x23, 0xd7, 0xf1, 0x98, 0x6d, 0xa5, - 0xee, 0x8e, 0xe7, 0x6a, 0x98, 0x1d, 0x49, 0xf8, 0x38, 0xf6, 0x6d, 0xe3, 0x2d, 0xa8, 0xc9, 0x33, - 0x0a, 0xf5, 0xc5, 0xca, 0x71, 0xfd, 0x2b, 0xbe, 0x4b, 0xd3, 0xfe, 0x9f, 0x35, 0x68, 0xc4, 0x7d, - 0x6d, 0xa9, 0x50, 0xee, 0xd0, 0x95, 0x97, 0x3d, 0xf4, 0xa2, 0xc7, 0x81, 0x38, 0x49, 0x54, 0xbf, - 0x72, 0x92, 0xd8, 0x05, 0x22, 0x73, 0xc1, 0x85, 0xcf, 0x5d, 0xcf, 0xb1, 0xa4, 0xcd, 0x65, 0x52, - 0xe8, 0x22, 0xe5, 0x09, 0x12, 0xce, 0xc4, 0xfc, 0xc1, 0xe7, 0x2b, 0xd0, 0x39, 0x1a, 0x1c, 0x9f, - 0x1e, 0x05, 0xc1, 0xc4, 0x1d, 0x51, 0x2c, 0xba, 0xf7, 0xa1, 0x8a, 0x6d, 0x45, 0xc9, 0x53, 0x66, - 0xbf, 0xac, 0xbf, 0x25, 0x07, 0xb0, 0x82, 0xdd, 0x05, 0x29, 0x7b, 0xd1, 0xec, 0x97, 0xb6, 0xb9, - 0x62, 0x13, 0xd9, 0x7f, 0x5c, 0x7f, 0xd8, 0xec, 0x97, 0xf5, 0xba, 0xe4, 0x03, 0xd0, 0xd3, 0xbe, - 0x60, 0xd1, 0xf3, 0x66, 0x7f, 0x61, 0xd7, 0x2b, 0xe4, 0xd3, 0xa2, 0x6c, 0xd1, 0x2b, 0x5d, 0x7f, - 0x61, 0x7b, 0x48, 0x0e, 0xa1, 0x1e, 0x17, 0xab, 0xe5, 0x0f, 0x90, 0xfd, 0x05, 0x1d, 0xa9, 0x30, - 0x8f, 0x2c, 0xf8, 0xcb, 0x5e, 0x49, 0xfb, 0xa5, 0x6d, 0x33, 0xb9, 0x07, 0x35, 0x55, 0x83, 0x94, - 0x3e, 0x42, 0xf6, 0xcb, 0xfb, 0x4a, 0xa1, 0x64, 0xda, 0xec, 0x2c, 0x7a, 0xc9, 0xed, 0x2f, 0xec, - 0xef, 0xc9, 0x11, 0x40, 0xa6, 0xc8, 0x5f, 0xf8, 0x44, 0xdb, 0x5f, 0xdc, 0xb7, 0x93, 0xf7, 0xa0, - 0x91, 0xbe, 0xc5, 0x94, 0x3f, 0xba, 0xf6, 0x17, 0xb5, 0xd2, 0x83, 0xff, 0xfb, 0xf7, 0x3f, 0x36, - 0xb5, 0xdf, 0x5c, 0x6d, 0x6a, 0xbf, 0xbb, 0xda, 0xd4, 0xbe, 0xb8, 0xda, 0xd4, 0xfe, 0x78, 0xb5, - 0xa9, 0xfd, 0xfd, 0x6a, 0x53, 0xfb, 0xfd, 0x97, 0x9b, 0xda, 0xb0, 0x86, 0xee, 0xff, 0xf6, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x91, 0x83, 0x9b, 0x1e, 0x27, 0x18, 0x00, 0x00, + // 2126 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x5f, 0x73, 0x1b, 0x49, + 0x11, 0xf7, 0xca, 0xb2, 0xa4, 0x6d, 0xc9, 0x92, 0x33, 0xf9, 0xa7, 0xe8, 0xc0, 0x09, 0x0b, 0xe4, + 0x6c, 0xce, 0x67, 0x1f, 0x3e, 0x42, 0x39, 0x97, 0xe3, 0x0a, 0x2b, 0x09, 0x67, 0x73, 0x07, 0x98, + 0x4d, 0x62, 0xaa, 0x28, 0xaa, 0xb6, 0x46, 0xda, 0xb1, 0xb4, 0x15, 0x69, 0x77, 0x6f, 0x67, 0xe4, + 0x93, 0xf3, 0x19, 0xae, 0x8a, 0x7b, 0xa0, 0x8a, 0x67, 0xde, 0xf8, 0x02, 0x54, 0xf1, 0xc8, 0x13, + 0x75, 0x8f, 0x14, 0x05, 0xc5, 0x5b, 0x00, 0x53, 0x3c, 0xc0, 0x27, 0xe0, 0x91, 0x9a, 0x9e, 0xd9, + 0xbf, 0x5e, 0xa5, 0x92, 0xf0, 0xc6, 0x8b, 0xb4, 0x33, 0xdd, 0x3d, 0x33, 0xdd, 0xd3, 0xdd, 0xbf, + 0xee, 0x81, 0x6b, 0x74, 0x30, 0xf4, 0x76, 0xc4, 0x59, 0xc8, 0xb8, 0xfa, 0xdd, 0x0e, 0xa3, 0x40, + 0x04, 0x64, 0x05, 0x07, 0xbd, 0xb7, 0x47, 0x9e, 0x18, 0xcf, 0x06, 0xdb, 0xc3, 0x60, 0xba, 0x33, + 0x0a, 0x46, 0xc1, 0x0e, 0x52, 0x07, 0xb3, 0x13, 0x1c, 0xe1, 0x00, 0xbf, 0x94, 0x54, 0xef, 0xe6, + 0x28, 0x08, 0x46, 0x13, 0x96, 0x72, 0x09, 0x6f, 0xca, 0xb8, 0xa0, 0xd3, 0x50, 0x33, 0xec, 0x65, + 0xd6, 0x13, 0xcc, 0x77, 0x59, 0x34, 0xf5, 0x7c, 0x91, 0xfd, 0x9c, 0x78, 0x03, 0xbe, 0x33, 0x0c, + 0xa6, 0xd3, 0xc0, 0xcf, 0x1e, 0xc8, 0xfa, 0x7d, 0x15, 0xea, 0x36, 0xfb, 0x64, 0xc6, 0xb8, 0x20, + 0x1b, 0x50, 0x65, 0xc3, 0x71, 0xd0, 0xad, 0xdc, 0x32, 0x36, 0x9a, 0xbb, 0x64, 0x5b, 0xf1, 0x69, + 0xea, 0xc3, 0xe1, 0x38, 0x38, 0x58, 0xb2, 0x91, 0x83, 0xbc, 0x05, 0x2b, 0x27, 0x93, 0x19, 0x1f, + 0x77, 0x97, 0x91, 0xf5, 0x72, 0x9e, 0xf5, 0x7b, 0x92, 0x74, 0xb0, 0x64, 0x2b, 0x1e, 0xb9, 0xac, + 0xe7, 0x9f, 0x04, 0xdd, 0x6a, 0xd9, 0xb2, 0x87, 0xfe, 0x09, 0x2e, 0x2b, 0x39, 0xc8, 0x1e, 0x00, + 0x67, 0xc2, 0x09, 0x42, 0xe1, 0x05, 0x7e, 0x77, 0x05, 0xf9, 0xaf, 0xe7, 0xf9, 0x1f, 0x31, 0xf1, + 0x23, 0x24, 0x1f, 0x2c, 0xd9, 0x26, 0x8f, 0x07, 0x52, 0xd2, 0xf3, 0x3d, 0xe1, 0x0c, 0xc7, 0xd4, + 0xf3, 0xbb, 0xb5, 0x32, 0xc9, 0x43, 0xdf, 0x13, 0xf7, 0x25, 0x59, 0x4a, 0x7a, 0xf1, 0x40, 0xaa, + 0xf2, 0xc9, 0x8c, 0x45, 0x67, 0xdd, 0x7a, 0x99, 0x2a, 0x3f, 0x96, 0x24, 0xa9, 0x0a, 0xf2, 0x90, + 0x7b, 0xd0, 0x1c, 0xb0, 0x91, 0xe7, 0x3b, 0x83, 0x49, 0x30, 0x7c, 0xda, 0x6d, 0xa0, 0x48, 0x37, + 0x2f, 0xd2, 0x97, 0x0c, 0x7d, 0x49, 0x3f, 0x58, 0xb2, 0x61, 0x90, 0x8c, 0xc8, 0x2e, 0x34, 0x86, + 0x63, 0x36, 0x7c, 0xea, 0x88, 0x79, 0xd7, 0x44, 0xc9, 0xab, 0x79, 0xc9, 0xfb, 0x92, 0xfa, 0x78, + 0x7e, 0xb0, 0x64, 0xd7, 0x87, 0xea, 0x93, 0xdc, 0x01, 0x93, 0xf9, 0xae, 0xde, 0xae, 0x89, 0x42, + 0xd7, 0x0a, 0xf7, 0xe2, 0xbb, 0xf1, 0x66, 0x0d, 0xa6, 0xbf, 0xc9, 0x36, 0xd4, 0xe4, 0x5d, 0x7b, + 0xa2, 0xdb, 0x42, 0x99, 0x2b, 0x85, 0x8d, 0x90, 0x76, 0xb0, 0x64, 0x6b, 0x2e, 0x69, 0x3e, 0x97, + 0x4d, 0xbc, 0x53, 0x16, 0xc9, 0xc3, 0x5d, 0x2e, 0x33, 0xdf, 0x03, 0x45, 0xc7, 0xe3, 0x99, 0x6e, + 0x3c, 0xe8, 0xd7, 0x61, 0xe5, 0x94, 0x4e, 0x66, 0xcc, 0x7a, 0x13, 0x9a, 0x19, 0x4f, 0x21, 0x5d, + 0xa8, 0x4f, 0x19, 0xe7, 0x74, 0xc4, 0xba, 0xc6, 0x2d, 0x63, 0xc3, 0xb4, 0xe3, 0xa1, 0xd5, 0x86, + 0x56, 0xd6, 0x4f, 0x32, 0x82, 0xd2, 0x17, 0xa4, 0xe0, 0x29, 0x8b, 0xb8, 0x74, 0x00, 0x2d, 0xa8, + 0x87, 0xd6, 0x7b, 0xb0, 0x56, 0x74, 0x02, 0xb2, 0x06, 0xcb, 0x4f, 0xd9, 0x99, 0xe6, 0x94, 0x9f, + 0xe4, 0x8a, 0x3e, 0x10, 0x7a, 0xb1, 0x69, 0xeb, 0xd3, 0x7d, 0x5e, 0x49, 0x84, 0x13, 0x3f, 0x20, + 0x7b, 0x50, 0x95, 0x81, 0x84, 0xd2, 0xcd, 0xdd, 0xde, 0xb6, 0x8a, 0xb2, 0xed, 0x38, 0xca, 0xb6, + 0x1f, 0xc7, 0x51, 0xd6, 0x6f, 0x7c, 0xf1, 0xfc, 0xe6, 0xd2, 0xe7, 0x7f, 0xbd, 0x69, 0xd8, 0x28, + 0x41, 0x6e, 0xc8, 0xab, 0xa4, 0x9e, 0xef, 0x78, 0xae, 0xde, 0xa7, 0x8e, 0xe3, 0x43, 0x97, 0xec, + 0xc3, 0xda, 0x30, 0xf0, 0x39, 0xf3, 0xf9, 0x8c, 0x3b, 0x21, 0x8d, 0xe8, 0x94, 0xeb, 0x28, 0x89, + 0x2f, 0xee, 0x7e, 0x4c, 0x3e, 0x42, 0xaa, 0xdd, 0x19, 0xe6, 0x27, 0xc8, 0xfb, 0x00, 0xa7, 0x74, + 0xe2, 0xb9, 0x54, 0x04, 0x11, 0xef, 0x56, 0x6f, 0x2d, 0x67, 0x84, 0x8f, 0x63, 0xc2, 0x93, 0xd0, + 0xa5, 0x82, 0xf5, 0xab, 0xf2, 0x64, 0x76, 0x86, 0x9f, 0xdc, 0x86, 0x0e, 0x0d, 0x43, 0x87, 0x0b, + 0x2a, 0x98, 0x33, 0x38, 0x13, 0x8c, 0x63, 0x24, 0xb5, 0xec, 0x55, 0x1a, 0x86, 0x8f, 0xe4, 0x6c, + 0x5f, 0x4e, 0x5a, 0x6e, 0x72, 0x0f, 0xe8, 0xe4, 0x84, 0x40, 0xd5, 0xa5, 0x82, 0xa2, 0x35, 0x5a, + 0x36, 0x7e, 0xcb, 0xb9, 0x90, 0x8a, 0xb1, 0xd6, 0x11, 0xbf, 0xc9, 0x35, 0xa8, 0x8d, 0x99, 0x37, + 0x1a, 0x0b, 0x54, 0x6b, 0xd9, 0xd6, 0x23, 0x69, 0xf8, 0x30, 0x0a, 0x4e, 0x19, 0xc6, 0x79, 0xc3, + 0x56, 0x03, 0xeb, 0x9f, 0x06, 0x5c, 0xba, 0x10, 0x18, 0x72, 0xdd, 0x31, 0xe5, 0xe3, 0x78, 0x2f, + 0xf9, 0x4d, 0xde, 0x92, 0xeb, 0x52, 0x97, 0x45, 0x3a, 0xff, 0xac, 0x6a, 0x8d, 0x0f, 0x70, 0x52, + 0x2b, 0xaa, 0x59, 0xc8, 0x43, 0x58, 0x9b, 0x50, 0x2e, 0x1c, 0xe5, 0xbf, 0x0e, 0xe6, 0x97, 0xe5, + 0x5c, 0x4c, 0x7d, 0x4c, 0x63, 0x3f, 0x97, 0x6e, 0xa5, 0xc5, 0xdb, 0x93, 0xdc, 0x2c, 0x39, 0x80, + 0x2b, 0x83, 0xb3, 0x67, 0xd4, 0x17, 0x9e, 0xcf, 0x9c, 0x0b, 0x36, 0xef, 0xe8, 0xa5, 0x1e, 0x9e, + 0x7a, 0x2e, 0xf3, 0x87, 0xb1, 0xb1, 0x2f, 0x27, 0x22, 0xc9, 0x65, 0x70, 0xeb, 0x16, 0xb4, 0xf3, + 0x51, 0x4c, 0xda, 0x50, 0x11, 0x73, 0xad, 0x61, 0x45, 0xcc, 0x2d, 0x2b, 0xf1, 0xc0, 0x24, 0x94, + 0x2e, 0xf0, 0x6c, 0x42, 0xa7, 0x10, 0xd6, 0x19, 0x73, 0x1b, 0x59, 0x73, 0x5b, 0x1d, 0x58, 0xcd, + 0x45, 0xb3, 0xf5, 0xd9, 0x0a, 0x34, 0x6c, 0xc6, 0x43, 0xe9, 0x4c, 0x64, 0x0f, 0x4c, 0x36, 0x1f, + 0x32, 0x95, 0x48, 0x8d, 0x42, 0x9a, 0x52, 0x3c, 0x0f, 0x63, 0xba, 0x0c, 0xe8, 0x84, 0x99, 0x6c, + 0xe6, 0x40, 0xe0, 0x72, 0x51, 0x28, 0x8b, 0x02, 0x5b, 0x79, 0x14, 0xb8, 0x52, 0xe0, 0x2d, 0xc0, + 0xc0, 0x66, 0x0e, 0x06, 0x8a, 0x0b, 0xe7, 0x70, 0xe0, 0x6e, 0x09, 0x0e, 0x14, 0x8f, 0xbf, 0x00, + 0x08, 0xee, 0x96, 0x00, 0x41, 0xf7, 0xc2, 0x5e, 0xa5, 0x48, 0xb0, 0x95, 0x47, 0x82, 0xa2, 0x3a, + 0x05, 0x28, 0x78, 0xbf, 0x0c, 0x0a, 0x6e, 0x14, 0x64, 0x16, 0x62, 0xc1, 0xbb, 0x17, 0xb0, 0xe0, + 0x5a, 0x41, 0xb4, 0x04, 0x0c, 0xee, 0xe6, 0xb2, 0x34, 0x94, 0xea, 0x56, 0x9e, 0xa6, 0xc9, 0xb7, + 0x2f, 0xe2, 0xc8, 0xf5, 0xe2, 0xd5, 0x96, 0x01, 0xc9, 0x4e, 0x01, 0x48, 0xae, 0x16, 0x4f, 0x59, + 0x40, 0x92, 0x14, 0x0f, 0x36, 0x65, 0xdc, 0x17, 0x3c, 0x4d, 0xe6, 0x08, 0x16, 0x45, 0x41, 0xa4, + 0x13, 0xb6, 0x1a, 0x58, 0x1b, 0x32, 0x13, 0xa5, 0xfe, 0xf5, 0x02, 0xec, 0x40, 0xa7, 0xcf, 0x78, + 0x97, 0xf5, 0x4b, 0x23, 0x95, 0xc5, 0x88, 0xce, 0x66, 0x31, 0x53, 0x67, 0xb1, 0x0c, 0xa4, 0x54, + 0x72, 0x90, 0x42, 0xbe, 0x01, 0x97, 0x30, 0x8d, 0xa0, 0x5d, 0x9c, 0x5c, 0x5a, 0xeb, 0x48, 0x82, + 0x32, 0x88, 0xca, 0x6f, 0x6f, 0xc3, 0xe5, 0x0c, 0xaf, 0x4c, 0xb1, 0x98, 0xc2, 0xaa, 0x18, 0xbc, + 0x6b, 0x09, 0xf7, 0x7e, 0x18, 0x1e, 0x50, 0x3e, 0xb6, 0x7e, 0x90, 0xea, 0x9f, 0xc2, 0x15, 0x81, + 0xea, 0x30, 0x70, 0x95, 0x5a, 0xab, 0x36, 0x7e, 0x4b, 0x08, 0x9b, 0x04, 0x23, 0xdc, 0xd5, 0xb4, + 0xe5, 0xa7, 0xe4, 0x4a, 0x22, 0xc5, 0x54, 0x21, 0x61, 0xfd, 0xc2, 0x48, 0xd7, 0x4b, 0x11, 0xac, + 0x0c, 0x6c, 0x8c, 0xff, 0x05, 0x6c, 0x2a, 0xaf, 0x06, 0x36, 0xd6, 0x6f, 0x8c, 0xf4, 0x46, 0x12, + 0x18, 0x79, 0x3d, 0x15, 0xa5, 0x73, 0x78, 0xbe, 0xcb, 0xe6, 0x18, 0xf0, 0xcb, 0xb6, 0x1a, 0xc4, + 0x08, 0x5f, 0x43, 0x33, 0xe7, 0x11, 0xbe, 0x8e, 0x73, 0x6a, 0xa0, 0xe1, 0x27, 0x38, 0xc1, 0x48, + 0x6c, 0xd9, 0x6a, 0x90, 0xc9, 0x9e, 0x66, 0x2e, 0x7b, 0x1e, 0x01, 0xb9, 0x18, 0xa3, 0xe4, 0x3d, + 0xa8, 0x0a, 0x3a, 0x92, 0x26, 0x94, 0x56, 0x68, 0x6f, 0xab, 0x7a, 0x79, 0xfb, 0xa3, 0xe3, 0x23, + 0xea, 0x45, 0xfd, 0x6b, 0x52, 0xfb, 0x7f, 0x3f, 0xbf, 0xd9, 0x96, 0x3c, 0x5b, 0xc1, 0xd4, 0x13, + 0x6c, 0x1a, 0x8a, 0x33, 0x1b, 0x65, 0xac, 0x3f, 0x1b, 0x32, 0x77, 0xe7, 0x62, 0xb7, 0xd4, 0x16, + 0xb1, 0x83, 0x56, 0x32, 0x30, 0xfb, 0x72, 0xf6, 0xf9, 0x32, 0xc0, 0x88, 0x72, 0xe7, 0x53, 0xea, + 0x0b, 0xe6, 0x6a, 0x23, 0x99, 0x23, 0xca, 0x7f, 0x82, 0x13, 0xb2, 0x26, 0x91, 0xe4, 0x19, 0x67, + 0x2e, 0x5a, 0x6b, 0xd9, 0xae, 0x8f, 0x28, 0x7f, 0xc2, 0x99, 0x9b, 0xe8, 0x55, 0x7f, 0x0d, 0xbd, + 0xfe, 0x92, 0x71, 0xbc, 0x14, 0xb8, 0xfe, 0x1f, 0x34, 0xfb, 0x97, 0x21, 0x11, 0x39, 0x9f, 0xfc, + 0xc8, 0x21, 0x5c, 0x4a, 0xdc, 0xdb, 0x99, 0xa1, 0xdb, 0xc7, 0xfe, 0xf0, 0xe2, 0xa8, 0x58, 0x3b, + 0xcd, 0x4f, 0x73, 0xf2, 0x43, 0xb8, 0x5e, 0x08, 0xce, 0x64, 0xc1, 0xca, 0x0b, 0x63, 0xf4, 0x6a, + 0x3e, 0x46, 0xe3, 0xf5, 0x62, 0x5d, 0x97, 0x5f, 0x43, 0xd7, 0xaf, 0xc9, 0xf2, 0x24, 0x9b, 0xb2, + 0xcb, 0x6e, 0xcb, 0xfa, 0x95, 0x01, 0x9d, 0xc2, 0x61, 0xc8, 0x0e, 0x80, 0xca, 0x78, 0xdc, 0x7b, + 0x16, 0x97, 0xca, 0x6b, 0xfa, 0xe0, 0x68, 0xb2, 0x47, 0xde, 0x33, 0x66, 0x9b, 0x83, 0xf8, 0x93, + 0xdc, 0x86, 0xba, 0x98, 0x2b, 0xee, 0x7c, 0x21, 0xf7, 0x78, 0x8e, 0xac, 0x35, 0x81, 0xff, 0xe4, + 0x0e, 0xb4, 0xd4, 0xc2, 0xa3, 0x80, 0x73, 0x2f, 0xd4, 0x45, 0x04, 0xc9, 0x2e, 0xfd, 0x21, 0x52, + 0xec, 0xe6, 0x20, 0x1d, 0x58, 0x3f, 0x05, 0x33, 0xd9, 0x96, 0xbc, 0x01, 0xe6, 0x94, 0xce, 0x75, + 0x95, 0x2b, 0xcf, 0xb6, 0x62, 0x37, 0xa6, 0x74, 0x8e, 0x05, 0x2e, 0xb9, 0x0e, 0x75, 0x49, 0x14, + 0x73, 0x65, 0xef, 0x15, 0xbb, 0x36, 0xa5, 0xf3, 0xc7, 0xf3, 0x84, 0x30, 0xa2, 0x3c, 0x2e, 0x61, + 0xa7, 0x74, 0xfe, 0x21, 0xe5, 0xd6, 0x07, 0x50, 0x53, 0x87, 0x7c, 0xa9, 0x85, 0xa5, 0x7c, 0x25, + 0x27, 0xff, 0x5d, 0x68, 0x66, 0xce, 0x4d, 0xbe, 0x09, 0x57, 0x95, 0x86, 0x21, 0x8d, 0x04, 0x5a, + 0x24, 0xb7, 0x20, 0x41, 0xe2, 0x11, 0x8d, 0x84, 0xdc, 0x52, 0x15, 0xe5, 0xdf, 0x87, 0x76, 0xbe, + 0x70, 0x25, 0x7b, 0xd0, 0xd2, 0x45, 0xee, 0x69, 0x90, 0xfa, 0x62, 0x5c, 0x9a, 0x1e, 0x07, 0x82, + 0x65, 0xea, 0xdb, 0xa6, 0x62, 0x95, 0xb3, 0xdc, 0xfa, 0x63, 0x15, 0x6a, 0xaa, 0x78, 0x26, 0xb7, + 0x33, 0xfd, 0x0a, 0x22, 0x63, 0xbf, 0x79, 0xfe, 0xfc, 0x66, 0x1d, 0x41, 0xe4, 0xf0, 0x41, 0xda, + 0xbc, 0xa4, 0xe9, 0xb2, 0x92, 0xab, 0xed, 0xe3, 0x4e, 0x69, 0xf9, 0x95, 0x3b, 0xa5, 0xeb, 0x50, + 0xf7, 0x67, 0x53, 0xbc, 0x84, 0xaa, 0x5a, 0xd2, 0x9f, 0x4d, 0xe5, 0x25, 0xbc, 0x01, 0xa6, 0x08, + 0x04, 0x9d, 0x20, 0x49, 0x85, 0x7c, 0x03, 0x27, 0x24, 0x71, 0x0f, 0x56, 0x33, 0x58, 0xeb, 0xb9, + 0xba, 0x90, 0x6b, 0x67, 0x9d, 0xe3, 0xf0, 0x41, 0xac, 0x74, 0x82, 0xbd, 0x87, 0x2e, 0xd9, 0xc8, + 0x37, 0x06, 0x08, 0xd1, 0x0a, 0x27, 0x32, 0xb5, 0xbf, 0x04, 0x68, 0x79, 0x00, 0xe9, 0xf4, 0x8a, + 0x45, 0x81, 0x46, 0x43, 0x4e, 0x20, 0xf1, 0x4d, 0xe8, 0xa4, 0x28, 0xa7, 0x58, 0x4c, 0xb5, 0x4a, + 0x3a, 0x8d, 0x8c, 0xef, 0xc0, 0x15, 0x9f, 0xcd, 0x85, 0x53, 0xe4, 0x06, 0xe4, 0x26, 0x92, 0x76, + 0x9c, 0x97, 0xf8, 0x3a, 0xb4, 0xd3, 0xb4, 0x80, 0xbc, 0x4d, 0xd5, 0x9e, 0x25, 0xb3, 0xc8, 0x76, + 0x03, 0x1a, 0x49, 0x8d, 0xd1, 0x42, 0x86, 0x3a, 0x55, 0xa5, 0x45, 0x52, 0xb5, 0x44, 0x8c, 0xcf, + 0x26, 0x42, 0x2f, 0xb2, 0x8a, 0x3c, 0x58, 0xb5, 0xd8, 0x6a, 0x1e, 0x79, 0xbf, 0x0a, 0xab, 0x4c, + 0xb7, 0x2f, 0x8a, 0xaf, 0x8d, 0x7c, 0xad, 0x78, 0x12, 0x99, 0x36, 0x61, 0x2d, 0x8c, 0x82, 0x30, + 0xe0, 0x2c, 0x72, 0xa8, 0xeb, 0x46, 0x8c, 0xf3, 0x6e, 0x47, 0xad, 0x17, 0xcf, 0xef, 0xab, 0x69, + 0xeb, 0x67, 0x50, 0xd7, 0xd6, 0x2f, 0x6d, 0xe2, 0xbe, 0x03, 0x2d, 0xe9, 0xec, 0xdc, 0xc9, 0xb5, + 0x72, 0x71, 0x29, 0x8d, 0xbe, 0xce, 0x44, 0xae, 0xa3, 0x6b, 0x22, 0xbf, 0x9a, 0xb2, 0xee, 0xc2, + 0x6a, 0x8e, 0x47, 0xa2, 0x3a, 0x3a, 0x85, 0x0e, 0x19, 0x35, 0x48, 0x76, 0xae, 0xa4, 0x3b, 0x5b, + 0xf7, 0xc0, 0x4c, 0x0c, 0x2d, 0x2b, 0xbe, 0x58, 0x0f, 0x43, 0xdb, 0x4e, 0x0d, 0xb1, 0x4c, 0x08, + 0x3e, 0x65, 0x91, 0x8e, 0x7c, 0x35, 0xb0, 0x9e, 0x40, 0xa7, 0x90, 0xd5, 0xc9, 0x16, 0xd4, 0xc3, + 0xd9, 0xc0, 0x89, 0x5f, 0x17, 0xd2, 0x34, 0x76, 0x34, 0x1b, 0x7c, 0xc4, 0xce, 0xe2, 0x7e, 0x34, + 0xc4, 0x51, 0xba, 0x6c, 0x25, 0xbb, 0xec, 0xcf, 0x0d, 0x68, 0xc4, 0x11, 0x4a, 0xbe, 0x05, 0x66, + 0xe2, 0x24, 0x85, 0x3c, 0x9a, 0xec, 0xad, 0x57, 0x4d, 0x19, 0xe5, 0x5d, 0x73, 0x6f, 0xe4, 0x33, + 0xd7, 0x49, 0x03, 0x02, 0x37, 0x69, 0xd8, 0x1d, 0x45, 0xf8, 0x38, 0xf6, 0x7e, 0xf2, 0x95, 0x24, + 0x55, 0x44, 0xc1, 0xcc, 0x77, 0xb5, 0x8a, 0x3a, 0x27, 0xd8, 0x72, 0xca, 0x7a, 0x07, 0x6a, 0xea, + 0xfc, 0xd2, 0x86, 0x72, 0xf3, 0xb8, 0x50, 0x96, 0xdf, 0xa5, 0x98, 0xf0, 0x27, 0x03, 0x1a, 0x71, + 0x03, 0x5c, 0x2a, 0x94, 0xd3, 0xab, 0xf2, 0xb2, 0x7a, 0x2d, 0x7a, 0x45, 0x88, 0x33, 0x4d, 0xf5, + 0x95, 0x33, 0xcd, 0x16, 0x10, 0x95, 0x50, 0x4e, 0x03, 0xe1, 0xf9, 0x23, 0x47, 0xdd, 0x87, 0xca, + 0x2c, 0x6b, 0x48, 0x39, 0x46, 0xc2, 0x91, 0x9c, 0xdf, 0xfd, 0x6c, 0x05, 0x3a, 0xfb, 0xfd, 0xfb, + 0x87, 0xfb, 0x61, 0x38, 0xf1, 0x86, 0x14, 0xab, 0xf3, 0x1d, 0xa8, 0x62, 0xff, 0x51, 0xf2, 0xf2, + 0xd9, 0x2b, 0x6b, 0x84, 0xc9, 0x2e, 0xac, 0x60, 0x1b, 0x42, 0xca, 0x1e, 0x40, 0x7b, 0xa5, 0xfd, + 0xb0, 0xdc, 0x44, 0x35, 0x2a, 0x17, 0xdf, 0x41, 0x7b, 0x65, 0x4d, 0x31, 0xf9, 0x00, 0xcc, 0xb4, + 0x81, 0x58, 0xf4, 0x1a, 0xda, 0x5b, 0xd8, 0x1e, 0x4b, 0xf9, 0xb4, 0x6e, 0x5b, 0xf4, 0xa8, 0xd7, + 0x5b, 0xd8, 0x47, 0x92, 0x3d, 0xa8, 0xc7, 0xf5, 0x6c, 0xf9, 0x7b, 0x65, 0x6f, 0x41, 0xeb, 0x2a, + 0xcd, 0xa3, 0x7a, 0x82, 0xb2, 0x47, 0xd5, 0x5e, 0x69, 0x7f, 0x4d, 0xee, 0x40, 0x4d, 0x17, 0x28, + 0xa5, 0x6f, 0x96, 0xbd, 0xf2, 0x06, 0x54, 0x2a, 0x99, 0x76, 0x45, 0x8b, 0x1e, 0x7e, 0x7b, 0x0b, + 0x1f, 0x02, 0xc8, 0x3e, 0x40, 0xa6, 0x0f, 0x58, 0xf8, 0xa2, 0xdb, 0x5b, 0xdc, 0xe0, 0x93, 0x7b, + 0xd0, 0x48, 0x1f, 0x6d, 0xca, 0xdf, 0x68, 0x7b, 0x8b, 0x7a, 0xee, 0xfe, 0x97, 0xfe, 0xf3, 0xf7, + 0x75, 0xe3, 0xd7, 0xe7, 0xeb, 0xc6, 0x6f, 0xcf, 0xd7, 0x8d, 0x2f, 0xce, 0xd7, 0x8d, 0x3f, 0x9c, + 0xaf, 0x1b, 0x7f, 0x3b, 0x5f, 0x37, 0x7e, 0xf7, 0x8f, 0x75, 0x63, 0x50, 0x43, 0xf7, 0x7f, 0xf7, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x30, 0x52, 0xb5, 0x7b, 0x56, 0x18, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index fcec8888..a2eb65eb 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -60,7 +60,7 @@ message RequestInitChain { google.protobuf.Timestamp time = 1 [(gogoproto.nullable)=false, (gogoproto.stdtime)=true]; string chain_id = 2; ConsensusParams consensus_params = 3; - repeated Validator validators = 4 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable)=false]; bytes app_state_bytes = 5; } @@ -143,7 +143,7 @@ message ResponseSetOption { message ResponseInitChain { ConsensusParams consensus_params = 1; - repeated Validator validators = 2 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable)=false]; } message ResponseQuery { @@ -183,7 +183,7 @@ message ResponseDeliverTx { } message ResponseEndBlock { - repeated Validator validator_updates = 1 [(gogoproto.nullable)=false]; + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable)=false]; ConsensusParams consensus_param_updates = 2; repeated common.KVPair tags = 3 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"]; } @@ -225,8 +225,7 @@ message BlockGossip { } message LastCommitInfo { - int32 commit_round = 1; - repeated SigningValidator validators = 2 [(gogoproto.nullable)=false]; + repeated VoteInfo commit_votes = 1 [(gogoproto.nullable)=false]; } //---------------------------------------- @@ -272,14 +271,20 @@ message PartSetHeader { // Validator message Validator { bytes address = 1; - PubKey pub_key = 2 [(gogoproto.nullable)=false]; int64 power = 3; } -// Validator with an extra bool -message SigningValidator { +// ValidatorUpdate +message ValidatorUpdate { + PubKey pub_key = 1 [(gogoproto.nullable)=false]; + int64 power = 2; +} + +// VoteInfo +message VoteInfo { Validator validator = 1 [(gogoproto.nullable)=false]; bool signed_last_block = 2; + int64 commit_round = 3; } message PubKey { diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index cdff9c72..de094ed4 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -42,7 +42,8 @@ It has these top-level messages: BlockID PartSetHeader Validator - SigningValidator + ValidatorUpdate + VoteInfo PubKey Evidence */ @@ -1970,15 +1971,15 @@ func TestValidatorMarshalTo(t *testing.T) { } } -func TestSigningValidatorProto(t *testing.T) { +func TestValidatorUpdateProto(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, false) + p := NewPopulatedValidatorUpdate(popr, false) dAtA, err := proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2001,10 +2002,10 @@ func TestSigningValidatorProto(t *testing.T) { } } -func TestSigningValidatorMarshalTo(t *testing.T) { +func TestValidatorUpdateMarshalTo(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, false) + p := NewPopulatedValidatorUpdate(popr, false) size := p.Size() dAtA := make([]byte, size) for i := range dAtA { @@ -2014,7 +2015,63 @@ func TestSigningValidatorMarshalTo(t *testing.T) { if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + if err := proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProto(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, false) + dAtA, err := proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} + if err := proto.Unmarshal(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + littlefuzz := make([]byte, len(dAtA)) + copy(littlefuzz, dAtA) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } + if len(littlefuzz) > 0 { + fuzzamount := 100 + for i := 0; i < fuzzamount; i++ { + littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) + littlefuzz = append(littlefuzz, byte(popr.Intn(256))) + } + // shouldn't panic + _ = proto.Unmarshal(littlefuzz, msg) + } +} + +func TestVoteInfoMarshalTo(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, false) + size := p.Size() + dAtA := make([]byte, size) + for i := range dAtA { + dAtA[i] = byte(popr.Intn(256)) + } + _, err := p.MarshalTo(dAtA) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} if err := proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2750,16 +2807,34 @@ func TestValidatorJSON(t *testing.T) { t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) } } -func TestSigningValidatorJSON(t *testing.T) { +func TestValidatorUpdateJSON(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) marshaler := jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + err = jsonpb.UnmarshalString(jsondata, msg) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) + } +} +func TestVoteInfoJSON(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + marshaler := jsonpb.Marshaler{} + jsondata, err := marshaler.MarshalToString(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + msg := &VoteInfo{} err = jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) @@ -3756,12 +3831,12 @@ func TestValidatorProtoCompactText(t *testing.T) { } } -func TestSigningValidatorProtoText(t *testing.T) { +func TestValidatorUpdateProtoText(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) dAtA := proto.MarshalTextString(p) - msg := &SigningValidator{} + msg := &ValidatorUpdate{} if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3770,12 +3845,40 @@ func TestSigningValidatorProtoText(t *testing.T) { } } -func TestSigningValidatorProtoCompactText(t *testing.T) { +func TestValidatorUpdateProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) dAtA := proto.CompactTextString(p) - msg := &SigningValidator{} + msg := &ValidatorUpdate{} + if err := proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProtoText(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + dAtA := proto.MarshalTextString(p) + msg := &VoteInfo{} + if err := proto.UnmarshalText(dAtA, msg); err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + if !p.Equal(msg) { + t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) + } +} + +func TestVoteInfoProtoCompactText(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) + dAtA := proto.CompactTextString(p) + msg := &VoteInfo{} if err := proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4588,10 +4691,32 @@ func TestValidatorSize(t *testing.T) { } } -func TestSigningValidatorSize(t *testing.T) { +func TestValidatorUpdateSize(t *testing.T) { seed := time.Now().UnixNano() popr := rand.New(rand.NewSource(seed)) - p := NewPopulatedSigningValidator(popr, true) + p := NewPopulatedValidatorUpdate(popr, true) + size2 := proto.Size(p) + dAtA, err := proto.Marshal(p) + if err != nil { + t.Fatalf("seed = %d, err = %v", seed, err) + } + size := p.Size() + if len(dAtA) != size { + t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) + } + if size2 != size { + t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) + } + size3 := proto.Size(p) + if size3 != size { + t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) + } +} + +func TestVoteInfoSize(t *testing.T) { + seed := time.Now().UnixNano() + popr := rand.New(rand.NewSource(seed)) + p := NewPopulatedVoteInfo(popr, true) size2 := proto.Size(p) dAtA, err := proto.Marshal(p) if err != nil { diff --git a/abci/types/util.go b/abci/types/util.go index 458024c5..3cde8823 100644 --- a/abci/types/util.go +++ b/abci/types/util.go @@ -2,58 +2,33 @@ package types import ( "bytes" - "encoding/json" "sort" - - cmn "github.com/tendermint/tendermint/libs/common" ) //------------------------------------------------------------------------------ -// Validators is a list of validators that implements the Sort interface -type Validators []Validator +// ValidatorUpdates is a list of validators that implements the Sort interface +type ValidatorUpdates []ValidatorUpdate -var _ sort.Interface = (Validators)(nil) +var _ sort.Interface = (ValidatorUpdates)(nil) -// All these methods for Validators: +// All these methods for ValidatorUpdates: // Len, Less and Swap -// are for Validators to implement sort.Interface +// are for ValidatorUpdates to implement sort.Interface // which will be used by the sort package. // See Issue https://github.com/tendermint/abci/issues/212 -func (v Validators) Len() int { +func (v ValidatorUpdates) Len() int { return len(v) } // XXX: doesn't distinguish same validator with different power -func (v Validators) Less(i, j int) bool { +func (v ValidatorUpdates) Less(i, j int) bool { return bytes.Compare(v[i].PubKey.Data, v[j].PubKey.Data) <= 0 } -func (v Validators) Swap(i, j int) { +func (v ValidatorUpdates) Swap(i, j int) { v1 := v[i] v[i] = v[j] v[j] = v1 } - -func ValidatorsString(vs Validators) string { - s := make([]validatorPretty, len(vs)) - for i, v := range vs { - s[i] = validatorPretty{ - Address: v.Address, - PubKey: v.PubKey.Data, - Power: v.Power, - } - } - b, err := json.Marshal(s) - if err != nil { - panic(err.Error()) - } - return string(b) -} - -type validatorPretty struct { - Address cmn.HexBytes `json:"address"` - PubKey []byte `json:"pub_key"` - Power int64 `json:"power"` -} diff --git a/consensus/common_test.go b/consensus/common_test.go index 81894618..dc055959 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -354,7 +354,7 @@ func randConsensusNet(nValidators int, testName string, tickerFunc func() Timeou } ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) css[i] = newConsensusStateWithConfig(thisConfig, state, privVals[i], app) @@ -386,7 +386,7 @@ func randConsensusNetWithPeers(nValidators, nPeers int, testName string, tickerF } app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) css[i] = newConsensusStateWithConfig(thisConfig, state, privVal, app) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 35502fb1..4a6d4b9d 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -118,7 +118,7 @@ func TestReactorWithEvidence(t *testing.T) { thisConfig := ResetConfig(fmt.Sprintf("%s_%d", testName, i)) ensureDir(path.Dir(thisConfig.Consensus.WalFile()), 0700) // dir for wal app := appFunc() - vals := types.TM2PB.Validators(state.Validators) + vals := types.TM2PB.ValidatorUpdates(state.Validators) app.InitChain(abci.RequestInitChain{Validators: vals}) pv := privVals[i] diff --git a/consensus/replay.go b/consensus/replay.go index cff8344b..c92654f2 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -266,7 +266,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain. if appBlockHeight == 0 { - nextVals := types.TM2PB.Validators(state.NextValidators) // state.Validators would work too. + nextVals := types.TM2PB.ValidatorUpdates(state.NextValidators) // state.Validators would work too. csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams) req := abci.RequestInitChain{ Time: h.genDoc.GenesisTime, @@ -282,7 +282,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight // If the app returned validators or consensus params, update the state. if len(res.Validators) > 0 { - vals, err := types.PB2TM.Validators(res.Validators) + vals, err := types.PB2TM.ValidatorUpdates(res.Validators) if err != nil { return nil, err } diff --git a/consensus/replay_test.go b/consensus/replay_test.go index c74a1ae9..8ea71d35 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -416,7 +416,7 @@ func buildAppStateFromChain(proxyApp proxy.AppConns, stateDB dbm.DB, } defer proxyApp.Stop() - validators := types.TM2PB.Validators(state.Validators) + validators := types.TM2PB.ValidatorUpdates(state.Validators) if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { @@ -453,7 +453,7 @@ func buildTMStateFromChain(config *cfg.Config, stateDB dbm.DB, state sm.State, c } defer proxyApp.Stop() - validators := types.TM2PB.Validators(state.Validators) + validators := types.TM2PB.ValidatorUpdates(state.Validators) if _, err := proxyApp.Consensus().InitChainSync(abci.RequestInitChain{ Validators: validators, }); err != nil { @@ -639,7 +639,7 @@ func (bs *mockBlockStore) LoadSeenCommit(height int64) *types.Commit { func TestInitChainUpdateValidators(t *testing.T) { val, _ := types.RandValidator(true, 10) vals := types.NewValidatorSet([]*types.Validator{val}) - app := &initChainApp{vals: types.TM2PB.Validators(vals)} + app := &initChainApp{vals: types.TM2PB.ValidatorUpdates(vals)} clientCreator := proxy.NewLocalClientCreator(app) config := ResetConfig("proxy_test_") @@ -666,7 +666,7 @@ func TestInitChainUpdateValidators(t *testing.T) { assert.Equal(t, newValAddr, expectValAddr) } -func newInitChainApp(vals []abci.Validator) *initChainApp { +func newInitChainApp(vals []abci.ValidatorUpdate) *initChainApp { return &initChainApp{ vals: vals, } @@ -675,7 +675,7 @@ func newInitChainApp(vals []abci.Validator) *initChainApp { // returns the vals on InitChain type initChainApp struct { abci.BaseApplication - vals []abci.Validator + vals []abci.ValidatorUpdate } func (ica *initChainApp) InitChain(req abci.RequestInitChain) abci.ResponseInitChain { diff --git a/state/execution.go b/state/execution.go index 7e7bc37a..71b3ec1c 100644 --- a/state/execution.go +++ b/state/execution.go @@ -184,15 +184,14 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, } proxyAppConn.SetResponseCallback(proxyCb) - signVals, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) + voteInfos, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) // Begin block. _, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{ Hash: block.Hash(), Header: types.TM2PB.Header(&block.Header), LastCommitInfo: abci.LastCommitInfo{ - CommitRound: int32(block.LastCommit.Round()), - Validators: signVals, + CommitVotes: voteInfos, }, ByzantineValidators: byzVals, }) @@ -218,15 +217,15 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, logger.Info("Executed block", "height", block.Height, "validTxs", validTxs, "invalidTxs", invalidTxs) - valUpdates := abciResponses.EndBlock.ValidatorUpdates - if len(valUpdates) > 0 { - logger.Info("Updates to validators", "updates", abci.ValidatorsString(valUpdates)) + if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { + // TODO: cleanup the formatting + logger.Info("Updates to validators", "updates", abciResponses.EndBlock.ValidatorUpdates) } return abciResponses, nil } -func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]abci.SigningValidator, []abci.Evidence) { +func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]abci.VoteInfo, []abci.Evidence) { // Sanity check that commit length matches validator set size - // only applies after first block @@ -241,17 +240,22 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS } // determine which validators did not sign last block. - signVals := make([]abci.SigningValidator, len(lastValSet.Validators)) + voteInfos := make([]abci.VoteInfo, len(lastValSet.Validators)) for i, val := range lastValSet.Validators { var vote *types.Vote + var commitRound = -1 if i < len(block.LastCommit.Precommits) { vote = block.LastCommit.Precommits[i] + if vote != nil { + commitRound = vote.Round + } } - val := abci.SigningValidator{ - Validator: types.TM2PB.ValidatorWithoutPubKey(val), - SignedLastBlock: vote != nil, + voteInfo := abci.VoteInfo{ + Validator: types.TM2PB.Validator(val), + SignedLastBlock: vote != nil, // XXX: should we replace with commitRound == -1 ? + CommitRound: int64(commitRound), //XXX: why is round an int? } - signVals[i] = val + voteInfos[i] = voteInfo } byzVals := make([]abci.Evidence, len(block.Evidence.Evidence)) @@ -266,15 +270,15 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS byzVals[i] = types.TM2PB.Evidence(ev, valset, block.Time) } - return signVals, byzVals + return voteInfos, byzVals } // If more or equal than 1/3 of total voting power changed in one block, then // a light client could never prove the transition externally. See // ./lite/doc.go for details on how a light client tracks validators. -func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.Validator) error { - updates, err := types.PB2TM.Validators(abciUpdates) +func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.ValidatorUpdate) error { + updates, err := types.PB2TM.ValidatorUpdates(abciUpdates) if err != nil { return err } diff --git a/state/execution_test.go b/state/execution_test.go index 161b96f2..52baadf3 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -86,7 +86,7 @@ func TestBeginBlockValidators(t *testing.T) { // -> app receives a list of validators with a bool indicating if they signed ctr := 0 - for i, v := range app.Validators { + for i, v := range app.CommitVotes { if ctr < len(tc.expectedAbsentValidators) && tc.expectedAbsentValidators[ctr] == i { @@ -160,7 +160,7 @@ func TestUpdateValidators(t *testing.T) { name string currentSet *types.ValidatorSet - abciUpdates []abci.Validator + abciUpdates []abci.ValidatorUpdate resultingSet *types.ValidatorSet shouldErr bool @@ -169,7 +169,7 @@ func TestUpdateValidators(t *testing.T) { "adding a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 20}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 20}}, types.NewValidatorSet([]*types.Validator{val1, val2}), false, @@ -178,7 +178,7 @@ func TestUpdateValidators(t *testing.T) { "updating a validator is OK", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey1), Power: 20}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey1), Power: 20}}, types.NewValidatorSet([]*types.Validator{types.NewValidator(pubkey1, 20)}), false, @@ -187,7 +187,7 @@ func TestUpdateValidators(t *testing.T) { "removing a validator is OK", types.NewValidatorSet([]*types.Validator{val1, val2}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), false, @@ -197,7 +197,7 @@ func TestUpdateValidators(t *testing.T) { "removing a non-existing validator results in error", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: 0}}, types.NewValidatorSet([]*types.Validator{val1}), true, @@ -207,7 +207,7 @@ func TestUpdateValidators(t *testing.T) { "adding a validator with negative power results in error", types.NewValidatorSet([]*types.Validator{val1}), - []abci.Validator{{Address: []byte{}, PubKey: types.TM2PB.PubKey(pubkey2), Power: -100}}, + []abci.ValidatorUpdate{{PubKey: types.TM2PB.PubKey(pubkey2), Power: -100}}, types.NewValidatorSet([]*types.Validator{val1}), true, @@ -335,7 +335,7 @@ func makeBlock(state State, height int64) *types.Block { type testApp struct { abci.BaseApplication - Validators []abci.SigningValidator + CommitVotes []abci.VoteInfo ByzantineValidators []abci.Evidence ValidatorUpdates []abci.Validator } @@ -347,7 +347,7 @@ func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { } func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock { - app.Validators = req.LastCommitInfo.Validators + app.CommitVotes = req.LastCommitInfo.CommitVotes app.ByzantineValidators = req.ByzantineValidators return abci.ResponseBeginBlock{} } diff --git a/state/state_test.go b/state/state_test.go index 211d5fdc..d8a8c0b8 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -78,8 +78,8 @@ func TestABCIResponsesSaveLoad1(t *testing.T) { abciResponses := NewABCIResponses(block) abciResponses.DeliverTx[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Tags: nil} abciResponses.DeliverTx[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Tags: nil} - abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(ed25519.GenPrivKey().PubKey(), 10), + abciResponses.EndBlock = &abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(ed25519.GenPrivKey().PubKey(), 10), }} saveABCIResponses(stateDB, block.Height, abciResponses) @@ -454,9 +454,9 @@ func makeHeaderPartsResponsesValPubKeyChange(state State, height int64, _, val := state.NextValidators.GetByIndex(0) if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) { abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(val.PubKey, 0), - types.TM2PB.ValidatorFromPubKeyAndPower(pubkey, 10), + ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(val.PubKey, 0), + types.TM2PB.NewValidatorUpdate(pubkey, 10), }, } } @@ -476,8 +476,8 @@ func makeHeaderPartsResponsesValPowerChange(state State, height int64, _, val := state.NextValidators.GetByIndex(0) if val.VotingPower != power { abciResponses.EndBlock = &abci.ResponseEndBlock{ - ValidatorUpdates: []abci.Validator{ - types.TM2PB.ValidatorFromPubKeyAndPower(val.PubKey, power), + ValidatorUpdates: []abci.ValidatorUpdate{ + types.TM2PB.NewValidatorUpdate(val.PubKey, power), }, } } diff --git a/types/protobuf.go b/types/protobuf.go index 1681dd37..1363430b 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -1,7 +1,6 @@ package types import ( - "bytes" "fmt" "reflect" "time" @@ -56,7 +55,7 @@ func (tm2pb) Header(header *Header) abci.Header { } } -func (tm2pb) ValidatorWithoutPubKey(val *Validator) abci.Validator { +func (tm2pb) Validator(val *Validator) abci.Validator { return abci.Validator{ Address: val.PubKey.Address(), Power: val.VotingPower, @@ -78,11 +77,10 @@ func (tm2pb) PartSetHeader(header PartSetHeader) abci.PartSetHeader { } // XXX: panics on unknown pubkey type -func (tm2pb) Validator(val *Validator) abci.Validator { - return abci.Validator{ - Address: val.PubKey.Address(), - PubKey: TM2PB.PubKey(val.PubKey), - Power: val.VotingPower, +func (tm2pb) ValidatorUpdate(val *Validator) abci.ValidatorUpdate { + return abci.ValidatorUpdate{ + PubKey: TM2PB.PubKey(val.PubKey), + Power: val.VotingPower, } } @@ -106,10 +104,10 @@ func (tm2pb) PubKey(pubKey crypto.PubKey) abci.PubKey { } // XXX: panics on nil or unknown pubkey type -func (tm2pb) Validators(vals *ValidatorSet) []abci.Validator { - validators := make([]abci.Validator, vals.Size()) +func (tm2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { + validators := make([]abci.ValidatorUpdate, vals.Size()) for i, val := range vals.Validators { - validators[i] = TM2PB.Validator(val) + validators[i] = TM2PB.ValidatorUpdate(val) } return validators } @@ -156,7 +154,7 @@ func (tm2pb) Evidence(ev Evidence, valSet *ValidatorSet, evTime time.Time) abci. return abci.Evidence{ Type: evType, - Validator: TM2PB.ValidatorWithoutPubKey(val), + Validator: TM2PB.Validator(val), Height: ev.Height(), Time: evTime, TotalVotingPower: valSet.TotalVotingPower(), @@ -164,12 +162,11 @@ func (tm2pb) Evidence(ev Evidence, valSet *ValidatorSet, evTime time.Time) abci. } // XXX: panics on nil or unknown pubkey type -func (tm2pb) ValidatorFromPubKeyAndPower(pubkey crypto.PubKey, power int64) abci.Validator { +func (tm2pb) NewValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate { pubkeyABCI := TM2PB.PubKey(pubkey) - return abci.Validator{ - Address: pubkey.Address(), - PubKey: pubkeyABCI, - Power: power, + return abci.ValidatorUpdate{ + PubKey: pubkeyABCI, + Power: power, } } @@ -205,7 +202,7 @@ func (pb2tm) PubKey(pubKey abci.PubKey) (crypto.PubKey, error) { } } -func (pb2tm) Validators(vals []abci.Validator) ([]*Validator, error) { +func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) { tmVals := make([]*Validator, len(vals)) for i, v := range vals { pub, err := PB2TM.PubKey(v.PubKey) @@ -214,17 +211,13 @@ func (pb2tm) Validators(vals []abci.Validator) ([]*Validator, error) { } // If the app provided an address too, it must match. // This is just a sanity check. - if len(v.Address) > 0 { + /*if len(v.Address) > 0 { if !bytes.Equal(pub.Address(), v.Address) { return nil, fmt.Errorf("Validator.Address (%X) does not match PubKey.Address (%X)", v.Address, pub.Address()) } - } - tmVals[i] = &Validator{ - Address: pub.Address(), - PubKey: pub, - VotingPower: v.Power, - } + }*/ + tmVals[i] = NewValidator(pub, v.Power) } return tmVals, nil } diff --git a/types/protobuf_test.go b/types/protobuf_test.go index caad5c8f..22bed60f 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -41,26 +41,26 @@ func TestABCIValidators(t *testing.T) { VotingPower: 10, } - abciVal := TM2PB.Validator(tmVal) - tmVals, err := PB2TM.Validators([]abci.Validator{abciVal}) + abciVal := TM2PB.ValidatorUpdate(tmVal) + tmVals, err := PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) - abciVals := TM2PB.Validators(NewValidatorSet(tmVals)) - assert.Equal(t, []abci.Validator{abciVal}, abciVals) + abciVals := TM2PB.ValidatorUpdates(NewValidatorSet(tmVals)) + assert.Equal(t, []abci.ValidatorUpdate{abciVal}, abciVals) // val with address tmVal.Address = pkEd.Address() - abciVal = TM2PB.Validator(tmVal) - tmVals, err = PB2TM.Validators([]abci.Validator{abciVal}) + abciVal = TM2PB.ValidatorUpdate(tmVal) + tmVals, err = PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) - // val with incorrect address - abciVal = TM2PB.Validator(tmVal) - abciVal.Address = []byte("incorrect!") - tmVals, err = PB2TM.Validators([]abci.Validator{abciVal}) + // val with incorrect pubkey daya + abciVal = TM2PB.ValidatorUpdate(tmVal) + abciVal.PubKey.Data = []byte("incorrect!") + tmVals, err = PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) assert.NotNil(t, err) assert.Nil(t, tmVals) } @@ -104,9 +104,6 @@ func TestABCIEvidence(t *testing.T) { ) assert.Equal(t, "duplicate/vote", abciEv.Type) - - // test we do not send pubkeys - assert.Empty(t, abciEv.Validator.PubKey) } type pubKeyEddie struct{} @@ -119,17 +116,17 @@ func (pubKeyEddie) Equals(crypto.PubKey) bool { return false } func TestABCIValidatorFromPubKeyAndPower(t *testing.T) { pubkey := ed25519.GenPrivKey().PubKey() - abciVal := TM2PB.ValidatorFromPubKeyAndPower(pubkey, 10) + abciVal := TM2PB.NewValidatorUpdate(pubkey, 10) assert.Equal(t, int64(10), abciVal.Power) - assert.Panics(t, func() { TM2PB.ValidatorFromPubKeyAndPower(nil, 10) }) - assert.Panics(t, func() { TM2PB.ValidatorFromPubKeyAndPower(pubKeyEddie{}, 10) }) + assert.Panics(t, func() { TM2PB.NewValidatorUpdate(nil, 10) }) + assert.Panics(t, func() { TM2PB.NewValidatorUpdate(pubKeyEddie{}, 10) }) } func TestABCIValidatorWithoutPubKey(t *testing.T) { pkEd := ed25519.GenPrivKey().PubKey() - abciVal := TM2PB.ValidatorWithoutPubKey(&Validator{ + abciVal := TM2PB.Validator(&Validator{ Address: pkEd.Address(), PubKey: pkEd, VotingPower: 10, From 91376627eae08bc2170c20746418f38e67d92e52 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 09:21:42 -0400 Subject: [PATCH 076/149] update ADR --- docs/architecture/adr-018-ABCI-Validators.md | 36 ++++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/docs/architecture/adr-018-ABCI-Validators.md b/docs/architecture/adr-018-ABCI-Validators.md index 2f1060b9..b632da85 100644 --- a/docs/architecture/adr-018-ABCI-Validators.md +++ b/docs/architecture/adr-018-ABCI-Validators.md @@ -2,6 +2,10 @@ ## Changelog +016-08-2018: Follow up from review: + - Revert changes to commit round + - Remind about justification for removing pubkey + - Update pros/cons 05-08-2018: Initial draft ## Context @@ -10,17 +14,14 @@ ADR 009 introduced major improvements to the ABCI around validators and the use of Amino. Here we follow up with some additional changes to improve the naming and expected use of Validator messages. -We also fix how we communicate the commit round - there is no defined commit -round, as validators can commit the same block in different rounds, so we -should communicate the round each validator committed in. - ## Decision ### Validator -Currently a Validator contains address and `pub_key`, and one or the other is +Currently a Validator contains `address` and `pub_key`, and one or the other is optional/not-sent depending on the use case. Instead, we should have a -Validator (with just the address) and a ValidatorUpdate (with the pubkey): +`Validator` (with just the address, used for RequestBeginBlock) +and a `ValidatorUpdate` (with the pubkey, used for ResponseEndBlock): ``` message Validator { @@ -34,6 +35,13 @@ message ValidatorUpdate { } ``` +As noted in ADR-009[https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-009-ABCI-design.md], +the `Validator` does not contain a pubkey because quantum public keys are +quite large and it would be wasteful to send them all over ABCI with every block. +Thus, applications that want to take advantage of the information in BeginBlock +are *required* to store pubkeys in state (or use much less efficient lazy means +of verifying BeginBlock data). + ### RequestBeginBlock LastCommitInfo currently has an array of `SigningValidator` that contains @@ -41,19 +49,17 @@ information for each validator in the entire validator set. Instead, this should be called `VoteInfo`, since it is information about the validator votes. -Additionally, we have a single CommitRound in the LastCommitInfo, -but such a round does not exist. Instead, we -should include the round associated with each commit vote: +Note that all votes in a commit must be from the same round. ``` message LastCommitInfo { + int64 round repeated VoteInfo commit_votes } message VoteInfo { Validator validator bool signed_last_block - int64 round } ``` @@ -62,6 +68,9 @@ message VoteInfo { Use ValidatorUpdates instead of Validators. Then it's clear we don't need an address, and we do need a pubkey. +We could require the address here as well as a sanity check, but it doesn't seem +necessary. + ### InitChain Use ValidatorUpdates for both Request and Response. InitChain @@ -76,16 +85,15 @@ Proposal. ### Positive -- Easier for developers to build on and understand the ABCI -- Apps get more information about the votes (ie. the round they're from) +- Clarifies the distinction between the different uses of validator information ### Negative -- There are two validator types +- Apps must still store the public keys in state to utilize the RequestBeginBlock info ### Neutral -- +- ResponseEndBlock does not require an address ## References From fe6a50437433f3d7c7c9ff4239110bc35f6e5e4b Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:17:30 -0400 Subject: [PATCH 077/149] revert gogo version used to generate files --- abci/types/types.pb.go | 2227 ++++++++++++++++++++++++++++++------ abci/types/typespb_test.go | 1495 ++++++++++++------------ 2 files changed, 2614 insertions(+), 1108 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 773754c7..8745553e 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -1,52 +1,6 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: abci/types/types.proto -/* - Package types is a generated protocol buffer package. - - It is generated from these files: - abci/types/types.proto - - It has these top-level messages: - Request - RequestEcho - RequestFlush - RequestInfo - RequestSetOption - RequestInitChain - RequestQuery - RequestBeginBlock - RequestCheckTx - RequestDeliverTx - RequestEndBlock - RequestCommit - Response - ResponseException - ResponseEcho - ResponseFlush - ResponseInfo - ResponseSetOption - ResponseInitChain - ResponseQuery - ResponseBeginBlock - ResponseCheckTx - ResponseDeliverTx - ResponseEndBlock - ResponseCommit - ConsensusParams - BlockSize - TxSize - BlockGossip - LastCommitInfo - Header - BlockID - PartSetHeader - Validator - ValidatorUpdate - VoteInfo - PubKey - Evidence -*/ package types import proto "github.com/gogo/protobuf/proto" @@ -66,7 +20,7 @@ import ( grpc "google.golang.org/grpc" ) -import types1 "github.com/gogo/protobuf/types" +import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" import io "io" @@ -96,13 +50,44 @@ type Request struct { // *Request_DeliverTx // *Request_EndBlock // *Request_Commit - Value isRequest_Value `protobuf_oneof:"value"` + Value isRequest_Value `protobuf_oneof:"value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{0} +} +func (m *Request) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Request.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_Request.Merge(dst, src) +} +func (m *Request) XXX_Size() int { + return m.Size() +} +func (m *Request) XXX_DiscardUnknown() { + xxx_messageInfo_Request.DiscardUnknown(m) +} + +var xxx_messageInfo_Request proto.InternalMessageInfo type isRequest_Value interface { isRequest_Value() @@ -426,57 +411,57 @@ func _Request_OneofSizer(msg proto.Message) (n int) { switch x := m.Value.(type) { case *Request_Echo: s := proto.Size(x.Echo) - n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_Flush: s := proto.Size(x.Flush) - n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_Info: s := proto.Size(x.Info) - n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_SetOption: s := proto.Size(x.SetOption) - n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_InitChain: s := proto.Size(x.InitChain) - n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_Query: s := proto.Size(x.Query) - n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_BeginBlock: s := proto.Size(x.BeginBlock) - n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_CheckTx: s := proto.Size(x.CheckTx) - n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_DeliverTx: s := proto.Size(x.DeliverTx) - n += proto.SizeVarint(19<<3 | proto.WireBytes) + n += 2 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_EndBlock: s := proto.Size(x.EndBlock) - n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Request_Commit: s := proto.Size(x.Commit) - n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case nil: @@ -487,13 +472,44 @@ func _Request_OneofSizer(msg proto.Message) (n int) { } type RequestEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestEcho) Reset() { *m = RequestEcho{} } -func (m *RequestEcho) String() string { return proto.CompactTextString(m) } -func (*RequestEcho) ProtoMessage() {} -func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } +func (m *RequestEcho) Reset() { *m = RequestEcho{} } +func (m *RequestEcho) String() string { return proto.CompactTextString(m) } +func (*RequestEcho) ProtoMessage() {} +func (*RequestEcho) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{1} +} +func (m *RequestEcho) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestEcho.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestEcho) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestEcho.Merge(dst, src) +} +func (m *RequestEcho) XXX_Size() int { + return m.Size() +} +func (m *RequestEcho) XXX_DiscardUnknown() { + xxx_messageInfo_RequestEcho.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestEcho proto.InternalMessageInfo func (m *RequestEcho) GetMessage() string { if m != nil { @@ -503,21 +519,83 @@ func (m *RequestEcho) GetMessage() string { } type RequestFlush struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestFlush) Reset() { *m = RequestFlush{} } -func (m *RequestFlush) String() string { return proto.CompactTextString(m) } -func (*RequestFlush) ProtoMessage() {} -func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} } +func (m *RequestFlush) Reset() { *m = RequestFlush{} } +func (m *RequestFlush) String() string { return proto.CompactTextString(m) } +func (*RequestFlush) ProtoMessage() {} +func (*RequestFlush) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{2} +} +func (m *RequestFlush) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestFlush.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestFlush) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestFlush.Merge(dst, src) +} +func (m *RequestFlush) XXX_Size() int { + return m.Size() +} +func (m *RequestFlush) XXX_DiscardUnknown() { + xxx_messageInfo_RequestFlush.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestFlush proto.InternalMessageInfo type RequestInfo struct { - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestInfo) Reset() { *m = RequestInfo{} } -func (m *RequestInfo) String() string { return proto.CompactTextString(m) } -func (*RequestInfo) ProtoMessage() {} -func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} } +func (m *RequestInfo) Reset() { *m = RequestInfo{} } +func (m *RequestInfo) String() string { return proto.CompactTextString(m) } +func (*RequestInfo) ProtoMessage() {} +func (*RequestInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{3} +} +func (m *RequestInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestInfo.Merge(dst, src) +} +func (m *RequestInfo) XXX_Size() int { + return m.Size() +} +func (m *RequestInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RequestInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestInfo proto.InternalMessageInfo func (m *RequestInfo) GetVersion() string { if m != nil { @@ -528,14 +606,45 @@ func (m *RequestInfo) GetVersion() string { // nondeterministic type RequestSetOption struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } -func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } -func (*RequestSetOption) ProtoMessage() {} -func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{4} } +func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } +func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } +func (*RequestSetOption) ProtoMessage() {} +func (*RequestSetOption) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{4} +} +func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestSetOption.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestSetOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestSetOption.Merge(dst, src) +} +func (m *RequestSetOption) XXX_Size() int { + return m.Size() +} +func (m *RequestSetOption) XXX_DiscardUnknown() { + xxx_messageInfo_RequestSetOption.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestSetOption proto.InternalMessageInfo func (m *RequestSetOption) GetKey() string { if m != nil { @@ -552,17 +661,48 @@ func (m *RequestSetOption) GetValue() string { } type RequestInitChain struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators" json:"validators"` - AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + Time time.Time `protobuf:"bytes,1,opt,name=time,stdtime" json:"time"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsensusParams *ConsensusParams `protobuf:"bytes,3,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,4,rep,name=validators" json:"validators"` + AppStateBytes []byte `protobuf:"bytes,5,opt,name=app_state_bytes,json=appStateBytes,proto3" json:"app_state_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } -func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } -func (*RequestInitChain) ProtoMessage() {} -func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{5} } +func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } +func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } +func (*RequestInitChain) ProtoMessage() {} +func (*RequestInitChain) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{5} +} +func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestInitChain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestInitChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestInitChain.Merge(dst, src) +} +func (m *RequestInitChain) XXX_Size() int { + return m.Size() +} +func (m *RequestInitChain) XXX_DiscardUnknown() { + xxx_messageInfo_RequestInitChain.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestInitChain proto.InternalMessageInfo func (m *RequestInitChain) GetTime() time.Time { if m != nil { @@ -600,16 +740,47 @@ func (m *RequestInitChain) GetAppStateBytes() []byte { } type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestQuery) Reset() { *m = RequestQuery{} } -func (m *RequestQuery) String() string { return proto.CompactTextString(m) } -func (*RequestQuery) ProtoMessage() {} -func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{6} } +func (m *RequestQuery) Reset() { *m = RequestQuery{} } +func (m *RequestQuery) String() string { return proto.CompactTextString(m) } +func (*RequestQuery) ProtoMessage() {} +func (*RequestQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{6} +} +func (m *RequestQuery) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestQuery.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestQuery.Merge(dst, src) +} +func (m *RequestQuery) XXX_Size() int { + return m.Size() +} +func (m *RequestQuery) XXX_DiscardUnknown() { + xxx_messageInfo_RequestQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestQuery proto.InternalMessageInfo func (m *RequestQuery) GetData() []byte { if m != nil { @@ -641,16 +812,47 @@ func (m *RequestQuery) GetProve() bool { // NOTE: validators here have empty pubkeys. type RequestBeginBlock struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header Header `protobuf:"bytes,2,opt,name=header" json:"header"` - LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo" json:"last_commit_info"` - ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header Header `protobuf:"bytes,2,opt,name=header" json:"header"` + LastCommitInfo LastCommitInfo `protobuf:"bytes,3,opt,name=last_commit_info,json=lastCommitInfo" json:"last_commit_info"` + ByzantineValidators []Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } -func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } -func (*RequestBeginBlock) ProtoMessage() {} -func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{7} } +func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } +func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } +func (*RequestBeginBlock) ProtoMessage() {} +func (*RequestBeginBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{7} +} +func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestBeginBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestBeginBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestBeginBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestBeginBlock.Merge(dst, src) +} +func (m *RequestBeginBlock) XXX_Size() int { + return m.Size() +} +func (m *RequestBeginBlock) XXX_DiscardUnknown() { + xxx_messageInfo_RequestBeginBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestBeginBlock proto.InternalMessageInfo func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -681,13 +883,44 @@ func (m *RequestBeginBlock) GetByzantineValidators() []Evidence { } type RequestCheckTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } -func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } -func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} } +func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } +func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } +func (*RequestCheckTx) ProtoMessage() {} +func (*RequestCheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{8} +} +func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestCheckTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestCheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestCheckTx.Merge(dst, src) +} +func (m *RequestCheckTx) XXX_Size() int { + return m.Size() +} +func (m *RequestCheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_RequestCheckTx.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestCheckTx proto.InternalMessageInfo func (m *RequestCheckTx) GetTx() []byte { if m != nil { @@ -697,13 +930,44 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestDeliverTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } -func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } -func (*RequestDeliverTx) ProtoMessage() {} -func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{9} } +func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } +func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } +func (*RequestDeliverTx) ProtoMessage() {} +func (*RequestDeliverTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{9} +} +func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestDeliverTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestDeliverTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestDeliverTx.Merge(dst, src) +} +func (m *RequestDeliverTx) XXX_Size() int { + return m.Size() +} +func (m *RequestDeliverTx) XXX_DiscardUnknown() { + xxx_messageInfo_RequestDeliverTx.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestDeliverTx proto.InternalMessageInfo func (m *RequestDeliverTx) GetTx() []byte { if m != nil { @@ -713,13 +977,44 @@ func (m *RequestDeliverTx) GetTx() []byte { } type RequestEndBlock struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } -func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } -func (*RequestEndBlock) ProtoMessage() {} -func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{10} } +func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } +func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } +func (*RequestEndBlock) ProtoMessage() {} +func (*RequestEndBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{10} +} +func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestEndBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestEndBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestEndBlock.Merge(dst, src) +} +func (m *RequestEndBlock) XXX_Size() int { + return m.Size() +} +func (m *RequestEndBlock) XXX_DiscardUnknown() { + xxx_messageInfo_RequestEndBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestEndBlock proto.InternalMessageInfo func (m *RequestEndBlock) GetHeight() int64 { if m != nil { @@ -729,12 +1024,43 @@ func (m *RequestEndBlock) GetHeight() int64 { } type RequestCommit struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RequestCommit) Reset() { *m = RequestCommit{} } -func (m *RequestCommit) String() string { return proto.CompactTextString(m) } -func (*RequestCommit) ProtoMessage() {} -func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{11} } +func (m *RequestCommit) Reset() { *m = RequestCommit{} } +func (m *RequestCommit) String() string { return proto.CompactTextString(m) } +func (*RequestCommit) ProtoMessage() {} +func (*RequestCommit) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{11} +} +func (m *RequestCommit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestCommit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RequestCommit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestCommit.Merge(dst, src) +} +func (m *RequestCommit) XXX_Size() int { + return m.Size() +} +func (m *RequestCommit) XXX_DiscardUnknown() { + xxx_messageInfo_RequestCommit.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestCommit proto.InternalMessageInfo type Response struct { // Types that are valid to be assigned to Value: @@ -750,13 +1076,44 @@ type Response struct { // *Response_DeliverTx // *Response_EndBlock // *Response_Commit - Value isResponse_Value `protobuf_oneof:"value"` + Value isResponse_Value `protobuf_oneof:"value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{12} } +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{12} +} +func (m *Response) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Response.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Response.Merge(dst, src) +} +func (m *Response) XXX_Size() int { + return m.Size() +} +func (m *Response) XXX_DiscardUnknown() { + xxx_messageInfo_Response.DiscardUnknown(m) +} + +var xxx_messageInfo_Response proto.InternalMessageInfo type isResponse_Value interface { isResponse_Value() @@ -1105,62 +1462,62 @@ func _Response_OneofSizer(msg proto.Message) (n int) { switch x := m.Value.(type) { case *Response_Exception: s := proto.Size(x.Exception) - n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_Echo: s := proto.Size(x.Echo) - n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_Flush: s := proto.Size(x.Flush) - n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_Info: s := proto.Size(x.Info) - n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_SetOption: s := proto.Size(x.SetOption) - n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_InitChain: s := proto.Size(x.InitChain) - n += proto.SizeVarint(6<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_Query: s := proto.Size(x.Query) - n += proto.SizeVarint(7<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_BeginBlock: s := proto.Size(x.BeginBlock) - n += proto.SizeVarint(8<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_CheckTx: s := proto.Size(x.CheckTx) - n += proto.SizeVarint(9<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_DeliverTx: s := proto.Size(x.DeliverTx) - n += proto.SizeVarint(10<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_EndBlock: s := proto.Size(x.EndBlock) - n += proto.SizeVarint(11<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case *Response_Commit: s := proto.Size(x.Commit) - n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += 1 // tag and wire n += proto.SizeVarint(uint64(s)) n += s case nil: @@ -1172,13 +1529,44 @@ func _Response_OneofSizer(msg proto.Message) (n int) { // nondeterministic type ResponseException struct { - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseException) Reset() { *m = ResponseException{} } -func (m *ResponseException) String() string { return proto.CompactTextString(m) } -func (*ResponseException) ProtoMessage() {} -func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{13} } +func (m *ResponseException) Reset() { *m = ResponseException{} } +func (m *ResponseException) String() string { return proto.CompactTextString(m) } +func (*ResponseException) ProtoMessage() {} +func (*ResponseException) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{13} +} +func (m *ResponseException) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseException) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseException.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseException) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseException.Merge(dst, src) +} +func (m *ResponseException) XXX_Size() int { + return m.Size() +} +func (m *ResponseException) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseException.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseException proto.InternalMessageInfo func (m *ResponseException) GetError() string { if m != nil { @@ -1188,13 +1576,44 @@ func (m *ResponseException) GetError() string { } type ResponseEcho struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } -func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } -func (*ResponseEcho) ProtoMessage() {} -func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{14} } +func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } +func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } +func (*ResponseEcho) ProtoMessage() {} +func (*ResponseEcho) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{14} +} +func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseEcho) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseEcho.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseEcho) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseEcho.Merge(dst, src) +} +func (m *ResponseEcho) XXX_Size() int { + return m.Size() +} +func (m *ResponseEcho) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseEcho.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseEcho proto.InternalMessageInfo func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1204,24 +1623,86 @@ func (m *ResponseEcho) GetMessage() string { } type ResponseFlush struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } -func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } -func (*ResponseFlush) ProtoMessage() {} -func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{15} } +func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } +func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } +func (*ResponseFlush) ProtoMessage() {} +func (*ResponseFlush) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{15} +} +func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseFlush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseFlush.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseFlush) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseFlush.Merge(dst, src) +} +func (m *ResponseFlush) XXX_Size() int { + return m.Size() +} +func (m *ResponseFlush) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseFlush.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseFlush proto.InternalMessageInfo type ResponseInfo struct { - Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` + LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } -func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } -func (*ResponseInfo) ProtoMessage() {} -func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{16} } +func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } +func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } +func (*ResponseInfo) ProtoMessage() {} +func (*ResponseInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{16} +} +func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseInfo.Merge(dst, src) +} +func (m *ResponseInfo) XXX_Size() int { + return m.Size() +} +func (m *ResponseInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseInfo proto.InternalMessageInfo func (m *ResponseInfo) GetData() string { if m != nil { @@ -1255,14 +1736,45 @@ func (m *ResponseInfo) GetLastBlockAppHash() []byte { type ResponseSetOption struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // bytes data = 2; - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } -func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } -func (*ResponseSetOption) ProtoMessage() {} -func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{17} } +func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } +func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } +func (*ResponseSetOption) ProtoMessage() {} +func (*ResponseSetOption) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{17} +} +func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseSetOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseSetOption.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseSetOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseSetOption.Merge(dst, src) +} +func (m *ResponseSetOption) XXX_Size() int { + return m.Size() +} +func (m *ResponseSetOption) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseSetOption.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseSetOption proto.InternalMessageInfo func (m *ResponseSetOption) GetCode() uint32 { if m != nil { @@ -1286,14 +1798,45 @@ func (m *ResponseSetOption) GetInfo() string { } type ResponseInitChain struct { - ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` - Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators" json:"validators"` + ConsensusParams *ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams" json:"consensus_params,omitempty"` + Validators []ValidatorUpdate `protobuf:"bytes,2,rep,name=validators" json:"validators"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } -func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } -func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{18} } +func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } +func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } +func (*ResponseInitChain) ProtoMessage() {} +func (*ResponseInitChain) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{18} +} +func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseInitChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseInitChain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseInitChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseInitChain.Merge(dst, src) +} +func (m *ResponseInitChain) XXX_Size() int { + return m.Size() +} +func (m *ResponseInitChain) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseInitChain.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseInitChain proto.InternalMessageInfo func (m *ResponseInitChain) GetConsensusParams() *ConsensusParams { if m != nil { @@ -1312,19 +1855,50 @@ func (m *ResponseInitChain) GetValidators() []ValidatorUpdate { type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // bytes data = 2; // use "value" instead. - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,8,opt,name=proof,proto3" json:"proof,omitempty"` - Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + Proof []byte `protobuf:"bytes,8,opt,name=proof,proto3" json:"proof,omitempty"` + Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } -func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } -func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{19} } +func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } +func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } +func (*ResponseQuery) ProtoMessage() {} +func (*ResponseQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{19} +} +func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseQuery.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseQuery.Merge(dst, src) +} +func (m *ResponseQuery) XXX_Size() int { + return m.Size() +} +func (m *ResponseQuery) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseQuery proto.InternalMessageInfo func (m *ResponseQuery) GetCode() uint32 { if m != nil { @@ -1383,13 +1957,44 @@ func (m *ResponseQuery) GetHeight() int64 { } type ResponseBeginBlock struct { - Tags []common.KVPair `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` + Tags []common.KVPair `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } -func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseBeginBlock) ProtoMessage() {} -func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{20} } +func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } +func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } +func (*ResponseBeginBlock) ProtoMessage() {} +func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{20} +} +func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseBeginBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseBeginBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseBeginBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseBeginBlock.Merge(dst, src) +} +func (m *ResponseBeginBlock) XXX_Size() int { + return m.Size() +} +func (m *ResponseBeginBlock) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseBeginBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseBeginBlock proto.InternalMessageInfo func (m *ResponseBeginBlock) GetTags() []common.KVPair { if m != nil { @@ -1399,19 +2004,50 @@ func (m *ResponseBeginBlock) GetTags() []common.KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } -func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } -func (*ResponseCheckTx) ProtoMessage() {} -func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{21} } +func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } +func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } +func (*ResponseCheckTx) ProtoMessage() {} +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{21} +} +func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseCheckTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseCheckTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseCheckTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseCheckTx.Merge(dst, src) +} +func (m *ResponseCheckTx) XXX_Size() int { + return m.Size() +} +func (m *ResponseCheckTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseCheckTx.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseCheckTx proto.InternalMessageInfo func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { @@ -1463,19 +2099,50 @@ func (m *ResponseCheckTx) GetTags() []common.KVPair { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + GasWanted int64 `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + GasUsed int64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + Tags []common.KVPair `protobuf:"bytes,7,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } -func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } -func (*ResponseDeliverTx) ProtoMessage() {} -func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{22} } +func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } +func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } +func (*ResponseDeliverTx) ProtoMessage() {} +func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{22} +} +func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseDeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseDeliverTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseDeliverTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseDeliverTx.Merge(dst, src) +} +func (m *ResponseDeliverTx) XXX_Size() int { + return m.Size() +} +func (m *ResponseDeliverTx) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseDeliverTx.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseDeliverTx proto.InternalMessageInfo func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { @@ -1530,12 +2197,43 @@ type ResponseEndBlock struct { ValidatorUpdates []ValidatorUpdate `protobuf:"bytes,1,rep,name=validator_updates,json=validatorUpdates" json:"validator_updates"` ConsensusParamUpdates *ConsensusParams `protobuf:"bytes,2,opt,name=consensus_param_updates,json=consensusParamUpdates" json:"consensus_param_updates,omitempty"` Tags []common.KVPair `protobuf:"bytes,3,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } -func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } -func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{23} } +func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } +func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } +func (*ResponseEndBlock) ProtoMessage() {} +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{23} +} +func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseEndBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseEndBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseEndBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseEndBlock.Merge(dst, src) +} +func (m *ResponseEndBlock) XXX_Size() int { + return m.Size() +} +func (m *ResponseEndBlock) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseEndBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseEndBlock proto.InternalMessageInfo func (m *ResponseEndBlock) GetValidatorUpdates() []ValidatorUpdate { if m != nil { @@ -1560,13 +2258,44 @@ func (m *ResponseEndBlock) GetTags() []common.KVPair { type ResponseCommit struct { // reserve 1 - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } -func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } -func (*ResponseCommit) ProtoMessage() {} -func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{24} } +func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } +func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } +func (*ResponseCommit) ProtoMessage() {} +func (*ResponseCommit) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{24} +} +func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResponseCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResponseCommit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResponseCommit) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponseCommit.Merge(dst, src) +} +func (m *ResponseCommit) XXX_Size() int { + return m.Size() +} +func (m *ResponseCommit) XXX_DiscardUnknown() { + xxx_messageInfo_ResponseCommit.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponseCommit proto.InternalMessageInfo func (m *ResponseCommit) GetData() []byte { if m != nil { @@ -1578,15 +2307,46 @@ func (m *ResponseCommit) GetData() []byte { // ConsensusParams contains all consensus-relevant parameters // that can be adjusted by the abci app type ConsensusParams struct { - BlockSize *BlockSize `protobuf:"bytes,1,opt,name=block_size,json=blockSize" json:"block_size,omitempty"` - TxSize *TxSize `protobuf:"bytes,2,opt,name=tx_size,json=txSize" json:"tx_size,omitempty"` - BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=block_gossip,json=blockGossip" json:"block_gossip,omitempty"` + BlockSize *BlockSize `protobuf:"bytes,1,opt,name=block_size,json=blockSize" json:"block_size,omitempty"` + TxSize *TxSize `protobuf:"bytes,2,opt,name=tx_size,json=txSize" json:"tx_size,omitempty"` + BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=block_gossip,json=blockGossip" json:"block_gossip,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{25} } +func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } +func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } +func (*ConsensusParams) ProtoMessage() {} +func (*ConsensusParams) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{25} +} +func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ConsensusParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusParams.Merge(dst, src) +} +func (m *ConsensusParams) XXX_Size() int { + return m.Size() +} +func (m *ConsensusParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusParams.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo func (m *ConsensusParams) GetBlockSize() *BlockSize { if m != nil { @@ -1611,15 +2371,46 @@ func (m *ConsensusParams) GetBlockGossip() *BlockGossip { // BlockSize contains limits on the block size. type BlockSize struct { - MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - MaxTxs int32 `protobuf:"varint,2,opt,name=max_txs,json=maxTxs,proto3" json:"max_txs,omitempty"` - MaxGas int64 `protobuf:"varint,3,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` + MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + MaxTxs int32 `protobuf:"varint,2,opt,name=max_txs,json=maxTxs,proto3" json:"max_txs,omitempty"` + MaxGas int64 `protobuf:"varint,3,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockSize) Reset() { *m = BlockSize{} } -func (m *BlockSize) String() string { return proto.CompactTextString(m) } -func (*BlockSize) ProtoMessage() {} -func (*BlockSize) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{26} } +func (m *BlockSize) Reset() { *m = BlockSize{} } +func (m *BlockSize) String() string { return proto.CompactTextString(m) } +func (*BlockSize) ProtoMessage() {} +func (*BlockSize) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{26} +} +func (m *BlockSize) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockSize.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockSize) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockSize.Merge(dst, src) +} +func (m *BlockSize) XXX_Size() int { + return m.Size() +} +func (m *BlockSize) XXX_DiscardUnknown() { + xxx_messageInfo_BlockSize.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockSize proto.InternalMessageInfo func (m *BlockSize) GetMaxBytes() int32 { if m != nil { @@ -1644,14 +2435,45 @@ func (m *BlockSize) GetMaxGas() int64 { // TxSize contains limits on the tx size. type TxSize struct { - MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` + MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *TxSize) Reset() { *m = TxSize{} } -func (m *TxSize) String() string { return proto.CompactTextString(m) } -func (*TxSize) ProtoMessage() {} -func (*TxSize) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } +func (m *TxSize) Reset() { *m = TxSize{} } +func (m *TxSize) String() string { return proto.CompactTextString(m) } +func (*TxSize) ProtoMessage() {} +func (*TxSize) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{27} +} +func (m *TxSize) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxSize.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *TxSize) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxSize.Merge(dst, src) +} +func (m *TxSize) XXX_Size() int { + return m.Size() +} +func (m *TxSize) XXX_DiscardUnknown() { + xxx_messageInfo_TxSize.DiscardUnknown(m) +} + +var xxx_messageInfo_TxSize proto.InternalMessageInfo func (m *TxSize) GetMaxBytes() int32 { if m != nil { @@ -1671,13 +2493,44 @@ func (m *TxSize) GetMaxGas() int64 { // elements of how blocks are gossiped type BlockGossip struct { // Note: must not be 0 - BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=block_part_size_bytes,json=blockPartSizeBytes,proto3" json:"block_part_size_bytes,omitempty"` + BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=block_part_size_bytes,json=blockPartSizeBytes,proto3" json:"block_part_size_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockGossip) Reset() { *m = BlockGossip{} } -func (m *BlockGossip) String() string { return proto.CompactTextString(m) } -func (*BlockGossip) ProtoMessage() {} -func (*BlockGossip) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{28} } +func (m *BlockGossip) Reset() { *m = BlockGossip{} } +func (m *BlockGossip) String() string { return proto.CompactTextString(m) } +func (*BlockGossip) ProtoMessage() {} +func (*BlockGossip) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{28} +} +func (m *BlockGossip) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockGossip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockGossip.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockGossip) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockGossip.Merge(dst, src) +} +func (m *BlockGossip) XXX_Size() int { + return m.Size() +} +func (m *BlockGossip) XXX_DiscardUnknown() { + xxx_messageInfo_BlockGossip.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockGossip proto.InternalMessageInfo func (m *BlockGossip) GetBlockPartSizeBytes() int32 { if m != nil { @@ -1687,13 +2540,44 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { } type LastCommitInfo struct { - CommitVotes []VoteInfo `protobuf:"bytes,1,rep,name=commit_votes,json=commitVotes" json:"commit_votes"` + CommitVotes []VoteInfo `protobuf:"bytes,1,rep,name=commit_votes,json=commitVotes" json:"commit_votes"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } -func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } -func (*LastCommitInfo) ProtoMessage() {} -func (*LastCommitInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } +func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } +func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } +func (*LastCommitInfo) ProtoMessage() {} +func (*LastCommitInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{29} +} +func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LastCommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LastCommitInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *LastCommitInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_LastCommitInfo.Merge(dst, src) +} +func (m *LastCommitInfo) XXX_Size() int { + return m.Size() +} +func (m *LastCommitInfo) XXX_DiscardUnknown() { + xxx_messageInfo_LastCommitInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo func (m *LastCommitInfo) GetCommitVotes() []VoteInfo { if m != nil { @@ -1721,14 +2605,45 @@ type Header struct { AppHash []byte `protobuf:"bytes,12,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` LastResultsHash []byte `protobuf:"bytes,13,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` // consensus info - EvidenceHash []byte `protobuf:"bytes,14,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,15,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + EvidenceHash []byte `protobuf:"bytes,14,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` + ProposerAddress []byte `protobuf:"bytes,15,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{30} } +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{30} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(dst, src) +} +func (m *Header) XXX_Size() int { + return m.Size() +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo func (m *Header) GetChainID() string { if m != nil { @@ -1836,14 +2751,45 @@ func (m *Header) GetProposerAddress() []byte { } type BlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader" json:"parts_header"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + PartsHeader PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=partsHeader" json:"parts_header"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockID) Reset() { *m = BlockID{} } -func (m *BlockID) String() string { return proto.CompactTextString(m) } -func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{31} } +func (m *BlockID) Reset() { *m = BlockID{} } +func (m *BlockID) String() string { return proto.CompactTextString(m) } +func (*BlockID) ProtoMessage() {} +func (*BlockID) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{31} +} +func (m *BlockID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockID) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockID.Merge(dst, src) +} +func (m *BlockID) XXX_Size() int { + return m.Size() +} +func (m *BlockID) XXX_DiscardUnknown() { + xxx_messageInfo_BlockID.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockID proto.InternalMessageInfo func (m *BlockID) GetHash() []byte { if m != nil { @@ -1860,14 +2806,45 @@ func (m *BlockID) GetPartsHeader() PartSetHeader { } type PartSetHeader struct { - Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } -func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } -func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{32} } +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{32} +} +func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *PartSetHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartSetHeader.Merge(dst, src) +} +func (m *PartSetHeader) XXX_Size() int { + return m.Size() +} +func (m *PartSetHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PartSetHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo func (m *PartSetHeader) GetTotal() int32 { if m != nil { @@ -1885,14 +2862,45 @@ func (m *PartSetHeader) GetHash() []byte { // Validator type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{33} } +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{33} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(dst, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo func (m *Validator) GetAddress() []byte { if m != nil { @@ -1910,14 +2918,45 @@ func (m *Validator) GetPower() int64 { // ValidatorUpdate type ValidatorUpdate struct { - PubKey PubKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey" json:"pub_key"` - Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` + PubKey PubKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey" json:"pub_key"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } -func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } -func (*ValidatorUpdate) ProtoMessage() {} -func (*ValidatorUpdate) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{34} } +func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } +func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } +func (*ValidatorUpdate) ProtoMessage() {} +func (*ValidatorUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{34} +} +func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorUpdate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ValidatorUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorUpdate.Merge(dst, src) +} +func (m *ValidatorUpdate) XXX_Size() int { + return m.Size() +} +func (m *ValidatorUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorUpdate proto.InternalMessageInfo func (m *ValidatorUpdate) GetPubKey() PubKey { if m != nil { @@ -1935,15 +2974,46 @@ func (m *ValidatorUpdate) GetPower() int64 { // VoteInfo type VoteInfo struct { - Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` - SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` - CommitRound int64 `protobuf:"varint,3,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` + Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` + SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` + CommitRound int64 `protobuf:"varint,3,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *VoteInfo) Reset() { *m = VoteInfo{} } -func (m *VoteInfo) String() string { return proto.CompactTextString(m) } -func (*VoteInfo) ProtoMessage() {} -func (*VoteInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{35} } +func (m *VoteInfo) Reset() { *m = VoteInfo{} } +func (m *VoteInfo) String() string { return proto.CompactTextString(m) } +func (*VoteInfo) ProtoMessage() {} +func (*VoteInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{35} +} +func (m *VoteInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *VoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_VoteInfo.Merge(dst, src) +} +func (m *VoteInfo) XXX_Size() int { + return m.Size() +} +func (m *VoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_VoteInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_VoteInfo proto.InternalMessageInfo func (m *VoteInfo) GetValidator() Validator { if m != nil { @@ -1967,14 +3037,45 @@ func (m *VoteInfo) GetCommitRound() int64 { } type PubKey struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *PubKey) Reset() { *m = PubKey{} } -func (m *PubKey) String() string { return proto.CompactTextString(m) } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{36} } +func (m *PubKey) Reset() { *m = PubKey{} } +func (m *PubKey) String() string { return proto.CompactTextString(m) } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{36} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(dst, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo func (m *PubKey) GetType() string { if m != nil { @@ -1991,17 +3092,48 @@ func (m *PubKey) GetData() []byte { } type Evidence struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Validator Validator `protobuf:"bytes,2,opt,name=validator" json:"validator"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,4,opt,name=time,stdtime" json:"time"` - TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Validator Validator `protobuf:"bytes,2,opt,name=validator" json:"validator"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,4,opt,name=time,stdtime" json:"time"` + TotalVotingPower int64 `protobuf:"varint,5,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Evidence) Reset() { *m = Evidence{} } -func (m *Evidence) String() string { return proto.CompactTextString(m) } -func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{37} } +func (m *Evidence) Reset() { *m = Evidence{} } +func (m *Evidence) String() string { return proto.CompactTextString(m) } +func (*Evidence) ProtoMessage() {} +func (*Evidence) Descriptor() ([]byte, []int) { + return fileDescriptor_types_56d74249e896ebc1, []int{37} +} +func (m *Evidence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Evidence) XXX_Merge(src proto.Message) { + xxx_messageInfo_Evidence.Merge(dst, src) +} +func (m *Evidence) XXX_Size() int { + return m.Size() +} +func (m *Evidence) XXX_DiscardUnknown() { + xxx_messageInfo_Evidence.DiscardUnknown(m) +} + +var xxx_messageInfo_Evidence proto.InternalMessageInfo func (m *Evidence) GetType() string { if m != nil { @@ -2144,6 +3276,9 @@ func (this *Request) Equal(that interface{}) bool { } else if !this.Value.Equal(that1.Value) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Request_Echo) Equal(that interface{}) bool { @@ -2432,6 +3567,9 @@ func (this *RequestEcho) Equal(that interface{}) bool { if this.Message != that1.Message { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestFlush) Equal(that interface{}) bool { @@ -2453,6 +3591,9 @@ func (this *RequestFlush) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestInfo) Equal(that interface{}) bool { @@ -2477,6 +3618,9 @@ func (this *RequestInfo) Equal(that interface{}) bool { if this.Version != that1.Version { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestSetOption) Equal(that interface{}) bool { @@ -2504,6 +3648,9 @@ func (this *RequestSetOption) Equal(that interface{}) bool { if this.Value != that1.Value { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestInitChain) Equal(that interface{}) bool { @@ -2545,6 +3692,9 @@ func (this *RequestInitChain) Equal(that interface{}) bool { if !bytes.Equal(this.AppStateBytes, that1.AppStateBytes) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestQuery) Equal(that interface{}) bool { @@ -2578,6 +3728,9 @@ func (this *RequestQuery) Equal(that interface{}) bool { if this.Prove != that1.Prove { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestBeginBlock) Equal(that interface{}) bool { @@ -2616,6 +3769,9 @@ func (this *RequestBeginBlock) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestCheckTx) Equal(that interface{}) bool { @@ -2640,6 +3796,9 @@ func (this *RequestCheckTx) Equal(that interface{}) bool { if !bytes.Equal(this.Tx, that1.Tx) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestDeliverTx) Equal(that interface{}) bool { @@ -2664,6 +3823,9 @@ func (this *RequestDeliverTx) Equal(that interface{}) bool { if !bytes.Equal(this.Tx, that1.Tx) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestEndBlock) Equal(that interface{}) bool { @@ -2688,6 +3850,9 @@ func (this *RequestEndBlock) Equal(that interface{}) bool { if this.Height != that1.Height { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *RequestCommit) Equal(that interface{}) bool { @@ -2709,6 +3874,9 @@ func (this *RequestCommit) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Response) Equal(that interface{}) bool { @@ -2739,6 +3907,9 @@ func (this *Response) Equal(that interface{}) bool { } else if !this.Value.Equal(that1.Value) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Response_Exception) Equal(that interface{}) bool { @@ -3051,6 +4222,9 @@ func (this *ResponseException) Equal(that interface{}) bool { if this.Error != that1.Error { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseEcho) Equal(that interface{}) bool { @@ -3075,6 +4249,9 @@ func (this *ResponseEcho) Equal(that interface{}) bool { if this.Message != that1.Message { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseFlush) Equal(that interface{}) bool { @@ -3096,6 +4273,9 @@ func (this *ResponseFlush) Equal(that interface{}) bool { } else if this == nil { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseInfo) Equal(that interface{}) bool { @@ -3129,6 +4309,9 @@ func (this *ResponseInfo) Equal(that interface{}) bool { if !bytes.Equal(this.LastBlockAppHash, that1.LastBlockAppHash) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseSetOption) Equal(that interface{}) bool { @@ -3159,6 +4342,9 @@ func (this *ResponseSetOption) Equal(that interface{}) bool { if this.Info != that1.Info { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseInitChain) Equal(that interface{}) bool { @@ -3191,6 +4377,9 @@ func (this *ResponseInitChain) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseQuery) Equal(that interface{}) bool { @@ -3236,6 +4425,9 @@ func (this *ResponseQuery) Equal(that interface{}) bool { if this.Height != that1.Height { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseBeginBlock) Equal(that interface{}) bool { @@ -3265,6 +4457,9 @@ func (this *ResponseBeginBlock) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseCheckTx) Equal(that interface{}) bool { @@ -3312,6 +4507,9 @@ func (this *ResponseCheckTx) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseDeliverTx) Equal(that interface{}) bool { @@ -3359,6 +4557,9 @@ func (this *ResponseDeliverTx) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseEndBlock) Equal(that interface{}) bool { @@ -3399,6 +4600,9 @@ func (this *ResponseEndBlock) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ResponseCommit) Equal(that interface{}) bool { @@ -3423,6 +4627,9 @@ func (this *ResponseCommit) Equal(that interface{}) bool { if !bytes.Equal(this.Data, that1.Data) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ConsensusParams) Equal(that interface{}) bool { @@ -3453,6 +4660,9 @@ func (this *ConsensusParams) Equal(that interface{}) bool { if !this.BlockGossip.Equal(that1.BlockGossip) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *BlockSize) Equal(that interface{}) bool { @@ -3483,6 +4693,9 @@ func (this *BlockSize) Equal(that interface{}) bool { if this.MaxGas != that1.MaxGas { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *TxSize) Equal(that interface{}) bool { @@ -3510,6 +4723,9 @@ func (this *TxSize) Equal(that interface{}) bool { if this.MaxGas != that1.MaxGas { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *BlockGossip) Equal(that interface{}) bool { @@ -3534,6 +4750,9 @@ func (this *BlockGossip) Equal(that interface{}) bool { if this.BlockPartSizeBytes != that1.BlockPartSizeBytes { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *LastCommitInfo) Equal(that interface{}) bool { @@ -3563,6 +4782,9 @@ func (this *LastCommitInfo) Equal(that interface{}) bool { return false } } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Header) Equal(that interface{}) bool { @@ -3629,6 +4851,9 @@ func (this *Header) Equal(that interface{}) bool { if !bytes.Equal(this.ProposerAddress, that1.ProposerAddress) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *BlockID) Equal(that interface{}) bool { @@ -3656,6 +4881,9 @@ func (this *BlockID) Equal(that interface{}) bool { if !this.PartsHeader.Equal(&that1.PartsHeader) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *PartSetHeader) Equal(that interface{}) bool { @@ -3683,6 +4911,9 @@ func (this *PartSetHeader) Equal(that interface{}) bool { if !bytes.Equal(this.Hash, that1.Hash) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Validator) Equal(that interface{}) bool { @@ -3710,6 +4941,9 @@ func (this *Validator) Equal(that interface{}) bool { if this.Power != that1.Power { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *ValidatorUpdate) Equal(that interface{}) bool { @@ -3737,6 +4971,9 @@ func (this *ValidatorUpdate) Equal(that interface{}) bool { if this.Power != that1.Power { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *VoteInfo) Equal(that interface{}) bool { @@ -3767,6 +5004,9 @@ func (this *VoteInfo) Equal(that interface{}) bool { if this.CommitRound != that1.CommitRound { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *PubKey) Equal(that interface{}) bool { @@ -3794,6 +5034,9 @@ func (this *PubKey) Equal(that interface{}) bool { if !bytes.Equal(this.Data, that1.Data) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (this *Evidence) Equal(that interface{}) bool { @@ -3830,6 +5073,9 @@ func (this *Evidence) Equal(that interface{}) bool { if this.TotalVotingPower != that1.TotalVotingPower { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } @@ -3868,7 +5114,7 @@ func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { out := new(ResponseEcho) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, opts...) if err != nil { return nil, err } @@ -3877,7 +5123,7 @@ func (c *aBCIApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { out := new(ResponseFlush) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, opts...) if err != nil { return nil, err } @@ -3886,7 +5132,7 @@ func (c *aBCIApplicationClient) Flush(ctx context.Context, in *RequestFlush, opt func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { out := new(ResponseInfo) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, opts...) if err != nil { return nil, err } @@ -3895,7 +5141,7 @@ func (c *aBCIApplicationClient) Info(ctx context.Context, in *RequestInfo, opts func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) { out := new(ResponseSetOption) - err := grpc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, opts...) if err != nil { return nil, err } @@ -3904,7 +5150,7 @@ func (c *aBCIApplicationClient) SetOption(ctx context.Context, in *RequestSetOpt func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { out := new(ResponseDeliverTx) - err := grpc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, opts...) if err != nil { return nil, err } @@ -3913,7 +5159,7 @@ func (c *aBCIApplicationClient) DeliverTx(ctx context.Context, in *RequestDelive func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { out := new(ResponseCheckTx) - err := grpc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, opts...) if err != nil { return nil, err } @@ -3922,7 +5168,7 @@ func (c *aBCIApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { out := new(ResponseQuery) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, opts...) if err != nil { return nil, err } @@ -3931,7 +5177,7 @@ func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opt func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, opts...) if err != nil { return nil, err } @@ -3940,7 +5186,7 @@ func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, o func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { out := new(ResponseInitChain) - err := grpc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, opts...) if err != nil { return nil, err } @@ -3949,7 +5195,7 @@ func (c *aBCIApplicationClient) InitChain(ctx context.Context, in *RequestInitCh func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) { out := new(ResponseBeginBlock) - err := grpc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, opts...) if err != nil { return nil, err } @@ -3958,15 +5204,14 @@ func (c *aBCIApplicationClient) BeginBlock(ctx context.Context, in *RequestBegin func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { out := new(ResponseEndBlock) - err := grpc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for ABCIApplication service - +// ABCIApplicationServer is the server API for ABCIApplication service. type ABCIApplicationServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) @@ -4258,6 +5503,9 @@ func (m *Request) MarshalTo(dAtA []byte) (int, error) { } i += nn1 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4438,6 +5686,9 @@ func (m *RequestEcho) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4456,6 +5707,9 @@ func (m *RequestFlush) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4480,6 +5734,9 @@ func (m *RequestInfo) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) i += copy(dAtA[i:], m.Version) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4510,6 +5767,9 @@ func (m *RequestSetOption) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4530,8 +5790,8 @@ func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0xa i++ - i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) - n13, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) + n13, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -4570,6 +5830,9 @@ func (m *RequestInitChain) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.AppStateBytes))) i += copy(dAtA[i:], m.AppStateBytes) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4615,6 +5878,9 @@ func (m *RequestQuery) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4667,6 +5933,9 @@ func (m *RequestBeginBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4691,6 +5960,9 @@ func (m *RequestCheckTx) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) i += copy(dAtA[i:], m.Tx) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4715,6 +5987,9 @@ func (m *RequestDeliverTx) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Tx))) i += copy(dAtA[i:], m.Tx) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4738,6 +6013,9 @@ func (m *RequestEndBlock) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Height)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4756,6 +6034,9 @@ func (m *RequestCommit) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4781,6 +6062,9 @@ func (m *Response) MarshalTo(dAtA []byte) (int, error) { } i += nn17 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4973,6 +6257,9 @@ func (m *ResponseException) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -4997,6 +6284,9 @@ func (m *ResponseEcho) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5015,6 +6305,9 @@ func (m *ResponseFlush) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5056,6 +6349,9 @@ func (m *ResponseInfo) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.LastBlockAppHash))) i += copy(dAtA[i:], m.LastBlockAppHash) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5091,6 +6387,9 @@ func (m *ResponseSetOption) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Info))) i += copy(dAtA[i:], m.Info) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5131,6 +6430,9 @@ func (m *ResponseInitChain) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5194,6 +6496,9 @@ func (m *ResponseQuery) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Height)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5224,6 +6529,9 @@ func (m *ResponseBeginBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5287,6 +6595,9 @@ func (m *ResponseCheckTx) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5350,6 +6661,9 @@ func (m *ResponseDeliverTx) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5402,6 +6716,9 @@ func (m *ResponseEndBlock) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5426,6 +6743,9 @@ func (m *ResponseCommit) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) i += copy(dAtA[i:], m.Data) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5474,6 +6794,9 @@ func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { } i += n34 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5507,6 +6830,9 @@ func (m *BlockSize) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5535,6 +6861,9 @@ func (m *TxSize) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5558,6 +6887,9 @@ func (m *BlockGossip) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.BlockPartSizeBytes)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5588,6 +6920,9 @@ func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5619,8 +6954,8 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x1a i++ - i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) - n35, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) + n35, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -5697,6 +7032,9 @@ func (m *Header) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) i += copy(dAtA[i:], m.ProposerAddress) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5729,6 +7067,9 @@ func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n37 + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5758,6 +7099,9 @@ func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) i += copy(dAtA[i:], m.Hash) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5787,6 +7131,9 @@ func (m *Validator) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Power)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5818,6 +7165,9 @@ func (m *ValidatorUpdate) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.Power)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5859,6 +7209,9 @@ func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.CommitRound)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5889,6 +7242,9 @@ func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) i += copy(dAtA[i:], m.Data) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5928,8 +7284,8 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x22 i++ - i = encodeVarintTypes(dAtA, i, uint64(types1.SizeOfStdTime(m.Time))) - n41, err := types1.StdTimeMarshalTo(m.Time, dAtA[i:]) + i = encodeVarintTypes(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Time))) + n41, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i:]) if err != nil { return 0, err } @@ -5939,6 +7295,9 @@ func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.TotalVotingPower)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -5979,6 +7338,7 @@ func NewPopulatedRequest(r randyTypes, easy bool) *Request { this.Value = NewPopulatedRequest_DeliverTx(r, easy) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 20) } return this } @@ -6042,6 +7402,7 @@ func NewPopulatedRequestEcho(r randyTypes, easy bool) *RequestEcho { this := &RequestEcho{} this.Message = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6049,6 +7410,7 @@ func NewPopulatedRequestEcho(r randyTypes, easy bool) *RequestEcho { func NewPopulatedRequestFlush(r randyTypes, easy bool) *RequestFlush { this := &RequestFlush{} if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -6057,6 +7419,7 @@ func NewPopulatedRequestInfo(r randyTypes, easy bool) *RequestInfo { this := &RequestInfo{} this.Version = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6066,13 +7429,14 @@ func NewPopulatedRequestSetOption(r randyTypes, easy bool) *RequestSetOption { this.Key = string(randStringTypes(r)) this.Value = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { this := &RequestInitChain{} - v1 := types1.NewPopulatedStdTime(r, easy) + v1 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) this.Time = *v1 this.ChainId = string(randStringTypes(r)) if r.Intn(10) != 0 { @@ -6092,6 +7456,7 @@ func NewPopulatedRequestInitChain(r randyTypes, easy bool) *RequestInitChain { this.AppStateBytes[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 6) } return this } @@ -6110,6 +7475,7 @@ func NewPopulatedRequestQuery(r randyTypes, easy bool) *RequestQuery { } this.Prove = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -6134,6 +7500,7 @@ func NewPopulatedRequestBeginBlock(r randyTypes, easy bool) *RequestBeginBlock { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -6146,6 +7513,7 @@ func NewPopulatedRequestCheckTx(r randyTypes, easy bool) *RequestCheckTx { this.Tx[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6158,6 +7526,7 @@ func NewPopulatedRequestDeliverTx(r randyTypes, easy bool) *RequestDeliverTx { this.Tx[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6169,6 +7538,7 @@ func NewPopulatedRequestEndBlock(r randyTypes, easy bool) *RequestEndBlock { this.Height *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6176,6 +7546,7 @@ func NewPopulatedRequestEndBlock(r randyTypes, easy bool) *RequestEndBlock { func NewPopulatedRequestCommit(r randyTypes, easy bool) *RequestCommit { this := &RequestCommit{} if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -6210,6 +7581,7 @@ func NewPopulatedResponse(r randyTypes, easy bool) *Response { this.Value = NewPopulatedResponse_Commit(r, easy) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 13) } return this } @@ -6278,6 +7650,7 @@ func NewPopulatedResponseException(r randyTypes, easy bool) *ResponseException { this := &ResponseException{} this.Error = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6286,6 +7659,7 @@ func NewPopulatedResponseEcho(r randyTypes, easy bool) *ResponseEcho { this := &ResponseEcho{} this.Message = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6293,6 +7667,7 @@ func NewPopulatedResponseEcho(r randyTypes, easy bool) *ResponseEcho { func NewPopulatedResponseFlush(r randyTypes, easy bool) *ResponseFlush { this := &ResponseFlush{} if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 1) } return this } @@ -6311,6 +7686,7 @@ func NewPopulatedResponseInfo(r randyTypes, easy bool) *ResponseInfo { this.LastBlockAppHash[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -6321,6 +7697,7 @@ func NewPopulatedResponseSetOption(r randyTypes, easy bool) *ResponseSetOption { this.Log = string(randStringTypes(r)) this.Info = string(randStringTypes(r)) if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 5) } return this } @@ -6339,6 +7716,7 @@ func NewPopulatedResponseInitChain(r randyTypes, easy bool) *ResponseInitChain { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6372,6 +7750,7 @@ func NewPopulatedResponseQuery(r randyTypes, easy bool) *ResponseQuery { this.Height *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 10) } return this } @@ -6387,6 +7766,7 @@ func NewPopulatedResponseBeginBlock(r randyTypes, easy bool) *ResponseBeginBlock } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6418,6 +7798,7 @@ func NewPopulatedResponseCheckTx(r randyTypes, easy bool) *ResponseCheckTx { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 8) } return this } @@ -6449,6 +7830,7 @@ func NewPopulatedResponseDeliverTx(r randyTypes, easy bool) *ResponseDeliverTx { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 8) } return this } @@ -6475,6 +7857,7 @@ func NewPopulatedResponseEndBlock(r randyTypes, easy bool) *ResponseEndBlock { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -6487,6 +7870,7 @@ func NewPopulatedResponseCommit(r randyTypes, easy bool) *ResponseCommit { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6503,6 +7887,7 @@ func NewPopulatedConsensusParams(r randyTypes, easy bool) *ConsensusParams { this.BlockGossip = NewPopulatedBlockGossip(r, easy) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -6522,6 +7907,7 @@ func NewPopulatedBlockSize(r randyTypes, easy bool) *BlockSize { this.MaxGas *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -6537,6 +7923,7 @@ func NewPopulatedTxSize(r randyTypes, easy bool) *TxSize { this.MaxGas *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6548,6 +7935,7 @@ func NewPopulatedBlockGossip(r randyTypes, easy bool) *BlockGossip { this.BlockPartSizeBytes *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6563,6 +7951,7 @@ func NewPopulatedLastCommitInfo(r randyTypes, easy bool) *LastCommitInfo { } } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 2) } return this } @@ -6574,7 +7963,7 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { if r.Intn(2) == 0 { this.Height *= -1 } - v34 := types1.NewPopulatedStdTime(r, easy) + v34 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) this.Time = *v34 this.NumTxs = int64(r.Int63()) if r.Intn(2) == 0 { @@ -6632,6 +8021,7 @@ func NewPopulatedHeader(r randyTypes, easy bool) *Header { this.ProposerAddress[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 16) } return this } @@ -6646,6 +8036,7 @@ func NewPopulatedBlockID(r randyTypes, easy bool) *BlockID { v46 := NewPopulatedPartSetHeader(r, easy) this.PartsHeader = *v46 if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6662,6 +8053,7 @@ func NewPopulatedPartSetHeader(r randyTypes, easy bool) *PartSetHeader { this.Hash[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6678,6 +8070,7 @@ func NewPopulatedValidator(r randyTypes, easy bool) *Validator { this.Power *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -6691,6 +8084,7 @@ func NewPopulatedValidatorUpdate(r randyTypes, easy bool) *ValidatorUpdate { this.Power *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6705,6 +8099,7 @@ func NewPopulatedVoteInfo(r randyTypes, easy bool) *VoteInfo { this.CommitRound *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 4) } return this } @@ -6718,6 +8113,7 @@ func NewPopulatedPubKey(r randyTypes, easy bool) *PubKey { this.Data[i] = byte(r.Intn(256)) } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -6731,13 +8127,14 @@ func NewPopulatedEvidence(r randyTypes, easy bool) *Evidence { if r.Intn(2) == 0 { this.Height *= -1 } - v53 := types1.NewPopulatedStdTime(r, easy) + v53 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy) this.Time = *v53 this.TotalVotingPower = int64(r.Int63()) if r.Intn(2) == 0 { this.TotalVotingPower *= -1 } if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedTypes(r, 6) } return this } @@ -6820,6 +8217,9 @@ func (m *Request) Size() (n int) { if m.Value != nil { n += m.Value.Size() } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -6929,12 +8329,18 @@ func (m *RequestEcho) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RequestFlush) Size() (n int) { var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -6945,6 +8351,9 @@ func (m *RequestInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -6959,13 +8368,16 @@ func (m *RequestSetOption) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RequestInitChain) Size() (n int) { var l int _ = l - l = types1.SizeOfStdTime(m.Time) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) l = len(m.ChainId) if l > 0 { @@ -6985,6 +8397,9 @@ func (m *RequestInitChain) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7005,6 +8420,9 @@ func (m *RequestQuery) Size() (n int) { if m.Prove { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7025,6 +8443,9 @@ func (m *RequestBeginBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7035,6 +8456,9 @@ func (m *RequestCheckTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7045,6 +8469,9 @@ func (m *RequestDeliverTx) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7054,12 +8481,18 @@ func (m *RequestEndBlock) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RequestCommit) Size() (n int) { var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7069,6 +8502,9 @@ func (m *Response) Size() (n int) { if m.Value != nil { n += m.Value.Size() } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7187,6 +8623,9 @@ func (m *ResponseException) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7197,12 +8636,18 @@ func (m *ResponseEcho) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResponseFlush) Size() (n int) { var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7224,6 +8669,9 @@ func (m *ResponseInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7241,6 +8689,9 @@ func (m *ResponseSetOption) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7257,6 +8708,9 @@ func (m *ResponseInitChain) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7292,6 +8746,9 @@ func (m *ResponseQuery) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7304,6 +8761,9 @@ func (m *ResponseBeginBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7337,6 +8797,9 @@ func (m *ResponseCheckTx) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7370,6 +8833,9 @@ func (m *ResponseDeliverTx) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7392,6 +8858,9 @@ func (m *ResponseEndBlock) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7402,6 +8871,9 @@ func (m *ResponseCommit) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7420,6 +8892,9 @@ func (m *ConsensusParams) Size() (n int) { l = m.BlockGossip.Size() n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7435,6 +8910,9 @@ func (m *BlockSize) Size() (n int) { if m.MaxGas != 0 { n += 1 + sovTypes(uint64(m.MaxGas)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7447,6 +8925,9 @@ func (m *TxSize) Size() (n int) { if m.MaxGas != 0 { n += 1 + sovTypes(uint64(m.MaxGas)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7456,6 +8937,9 @@ func (m *BlockGossip) Size() (n int) { if m.BlockPartSizeBytes != 0 { n += 1 + sovTypes(uint64(m.BlockPartSizeBytes)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7468,6 +8952,9 @@ func (m *LastCommitInfo) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7481,7 +8968,7 @@ func (m *Header) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - l = types1.SizeOfStdTime(m.Time) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) if m.NumTxs != 0 { n += 1 + sovTypes(uint64(m.NumTxs)) @@ -7527,6 +9014,9 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7539,6 +9029,9 @@ func (m *BlockID) Size() (n int) { } l = m.PartsHeader.Size() n += 1 + l + sovTypes(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7552,6 +9045,9 @@ func (m *PartSetHeader) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7565,6 +9061,9 @@ func (m *Validator) Size() (n int) { if m.Power != 0 { n += 1 + sovTypes(uint64(m.Power)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7576,6 +9075,9 @@ func (m *ValidatorUpdate) Size() (n int) { if m.Power != 0 { n += 1 + sovTypes(uint64(m.Power)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7590,6 +9092,9 @@ func (m *VoteInfo) Size() (n int) { if m.CommitRound != 0 { n += 1 + sovTypes(uint64(m.CommitRound)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7604,6 +9109,9 @@ func (m *PubKey) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -7619,11 +9127,14 @@ func (m *Evidence) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - l = types1.SizeOfStdTime(m.Time) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) n += 1 + l + sovTypes(uint64(l)) if m.TotalVotingPower != 0 { n += 1 + sovTypes(uint64(m.TotalVotingPower)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -8033,6 +9544,7 @@ func (m *Request) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8112,6 +9624,7 @@ func (m *RequestEcho) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8162,6 +9675,7 @@ func (m *RequestFlush) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8241,6 +9755,7 @@ func (m *RequestInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8349,6 +9864,7 @@ func (m *RequestSetOption) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8413,7 +9929,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8553,6 +10069,7 @@ func (m *RequestInitChain) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8702,6 +10219,7 @@ func (m *RequestQuery) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8874,6 +10392,7 @@ func (m *RequestBeginBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -8955,6 +10474,7 @@ func (m *RequestCheckTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9036,6 +10556,7 @@ func (m *RequestDeliverTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9105,6 +10626,7 @@ func (m *RequestEndBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9155,6 +10677,7 @@ func (m *RequestCommit) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9589,6 +11112,7 @@ func (m *Response) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9668,6 +11192,7 @@ func (m *ResponseException) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9747,6 +11272,7 @@ func (m *ResponseEcho) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9797,6 +11323,7 @@ func (m *ResponseFlush) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -9955,6 +11482,7 @@ func (m *ResponseInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10082,6 +11610,7 @@ func (m *ResponseSetOption) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10196,6 +11725,7 @@ func (m *ResponseInitChain) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10454,6 +11984,7 @@ func (m *ResponseQuery) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10535,6 +12066,7 @@ func (m *ResponseBeginBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10762,6 +12294,7 @@ func (m *ResponseCheckTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -10989,6 +12522,7 @@ func (m *ResponseDeliverTx) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11134,6 +12668,7 @@ func (m *ResponseEndBlock) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11215,6 +12750,7 @@ func (m *ResponseCommit) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11364,6 +12900,7 @@ func (m *ConsensusParams) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11471,6 +13008,7 @@ func (m *BlockSize) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11559,6 +13097,7 @@ func (m *TxSize) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11628,6 +13167,7 @@ func (m *BlockGossip) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11709,6 +13249,7 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -11821,7 +13362,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -12184,6 +13725,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12295,6 +13837,7 @@ func (m *BlockID) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12395,6 +13938,7 @@ func (m *PartSetHeader) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12495,6 +14039,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12594,6 +14139,7 @@ func (m *ValidatorUpdate) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12713,6 +14259,7 @@ func (m *VoteInfo) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12823,6 +14370,7 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -12965,7 +14513,7 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types1.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -13000,6 +14548,7 @@ func (m *Evidence) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -13114,10 +14663,12 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) } -func init() { golang_proto.RegisterFile("abci/types/types.proto", fileDescriptorTypes) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_56d74249e896ebc1) } +func init() { + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_56d74249e896ebc1) +} -var fileDescriptorTypes = []byte{ +var fileDescriptor_types_56d74249e896ebc1 = []byte{ // 2126 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x5f, 0x73, 0x1b, 0x49, 0x11, 0xf7, 0xca, 0xb2, 0xa4, 0x6d, 0xc9, 0x92, 0x33, 0xf9, 0xa7, 0xe8, 0xc0, 0x09, 0x0b, 0xe4, diff --git a/abci/types/typespb_test.go b/abci/types/typespb_test.go index de094ed4..0411afc8 100644 --- a/abci/types/typespb_test.go +++ b/abci/types/typespb_test.go @@ -1,59 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: abci/types/types.proto -/* -Package types is a generated protocol buffer package. - -It is generated from these files: - abci/types/types.proto - -It has these top-level messages: - Request - RequestEcho - RequestFlush - RequestInfo - RequestSetOption - RequestInitChain - RequestQuery - RequestBeginBlock - RequestCheckTx - RequestDeliverTx - RequestEndBlock - RequestCommit - Response - ResponseException - ResponseEcho - ResponseFlush - ResponseInfo - ResponseSetOption - ResponseInitChain - ResponseQuery - ResponseBeginBlock - ResponseCheckTx - ResponseDeliverTx - ResponseEndBlock - ResponseCommit - ConsensusParams - BlockSize - TxSize - BlockGossip - LastCommitInfo - Header - BlockID - PartSetHeader - Validator - ValidatorUpdate - VoteInfo - PubKey - Evidence -*/ package types import testing "testing" -import rand "math/rand" +import math_rand "math/rand" import time "time" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" import proto "github.com/gogo/protobuf/proto" -import jsonpb "github.com/gogo/protobuf/jsonpb" import golang_proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" @@ -69,14 +24,14 @@ var _ = math.Inf func TestRequestProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -94,13 +49,13 @@ func TestRequestProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -112,7 +67,7 @@ func TestRequestMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -125,14 +80,14 @@ func TestRequestMarshalTo(t *testing.T) { func TestRequestEchoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -150,13 +105,13 @@ func TestRequestEchoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestEchoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -168,7 +123,7 @@ func TestRequestEchoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -181,14 +136,14 @@ func TestRequestEchoMarshalTo(t *testing.T) { func TestRequestFlushProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -206,13 +161,13 @@ func TestRequestFlushProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestFlushMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -224,7 +179,7 @@ func TestRequestFlushMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -237,14 +192,14 @@ func TestRequestFlushMarshalTo(t *testing.T) { func TestRequestInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -262,13 +217,13 @@ func TestRequestInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -280,7 +235,7 @@ func TestRequestInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -293,14 +248,14 @@ func TestRequestInfoMarshalTo(t *testing.T) { func TestRequestSetOptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -318,13 +273,13 @@ func TestRequestSetOptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestSetOptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -336,7 +291,7 @@ func TestRequestSetOptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -349,14 +304,14 @@ func TestRequestSetOptionMarshalTo(t *testing.T) { func TestRequestInitChainProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -374,13 +329,13 @@ func TestRequestInitChainProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestInitChainMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -392,7 +347,7 @@ func TestRequestInitChainMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -405,14 +360,14 @@ func TestRequestInitChainMarshalTo(t *testing.T) { func TestRequestQueryProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -430,13 +385,13 @@ func TestRequestQueryProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestQueryMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -448,7 +403,7 @@ func TestRequestQueryMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -461,14 +416,14 @@ func TestRequestQueryMarshalTo(t *testing.T) { func TestRequestBeginBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -486,13 +441,13 @@ func TestRequestBeginBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestBeginBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -504,7 +459,7 @@ func TestRequestBeginBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -517,14 +472,14 @@ func TestRequestBeginBlockMarshalTo(t *testing.T) { func TestRequestCheckTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -542,13 +497,13 @@ func TestRequestCheckTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestCheckTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -560,7 +515,7 @@ func TestRequestCheckTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -573,14 +528,14 @@ func TestRequestCheckTxMarshalTo(t *testing.T) { func TestRequestDeliverTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -598,13 +553,13 @@ func TestRequestDeliverTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestDeliverTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -616,7 +571,7 @@ func TestRequestDeliverTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -629,14 +584,14 @@ func TestRequestDeliverTxMarshalTo(t *testing.T) { func TestRequestEndBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -654,13 +609,13 @@ func TestRequestEndBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestEndBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -672,7 +627,7 @@ func TestRequestEndBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -685,14 +640,14 @@ func TestRequestEndBlockMarshalTo(t *testing.T) { func TestRequestCommitProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -710,13 +665,13 @@ func TestRequestCommitProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestRequestCommitMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -728,7 +683,7 @@ func TestRequestCommitMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -741,14 +696,14 @@ func TestRequestCommitMarshalTo(t *testing.T) { func TestResponseProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -766,13 +721,13 @@ func TestResponseProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -784,7 +739,7 @@ func TestResponseMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -797,14 +752,14 @@ func TestResponseMarshalTo(t *testing.T) { func TestResponseExceptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -822,13 +777,13 @@ func TestResponseExceptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseExceptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -840,7 +795,7 @@ func TestResponseExceptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -853,14 +808,14 @@ func TestResponseExceptionMarshalTo(t *testing.T) { func TestResponseEchoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -878,13 +833,13 @@ func TestResponseEchoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseEchoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -896,7 +851,7 @@ func TestResponseEchoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -909,14 +864,14 @@ func TestResponseEchoMarshalTo(t *testing.T) { func TestResponseFlushProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -934,13 +889,13 @@ func TestResponseFlushProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseFlushMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -952,7 +907,7 @@ func TestResponseFlushMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -965,14 +920,14 @@ func TestResponseFlushMarshalTo(t *testing.T) { func TestResponseInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -990,13 +945,13 @@ func TestResponseInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1008,7 +963,7 @@ func TestResponseInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1021,14 +976,14 @@ func TestResponseInfoMarshalTo(t *testing.T) { func TestResponseSetOptionProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1046,13 +1001,13 @@ func TestResponseSetOptionProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseSetOptionMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1064,7 +1019,7 @@ func TestResponseSetOptionMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1077,14 +1032,14 @@ func TestResponseSetOptionMarshalTo(t *testing.T) { func TestResponseInitChainProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1102,13 +1057,13 @@ func TestResponseInitChainProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseInitChainMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1120,7 +1075,7 @@ func TestResponseInitChainMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1133,14 +1088,14 @@ func TestResponseInitChainMarshalTo(t *testing.T) { func TestResponseQueryProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1158,13 +1113,13 @@ func TestResponseQueryProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseQueryMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1176,7 +1131,7 @@ func TestResponseQueryMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1189,14 +1144,14 @@ func TestResponseQueryMarshalTo(t *testing.T) { func TestResponseBeginBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1214,13 +1169,13 @@ func TestResponseBeginBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseBeginBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1232,7 +1187,7 @@ func TestResponseBeginBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1245,14 +1200,14 @@ func TestResponseBeginBlockMarshalTo(t *testing.T) { func TestResponseCheckTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1270,13 +1225,13 @@ func TestResponseCheckTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseCheckTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1288,7 +1243,7 @@ func TestResponseCheckTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1301,14 +1256,14 @@ func TestResponseCheckTxMarshalTo(t *testing.T) { func TestResponseDeliverTxProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1326,13 +1281,13 @@ func TestResponseDeliverTxProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseDeliverTxMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1344,7 +1299,7 @@ func TestResponseDeliverTxMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1357,14 +1312,14 @@ func TestResponseDeliverTxMarshalTo(t *testing.T) { func TestResponseEndBlockProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1382,13 +1337,13 @@ func TestResponseEndBlockProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseEndBlockMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1400,7 +1355,7 @@ func TestResponseEndBlockMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1413,14 +1368,14 @@ func TestResponseEndBlockMarshalTo(t *testing.T) { func TestResponseCommitProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1438,13 +1393,13 @@ func TestResponseCommitProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestResponseCommitMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1456,7 +1411,7 @@ func TestResponseCommitMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1469,14 +1424,14 @@ func TestResponseCommitMarshalTo(t *testing.T) { func TestConsensusParamsProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1494,13 +1449,13 @@ func TestConsensusParamsProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestConsensusParamsMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1512,7 +1467,7 @@ func TestConsensusParamsMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1525,14 +1480,14 @@ func TestConsensusParamsMarshalTo(t *testing.T) { func TestBlockSizeProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1550,13 +1505,13 @@ func TestBlockSizeProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestBlockSizeMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1568,7 +1523,7 @@ func TestBlockSizeMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1581,14 +1536,14 @@ func TestBlockSizeMarshalTo(t *testing.T) { func TestTxSizeProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1606,13 +1561,13 @@ func TestTxSizeProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestTxSizeMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1624,7 +1579,7 @@ func TestTxSizeMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1637,14 +1592,14 @@ func TestTxSizeMarshalTo(t *testing.T) { func TestBlockGossipProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1662,13 +1617,13 @@ func TestBlockGossipProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestBlockGossipMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1680,7 +1635,7 @@ func TestBlockGossipMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1693,14 +1648,14 @@ func TestBlockGossipMarshalTo(t *testing.T) { func TestLastCommitInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1718,13 +1673,13 @@ func TestLastCommitInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestLastCommitInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1736,7 +1691,7 @@ func TestLastCommitInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1749,14 +1704,14 @@ func TestLastCommitInfoMarshalTo(t *testing.T) { func TestHeaderProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1774,13 +1729,13 @@ func TestHeaderProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestHeaderMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1792,7 +1747,7 @@ func TestHeaderMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1805,14 +1760,14 @@ func TestHeaderMarshalTo(t *testing.T) { func TestBlockIDProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1830,13 +1785,13 @@ func TestBlockIDProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestBlockIDMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1848,7 +1803,7 @@ func TestBlockIDMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1861,14 +1816,14 @@ func TestBlockIDMarshalTo(t *testing.T) { func TestPartSetHeaderProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1886,13 +1841,13 @@ func TestPartSetHeaderProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestPartSetHeaderMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1904,7 +1859,7 @@ func TestPartSetHeaderMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1917,14 +1872,14 @@ func TestPartSetHeaderMarshalTo(t *testing.T) { func TestValidatorProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1942,13 +1897,13 @@ func TestValidatorProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValidatorMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -1960,7 +1915,7 @@ func TestValidatorMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -1973,14 +1928,14 @@ func TestValidatorMarshalTo(t *testing.T) { func TestValidatorUpdateProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ValidatorUpdate{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -1998,13 +1953,13 @@ func TestValidatorUpdateProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestValidatorUpdateMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2016,7 +1971,7 @@ func TestValidatorUpdateMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ValidatorUpdate{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2029,14 +1984,14 @@ func TestValidatorUpdateMarshalTo(t *testing.T) { func TestVoteInfoProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &VoteInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -2054,13 +2009,13 @@ func TestVoteInfoProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestVoteInfoMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2072,7 +2027,7 @@ func TestVoteInfoMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &VoteInfo{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2085,14 +2040,14 @@ func TestVoteInfoMarshalTo(t *testing.T) { func TestPubKeyProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -2110,13 +2065,13 @@ func TestPubKeyProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestPubKeyMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2128,7 +2083,7 @@ func TestPubKeyMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2141,14 +2096,14 @@ func TestPubKeyMarshalTo(t *testing.T) { func TestEvidenceProto(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, false) - dAtA, err := proto.Marshal(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } littlefuzz := make([]byte, len(dAtA)) @@ -2166,13 +2121,13 @@ func TestEvidenceProto(t *testing.T) { littlefuzz = append(littlefuzz, byte(popr.Intn(256))) } // shouldn't panic - _ = proto.Unmarshal(littlefuzz, msg) + _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) } } func TestEvidenceMarshalTo(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, false) size := p.Size() dAtA := make([]byte, size) @@ -2184,7 +2139,7 @@ func TestEvidenceMarshalTo(t *testing.T) { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - if err := proto.Unmarshal(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } for i := range dAtA { @@ -2197,15 +2152,15 @@ func TestEvidenceMarshalTo(t *testing.T) { func TestRequestJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Request{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2215,15 +2170,15 @@ func TestRequestJSON(t *testing.T) { } func TestRequestEchoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEcho{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2233,15 +2188,15 @@ func TestRequestEchoJSON(t *testing.T) { } func TestRequestFlushJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestFlush{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2251,15 +2206,15 @@ func TestRequestFlushJSON(t *testing.T) { } func TestRequestInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInfo{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2269,15 +2224,15 @@ func TestRequestInfoJSON(t *testing.T) { } func TestRequestSetOptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestSetOption{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2287,15 +2242,15 @@ func TestRequestSetOptionJSON(t *testing.T) { } func TestRequestInitChainJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestInitChain{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2305,15 +2260,15 @@ func TestRequestInitChainJSON(t *testing.T) { } func TestRequestQueryJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestQuery{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2323,15 +2278,15 @@ func TestRequestQueryJSON(t *testing.T) { } func TestRequestBeginBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestBeginBlock{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2341,15 +2296,15 @@ func TestRequestBeginBlockJSON(t *testing.T) { } func TestRequestCheckTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCheckTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2359,15 +2314,15 @@ func TestRequestCheckTxJSON(t *testing.T) { } func TestRequestDeliverTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestDeliverTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2377,15 +2332,15 @@ func TestRequestDeliverTxJSON(t *testing.T) { } func TestRequestEndBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestEndBlock{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2395,15 +2350,15 @@ func TestRequestEndBlockJSON(t *testing.T) { } func TestRequestCommitJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &RequestCommit{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2413,15 +2368,15 @@ func TestRequestCommitJSON(t *testing.T) { } func TestResponseJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Response{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2431,15 +2386,15 @@ func TestResponseJSON(t *testing.T) { } func TestResponseExceptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseException{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2449,15 +2404,15 @@ func TestResponseExceptionJSON(t *testing.T) { } func TestResponseEchoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEcho{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2467,15 +2422,15 @@ func TestResponseEchoJSON(t *testing.T) { } func TestResponseFlushJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseFlush{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2485,15 +2440,15 @@ func TestResponseFlushJSON(t *testing.T) { } func TestResponseInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInfo{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2503,15 +2458,15 @@ func TestResponseInfoJSON(t *testing.T) { } func TestResponseSetOptionJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseSetOption{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2521,15 +2476,15 @@ func TestResponseSetOptionJSON(t *testing.T) { } func TestResponseInitChainJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseInitChain{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2539,15 +2494,15 @@ func TestResponseInitChainJSON(t *testing.T) { } func TestResponseQueryJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseQuery{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2557,15 +2512,15 @@ func TestResponseQueryJSON(t *testing.T) { } func TestResponseBeginBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseBeginBlock{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2575,15 +2530,15 @@ func TestResponseBeginBlockJSON(t *testing.T) { } func TestResponseCheckTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCheckTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2593,15 +2548,15 @@ func TestResponseCheckTxJSON(t *testing.T) { } func TestResponseDeliverTxJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseDeliverTx{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2611,15 +2566,15 @@ func TestResponseDeliverTxJSON(t *testing.T) { } func TestResponseEndBlockJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseEndBlock{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2629,15 +2584,15 @@ func TestResponseEndBlockJSON(t *testing.T) { } func TestResponseCommitJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ResponseCommit{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2647,15 +2602,15 @@ func TestResponseCommitJSON(t *testing.T) { } func TestConsensusParamsJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ConsensusParams{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2665,15 +2620,15 @@ func TestConsensusParamsJSON(t *testing.T) { } func TestBlockSizeJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockSize{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2683,15 +2638,15 @@ func TestBlockSizeJSON(t *testing.T) { } func TestTxSizeJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &TxSize{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2701,15 +2656,15 @@ func TestTxSizeJSON(t *testing.T) { } func TestBlockGossipJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockGossip{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2719,15 +2674,15 @@ func TestBlockGossipJSON(t *testing.T) { } func TestLastCommitInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &LastCommitInfo{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2737,15 +2692,15 @@ func TestLastCommitInfoJSON(t *testing.T) { } func TestHeaderJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Header{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2755,15 +2710,15 @@ func TestHeaderJSON(t *testing.T) { } func TestBlockIDJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &BlockID{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2773,15 +2728,15 @@ func TestBlockIDJSON(t *testing.T) { } func TestPartSetHeaderJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PartSetHeader{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2791,15 +2746,15 @@ func TestPartSetHeaderJSON(t *testing.T) { } func TestValidatorJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Validator{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2809,15 +2764,15 @@ func TestValidatorJSON(t *testing.T) { } func TestValidatorUpdateJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &ValidatorUpdate{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2827,15 +2782,15 @@ func TestValidatorUpdateJSON(t *testing.T) { } func TestVoteInfoJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &VoteInfo{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2845,15 +2800,15 @@ func TestVoteInfoJSON(t *testing.T) { } func TestPubKeyJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &PubKey{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2863,15 +2818,15 @@ func TestPubKeyJSON(t *testing.T) { } func TestEvidenceJSON(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - marshaler := jsonpb.Marshaler{} + marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} jsondata, err := marshaler.MarshalToString(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } msg := &Evidence{} - err = jsonpb.UnmarshalString(jsondata, msg) + err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -2881,11 +2836,11 @@ func TestEvidenceJSON(t *testing.T) { } func TestRequestProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Request{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2895,11 +2850,11 @@ func TestRequestProtoText(t *testing.T) { func TestRequestProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Request{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2909,11 +2864,11 @@ func TestRequestProtoCompactText(t *testing.T) { func TestRequestEchoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestEcho{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2923,11 +2878,11 @@ func TestRequestEchoProtoText(t *testing.T) { func TestRequestEchoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestEcho{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2937,11 +2892,11 @@ func TestRequestEchoProtoCompactText(t *testing.T) { func TestRequestFlushProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestFlush{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2951,11 +2906,11 @@ func TestRequestFlushProtoText(t *testing.T) { func TestRequestFlushProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestFlush{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2965,11 +2920,11 @@ func TestRequestFlushProtoCompactText(t *testing.T) { func TestRequestInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2979,11 +2934,11 @@ func TestRequestInfoProtoText(t *testing.T) { func TestRequestInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -2993,11 +2948,11 @@ func TestRequestInfoProtoCompactText(t *testing.T) { func TestRequestSetOptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestSetOption{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3007,11 +2962,11 @@ func TestRequestSetOptionProtoText(t *testing.T) { func TestRequestSetOptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestSetOption{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3021,11 +2976,11 @@ func TestRequestSetOptionProtoCompactText(t *testing.T) { func TestRequestInitChainProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestInitChain{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3035,11 +2990,11 @@ func TestRequestInitChainProtoText(t *testing.T) { func TestRequestInitChainProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestInitChain{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3049,11 +3004,11 @@ func TestRequestInitChainProtoCompactText(t *testing.T) { func TestRequestQueryProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestQuery{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3063,11 +3018,11 @@ func TestRequestQueryProtoText(t *testing.T) { func TestRequestQueryProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestQuery{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3077,11 +3032,11 @@ func TestRequestQueryProtoCompactText(t *testing.T) { func TestRequestBeginBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestBeginBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3091,11 +3046,11 @@ func TestRequestBeginBlockProtoText(t *testing.T) { func TestRequestBeginBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestBeginBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3105,11 +3060,11 @@ func TestRequestBeginBlockProtoCompactText(t *testing.T) { func TestRequestCheckTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestCheckTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3119,11 +3074,11 @@ func TestRequestCheckTxProtoText(t *testing.T) { func TestRequestCheckTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestCheckTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3133,11 +3088,11 @@ func TestRequestCheckTxProtoCompactText(t *testing.T) { func TestRequestDeliverTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestDeliverTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3147,11 +3102,11 @@ func TestRequestDeliverTxProtoText(t *testing.T) { func TestRequestDeliverTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestDeliverTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3161,11 +3116,11 @@ func TestRequestDeliverTxProtoCompactText(t *testing.T) { func TestRequestEndBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestEndBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3175,11 +3130,11 @@ func TestRequestEndBlockProtoText(t *testing.T) { func TestRequestEndBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestEndBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3189,11 +3144,11 @@ func TestRequestEndBlockProtoCompactText(t *testing.T) { func TestRequestCommitProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &RequestCommit{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3203,11 +3158,11 @@ func TestRequestCommitProtoText(t *testing.T) { func TestRequestCommitProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &RequestCommit{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3217,11 +3172,11 @@ func TestRequestCommitProtoCompactText(t *testing.T) { func TestResponseProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Response{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3231,11 +3186,11 @@ func TestResponseProtoText(t *testing.T) { func TestResponseProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Response{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3245,11 +3200,11 @@ func TestResponseProtoCompactText(t *testing.T) { func TestResponseExceptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseException{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3259,11 +3214,11 @@ func TestResponseExceptionProtoText(t *testing.T) { func TestResponseExceptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseException{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3273,11 +3228,11 @@ func TestResponseExceptionProtoCompactText(t *testing.T) { func TestResponseEchoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseEcho{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3287,11 +3242,11 @@ func TestResponseEchoProtoText(t *testing.T) { func TestResponseEchoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseEcho{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3301,11 +3256,11 @@ func TestResponseEchoProtoCompactText(t *testing.T) { func TestResponseFlushProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseFlush{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3315,11 +3270,11 @@ func TestResponseFlushProtoText(t *testing.T) { func TestResponseFlushProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseFlush{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3329,11 +3284,11 @@ func TestResponseFlushProtoCompactText(t *testing.T) { func TestResponseInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3343,11 +3298,11 @@ func TestResponseInfoProtoText(t *testing.T) { func TestResponseInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3357,11 +3312,11 @@ func TestResponseInfoProtoCompactText(t *testing.T) { func TestResponseSetOptionProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseSetOption{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3371,11 +3326,11 @@ func TestResponseSetOptionProtoText(t *testing.T) { func TestResponseSetOptionProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseSetOption{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3385,11 +3340,11 @@ func TestResponseSetOptionProtoCompactText(t *testing.T) { func TestResponseInitChainProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseInitChain{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3399,11 +3354,11 @@ func TestResponseInitChainProtoText(t *testing.T) { func TestResponseInitChainProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseInitChain{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3413,11 +3368,11 @@ func TestResponseInitChainProtoCompactText(t *testing.T) { func TestResponseQueryProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseQuery{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3427,11 +3382,11 @@ func TestResponseQueryProtoText(t *testing.T) { func TestResponseQueryProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseQuery{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3441,11 +3396,11 @@ func TestResponseQueryProtoCompactText(t *testing.T) { func TestResponseBeginBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseBeginBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3455,11 +3410,11 @@ func TestResponseBeginBlockProtoText(t *testing.T) { func TestResponseBeginBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseBeginBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3469,11 +3424,11 @@ func TestResponseBeginBlockProtoCompactText(t *testing.T) { func TestResponseCheckTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseCheckTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3483,11 +3438,11 @@ func TestResponseCheckTxProtoText(t *testing.T) { func TestResponseCheckTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseCheckTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3497,11 +3452,11 @@ func TestResponseCheckTxProtoCompactText(t *testing.T) { func TestResponseDeliverTxProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseDeliverTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3511,11 +3466,11 @@ func TestResponseDeliverTxProtoText(t *testing.T) { func TestResponseDeliverTxProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseDeliverTx{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3525,11 +3480,11 @@ func TestResponseDeliverTxProtoCompactText(t *testing.T) { func TestResponseEndBlockProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseEndBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3539,11 +3494,11 @@ func TestResponseEndBlockProtoText(t *testing.T) { func TestResponseEndBlockProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseEndBlock{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3553,11 +3508,11 @@ func TestResponseEndBlockProtoCompactText(t *testing.T) { func TestResponseCommitProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ResponseCommit{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3567,11 +3522,11 @@ func TestResponseCommitProtoText(t *testing.T) { func TestResponseCommitProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ResponseCommit{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3581,11 +3536,11 @@ func TestResponseCommitProtoCompactText(t *testing.T) { func TestConsensusParamsProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ConsensusParams{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3595,11 +3550,11 @@ func TestConsensusParamsProtoText(t *testing.T) { func TestConsensusParamsProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ConsensusParams{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3609,11 +3564,11 @@ func TestConsensusParamsProtoCompactText(t *testing.T) { func TestBlockSizeProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &BlockSize{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3623,11 +3578,11 @@ func TestBlockSizeProtoText(t *testing.T) { func TestBlockSizeProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &BlockSize{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3637,11 +3592,11 @@ func TestBlockSizeProtoCompactText(t *testing.T) { func TestTxSizeProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &TxSize{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3651,11 +3606,11 @@ func TestTxSizeProtoText(t *testing.T) { func TestTxSizeProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &TxSize{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3665,11 +3620,11 @@ func TestTxSizeProtoCompactText(t *testing.T) { func TestBlockGossipProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &BlockGossip{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3679,11 +3634,11 @@ func TestBlockGossipProtoText(t *testing.T) { func TestBlockGossipProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &BlockGossip{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3693,11 +3648,11 @@ func TestBlockGossipProtoCompactText(t *testing.T) { func TestLastCommitInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &LastCommitInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3707,11 +3662,11 @@ func TestLastCommitInfoProtoText(t *testing.T) { func TestLastCommitInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &LastCommitInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3721,11 +3676,11 @@ func TestLastCommitInfoProtoCompactText(t *testing.T) { func TestHeaderProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Header{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3735,11 +3690,11 @@ func TestHeaderProtoText(t *testing.T) { func TestHeaderProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Header{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3749,11 +3704,11 @@ func TestHeaderProtoCompactText(t *testing.T) { func TestBlockIDProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &BlockID{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3763,11 +3718,11 @@ func TestBlockIDProtoText(t *testing.T) { func TestBlockIDProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &BlockID{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3777,11 +3732,11 @@ func TestBlockIDProtoCompactText(t *testing.T) { func TestPartSetHeaderProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PartSetHeader{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3791,11 +3746,11 @@ func TestPartSetHeaderProtoText(t *testing.T) { func TestPartSetHeaderProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PartSetHeader{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3805,11 +3760,11 @@ func TestPartSetHeaderProtoCompactText(t *testing.T) { func TestValidatorProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Validator{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3819,11 +3774,11 @@ func TestValidatorProtoText(t *testing.T) { func TestValidatorProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Validator{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3833,11 +3788,11 @@ func TestValidatorProtoCompactText(t *testing.T) { func TestValidatorUpdateProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &ValidatorUpdate{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3847,11 +3802,11 @@ func TestValidatorUpdateProtoText(t *testing.T) { func TestValidatorUpdateProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &ValidatorUpdate{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3861,11 +3816,11 @@ func TestValidatorUpdateProtoCompactText(t *testing.T) { func TestVoteInfoProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &VoteInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3875,11 +3830,11 @@ func TestVoteInfoProtoText(t *testing.T) { func TestVoteInfoProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &VoteInfo{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3889,11 +3844,11 @@ func TestVoteInfoProtoCompactText(t *testing.T) { func TestPubKeyProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &PubKey{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3903,11 +3858,11 @@ func TestPubKeyProtoText(t *testing.T) { func TestPubKeyProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &PubKey{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3917,11 +3872,11 @@ func TestPubKeyProtoCompactText(t *testing.T) { func TestEvidenceProtoText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - dAtA := proto.MarshalTextString(p) + dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) msg := &Evidence{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3931,11 +3886,11 @@ func TestEvidenceProtoText(t *testing.T) { func TestEvidenceProtoCompactText(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - dAtA := proto.CompactTextString(p) + dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) msg := &Evidence{} - if err := proto.UnmarshalText(dAtA, msg); err != nil { + if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } if !p.Equal(msg) { @@ -3945,10 +3900,10 @@ func TestEvidenceProtoCompactText(t *testing.T) { func TestRequestSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequest(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3959,7 +3914,7 @@ func TestRequestSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3967,10 +3922,10 @@ func TestRequestSize(t *testing.T) { func TestRequestEchoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEcho(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -3981,7 +3936,7 @@ func TestRequestEchoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -3989,10 +3944,10 @@ func TestRequestEchoSize(t *testing.T) { func TestRequestFlushSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestFlush(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4003,7 +3958,7 @@ func TestRequestFlushSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4011,10 +3966,10 @@ func TestRequestFlushSize(t *testing.T) { func TestRequestInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInfo(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4025,7 +3980,7 @@ func TestRequestInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4033,10 +3988,10 @@ func TestRequestInfoSize(t *testing.T) { func TestRequestSetOptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestSetOption(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4047,7 +4002,7 @@ func TestRequestSetOptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4055,10 +4010,10 @@ func TestRequestSetOptionSize(t *testing.T) { func TestRequestInitChainSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestInitChain(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4069,7 +4024,7 @@ func TestRequestInitChainSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4077,10 +4032,10 @@ func TestRequestInitChainSize(t *testing.T) { func TestRequestQuerySize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestQuery(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4091,7 +4046,7 @@ func TestRequestQuerySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4099,10 +4054,10 @@ func TestRequestQuerySize(t *testing.T) { func TestRequestBeginBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestBeginBlock(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4113,7 +4068,7 @@ func TestRequestBeginBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4121,10 +4076,10 @@ func TestRequestBeginBlockSize(t *testing.T) { func TestRequestCheckTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCheckTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4135,7 +4090,7 @@ func TestRequestCheckTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4143,10 +4098,10 @@ func TestRequestCheckTxSize(t *testing.T) { func TestRequestDeliverTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestDeliverTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4157,7 +4112,7 @@ func TestRequestDeliverTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4165,10 +4120,10 @@ func TestRequestDeliverTxSize(t *testing.T) { func TestRequestEndBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestEndBlock(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4179,7 +4134,7 @@ func TestRequestEndBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4187,10 +4142,10 @@ func TestRequestEndBlockSize(t *testing.T) { func TestRequestCommitSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedRequestCommit(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4201,7 +4156,7 @@ func TestRequestCommitSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4209,10 +4164,10 @@ func TestRequestCommitSize(t *testing.T) { func TestResponseSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponse(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4223,7 +4178,7 @@ func TestResponseSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4231,10 +4186,10 @@ func TestResponseSize(t *testing.T) { func TestResponseExceptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseException(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4245,7 +4200,7 @@ func TestResponseExceptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4253,10 +4208,10 @@ func TestResponseExceptionSize(t *testing.T) { func TestResponseEchoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEcho(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4267,7 +4222,7 @@ func TestResponseEchoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4275,10 +4230,10 @@ func TestResponseEchoSize(t *testing.T) { func TestResponseFlushSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseFlush(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4289,7 +4244,7 @@ func TestResponseFlushSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4297,10 +4252,10 @@ func TestResponseFlushSize(t *testing.T) { func TestResponseInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInfo(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4311,7 +4266,7 @@ func TestResponseInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4319,10 +4274,10 @@ func TestResponseInfoSize(t *testing.T) { func TestResponseSetOptionSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseSetOption(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4333,7 +4288,7 @@ func TestResponseSetOptionSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4341,10 +4296,10 @@ func TestResponseSetOptionSize(t *testing.T) { func TestResponseInitChainSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseInitChain(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4355,7 +4310,7 @@ func TestResponseInitChainSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4363,10 +4318,10 @@ func TestResponseInitChainSize(t *testing.T) { func TestResponseQuerySize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseQuery(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4377,7 +4332,7 @@ func TestResponseQuerySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4385,10 +4340,10 @@ func TestResponseQuerySize(t *testing.T) { func TestResponseBeginBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseBeginBlock(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4399,7 +4354,7 @@ func TestResponseBeginBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4407,10 +4362,10 @@ func TestResponseBeginBlockSize(t *testing.T) { func TestResponseCheckTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCheckTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4421,7 +4376,7 @@ func TestResponseCheckTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4429,10 +4384,10 @@ func TestResponseCheckTxSize(t *testing.T) { func TestResponseDeliverTxSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseDeliverTx(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4443,7 +4398,7 @@ func TestResponseDeliverTxSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4451,10 +4406,10 @@ func TestResponseDeliverTxSize(t *testing.T) { func TestResponseEndBlockSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseEndBlock(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4465,7 +4420,7 @@ func TestResponseEndBlockSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4473,10 +4428,10 @@ func TestResponseEndBlockSize(t *testing.T) { func TestResponseCommitSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedResponseCommit(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4487,7 +4442,7 @@ func TestResponseCommitSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4495,10 +4450,10 @@ func TestResponseCommitSize(t *testing.T) { func TestConsensusParamsSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedConsensusParams(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4509,7 +4464,7 @@ func TestConsensusParamsSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4517,10 +4472,10 @@ func TestConsensusParamsSize(t *testing.T) { func TestBlockSizeSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockSize(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4531,7 +4486,7 @@ func TestBlockSizeSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4539,10 +4494,10 @@ func TestBlockSizeSize(t *testing.T) { func TestTxSizeSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedTxSize(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4553,7 +4508,7 @@ func TestTxSizeSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4561,10 +4516,10 @@ func TestTxSizeSize(t *testing.T) { func TestBlockGossipSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockGossip(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4575,7 +4530,7 @@ func TestBlockGossipSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4583,10 +4538,10 @@ func TestBlockGossipSize(t *testing.T) { func TestLastCommitInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedLastCommitInfo(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4597,7 +4552,7 @@ func TestLastCommitInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4605,10 +4560,10 @@ func TestLastCommitInfoSize(t *testing.T) { func TestHeaderSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedHeader(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4619,7 +4574,7 @@ func TestHeaderSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4627,10 +4582,10 @@ func TestHeaderSize(t *testing.T) { func TestBlockIDSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedBlockID(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4641,7 +4596,7 @@ func TestBlockIDSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4649,10 +4604,10 @@ func TestBlockIDSize(t *testing.T) { func TestPartSetHeaderSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPartSetHeader(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4663,7 +4618,7 @@ func TestPartSetHeaderSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4671,10 +4626,10 @@ func TestPartSetHeaderSize(t *testing.T) { func TestValidatorSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidator(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4685,7 +4640,7 @@ func TestValidatorSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4693,10 +4648,10 @@ func TestValidatorSize(t *testing.T) { func TestValidatorUpdateSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedValidatorUpdate(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4707,7 +4662,7 @@ func TestValidatorUpdateSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4715,10 +4670,10 @@ func TestValidatorUpdateSize(t *testing.T) { func TestVoteInfoSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedVoteInfo(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4729,7 +4684,7 @@ func TestVoteInfoSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4737,10 +4692,10 @@ func TestVoteInfoSize(t *testing.T) { func TestPubKeySize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedPubKey(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4751,7 +4706,7 @@ func TestPubKeySize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } @@ -4759,10 +4714,10 @@ func TestPubKeySize(t *testing.T) { func TestEvidenceSize(t *testing.T) { seed := time.Now().UnixNano() - popr := rand.New(rand.NewSource(seed)) + popr := math_rand.New(math_rand.NewSource(seed)) p := NewPopulatedEvidence(popr, true) - size2 := proto.Size(p) - dAtA, err := proto.Marshal(p) + size2 := github_com_gogo_protobuf_proto.Size(p) + dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) if err != nil { t.Fatalf("seed = %d, err = %v", seed, err) } @@ -4773,7 +4728,7 @@ func TestEvidenceSize(t *testing.T) { if size2 != size { t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) } - size3 := proto.Size(p) + size3 := github_com_gogo_protobuf_proto.Size(p) if size3 != size { t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) } From b189ab676feaffc77797400911c3cb2236d3e7b8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:21:51 -0400 Subject: [PATCH 078/149] makefile: lint flags --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e61f6294..1fb3eacb 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protob BUILD_TAGS?='tendermint' BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" +LINT_FLAGS = --exclude '.*\.pb\.go' --vendor --deadline=600s + all: check build test install check: check_tools get_vendor_deps @@ -39,9 +41,6 @@ protoc_all: protoc_libs protoc_abci protoc_grpc ## Note the $< here is substituted for the %.proto ## Note the $@ here is substituted for the %.pb.go protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:. - ## Note we don't use inplace since it's not natively available on mac - @echo "--> adding nolint declarations to protobuf generated files" - @awk '/^\s*package \w+/ { print "//nolint" }1' $@ > $@.tmp && mv $@.tmp $@ ######################################## ### Build ABCI @@ -220,7 +219,7 @@ fmt: metalinter: @echo "--> Running linter" - @gometalinter.v2 --vendor --deadline=600s --disable-all \ + @gometalinter.v2 $(LINT_FLAGS) --disable-all \ --enable=deadcode \ --enable=gosimple \ --enable=misspell \ @@ -249,7 +248,7 @@ metalinter: metalinter_all: @echo "--> Running linter (all)" - gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./... + gometalinter.v2 $(LINT_FLAGS) --enable-all --disable=lll ./... DESTINATION = ./index.html.md From c919643c3ee3205670c0e938dcf61df0f3f2d498 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:33:53 -0400 Subject: [PATCH 079/149] abci: move round back from votes to commit --- abci/types/types.pb.go | 473 ++++++++++++++++++++-------------------- abci/types/types.proto | 5 +- state/execution.go | 28 ++- state/execution_test.go | 2 +- 4 files changed, 254 insertions(+), 254 deletions(-) diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 8745553e..79e16006 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -60,7 +60,7 @@ func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{0} + return fileDescriptor_types_bafb6deff4c77e13, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +482,7 @@ func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{1} + return fileDescriptor_types_bafb6deff4c77e13, []int{1} } func (m *RequestEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,7 +528,7 @@ func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{2} + return fileDescriptor_types_bafb6deff4c77e13, []int{2} } func (m *RequestFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -568,7 +568,7 @@ func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{3} + return fileDescriptor_types_bafb6deff4c77e13, []int{3} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -617,7 +617,7 @@ func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{4} + return fileDescriptor_types_bafb6deff4c77e13, []int{4} } func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -675,7 +675,7 @@ func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{5} + return fileDescriptor_types_bafb6deff4c77e13, []int{5} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +753,7 @@ func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{6} + return fileDescriptor_types_bafb6deff4c77e13, []int{6} } func (m *RequestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -825,7 +825,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{7} + return fileDescriptor_types_bafb6deff4c77e13, []int{7} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -893,7 +893,7 @@ func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{8} + return fileDescriptor_types_bafb6deff4c77e13, []int{8} } func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -940,7 +940,7 @@ func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{9} + return fileDescriptor_types_bafb6deff4c77e13, []int{9} } func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +987,7 @@ func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{10} + return fileDescriptor_types_bafb6deff4c77e13, []int{10} } func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,7 +1033,7 @@ func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{11} + return fileDescriptor_types_bafb6deff4c77e13, []int{11} } func (m *RequestCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1086,7 +1086,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{12} + return fileDescriptor_types_bafb6deff4c77e13, []int{12} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1539,7 +1539,7 @@ func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{13} + return fileDescriptor_types_bafb6deff4c77e13, []int{13} } func (m *ResponseException) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1586,7 +1586,7 @@ func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{14} + return fileDescriptor_types_bafb6deff4c77e13, []int{14} } func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1632,7 +1632,7 @@ func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{15} + return fileDescriptor_types_bafb6deff4c77e13, []int{15} } func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1675,7 +1675,7 @@ func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{16} + return fileDescriptor_types_bafb6deff4c77e13, []int{16} } func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1747,7 +1747,7 @@ func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{17} + return fileDescriptor_types_bafb6deff4c77e13, []int{17} } func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1809,7 +1809,7 @@ func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{18} + return fileDescriptor_types_bafb6deff4c77e13, []int{18} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1871,7 +1871,7 @@ func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{19} + return fileDescriptor_types_bafb6deff4c77e13, []int{19} } func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1967,7 +1967,7 @@ func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{20} + return fileDescriptor_types_bafb6deff4c77e13, []int{20} } func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2020,7 +2020,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{21} + return fileDescriptor_types_bafb6deff4c77e13, []int{21} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2115,7 +2115,7 @@ func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{22} + return fileDescriptor_types_bafb6deff4c77e13, []int{22} } func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2206,7 +2206,7 @@ func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{23} + return fileDescriptor_types_bafb6deff4c77e13, []int{23} } func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2268,7 +2268,7 @@ func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{24} + return fileDescriptor_types_bafb6deff4c77e13, []int{24} } func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2319,7 +2319,7 @@ func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } func (*ConsensusParams) ProtoMessage() {} func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{25} + return fileDescriptor_types_bafb6deff4c77e13, []int{25} } func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2383,7 +2383,7 @@ func (m *BlockSize) Reset() { *m = BlockSize{} } func (m *BlockSize) String() string { return proto.CompactTextString(m) } func (*BlockSize) ProtoMessage() {} func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{26} + return fileDescriptor_types_bafb6deff4c77e13, []int{26} } func (m *BlockSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2446,7 +2446,7 @@ func (m *TxSize) Reset() { *m = TxSize{} } func (m *TxSize) String() string { return proto.CompactTextString(m) } func (*TxSize) ProtoMessage() {} func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{27} + return fileDescriptor_types_bafb6deff4c77e13, []int{27} } func (m *TxSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2503,7 +2503,7 @@ func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{28} + return fileDescriptor_types_bafb6deff4c77e13, []int{28} } func (m *BlockGossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2540,7 +2540,8 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { } type LastCommitInfo struct { - CommitVotes []VoteInfo `protobuf:"bytes,1,rep,name=commit_votes,json=commitVotes" json:"commit_votes"` + Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"` + Votes []VoteInfo `protobuf:"bytes,2,rep,name=votes" json:"votes"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2550,7 +2551,7 @@ func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{29} + return fileDescriptor_types_bafb6deff4c77e13, []int{29} } func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2579,9 +2580,16 @@ func (m *LastCommitInfo) XXX_DiscardUnknown() { var xxx_messageInfo_LastCommitInfo proto.InternalMessageInfo -func (m *LastCommitInfo) GetCommitVotes() []VoteInfo { +func (m *LastCommitInfo) GetRound() int32 { if m != nil { - return m.CommitVotes + return m.Round + } + return 0 +} + +func (m *LastCommitInfo) GetVotes() []VoteInfo { + if m != nil { + return m.Votes } return nil } @@ -2616,7 +2624,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{30} + return fileDescriptor_types_bafb6deff4c77e13, []int{30} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2762,7 +2770,7 @@ func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{31} + return fileDescriptor_types_bafb6deff4c77e13, []int{31} } func (m *BlockID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2817,7 +2825,7 @@ func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{32} + return fileDescriptor_types_bafb6deff4c77e13, []int{32} } func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2862,7 +2870,8 @@ func (m *PartSetHeader) GetHash() []byte { // Validator type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // PubKey pub_key = 2 [(gogoproto.nullable)=false]; Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2873,7 +2882,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{33} + return fileDescriptor_types_bafb6deff4c77e13, []int{33} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2929,7 +2938,7 @@ func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } func (*ValidatorUpdate) ProtoMessage() {} func (*ValidatorUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{34} + return fileDescriptor_types_bafb6deff4c77e13, []int{34} } func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2976,7 +2985,6 @@ func (m *ValidatorUpdate) GetPower() int64 { type VoteInfo struct { Validator Validator `protobuf:"bytes,1,opt,name=validator" json:"validator"` SignedLastBlock bool `protobuf:"varint,2,opt,name=signed_last_block,json=signedLastBlock,proto3" json:"signed_last_block,omitempty"` - CommitRound int64 `protobuf:"varint,3,opt,name=commit_round,json=commitRound,proto3" json:"commit_round,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2986,7 +2994,7 @@ func (m *VoteInfo) Reset() { *m = VoteInfo{} } func (m *VoteInfo) String() string { return proto.CompactTextString(m) } func (*VoteInfo) ProtoMessage() {} func (*VoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{35} + return fileDescriptor_types_bafb6deff4c77e13, []int{35} } func (m *VoteInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3029,13 +3037,6 @@ func (m *VoteInfo) GetSignedLastBlock() bool { return false } -func (m *VoteInfo) GetCommitRound() int64 { - if m != nil { - return m.CommitRound - } - return 0 -} - type PubKey struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -3048,7 +3049,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{36} + return fileDescriptor_types_bafb6deff4c77e13, []int{36} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3106,7 +3107,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_56d74249e896ebc1, []int{37} + return fileDescriptor_types_bafb6deff4c77e13, []int{37} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4774,11 +4775,14 @@ func (this *LastCommitInfo) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.CommitVotes) != len(that1.CommitVotes) { + if this.Round != that1.Round { return false } - for i := range this.CommitVotes { - if !this.CommitVotes[i].Equal(&that1.CommitVotes[i]) { + if len(this.Votes) != len(that1.Votes) { + return false + } + for i := range this.Votes { + if !this.Votes[i].Equal(&that1.Votes[i]) { return false } } @@ -5001,9 +5005,6 @@ func (this *VoteInfo) Equal(that interface{}) bool { if this.SignedLastBlock != that1.SignedLastBlock { return false } - if this.CommitRound != that1.CommitRound { - return false - } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } @@ -6908,9 +6909,14 @@ func (m *LastCommitInfo) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.CommitVotes) > 0 { - for _, msg := range m.CommitVotes { - dAtA[i] = 0xa + if m.Round != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Round)) + } + if len(m.Votes) > 0 { + for _, msg := range m.Votes { + dAtA[i] = 0x12 i++ i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) @@ -7204,11 +7210,6 @@ func (m *VoteInfo) MarshalTo(dAtA []byte) (int, error) { } i++ } - if m.CommitRound != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.CommitRound)) - } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } @@ -7942,16 +7943,20 @@ func NewPopulatedBlockGossip(r randyTypes, easy bool) *BlockGossip { func NewPopulatedLastCommitInfo(r randyTypes, easy bool) *LastCommitInfo { this := &LastCommitInfo{} + this.Round = int32(r.Int31()) + if r.Intn(2) == 0 { + this.Round *= -1 + } if r.Intn(10) != 0 { v32 := r.Intn(5) - this.CommitVotes = make([]VoteInfo, v32) + this.Votes = make([]VoteInfo, v32) for i := 0; i < v32; i++ { v33 := NewPopulatedVoteInfo(r, easy) - this.CommitVotes[i] = *v33 + this.Votes[i] = *v33 } } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 2) + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -8094,12 +8099,8 @@ func NewPopulatedVoteInfo(r randyTypes, easy bool) *VoteInfo { v50 := NewPopulatedValidator(r, easy) this.Validator = *v50 this.SignedLastBlock = bool(bool(r.Intn(2) == 0)) - this.CommitRound = int64(r.Int63()) - if r.Intn(2) == 0 { - this.CommitRound *= -1 - } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -8946,8 +8947,11 @@ func (m *BlockGossip) Size() (n int) { func (m *LastCommitInfo) Size() (n int) { var l int _ = l - if len(m.CommitVotes) > 0 { - for _, e := range m.CommitVotes { + if m.Round != 0 { + n += 1 + sovTypes(uint64(m.Round)) + } + if len(m.Votes) > 0 { + for _, e := range m.Votes { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } @@ -9089,9 +9093,6 @@ func (m *VoteInfo) Size() (n int) { if m.SignedLastBlock { n += 2 } - if m.CommitRound != 0 { - n += 1 + sovTypes(uint64(m.CommitRound)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -13207,8 +13208,27 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + } + m.Round = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Round |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitVotes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -13232,8 +13252,8 @@ func (m *LastCommitInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CommitVotes = append(m.CommitVotes, VoteInfo{}) - if err := m.CommitVotes[len(m.CommitVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Votes = append(m.Votes, VoteInfo{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -14228,25 +14248,6 @@ func (m *VoteInfo) Unmarshal(dAtA []byte) error { } } m.SignedLastBlock = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitRound", wireType) - } - m.CommitRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CommitRound |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -14663,144 +14664,144 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_56d74249e896ebc1) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) } func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_56d74249e896ebc1) + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) } -var fileDescriptor_types_56d74249e896ebc1 = []byte{ - // 2126 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x5f, 0x73, 0x1b, 0x49, - 0x11, 0xf7, 0xca, 0xb2, 0xa4, 0x6d, 0xc9, 0x92, 0x33, 0xf9, 0xa7, 0xe8, 0xc0, 0x09, 0x0b, 0xe4, - 0x6c, 0xce, 0x67, 0x1f, 0x3e, 0x42, 0x39, 0x97, 0xe3, 0x0a, 0x2b, 0x09, 0x67, 0x73, 0x07, 0x98, - 0x4d, 0x62, 0xaa, 0x28, 0xaa, 0xb6, 0x46, 0xda, 0xb1, 0xb4, 0x15, 0x69, 0x77, 0x6f, 0x67, 0xe4, - 0x93, 0xf3, 0x19, 0xae, 0x8a, 0x7b, 0xa0, 0x8a, 0x67, 0xde, 0xf8, 0x02, 0x54, 0xf1, 0xc8, 0x13, - 0x75, 0x8f, 0x14, 0x05, 0xc5, 0x5b, 0x00, 0x53, 0x3c, 0xc0, 0x27, 0xe0, 0x91, 0x9a, 0x9e, 0xd9, - 0xbf, 0x5e, 0xa5, 0x92, 0xf0, 0xc6, 0x8b, 0xb4, 0x33, 0xdd, 0x3d, 0x33, 0xdd, 0xd3, 0xdd, 0xbf, - 0xee, 0x81, 0x6b, 0x74, 0x30, 0xf4, 0x76, 0xc4, 0x59, 0xc8, 0xb8, 0xfa, 0xdd, 0x0e, 0xa3, 0x40, - 0x04, 0x64, 0x05, 0x07, 0xbd, 0xb7, 0x47, 0x9e, 0x18, 0xcf, 0x06, 0xdb, 0xc3, 0x60, 0xba, 0x33, - 0x0a, 0x46, 0xc1, 0x0e, 0x52, 0x07, 0xb3, 0x13, 0x1c, 0xe1, 0x00, 0xbf, 0x94, 0x54, 0xef, 0xe6, - 0x28, 0x08, 0x46, 0x13, 0x96, 0x72, 0x09, 0x6f, 0xca, 0xb8, 0xa0, 0xd3, 0x50, 0x33, 0xec, 0x65, - 0xd6, 0x13, 0xcc, 0x77, 0x59, 0x34, 0xf5, 0x7c, 0x91, 0xfd, 0x9c, 0x78, 0x03, 0xbe, 0x33, 0x0c, - 0xa6, 0xd3, 0xc0, 0xcf, 0x1e, 0xc8, 0xfa, 0x7d, 0x15, 0xea, 0x36, 0xfb, 0x64, 0xc6, 0xb8, 0x20, - 0x1b, 0x50, 0x65, 0xc3, 0x71, 0xd0, 0xad, 0xdc, 0x32, 0x36, 0x9a, 0xbb, 0x64, 0x5b, 0xf1, 0x69, - 0xea, 0xc3, 0xe1, 0x38, 0x38, 0x58, 0xb2, 0x91, 0x83, 0xbc, 0x05, 0x2b, 0x27, 0x93, 0x19, 0x1f, - 0x77, 0x97, 0x91, 0xf5, 0x72, 0x9e, 0xf5, 0x7b, 0x92, 0x74, 0xb0, 0x64, 0x2b, 0x1e, 0xb9, 0xac, - 0xe7, 0x9f, 0x04, 0xdd, 0x6a, 0xd9, 0xb2, 0x87, 0xfe, 0x09, 0x2e, 0x2b, 0x39, 0xc8, 0x1e, 0x00, - 0x67, 0xc2, 0x09, 0x42, 0xe1, 0x05, 0x7e, 0x77, 0x05, 0xf9, 0xaf, 0xe7, 0xf9, 0x1f, 0x31, 0xf1, - 0x23, 0x24, 0x1f, 0x2c, 0xd9, 0x26, 0x8f, 0x07, 0x52, 0xd2, 0xf3, 0x3d, 0xe1, 0x0c, 0xc7, 0xd4, - 0xf3, 0xbb, 0xb5, 0x32, 0xc9, 0x43, 0xdf, 0x13, 0xf7, 0x25, 0x59, 0x4a, 0x7a, 0xf1, 0x40, 0xaa, - 0xf2, 0xc9, 0x8c, 0x45, 0x67, 0xdd, 0x7a, 0x99, 0x2a, 0x3f, 0x96, 0x24, 0xa9, 0x0a, 0xf2, 0x90, - 0x7b, 0xd0, 0x1c, 0xb0, 0x91, 0xe7, 0x3b, 0x83, 0x49, 0x30, 0x7c, 0xda, 0x6d, 0xa0, 0x48, 0x37, - 0x2f, 0xd2, 0x97, 0x0c, 0x7d, 0x49, 0x3f, 0x58, 0xb2, 0x61, 0x90, 0x8c, 0xc8, 0x2e, 0x34, 0x86, - 0x63, 0x36, 0x7c, 0xea, 0x88, 0x79, 0xd7, 0x44, 0xc9, 0xab, 0x79, 0xc9, 0xfb, 0x92, 0xfa, 0x78, - 0x7e, 0xb0, 0x64, 0xd7, 0x87, 0xea, 0x93, 0xdc, 0x01, 0x93, 0xf9, 0xae, 0xde, 0xae, 0x89, 0x42, - 0xd7, 0x0a, 0xf7, 0xe2, 0xbb, 0xf1, 0x66, 0x0d, 0xa6, 0xbf, 0xc9, 0x36, 0xd4, 0xe4, 0x5d, 0x7b, - 0xa2, 0xdb, 0x42, 0x99, 0x2b, 0x85, 0x8d, 0x90, 0x76, 0xb0, 0x64, 0x6b, 0x2e, 0x69, 0x3e, 0x97, - 0x4d, 0xbc, 0x53, 0x16, 0xc9, 0xc3, 0x5d, 0x2e, 0x33, 0xdf, 0x03, 0x45, 0xc7, 0xe3, 0x99, 0x6e, - 0x3c, 0xe8, 0xd7, 0x61, 0xe5, 0x94, 0x4e, 0x66, 0xcc, 0x7a, 0x13, 0x9a, 0x19, 0x4f, 0x21, 0x5d, - 0xa8, 0x4f, 0x19, 0xe7, 0x74, 0xc4, 0xba, 0xc6, 0x2d, 0x63, 0xc3, 0xb4, 0xe3, 0xa1, 0xd5, 0x86, - 0x56, 0xd6, 0x4f, 0x32, 0x82, 0xd2, 0x17, 0xa4, 0xe0, 0x29, 0x8b, 0xb8, 0x74, 0x00, 0x2d, 0xa8, - 0x87, 0xd6, 0x7b, 0xb0, 0x56, 0x74, 0x02, 0xb2, 0x06, 0xcb, 0x4f, 0xd9, 0x99, 0xe6, 0x94, 0x9f, - 0xe4, 0x8a, 0x3e, 0x10, 0x7a, 0xb1, 0x69, 0xeb, 0xd3, 0x7d, 0x5e, 0x49, 0x84, 0x13, 0x3f, 0x20, - 0x7b, 0x50, 0x95, 0x81, 0x84, 0xd2, 0xcd, 0xdd, 0xde, 0xb6, 0x8a, 0xb2, 0xed, 0x38, 0xca, 0xb6, - 0x1f, 0xc7, 0x51, 0xd6, 0x6f, 0x7c, 0xf1, 0xfc, 0xe6, 0xd2, 0xe7, 0x7f, 0xbd, 0x69, 0xd8, 0x28, - 0x41, 0x6e, 0xc8, 0xab, 0xa4, 0x9e, 0xef, 0x78, 0xae, 0xde, 0xa7, 0x8e, 0xe3, 0x43, 0x97, 0xec, - 0xc3, 0xda, 0x30, 0xf0, 0x39, 0xf3, 0xf9, 0x8c, 0x3b, 0x21, 0x8d, 0xe8, 0x94, 0xeb, 0x28, 0x89, - 0x2f, 0xee, 0x7e, 0x4c, 0x3e, 0x42, 0xaa, 0xdd, 0x19, 0xe6, 0x27, 0xc8, 0xfb, 0x00, 0xa7, 0x74, - 0xe2, 0xb9, 0x54, 0x04, 0x11, 0xef, 0x56, 0x6f, 0x2d, 0x67, 0x84, 0x8f, 0x63, 0xc2, 0x93, 0xd0, - 0xa5, 0x82, 0xf5, 0xab, 0xf2, 0x64, 0x76, 0x86, 0x9f, 0xdc, 0x86, 0x0e, 0x0d, 0x43, 0x87, 0x0b, - 0x2a, 0x98, 0x33, 0x38, 0x13, 0x8c, 0x63, 0x24, 0xb5, 0xec, 0x55, 0x1a, 0x86, 0x8f, 0xe4, 0x6c, - 0x5f, 0x4e, 0x5a, 0x6e, 0x72, 0x0f, 0xe8, 0xe4, 0x84, 0x40, 0xd5, 0xa5, 0x82, 0xa2, 0x35, 0x5a, - 0x36, 0x7e, 0xcb, 0xb9, 0x90, 0x8a, 0xb1, 0xd6, 0x11, 0xbf, 0xc9, 0x35, 0xa8, 0x8d, 0x99, 0x37, - 0x1a, 0x0b, 0x54, 0x6b, 0xd9, 0xd6, 0x23, 0x69, 0xf8, 0x30, 0x0a, 0x4e, 0x19, 0xc6, 0x79, 0xc3, - 0x56, 0x03, 0xeb, 0x9f, 0x06, 0x5c, 0xba, 0x10, 0x18, 0x72, 0xdd, 0x31, 0xe5, 0xe3, 0x78, 0x2f, - 0xf9, 0x4d, 0xde, 0x92, 0xeb, 0x52, 0x97, 0x45, 0x3a, 0xff, 0xac, 0x6a, 0x8d, 0x0f, 0x70, 0x52, - 0x2b, 0xaa, 0x59, 0xc8, 0x43, 0x58, 0x9b, 0x50, 0x2e, 0x1c, 0xe5, 0xbf, 0x0e, 0xe6, 0x97, 0xe5, - 0x5c, 0x4c, 0x7d, 0x4c, 0x63, 0x3f, 0x97, 0x6e, 0xa5, 0xc5, 0xdb, 0x93, 0xdc, 0x2c, 0x39, 0x80, - 0x2b, 0x83, 0xb3, 0x67, 0xd4, 0x17, 0x9e, 0xcf, 0x9c, 0x0b, 0x36, 0xef, 0xe8, 0xa5, 0x1e, 0x9e, - 0x7a, 0x2e, 0xf3, 0x87, 0xb1, 0xb1, 0x2f, 0x27, 0x22, 0xc9, 0x65, 0x70, 0xeb, 0x16, 0xb4, 0xf3, - 0x51, 0x4c, 0xda, 0x50, 0x11, 0x73, 0xad, 0x61, 0x45, 0xcc, 0x2d, 0x2b, 0xf1, 0xc0, 0x24, 0x94, - 0x2e, 0xf0, 0x6c, 0x42, 0xa7, 0x10, 0xd6, 0x19, 0x73, 0x1b, 0x59, 0x73, 0x5b, 0x1d, 0x58, 0xcd, - 0x45, 0xb3, 0xf5, 0xd9, 0x0a, 0x34, 0x6c, 0xc6, 0x43, 0xe9, 0x4c, 0x64, 0x0f, 0x4c, 0x36, 0x1f, - 0x32, 0x95, 0x48, 0x8d, 0x42, 0x9a, 0x52, 0x3c, 0x0f, 0x63, 0xba, 0x0c, 0xe8, 0x84, 0x99, 0x6c, - 0xe6, 0x40, 0xe0, 0x72, 0x51, 0x28, 0x8b, 0x02, 0x5b, 0x79, 0x14, 0xb8, 0x52, 0xe0, 0x2d, 0xc0, - 0xc0, 0x66, 0x0e, 0x06, 0x8a, 0x0b, 0xe7, 0x70, 0xe0, 0x6e, 0x09, 0x0e, 0x14, 0x8f, 0xbf, 0x00, - 0x08, 0xee, 0x96, 0x00, 0x41, 0xf7, 0xc2, 0x5e, 0xa5, 0x48, 0xb0, 0x95, 0x47, 0x82, 0xa2, 0x3a, - 0x05, 0x28, 0x78, 0xbf, 0x0c, 0x0a, 0x6e, 0x14, 0x64, 0x16, 0x62, 0xc1, 0xbb, 0x17, 0xb0, 0xe0, - 0x5a, 0x41, 0xb4, 0x04, 0x0c, 0xee, 0xe6, 0xb2, 0x34, 0x94, 0xea, 0x56, 0x9e, 0xa6, 0xc9, 0xb7, - 0x2f, 0xe2, 0xc8, 0xf5, 0xe2, 0xd5, 0x96, 0x01, 0xc9, 0x4e, 0x01, 0x48, 0xae, 0x16, 0x4f, 0x59, - 0x40, 0x92, 0x14, 0x0f, 0x36, 0x65, 0xdc, 0x17, 0x3c, 0x4d, 0xe6, 0x08, 0x16, 0x45, 0x41, 0xa4, - 0x13, 0xb6, 0x1a, 0x58, 0x1b, 0x32, 0x13, 0xa5, 0xfe, 0xf5, 0x02, 0xec, 0x40, 0xa7, 0xcf, 0x78, - 0x97, 0xf5, 0x4b, 0x23, 0x95, 0xc5, 0x88, 0xce, 0x66, 0x31, 0x53, 0x67, 0xb1, 0x0c, 0xa4, 0x54, - 0x72, 0x90, 0x42, 0xbe, 0x01, 0x97, 0x30, 0x8d, 0xa0, 0x5d, 0x9c, 0x5c, 0x5a, 0xeb, 0x48, 0x82, - 0x32, 0x88, 0xca, 0x6f, 0x6f, 0xc3, 0xe5, 0x0c, 0xaf, 0x4c, 0xb1, 0x98, 0xc2, 0xaa, 0x18, 0xbc, - 0x6b, 0x09, 0xf7, 0x7e, 0x18, 0x1e, 0x50, 0x3e, 0xb6, 0x7e, 0x90, 0xea, 0x9f, 0xc2, 0x15, 0x81, - 0xea, 0x30, 0x70, 0x95, 0x5a, 0xab, 0x36, 0x7e, 0x4b, 0x08, 0x9b, 0x04, 0x23, 0xdc, 0xd5, 0xb4, - 0xe5, 0xa7, 0xe4, 0x4a, 0x22, 0xc5, 0x54, 0x21, 0x61, 0xfd, 0xc2, 0x48, 0xd7, 0x4b, 0x11, 0xac, - 0x0c, 0x6c, 0x8c, 0xff, 0x05, 0x6c, 0x2a, 0xaf, 0x06, 0x36, 0xd6, 0x6f, 0x8c, 0xf4, 0x46, 0x12, - 0x18, 0x79, 0x3d, 0x15, 0xa5, 0x73, 0x78, 0xbe, 0xcb, 0xe6, 0x18, 0xf0, 0xcb, 0xb6, 0x1a, 0xc4, - 0x08, 0x5f, 0x43, 0x33, 0xe7, 0x11, 0xbe, 0x8e, 0x73, 0x6a, 0xa0, 0xe1, 0x27, 0x38, 0xc1, 0x48, - 0x6c, 0xd9, 0x6a, 0x90, 0xc9, 0x9e, 0x66, 0x2e, 0x7b, 0x1e, 0x01, 0xb9, 0x18, 0xa3, 0xe4, 0x3d, - 0xa8, 0x0a, 0x3a, 0x92, 0x26, 0x94, 0x56, 0x68, 0x6f, 0xab, 0x7a, 0x79, 0xfb, 0xa3, 0xe3, 0x23, - 0xea, 0x45, 0xfd, 0x6b, 0x52, 0xfb, 0x7f, 0x3f, 0xbf, 0xd9, 0x96, 0x3c, 0x5b, 0xc1, 0xd4, 0x13, - 0x6c, 0x1a, 0x8a, 0x33, 0x1b, 0x65, 0xac, 0x3f, 0x1b, 0x32, 0x77, 0xe7, 0x62, 0xb7, 0xd4, 0x16, - 0xb1, 0x83, 0x56, 0x32, 0x30, 0xfb, 0x72, 0xf6, 0xf9, 0x32, 0xc0, 0x88, 0x72, 0xe7, 0x53, 0xea, - 0x0b, 0xe6, 0x6a, 0x23, 0x99, 0x23, 0xca, 0x7f, 0x82, 0x13, 0xb2, 0x26, 0x91, 0xe4, 0x19, 0x67, - 0x2e, 0x5a, 0x6b, 0xd9, 0xae, 0x8f, 0x28, 0x7f, 0xc2, 0x99, 0x9b, 0xe8, 0x55, 0x7f, 0x0d, 0xbd, - 0xfe, 0x92, 0x71, 0xbc, 0x14, 0xb8, 0xfe, 0x1f, 0x34, 0xfb, 0x97, 0x21, 0x11, 0x39, 0x9f, 0xfc, - 0xc8, 0x21, 0x5c, 0x4a, 0xdc, 0xdb, 0x99, 0xa1, 0xdb, 0xc7, 0xfe, 0xf0, 0xe2, 0xa8, 0x58, 0x3b, - 0xcd, 0x4f, 0x73, 0xf2, 0x43, 0xb8, 0x5e, 0x08, 0xce, 0x64, 0xc1, 0xca, 0x0b, 0x63, 0xf4, 0x6a, - 0x3e, 0x46, 0xe3, 0xf5, 0x62, 0x5d, 0x97, 0x5f, 0x43, 0xd7, 0xaf, 0xc9, 0xf2, 0x24, 0x9b, 0xb2, - 0xcb, 0x6e, 0xcb, 0xfa, 0x95, 0x01, 0x9d, 0xc2, 0x61, 0xc8, 0x0e, 0x80, 0xca, 0x78, 0xdc, 0x7b, - 0x16, 0x97, 0xca, 0x6b, 0xfa, 0xe0, 0x68, 0xb2, 0x47, 0xde, 0x33, 0x66, 0x9b, 0x83, 0xf8, 0x93, - 0xdc, 0x86, 0xba, 0x98, 0x2b, 0xee, 0x7c, 0x21, 0xf7, 0x78, 0x8e, 0xac, 0x35, 0x81, 0xff, 0xe4, - 0x0e, 0xb4, 0xd4, 0xc2, 0xa3, 0x80, 0x73, 0x2f, 0xd4, 0x45, 0x04, 0xc9, 0x2e, 0xfd, 0x21, 0x52, - 0xec, 0xe6, 0x20, 0x1d, 0x58, 0x3f, 0x05, 0x33, 0xd9, 0x96, 0xbc, 0x01, 0xe6, 0x94, 0xce, 0x75, - 0x95, 0x2b, 0xcf, 0xb6, 0x62, 0x37, 0xa6, 0x74, 0x8e, 0x05, 0x2e, 0xb9, 0x0e, 0x75, 0x49, 0x14, - 0x73, 0x65, 0xef, 0x15, 0xbb, 0x36, 0xa5, 0xf3, 0xc7, 0xf3, 0x84, 0x30, 0xa2, 0x3c, 0x2e, 0x61, - 0xa7, 0x74, 0xfe, 0x21, 0xe5, 0xd6, 0x07, 0x50, 0x53, 0x87, 0x7c, 0xa9, 0x85, 0xa5, 0x7c, 0x25, - 0x27, 0xff, 0x5d, 0x68, 0x66, 0xce, 0x4d, 0xbe, 0x09, 0x57, 0x95, 0x86, 0x21, 0x8d, 0x04, 0x5a, - 0x24, 0xb7, 0x20, 0x41, 0xe2, 0x11, 0x8d, 0x84, 0xdc, 0x52, 0x15, 0xe5, 0xdf, 0x87, 0x76, 0xbe, - 0x70, 0x25, 0x7b, 0xd0, 0xd2, 0x45, 0xee, 0x69, 0x90, 0xfa, 0x62, 0x5c, 0x9a, 0x1e, 0x07, 0x82, - 0x65, 0xea, 0xdb, 0xa6, 0x62, 0x95, 0xb3, 0xdc, 0xfa, 0x63, 0x15, 0x6a, 0xaa, 0x78, 0x26, 0xb7, - 0x33, 0xfd, 0x0a, 0x22, 0x63, 0xbf, 0x79, 0xfe, 0xfc, 0x66, 0x1d, 0x41, 0xe4, 0xf0, 0x41, 0xda, - 0xbc, 0xa4, 0xe9, 0xb2, 0x92, 0xab, 0xed, 0xe3, 0x4e, 0x69, 0xf9, 0x95, 0x3b, 0xa5, 0xeb, 0x50, - 0xf7, 0x67, 0x53, 0xbc, 0x84, 0xaa, 0x5a, 0xd2, 0x9f, 0x4d, 0xe5, 0x25, 0xbc, 0x01, 0xa6, 0x08, - 0x04, 0x9d, 0x20, 0x49, 0x85, 0x7c, 0x03, 0x27, 0x24, 0x71, 0x0f, 0x56, 0x33, 0x58, 0xeb, 0xb9, - 0xba, 0x90, 0x6b, 0x67, 0x9d, 0xe3, 0xf0, 0x41, 0xac, 0x74, 0x82, 0xbd, 0x87, 0x2e, 0xd9, 0xc8, - 0x37, 0x06, 0x08, 0xd1, 0x0a, 0x27, 0x32, 0xb5, 0xbf, 0x04, 0x68, 0x79, 0x00, 0xe9, 0xf4, 0x8a, - 0x45, 0x81, 0x46, 0x43, 0x4e, 0x20, 0xf1, 0x4d, 0xe8, 0xa4, 0x28, 0xa7, 0x58, 0x4c, 0xb5, 0x4a, - 0x3a, 0x8d, 0x8c, 0xef, 0xc0, 0x15, 0x9f, 0xcd, 0x85, 0x53, 0xe4, 0x06, 0xe4, 0x26, 0x92, 0x76, - 0x9c, 0x97, 0xf8, 0x3a, 0xb4, 0xd3, 0xb4, 0x80, 0xbc, 0x4d, 0xd5, 0x9e, 0x25, 0xb3, 0xc8, 0x76, - 0x03, 0x1a, 0x49, 0x8d, 0xd1, 0x42, 0x86, 0x3a, 0x55, 0xa5, 0x45, 0x52, 0xb5, 0x44, 0x8c, 0xcf, - 0x26, 0x42, 0x2f, 0xb2, 0x8a, 0x3c, 0x58, 0xb5, 0xd8, 0x6a, 0x1e, 0x79, 0xbf, 0x0a, 0xab, 0x4c, - 0xb7, 0x2f, 0x8a, 0xaf, 0x8d, 0x7c, 0xad, 0x78, 0x12, 0x99, 0x36, 0x61, 0x2d, 0x8c, 0x82, 0x30, - 0xe0, 0x2c, 0x72, 0xa8, 0xeb, 0x46, 0x8c, 0xf3, 0x6e, 0x47, 0xad, 0x17, 0xcf, 0xef, 0xab, 0x69, - 0xeb, 0x67, 0x50, 0xd7, 0xd6, 0x2f, 0x6d, 0xe2, 0xbe, 0x03, 0x2d, 0xe9, 0xec, 0xdc, 0xc9, 0xb5, - 0x72, 0x71, 0x29, 0x8d, 0xbe, 0xce, 0x44, 0xae, 0xa3, 0x6b, 0x22, 0xbf, 0x9a, 0xb2, 0xee, 0xc2, - 0x6a, 0x8e, 0x47, 0xa2, 0x3a, 0x3a, 0x85, 0x0e, 0x19, 0x35, 0x48, 0x76, 0xae, 0xa4, 0x3b, 0x5b, - 0xf7, 0xc0, 0x4c, 0x0c, 0x2d, 0x2b, 0xbe, 0x58, 0x0f, 0x43, 0xdb, 0x4e, 0x0d, 0xb1, 0x4c, 0x08, - 0x3e, 0x65, 0x91, 0x8e, 0x7c, 0x35, 0xb0, 0x9e, 0x40, 0xa7, 0x90, 0xd5, 0xc9, 0x16, 0xd4, 0xc3, - 0xd9, 0xc0, 0x89, 0x5f, 0x17, 0xd2, 0x34, 0x76, 0x34, 0x1b, 0x7c, 0xc4, 0xce, 0xe2, 0x7e, 0x34, - 0xc4, 0x51, 0xba, 0x6c, 0x25, 0xbb, 0xec, 0xcf, 0x0d, 0x68, 0xc4, 0x11, 0x4a, 0xbe, 0x05, 0x66, - 0xe2, 0x24, 0x85, 0x3c, 0x9a, 0xec, 0xad, 0x57, 0x4d, 0x19, 0xe5, 0x5d, 0x73, 0x6f, 0xe4, 0x33, - 0xd7, 0x49, 0x03, 0x02, 0x37, 0x69, 0xd8, 0x1d, 0x45, 0xf8, 0x38, 0xf6, 0x7e, 0xf2, 0x95, 0x24, - 0x55, 0x44, 0xc1, 0xcc, 0x77, 0xb5, 0x8a, 0x3a, 0x27, 0xd8, 0x72, 0xca, 0x7a, 0x07, 0x6a, 0xea, - 0xfc, 0xd2, 0x86, 0x72, 0xf3, 0xb8, 0x50, 0x96, 0xdf, 0xa5, 0x98, 0xf0, 0x27, 0x03, 0x1a, 0x71, - 0x03, 0x5c, 0x2a, 0x94, 0xd3, 0xab, 0xf2, 0xb2, 0x7a, 0x2d, 0x7a, 0x45, 0x88, 0x33, 0x4d, 0xf5, - 0x95, 0x33, 0xcd, 0x16, 0x10, 0x95, 0x50, 0x4e, 0x03, 0xe1, 0xf9, 0x23, 0x47, 0xdd, 0x87, 0xca, - 0x2c, 0x6b, 0x48, 0x39, 0x46, 0xc2, 0x91, 0x9c, 0xdf, 0xfd, 0x6c, 0x05, 0x3a, 0xfb, 0xfd, 0xfb, - 0x87, 0xfb, 0x61, 0x38, 0xf1, 0x86, 0x14, 0xab, 0xf3, 0x1d, 0xa8, 0x62, 0xff, 0x51, 0xf2, 0xf2, - 0xd9, 0x2b, 0x6b, 0x84, 0xc9, 0x2e, 0xac, 0x60, 0x1b, 0x42, 0xca, 0x1e, 0x40, 0x7b, 0xa5, 0xfd, - 0xb0, 0xdc, 0x44, 0x35, 0x2a, 0x17, 0xdf, 0x41, 0x7b, 0x65, 0x4d, 0x31, 0xf9, 0x00, 0xcc, 0xb4, - 0x81, 0x58, 0xf4, 0x1a, 0xda, 0x5b, 0xd8, 0x1e, 0x4b, 0xf9, 0xb4, 0x6e, 0x5b, 0xf4, 0xa8, 0xd7, - 0x5b, 0xd8, 0x47, 0x92, 0x3d, 0xa8, 0xc7, 0xf5, 0x6c, 0xf9, 0x7b, 0x65, 0x6f, 0x41, 0xeb, 0x2a, - 0xcd, 0xa3, 0x7a, 0x82, 0xb2, 0x47, 0xd5, 0x5e, 0x69, 0x7f, 0x4d, 0xee, 0x40, 0x4d, 0x17, 0x28, - 0xa5, 0x6f, 0x96, 0xbd, 0xf2, 0x06, 0x54, 0x2a, 0x99, 0x76, 0x45, 0x8b, 0x1e, 0x7e, 0x7b, 0x0b, - 0x1f, 0x02, 0xc8, 0x3e, 0x40, 0xa6, 0x0f, 0x58, 0xf8, 0xa2, 0xdb, 0x5b, 0xdc, 0xe0, 0x93, 0x7b, - 0xd0, 0x48, 0x1f, 0x6d, 0xca, 0xdf, 0x68, 0x7b, 0x8b, 0x7a, 0xee, 0xfe, 0x97, 0xfe, 0xf3, 0xf7, - 0x75, 0xe3, 0xd7, 0xe7, 0xeb, 0xc6, 0x6f, 0xcf, 0xd7, 0x8d, 0x2f, 0xce, 0xd7, 0x8d, 0x3f, 0x9c, - 0xaf, 0x1b, 0x7f, 0x3b, 0x5f, 0x37, 0x7e, 0xf7, 0x8f, 0x75, 0x63, 0x50, 0x43, 0xf7, 0x7f, 0xf7, - 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x30, 0x52, 0xb5, 0x7b, 0x56, 0x18, 0x00, 0x00, +var fileDescriptor_types_bafb6deff4c77e13 = []byte{ + // 2115 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6e, 0x1b, 0xc9, + 0xd1, 0xd7, 0x50, 0x14, 0xc9, 0x29, 0x4a, 0xa4, 0xdc, 0xb6, 0x25, 0x9a, 0xfb, 0x7d, 0x92, 0x31, + 0x49, 0xbc, 0x52, 0x56, 0x2b, 0x6d, 0xb4, 0x71, 0x20, 0xaf, 0x37, 0x8b, 0x88, 0xb6, 0xb3, 0x12, + 0x76, 0x93, 0x28, 0x63, 0x5b, 0x01, 0x82, 0x00, 0x83, 0x26, 0xa7, 0x45, 0x0e, 0x4c, 0xce, 0xcc, + 0x4e, 0x37, 0xb5, 0x94, 0x9f, 0x61, 0x0f, 0x7b, 0x08, 0x90, 0x73, 0x6e, 0x79, 0x81, 0x00, 0x39, + 0xe6, 0x14, 0xec, 0x31, 0x08, 0x12, 0xe4, 0xe6, 0x24, 0x0a, 0x72, 0x48, 0x9e, 0x20, 0xc7, 0xa0, + 0xab, 0x7b, 0xfe, 0x6a, 0x68, 0xd8, 0xce, 0x2d, 0x17, 0x72, 0xba, 0xab, 0xaa, 0xbb, 0xab, 0xba, + 0xaa, 0x7e, 0x55, 0x0d, 0x6b, 0xb4, 0x3f, 0xf0, 0xf6, 0xc4, 0x45, 0xc8, 0xb8, 0xfa, 0xdd, 0x0d, + 0xa3, 0x40, 0x04, 0x64, 0x09, 0x07, 0xdd, 0x77, 0x87, 0x9e, 0x18, 0x4d, 0xfb, 0xbb, 0x83, 0x60, + 0xb2, 0x37, 0x0c, 0x86, 0xc1, 0x1e, 0x52, 0xfb, 0xd3, 0x33, 0x1c, 0xe1, 0x00, 0xbf, 0x94, 0x54, + 0x77, 0x73, 0x18, 0x04, 0xc3, 0x31, 0x4b, 0xb9, 0x84, 0x37, 0x61, 0x5c, 0xd0, 0x49, 0xa8, 0x19, + 0x0e, 0x32, 0xeb, 0x09, 0xe6, 0xbb, 0x2c, 0x9a, 0x78, 0xbe, 0xc8, 0x7e, 0x8e, 0xbd, 0x3e, 0xdf, + 0x1b, 0x04, 0x93, 0x49, 0xe0, 0x67, 0x0f, 0x64, 0xfd, 0xae, 0x0a, 0x75, 0x9b, 0x7d, 0x36, 0x65, + 0x5c, 0x90, 0x2d, 0xa8, 0xb2, 0xc1, 0x28, 0xe8, 0x54, 0x6e, 0x1b, 0x5b, 0xcd, 0x7d, 0xb2, 0xab, + 0xf8, 0x34, 0xf5, 0xd1, 0x60, 0x14, 0x1c, 0x2d, 0xd8, 0xc8, 0x41, 0xde, 0x81, 0xa5, 0xb3, 0xf1, + 0x94, 0x8f, 0x3a, 0x8b, 0xc8, 0x7a, 0x3d, 0xcf, 0xfa, 0x7d, 0x49, 0x3a, 0x5a, 0xb0, 0x15, 0x8f, + 0x5c, 0xd6, 0xf3, 0xcf, 0x82, 0x4e, 0xb5, 0x6c, 0xd9, 0x63, 0xff, 0x0c, 0x97, 0x95, 0x1c, 0xe4, + 0x00, 0x80, 0x33, 0xe1, 0x04, 0xa1, 0xf0, 0x02, 0xbf, 0xb3, 0x84, 0xfc, 0xeb, 0x79, 0xfe, 0xc7, + 0x4c, 0xfc, 0x08, 0xc9, 0x47, 0x0b, 0xb6, 0xc9, 0xe3, 0x81, 0x94, 0xf4, 0x7c, 0x4f, 0x38, 0x83, + 0x11, 0xf5, 0xfc, 0x4e, 0xad, 0x4c, 0xf2, 0xd8, 0xf7, 0xc4, 0x03, 0x49, 0x96, 0x92, 0x5e, 0x3c, + 0x90, 0xaa, 0x7c, 0x36, 0x65, 0xd1, 0x45, 0xa7, 0x5e, 0xa6, 0xca, 0x8f, 0x25, 0x49, 0xaa, 0x82, + 0x3c, 0xe4, 0x3e, 0x34, 0xfb, 0x6c, 0xe8, 0xf9, 0x4e, 0x7f, 0x1c, 0x0c, 0x9e, 0x75, 0x1a, 0x28, + 0xd2, 0xc9, 0x8b, 0xf4, 0x24, 0x43, 0x4f, 0xd2, 0x8f, 0x16, 0x6c, 0xe8, 0x27, 0x23, 0xb2, 0x0f, + 0x8d, 0xc1, 0x88, 0x0d, 0x9e, 0x39, 0x62, 0xd6, 0x31, 0x51, 0xf2, 0x66, 0x5e, 0xf2, 0x81, 0xa4, + 0x3e, 0x99, 0x1d, 0x2d, 0xd8, 0xf5, 0x81, 0xfa, 0x24, 0x77, 0xc1, 0x64, 0xbe, 0xab, 0xb7, 0x6b, + 0xa2, 0xd0, 0x5a, 0xe1, 0x5e, 0x7c, 0x37, 0xde, 0xac, 0xc1, 0xf4, 0x37, 0xd9, 0x85, 0x9a, 0xbc, + 0x6b, 0x4f, 0x74, 0x96, 0x51, 0xe6, 0x46, 0x61, 0x23, 0xa4, 0x1d, 0x2d, 0xd8, 0x9a, 0x4b, 0x9a, + 0xcf, 0x65, 0x63, 0xef, 0x9c, 0x45, 0xf2, 0x70, 0xd7, 0xcb, 0xcc, 0xf7, 0x50, 0xd1, 0xf1, 0x78, + 0xa6, 0x1b, 0x0f, 0x7a, 0x75, 0x58, 0x3a, 0xa7, 0xe3, 0x29, 0xb3, 0xde, 0x86, 0x66, 0xc6, 0x53, + 0x48, 0x07, 0xea, 0x13, 0xc6, 0x39, 0x1d, 0xb2, 0x8e, 0x71, 0xdb, 0xd8, 0x32, 0xed, 0x78, 0x68, + 0xb5, 0x60, 0x39, 0xeb, 0x27, 0x19, 0x41, 0xe9, 0x0b, 0x52, 0xf0, 0x9c, 0x45, 0x5c, 0x3a, 0x80, + 0x16, 0xd4, 0x43, 0xeb, 0x03, 0x58, 0x2d, 0x3a, 0x01, 0x59, 0x85, 0xc5, 0x67, 0xec, 0x42, 0x73, + 0xca, 0x4f, 0x72, 0x43, 0x1f, 0x08, 0xbd, 0xd8, 0xb4, 0xf5, 0xe9, 0xbe, 0xac, 0x24, 0xc2, 0x89, + 0x1f, 0x90, 0x03, 0xa8, 0xca, 0x40, 0x42, 0xe9, 0xe6, 0x7e, 0x77, 0x57, 0x45, 0xd9, 0x6e, 0x1c, + 0x65, 0xbb, 0x4f, 0xe2, 0x28, 0xeb, 0x35, 0xbe, 0x7a, 0xb1, 0xb9, 0xf0, 0xe5, 0x5f, 0x36, 0x0d, + 0x1b, 0x25, 0xc8, 0x2d, 0x79, 0x95, 0xd4, 0xf3, 0x1d, 0xcf, 0xd5, 0xfb, 0xd4, 0x71, 0x7c, 0xec, + 0x92, 0x43, 0x58, 0x1d, 0x04, 0x3e, 0x67, 0x3e, 0x9f, 0x72, 0x27, 0xa4, 0x11, 0x9d, 0x70, 0x1d, + 0x25, 0xf1, 0xc5, 0x3d, 0x88, 0xc9, 0x27, 0x48, 0xb5, 0xdb, 0x83, 0xfc, 0x04, 0xf9, 0x10, 0xe0, + 0x9c, 0x8e, 0x3d, 0x97, 0x8a, 0x20, 0xe2, 0x9d, 0xea, 0xed, 0xc5, 0x8c, 0xf0, 0x69, 0x4c, 0x78, + 0x1a, 0xba, 0x54, 0xb0, 0x5e, 0x55, 0x9e, 0xcc, 0xce, 0xf0, 0x93, 0x3b, 0xd0, 0xa6, 0x61, 0xe8, + 0x70, 0x41, 0x05, 0x73, 0xfa, 0x17, 0x82, 0x71, 0x8c, 0xa4, 0x65, 0x7b, 0x85, 0x86, 0xe1, 0x63, + 0x39, 0xdb, 0x93, 0x93, 0x96, 0x9b, 0xdc, 0x03, 0x3a, 0x39, 0x21, 0x50, 0x75, 0xa9, 0xa0, 0x68, + 0x8d, 0x65, 0x1b, 0xbf, 0xe5, 0x5c, 0x48, 0xc5, 0x48, 0xeb, 0x88, 0xdf, 0x64, 0x0d, 0x6a, 0x23, + 0xe6, 0x0d, 0x47, 0x02, 0xd5, 0x5a, 0xb4, 0xf5, 0x48, 0x1a, 0x3e, 0x8c, 0x82, 0x73, 0x86, 0x71, + 0xde, 0xb0, 0xd5, 0xc0, 0xfa, 0x87, 0x01, 0xd7, 0xae, 0x04, 0x86, 0x5c, 0x77, 0x44, 0xf9, 0x28, + 0xde, 0x4b, 0x7e, 0x93, 0x77, 0xe4, 0xba, 0xd4, 0x65, 0x91, 0xce, 0x3f, 0x2b, 0x5a, 0xe3, 0x23, + 0x9c, 0xd4, 0x8a, 0x6a, 0x16, 0xf2, 0x08, 0x56, 0xc7, 0x94, 0x0b, 0x47, 0xf9, 0xaf, 0x83, 0xf9, + 0x65, 0x31, 0x17, 0x53, 0x9f, 0xd2, 0xd8, 0xcf, 0xa5, 0x5b, 0x69, 0xf1, 0xd6, 0x38, 0x37, 0x4b, + 0x8e, 0xe0, 0x46, 0xff, 0xe2, 0x39, 0xf5, 0x85, 0xe7, 0x33, 0xe7, 0x8a, 0xcd, 0xdb, 0x7a, 0xa9, + 0x47, 0xe7, 0x9e, 0xcb, 0xfc, 0x41, 0x6c, 0xec, 0xeb, 0x89, 0x48, 0x72, 0x19, 0xdc, 0xba, 0x0d, + 0xad, 0x7c, 0x14, 0x93, 0x16, 0x54, 0xc4, 0x4c, 0x6b, 0x58, 0x11, 0x33, 0xcb, 0x4a, 0x3c, 0x30, + 0x09, 0xa5, 0x2b, 0x3c, 0xdb, 0xd0, 0x2e, 0x84, 0x75, 0xc6, 0xdc, 0x46, 0xd6, 0xdc, 0x56, 0x1b, + 0x56, 0x72, 0xd1, 0x6c, 0x7d, 0xb1, 0x04, 0x0d, 0x9b, 0xf1, 0x50, 0x3a, 0x13, 0x39, 0x00, 0x93, + 0xcd, 0x06, 0x4c, 0x25, 0x52, 0xa3, 0x90, 0xa6, 0x14, 0xcf, 0xa3, 0x98, 0x2e, 0x03, 0x3a, 0x61, + 0x26, 0xdb, 0x39, 0x10, 0xb8, 0x5e, 0x14, 0xca, 0xa2, 0xc0, 0x4e, 0x1e, 0x05, 0x6e, 0x14, 0x78, + 0x0b, 0x30, 0xb0, 0x9d, 0x83, 0x81, 0xe2, 0xc2, 0x39, 0x1c, 0xb8, 0x57, 0x82, 0x03, 0xc5, 0xe3, + 0xcf, 0x01, 0x82, 0x7b, 0x25, 0x40, 0xd0, 0xb9, 0xb2, 0x57, 0x29, 0x12, 0xec, 0xe4, 0x91, 0xa0, + 0xa8, 0x4e, 0x01, 0x0a, 0x3e, 0x2c, 0x83, 0x82, 0x5b, 0x05, 0x99, 0xb9, 0x58, 0xf0, 0xfe, 0x15, + 0x2c, 0x58, 0x2b, 0x88, 0x96, 0x80, 0xc1, 0xbd, 0x5c, 0x96, 0x86, 0x52, 0xdd, 0xca, 0xd3, 0x34, + 0xf9, 0xce, 0x55, 0x1c, 0x59, 0x2f, 0x5e, 0x6d, 0x19, 0x90, 0xec, 0x15, 0x80, 0xe4, 0x66, 0xf1, + 0x94, 0x05, 0x24, 0x49, 0xf1, 0x60, 0x5b, 0xc6, 0x7d, 0xc1, 0xd3, 0x64, 0x8e, 0x60, 0x51, 0x14, + 0x44, 0x3a, 0x61, 0xab, 0x81, 0xb5, 0x25, 0x33, 0x51, 0xea, 0x5f, 0x2f, 0xc1, 0x0e, 0x74, 0xfa, + 0x8c, 0x77, 0x59, 0xbf, 0x30, 0x52, 0x59, 0x8c, 0xe8, 0x6c, 0x16, 0x33, 0x75, 0x16, 0xcb, 0x40, + 0x4a, 0x25, 0x07, 0x29, 0xe4, 0x9b, 0x70, 0x0d, 0xd3, 0x08, 0xda, 0xc5, 0xc9, 0xa5, 0xb5, 0xb6, + 0x24, 0x28, 0x83, 0xa8, 0xfc, 0xf6, 0x2e, 0x5c, 0xcf, 0xf0, 0xca, 0x14, 0x8b, 0x29, 0xac, 0x8a, + 0xc1, 0xbb, 0x9a, 0x70, 0x1f, 0x86, 0xe1, 0x11, 0xe5, 0x23, 0xeb, 0x07, 0xa9, 0xfe, 0x29, 0x5c, + 0x11, 0xa8, 0x0e, 0x02, 0x57, 0xa9, 0xb5, 0x62, 0xe3, 0xb7, 0x84, 0xb0, 0x71, 0x30, 0xc4, 0x5d, + 0x4d, 0x5b, 0x7e, 0x4a, 0xae, 0x24, 0x52, 0x4c, 0x15, 0x12, 0xd6, 0xcf, 0x8d, 0x74, 0xbd, 0x14, + 0xc1, 0xca, 0xc0, 0xc6, 0xf8, 0x6f, 0xc0, 0xa6, 0xf2, 0x7a, 0x60, 0x63, 0xfd, 0xda, 0x48, 0x6f, + 0x24, 0x81, 0x91, 0x37, 0x53, 0x51, 0x3a, 0x87, 0xe7, 0xbb, 0x6c, 0x86, 0x01, 0xbf, 0x68, 0xab, + 0x41, 0x8c, 0xf0, 0x35, 0x34, 0x73, 0x1e, 0xe1, 0xeb, 0x38, 0xa7, 0x06, 0x1a, 0x7e, 0x82, 0x33, + 0x8c, 0xc4, 0x65, 0x5b, 0x0d, 0x32, 0xd9, 0xd3, 0xcc, 0x65, 0xcf, 0x13, 0x20, 0x57, 0x63, 0x94, + 0x7c, 0x00, 0x55, 0x41, 0x87, 0xd2, 0x84, 0xd2, 0x0a, 0xad, 0x5d, 0x55, 0x2f, 0xef, 0x7e, 0x72, + 0x7a, 0x42, 0xbd, 0xa8, 0xb7, 0x26, 0xb5, 0xff, 0xd7, 0x8b, 0xcd, 0x96, 0xe4, 0xd9, 0x09, 0x26, + 0x9e, 0x60, 0x93, 0x50, 0x5c, 0xd8, 0x28, 0x63, 0xfd, 0xc9, 0x90, 0xb9, 0x3b, 0x17, 0xbb, 0xa5, + 0xb6, 0x88, 0x1d, 0xb4, 0x92, 0x81, 0xd9, 0x57, 0xb3, 0xcf, 0xff, 0x03, 0x0c, 0x29, 0x77, 0x3e, + 0xa7, 0xbe, 0x60, 0xae, 0x36, 0x92, 0x39, 0xa4, 0xfc, 0x27, 0x38, 0x21, 0x6b, 0x12, 0x49, 0x9e, + 0x72, 0xe6, 0xa2, 0xb5, 0x16, 0xed, 0xfa, 0x90, 0xf2, 0xa7, 0x9c, 0xb9, 0x89, 0x5e, 0xf5, 0x37, + 0xd0, 0xeb, 0xcf, 0x19, 0xc7, 0x4b, 0x81, 0xeb, 0x7f, 0x41, 0xb3, 0x7f, 0x1a, 0x12, 0x91, 0xf3, + 0xc9, 0x8f, 0x1c, 0xc3, 0xb5, 0xc4, 0xbd, 0x9d, 0x29, 0xba, 0x7d, 0xec, 0x0f, 0x2f, 0x8f, 0x8a, + 0xd5, 0xf3, 0xfc, 0x34, 0x27, 0x3f, 0x84, 0xf5, 0x42, 0x70, 0x26, 0x0b, 0x56, 0x5e, 0x1a, 0xa3, + 0x37, 0xf3, 0x31, 0x1a, 0xaf, 0x17, 0xeb, 0xba, 0xf8, 0x06, 0xba, 0x7e, 0x5d, 0x96, 0x27, 0xd9, + 0x94, 0x5d, 0x76, 0x5b, 0xd6, 0x2f, 0x0d, 0x68, 0x17, 0x0e, 0x43, 0xf6, 0x00, 0x54, 0xc6, 0xe3, + 0xde, 0xf3, 0xb8, 0x54, 0x5e, 0xd5, 0x07, 0x47, 0x93, 0x3d, 0xf6, 0x9e, 0x33, 0xdb, 0xec, 0xc7, + 0x9f, 0xe4, 0x0e, 0xd4, 0xc5, 0x4c, 0x71, 0xe7, 0x0b, 0xb9, 0x27, 0x33, 0x64, 0xad, 0x09, 0xfc, + 0x27, 0x77, 0x61, 0x59, 0x2d, 0x3c, 0x0c, 0x38, 0xf7, 0x42, 0x5d, 0x44, 0x90, 0xec, 0xd2, 0x1f, + 0x23, 0xc5, 0x6e, 0xf6, 0xd3, 0x81, 0xf5, 0x53, 0x30, 0x93, 0x6d, 0xc9, 0x5b, 0x60, 0x4e, 0xe8, + 0x4c, 0x57, 0xb9, 0xf2, 0x6c, 0x4b, 0x76, 0x63, 0x42, 0x67, 0x58, 0xe0, 0x92, 0x75, 0xa8, 0x4b, + 0xa2, 0x98, 0x29, 0x7b, 0x2f, 0xd9, 0xb5, 0x09, 0x9d, 0x3d, 0x99, 0x25, 0x84, 0x21, 0xe5, 0x71, + 0x09, 0x3b, 0xa1, 0xb3, 0x8f, 0x29, 0xb7, 0x3e, 0x82, 0x9a, 0x3a, 0xe4, 0x2b, 0x2d, 0x2c, 0xe5, + 0x2b, 0x39, 0xf9, 0xef, 0x41, 0x33, 0x73, 0x6e, 0xf2, 0x2d, 0xb8, 0xa9, 0x34, 0x0c, 0x69, 0x24, + 0xd0, 0x22, 0xb9, 0x05, 0x09, 0x12, 0x4f, 0x68, 0x24, 0xe4, 0x96, 0xaa, 0x28, 0x7f, 0x0c, 0xad, + 0x7c, 0xe1, 0x2a, 0xf3, 0x5a, 0x14, 0x4c, 0x7d, 0x57, 0x0b, 0xa9, 0x81, 0xec, 0x5a, 0xcf, 0x03, + 0xe5, 0x49, 0xd9, 0x4a, 0xf5, 0x34, 0x10, 0x2c, 0x53, 0xee, 0x2a, 0x1e, 0xeb, 0x0f, 0x55, 0xa8, + 0xa9, 0x2a, 0x9a, 0xdc, 0xc9, 0x34, 0x2e, 0x08, 0x91, 0xbd, 0xe6, 0xe5, 0x8b, 0xcd, 0x3a, 0xa2, + 0xc9, 0xf1, 0xc3, 0xb4, 0x8b, 0x49, 0xf3, 0x66, 0x25, 0x57, 0xe4, 0xc7, 0x2d, 0xd3, 0xe2, 0x6b, + 0xb7, 0x4c, 0xeb, 0x50, 0xf7, 0xa7, 0x13, 0xbc, 0x8d, 0xaa, 0x5a, 0xd2, 0x9f, 0x4e, 0xe4, 0x6d, + 0xbc, 0x05, 0xa6, 0x08, 0x04, 0x1d, 0x23, 0x49, 0xc5, 0x7e, 0x03, 0x27, 0x24, 0xf1, 0x00, 0x56, + 0x32, 0xa0, 0xeb, 0xb9, 0xba, 0xa2, 0x6b, 0x65, 0xbd, 0xe4, 0xf8, 0xa1, 0x56, 0xb7, 0x99, 0x80, + 0xf0, 0xb1, 0x4b, 0xb6, 0xf2, 0x1d, 0x02, 0x62, 0xb5, 0x02, 0x8c, 0x4c, 0x13, 0x20, 0x91, 0x5a, + 0x1e, 0x40, 0x7a, 0xbf, 0x62, 0x51, 0xe8, 0xd1, 0x90, 0x13, 0x48, 0x7c, 0x1b, 0xda, 0x29, 0xdc, + 0x29, 0x16, 0x53, 0xad, 0x92, 0x4e, 0x23, 0xe3, 0x7b, 0x70, 0xc3, 0x67, 0x33, 0xe1, 0x14, 0xb9, + 0x01, 0xb9, 0x89, 0xa4, 0x9d, 0xe6, 0x25, 0xbe, 0x01, 0xad, 0x34, 0x3f, 0x20, 0x6f, 0x53, 0xf5, + 0x69, 0xc9, 0x2c, 0xb2, 0xdd, 0x82, 0x46, 0x52, 0x6c, 0x2c, 0x23, 0x43, 0x9d, 0xaa, 0x1a, 0x23, + 0x29, 0x5f, 0x22, 0xc6, 0xa7, 0x63, 0xa1, 0x17, 0x59, 0x41, 0x1e, 0x2c, 0x5f, 0x6c, 0x35, 0x8f, + 0xbc, 0x5f, 0x83, 0x15, 0xa6, 0xfb, 0x18, 0xc5, 0xd7, 0x42, 0xbe, 0xe5, 0x78, 0x12, 0x99, 0xb6, + 0x61, 0x35, 0x8c, 0x82, 0x30, 0xe0, 0x2c, 0x72, 0xa8, 0xeb, 0x46, 0x8c, 0xf3, 0x4e, 0x5b, 0xad, + 0x17, 0xcf, 0x1f, 0xaa, 0x69, 0xeb, 0x67, 0x50, 0xd7, 0xd6, 0x2f, 0xed, 0xe6, 0xbe, 0x0b, 0xcb, + 0xd2, 0xeb, 0xb9, 0x93, 0xeb, 0xe9, 0xe2, 0x9a, 0x1a, 0x9d, 0x9e, 0x89, 0x5c, 0x6b, 0xd7, 0x44, + 0x7e, 0x35, 0x65, 0xdd, 0x83, 0x95, 0x1c, 0x8f, 0x0c, 0x03, 0x74, 0x8a, 0x38, 0x0c, 0x70, 0x90, + 0xec, 0x5c, 0x49, 0x77, 0xb6, 0xee, 0x83, 0x99, 0x18, 0x5a, 0x96, 0x7e, 0xb1, 0x1e, 0x86, 0xb6, + 0x9d, 0x1a, 0x62, 0xbd, 0x10, 0x7c, 0xce, 0x22, 0x9d, 0x02, 0xd4, 0xc0, 0x7a, 0x0a, 0xed, 0x42, + 0x7a, 0x27, 0x3b, 0x50, 0x0f, 0xa7, 0x7d, 0x27, 0x7e, 0x66, 0x48, 0xf3, 0xd9, 0xc9, 0xb4, 0xff, + 0x09, 0xbb, 0x88, 0x1b, 0xd3, 0x10, 0x47, 0xe9, 0xb2, 0x95, 0xec, 0xb2, 0x63, 0x68, 0xc4, 0xa1, + 0x49, 0xbe, 0x0d, 0x66, 0xe2, 0x23, 0x85, 0x7c, 0x9a, 0x6c, 0xad, 0x17, 0x4d, 0x19, 0xe5, 0x55, + 0x73, 0x6f, 0xe8, 0x33, 0xd7, 0x49, 0xe3, 0x01, 0xf7, 0x68, 0xd8, 0x6d, 0x45, 0xf8, 0x34, 0x76, + 0x7e, 0xeb, 0x3d, 0xa8, 0xa9, 0xb3, 0x49, 0xfb, 0xc8, 0x95, 0xe3, 0x6a, 0x58, 0x7e, 0x97, 0x26, + 0xfe, 0x3f, 0x1a, 0xd0, 0x88, 0xbb, 0xdc, 0x52, 0xa1, 0xdc, 0xa1, 0x2b, 0xaf, 0x7a, 0xe8, 0x79, + 0x4f, 0x05, 0x71, 0x16, 0xa9, 0xbe, 0x76, 0x16, 0xd9, 0x01, 0xa2, 0x92, 0xc5, 0x79, 0x20, 0x3c, + 0x7f, 0xe8, 0x28, 0x5b, 0xab, 0xac, 0xb1, 0x8a, 0x94, 0x53, 0x24, 0x9c, 0xc8, 0xf9, 0xfd, 0x2f, + 0x96, 0xa0, 0x7d, 0xd8, 0x7b, 0x70, 0x7c, 0x18, 0x86, 0x63, 0x6f, 0x40, 0xb1, 0x04, 0xdf, 0x83, + 0x2a, 0x36, 0x19, 0x25, 0xcf, 0x9b, 0xdd, 0xb2, 0x6e, 0x97, 0xec, 0xc3, 0x12, 0xf6, 0x1a, 0xa4, + 0xec, 0x95, 0xb3, 0x5b, 0xda, 0xf4, 0xca, 0x4d, 0x54, 0x37, 0x72, 0xf5, 0xb1, 0xb3, 0x5b, 0xd6, + 0xf9, 0x92, 0x8f, 0xc0, 0x4c, 0xbb, 0x84, 0x79, 0x4f, 0x9e, 0xdd, 0xb9, 0x3d, 0xb0, 0x94, 0x4f, + 0x8b, 0xb3, 0x79, 0x2f, 0x77, 0xdd, 0xb9, 0xcd, 0x22, 0x39, 0x80, 0x7a, 0x5c, 0xb4, 0x96, 0x3f, + 0x4a, 0x76, 0xe7, 0xf4, 0xa7, 0xd2, 0x3c, 0xaa, 0xf0, 0x2f, 0x7b, 0x39, 0xed, 0x96, 0x36, 0xd1, + 0xe4, 0x2e, 0xd4, 0x74, 0x15, 0x52, 0xfa, 0x30, 0xd9, 0x2d, 0xef, 0x32, 0xa5, 0x92, 0x69, 0xeb, + 0x33, 0xef, 0x75, 0xb7, 0x3b, 0xb7, 0xdb, 0x27, 0x87, 0x00, 0x99, 0x62, 0x7f, 0xee, 0xb3, 0x6d, + 0x77, 0x7e, 0x17, 0x4f, 0xee, 0x43, 0x23, 0x7d, 0x99, 0x29, 0x7f, 0x88, 0xed, 0xce, 0x6b, 0xac, + 0x7b, 0xff, 0xf7, 0xef, 0xbf, 0x6d, 0x18, 0xbf, 0xba, 0xdc, 0x30, 0x7e, 0x73, 0xb9, 0x61, 0x7c, + 0x75, 0xb9, 0x61, 0xfc, 0xfe, 0x72, 0xc3, 0xf8, 0xeb, 0xe5, 0x86, 0xf1, 0xdb, 0xbf, 0x6f, 0x18, + 0xfd, 0x1a, 0xba, 0xff, 0xfb, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x32, 0xa1, 0x6a, 0x3b, + 0x18, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index a2eb65eb..ae550c0a 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -225,7 +225,8 @@ message BlockGossip { } message LastCommitInfo { - repeated VoteInfo commit_votes = 1 [(gogoproto.nullable)=false]; + int32 round = 1; + repeated VoteInfo votes = 2 [(gogoproto.nullable)=false]; } //---------------------------------------- @@ -271,6 +272,7 @@ message PartSetHeader { // Validator message Validator { bytes address = 1; + //PubKey pub_key = 2 [(gogoproto.nullable)=false]; int64 power = 3; } @@ -284,7 +286,6 @@ message ValidatorUpdate { message VoteInfo { Validator validator = 1 [(gogoproto.nullable)=false]; bool signed_last_block = 2; - int64 commit_round = 3; } message PubKey { diff --git a/state/execution.go b/state/execution.go index 71b3ec1c..4872584a 100644 --- a/state/execution.go +++ b/state/execution.go @@ -184,15 +184,13 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, } proxyAppConn.SetResponseCallback(proxyCb) - voteInfos, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) + commitInfo, byzVals := getBeginBlockValidatorInfo(block, lastValSet, stateDB) // Begin block. _, err := proxyAppConn.BeginBlockSync(abci.RequestBeginBlock{ - Hash: block.Hash(), - Header: types.TM2PB.Header(&block.Header), - LastCommitInfo: abci.LastCommitInfo{ - CommitVotes: voteInfos, - }, + Hash: block.Hash(), + Header: types.TM2PB.Header(&block.Header), + LastCommitInfo: commitInfo, ByzantineValidators: byzVals, }) if err != nil { @@ -225,7 +223,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, return abciResponses, nil } -func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]abci.VoteInfo, []abci.Evidence) { +func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) (abci.LastCommitInfo, []abci.Evidence) { // Sanity check that commit length matches validator set size - // only applies after first block @@ -239,25 +237,25 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS } } - // determine which validators did not sign last block. + // Collect the vote info (list of validators and whether or not they signed). voteInfos := make([]abci.VoteInfo, len(lastValSet.Validators)) for i, val := range lastValSet.Validators { var vote *types.Vote - var commitRound = -1 if i < len(block.LastCommit.Precommits) { vote = block.LastCommit.Precommits[i] - if vote != nil { - commitRound = vote.Round - } } voteInfo := abci.VoteInfo{ Validator: types.TM2PB.Validator(val), - SignedLastBlock: vote != nil, // XXX: should we replace with commitRound == -1 ? - CommitRound: int64(commitRound), //XXX: why is round an int? + SignedLastBlock: vote != nil, } voteInfos[i] = voteInfo } + commitInfo := abci.LastCommitInfo{ + Round: int32(block.LastCommit.Round()), + Votes: voteInfos, + } + byzVals := make([]abci.Evidence, len(block.Evidence.Evidence)) for i, ev := range block.Evidence.Evidence { // We need the validator set. We already did this in validateBlock. @@ -270,7 +268,7 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS byzVals[i] = types.TM2PB.Evidence(ev, valset, block.Time) } - return voteInfos, byzVals + return commitInfo, byzVals } diff --git a/state/execution_test.go b/state/execution_test.go index 52baadf3..e50172e1 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -347,7 +347,7 @@ func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) { } func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock { - app.CommitVotes = req.LastCommitInfo.CommitVotes + app.CommitVotes = req.LastCommitInfo.Votes app.ByzantineValidators = req.ByzantineValidators return abci.ResponseBeginBlock{} } From 1111c1848d64518271a4f7626eb3aaf8a0103174 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:49:14 -0400 Subject: [PATCH 080/149] update abci spec --- docs/app-dev/abci-spec.md | 46 ++++++++++++++++++++++++++------------ docs/spec/software/abci.md | 12 ++++------ 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/docs/app-dev/abci-spec.md b/docs/app-dev/abci-spec.md index 770740b8..69b8620d 100644 --- a/docs/app-dev/abci-spec.md +++ b/docs/app-dev/abci-spec.md @@ -111,14 +111,16 @@ See below for more details on the message types and how they are used. - `Time (google.protobuf.Timestamp)`: Genesis time. - `ChainID (string)`: ID of the blockchain. - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. - - `Validators ([]Validator)`: Initial genesis validators. + - `Validators ([]ValidatorUpdate)`: Initial genesis validators. - `AppStateBytes ([]byte)`: Serialized initial application state. Amino-encoded JSON bytes. - **Response**: - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. - - `Validators ([]Validator)`: Initial validator set. + - `Validators ([]ValidatorUpdate)`: Initial validator set. - **Usage**: - Called once upon genesis. + - List of validators in the response will be used as the initial validator set + (regardless of what was sent in the request). ### Query @@ -161,9 +163,10 @@ See below for more details on the message types and how they are used. - `Hash ([]byte)`: The block's hash. This can be derived from the block header. - `Header (struct{})`: The block header. - - `LastCommitInfo (LastCommitInfo)`: Info about the last commit. + - `LastCommitInfo (LastCommitInfo)`: Info about the last commit, including the + round, and the list of validators and which ones signed the last block. - `ByzantineValidators ([]Evidence)`: List of evidence of - validators that acted maliciously + validators that acted maliciously. - **Response**: - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing - **Usage**: @@ -237,7 +240,7 @@ See below for more details on the message types and how they are used. - **Request**: - `Height (int64)`: Height of the block just executed. - **Response**: - - `ValidatorUpdates ([]Validator)`: Changes to validator set (set + - `ValidatorUpdates ([]ValidatorUpdate)`: Changes to validator set (set voting power to 0 to remove). - `ConsensusParamUpdates (ConsensusParams)`: Changes to consensus-critical time, size, and other parameters. @@ -246,7 +249,6 @@ See below for more details on the message types and how they are used. - Signals the end of a block. - Called prior to each Commit, after all transactions. - Validator set and consensus params are updated with the result. - - Validator pubkeys are expected to be go-wire encoded. ### Commit @@ -271,12 +273,17 @@ See below for more details on the message types and how they are used. - `NumTxs (int32)`: Number of transactions in the block - `TotalTxs (int64)`: Total number of transactions in the blockchain until now - - `LastBlockHash ([]byte)`: Hash of the previous (parent) block + - `LastBlockID (BlockID)`: Hash of the previous (parent) block + - `LastCommitHash ([]byte)`: Hash of the previous block's commit - `ValidatorsHash ([]byte)`: Hash of the validator set for this block + - `NextValidatorsHash ([]byte)`: Hash of the validator set for the next block + - `ConsensusHash ([]byte)`: Hash of the consensus parameters for this block - `AppHash ([]byte)`: Data returned by the last call to `Commit` - typically the Merkle root of the application state after executing the previous block's transactions - - `Proposer (Validator)`: Original proposer for the block + - `LastResultsHash ([]byte)`: Hash of the ABCI results returned by the last block + - `EvidenceHash ([]byte)`: Hash of the evidence included in this block + - `ProposerAddress ([]byte)`: Original proposer for the block - **Usage**: - Provided in RequestBeginBlock - Provides important context about the current state of the blockchain - @@ -288,16 +295,27 @@ See below for more details on the message types and how they are used. - **Fields**: - `Address ([]byte)`: Address of the validator (hash of the public key) + - `Power (int64)`: Voting power of the validator +- **Usage**: + - Validator identified by address + - Used in RequestBeginBlock as part of VoteInfo + - Does not include PubKey to avoid sending potentially large quantum pubkeys + over the ABCI + +### ValidatorUpdate + +- **Fields**: - `PubKey (PubKey)`: Public key of the validator - `Power (int64)`: Voting power of the validator - **Usage**: - - Provides all identifying information about the validator + - Validator identified by PubKey + - Used to tell Tendermint to update the validator set -### SigningValidator +### VoteInfo - **Fields**: - `Validator (Validator)`: A validator - - `SignedLastBlock (bool)`: Indicated whether or not the validator signed + - `SignedLastBlock (bool)`: Indicates whether or not the validator signed the last block - **Usage**: - Indicates whether a validator signed the last block, allowing for rewards @@ -330,6 +348,6 @@ See below for more details on the message types and how they are used. ### LastCommitInfo - **Fields**: - - `CommitRound (int32)`: Commit round. - - `Validators ([]SigningValidator)`: List of validators in the current - validator set and whether or not they signed a vote. + - `Round (int32)`: Commit round. + - `Votes ([]VoteInfo)`: List of validators addresses in the last validator set + with their voting power and whether or not they signed a vote. diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index 093f3ac1..4323d394 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -52,14 +52,13 @@ objects in the `ResponseBeginBlock`: ``` message Validator { - bytes address = 1; - PubKey pub_key = 2; - int64 power = 3; + PubKey pub_key + int64 power } message PubKey { - string type = 1; - bytes data = 2; + string type + bytes data } ``` @@ -99,9 +98,6 @@ If the list is not empty, Tendermint will adopt it for the validator set. This way the application can determine the initial validator set for the blockchain. -Note that if addressses are included in the returned validators, they must match -the address of the public key. - ResponseInitChain also includes ConsensusParams, but these are presently ignored. From 4f61b97bbe69a08c3406e3b04148ef8fa866641d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:56:43 -0400 Subject: [PATCH 081/149] update dep for proto. fix types/proto3/block.proto --- types/proto3/block.proto | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/types/proto3/block.proto b/types/proto3/block.proto index cefd180d..835d6b74 100644 --- a/types/proto3/block.proto +++ b/types/proto3/block.proto @@ -30,13 +30,14 @@ message Header { // hashes from the app output from the prev block bytes ValidatorsHash = 9; // validators for the current block - bytes ConsensusHash = 10; // consensus params for current block - bytes AppHash = 11; // state after txs from the previous block - bytes LastResultsHash = 12; // root hash of all results from the txs from the previous block + bytes NextValidatorsHash = 10; // validators for the next block + bytes ConsensusHash = 11; // consensus params for current block + bytes AppHash = 12; // state after txs from the previous block + bytes LastResultsHash = 13; // root hash of all results from the txs from the previous block // consensus info - bytes EvidenceHash = 13; // evidence included in the block - bytes ProposerAddress = 14; // original proposer of the block + bytes EvidenceHash = 14; // evidence included in the block + bytes ProposerAddress = 15; // original proposer of the block } // Timestamp wraps how amino encodes time. Note that this is different from the protobuf well-known type From 0701d790468bf9049121ce02144dc08150125a1e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 10:58:03 -0400 Subject: [PATCH 082/149] minor fixes --- state/execution.go | 5 +++-- types/protobuf_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/state/execution.go b/state/execution.go index 4872584a..aa96d22e 100644 --- a/state/execution.go +++ b/state/execution.go @@ -215,9 +215,10 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus, logger.Info("Executed block", "height", block.Height, "validTxs", validTxs, "invalidTxs", invalidTxs) - if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { + valUpdates := abciResponses.EndBlock.ValidatorUpdates + if len(valUpdates) > 0 { // TODO: cleanup the formatting - logger.Info("Updates to validators", "updates", abciResponses.EndBlock.ValidatorUpdates) + logger.Info("Updates to validators", "updates", valUpdates) } return abciResponses, nil diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 22bed60f..8bdf094b 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -57,7 +57,7 @@ func TestABCIValidators(t *testing.T) { assert.Nil(t, err) assert.Equal(t, tmValExpected, tmVals[0]) - // val with incorrect pubkey daya + // val with incorrect pubkey data abciVal = TM2PB.ValidatorUpdate(tmVal) abciVal.PubKey.Data = []byte("incorrect!") tmVals, err = PB2TM.ValidatorUpdates([]abci.ValidatorUpdate{abciVal}) From 0cbf9b2a7d56424b7f1824e6fb58d7d4cf15b0b7 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 11:04:15 -0400 Subject: [PATCH 083/149] update changelog --- CHANGELOG_PENDING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 40fd2644..ac381c80 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -14,6 +14,10 @@ BREAKING CHANGES: - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers - [node] NewNode now accepts a `*p2p.NodeKey` +- [abci] \#2159 Update use of `Validator` ala ADR-018: + - Remove PubKey from `Validator` and introduce `ValidatorUpdate` + - InitChain and EndBlock use ValidatorUpdate + - Update field names and types in BeginBlock FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) From 76bb4b15c7c304251b47e50eb68ed885f06ab73e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 16 Aug 2018 13:22:04 -0400 Subject: [PATCH 084/149] rebase fixes --- state/execution.go | 5 +++-- state/execution_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/state/execution.go b/state/execution.go index aa96d22e..ab689f5f 100644 --- a/state/execution.go +++ b/state/execution.go @@ -384,9 +384,10 @@ func fireEvents(logger log.Logger, eventBus types.BlockEventPublisher, block *ty }}) } - if len(abciResponses.EndBlock.ValidatorUpdates) > 0 { + abciValUpdates := abciResponses.EndBlock.ValidatorUpdates + if len(abciValUpdates) > 0 { // if there were an error, we would've stopped in updateValidators - updates, _ := types.PB2TM.Validators(abciResponses.EndBlock.ValidatorUpdates) + updates, _ := types.PB2TM.ValidatorUpdates(abciValUpdates) eventBus.PublishEventValidatorSetUpdates( types.EventDataValidatorSetUpdates{ValidatorUpdates: updates}) } diff --git a/state/execution_test.go b/state/execution_test.go index e50172e1..4d7c4f99 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -260,7 +260,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} pubkey := ed25519.GenPrivKey().PubKey() - app.ValidatorUpdates = []abci.Validator{ + app.ValidatorUpdates = []abci.ValidatorUpdate{ {PubKey: types.TM2PB.PubKey(pubkey), Power: 10}, } @@ -337,7 +337,7 @@ type testApp struct { CommitVotes []abci.VoteInfo ByzantineValidators []abci.Evidence - ValidatorUpdates []abci.Validator + ValidatorUpdates []abci.ValidatorUpdate } var _ abci.Application = (*testApp)(nil) From 62b2093da50fee53da880553e5ef3c6f2d7a29c1 Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Fri, 17 Aug 2018 15:59:46 +0800 Subject: [PATCH 085/149] ABCIAppClient conn close (#2236) Refs https://github.com/grpc/grpc-go/issues/2264 --- abci/client/grpc_client.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index a1f09946..4f37b17b 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -22,6 +22,7 @@ type grpcClient struct { mustConnect bool client types.ABCIApplicationClient + conn *grpc.ClientConn mtx sync.Mutex addr string @@ -60,6 +61,7 @@ RETRY_LOOP: cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr) client := types.NewABCIApplicationClient(conn) + cli.conn = conn ENSURE_CONNECTED: for { @@ -78,12 +80,10 @@ RETRY_LOOP: func (cli *grpcClient) OnStop() { cli.BaseService.OnStop() - cli.mtx.Lock() - defer cli.mtx.Unlock() - // TODO: how to close conn? its not a net.Conn and grpc doesn't expose a Close() - /*if cli.client.conn != nil { - cli.client.conn.Close() - }*/ + + if cli.conn != nil { + cli.conn.Close() + } } func (cli *grpcClient) StopForError(err error) { From 6dde3205917a4a0e3b963cc5d63fda9f54d35569 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 17 Aug 2018 10:32:10 -0400 Subject: [PATCH 086/149] fixes from review --- docs/app-dev/abci-spec.md | 11 ++++++++--- types/protobuf.go | 8 -------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/app-dev/abci-spec.md b/docs/app-dev/abci-spec.md index 69b8620d..63570f7f 100644 --- a/docs/app-dev/abci-spec.md +++ b/docs/app-dev/abci-spec.md @@ -116,11 +116,16 @@ See below for more details on the message types and how they are used. - **Response**: - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. - - `Validators ([]ValidatorUpdate)`: Initial validator set. + - `Validators ([]ValidatorUpdate)`: Initial validator set (if non empty). - **Usage**: - Called once upon genesis. - - List of validators in the response will be used as the initial validator set - (regardless of what was sent in the request). + - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators + - If ResponseInitChain.Validators is not empty, the initial validator set will be the + ResponseInitChain.Validators (regardless of what is in RequestInitChain.Validators). + - This allows the app to decide if it wants to accept the initial validator + set proposed by tendermint (ie. in the genesis file), or if it wants to use + a different one (perhaps computed based on some application specific + information in the genesis file). ### Query diff --git a/types/protobuf.go b/types/protobuf.go index 1363430b..30e74f15 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -209,14 +209,6 @@ func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) if err != nil { return nil, err } - // If the app provided an address too, it must match. - // This is just a sanity check. - /*if len(v.Address) > 0 { - if !bytes.Equal(pub.Address(), v.Address) { - return nil, fmt.Errorf("Validator.Address (%X) does not match PubKey.Address (%X)", - v.Address, pub.Address()) - } - }*/ tmVals[i] = NewValidator(pub, v.Power) } return tmVals, nil From 43ebc77f9b7ddfcdaca385805ca970199c0d2b59 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Sun, 26 Aug 2018 00:45:34 -0700 Subject: [PATCH 087/149] Fix typo, closes #2269 (#2277) --- docs/tendermint-core/using-tendermint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index db997611..b3ea2624 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -523,7 +523,7 @@ developers guide](../app-dev/app-development.md) for more details. To run a network locally, say on a single machine, you must change the `_laddr` fields in the `config.toml` (or using the flags) so that the listening addresses of the various sockets don't conflict. Additionally, -you must set `addrbook_strict=false` in the `config.toml`, otherwise +you must set `addr_book_strict=false` in the `config.toml`, otherwise Tendermint's p2p library will deny making connections to peers with the same IP address. From 1cf6712a36e8ecc843a68aa373748e89e0afecba Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 27 Aug 2018 10:19:27 +0400 Subject: [PATCH 088/149] quick fix for CircleCI (#2279) See https://discuss.circleci.com/t/saving-cache-stopped-working-warning-skipping-this-step-disabled-in-configuration/24423/2 --- .circleci/config.yml | 153 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 133 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d321e9e..312d04ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,10 +41,10 @@ jobs: key: v3-pkg-cache paths: - /go/pkg - - save_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} - paths: - - /go/src/github.com/tendermint/tendermint + # - save_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # paths: + # - /go/src/github.com/tendermint/tendermint build_slate: <<: *defaults @@ -53,8 +53,23 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # https://discuss.circleci.com/t/saving-cache-stopped-working-warning-skipping-this-step-disabled-in-configuration/24423/2 + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: slate docs command: | @@ -69,8 +84,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: metalinter command: | @@ -91,8 +120,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: Run abci apps tests command: | @@ -108,8 +151,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: Run abci-cli tests command: | @@ -123,8 +180,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends bsdmainutils - run: name: Run tests @@ -138,8 +209,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: mkdir -p /tmp/logs - run: name: Run tests @@ -163,8 +248,22 @@ jobs: at: /tmp/workspace - restore_cache: key: v3-pkg-cache - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: Run tests command: bash test/persist/test_failure_indices.sh @@ -186,8 +285,22 @@ jobs: steps: - attach_workspace: at: /tmp/workspace - - restore_cache: - key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + # - restore_cache: + # key: v3-tree-{{ .Environment.CIRCLE_SHA1 }} + - checkout + - run: + name: tools + command: | + export PATH="$GOBIN:$PATH" + make get_tools + - run: + name: dependencies + command: | + export PATH="$GOBIN:$PATH" + make get_vendor_deps + - run: mkdir -p $GOPATH/src/github.com/tendermint + - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint + - run: name: gather command: | From 2f7fc87230a308cb6feb17984620408c2f07c37b Mon Sep 17 00:00:00 2001 From: Zach Date: Sun, 26 Aug 2018 23:36:22 -0700 Subject: [PATCH 089/149] docs: fix img links, closes #2214 (#2282) --- docs/introduction/introduction.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/introduction/introduction.md b/docs/introduction/introduction.md index 19763256..389bf965 100644 --- a/docs/introduction/introduction.md +++ b/docs/introduction/introduction.md @@ -227,7 +227,7 @@ design their message handlers to create a blockchain that does anything useful but this architecture provides a place to start. The diagram below illustrates the flow of messages via ABCI. -![](imgs/abci.png) +![](../imgs/abci.png) ## A Note on Determinism @@ -263,7 +263,7 @@ Tendermint is an easy-to-understand, mostly asynchronous, BFT consensus protocol. The protocol follows a simple state machine that looks like this: -![](imgs/consensus_logic.png) +![](../imgs/consensus_logic.png) Participants in the protocol are called **validators**; they take turns proposing blocks of transactions and voting on them. Blocks are @@ -329,4 +329,4 @@ The following diagram is Tendermint in a (technical) nutshell. [See here for high resolution version](https://github.com/mobfoundry/hackatom/blob/master/tminfo.pdf). -![](imgs/tm-transaction-flow.png) +![](../imgs/tm-transaction-flow.png) From aab5947d827659793ed0a83e771750e4a5befb29 Mon Sep 17 00:00:00 2001 From: Zach Date: Sun, 26 Aug 2018 23:37:54 -0700 Subject: [PATCH 090/149] docs: deprecate RTD (#2280) --- docs/Makefile | 23 ----- docs/conf.py | 199 ------------------------------------------ docs/index.rst | 15 ---- docs/requirements.txt | 4 - 4 files changed, 241 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/conf.py delete mode 100644 docs/index.rst delete mode 100644 docs/requirements.txt diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 442c9be6..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = python -msphinx -SPHINXPROJ = Tendermint -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -install: - @pip install -r requirements.txt - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 0cfc05cd..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,199 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Tendermint documentation build configuration file, created by -# sphinx-quickstart on Mon Aug 7 04:55:09 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) -import urllib - -import sphinx_rtd_theme - - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# - -from recommonmark.parser import CommonMarkParser - -source_parsers = { - '.md': CommonMarkParser, -} - -source_suffix = ['.rst', '.md'] -#source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Tendermint' -copyright = u'2018, The Authors' -author = u'Tendermint' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = u'' -# The full version, including alpha/beta/rc tags. -release = u'' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'architecture', 'spec', 'examples'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'sphinx_rtd_theme' -# html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'about.html', - 'navigation.html', - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - 'donate.html', - ] -} - - -# -- Options for HTMLHelp output ------------------------------------------ - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Tendermintdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'Tendermint.tex', u'Tendermint Documentation', - u'The Authors', 'manual'), -] - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'Tendermint', u'Tendermint Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'Tendermint', u'Tendermint Documentation', - author, 'Tendermint', 'Byzantine Fault Tolerant Consensus.', - 'Database'), -] - -# ---------------- customizations ---------------------- - -# for Docker README, below -from shutil import copyfile - -# tm-bench and tm-monitor -tools_repo = "https://raw.githubusercontent.com/tendermint/tools/" -tools_branch = "master" - -tools_dir = "./tools" - - -if os.path.isdir(tools_dir) != True: - os.mkdir(tools_dir) - -copyfile('../DOCKER/README.md', tools_dir+'/docker.md') - -urllib.urlretrieve(tools_repo+tools_branch+'/tm-bench/README.md', filename=tools_dir+'/benchmarking.md') -urllib.urlretrieve(tools_repo+tools_branch+'/tm-monitor/README.md', filename=tools_dir+'/monitoring.md') diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index bafbec35..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. Tendermint documentation master file, created by - sphinx-quickstart on Mon Aug 7 04:55:09 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Tendermint! -====================== - -This location for our documentation has been deprecated, please see: - -- https://tendermint.com/docs/ - -The last version built by Read The Docs will still be available at: - -- https://tendermint.readthedocs.io/projects/tools/en/v0.21.0/ diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 85e42ba8..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -sphinx -sphinx-autobuild -recommonmark -sphinx_rtd_theme From 8a84593c02e264803c12ca237f546b20754e73c8 Mon Sep 17 00:00:00 2001 From: Ahmad M ElShareif Date: Mon, 27 Aug 2018 09:43:15 +0300 Subject: [PATCH 091/149] Reduce code in common/math (#2274) --- libs/common/math.go | 126 -------------------------------------------- 1 file changed, 126 deletions(-) diff --git a/libs/common/math.go b/libs/common/math.go index b037d1a7..ae91f205 100644 --- a/libs/common/math.go +++ b/libs/common/math.go @@ -1,47 +1,5 @@ package common -func MaxInt8(a, b int8) int8 { - if a > b { - return a - } - return b -} - -func MaxUint8(a, b uint8) uint8 { - if a > b { - return a - } - return b -} - -func MaxInt16(a, b int16) int16 { - if a > b { - return a - } - return b -} - -func MaxUint16(a, b uint16) uint16 { - if a > b { - return a - } - return b -} - -func MaxInt32(a, b int32) int32 { - if a > b { - return a - } - return b -} - -func MaxUint32(a, b uint32) uint32 { - if a > b { - return a - } - return b -} - func MaxInt64(a, b int64) int64 { if a > b { return a @@ -49,13 +7,6 @@ func MaxInt64(a, b int64) int64 { return b } -func MaxUint64(a, b uint64) uint64 { - if a > b { - return a - } - return b -} - func MaxInt(a, b int) int { if a > b { return a @@ -63,57 +14,8 @@ func MaxInt(a, b int) int { return b } -func MaxUint(a, b uint) uint { - if a > b { - return a - } - return b -} - //----------------------------------------------------------------------------- -func MinInt8(a, b int8) int8 { - if a < b { - return a - } - return b -} - -func MinUint8(a, b uint8) uint8 { - if a < b { - return a - } - return b -} - -func MinInt16(a, b int16) int16 { - if a < b { - return a - } - return b -} - -func MinUint16(a, b uint16) uint16 { - if a < b { - return a - } - return b -} - -func MinInt32(a, b int32) int32 { - if a < b { - return a - } - return b -} - -func MinUint32(a, b uint32) uint32 { - if a < b { - return a - } - return b -} - func MinInt64(a, b int64) int64 { if a < b { return a @@ -121,37 +23,9 @@ func MinInt64(a, b int64) int64 { return b } -func MinUint64(a, b uint64) uint64 { - if a < b { - return a - } - return b -} - func MinInt(a, b int) int { if a < b { return a } return b } - -func MinUint(a, b uint) uint { - if a < b { - return a - } - return b -} - -//----------------------------------------------------------------------------- - -func ExpUint64(a, b uint64) uint64 { - accum := uint64(1) - for b > 0 { - if b&1 == 1 { - accum *= a - } - a *= a - b >>= 1 - } - return accum -} From 20e35654c62ee502d349a8a96f033d12a95215f8 Mon Sep 17 00:00:00 2001 From: Peng Zhong <172531+nylira@users.noreply.github.com> Date: Mon, 27 Aug 2018 15:33:46 +0800 Subject: [PATCH 092/149] lint markdown docs using a stop-words and write-good linters (#2195) * lint docs with write-good, stop-words * remove package-lock.json * update changelog * fix wrong paragraph formatting * fix some docs formatting * fix docs format * fix abci spec format --- CHANGELOG_PENDING.md | 1 + docs/.textlintrc.json | 9 + docs/app-dev/ecosystem.json | 30 +- .../adr-002-event-subscription.md | 3 +- .../adr-004-historical-validators.md | 6 +- docs/architecture/adr-005-consensus-params.md | 9 +- docs/architecture/adr-006-trust-metric.md | 37 +- .../adr-007-trust-metric-usage.md | 3 + docs/architecture/adr-008-priv-validator.md | 8 +- docs/architecture/adr-009-ABCI-design.md | 10 +- docs/architecture/adr-010-crypto-changes.md | 3 - docs/architecture/adr-011-monitoring.md | 56 +- docs/architecture/adr-012-ABCI-propose-tx.md | 12 +- docs/architecture/adr-012-peer-transport.md | 34 +- docs/architecture/adr-013-symmetric-crypto.md | 40 +- .../architecture/adr-014-secp-malleability.md | 16 +- docs/architecture/adr-015-crypto-encoding.md | 15 +- .../architecture/adr-016-protocol-versions.md | 33 +- docs/architecture/adr-017-chain-versions.md | 23 +- docs/architecture/adr-019-multisigs.md | 48 +- docs/architecture/adr-template.md | 1 - docs/package.json | 7 +- docs/spec/README.md | 6 +- docs/spec/blockchain/blockchain.md | 16 +- docs/spec/blockchain/encoding.md | 63 +- docs/spec/blockchain/state.md | 1 - docs/spec/consensus/bft-time.md | 79 +- docs/spec/consensus/consensus.md | 174 +- docs/spec/consensus/light-client.md | 69 +- docs/spec/p2p/connection.md | 11 +- docs/spec/p2p/node.md | 3 +- docs/spec/p2p/peer.md | 17 +- docs/spec/reactors/block_sync/impl.md | 60 +- docs/spec/reactors/block_sync/reactor.md | 284 +- .../reactors/consensus/consensus-reactor.md | 219 +- docs/spec/reactors/consensus/consensus.md | 2 +- .../reactors/consensus/proposer-selection.md | 24 +- docs/spec/reactors/mempool/concurrency.md | 8 +- docs/spec/reactors/mempool/config.md | 2 +- docs/spec/reactors/mempool/functionality.md | 15 +- docs/spec/reactors/mempool/messages.md | 28 +- docs/spec/reactors/pex/pex.md | 2 +- docs/spec/software/abci.md | 55 +- docs/stop-words.txt | 6 + docs/tendermint-core/block-structure.md | 14 +- docs/tendermint-core/light-client-protocol.md | 20 +- docs/tendermint-core/running-in-production.md | 25 +- docs/tendermint-core/secure-p2p.md | 12 +- docs/tendermint-core/using-tendermint.md | 28 +- docs/tendermint-core/validators.md | 6 +- docs/tools/benchmarking.md | 4 +- docs/tools/monitoring.md | 3 +- docs/yarn.lock | 2611 +++++++++++++++++ 53 files changed, 3440 insertions(+), 831 deletions(-) create mode 100644 docs/.textlintrc.json create mode 100644 docs/stop-words.txt create mode 100644 docs/yarn.lock diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index ac381c80..36f80992 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -23,6 +23,7 @@ FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) IMPROVEMENTS: +- [docs] Lint documentation with `write-good` and `stop-words`. - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) diff --git a/docs/.textlintrc.json b/docs/.textlintrc.json new file mode 100644 index 00000000..4103f89e --- /dev/null +++ b/docs/.textlintrc.json @@ -0,0 +1,9 @@ +{ + "rules": { + "stop-words": { + "severity": "warning", + "defaultWords": false, + "words": "stop-words.txt" + } + } +} diff --git a/docs/app-dev/ecosystem.json b/docs/app-dev/ecosystem.json index 363f1890..728f3a53 100644 --- a/docs/app-dev/ecosystem.json +++ b/docs/app-dev/ecosystem.json @@ -5,24 +5,21 @@ "url": "https://github.com/cosmos/cosmos-sdk", "language": "Go", "author": "Cosmos", - "description": - "A prototypical account based crypto currency state machine supporting plugins" + "description": "A prototypical account based crypto currency state machine supporting plugins" }, { "name": "cb-ledger", "url": "https://github.com/block-finance/cpp-abci", "language": "C++", "author": "Block Finance", - "description": - "Custodian Bank Ledger, integrating central banking with the blockchains of tomorrow" + "description": "Custodian Bank Ledger, integrating central banking with the blockchains of tomorrow" }, { "name": "Clearchain", "url": "https://github.com/tendermint/clearchain", "language": "Go", "author": "FXCLR", - "description": - "Application to manage a distributed ledger for money transfers that support multi-currency accounts" + "description": "Application to manage a distributed ledger for money transfers that support multi-currency accounts" }, { "name": "Ethermint", @@ -43,8 +40,7 @@ "url": "https://github.com/hyperledger/burrow", "language": "Go", "author": "Monax Industries", - "description": - "Ethereum Virtual Machine augmented with native permissioning scheme and global key-value store" + "description": "Ethereum Virtual Machine augmented with native permissioning scheme and global key-value store" }, { "name": "Merkle AVL Tree", @@ -72,8 +68,7 @@ "url": "https://github.com/trusch/passchain", "language": "Go", "author": "trusch", - "description": - "Tool to securely store and share passwords, tokens and other short secrets" + "description": "Tool to securely store and share passwords, tokens and other short secrets" }, { "name": "Passwerk", @@ -87,8 +82,7 @@ "url": "https://github.com/davebryson/py-tendermint", "language": "Python", "author": "Dave Bryson", - "description": - "A Python microframework for building blockchain applications with Tendermint" + "description": "A Python microframework for building blockchain applications with Tendermint" }, { "name": "Stratumn SDK", @@ -102,16 +96,14 @@ "url": "https://github.com/keppel/lotion", "language": "Javascript", "author": "Judd Keppel", - "description": - "A Javascript microframework for building blockchain applications with Tendermint" + "description": "A Javascript microframework for building blockchain applications with Tendermint" }, { "name": "Tendermint Blockchain Chat App", "url": "https://github.com/SaifRehman/tendermint-chat-app/", "language": "Javascript", "author": "Saif Rehman", - "description": - "This is a minimal chat application based on Tendermint using Lotion.js in 30 lines of code!. It also includes web/mobile application built using Ionic 3." + "description": "This is a minimal chat application based on Tendermint using Lotion.js in 30 lines of code!. It also includes web/mobile application built using Ionic 3." }, { "name": "BigchainDB", @@ -184,16 +176,14 @@ "url": "https://github.com/tendermint/tools", "technology": "Docker and Kubernetes", "author": "Tendermint", - "description": - "Deploy a Tendermint test network using Google's kubernetes" + "description": "Deploy a Tendermint test network using Google's kubernetes" }, { "name": "terraforce", "url": "https://github.com/tendermint/tools", "technology": "Terraform", "author": "Tendermint", - "description": - "Terraform + our custom terraforce tool; deploy a production Tendermint network with load balancing over multiple AWS availability zones" + "description": "Terraform + our custom terraforce tool; deploy a production Tendermint network with load balancing over multiple AWS availability zones" }, { "name": "ansible-tendermint", diff --git a/docs/architecture/adr-002-event-subscription.md b/docs/architecture/adr-002-event-subscription.md index cc207c4a..a73d584a 100644 --- a/docs/architecture/adr-002-event-subscription.md +++ b/docs/architecture/adr-002-event-subscription.md @@ -7,8 +7,7 @@ a subset of transactions** (rather than all of them) using `/subscribe?event=X`. example, I want to subscribe for all transactions associated with a particular account. Same for fetching. The user may want to **fetch transactions based on some filter** (rather than fetching all the blocks). For example, I want to get -all transactions for a particular account in the last two weeks (`tx's block -time >= '2017-06-05'`). +all transactions for a particular account in the last two weeks (`tx's block time >= '2017-06-05'`). Now you can't even subscribe to "all txs" in Tendermint. diff --git a/docs/architecture/adr-004-historical-validators.md b/docs/architecture/adr-004-historical-validators.md index be0de22c..c98af702 100644 --- a/docs/architecture/adr-004-historical-validators.md +++ b/docs/architecture/adr-004-historical-validators.md @@ -3,11 +3,11 @@ ## Context Right now, we can query the present validator set, but there is no history. -If you were offline for a long time, there is no way to reconstruct past validators. This is needed for the light client and we agreed needs enhancement of the API. +If you were offline for a long time, there is no way to reconstruct past validators. This is needed for the light client and we agreed needs enhancement of the API. ## Decision -For every block, store a new structure that contains either the latest validator set, +For every block, store a new structure that contains either the latest validator set, or the height of the last block for which the validator set changed. Note this is not the height of the block which returned the validator set change itself, but the next block, ie. the first block it comes into effect for. @@ -19,7 +19,7 @@ are updated frequently - for instance by only saving the diffs, rather than the An alternative approach suggested keeping the validator set, or diffs of it, in a merkle IAVL tree. While it might afford cheaper proofs that a validator set has not changed, it would be more complex, -and likely less efficient. +and likely less efficient. ## Status diff --git a/docs/architecture/adr-005-consensus-params.md b/docs/architecture/adr-005-consensus-params.md index 6656d35b..ad132c9b 100644 --- a/docs/architecture/adr-005-consensus-params.md +++ b/docs/architecture/adr-005-consensus-params.md @@ -7,7 +7,7 @@ Since they may be need to be different in different networks, and potentially to networks, we seek to initialize them in a genesis file, and expose them through the ABCI. While we have some specific parameters now, like maximum block and transaction size, we expect to have more in the future, -such as a period over which evidence is valid, or the frequency of checkpoints. +such as a period over which evidence is valid, or the frequency of checkpoints. ## Decision @@ -45,7 +45,7 @@ type BlockGossip struct { The `ConsensusParams` can evolve over time by adding new structs that cover different aspects of the consensus rules. -The `BlockPartSizeBytes` and the `BlockSize.MaxBytes` are enforced to be greater than 0. +The `BlockPartSizeBytes` and the `BlockSize.MaxBytes` are enforced to be greater than 0. The former because we need a part size, the latter so that we always have at least some sanity check over the size of blocks. ### ABCI @@ -53,14 +53,14 @@ The former because we need a part size, the latter so that we always have at lea #### InitChain InitChain currently takes the initial validator set. It should be extended to also take parts of the ConsensusParams. -There is some case to be made for it to take the entire Genesis, except there may be things in the genesis, +There is some case to be made for it to take the entire Genesis, except there may be things in the genesis, like the BlockPartSize, that the app shouldn't really know about. #### EndBlock The EndBlock response includes a `ConsensusParams`, which includes BlockSize and TxSize, but not BlockGossip. Other param struct can be added to `ConsensusParams` in the future. -The `0` value is used to denote no change. +The `0` value is used to denote no change. Any other value will update that parameter in the `State.ConsensusParams`, to be applied for the next block. Tendermint should have hard-coded upper limits as sanity checks. @@ -83,4 +83,3 @@ Proposed. ### Neutral - The TxSize, which checks validity, may be in conflict with the config's `max_block_size_tx`, which determines proposal sizes - diff --git a/docs/architecture/adr-006-trust-metric.md b/docs/architecture/adr-006-trust-metric.md index ec8a0cce..6fa77a60 100644 --- a/docs/architecture/adr-006-trust-metric.md +++ b/docs/architecture/adr-006-trust-metric.md @@ -8,13 +8,13 @@ The proposed trust metric will allow Tendermint to maintain local trust rankings The Tendermint Core project developers would like to improve Tendermint security and reliability by keeping track of the level of trustworthiness peers have demonstrated within the peer-to-peer network. This way, undesirable outcomes from peers will not immediately result in them being dropped from the network (potentially causing drastic changes to take place). Instead, peers behavior can be monitored with appropriate metrics and be removed from the network once Tendermint Core is certain the peer is a threat. For example, when the PEXReactor makes a request for peers network addresses from a already known peer, and the returned network addresses are unreachable, this untrustworthy behavior should be tracked. Returning a few bad network addresses probably shouldn’t cause a peer to be dropped, while excessive amounts of this behavior does qualify the peer being dropped. -Trust metrics can be circumvented by malicious nodes through the use of strategic oscillation techniques, which adapts the malicious node’s behavior pattern in order to maximize its goals. For instance, if the malicious node learns that the time interval of the Tendermint trust metric is *X* hours, then it could wait *X* hours in-between malicious activities. We could try to combat this issue by increasing the interval length, yet this will make the system less adaptive to recent events. +Trust metrics can be circumvented by malicious nodes through the use of strategic oscillation techniques, which adapts the malicious node’s behavior pattern in order to maximize its goals. For instance, if the malicious node learns that the time interval of the Tendermint trust metric is _X_ hours, then it could wait _X_ hours in-between malicious activities. We could try to combat this issue by increasing the interval length, yet this will make the system less adaptive to recent events. Instead, having shorter intervals, but keeping a history of interval values, will give our metric the flexibility needed in order to keep the network stable, while also making it resilient against a strategic malicious node in the Tendermint peer-to-peer network. Also, the metric can access trust data over a rather long period of time while not greatly increasing its history size by aggregating older history values over a larger number of intervals, and at the same time, maintain great precision for the recent intervals. This approach is referred to as fading memories, and closely resembles the way human beings remember their experiences. The trade-off to using history data is that the interval values should be preserved in-between executions of the node. ### References -S. Mudhakar, L. Xiong, and L. Liu, “TrustGuard: Countering Vulnerabilities in Reputation Management for Decentralized Overlay Networks,” in *Proceedings of the 14th international conference on World Wide Web, pp. 422-431*, May 2005. +S. Mudhakar, L. Xiong, and L. Liu, “TrustGuard: Countering Vulnerabilities in Reputation Management for Decentralized Overlay Networks,” in _Proceedings of the 14th international conference on World Wide Web, pp. 422-431_, May 2005. ## Decision @@ -26,25 +26,23 @@ The three subsections below will cover the process being considered for calculat The proposed trust metric will count good and bad events relevant to the object, and calculate the percent of counters that are good over an interval with a predefined duration. This is the procedure that will continue for the life of the trust metric. When the trust metric is queried for the current **trust value**, a resilient equation will be utilized to perform the calculation. -The equation being proposed resembles a Proportional-Integral-Derivative (PID) controller used in control systems. The proportional component allows us to be sensitive to the value of the most recent interval, while the integral component allows us to incorporate trust values stored in the history data, and the derivative component allows us to give weight to sudden changes in the behavior of a peer. We compute the trust value of a peer in interval i based on its current trust ranking, its trust rating history prior to interval *i* (over the past *maxH* number of intervals) and its trust ranking fluctuation. We will break up the equation into the three components. +The equation being proposed resembles a Proportional-Integral-Derivative (PID) controller used in control systems. The proportional component allows us to be sensitive to the value of the most recent interval, while the integral component allows us to incorporate trust values stored in the history data, and the derivative component allows us to give weight to sudden changes in the behavior of a peer. We compute the trust value of a peer in interval i based on its current trust ranking, its trust rating history prior to interval _i_ (over the past _maxH_ number of intervals) and its trust ranking fluctuation. We will break up the equation into the three components. ```math (1) Proportional Value = a * R[i] ``` -where *R*[*i*] denotes the raw trust value at time interval *i* (where *i* == 0 being current time) and *a* is the weight applied to the contribution of the current reports. The next component of our equation uses a weighted sum over the last *maxH* intervals to calculate the history value for time *i*: - +where _R_[*i*] denotes the raw trust value at time interval _i_ (where _i_ == 0 being current time) and _a_ is the weight applied to the contribution of the current reports. The next component of our equation uses a weighted sum over the last _maxH_ intervals to calculate the history value for time _i_: -`H[i] = ` ![formula1](img/formula1.png "Weighted Sum Formula") +`H[i] =` ![formula1](img/formula1.png "Weighted Sum Formula") - -The weights can be chosen either optimistically or pessimistically. An optimistic weight creates larger weights for newer history data values, while the the pessimistic weight creates larger weights for time intervals with lower scores. The default weights used during the calculation of the history value are optimistic and calculated as *Wk* = 0.8^*k*, for time interval *k*. With the history value available, we can now finish calculating the integral value: +The weights can be chosen either optimistically or pessimistically. An optimistic weight creates larger weights for newer history data values, while the the pessimistic weight creates larger weights for time intervals with lower scores. The default weights used during the calculation of the history value are optimistic and calculated as _Wk_ = 0.8^_k_, for time interval _k_. With the history value available, we can now finish calculating the integral value: ```math (2) Integral Value = b * H[i] ``` -Where *H*[*i*] denotes the history value at time interval *i* and *b* is the weight applied to the contribution of past performance for the object being measured. The derivative component will be calculated as follows: +Where _H_[*i*] denotes the history value at time interval _i_ and _b_ is the weight applied to the contribution of past performance for the object being measured. The derivative component will be calculated as follows: ```math D[i] = R[i] – H[i] @@ -52,25 +50,25 @@ D[i] = R[i] – H[i] (3) Derivative Value = c(D[i]) * D[i] ``` -Where the value of *c* is selected based on the *D*[*i*] value relative to zero. The default selection process makes *c* equal to 0 unless *D*[*i*] is a negative value, in which case c is equal to 1. The result is that the maximum penalty is applied when current behavior is lower than previously experienced behavior. If the current behavior is better than the previously experienced behavior, then the Derivative Value has no impact on the trust value. With the three components brought together, our trust value equation is calculated as follows: +Where the value of _c_ is selected based on the _D_[*i*] value relative to zero. The default selection process makes _c_ equal to 0 unless _D_[*i*] is a negative value, in which case c is equal to 1. The result is that the maximum penalty is applied when current behavior is lower than previously experienced behavior. If the current behavior is better than the previously experienced behavior, then the Derivative Value has no impact on the trust value. With the three components brought together, our trust value equation is calculated as follows: ```math TrustValue[i] = a * R[i] + b * H[i] + c(D[i]) * D[i] ``` -As a performance optimization that will keep the amount of raw interval data being saved to a reasonable size of *m*, while allowing us to represent 2^*m* - 1 history intervals, we can employ the fading memories technique that will trade space and time complexity for the precision of the history data values by summarizing larger quantities of less recent values. While our equation above attempts to access up to *maxH* (which can be 2^*m* - 1), we will map those requests down to *m* values using equation 4 below: +As a performance optimization that will keep the amount of raw interval data being saved to a reasonable size of _m_, while allowing us to represent 2^_m_ - 1 history intervals, we can employ the fading memories technique that will trade space and time complexity for the precision of the history data values by summarizing larger quantities of less recent values. While our equation above attempts to access up to _maxH_ (which can be 2^_m_ - 1), we will map those requests down to _m_ values using equation 4 below: ```math (4) j = index, where index > 0 ``` -Where *j* is one of *(0, 1, 2, … , m – 1)* indices used to access history interval data. Now we can access the raw intervals using the following calculations: +Where _j_ is one of _(0, 1, 2, … , m – 1)_ indices used to access history interval data. Now we can access the raw intervals using the following calculations: ```math R[0] = raw data for current time interval ``` -`R[j] = ` ![formula2](img/formula2.png "Fading Memories Formula") +`R[j] =` ![formula2](img/formula2.png "Fading Memories Formula") ### Trust Metric Store @@ -84,9 +82,7 @@ When the node is shutting down, the trust metric store will save history data fo Each trust metric allows for the recording of positive/negative events, querying the current trust value/score, and the stopping/pausing of tracking over time intervals. This can be seen below: - ```go - // TrustMetric - keeps track of peer reliability type TrustMetric struct { // Private elements. @@ -123,13 +119,11 @@ tm.BadEvents(1) score := tm.TrustScore() tm.Stop() - ``` Some of the trust metric parameters can be configured. The weight values should probably be left alone in more cases, yet the time durations for the tracking window and individual time interval should be considered. ```go - // TrustMetricConfig - Configures the weight functions and time intervals for the metric type TrustMetricConfig struct { // Determines the percentage given to current behavior @@ -165,23 +159,21 @@ config := TrustMetricConfig{ tm := NewMetricWithConfig(config) tm.BadEvents(10) -tm.Pause() +tm.Pause() tm.GoodEvents(1) // becomes active again - ``` -A trust metric store should be created with a DB that has persistent storage so it can save history data across node executions. All trust metrics instantiated by the store will be created with the provided TrustMetricConfig configuration. +A trust metric store should be created with a DB that has persistent storage so it can save history data across node executions. All trust metrics instantiated by the store will be created with the provided TrustMetricConfig configuration. When you attempt to fetch the trust metric for a peer, and an entry does not exist in the trust metric store, a new metric is automatically created and the entry made within the store. In additional to the fetching method, GetPeerTrustMetric, the trust metric store provides a method to call when a peer has disconnected from the node. This is so the metric can be paused (history data will not be saved) for periods of time when the node is not having direct experiences with the peer. ```go - // TrustMetricStore - Manages all trust metrics for peers type TrustMetricStore struct { cmn.BaseService - + // Private elements } @@ -214,7 +206,6 @@ tm := tms.GetPeerTrustMetric(key) tm.BadEvents(1) tms.PeerDisconnected(key) - ``` ## Status diff --git a/docs/architecture/adr-007-trust-metric-usage.md b/docs/architecture/adr-007-trust-metric-usage.md index 4d833a69..de3a088c 100644 --- a/docs/architecture/adr-007-trust-metric-usage.md +++ b/docs/architecture/adr-007-trust-metric-usage.md @@ -17,11 +17,13 @@ For example, when the PEXReactor makes a request for peers network addresses fro The trust metric implementation allows a developer to obtain a peer's trust metric from a trust metric store, and track good and bad events relevant to a peer's behavior, and at any time, the peer's metric can be queried for a current trust value. The current trust value is calculated with a formula that utilizes current behavior, previous behavior, and change between the two. Current behavior is calculated as the percentage of good behavior within a time interval. The time interval is short; probably set between 30 seconds and 5 minutes. On the other hand, the historic data can estimate a peer's behavior over days worth of tracking. At the end of a time interval, the current behavior becomes part of the historic data, and a new time interval begins with the good and bad counters reset to zero. These are some important things to keep in mind regarding how the trust metrics handle time intervals and scoring: + - Each new time interval begins with a perfect score - Bad events quickly bring the score down and good events cause the score to slowly rise - When the time interval is over, the percentage of good events becomes historic data. Some useful information about the inner workings of the trust metric: + - When a trust metric is first instantiated, a timer (ticker) periodically fires in order to handle transitions between trust metric time intervals - If a peer is disconnected from a node, the timer should be paused, since the node is no longer connected to that peer - The ability to pause the metric is supported with the store **PeerDisconnected** method and the metric **Pause** method @@ -76,6 +78,7 @@ Peer quality is tracked in the connection and across the reactors by storing the thread safe Data store. Peer behaviour is then defined as one of the following: + - Fatal - something outright malicious that causes us to disconnect the peer and ban it from the address book for some amount of time - Bad - Any kind of timeout, messages that don't unmarshal, fail other validity checks, or messages we didn't ask for or aren't expecting (usually worth one bad event) - Neutral - Unknown channels/message types/version upgrades (no good or bad events recorded) diff --git a/docs/architecture/adr-008-priv-validator.md b/docs/architecture/adr-008-priv-validator.md index 4c1d87be..94e882af 100644 --- a/docs/architecture/adr-008-priv-validator.md +++ b/docs/architecture/adr-008-priv-validator.md @@ -11,18 +11,18 @@ implementations: The SocketPV address can be provided via flags at the command line - doing so will cause Tendermint to ignore any "priv_validator.json" file and to listen on the given address for incoming connections from an external priv_validator -process. It will halt any operation until at least one external process +process. It will halt any operation until at least one external process succesfully connected. The external priv_validator process will dial the address to connect to Tendermint, and then Tendermint will send requests on the ensuing connection to -sign votes and proposals. Thus the external process initiates the connection, -but the Tendermint process makes all requests. In a later stage we're going to +sign votes and proposals. Thus the external process initiates the connection, +but the Tendermint process makes all requests. In a later stage we're going to support multiple validators for fault tolerance. To prevent double signing they need to be synced, which is deferred to an external solution (see #1185). In addition, Tendermint will provide implementations that can be run in that -external process. These include: +external process. These include: - FilePV will encrypt the private key, and the user must enter password to decrypt key when process is started. diff --git a/docs/architecture/adr-009-ABCI-design.md b/docs/architecture/adr-009-ABCI-design.md index 8b85679b..fab28853 100644 --- a/docs/architecture/adr-009-ABCI-design.md +++ b/docs/architecture/adr-009-ABCI-design.md @@ -8,7 +8,7 @@ ## Context -The ABCI was first introduced in late 2015. It's purpose is to be: +The ABCI was first introduced in late 2015. It's purpose is to be: - a generic interface between state machines and their replication engines - agnostic to the language the state machine is written in @@ -66,8 +66,8 @@ possible. ### Validators To change the validator set, applications can return a list of validator updates -with ResponseEndBlock. In these updates, the public key *must* be included, -because Tendermint requires the public key to verify validator signatures. This +with ResponseEndBlock. In these updates, the public key _must_ be included, +because Tendermint requires the public key to verify validator signatures. This means ABCI developers have to work with PubKeys. That said, it would also be convenient to work with address information, and for it to be simple to do so. @@ -80,7 +80,7 @@ in commits. ### InitChain -Tendermint passes in a list of validators here, and nothing else. It would +Tendermint passes in a list of validators here, and nothing else. It would benefit the application to be able to control the initial validator set. For instance the genesis file could include application-based information about the initial validator set that the application could process to determine the @@ -120,7 +120,6 @@ v1 will: That said, an Amino v2 will be worked on to improve the performance of the format and its useability in cryptographic applications. - ### PubKey Encoding schemes infect software. As a generic middleware, ABCI aims to have @@ -143,7 +142,6 @@ where `type` can be: - "ed225519", with `data = ` - "secp256k1", with `data = <33-byte OpenSSL compressed pubkey>` - As we want to retain flexibility here, and since ideally, PubKey would be an interface type, we do not use `enum` or `oneof`. diff --git a/docs/architecture/adr-010-crypto-changes.md b/docs/architecture/adr-010-crypto-changes.md index cfe61842..0bc07d69 100644 --- a/docs/architecture/adr-010-crypto-changes.md +++ b/docs/architecture/adr-010-crypto-changes.md @@ -66,13 +66,10 @@ Make the following changes: - More modern and standard cryptographic functions with wider adoption and hardware acceleration - ### Negative - Exact authenticated encryption construction isn't already provided in a well-used library - ### Neutral ## References - diff --git a/docs/architecture/adr-011-monitoring.md b/docs/architecture/adr-011-monitoring.md index ca16a9a1..8f2d009d 100644 --- a/docs/architecture/adr-011-monitoring.md +++ b/docs/architecture/adr-011-monitoring.md @@ -15,11 +15,11 @@ https://github.com/tendermint/tendermint/issues/986. A few solutions were considered: 1. [Prometheus](https://prometheus.io) - a) Prometheus API - b) [go-kit metrics package](https://github.com/go-kit/kit/tree/master/metrics) as an interface plus Prometheus - c) [telegraf](https://github.com/influxdata/telegraf) - d) new service, which will listen to events emitted by pubsub and report metrics -5. [OpenCensus](https://opencensus.io/go/index.html) + a) Prometheus API + b) [go-kit metrics package](https://github.com/go-kit/kit/tree/master/metrics) as an interface plus Prometheus + c) [telegraf](https://github.com/influxdata/telegraf) + d) new service, which will listen to events emitted by pubsub and report metrics +2. [OpenCensus](https://opencensus.io/go/index.html) ### 1. Prometheus @@ -70,30 +70,30 @@ will need to write interfaces ourselves. ### List of metrics -| | Name | Type | Description | -| - | --------------------------------------- | ------- | ----------------------------------------------------------------------------- | -| A | consensus_height | Gauge | | -| A | consensus_validators | Gauge | Number of validators who signed | -| A | consensus_validators_power | Gauge | Total voting power of all validators | -| A | consensus_missing_validators | Gauge | Number of validators who did not sign | -| A | consensus_missing_validators_power | Gauge | Total voting power of the missing validators | -| A | consensus_byzantine_validators | Gauge | Number of validators who tried to double sign | -| A | consensus_byzantine_validators_power | Gauge | Total voting power of the byzantine validators | -| A | consensus_block_interval | Timing | Time between this and last block (Block.Header.Time) | -| | consensus_block_time | Timing | Time to create a block (from creating a proposal to commit) | -| | consensus_time_between_blocks | Timing | Time between committing last block and (receiving proposal creating proposal) | -| A | consensus_rounds | Gauge | Number of rounds | -| | consensus_prevotes | Gauge | | -| | consensus_precommits | Gauge | | -| | consensus_prevotes_total_power | Gauge | | -| | consensus_precommits_total_power | Gauge | | -| A | consensus_num_txs | Gauge | | -| A | mempool_size | Gauge | | -| A | consensus_total_txs | Gauge | | -| A | consensus_block_size | Gauge | In bytes | -| A | p2p_peers | Gauge | Number of peers node's connected to | +| | Name | Type | Description | +| --- | ------------------------------------ | ------ | ----------------------------------------------------------------------------- | +| A | consensus_height | Gauge | | +| A | consensus_validators | Gauge | Number of validators who signed | +| A | consensus_validators_power | Gauge | Total voting power of all validators | +| A | consensus_missing_validators | Gauge | Number of validators who did not sign | +| A | consensus_missing_validators_power | Gauge | Total voting power of the missing validators | +| A | consensus_byzantine_validators | Gauge | Number of validators who tried to double sign | +| A | consensus_byzantine_validators_power | Gauge | Total voting power of the byzantine validators | +| A | consensus_block_interval | Timing | Time between this and last block (Block.Header.Time) | +| | consensus_block_time | Timing | Time to create a block (from creating a proposal to commit) | +| | consensus_time_between_blocks | Timing | Time between committing last block and (receiving proposal creating proposal) | +| A | consensus_rounds | Gauge | Number of rounds | +| | consensus_prevotes | Gauge | | +| | consensus_precommits | Gauge | | +| | consensus_prevotes_total_power | Gauge | | +| | consensus_precommits_total_power | Gauge | | +| A | consensus_num_txs | Gauge | | +| A | mempool_size | Gauge | | +| A | consensus_total_txs | Gauge | | +| A | consensus_block_size | Gauge | In bytes | +| A | p2p_peers | Gauge | Number of peers node's connected to | -`A` - will be implemented in the fist place. +`A` - will be implemented in the fist place. **Proposed solution** diff --git a/docs/architecture/adr-012-ABCI-propose-tx.md b/docs/architecture/adr-012-ABCI-propose-tx.md index 4ea290f0..497ccd18 100644 --- a/docs/architecture/adr-012-ABCI-propose-tx.md +++ b/docs/architecture/adr-012-ABCI-propose-tx.md @@ -33,7 +33,7 @@ Due to the requirements of [Minimal Viable Plasma (MVP)](https://ethresear.ch/t/ special treatment. 2. Other "internal" transactions on the child chain, which may be initiated - unilaterally. The most basic example of is a coinbase transaction + unilaterally. The most basic example of is a coinbase transaction implementing validator node incentives, but may also be app-specific. In these cases, it may be favourable for such transactions to be ordered in a specific manner, e.g., coinbase transactions will always be @@ -86,14 +86,14 @@ current proposer is passed to `BeginBlock`. It is much easier to relay these transactions directly to the Root Chain smart contract and/or maintain a "compressed" auxiliary chain comprised of Plasma-friendly blocks that 100% reflect the canonical (Tendermint) -blockchain. Unfortunately, this approach not idiomatic (i.e., utilises the +blockchain. Unfortunately, this approach not idiomatic (i.e., utilises the Tendermint consensus engine in unintended ways). Additionally, it does not allow the application developer to: - Control the _ordering_ of transactions in the proposed block (e.g., index 0, -or 0 to `n` for coinbase transactions) + or 0 to `n` for coinbase transactions) - Control the _number_ of transactions in the block (e.g., when a `deposit` -block is required) + block is required) Since determinism is of utmost importance in blockchain engineering, this approach, while more viable, should also not be considered as fit for production. @@ -163,9 +163,9 @@ Pending - Tendermint ABCI apps will be able to function as minimally viable Plasma chains. - It will thereby become possible to add an extension to `cosmos-sdk` to enable - ABCI apps to support both IBC and Plasma, maximising interop. + ABCI apps to support both IBC and Plasma, maximising interop. - ABCI apps will have great control and flexibility in managing blockchain state, - without having to resort to non-deterministic hacks and/or unsafe workarounds + without having to resort to non-deterministic hacks and/or unsafe workarounds ### Negative diff --git a/docs/architecture/adr-012-peer-transport.md b/docs/architecture/adr-012-peer-transport.md index 01a79c8a..1cf4fb80 100644 --- a/docs/architecture/adr-012-peer-transport.md +++ b/docs/architecture/adr-012-peer-transport.md @@ -9,8 +9,9 @@ handling. An artifact is the dependency of the Switch on `[config.P2PConfig`](https://github.com/tendermint/tendermint/blob/05a76fb517f50da27b4bfcdc7b4cf185fc61eff6/config/config.go#L272-L339). Addresses: -* [#2046](https://github.com/tendermint/tendermint/issues/2046) -* [#2047](https://github.com/tendermint/tendermint/issues/2047) + +- [#2046](https://github.com/tendermint/tendermint/issues/2046) +- [#2047](https://github.com/tendermint/tendermint/issues/2047) First iteraton in [#2067](https://github.com/tendermint/tendermint/issues/2067) @@ -29,15 +30,14 @@ transport implementation is responsible to filter establishing peers specific to its domain, for the default multiplexed implementation the following will apply: -* connections from our own node -* handshake fails -* upgrade to secret connection fails -* prevent duplicate ip -* prevent duplicate id -* nodeinfo incompatibility +- connections from our own node +- handshake fails +- upgrade to secret connection fails +- prevent duplicate ip +- prevent duplicate id +- nodeinfo incompatibility - -``` go +```go // PeerTransport proxies incoming and outgoing peer connections. type PeerTransport interface { // Accept returns a newly connected Peer. @@ -75,7 +75,7 @@ func NewMTransport( nodeAddr NetAddress, nodeInfo NodeInfo, nodeKey NodeKey, -) *multiplexTransport +) *multiplexTransport ``` ### Switch @@ -84,7 +84,7 @@ From now the Switch will depend on a fully setup `PeerTransport` to retrieve/reach out to its peers. As the more low-level concerns are pushed to the transport, we can omit passing the `config.P2PConfig` to the Switch. -``` go +```go func NewSwitch(transport PeerTransport, opts ...SwitchOption) *Switch ``` @@ -96,17 +96,17 @@ In Review. ### Positive -* free Switch from transport concerns - simpler implementation -* pluggable transport implementation - simpler test setup -* remove Switch dependency on P2PConfig - easier to test +- free Switch from transport concerns - simpler implementation +- pluggable transport implementation - simpler test setup +- remove Switch dependency on P2PConfig - easier to test ### Negative -* more setup for tests which depend on Switches +- more setup for tests which depend on Switches ### Neutral -* multiplexed will be the default implementation +- multiplexed will be the default implementation [0] These guards could be potentially extended to be pluggable much like middlewares to express different concerns required by differentally configured diff --git a/docs/architecture/adr-013-symmetric-crypto.md b/docs/architecture/adr-013-symmetric-crypto.md index 00442ab0..69bfc2f2 100644 --- a/docs/architecture/adr-013-symmetric-crypto.md +++ b/docs/architecture/adr-013-symmetric-crypto.md @@ -14,22 +14,23 @@ to easily swap these out. ### How do we encrypt with AEAD's -AEAD's typically require a nonce in addition to the key. +AEAD's typically require a nonce in addition to the key. For the purposes we require symmetric cryptography for, we need encryption to be stateless. -Because of this we use random nonces. +Because of this we use random nonces. (Thus the AEAD must support random nonces) -We currently construct a random nonce, and encrypt the data with it. +We currently construct a random nonce, and encrypt the data with it. The returned value is `nonce || encrypted data`. The limitation of this is that does not provide a way to identify which algorithm was used in encryption. -Consequently decryption with multiple algoritms is sub-optimal. +Consequently decryption with multiple algoritms is sub-optimal. (You have to try them all) ## Decision -We should create the following two methods in a new `crypto/encoding/symmetric` package: +We should create the following two methods in a new `crypto/encoding/symmetric` package: + ```golang func Encrypt(aead cipher.AEAD, plaintext []byte) (ciphertext []byte, err error) func Decrypt(key []byte, ciphertext []byte) (plaintext []byte, err error) @@ -37,18 +38,19 @@ func Register(aead cipher.AEAD, algo_name string, NewAead func(key []byte) (ciph ``` This allows you to specify the algorithm in encryption, but not have to specify -it in decryption. +it in decryption. This is intended for ease of use in downstream applications, in addition to people looking at the file directly. One downside is that for the encrypt function you must have already initialized an AEAD, -but I don't really see this as an issue. +but I don't really see this as an issue. -If there is no error in encryption, Encrypt will return `algo_name || nonce || aead_ciphertext`. +If there is no error in encryption, Encrypt will return `algo_name || nonce || aead_ciphertext`. `algo_name` should be length prefixed, using standard varuint encoding. This will be binary data, but thats not a problem considering the nonce and ciphertext are also binary. -This solution requires a mapping from aead type to name. -We can achieve this via reflection. +This solution requires a mapping from aead type to name. +We can achieve this via reflection. + ```golang func getType(myvar interface{}) string { if t := reflect.TypeOf(myvar); t.Kind() == reflect.Ptr { @@ -58,7 +60,8 @@ func getType(myvar interface{}) string { } } ``` -Then we maintain a map from the name returned from `getType(aead)` to `algo_name`. + +Then we maintain a map from the name returned from `getType(aead)` to `algo_name`. In decryption, we read the `algo_name`, and then instantiate a new AEAD with the key. Then we call the AEAD's decrypt method on the provided nonce/ciphertext. @@ -81,13 +84,16 @@ Proposed. ## Consequences ### Positive -* Allows us to support new AEAD's, in a way that makes decryption easier -* Allows downstream users to add their own AEAD + +- Allows us to support new AEAD's, in a way that makes decryption easier +- Allows downstream users to add their own AEAD ### Negative -* We will have to break all private keys stored on disk. -They can be recovered using seed words, and upgrade scripts are simple. + +- We will have to break all private keys stored on disk. + They can be recovered using seed words, and upgrade scripts are simple. ### Neutral -* Caller has to instantiate the AEAD with the private key. -However it forces them to be aware of what signing algorithm they are using, which is a positive. \ No newline at end of file + +- Caller has to instantiate the AEAD with the private key. + However it forces them to be aware of what signing algorithm they are using, which is a positive. diff --git a/docs/architecture/adr-014-secp-malleability.md b/docs/architecture/adr-014-secp-malleability.md index 3351056c..ce84c7eb 100644 --- a/docs/architecture/adr-014-secp-malleability.md +++ b/docs/architecture/adr-014-secp-malleability.md @@ -22,21 +22,21 @@ Removing this second layer of signature malleability concerns could ease downstr ### ECDSA context Secp256k1 is ECDSA over a particular curve. -The signature is of the form `(r, s)`, where `s` is a field element. +The signature is of the form `(r, s)`, where `s` is a field element. (The particular field is the `Z_n`, where the elliptic curve has order `n`) However `(r, -s)` is also another valid solution. Note that anyone can negate a group element, and therefore can get this second signature. ## Decision -We can just distinguish a canonical form for the ECDSA signatures. +We can just distinguish a canonical form for the ECDSA signatures. Then we require that all ECDSA signatures be in the form which we defined as canonical. We reject signatures in non-canonical form. -A canonical form is rather easy to define and check. +A canonical form is rather easy to define and check. It would just be the smaller of the two values for `s`, defined lexicographically. This is a simple check, instead of checking if `s < n`, instead check `s <= (n - 1)/2`. -An example of another cryptosystem using this +An example of another cryptosystem using this is the parity definition here https://github.com/zkcrypto/pairing/pull/30#issuecomment-372910663. This is the same solution Ethereum has chosen for solving secp malleability. @@ -52,10 +52,12 @@ Proposed. ## Consequences ### Positive -* Lets us maintain the ability to expect a tx hash to appear in the blockchain. + +- Lets us maintain the ability to expect a tx hash to appear in the blockchain. ### Negative -* More work in all future implementations (Though this is a very simple check) -* Requires us to maintain another fork + +- More work in all future implementations (Though this is a very simple check) +- Requires us to maintain another fork ### Neutral diff --git a/docs/architecture/adr-015-crypto-encoding.md b/docs/architecture/adr-015-crypto-encoding.md index 67cce95f..f6818d5d 100644 --- a/docs/architecture/adr-015-crypto-encoding.md +++ b/docs/architecture/adr-015-crypto-encoding.md @@ -1,8 +1,8 @@ -# ADR 015: Crypto encoding +# ADR 015: Crypto encoding ## Context -We must standardize our method for encoding public keys and signatures on chain. +We must standardize our method for encoding public keys and signatures on chain. Currently we amino encode the public keys and signatures. The reason we are using amino here is primarily due to ease of support in parsing for other languages. @@ -54,9 +54,11 @@ When placed in state, signatures will still be amino encoded, but it will be the primitive type `[]byte` getting encoded. #### Ed25519 + Use the canonical representation for signatures. #### Secp256k1 + There isn't a clear canonical representation here. Signatures have two elements `r,s`. These bytes are encoded as `r || s`, where `r` and `s` are both exactly @@ -71,10 +73,13 @@ Needs decision on Enum types. ## Consequences ### Positive -* More space efficient signatures + +- More space efficient signatures ### Negative -* We have an amino dependency for cryptography. + +- We have an amino dependency for cryptography. ### Neutral -* No change to public keys \ No newline at end of file + +- No change to public keys diff --git a/docs/architecture/adr-016-protocol-versions.md b/docs/architecture/adr-016-protocol-versions.md index 636cb181..4dba4e84 100644 --- a/docs/architecture/adr-016-protocol-versions.md +++ b/docs/architecture/adr-016-protocol-versions.md @@ -8,14 +8,14 @@ ## Changelog - 03-08-2018: Updates from discussion with Jae: - - ProtocolVersion contains Block/AppVersion, not Current/Next - - signal upgrades to Tendermint using EndBlock fields - - dont restrict peer compatibilty by version to simplify syncing old nodes + - ProtocolVersion contains Block/AppVersion, not Current/Next + - signal upgrades to Tendermint using EndBlock fields + - dont restrict peer compatibilty by version to simplify syncing old nodes - 28-07-2018: Updates from review - - split into two ADRs - one for protocol, one for chains - - include signalling for upgrades in header + - split into two ADRs - one for protocol, one for chains + - include signalling for upgrades in header - 16-07-2018: Initial draft - was originally joint ADR for protocol and chain -versions + versions ## Context @@ -59,18 +59,16 @@ to connect to peers with older version. ### BlockVersion - All tendermint hashed data-structures (headers, votes, txs, responses, etc.). - - Note the semantic meaning of a transaction may change according to the AppVersion, - but the way txs are merklized into the header is part of the BlockVersion + - Note the semantic meaning of a transaction may change according to the AppVersion, but the way txs are merklized into the header is part of the BlockVersion - It should be the least frequent/likely to change. - - Tendermint should be stabilizing - it's just Atomic Broadcast. - - We can start considering for Tendermint v2.0 in a year + - Tendermint should be stabilizing - it's just Atomic Broadcast. + - We can start considering for Tendermint v2.0 in a year - It's easy to determine the version of a block from its serialized form ### P2PVersion - All p2p and reactor messaging (messages, detectable behaviour) -- Will change gradually as reactors evolve to improve performance and support new features - - eg proposed new message types BatchTx in the mempool and HasBlockPart in the consensus +- Will change gradually as reactors evolve to improve performance and support new features - eg proposed new message types BatchTx in the mempool and HasBlockPart in the consensus - It's easy to determine the version of a peer from its first serialized message/s - New versions must be compatible with at least one old version to allow gradual upgrades @@ -79,10 +77,10 @@ to connect to peers with older version. - The ABCI state machine (txs, begin/endblock behaviour, commit hashing) - Behaviour and message types will change abruptly in the course of the life of a chain - Need to minimize complexity of the code for supporting different AppVersions at different heights -- Ideally, each version of the software supports only a *single* AppVersion at one time - - this means we checkout different versions of the software at different heights instead of littering the code - with conditionals - - minimize the number of data migrations required across AppVersion (ie. most AppVersion should be able to read the same state from disk as previous AppVersion). +- Ideally, each version of the software supports only a _single_ AppVersion at one time + - this means we checkout different versions of the software at different heights instead of littering the code + with conditionals + - minimize the number of data migrations required across AppVersion (ie. most AppVersion should be able to read the same state from disk as previous AppVersion). ## Ideal @@ -125,7 +123,6 @@ serve as a complete description of the consensus-critical protocol. Using the `NextVersion` field, proposer's can signal their readiness to upgrade to a new Block and/or App version. - ### NodeInfo NodeInfo should include a Version struct as its first field like: @@ -150,7 +147,6 @@ it's SemVer version - this is for convenience only. Eg. The other versions and ChainID will determine peer compatibility (described below). - ### ABCI Since the ABCI is responsible for keeping Tendermint and the App in sync, we @@ -280,7 +276,6 @@ checking out and installing new software versions and restarting the process. It would subscribe to the relevant upgrade event (needs to be implemented) and call `/unsafe_stop` at the correct height (of course only after getting approval from its user!) - ## Consequences ### Positive diff --git a/docs/architecture/adr-017-chain-versions.md b/docs/architecture/adr-017-chain-versions.md index 4be7e6e5..7113dbae 100644 --- a/docs/architecture/adr-017-chain-versions.md +++ b/docs/architecture/adr-017-chain-versions.md @@ -7,9 +7,9 @@ ## Changelog - 28-07-2018: Updates from review - - split into two ADRs - one for protocol, one for chains + - split into two ADRs - one for protocol, one for chains - 16-07-2018: Initial draft - was originally joint ADR for protocol and chain -versions + versions ## Context @@ -41,20 +41,19 @@ Peers only connect to other peers with the same NetworkName. We need to support existing networks upgrading and forking, wherein they may do any of: - - revert back to some height, continue with the same versions but new blocks - - arbitrarily mutate state at some height, continue with the same versions (eg. Dao Fork) - - change the AppVersion at some height + - revert back to some height, continue with the same versions but new blocks + - arbitrarily mutate state at some height, continue with the same versions (eg. Dao Fork) + - change the AppVersion at some height Note because of Tendermint's voting power threshold rules, a chain can only be extended under the "original" rules and under the new rules if 1/3 or more is double signing, which is expressly prohibited, and is supposed to result in their punishment on both chains. Since they can censor the punishment, the chain is expected to be hardforked to remove the validators. Thus, if both branches are to continue after a fork, they will each require a new identifier, and the old chain identifier will be retired (ie. only useful for syncing history, not for new blocks).. - TODO: explain how to handle slashing when chain id changed! +TODO: explain how to handle slashing when chain id changed! We need a consistent way to describe forks. - ## Proposal ### ChainDescription @@ -92,9 +91,9 @@ ChainDescription = /x// ``` Where - - ChainID is the ChainID from the previous ChainDescription (ie. its hash) - - `x` denotes that a change occured - - `Height` is the height the change occured - - ForkDescription has the same form as ChainDescription but for the fork - - this allows forks to specify new versions for tendermint or the app, as well as arbitrary changes to the state or validator set +- ChainID is the ChainID from the previous ChainDescription (ie. its hash) +- `x` denotes that a change occured +- `Height` is the height the change occured +- ForkDescription has the same form as ChainDescription but for the fork +- this allows forks to specify new versions for tendermint or the app, as well as arbitrary changes to the state or validator set diff --git a/docs/architecture/adr-019-multisigs.md b/docs/architecture/adr-019-multisigs.md index 98bb5ec0..3d1c5ba8 100644 --- a/docs/architecture/adr-019-multisigs.md +++ b/docs/architecture/adr-019-multisigs.md @@ -1,6 +1,6 @@ # ADR 019: Encoding standard for Multisignatures -## Changelog +## Changelog 06-08-2018: Minor updates @@ -10,9 +10,9 @@ ## Context -Multisignatures, or technically _Accountable Subgroup Multisignatures_ (ASM), -are signature schemes which enable any subgroup of a set of signers to sign any message, -and reveal to the verifier exactly who the signers were. +Multisignatures, or technically _Accountable Subgroup Multisignatures_ (ASM), +are signature schemes which enable any subgroup of a set of signers to sign any message, +and reveal to the verifier exactly who the signers were. This allows for complex conditionals of when to validate a signature. Suppose the set of signers is of size _n_. @@ -22,7 +22,7 @@ this becomes what is commonly reffered to as a _k of n multisig_ in Bitcoin. This ADR specifies the encoding standard for general accountable subgroup multisignatures, k of n accountable subgroup multisignatures, and its weighted variant. -In the future, we can also allow for more complex conditionals on the accountable subgroup. +In the future, we can also allow for more complex conditionals on the accountable subgroup. ## Proposed Solution @@ -42,6 +42,7 @@ type ThresholdMultiSignaturePubKey struct { // K of N threshold multisig Pubkeys []crypto.Pubkey `json:"pubkeys"` } ``` + We will derive N from the length of pubkeys. (For spatial efficiency in encoding) `Verify` will expect an `[]byte` encoded version of the Multisignature. @@ -56,7 +57,7 @@ the kth public key on the message. Address will be `Hash(amino_encoded_pubkey)` The reason this doesn't use `log_8(n)` bytes per signer is because that heavily optimizes for the case where a very small number of signers are required. -e.g. for `n` of size `24`, that would only be more space efficient for `k < 3`. +e.g. for `n` of size `24`, that would only be more space efficient for `k < 3`. This seems less likely, and that it should not be the case optimized for. #### Weighted threshold signature @@ -70,17 +71,19 @@ type WeightedThresholdMultiSignaturePubKey struct { Pubkeys []crypto.Pubkey `json:"pubkeys"` } ``` + Weights and Pubkeys must be of the same length. -Everything else proceeds identically to the K of N multisig, +Everything else proceeds identically to the K of N multisig, except the multisig fails if the sum of the weights is less than the threshold. #### Multisignature The inter-mediate phase of the signatures (as it accrues more signatures) will be the following struct: + ```golang type Multisignature struct { BitArray CryptoBitArray // Documented later - Sigs [][]byte + Sigs [][]byte ``` It is important to recall that each private key will output a signature on the provided message itself. @@ -88,24 +91,29 @@ So no signing algorithm ever outputs the multisignature. The UI will take a signature, cast into a multisignature, and then keep adding new signatures into it, and when done marshal into `[]byte`. This will require the following helper methods: + ```golang func SigToMultisig(sig []byte, n int) func GetIndex(pk crypto.Pubkey, []crypto.Pubkey) func AddSignature(sig Signature, index int, multiSig *Multisignature) ``` + The multisignature will be converted to an `[]byte` using amino.MarshalBinaryBare. \* #### Bit Array -We would be using a new implementation of a bitarray. The struct it would be encoded/decoded from is + +We would be using a new implementation of a bitarray. The struct it would be encoded/decoded from is + ```golang type CryptoBitArray struct { - ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. + ExtraBitsStored byte `json:"extra_bits"` // The number of extra bits in elems. Elems []byte `json:"elems"` } ``` + The reason for not using the BitArray currently implemented in `libs/common/bit_array.go` is that it is less space efficient, due to a space / time trade-off. -Evidence for this is outlined in [this issue](https://github.com/tendermint/tendermint/issues/2077). +Evidence for this is outlined in [this issue](https://github.com/tendermint/tendermint/issues/2077). In the multisig, we will not be performing arithmetic operations, so there is no performance increase with the current implementation, @@ -122,7 +130,7 @@ Again the implementation of this space saving feature is straight forward. ### Encoding the structs -We will use straight forward amino encoding. This is chosen for ease of compatibility in other languages. +We will use straight forward amino encoding. This is chosen for ease of compatibility in other languages. ### Future points of discussion @@ -133,18 +141,20 @@ Aggregation of pubkeys / sigs in Schnorr sigs / BLS sigs is not backwards compat ## Status -Proposed. +Proposed. ## Consequences ### Positive -* Supports multisignatures, in a way that won't require any special cases in our downstream verification code. -* Easy to serialize / deserialize -* Unbounded number of signers + +- Supports multisignatures, in a way that won't require any special cases in our downstream verification code. +- Easy to serialize / deserialize +- Unbounded number of signers ### Negative -* Larger codebase, however this should reside in a subfolder of tendermint/crypto, as it provides no new interfaces. (Ref #https://github.com/tendermint/go-crypto/issues/136) -* Space inefficient due to utilization of amino encoding -* Suggested implementation requires a new struct for every ASM. + +- Larger codebase, however this should reside in a subfolder of tendermint/crypto, as it provides no new interfaces. (Ref #https://github.com/tendermint/go-crypto/issues/136) +- Space inefficient due to utilization of amino encoding +- Suggested implementation requires a new struct for every ASM. ### Neutral diff --git a/docs/architecture/adr-template.md b/docs/architecture/adr-template.md index 2303490a..d47c7f55 100644 --- a/docs/architecture/adr-template.md +++ b/docs/architecture/adr-template.md @@ -6,7 +6,6 @@ ## Status - ## Consequences ### Positive diff --git a/docs/package.json b/docs/package.json index c76bb37c..d45ba539 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,7 +3,9 @@ "prettier": "^1.13.7", "remark-cli": "^5.0.0", "remark-lint-no-dead-urls": "^0.3.0", - "textlint": "^10.2.1" + "remark-lint-write-good": "^1.0.3", + "textlint": "^10.2.1", + "textlint-rule-stop-words": "^1.0.3" }, "name": "tendermint", "description": "Tendermint Core Documentation", @@ -31,7 +33,8 @@ "homepage": "https://tendermint.com/docs/", "remarkConfig": { "plugins": [ - "remark-lint-no-dead-urls" + "remark-lint-no-dead-urls", + "remark-lint-write-good" ] } } diff --git a/docs/spec/README.md b/docs/spec/README.md index ab689d9d..82ed9717 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -57,7 +57,7 @@ is malicious or faulty. A commit in Tendermint is a set of signed messages from more than 2/3 of the total weight of the current Validator set. Validators take turns proposing blocks and voting on them. Once enough votes are received, the block is considered -committed. These votes are included in the *next* block as proof that the previous block +committed. These votes are included in the _next_ block as proof that the previous block was committed - they cannot be included in the current block, as that block has already been created. @@ -71,8 +71,8 @@ of the latest state of the blockchain. To achieve this, it embeds cryptographic commitments to certain information in the block "header". This information includes the contents of the block (eg. the transactions), the validator set committing the block, as well as the various results returned by the application. -Note, however, that block execution only occurs *after* a block is committed. -Thus, application results can only be included in the *next* block. +Note, however, that block execution only occurs _after_ a block is committed. +Thus, application results can only be included in the _next_ block. Also note that information like the transaction results and the validator set are never directly included in the block - only their cryptographic digests (Merkle roots) are. diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index eab3acdf..e1e0c3fe 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -104,8 +104,8 @@ type Vote struct { ``` There are two types of votes: -a *prevote* has `vote.Type == 1` and -a *precommit* has `vote.Type == 2`. +a _prevote_ has `vote.Type == 1` and +a _precommit_ has `vote.Type == 2`. ## Signature @@ -162,10 +162,10 @@ We refer to certain globally available objects: `prevBlock` is the `block` at the previous height, and `state` keeps track of the validator set, the consensus parameters and other results from the application. At the point when `block` is the block under consideration, -the current version of the `state` corresponds to the state -after executing transactions from the `prevBlock`. +the current version of the `state` corresponds to the state +after executing transactions from the `prevBlock`. Elements of an object are accessed as expected, -ie. `block.Header`. +ie. `block.Header`. See [here](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/state.md) for the definition of `state`. ### Header @@ -288,6 +288,7 @@ This can be used to validate the `LastCommit` included in the next block. ```go block.NextValidatorsHash == SimpleMerkleRoot(state.NextValidators) ``` + Simple Merkle root of the next validator set that will be the validator set that commits the next block. Modifications to the validator set are defined by the application. @@ -427,11 +428,8 @@ Execute(s State, app ABCIApp, block Block) State { AppHash: AppHash, LastValidators: state.Validators, Validators: state.NextValidators, - NextValidators: UpdateValidators(state.NextValidators, ValidatorChanges), + NextValidators: UpdateValidators(state.NextValidators, ValidatorChanges), ConsensusParams: UpdateConsensusParams(state.ConsensusParams, ConsensusParamChanges), } } - ``` - - diff --git a/docs/spec/blockchain/encoding.md b/docs/spec/blockchain/encoding.md index 49c88475..a0acad39 100644 --- a/docs/spec/blockchain/encoding.md +++ b/docs/spec/blockchain/encoding.md @@ -48,33 +48,33 @@ spec](https://github.com/tendermint/go-amino#computing-the-prefix-and-disambigua In what follows, we provide the type names and prefix bytes directly. Notice that when encoding byte-arrays, the length of the byte-array is appended -to the PrefixBytes. Thus the encoding of a byte array becomes ` - `. In other words, to encode any type listed below you do not need to be +to the PrefixBytes. Thus the encoding of a byte array becomes ` `. In other words, to encode any type listed below you do not need to be familiar with amino encoding. You can simply use below table and concatenate Prefix || Length (of raw bytes) || raw bytes ( while || stands for byte concatenation here). -| Type | Name | Prefix | Length | Notes | -| ---- | ---- | ------ | ----- | ------ | -| PubKeyEd25519 | tendermint/PubKeyEd25519 | 0x1624DE64 | 0x20 | | -| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | | -| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | | -| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | | -| SignatureEd25519 | tendermint/SignatureEd25519 | 0x2031EA53 | 0x40 | | +| Type | Name | Prefix | Length | Notes | +| ------------------ | ----------------------------- | ---------- | -------- | ----- | +| PubKeyEd25519 | tendermint/PubKeyEd25519 | 0x1624DE64 | 0x20 | | +| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | | +| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | | +| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | | +| SignatureEd25519 | tendermint/SignatureEd25519 | 0x2031EA53 | 0x40 | | | SignatureSecp256k1 | tendermint/SignatureSecp256k1 | 0x7FC4A495 | variable | + | ### Examples 1. For example, the 33-byte (or 0x21-byte in hex) Secp256k1 pubkey -`020BD40F225A57ED383B440CF073BC5539D0341F5767D2BF2D78406D00475A2EE9` -would be encoded as -`EB5AE98221020BD40F225A57ED383B440CF073BC5539D0341F5767D2BF2D78406D00475A2EE9` + `020BD40F225A57ED383B440CF073BC5539D0341F5767D2BF2D78406D00475A2EE9` + would be encoded as + `EB5AE98221020BD40F225A57ED383B440CF073BC5539D0341F5767D2BF2D78406D00475A2EE9` 2. For example, the variable size Secp256k1 signature (in this particular example 70 or 0x46 bytes) -`304402201CD4B8C764D2FD8AF23ECFE6666CA8A53886D47754D951295D2D311E1FEA33BF02201E0F906BB1CF2C30EAACFFB032A7129358AFF96B9F79B06ACFFB18AC90C2ADD7` -would be encoded as -`16E1FEEA46304402201CD4B8C764D2FD8AF23ECFE6666CA8A53886D47754D951295D2D311E1FEA33BF02201E0F906BB1CF2C30EAACFFB032A7129358AFF96B9F79B06ACFFB18AC90C2ADD7` + `304402201CD4B8C764D2FD8AF23ECFE6666CA8A53886D47754D951295D2D311E1FEA33BF02201E0F906BB1CF2C30EAACFFB032A7129358AFF96B9F79B06ACFFB18AC90C2ADD7` + would be encoded as + `16E1FEEA46304402201CD4B8C764D2FD8AF23ECFE6666CA8A53886D47754D951295D2D311E1FEA33BF02201E0F906BB1CF2C30EAACFFB032A7129358AFF96B9F79B06ACFFB18AC90C2ADD7` ### Addresses @@ -152,28 +152,27 @@ func MakeParts(obj interface{}, partSize int) []Part For an overview of Merkle trees, see [wikipedia](https://en.wikipedia.org/wiki/Merkle_tree) - A Simple Tree is a simple compact binary tree for a static list of items. Simple Merkle trees are used in numerous places in Tendermint to compute a cryptographic digest of a data structure. In a Simple Tree, the transactions and validation signatures of a block are hashed using this simple merkle tree logic. If the number of items is not a power of two, the tree will not be full and some leaf nodes will be at different levels. Simple Tree tries to keep both sides of the tree the same size, but the left side may be one -greater, for example: +greater, for example: ``` - Simple Tree with 6 items Simple Tree with 7 items - - * * - / \ / \ - / \ / \ - / \ / \ - / \ / \ - * * * * - / \ / \ / \ / \ - / \ / \ / \ / \ - / \ / \ / \ / \ + Simple Tree with 6 items Simple Tree with 7 items + + * * + / \ / \ + / \ / \ + / \ / \ + / \ / \ + * * * * + / \ / \ / \ / \ + / \ / \ / \ / \ + / \ / \ / \ / \ * h2 * h5 * * * h6 - / \ / \ / \ / \ / \ + / \ / \ / \ / \ / \ h0 h1 h3 h4 h0 h1 h2 h3 h4 h5 ``` @@ -224,7 +223,6 @@ For `[]struct` arguments, we compute a `[][]byte` by hashing the individual `str Proof that a leaf is in a Merkle tree consists of a simple structure: - ``` type SimpleProof struct { Aunts [][]byte @@ -265,8 +263,8 @@ func computeHashFromAunts(index, total int, leafHash []byte, innerHashes [][]byt The Simple Tree is used to merkelize a list of items, so to merkelize a (short) dictionary of key-value pairs, encode the dictionary as an -ordered list of ``KVPair`` structs. The block hash is such a hash -derived from all the fields of the block ``Header``. The state hash is +ordered list of `KVPair` structs. The block hash is such a hash +derived from all the fields of the block `Header`. The state hash is similarly derived. ### IAVL+ Tree @@ -300,7 +298,6 @@ For instance, an ED25519 PubKey would look like: Where the `"value"` is the base64 encoding of the raw pubkey bytes, and the `"type"` is the full disfix bytes for Ed25519 pubkeys. - ### Signed Messages Signed messages (eg. votes, proposals) in the consensus are encoded using Amino-JSON, rather than in the standard binary format. diff --git a/docs/spec/blockchain/state.md b/docs/spec/blockchain/state.md index df86cd45..726015ea 100644 --- a/docs/spec/blockchain/state.md +++ b/docs/spec/blockchain/state.md @@ -75,7 +75,6 @@ func TotalVotingPower(vals []Validators) int64{ } ``` - ### ConsensusParams TODO diff --git a/docs/spec/consensus/bft-time.md b/docs/spec/consensus/bft-time.md index a005e904..c53c8042 100644 --- a/docs/spec/consensus/bft-time.md +++ b/docs/spec/consensus/bft-time.md @@ -1,56 +1,53 @@ -# BFT time in Tendermint +# BFT time in Tendermint -Tendermint provides a deterministic, Byzantine fault-tolerant, source of time. -Time in Tendermint is defined with the Time field of the block header. +Tendermint provides a deterministic, Byzantine fault-tolerant, source of time. +Time in Tendermint is defined with the Time field of the block header. It satisfies the following properties: -- Time Monotonicity: Time is monotonically increasing, i.e., given -a header H1 for height h1 and a header H2 for height `h2 = h1 + 1`, `H1.Time < H2.Time`. -- Time Validity: Given a set of Commit votes that forms the `block.LastCommit` field, a range of -valid values for the Time field of the block header is defined only by -Precommit messages (from the LastCommit field) sent by correct processes, i.e., -a faulty process cannot arbitrarily increase the Time value. +- Time Monotonicity: Time is monotonically increasing, i.e., given + a header H1 for height h1 and a header H2 for height `h2 = h1 + 1`, `H1.Time < H2.Time`. +- Time Validity: Given a set of Commit votes that forms the `block.LastCommit` field, a range of + valid values for the Time field of the block header is defined only by + Precommit messages (from the LastCommit field) sent by correct processes, i.e., + a faulty process cannot arbitrarily increase the Time value. -In the context of Tendermint, time is of type int64 and denotes UNIX time in milliseconds, i.e., -corresponds to the number of milliseconds since January 1, 1970. Before defining rules that need to be enforced by the +In the context of Tendermint, time is of type int64 and denotes UNIX time in milliseconds, i.e., +corresponds to the number of milliseconds since January 1, 1970. Before defining rules that need to be enforced by the Tendermint consensus protocol, so the properties above holds, we introduce the following definition: - median of a set of `Vote` messages is equal to the median of `Vote.Time` fields of the corresponding `Vote` messages, -where the value of `Vote.Time` is counted number of times proportional to the process voting power. As in Tendermint -the voting power is not uniform (one process one vote), a vote message is actually an aggregator of the same votes whose -number is equal to the voting power of the process that has casted the corresponding votes message. + where the value of `Vote.Time` is counted number of times proportional to the process voting power. As in Tendermint + the voting power is not uniform (one process one vote), a vote message is actually an aggregator of the same votes whose + number is equal to the voting power of the process that has casted the corresponding votes message. Let's consider the following example: - - we have four processes p1, p2, p3 and p4, with the following voting power distribution (p1, 23), (p2, 27), (p3, 10) -and (p4, 10). The total voting power is 70 (`N = 3f+1`, where `N` is the total voting power, and `f` is the maximum voting -power of the faulty processes), so we assume that the faulty processes have at most 23 of voting power. -Furthermore, we have the following vote messages in some LastCommit field (we ignore all fields except Time field): - - (p1, 100), (p2, 98), (p3, 1000), (p4, 500). We assume that p3 and p4 are faulty processes. Let's assume that the - `block.LastCommit` message contains votes of processes p2, p3 and p4. Median is then chosen the following way: - the value 98 is counted 27 times, the value 1000 is counted 10 times and the value 500 is counted also 10 times. - So the median value will be the value 98. No matter what set of messages with at least `2f+1` voting power we - choose, the median value will always be between the values sent by correct processes. -We ensure Time Monotonicity and Time Validity properties by the following rules: - -- let rs denotes `RoundState` (consensus internal state) of some process. Then -`rs.ProposalBlock.Header.Time == median(rs.LastCommit) && -rs.Proposal.Timestamp == rs.ProposalBlock.Header.Time`. +- we have four processes p1, p2, p3 and p4, with the following voting power distribution (p1, 23), (p2, 27), (p3, 10) + and (p4, 10). The total voting power is 70 (`N = 3f+1`, where `N` is the total voting power, and `f` is the maximum voting + power of the faulty processes), so we assume that the faulty processes have at most 23 of voting power. + Furthermore, we have the following vote messages in some LastCommit field (we ignore all fields except Time field): - (p1, 100), (p2, 98), (p3, 1000), (p4, 500). We assume that p3 and p4 are faulty processes. Let's assume that the + `block.LastCommit` message contains votes of processes p2, p3 and p4. Median is then chosen the following way: + the value 98 is counted 27 times, the value 1000 is counted 10 times and the value 500 is counted also 10 times. + So the median value will be the value 98. No matter what set of messages with at least `2f+1` voting power we + choose, the median value will always be between the values sent by correct processes. -- Furthermore, when creating the `vote` message, the following rules for determining `vote.Time` field should hold: +We ensure Time Monotonicity and Time Validity properties by the following rules: - - if `rs.Proposal` is defined then - `vote.Time = max(rs.Proposal.Timestamp + 1, time.Now())`, where `time.Now()` - denotes local Unix time in milliseconds. - - - if `rs.Proposal` is not defined and `rs.Votes` contains +2/3 of the corresponding vote messages (votes for the - current height and round, and with the corresponding type (`Prevote` or `Precommit`)), then - - `vote.Time = max(median(getVotes(rs.Votes, vote.Height, vote.Round, vote.Type)), time.Now())`, - - where `getVotes` function returns the votes for particular `Height`, `Round` and `Type`. - The second rule is relevant for the case when a process jumps to a higher round upon receiving +2/3 votes for a higher - round, but the corresponding `Proposal` message for the higher round hasn't been received yet. +- let rs denotes `RoundState` (consensus internal state) of some process. Then + `rs.ProposalBlock.Header.Time == median(rs.LastCommit) && rs.Proposal.Timestamp == rs.ProposalBlock.Header.Time`. +- Furthermore, when creating the `vote` message, the following rules for determining `vote.Time` field should hold: + - if `rs.Proposal` is defined then + `vote.Time = max(rs.Proposal.Timestamp + 1, time.Now())`, where `time.Now()` + denotes local Unix time in milliseconds. + + - if `rs.Proposal` is not defined and `rs.Votes` contains +2/3 of the corresponding vote messages (votes for the + current height and round, and with the corresponding type (`Prevote` or `Precommit`)), then + + `vote.Time = max(median(getVotes(rs.Votes, vote.Height, vote.Round, vote.Type)), time.Now())`, + + where `getVotes` function returns the votes for particular `Height`, `Round` and `Type`. + The second rule is relevant for the case when a process jumps to a higher round upon receiving +2/3 votes for a higher + round, but the corresponding `Proposal` message for the higher round hasn't been received yet. diff --git a/docs/spec/consensus/consensus.md b/docs/spec/consensus/consensus.md index d6804779..842c73a6 100644 --- a/docs/spec/consensus/consensus.md +++ b/docs/spec/consensus/consensus.md @@ -2,31 +2,31 @@ ## Terms -- The network is composed of optionally connected *nodes*. Nodes - directly connected to a particular node are called *peers*. -- The consensus process in deciding the next block (at some *height* - `H`) is composed of one or many *rounds*. -- `NewHeight`, `Propose`, `Prevote`, `Precommit`, and `Commit` - represent state machine states of a round. (aka `RoundStep` or - just "step"). -- A node is said to be *at* a given height, round, and step, or at - `(H,R,S)`, or at `(H,R)` in short to omit the step. -- To *prevote* or *precommit* something means to broadcast a [prevote - vote](https://godoc.org/github.com/tendermint/tendermint/types#Vote) - or [first precommit - vote](https://godoc.org/github.com/tendermint/tendermint/types#FirstPrecommit) - for something. -- A vote *at* `(H,R)` is a vote signed with the bytes for `H` and `R` - included in its [sign-bytes](block-structure.html#vote-sign-bytes). -- *+2/3* is short for "more than 2/3" -- *1/3+* is short for "1/3 or more" -- A set of +2/3 of prevotes for a particular block or `` at - `(H,R)` is called a *proof-of-lock-change* or *PoLC* for short. +- The network is composed of optionally connected _nodes_. Nodes + directly connected to a particular node are called _peers_. +- The consensus process in deciding the next block (at some _height_ + `H`) is composed of one or many _rounds_. +- `NewHeight`, `Propose`, `Prevote`, `Precommit`, and `Commit` + represent state machine states of a round. (aka `RoundStep` or + just "step"). +- A node is said to be _at_ a given height, round, and step, or at + `(H,R,S)`, or at `(H,R)` in short to omit the step. +- To _prevote_ or _precommit_ something means to broadcast a [prevote + vote](https://godoc.org/github.com/tendermint/tendermint/types#Vote) + or [first precommit + vote](https://godoc.org/github.com/tendermint/tendermint/types#FirstPrecommit) + for something. +- A vote _at_ `(H,R)` is a vote signed with the bytes for `H` and `R` + included in its [sign-bytes](block-structure.html#vote-sign-bytes). +- _+2/3_ is short for "more than 2/3" +- _1/3+_ is short for "1/3 or more" +- A set of +2/3 of prevotes for a particular block or `` at + `(H,R)` is called a _proof-of-lock-change_ or _PoLC_ for short. ## State Machine Overview At each height of the blockchain a round-based protocol is run to -determine the next block. Each round is composed of three *steps* +determine the next block. Each round is composed of three _steps_ (`Propose`, `Prevote`, and `Precommit`), along with two special steps `Commit` and `NewHeight`. @@ -36,22 +36,22 @@ In the optimal scenario, the order of steps is: NewHeight -> (Propose -> Prevote -> Precommit)+ -> Commit -> NewHeight ->... ``` -The sequence `(Propose -> Prevote -> Precommit)` is called a *round*. +The sequence `(Propose -> Prevote -> Precommit)` is called a _round_. There may be more than one round required to commit a block at a given height. Examples for why more rounds may be required include: -- The designated proposer was not online. -- The block proposed by the designated proposer was not valid. -- The block proposed by the designated proposer did not propagate - in time. -- The block proposed was valid, but +2/3 of prevotes for the proposed - block were not received in time for enough validator nodes by the - time they reached the `Precommit` step. Even though +2/3 of prevotes - are necessary to progress to the next step, at least one validator - may have voted `` or maliciously voted for something else. -- The block proposed was valid, and +2/3 of prevotes were received for - enough nodes, but +2/3 of precommits for the proposed block were not - received for enough validator nodes. +- The designated proposer was not online. +- The block proposed by the designated proposer was not valid. +- The block proposed by the designated proposer did not propagate + in time. +- The block proposed was valid, but +2/3 of prevotes for the proposed + block were not received in time for enough validator nodes by the + time they reached the `Precommit` step. Even though +2/3 of prevotes + are necessary to progress to the next step, at least one validator + may have voted `` or maliciously voted for something else. +- The block proposed was valid, and +2/3 of prevotes were received for + enough nodes, but +2/3 of precommits for the proposed block were not + received for enough validator nodes. Some of these problems are resolved by moving onto the next round & proposer. Others are resolved by increasing certain round timeout @@ -80,14 +80,13 @@ parameters over each successive round. +--------------------------------------------------------------------+ ``` -Background Gossip -================= +# Background Gossip A node may not have a corresponding validator private key, but it nevertheless plays an active role in the consensus process by relaying relevant meta-data, proposals, blocks, and votes to its peers. A node that has the private keys of an active validator and is engaged in -signing votes is called a *validator-node*. All nodes (not just +signing votes is called a _validator-node_. All nodes (not just validator-nodes) have an associated state (the current height, round, and step) and work to make progress. @@ -97,21 +96,21 @@ epidemic gossip protocol is implemented among some of these channels to bring peers up to speed on the most recent state of consensus. For example, -- Nodes gossip `PartSet` parts of the current round's proposer's - proposed block. A LibSwift inspired algorithm is used to quickly - broadcast blocks across the gossip network. -- Nodes gossip prevote/precommit votes. A node `NODE_A` that is ahead - of `NODE_B` can send `NODE_B` prevotes or precommits for `NODE_B`'s - current (or future) round to enable it to progress forward. -- Nodes gossip prevotes for the proposed PoLC (proof-of-lock-change) - round if one is proposed. -- Nodes gossip to nodes lagging in blockchain height with block - [commits](https://godoc.org/github.com/tendermint/tendermint/types#Commit) - for older blocks. -- Nodes opportunistically gossip `HasVote` messages to hint peers what - votes it already has. -- Nodes broadcast their current state to all neighboring peers. (but - is not gossiped further) +- Nodes gossip `PartSet` parts of the current round's proposer's + proposed block. A LibSwift inspired algorithm is used to quickly + broadcast blocks across the gossip network. +- Nodes gossip prevote/precommit votes. A node `NODE_A` that is ahead + of `NODE_B` can send `NODE_B` prevotes or precommits for `NODE_B`'s + current (or future) round to enable it to progress forward. +- Nodes gossip prevotes for the proposed PoLC (proof-of-lock-change) + round if one is proposed. +- Nodes gossip to nodes lagging in blockchain height with block + [commits](https://godoc.org/github.com/tendermint/tendermint/types#Commit) + for older blocks. +- Nodes opportunistically gossip `HasVote` messages to hint peers what + votes it already has. +- Nodes broadcast their current state to all neighboring peers. (but + is not gossiped further) There's more, but let's not get ahead of ourselves here. @@ -144,14 +143,14 @@ and all prevotes at `PoLC-Round`. --> goto `Prevote(H,R)` - After Upon entering `Prevote`, each validator broadcasts its prevote vote. -- First, if the validator is locked on a block since `LastLockRound` - but now has a PoLC for something else at round `PoLC-Round` where - `LastLockRound < PoLC-Round < R`, then it unlocks. -- If the validator is still locked on a block, it prevotes that. -- Else, if the proposed block from `Propose(H,R)` is good, it - prevotes that. -- Else, if the proposal is invalid or wasn't received on time, it - prevotes ``. +- First, if the validator is locked on a block since `LastLockRound` + but now has a PoLC for something else at round `PoLC-Round` where + `LastLockRound < PoLC-Round < R`, then it unlocks. +- If the validator is still locked on a block, it prevotes that. +- Else, if the proposed block from `Propose(H,R)` is good, it + prevotes that. +- Else, if the proposal is invalid or wasn't received on time, it + prevotes ``. The `Prevote` step ends: - After +2/3 prevotes for a particular block or ``. -->; goto `Precommit(H,R)` - After `timeoutPrevote` after @@ -161,11 +160,12 @@ receiving any +2/3 prevotes. --> goto `Precommit(H,R)` - After ### Precommit Step (height:H,round:R) Upon entering `Precommit`, each validator broadcasts its precommit vote. + - If the validator has a PoLC at `(H,R)` for a particular block `B`, it -(re)locks (or changes lock to) and precommits `B` and sets -`LastLockRound = R`. - Else, if the validator has a PoLC at `(H,R)` for -``, it unlocks and precommits ``. - Else, it keeps the lock -unchanged and precommits ``. + (re)locks (or changes lock to) and precommits `B` and sets + `LastLockRound = R`. - Else, if the validator has a PoLC at `(H,R)` for + ``, it unlocks and precommits ``. - Else, it keeps the lock + unchanged and precommits ``. A precommit for `` means "I didn’t see a PoLC for this round, but I did get +2/3 prevotes and waited a bit". @@ -177,24 +177,24 @@ conditions](#common-exit-conditions) ### Common exit conditions -- After +2/3 precommits for a particular block. --> goto - `Commit(H)` -- After any +2/3 prevotes received at `(H,R+x)`. --> goto - `Prevote(H,R+x)` -- After any +2/3 precommits received at `(H,R+x)`. --> goto - `Precommit(H,R+x)` +- After +2/3 precommits for a particular block. --> goto + `Commit(H)` +- After any +2/3 prevotes received at `(H,R+x)`. --> goto + `Prevote(H,R+x)` +- After any +2/3 precommits received at `(H,R+x)`. --> goto + `Precommit(H,R+x)` ### Commit Step (height:H) -- Set `CommitTime = now()` -- Wait until block is received. --> goto `NewHeight(H+1)` +- Set `CommitTime = now()` +- Wait until block is received. --> goto `NewHeight(H+1)` ### NewHeight Step (height:H) -- Move `Precommits` to `LastCommit` and increment height. -- Set `StartTime = CommitTime+timeoutCommit` -- Wait until `StartTime` to receive straggler commits. --> goto - `Propose(H,0)` +- Move `Precommits` to `LastCommit` and increment height. +- Set `StartTime = CommitTime+timeoutCommit` +- Wait until `StartTime` to receive straggler commits. --> goto + `Propose(H,0)` ## Proofs @@ -236,20 +236,20 @@ Further, define the JSet at height `H` of a set of validators `VSet` to be the union of the JSets for each validator in `VSet`. For a given commit by honest validators at round `R` for block `B` we can construct a JSet to justify the commit for `B` at `R`. We say that a JSet -*justifies* a commit at `(H,R)` if all the committers (validators in the +_justifies_ a commit at `(H,R)` if all the committers (validators in the commit-set) are each justified in the JSet with no duplicitous vote signatures (by the committers). -- **Lemma**: When a fork is detected by the existence of two - conflicting [commits](./validators.html#commiting-a-block), the - union of the JSets for both commits (if they can be compiled) must - include double-signing by at least 1/3+ of the validator set. - **Proof**: The commit cannot be at the same round, because that - would immediately imply double-signing by 1/3+. Take the union of - the JSets of both commits. If there is no double-signing by at least - 1/3+ of the validator set in the union, then no honest validator - could have precommitted any different block after the first commit. - Yet, +2/3 did. Reductio ad absurdum. +- **Lemma**: When a fork is detected by the existence of two + conflicting [commits](./validators.html#commiting-a-block), the + union of the JSets for both commits (if they can be compiled) must + include double-signing by at least 1/3+ of the validator set. + **Proof**: The commit cannot be at the same round, because that + would immediately imply double-signing by 1/3+. Take the union of + the JSets of both commits. If there is no double-signing by at least + 1/3+ of the validator set in the union, then no honest validator + could have precommitted any different block after the first commit. + Yet, +2/3 did. Reductio ad absurdum. As a corollary, when there is a fork, an external process can determine the blame by requiring each validator to justify all of its round votes. diff --git a/docs/spec/consensus/light-client.md b/docs/spec/consensus/light-client.md index 0ed9d36d..1b608627 100644 --- a/docs/spec/consensus/light-client.md +++ b/docs/spec/consensus/light-client.md @@ -1,14 +1,14 @@ # Light client -A light client is a process that connects to the Tendermint Full Node(s) and then tries to verify the Merkle proofs -about the blockchain application. In this document we describe mechanisms that ensures that the Tendermint light client -has the same level of security as Full Node processes (without being itself a Full Node). +A light client is a process that connects to the Tendermint Full Node(s) and then tries to verify the Merkle proofs +about the blockchain application. In this document we describe mechanisms that ensures that the Tendermint light client +has the same level of security as Full Node processes (without being itself a Full Node). -To be able to validate a Merkle proof, a light client needs to validate the blockchain header that contains the root app hash. -Validating a blockchain header in Tendermint consists in verifying that the header is committed (signed) by >2/3 of the -voting power of the corresponding validator set. As the validator set is a dynamic set (it is changing), one of the -core functionality of the light client is updating the current validator set, that is then used to verify the -blockchain header, and further the corresponding Merkle proofs. +To be able to validate a Merkle proof, a light client needs to validate the blockchain header that contains the root app hash. +Validating a blockchain header in Tendermint consists in verifying that the header is committed (signed) by >2/3 of the +voting power of the corresponding validator set. As the validator set is a dynamic set (it is changing), one of the +core functionality of the light client is updating the current validator set, that is then used to verify the +blockchain header, and further the corresponding Merkle proofs. For the purpose of this light client specification, we assume that the Tendermint Full Node exposes the following functions over Tendermint RPC: @@ -19,51 +19,50 @@ Validators(height int64) (ResultValidators, error) // returns validator set for LastHeader(valSetNumber int64) (SignedHeader, error) // returns last header signed by the validator set with the given validator set number type SignedHeader struct { - Header Header + Header Header Commit Commit - ValSetNumber int64 + ValSetNumber int64 } type ResultValidators struct { - BlockHeight int64 - Validators []Validator - // time the current validator set is initialised, i.e, time of the last validator change before header BlockHeight - ValSetTime int64 + BlockHeight int64 + Validators []Validator + // time the current validator set is initialised, i.e, time of the last validator change before header BlockHeight + ValSetTime int64 } ``` -We assume that Tendermint keeps track of the validator set changes and that each time a validator set is changed it is -being assigned the next sequence number. We can call this number the validator set sequence number. Tendermint also remembers +We assume that Tendermint keeps track of the validator set changes and that each time a validator set is changed it is +being assigned the next sequence number. We can call this number the validator set sequence number. Tendermint also remembers the Time from the header when the next validator set is initialised (starts to be in power), and we refer to this time as validator set init time. Furthermore, we assume that each validator set change is signed (committed) by the current validator set. More precisely, -given a block `H` that contains transactions that are modifying the current validator set, the Merkle root hash of the next -validator set (modified based on transactions from block H) will be in block `H+1` (and signed by the current validator -set), and then starting from the block `H+2`, it will be signed by the next validator set. - -Note that the real Tendermint RPC API is slightly different (for example, response messages contain more data and function -names are slightly different); we shortened (and modified) it for the purpose of this document to make the spec more -clear and simple. Furthermore, note that in case of the third function, the returned header has `ValSetNumber` equals to -`valSetNumber+1`. +given a block `H` that contains transactions that are modifying the current validator set, the Merkle root hash of the next +validator set (modified based on transactions from block H) will be in block `H+1` (and signed by the current validator +set), and then starting from the block `H+2`, it will be signed by the next validator set. +Note that the real Tendermint RPC API is slightly different (for example, response messages contain more data and function +names are slightly different); we shortened (and modified) it for the purpose of this document to make the spec more +clear and simple. Furthermore, note that in case of the third function, the returned header has `ValSetNumber` equals to +`valSetNumber+1`. Locally, light client manages the following state: ```golang -valSet []Validator // current validator set (last known and verified validator set) -valSetNumber int64 // sequence number of the current validator set +valSet []Validator // current validator set (last known and verified validator set) +valSetNumber int64 // sequence number of the current validator set valSetHash []byte // hash of the current validator set -valSetTime int64 // time when the current validator set is initialised +valSetTime int64 // time when the current validator set is initialised ``` The light client is initialised with the trusted validator set, for example based on the known validator set hash, validator set sequence number and the validator set init time. The core of the light client logic is captured by the VerifyAndUpdate function that is used to 1) verify if the given header is valid, -and 2) update the validator set (when the given header is valid and it is more recent than the seen headers). +and 2) update the validator set (when the given header is valid and it is more recent than the seen headers). ```golang VerifyAndUpdate(signedHeader SignedHeader): - assertThat signedHeader.valSetNumber >= valSetNumber + assertThat signedHeader.valSetNumber >= valSetNumber if isValid(signedHeader) and signedHeader.Header.Time <= valSetTime + UNBONDING_PERIOD then setValidatorSet(signedHeader) return true @@ -76,7 +75,7 @@ isValid(signedHeader SignedHeader): assertThat Hash(valSetOfTheHeader) == signedHeader.Header.ValSetHash assertThat signedHeader is passing basic validation if votingPower(signedHeader.Commit) > 2/3 * votingPower(valSetOfTheHeader) then return true - else + else return false setValidatorSet(signedHeader SignedHeader): @@ -85,7 +84,7 @@ setValidatorSet(signedHeader SignedHeader): valSet = nextValSet.Validators valSetHash = signedHeader.Header.ValidatorsHash valSetNumber = signedHeader.ValSetNumber - valSetTime = nextValSet.ValSetTime + valSetTime = nextValSet.ValSetTime votingPower(commit Commit): votingPower = 0 @@ -96,9 +95,9 @@ votingPower(commit Commit): votingPower(validatorSet []Validator): for each validator in validatorSet do: - votingPower += validator.VotingPower + votingPower += validator.VotingPower return votingPower - + updateValidatorSet(valSetNumberOfTheHeader): while valSetNumber != valSetNumberOfTheHeader do signedHeader = LastHeader(valSetNumber) @@ -110,5 +109,5 @@ updateValidatorSet(valSetNumberOfTheHeader): Note that in the logic above we assume that the light client will always go upward with respect to header verifications, i.e., that it will always be used to verify more recent headers. In case a light client needs to be used to verify older -headers (go backward) the same mechanisms and similar logic can be used. In case a call to the FullNode or subsequent -checks fail, a light client need to implement some recovery strategy, for example connecting to other FullNode. +headers (go backward) the same mechanisms and similar logic can be used. In case a call to the FullNode or subsequent +checks fail, a light client need to implement some recovery strategy, for example connecting to other FullNode. diff --git a/docs/spec/p2p/connection.md b/docs/spec/p2p/connection.md index f6322fe8..47366a54 100644 --- a/docs/spec/p2p/connection.md +++ b/docs/spec/p2p/connection.md @@ -4,10 +4,10 @@ `MConnection` is a multiplex connection that supports multiple independent streams with distinct quality of service guarantees atop a single TCP connection. -Each stream is known as a `Channel` and each `Channel` has a globally unique *byte id*. +Each stream is known as a `Channel` and each `Channel` has a globally unique _byte id_. Each `Channel` also has a relative priority that determines the quality of service of the `Channel` compared to other `Channel`s. -The *byte id* and the relative priorities of each `Channel` are configured upon +The _byte id_ and the relative priorities of each `Channel` are configured upon initialization of the connection. The `MConnection` supports three packet types: @@ -53,13 +53,14 @@ Messages are chosen for a batch one at a time from the channel with the lowest r ## Sending Messages There are two methods for sending messages: + ```go func (m MConnection) Send(chID byte, msg interface{}) bool {} func (m MConnection) TrySend(chID byte, msg interface{}) bool {} ``` `Send(chID, msg)` is a blocking call that waits until `msg` is successfully queued -for the channel with the given id byte `chID`. The message `msg` is serialized +for the channel with the given id byte `chID`. The message `msg` is serialized using the `tendermint/wire` submodule's `WriteBinary()` reflection routine. `TrySend(chID, msg)` is a nonblocking call that queues the message msg in the channel @@ -76,8 +77,8 @@ and other higher level thread-safe data used by the reactors. ## Switch/Reactor The `Switch` handles peer connections and exposes an API to receive incoming messages -on `Reactors`. Each `Reactor` is responsible for handling incoming messages of one -or more `Channels`. So while sending outgoing messages is typically performed on the peer, +on `Reactors`. Each `Reactor` is responsible for handling incoming messages of one +or more `Channels`. So while sending outgoing messages is typically performed on the peer, incoming messages are received on the reactor. ```go diff --git a/docs/spec/p2p/node.md b/docs/spec/p2p/node.md index 366b27dd..2771356a 100644 --- a/docs/spec/p2p/node.md +++ b/docs/spec/p2p/node.md @@ -17,8 +17,9 @@ See [the peer-exchange docs](https://github.com/tendermint/tendermint/blob/maste ## New Full Node A new node needs a few things to connect to the network: + - a list of seeds, which can be provided to Tendermint via config file or flags, -or hardcoded into the software by in-process apps + or hardcoded into the software by in-process apps - a `ChainID`, also called `Network` at the p2p layer - a recent block height, H, and hash, HASH for the blockchain. diff --git a/docs/spec/p2p/peer.md b/docs/spec/p2p/peer.md index dadb4a3a..f9d2d8bc 100644 --- a/docs/spec/p2p/peer.md +++ b/docs/spec/p2p/peer.md @@ -29,26 +29,26 @@ Both handshakes have configurable timeouts (they should complete quickly). Tendermint implements the Station-to-Station protocol using X25519 keys for Diffie-Helman key-exchange and chacha20poly1305 for encryption. It goes as follows: + - generate an ephemeral X25519 keypair - send the ephemeral public key to the peer - wait to receive the peer's ephemeral public key - compute the Diffie-Hellman shared secret using the peers ephemeral public key and our ephemeral private key - generate two keys to use for encryption (sending and receiving) and a challenge for authentication as follows: - - create a hkdf-sha256 instance with the key being the diffie hellman shared secret, and info parameter as - `TENDERMINT_SECRET_CONNECTION_KEY_AND_CHALLENGE_GEN` - - get 96 bytes of output from hkdf-sha256 - - if we had the smaller ephemeral pubkey, use the first 32 bytes for the key for receiving, the second 32 bytes for sending; else the opposite - - use the last 32 bytes of output for the challenge + - create a hkdf-sha256 instance with the key being the diffie hellman shared secret, and info parameter as + `TENDERMINT_SECRET_CONNECTION_KEY_AND_CHALLENGE_GEN` + - get 96 bytes of output from hkdf-sha256 + - if we had the smaller ephemeral pubkey, use the first 32 bytes for the key for receiving, the second 32 bytes for sending; else the opposite + - use the last 32 bytes of output for the challenge - use a seperate nonce for receiving and sending. Both nonces start at 0, and should support the full 96 bit nonce range - all communications from now on are encrypted in 1024 byte frames, -using the respective secret and nonce. Each nonce is incremented by one after each use. + using the respective secret and nonce. Each nonce is incremented by one after each use. - we now have an encrypted channel, but still need to authenticate - sign the common challenge obtained from the hkdf with our persistent private key - send the amino encoded persistent pubkey and signature to the peer - wait to receive the persistent public key and signature from the peer - verify the signature on the challenge using the peer's persistent public key - If this is an outgoing connection (we dialed the peer) and we used a peer ID, then finally verify that the peer's persistent public key corresponds to the peer ID we dialed, ie. `peer.PubKey.Address() == `. @@ -69,7 +69,6 @@ an optional whitelist which can be managed through the ABCI app - if the whitelist is enabled and the peer does not qualify, the connection is terminated. - ### Tendermint Version Handshake The Tendermint Version Handshake allows the peers to exchange their NodeInfo: @@ -89,6 +88,7 @@ type NodeInfo struct { ``` The connection is disconnected if: + - `peer.NodeInfo.ID` is not equal `peerConn.ID` - `peer.NodeInfo.Version` is not formatted as `X.X.X` where X are integers known as Major, Minor, and Revision - `peer.NodeInfo.Version` Major is not the same as ours @@ -97,7 +97,6 @@ The connection is disconnected if: - `peer.NodeInfo.ListenAddr` is malformed or is a DNS host that cannot be resolved - At this point, if we have not disconnected, the peer is valid. It is added to the switch and hence all reactors via the `AddPeer` method. Note that each reactor may handle multiple channels. diff --git a/docs/spec/reactors/block_sync/impl.md b/docs/spec/reactors/block_sync/impl.md index a96f83b3..ff067b84 100644 --- a/docs/spec/reactors/block_sync/impl.md +++ b/docs/spec/reactors/block_sync/impl.md @@ -1,46 +1,46 @@ ## Blockchain Reactor -* coordinates the pool for syncing -* coordinates the store for persistence -* coordinates the playing of blocks towards the app using a sm.BlockExecutor -* handles switching between fastsync and consensus -* it is a p2p.BaseReactor -* starts the pool.Start() and its poolRoutine() -* registers all the concrete types and interfaces for serialisation +- coordinates the pool for syncing +- coordinates the store for persistence +- coordinates the playing of blocks towards the app using a sm.BlockExecutor +- handles switching between fastsync and consensus +- it is a p2p.BaseReactor +- starts the pool.Start() and its poolRoutine() +- registers all the concrete types and interfaces for serialisation ### poolRoutine -* listens to these channels: - * pool requests blocks from a specific peer by posting to requestsCh, block reactor then sends +- listens to these channels: + - pool requests blocks from a specific peer by posting to requestsCh, block reactor then sends a &bcBlockRequestMessage for a specific height - * pool signals timeout of a specific peer by posting to timeoutsCh - * switchToConsensusTicker to periodically try and switch to consensus - * trySyncTicker to periodically check if we have fallen behind and then catch-up sync - * if there aren't any new blocks available on the pool it skips syncing -* tries to sync the app by taking downloaded blocks from the pool, gives them to the app and stores + - pool signals timeout of a specific peer by posting to timeoutsCh + - switchToConsensusTicker to periodically try and switch to consensus + - trySyncTicker to periodically check if we have fallen behind and then catch-up sync + - if there aren't any new blocks available on the pool it skips syncing +- tries to sync the app by taking downloaded blocks from the pool, gives them to the app and stores them on disk -* implements Receive which is called by the switch/peer - * calls AddBlock on the pool when it receives a new block from a peer +- implements Receive which is called by the switch/peer + - calls AddBlock on the pool when it receives a new block from a peer ## Block Pool -* responsible for downloading blocks from peers -* makeRequestersRoutine() - * removes timeout peers - * starts new requesters by calling makeNextRequester() -* requestRoutine(): - * picks a peer and sends the request, then blocks until: - * pool is stopped by listening to pool.Quit - * requester is stopped by listening to Quit - * request is redone - * we receive a block - * gotBlockCh is strange +- responsible for downloading blocks from peers +- makeRequestersRoutine() + - removes timeout peers + - starts new requesters by calling makeNextRequester() +- requestRoutine(): + - picks a peer and sends the request, then blocks until: + - pool is stopped by listening to pool.Quit + - requester is stopped by listening to Quit + - request is redone + - we receive a block + - gotBlockCh is strange ## Block Store -* persists blocks to disk +- persists blocks to disk # TODO -* How does the switch from bcR to conR happen? Does conR persist blocks to disk too? -* What is the interaction between the consensus and blockchain reactors? +- How does the switch from bcR to conR happen? Does conR persist blocks to disk too? +- What is the interaction between the consensus and blockchain reactors? diff --git a/docs/spec/reactors/block_sync/reactor.md b/docs/spec/reactors/block_sync/reactor.md index 97104eee..045bbd40 100644 --- a/docs/spec/reactors/block_sync/reactor.md +++ b/docs/spec/reactors/block_sync/reactor.md @@ -46,11 +46,11 @@ type bcStatusResponseMessage struct { ## Architecture and algorithm -The Blockchain reactor is organised as a set of concurrent tasks: - - Receive routine of Blockchain Reactor - - Task for creating Requesters - - Set of Requesters tasks and - - Controller task. +The Blockchain reactor is organised as a set of concurrent tasks: + +- Receive routine of Blockchain Reactor +- Task for creating Requesters +- Set of Requesters tasks and - Controller task. ![Blockchain Reactor Architecture Diagram](img/bc-reactor.png) @@ -58,41 +58,39 @@ The Blockchain reactor is organised as a set of concurrent tasks: These are the core data structures necessarily to provide the Blockchain Reactor logic. -Requester data structure is used to track assignment of request for `block` at position `height` to a -peer with id equals to `peerID`. +Requester data structure is used to track assignment of request for `block` at position `height` to a peer with id equals to `peerID`. ```go type Requester { - mtx Mutex + mtx Mutex block Block - height int64 - 
 peerID p2p.ID + height int64 + 
peerID p2p.ID redoChannel chan struct{} } ``` -Pool is core data structure that stores last executed block (`height`), assignment of requests to peers (`requesters`), -current height for each peer and number of pending requests for each peer (`peers`), maximum peer height, etc. + +Pool is core data structure that stores last executed block (`height`), assignment of requests to peers (`requesters`), current height for each peer and number of pending requests for each peer (`peers`), maximum peer height, etc. ```go type Pool { - mtx Mutex + mtx Mutex requesters map[int64]*Requester - 
height int64 + height int64 peers map[p2p.ID]*Peer - 
maxPeerHeight int64 

 - 
numPending int32 + maxPeerHeight int64 + numPending int32 store BlockStore - 
requestsChannel chan<- BlockRequest - 
errorsChannel chan<- peerError + requestsChannel chan<- BlockRequest + errorsChannel chan<- peerError } ``` -Peer data structure stores for each peer current `height` and number of pending requests sent to -the peer (`numPending`), etc. +Peer data structure stores for each peer current `height` and number of pending requests sent to the peer (`numPending`), etc. ```go type Peer struct { - id p2p.ID + id p2p.ID height int64 numPending int32 timeout *time.Timer @@ -100,202 +98,202 @@ type Peer struct { } ``` -BlockRequest is internal data structure used to denote current mapping of request for a block at some `height` to -a peer (`PeerID`). - +BlockRequest is internal data structure used to denote current mapping of request for a block at some `height` to a peer (`PeerID`). + ```go type BlockRequest { Height int64 - PeerID p2p.ID + PeerID p2p.ID } ``` ### Receive routine of Blockchain Reactor -It is executed upon message reception on the BlockchainChannel inside p2p receive routine. There is a separate p2p -receive routine (and therefore receive routine of the Blockchain Reactor) executed for each peer. Note that -try to send will not block (returns immediately) if outgoing buffer is full. +It is executed upon message reception on the BlockchainChannel inside p2p receive routine. There is a separate p2p receive routine (and therefore receive routine of the Blockchain Reactor) executed for each peer. Note that try to send will not block (returns immediately) if outgoing buffer is full. ```go handleMsg(pool, m): upon receiving bcBlockRequestMessage m from peer p: - block = load block for height m.Height from pool.store - if block != nil then - try to send BlockResponseMessage(block) to p - else - try to send bcNoBlockResponseMessage(m.Height) to p + block = load block for height m.Height from pool.store + if block != nil then + try to send BlockResponseMessage(block) to p + else + try to send bcNoBlockResponseMessage(m.Height) to p - upon receiving bcBlockResponseMessage m from peer p: - pool.mtx.Lock() - requester = pool.requesters[m.Height] - if requester == nil then - error("peer sent us a block we didn't expect") - continue + upon receiving bcBlockResponseMessage m from peer p: + pool.mtx.Lock() + requester = pool.requesters[m.Height] + if requester == nil then + error("peer sent us a block we didn't expect") + continue - if requester.block == nil and requester.peerID == p then + if requester.block == nil and requester.peerID == p then requester.block = m - pool.numPending -= 1 // atomic decrement - peer = pool.peers[p] - if peer != nil then - peer.numPending-- - if peer.numPending == 0 then - peer.timeout.Stop() - // NOTE: we don't send Quit signal to the corresponding requester task! - else - trigger peer timeout to expire after peerTimeout - pool.mtx.Unlock() - - + pool.numPending -= 1 // atomic decrement + peer = pool.peers[p] + if peer != nil then + peer.numPending-- + if peer.numPending == 0 then + peer.timeout.Stop() + // NOTE: we don't send Quit signal to the corresponding requester task! + else + trigger peer timeout to expire after peerTimeout + pool.mtx.Unlock() + + upon receiving bcStatusRequestMessage m from peer p: - try to send bcStatusResponseMessage(pool.store.Height) + try to send bcStatusResponseMessage(pool.store.Height) upon receiving bcStatusResponseMessage m from peer p: - pool.mtx.Lock() - peer = pool.peers[p] - if peer != nil then - peer.height = m.height - else - peer = create new Peer data structure with id = p and height = m.Height - pool.peers[p] = peer + pool.mtx.Lock() + peer = pool.peers[p] + if peer != nil then + peer.height = m.height + else + peer = create new Peer data structure with id = p and height = m.Height + pool.peers[p] = peer + + if m.Height > pool.maxPeerHeight then + pool.maxPeerHeight = m.Height + pool.mtx.Unlock() - if m.Height > pool.maxPeerHeight then - pool.maxPeerHeight = m.Height - pool.mtx.Unlock() - onTimeout(p): - send error message to pool error channel - peer = pool.peers[p] - peer.didTimeout = true + send error message to pool error channel + peer = pool.peers[p] + peer.didTimeout = true ``` ### Requester tasks -Requester task is responsible for fetching a single block at position `height`. +Requester task is responsible for fetching a single block at position `height`. ```go fetchBlock(height, pool): - while true do - peerID = nil + while true do + peerID = nil block = nil - peer = pickAvailablePeer(height) - peerId = peer.id + peer = pickAvailablePeer(height) + peerId = peer.id enqueue BlockRequest(height, peerID) to pool.requestsChannel - redo = false - while !redo do - select { + redo = false + while !redo do + select { upon receiving Quit message do - return - upon receiving message on redoChannel do - mtx.Lock() + return + upon receiving message on redoChannel do + mtx.Lock() pool.numPending++ - redo = true - mtx.UnLock() - } + redo = true + mtx.UnLock() + } pickAvailablePeer(height): - selectedPeer = nil - while selectedPeer = nil do - pool.mtx.Lock() - for each peer in pool.peers do - if !peer.didTimeout and peer.numPending < maxPendingRequestsPerPeer and peer.height >= height then - peer.numPending++ - selectedPeer = peer - break - pool.mtx.Unlock() - - if selectedPeer = nil then - sleep requestIntervalMS + selectedPeer = nil + while selectedPeer = nil do + pool.mtx.Lock() + for each peer in pool.peers do + if !peer.didTimeout and peer.numPending < maxPendingRequestsPerPeer and peer.height >= height then + peer.numPending++ + selectedPeer = peer + break + pool.mtx.Unlock() - return selectedPeer + if selectedPeer = nil then + sleep requestIntervalMS + + return selectedPeer ``` + sleep for requestIntervalMS + ### Task for creating Requesters This task is responsible for continuously creating and starting Requester tasks. + ```go createRequesters(pool): - while true do - if !pool.isRunning then break - if pool.numPending < maxPendingRequests or size(pool.requesters) < maxTotalRequesters then + while true do + if !pool.isRunning then break + if pool.numPending < maxPendingRequests or size(pool.requesters) < maxTotalRequesters then pool.mtx.Lock() nextHeight = pool.height + size(pool.requesters) - requester = create new requester for height nextHeight - pool.requesters[nextHeight] = requester - pool.numPending += 1 // atomic increment - start requester task - pool.mtx.Unlock() - else + requester = create new requester for height nextHeight + pool.requesters[nextHeight] = requester + pool.numPending += 1 // atomic increment + start requester task + pool.mtx.Unlock() + else sleep requestIntervalMS - pool.mtx.Lock() - for each peer in pool.peers do - if !peer.didTimeout && peer.numPending > 0 && peer.curRate < minRecvRate then - send error on pool error channel + pool.mtx.Lock() + for each peer in pool.peers do + if !peer.didTimeout && peer.numPending > 0 && peer.curRate < minRecvRate then + send error on pool error channel peer.didTimeout = true - if peer.didTimeout then - for each requester in pool.requesters do - if requester.getPeerID() == peer then + if peer.didTimeout then + for each requester in pool.requesters do + if requester.getPeerID() == peer then enqueue msg on requestor's redoChannel - delete(pool.peers, peerID) - pool.mtx.Unlock() + delete(pool.peers, peerID) + pool.mtx.Unlock() ``` - -### Main blockchain reactor controller task +### Main blockchain reactor controller task + ```go main(pool): - create trySyncTicker with interval trySyncIntervalMS - create statusUpdateTicker with interval statusUpdateIntervalSeconds - create switchToConsensusTicker with interbal switchToConsensusIntervalSeconds - - while true do - select { + create trySyncTicker with interval trySyncIntervalMS + create statusUpdateTicker with interval statusUpdateIntervalSeconds + create switchToConsensusTicker with interbal switchToConsensusIntervalSeconds + + while true do + select { upon receiving BlockRequest(Height, Peer) on pool.requestsChannel: - try to send bcBlockRequestMessage(Height) to Peer + try to send bcBlockRequestMessage(Height) to Peer upon receiving error(peer) on errorsChannel: - stop peer for error + stop peer for error upon receiving message on statusUpdateTickerChannel: - broadcast bcStatusRequestMessage(bcR.store.Height) // message sent in a separate routine + broadcast bcStatusRequestMessage(bcR.store.Height) // message sent in a separate routine upon receiving message on switchToConsensusTickerChannel: - pool.mtx.Lock() - receivedBlockOrTimedOut = pool.height > 0 || (time.Now() - pool.startTime) > 5 Seconds - ourChainIsLongestAmongPeers = pool.maxPeerHeight == 0 || pool.height >= pool.maxPeerHeight - haveSomePeers = size of pool.peers > 0 + pool.mtx.Lock() + receivedBlockOrTimedOut = pool.height > 0 || (time.Now() - pool.startTime) > 5 Seconds + ourChainIsLongestAmongPeers = pool.maxPeerHeight == 0 || pool.height >= pool.maxPeerHeight + haveSomePeers = size of pool.peers > 0 pool.mtx.Unlock() if haveSomePeers && receivedBlockOrTimedOut && ourChainIsLongestAmongPeers then - switch to consensus mode + switch to consensus mode upon receiving message on trySyncTickerChannel: - for i = 0; i < 10; i++ do - pool.mtx.Lock() + for i = 0; i < 10; i++ do + pool.mtx.Lock() firstBlock = pool.requesters[pool.height].block secondBlock = pool.requesters[pool.height].block if firstBlock == nil or secondBlock == nil then continue pool.mtx.Unlock() - verify firstBlock using LastCommit from secondBlock - if verification failed - pool.mtx.Lock() + verify firstBlock using LastCommit from secondBlock + if verification failed + pool.mtx.Lock() peerID = pool.requesters[pool.height].peerID redoRequestsForPeer(peerId) delete(pool.peers, peerID) - stop peer peerID for error - pool.mtx.Unlock() - else + stop peer peerID for error + pool.mtx.Unlock() + else delete(pool.requesters, pool.height) save firstBlock to store - pool.height++ - execute firstBlock + pool.height++ + execute firstBlock } - + redoRequestsForPeer(pool, peerId): - for each requester in pool.requesters do - if requester.getPeerID() == peerID - enqueue msg on redoChannel for requester + for each requester in pool.requesters do + if requester.getPeerID() == peerID + enqueue msg on redoChannel for requester ``` - + ## Channels Defines `maxMsgSize` for the maximum size of incoming messages, diff --git a/docs/spec/reactors/consensus/consensus-reactor.md b/docs/spec/reactors/consensus/consensus-reactor.md index 0f03b44b..7be35032 100644 --- a/docs/spec/reactors/consensus/consensus-reactor.md +++ b/docs/spec/reactors/consensus/consensus-reactor.md @@ -1,49 +1,48 @@ # Consensus Reactor -Consensus Reactor defines a reactor for the consensus service. It contains the ConsensusState service that -manages the state of the Tendermint consensus internal state machine. -When Consensus Reactor is started, it starts Broadcast Routine which starts ConsensusState service. -Furthermore, for each peer that is added to the Consensus Reactor, it creates (and manages) the known peer state -(that is used extensively in gossip routines) and starts the following three routines for the peer p: -Gossip Data Routine, Gossip Votes Routine and QueryMaj23Routine. Finally, Consensus Reactor is responsible +Consensus Reactor defines a reactor for the consensus service. It contains the ConsensusState service that +manages the state of the Tendermint consensus internal state machine. +When Consensus Reactor is started, it starts Broadcast Routine which starts ConsensusState service. +Furthermore, for each peer that is added to the Consensus Reactor, it creates (and manages) the known peer state +(that is used extensively in gossip routines) and starts the following three routines for the peer p: +Gossip Data Routine, Gossip Votes Routine and QueryMaj23Routine. Finally, Consensus Reactor is responsible for decoding messages received from a peer and for adequate processing of the message depending on its type and content. -The processing normally consists of updating the known peer state and for some messages -(`ProposalMessage`, `BlockPartMessage` and `VoteMessage`) also forwarding message to ConsensusState module -for further processing. In the following text we specify the core functionality of those separate unit of executions -that are part of the Consensus Reactor. +The processing normally consists of updating the known peer state and for some messages +(`ProposalMessage`, `BlockPartMessage` and `VoteMessage`) also forwarding message to ConsensusState module +for further processing. In the following text we specify the core functionality of those separate unit of executions +that are part of the Consensus Reactor. ## ConsensusState service -Consensus State handles execution of the Tendermint BFT consensus algorithm. It processes votes and proposals, +Consensus State handles execution of the Tendermint BFT consensus algorithm. It processes votes and proposals, and upon reaching agreement, commits blocks to the chain and executes them against the application. The internal state machine receives input from peers, the internal validator and from a timer. Inside Consensus State we have the following units of execution: Timeout Ticker and Receive Routine. -Timeout Ticker is a timer that schedules timeouts conditional on the height/round/step that are processed -by the Receive Routine. - +Timeout Ticker is a timer that schedules timeouts conditional on the height/round/step that are processed +by the Receive Routine. ### Receive Routine of the ConsensusState service Receive Routine of the ConsensusState handles messages which may cause internal consensus state transitions. -It is the only routine that updates RoundState that contains internal consensus state. -Updates (state transitions) happen on timeouts, complete proposals, and 2/3 majorities. -It receives messages from peers, internal validators and from Timeout Ticker -and invokes the corresponding handlers, potentially updating the RoundState. -The details of the protocol (together with formal proofs of correctness) implemented by the Receive Routine are +It is the only routine that updates RoundState that contains internal consensus state. +Updates (state transitions) happen on timeouts, complete proposals, and 2/3 majorities. +It receives messages from peers, internal validators and from Timeout Ticker +and invokes the corresponding handlers, potentially updating the RoundState. +The details of the protocol (together with formal proofs of correctness) implemented by the Receive Routine are discussed in separate document. For understanding of this document -it is sufficient to understand that the Receive Routine manages and updates RoundState data structure that is +it is sufficient to understand that the Receive Routine manages and updates RoundState data structure that is then extensively used by the gossip routines to determine what information should be sent to peer processes. ## Round State RoundState defines the internal consensus state. It contains height, round, round step, a current validator set, -a proposal and proposal block for the current round, locked round and block (if some block is being locked), set of -received votes and last commit and last validators set. +a proposal and proposal block for the current round, locked round and block (if some block is being locked), set of +received votes and last commit and last validators set. ```golang type RoundState struct { - Height int64 + Height int64 Round int Step RoundStepType Validators ValidatorSet @@ -54,10 +53,10 @@ type RoundState struct { LockedBlock Block LockedBlockParts PartSet Votes HeightVoteSet - LastCommit VoteSet + LastCommit VoteSet LastValidators ValidatorSet -} -``` +} +``` Internally, consensus will run as a state machine with the following states: @@ -82,8 +81,8 @@ type PeerRoundState struct { Round int // Round peer is at, -1 if unknown. Step RoundStepType // Step peer is at Proposal bool // True if peer has proposal for this round - ProposalBlockPartsHeader PartSetHeader - ProposalBlockParts BitArray + ProposalBlockPartsHeader PartSetHeader + ProposalBlockParts BitArray ProposalPOLRound int // Proposal's POL round. -1 if none. ProposalPOL BitArray // nil until ProposalPOLMessage received. Prevotes BitArray // All votes peer has for this round @@ -93,19 +92,19 @@ type PeerRoundState struct { CatchupCommitRound int // Round that we have commit for. Not necessarily unique. -1 if none. CatchupCommit BitArray // All commit precommits peer has for this height & CatchupCommitRound } -``` +``` ## Receive method of Consensus reactor -The entry point of the Consensus reactor is a receive method. When a message is received from a peer p, -normally the peer round state is updated correspondingly, and some messages +The entry point of the Consensus reactor is a receive method. When a message is received from a peer p, +normally the peer round state is updated correspondingly, and some messages are passed for further processing, for example to ConsensusState service. We now specify the processing of messages in the receive method of Consensus reactor for each message type. In the following message handler, `rs` and `prs` denote `RoundState` and `PeerRoundState`, respectively. -### NewRoundStepMessage handler +### NewRoundStepMessage handler -``` +``` handleMessage(msg): if msg is from smaller height/round/step then return // Just remember these values. @@ -116,10 +115,10 @@ handleMessage(msg): Update prs with values from msg if prs.Height or prs.Round has been updated then - reset Proposal related fields of the peer state + reset Proposal related fields of the peer state if prs.Round has been updated and msg.Round == prsCatchupCommitRound then prs.Precommits = psCatchupCommit - if prs.Height has been updated then + if prs.Height has been updated then if prsHeight+1 == msg.Height && prsRound == msg.LastCommitRound then prs.LastCommitRound = msg.LastCommitRound prs.LastCommit = prs.Precommits @@ -128,111 +127,111 @@ handleMessage(msg): prs.LastCommit = nil } Reset prs.CatchupCommitRound and prs.CatchupCommit -``` +``` ### CommitStepMessage handler -``` +``` handleMessage(msg): - if prs.Height == msg.Height then + if prs.Height == msg.Height then prs.ProposalBlockPartsHeader = msg.BlockPartsHeader prs.ProposalBlockParts = msg.BlockParts -``` +``` ### HasVoteMessage handler -``` +``` handleMessage(msg): - if prs.Height == msg.Height then + if prs.Height == msg.Height then prs.setHasVote(msg.Height, msg.Round, msg.Type, msg.Index) -``` +``` ### VoteSetMaj23Message handler -``` +``` handleMessage(msg): if prs.Height == msg.Height then Record in rs that a peer claim to have ⅔ majority for msg.BlockID - Send VoteSetBitsMessage showing votes node has for that BlockId -``` + Send VoteSetBitsMessage showing votes node has for that BlockId +``` ### ProposalMessage handler ``` handleMessage(msg): - if prs.Height != msg.Height || prs.Round != msg.Round || prs.Proposal then return + if prs.Height != msg.Height || prs.Round != msg.Round || prs.Proposal then return prs.Proposal = true prs.ProposalBlockPartsHeader = msg.BlockPartsHeader - prs.ProposalBlockParts = empty set + prs.ProposalBlockParts = empty set prs.ProposalPOLRound = msg.POLRound - prs.ProposalPOL = nil + prs.ProposalPOL = nil Send msg through internal peerMsgQueue to ConsensusState service -``` +``` ### ProposalPOLMessage handler -``` +``` handleMessage(msg): if prs.Height != msg.Height or prs.ProposalPOLRound != msg.ProposalPOLRound then return prs.ProposalPOL = msg.ProposalPOL -``` +``` ### BlockPartMessage handler -``` +``` handleMessage(msg): if prs.Height != msg.Height || prs.Round != msg.Round then return - Record in prs that peer has block part msg.Part.Index + Record in prs that peer has block part msg.Part.Index Send msg trough internal peerMsgQueue to ConsensusState service -``` +``` ### VoteMessage handler -``` +``` handleMessage(msg): Record in prs that a peer knows vote with index msg.vote.ValidatorIndex for particular height and round Send msg trough internal peerMsgQueue to ConsensusState service -``` +``` ### VoteSetBitsMessage handler -``` +``` handleMessage(msg): Update prs for the bit-array of votes peer claims to have for the msg.BlockID -``` +``` ## Gossip Data Routine -It is used to send the following messages to the peer: `BlockPartMessage`, `ProposalMessage` and -`ProposalPOLMessage` on the DataChannel. The gossip data routine is based on the local RoundState (`rs`) +It is used to send the following messages to the peer: `BlockPartMessage`, `ProposalMessage` and +`ProposalPOLMessage` on the DataChannel. The gossip data routine is based on the local RoundState (`rs`) and the known PeerRoundState (`prs`). The routine repeats forever the logic shown below: ``` 1a) if rs.ProposalBlockPartsHeader == prs.ProposalBlockPartsHeader and the peer does not have all the proposal parts then - Part = pick a random proposal block part the peer does not have - Send BlockPartMessage(rs.Height, rs.Round, Part) to the peer on the DataChannel + Part = pick a random proposal block part the peer does not have + Send BlockPartMessage(rs.Height, rs.Round, Part) to the peer on the DataChannel if send returns true, record that the peer knows the corresponding block Part - Continue - + Continue + 1b) if (0 < prs.Height) and (prs.Height < rs.Height) then help peer catch up using gossipDataForCatchup function Continue -1c) if (rs.Height != prs.Height) or (rs.Round != prs.Round) then +1c) if (rs.Height != prs.Height) or (rs.Round != prs.Round) then Sleep PeerGossipSleepDuration - Continue + Continue // at this point rs.Height == prs.Height and rs.Round == prs.Round -1d) if (rs.Proposal != nil and !prs.Proposal) then +1d) if (rs.Proposal != nil and !prs.Proposal) then Send ProposalMessage(rs.Proposal) to the peer if send returns true, record that the peer knows Proposal if 0 <= rs.Proposal.POLRound then - polRound = rs.Proposal.POLRound - prevotesBitArray = rs.Votes.Prevotes(polRound).BitArray() + polRound = rs.Proposal.POLRound + prevotesBitArray = rs.Votes.Prevotes(polRound).BitArray() Send ProposalPOLMessage(rs.Height, polRound, prevotesBitArray) - Continue + Continue -2) Sleep PeerGossipSleepDuration +2) Sleep PeerGossipSleepDuration ``` ### Gossip Data For Catchup @@ -240,65 +239,65 @@ and the known PeerRoundState (`prs`). The routine repeats forever the logic show This function is responsible for helping peer catch up if it is at the smaller height (prs.Height < rs.Height). The function executes the following logic: - if peer does not have all block parts for prs.ProposalBlockPart then + if peer does not have all block parts for prs.ProposalBlockPart then blockMeta = Load Block Metadata for height prs.Height from blockStore if (!blockMeta.BlockID.PartsHeader == prs.ProposalBlockPartsHeader) then Sleep PeerGossipSleepDuration return - Part = pick a random proposal block part the peer does not have - Send BlockPartMessage(prs.Height, prs.Round, Part) to the peer on the DataChannel + Part = pick a random proposal block part the peer does not have + Send BlockPartMessage(prs.Height, prs.Round, Part) to the peer on the DataChannel if send returns true, record that the peer knows the corresponding block Part return - else Sleep PeerGossipSleepDuration - + else Sleep PeerGossipSleepDuration + ## Gossip Votes Routine It is used to send the following message: `VoteMessage` on the VoteChannel. -The gossip votes routine is based on the local RoundState (`rs`) +The gossip votes routine is based on the local RoundState (`rs`) and the known PeerRoundState (`prs`). The routine repeats forever the logic shown below: ``` 1a) if rs.Height == prs.Height then - if prs.Step == RoundStepNewHeight then - vote = random vote from rs.LastCommit the peer does not have - Send VoteMessage(vote) to the peer - if send returns true, continue - - if prs.Step <= RoundStepPrevote and prs.Round != -1 and prs.Round <= rs.Round then - Prevotes = rs.Votes.Prevotes(prs.Round) - vote = random vote from Prevotes the peer does not have - Send VoteMessage(vote) to the peer + if prs.Step == RoundStepNewHeight then + vote = random vote from rs.LastCommit the peer does not have + Send VoteMessage(vote) to the peer if send returns true, continue - if prs.Step <= RoundStepPrecommit and prs.Round != -1 and prs.Round <= rs.Round then - Precommits = rs.Votes.Precommits(prs.Round) - vote = random vote from Precommits the peer does not have - Send VoteMessage(vote) to the peer + if prs.Step <= RoundStepPrevote and prs.Round != -1 and prs.Round <= rs.Round then + Prevotes = rs.Votes.Prevotes(prs.Round) + vote = random vote from Prevotes the peer does not have + Send VoteMessage(vote) to the peer if send returns true, continue - - if prs.ProposalPOLRound != -1 then + + if prs.Step <= RoundStepPrecommit and prs.Round != -1 and prs.Round <= rs.Round then + Precommits = rs.Votes.Precommits(prs.Round) + vote = random vote from Precommits the peer does not have + Send VoteMessage(vote) to the peer + if send returns true, continue + + if prs.ProposalPOLRound != -1 then PolPrevotes = rs.Votes.Prevotes(prs.ProposalPOLRound) - vote = random vote from PolPrevotes the peer does not have - Send VoteMessage(vote) to the peer - if send returns true, continue + vote = random vote from PolPrevotes the peer does not have + Send VoteMessage(vote) to the peer + if send returns true, continue 1b) if prs.Height != 0 and rs.Height == prs.Height+1 then - vote = random vote from rs.LastCommit peer does not have - Send VoteMessage(vote) to the peer - if send returns true, continue - -1c) if prs.Height != 0 and rs.Height >= prs.Height+2 then - Commit = get commit from BlockStore for prs.Height - vote = random vote from Commit the peer does not have - Send VoteMessage(vote) to the peer + vote = random vote from rs.LastCommit peer does not have + Send VoteMessage(vote) to the peer if send returns true, continue -2) Sleep PeerGossipSleepDuration +1c) if prs.Height != 0 and rs.Height >= prs.Height+2 then + Commit = get commit from BlockStore for prs.Height + vote = random vote from Commit the peer does not have + Send VoteMessage(vote) to the peer + if send returns true, continue + +2) Sleep PeerGossipSleepDuration ``` ## QueryMaj23Routine -It is used to send the following message: `VoteSetMaj23Message`. `VoteSetMaj23Message` is sent to indicate that a given +It is used to send the following message: `VoteSetMaj23Message`. `VoteSetMaj23Message` is sent to indicate that a given BlockID has seen +2/3 votes. This routine is based on the local RoundState (`rs`) and the known PeerRoundState (`prs`). The routine repeats forever the logic shown below. @@ -324,8 +323,8 @@ BlockID has seen +2/3 votes. This routine is based on the local RoundState (`rs` Send m to peer Sleep PeerQueryMaj23SleepDuration -1d) if prs.CatchupCommitRound != -1 and 0 < prs.Height and - prs.Height <= blockStore.Height() then +1d) if prs.CatchupCommitRound != -1 and 0 < prs.Height and + prs.Height <= blockStore.Height() then Commit = LoadCommit(prs.Height) m = VoteSetMaj23Message(prs.Height,Commit.Round,Precommit,Commit.blockId) Send m to peer @@ -339,14 +338,14 @@ BlockID has seen +2/3 votes. This routine is based on the local RoundState (`rs` The Broadcast routine subscribes to an internal event bus to receive new round steps, votes messages and proposal heartbeat messages, and broadcasts messages to peers upon receiving those events. It broadcasts `NewRoundStepMessage` or `CommitStepMessage` upon new round state event. Note that -broadcasting these messages does not depend on the PeerRoundState; it is sent on the StateChannel. -Upon receiving VoteMessage it broadcasts `HasVoteMessage` message to its peers on the StateChannel. +broadcasting these messages does not depend on the PeerRoundState; it is sent on the StateChannel. +Upon receiving VoteMessage it broadcasts `HasVoteMessage` message to its peers on the StateChannel. `ProposalHeartbeatMessage` is sent the same way on the StateChannel. ## Channels Defines 4 channels: state, data, vote and vote_set_bits. Each channel -has `SendQueueCapacity` and `RecvBufferCapacity` and +has `SendQueueCapacity` and `RecvBufferCapacity` and `RecvMessageCapacity` set to `maxMsgSize`. Sending incorrectly encoded data will result in stopping the peer. diff --git a/docs/spec/reactors/consensus/consensus.md b/docs/spec/reactors/consensus/consensus.md index 4ea619b5..a1cf17bc 100644 --- a/docs/spec/reactors/consensus/consensus.md +++ b/docs/spec/reactors/consensus/consensus.md @@ -23,7 +23,7 @@ processes using `BlockPartMessage`. Validators in Tendermint communicate by peer-to-peer gossiping protocol. Each validator is connected only to a subset of processes called peers. By the gossiping protocol, a validator send to its peers -all needed information (`ProposalMessage`, `VoteMessage` and `BlockPartMessage`) so they can +all needed information (`ProposalMessage`, `VoteMessage` and `BlockPartMessage`) so they can reach agreement on some block, and also obtain the content of the chosen block (block parts). As part of the gossiping protocol, processes also send auxiliary messages that inform peers about the executed steps of the core consensus algorithm (`NewRoundStepMessage` and `CommitStepMessage`), and diff --git a/docs/spec/reactors/consensus/proposer-selection.md b/docs/spec/reactors/consensus/proposer-selection.md index 649d3dd2..b5e0b35a 100644 --- a/docs/spec/reactors/consensus/proposer-selection.md +++ b/docs/spec/reactors/consensus/proposer-selection.md @@ -1,6 +1,6 @@ # Proposer selection procedure in Tendermint -This document specifies the Proposer Selection Procedure that is used in Tendermint to choose a round proposer. +This document specifies the Proposer Selection Procedure that is used in Tendermint to choose a round proposer. As Tendermint is “leader-based protocol”, the proposer selection is critical for its correct functioning. Let denote with `proposer_p(h,r)` a process returned by the Proposer Selection Procedure at the process p, at height h and round r. Then the Proposer Selection procedure should fulfill the following properties: @@ -9,13 +9,13 @@ and round r. Then the Proposer Selection procedure should fulfill the following p and q, for each height h, and each round r, proposer_p(h,r) = proposer_q(h,r) -`Liveness`: In every consecutive sequence of rounds of size K (K is system parameter), at least a -single round has an honest proposer. +`Liveness`: In every consecutive sequence of rounds of size K (K is system parameter), at least a +single round has an honest proposer. -`Fairness`: The proposer selection is proportional to the validator voting power, i.e., a validator with more -voting power is selected more frequently, proportional to its power. More precisely, given a set of processes -with the total voting power N, during a sequence of rounds of size N, every process is proposer in a number of rounds -equal to its voting power. +`Fairness`: The proposer selection is proportional to the validator voting power, i.e., a validator with more +voting power is selected more frequently, proportional to its power. More precisely, given a set of processes +with the total voting power N, during a sequence of rounds of size N, every process is proposer in a number of rounds +equal to its voting power. We now look at a few particular cases to understand better how fairness should be implemented. If we have 4 processes with the following voting power distribution (p0,4), (p1, 2), (p2, 2), (p3, 2) at some round r, @@ -27,20 +27,20 @@ Let consider now the following scenario where a total voting power of faulty pro p0: (p0,3), (p1, 1), (p2, 1), (p3, 1), (p4, 1), (p5, 1), (p6, 1), (p7, 1). In this case the sequence of proposer selections looks like this: -`p0, p1, p2, p3, p0, p4, p5, p6, p7, p0, p0, p1, p2, p3, p0, p4, p5, p6, p7, p0, etc` +`p0, p1, p2, p3, p0, p4, p5, p6, p7, p0, p0, p1, p2, p3, p0, p4, p5, p6, p7, p0, etc` In this case, we see that a number of rounds coordinated by a faulty process is proportional to its voting power. -We consider also the case where we have voting power uniformly distributed among processes, i.e., we have 10 processes -each with voting power of 1. And let consider that there are 3 faulty processes with consecutive addresses, +We consider also the case where we have voting power uniformly distributed among processes, i.e., we have 10 processes +each with voting power of 1. And let consider that there are 3 faulty processes with consecutive addresses, for example the first 3 processes are faulty. Then the sequence looks like this: `p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, etc` -In this case, we have 3 consecutive rounds with a faulty proposer. +In this case, we have 3 consecutive rounds with a faulty proposer. One special case we consider is the case where a single honest process p0 has most of the voting power, for example: (p0,100), (p1, 2), (p2, 3), (p3, 4). Then the sequence of proposer selection looks like this: p0, p0, p0, p0, p0, p0, p0, p0, p0, p0, p0, p0, p0, p1, p0, p0, p0, p0, p0, etc -This basically means that almost all rounds have the same proposer. But in this case, the process p0 has anyway enough +This basically means that almost all rounds have the same proposer. But in this case, the process p0 has anyway enough voting power to decide whatever he wants, so the fact that he coordinates almost all rounds seems correct. diff --git a/docs/spec/reactors/mempool/concurrency.md b/docs/spec/reactors/mempool/concurrency.md index 991113e6..a6870db9 100644 --- a/docs/spec/reactors/mempool/concurrency.md +++ b/docs/spec/reactors/mempool/concurrency.md @@ -2,7 +2,7 @@ Look at the concurrency model this uses... -* Receiving CheckTx -* Broadcasting new tx -* Interfaces with consensus engine, reap/update while checking -* Calling the ABCI app (ordering. callbacks. how proxy works alongside the blockchain proxy which actually writes blocks) +- Receiving CheckTx +- Broadcasting new tx +- Interfaces with consensus engine, reap/update while checking +- Calling the ABCI app (ordering. callbacks. how proxy works alongside the blockchain proxy which actually writes blocks) diff --git a/docs/spec/reactors/mempool/config.md b/docs/spec/reactors/mempool/config.md index 776149ba..3e3c0d37 100644 --- a/docs/spec/reactors/mempool/config.md +++ b/docs/spec/reactors/mempool/config.md @@ -11,12 +11,12 @@ Flag: `--mempool.recheck_empty=false` Environment: `TM_MEMPOOL_RECHECK_EMPTY=false` Config: + ``` [mempool] recheck_empty = false ``` - ## Recheck `--mempool.recheck=false` (default: true) diff --git a/docs/spec/reactors/mempool/functionality.md b/docs/spec/reactors/mempool/functionality.md index 85c3dc58..8c9847e8 100644 --- a/docs/spec/reactors/mempool/functionality.md +++ b/docs/spec/reactors/mempool/functionality.md @@ -6,26 +6,25 @@ consensus reactor when it is selected as the block proposer. There are two sides to the mempool state: -* External: get, check, and broadcast new transactions -* Internal: return valid transaction, update list after block commit - +- External: get, check, and broadcast new transactions +- Internal: return valid transaction, update list after block commit ## External functionality External functionality is exposed via network interfaces to potentially untrusted actors. -* CheckTx - triggered via RPC or P2P -* Broadcast - gossip messages after a successful check +- CheckTx - triggered via RPC or P2P +- Broadcast - gossip messages after a successful check ## Internal functionality Internal functionality is exposed via method calls to other code compiled into the tendermint binary. -* Reap - get tx to propose in next block -* Update - remove tx that were included in last block -* ABCI.CheckTx - call ABCI app to validate the tx +- Reap - get tx to propose in next block +- Update - remove tx that were included in last block +- ABCI.CheckTx - call ABCI app to validate the tx What does it provide the consensus reactor? What guarantees does it need from the ABCI app? diff --git a/docs/spec/reactors/mempool/messages.md b/docs/spec/reactors/mempool/messages.md index 9a624dff..117fc5f2 100644 --- a/docs/spec/reactors/mempool/messages.md +++ b/docs/spec/reactors/mempool/messages.md @@ -35,12 +35,12 @@ Request (`POST http://gaia.zone:26657/`): ```json { - "id": "", - "jsonrpc": "2.0", - "method": "broadcast_sync", - "params": { + "id": "", + "jsonrpc": "2.0", + "method": "broadcast_sync", + "params": { "tx": "F012A4BC68..." - } + } } ``` @@ -48,14 +48,14 @@ Response: ```json { - "error": "", - "result": { - "hash": "E39AAB7A537ABAA237831742DCE1117F187C3C52", - "log": "", - "data": "", - "code": 0 - }, - "id": "", - "jsonrpc": "2.0" + "error": "", + "result": { + "hash": "E39AAB7A537ABAA237831742DCE1117F187C3C52", + "log": "", + "data": "", + "code": 0 + }, + "id": "", + "jsonrpc": "2.0" } ``` diff --git a/docs/spec/reactors/pex/pex.md b/docs/spec/reactors/pex/pex.md index 9e00101a..26f1fa8b 100644 --- a/docs/spec/reactors/pex/pex.md +++ b/docs/spec/reactors/pex/pex.md @@ -95,6 +95,7 @@ remove from address book completely. ## Select Peers to Exchange When we’re asked for peers, we select them as follows: + - select at most `maxGetSelection` peers - try to select at least `minGetSelection` peers - if we have less than that, select them all. - select a random, unbiased `getSelectionPercent` of the peers @@ -126,4 +127,3 @@ to use it in the PEX. See the [trustmetric](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-006-trust-metric.md) and [trustmetric useage](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-007-trust-metric-usage.md) architecture docs for more details. - diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index 4323d394..aacdb43d 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -44,7 +44,6 @@ Thus, during Commit, it is safe to reset the QueryState and the CheckTxState to Note, however, that it is not possible to send transactions to Tendermint during Commit - if your app tries to send a `/broadcast_tx` to Tendermint during Commit, it will deadlock. - ## EndBlock Validator Updates Updates to the Tendermint validator set can be made by returning `Validator` @@ -60,12 +59,12 @@ message PubKey { string type bytes data } - ``` The `pub_key` currently supports two types: - - `type = "ed25519" and `data = ` - - `type = "secp256k1" and `data = <33-byte OpenSSL compressed public key>` + +- `type = "ed25519" and`data = ` +- `type = "secp256k1" and `data = <33-byte OpenSSL compressed public key>` If the address is provided, it must match the address of the pubkey, as specified [here](/docs/spec/blockchain/encoding.md#Addresses) @@ -87,9 +86,9 @@ following rules: - if power is 0, the validator must already exist, and will be removed from the validator set - if power is non-0: - - if the validator does not already exist, it will be added to the validator - set with the given power - - if the validator does already exist, its power will be adjusted to the given power + - if the validator does not already exist, it will be added to the validator + set with the given power + - if the validator does already exist, its power will be adjusted to the given power ## InitChain Validator Updates @@ -114,10 +113,10 @@ features. These are: When Tendermint connects to a peer, it sends two queries to the ABCI application using the following paths, with no additional data: - - `/p2p/filter/addr/`, where `` denote the IP address and - the port of the connection - - `p2p/filter/id/`, where `` is the peer node ID (ie. the - pubkey.Address() for the peer's PubKey) +- `/p2p/filter/addr/`, where `` denote the IP address and + the port of the connection +- `p2p/filter/id/`, where `` is the peer node ID (ie. the + pubkey.Address() for the peer's PubKey) If either of these queries return a non-zero ABCI code, Tendermint will refuse to connect to the peer. @@ -128,11 +127,9 @@ On startup, Tendermint calls Info on the Query connection to get the latest committed state of the app. The app MUST return information consistent with the last block it succesfully completed Commit for. -If the app succesfully committed block H but not H+1, then `last_block_height = -H` and `last_block_app_hash = `. If the app +If the app succesfully committed block H but not H+1, then `last_block_height = H` and `last_block_app_hash = `. If the app failed during the Commit of block H, then `last_block_height = H-1` and -`last_block_app_hash = `. +`last_block_app_hash = `. We now distinguish three heights, and describe how Tendermint syncs itself with the app. @@ -165,24 +162,24 @@ If `storeBlockHeight > stateBlockHeight+1`, panic Now, the meat: If `storeBlockHeight == stateBlockHeight && appBlockHeight < storeBlockHeight`, - replay all blocks in full from `appBlockHeight` to `storeBlockHeight`. - This happens if we completed processing the block, but the app forgot its height. +replay all blocks in full from `appBlockHeight` to `storeBlockHeight`. +This happens if we completed processing the block, but the app forgot its height. If `storeBlockHeight == stateBlockHeight && appBlockHeight == storeBlockHeight`, we're done - This happens if we crashed at an opportune spot. +This happens if we crashed at an opportune spot. If `storeBlockHeight == stateBlockHeight+1` - This happens if we started processing the block but didn't finish. +This happens if we started processing the block but didn't finish. - If `appBlockHeight < stateBlockHeight` - replay all blocks in full from `appBlockHeight` to `storeBlockHeight-1`, - and replay the block at `storeBlockHeight` using the WAL. - This happens if the app forgot the last block it committed. + If `appBlockHeight < stateBlockHeight` + replay all blocks in full from `appBlockHeight` to `storeBlockHeight-1`, + and replay the block at `storeBlockHeight` using the WAL. + This happens if the app forgot the last block it committed. - If `appBlockHeight == stateBlockHeight`, - replay the last block (storeBlockHeight) in full. - This happens if we crashed before the app finished Commit + If `appBlockHeight == stateBlockHeight`, + replay the last block (storeBlockHeight) in full. + This happens if we crashed before the app finished Commit - If appBlockHeight == storeBlockHeight { - update the state using the saved ABCI responses but dont run the block against the real app. - This happens if we crashed after the app finished Commit but before Tendermint saved the state. + If appBlockHeight == storeBlockHeight { + update the state using the saved ABCI responses but dont run the block against the real app. + This happens if we crashed after the app finished Commit but before Tendermint saved the state. diff --git a/docs/stop-words.txt b/docs/stop-words.txt new file mode 100644 index 00000000..7f90eca3 --- /dev/null +++ b/docs/stop-words.txt @@ -0,0 +1,6 @@ +investor +invest +investing +token distribution +atom distribution +distribution of atoms diff --git a/docs/tendermint-core/block-structure.md b/docs/tendermint-core/block-structure.md index 80380552..f58e83aa 100644 --- a/docs/tendermint-core/block-structure.md +++ b/docs/tendermint-core/block-structure.md @@ -13,11 +13,11 @@ A [Block](https://godoc.org/github.com/tendermint/tendermint/types#Block) contains: -- a [Header](#header) contains merkle hashes for various chain states -- the - [Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) - is all transactions which are to be processed -- the [LastCommit](#commit) > 2/3 signatures for the last block +- a [Header](#header) contains merkle hashes for various chain states +- the + [Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) + is all transactions which are to be processed +- the [LastCommit](#commit) > 2/3 signatures for the last block The signatures returned along with block `H` are those validating block `H-1`. This can be a little confusing, but we must also consider that @@ -66,7 +66,7 @@ effects of running that transaction will be first visible in the `AppHash` from the block header at height `H+1`. Like the `LastCommit` issue, this is a requirement of the immutability -of the block chain, as the application only applies transactions *after* +of the block chain, as the application only applies transactions _after_ they are commited to the chain. ## Commit @@ -90,7 +90,7 @@ you look at the code, you will notice that we need to provide the `chainID` of the blockchain in order to properly calculate the votes. This is to protect anyone from swapping votes between chains to fake (or frame) a validator. Also note that this `chainID` is in the -`genesis.json` from *Tendermint*, not the `genesis.json` from the +`genesis.json` from _Tendermint_, not the `genesis.json` from the basecoin app ([that is a different chainID...](https://github.com/cosmos/cosmos-sdk/issues/32)). diff --git a/docs/tendermint-core/light-client-protocol.md b/docs/tendermint-core/light-client-protocol.md index 6d905be3..7318ad16 100644 --- a/docs/tendermint-core/light-client-protocol.md +++ b/docs/tendermint-core/light-client-protocol.md @@ -18,13 +18,13 @@ proofs](./merkle.md#iavl-tree). ## Properties -- You get the full collateralized security benefits of Tendermint; No - need to wait for confirmations. -- You get the full speed benefits of Tendermint; transactions - commit instantly. -- You can get the most recent version of the application state - non-interactively (without committing anything to the blockchain). - For example, this means that you can get the most recent value of a - name from the name-registry without worrying about fork censorship - attacks, without posting a commit and waiting for confirmations. - It's fast, secure, and free! +- You get the full collateralized security benefits of Tendermint; No + need to wait for confirmations. +- You get the full speed benefits of Tendermint; transactions + commit instantly. +- You can get the most recent version of the application state + non-interactively (without committing anything to the blockchain). + For example, this means that you can get the most recent value of a + name from the name-registry without worrying about fork censorship + attacks, without posting a commit and waiting for confirmations. + It's fast, secure, and free! diff --git a/docs/tendermint-core/running-in-production.md b/docs/tendermint-core/running-in-production.md index eeab25c3..76465b8e 100644 --- a/docs/tendermint-core/running-in-production.md +++ b/docs/tendermint-core/running-in-production.md @@ -135,33 +135,34 @@ Tendermint, replay will fail with panic. Recovering from data corruption can be hard and time-consuming. Here are two approaches you can take: -1) Delete the WAL file and restart Tendermint. It will attempt to sync with other peers. -2) Try to repair the WAL file manually: +1. Delete the WAL file and restart Tendermint. It will attempt to sync with other peers. +2. Try to repair the WAL file manually: - 1. Create a backup of the corrupted WAL file: +1) Create a backup of the corrupted WAL file: ``` cp "$TMHOME/data/cs.wal/wal" > /tmp/corrupted_wal_backup ``` - 2. Use `./scripts/wal2json` to create a human-readable version +2. Use `./scripts/wal2json` to create a human-readable version ``` ./scripts/wal2json/wal2json "$TMHOME/data/cs.wal/wal" > /tmp/corrupted_wal ``` - 3. Search for a "CORRUPTED MESSAGE" line. - 4. By looking at the previous message and the message after the corrupted one - and looking at the logs, try to rebuild the message. If the consequent - messages are marked as corrupted too (this may happen if length header - got corrupted or some writes did not make it to the WAL ~ truncation), - then remove all the lines starting from the corrupted one and restart - Tendermint. +3. Search for a "CORRUPTED MESSAGE" line. +4. By looking at the previous message and the message after the corrupted one + and looking at the logs, try to rebuild the message. If the consequent + messages are marked as corrupted too (this may happen if length header + got corrupted or some writes did not make it to the WAL ~ truncation), + then remove all the lines starting from the corrupted one and restart + Tendermint. ``` $EDITOR /tmp/corrupted_wal ``` - 5. After editing, convert this file back into binary form by running: + +5. After editing, convert this file back into binary form by running: ``` ./scripts/json2wal/json2wal /tmp/corrupted_wal $TMHOME/data/cs.wal/wal diff --git a/docs/tendermint-core/secure-p2p.md b/docs/tendermint-core/secure-p2p.md index 692fe9ef..1d90e058 100644 --- a/docs/tendermint-core/secure-p2p.md +++ b/docs/tendermint-core/secure-p2p.md @@ -61,9 +61,9 @@ Authenticated encryption is enabled by default. ## Additional Reading -- [Implementation](https://github.com/tendermint/tendermint/blob/64bae01d007b5bee0d0827ab53259ffd5910b4e6/p2p/conn/secret_connection.go#L47) -- [Original STS paper by Whitfield Diffie, Paul C. van Oorschot and - Michael J. - Wiener](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.216.6107&rep=rep1&type=pdf) -- [Further work on secret - handshakes](https://dominictarr.github.io/secret-handshake-paper/shs.pdf) +- [Implementation](https://github.com/tendermint/tendermint/blob/64bae01d007b5bee0d0827ab53259ffd5910b4e6/p2p/conn/secret_connection.go#L47) +- [Original STS paper by Whitfield Diffie, Paul C. van Oorschot and + Michael J. + Wiener](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.216.6107&rep=rep1&type=pdf) +- [Further work on secret + handshakes](https://dominictarr.github.io/secret-handshake-paper/shs.pdf) diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index b3ea2624..71b773f0 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -39,20 +39,20 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g #### Fields -- `genesis_time`: Official time of blockchain start. -- `chain_id`: ID of the blockchain. This must be unique for - every blockchain. If your testnet blockchains do not have unique - chain IDs, you will have a bad time. -- `validators`: -- `pub_key`: The first element specifies the `pub_key` type. 1 - == Ed25519. The second element are the pubkey bytes. -- `power`: The validator's voting power. -- `name`: Name of the validator (optional). -- `app_hash`: The expected application hash (as returned by the - `ResponseInfo` ABCI message) upon genesis. If the app's hash does - not match, Tendermint will panic. -- `app_state`: The application state (e.g. initial distribution - of tokens). +- `genesis_time`: Official time of blockchain start. +- `chain_id`: ID of the blockchain. This must be unique for + every blockchain. If your testnet blockchains do not have unique + chain IDs, you will have a bad time. +- `validators`: +- `pub_key`: The first element specifies the `pub_key` type. 1 + == Ed25519. The second element are the pubkey bytes. +- `power`: The validator's voting power. +- `name`: Name of the validator (optional). +- `app_hash`: The expected application hash (as returned by the + `ResponseInfo` ABCI message) upon genesis. If the app's hash does + not match, Tendermint will panic. +- `app_state`: The application state (e.g. initial distribution + of tokens). #### Sample genesis.json diff --git a/docs/tendermint-core/validators.md b/docs/tendermint-core/validators.md index 0c1d7d89..5513886a 100644 --- a/docs/tendermint-core/validators.md +++ b/docs/tendermint-core/validators.md @@ -2,7 +2,7 @@ Validators are responsible for committing new blocks in the blockchain. These validators participate in the consensus protocol by broadcasting -*votes* which contain cryptographic signatures signed by each +_votes_ which contain cryptographic signatures signed by each validator's private key. Some Proof-of-Stake consensus algorithms aim to create a "completely" @@ -28,12 +28,12 @@ There are two ways to become validator. ## Committing a Block -*+2/3 is short for "more than 2/3"* +_+2/3 is short for "more than 2/3"_ A block is committed when +2/3 of the validator set sign [precommit votes](../spec/blockchain/blockchain.md#vote) for that block at the same `round`. The +2/3 set of precommit votes is called a -[*commit*](../spec/blockchain/blockchain.md#commit). While any +2/3 set of +[_commit_](../spec/blockchain/blockchain.md#commit). While any +2/3 set of precommits for the same block at the same height&round can serve as validation, the canonical commit is included in the next block (see [LastCommit](../spec/blockchain/blockchain.md#last-commit)). diff --git a/docs/tools/benchmarking.md b/docs/tools/benchmarking.md index 20c368e2..691d3b6e 100644 --- a/docs/tools/benchmarking.md +++ b/docs/tools/benchmarking.md @@ -23,7 +23,7 @@ Blocks/sec 0.818 0.386 1 9 [Install Tendermint](../introduction/install) This currently is setup to work on tendermint's develop branch. Please ensure you are on that. (If not, update `tendermint` and `tmlibs` in gopkg.toml to use - the master branch.) +the master branch.) then run: @@ -32,7 +32,7 @@ tendermint init tendermint node --proxy_app=kvstore ``` -``` +``` tm-bench localhost:26657 ``` diff --git a/docs/tools/monitoring.md b/docs/tools/monitoring.md index 5b0ffd07..bd0105c8 100644 --- a/docs/tools/monitoring.md +++ b/docs/tools/monitoring.md @@ -26,6 +26,7 @@ use `kvstore`: docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore ``` + ``` docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657 ``` @@ -71,7 +72,7 @@ Flags: Run `tm-monitor` and visit http://localhost:26670 You should see the list of the available RPC endpoints: -``` +``` http://localhost:26670/status http://localhost:26670/status/network http://localhost:26670/monitor?endpoint=_ diff --git a/docs/yarn.lock b/docs/yarn.lock new file mode 100644 index 00000000..4f453ed4 --- /dev/null +++ b/docs/yarn.lock @@ -0,0 +1,2611 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@azu/format-text@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@azu/format-text/-/format-text-1.0.1.tgz#6967350a94640f6b02855169bd897ce54d6cebe2" + +"@azu/style-format@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@azu/style-format/-/style-format-1.0.0.tgz#e70187f8a862e191b1bce6c0268f13acd3a56b20" + dependencies: + "@azu/format-text" "^1.0.1" + +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" + +"@textlint/ast-node-types@^4.0.2", "@textlint/ast-node-types@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@textlint/ast-node-types/-/ast-node-types-4.0.3.tgz#b51c87bb86022323f764fbdc976b173f19261cc5" + +"@textlint/ast-traverse@^2.0.8", "@textlint/ast-traverse@^2.0.9": + version "2.0.9" + resolved "https://registry.yarnpkg.com/@textlint/ast-traverse/-/ast-traverse-2.0.9.tgz#4bf427cf01b7195013e75d27540a77ad68c363d9" + dependencies: + "@textlint/ast-node-types" "^4.0.3" + +"@textlint/feature-flag@^3.0.4", "@textlint/feature-flag@^3.0.5": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@textlint/feature-flag/-/feature-flag-3.0.5.tgz#3783e0f2661053d2a74fdad775993395a2d530b4" + dependencies: + map-like "^2.0.0" + +"@textlint/fixer-formatter@^3.0.7": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@textlint/fixer-formatter/-/fixer-formatter-3.0.8.tgz#90ef804c60b9e694c8c048a06febbf1f331abd49" + dependencies: + "@textlint/kernel" "^3.0.0" + chalk "^1.1.3" + debug "^2.1.0" + diff "^2.2.2" + interop-require "^1.0.0" + is-file "^1.0.0" + string-width "^1.0.1" + text-table "^0.2.0" + try-resolve "^1.0.1" + +"@textlint/kernel@^2.0.9": + version "2.0.9" + resolved "https://registry.yarnpkg.com/@textlint/kernel/-/kernel-2.0.9.tgz#a4471b7969e192551230c35ea9fae32d80128ee0" + dependencies: + "@textlint/ast-node-types" "^4.0.2" + "@textlint/ast-traverse" "^2.0.8" + "@textlint/feature-flag" "^3.0.4" + "@types/bluebird" "^3.5.18" + bluebird "^3.5.1" + debug "^2.6.6" + deep-equal "^1.0.1" + object-assign "^4.1.1" + structured-source "^3.0.2" + +"@textlint/kernel@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@textlint/kernel/-/kernel-3.0.0.tgz#ba10962acff64f17b9e5fce8089a40f1f8880dcd" + dependencies: + "@textlint/ast-node-types" "^4.0.3" + "@textlint/ast-traverse" "^2.0.9" + "@textlint/feature-flag" "^3.0.5" + "@types/bluebird" "^3.5.18" + bluebird "^3.5.1" + debug "^2.6.6" + deep-equal "^1.0.1" + map-like "^2.0.0" + object-assign "^4.1.1" + structured-source "^3.0.2" + +"@textlint/linter-formatter@^3.0.7": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@textlint/linter-formatter/-/linter-formatter-3.0.8.tgz#030aa03ff3d85dda94ca9fa9e6bf824f9c1cb7ef" + dependencies: + "@azu/format-text" "^1.0.1" + "@azu/style-format" "^1.0.0" + "@textlint/kernel" "^3.0.0" + chalk "^1.0.0" + concat-stream "^1.5.1" + js-yaml "^3.2.4" + optionator "^0.8.1" + pluralize "^2.0.0" + string-width "^1.0.1" + string.prototype.padstart "^3.0.0" + strip-ansi "^3.0.1" + table "^3.7.8" + text-table "^0.2.0" + try-resolve "^1.0.1" + xml-escape "^1.0.0" + +"@textlint/markdown-to-ast@^6.0.8": + version "6.0.9" + resolved "https://registry.yarnpkg.com/@textlint/markdown-to-ast/-/markdown-to-ast-6.0.9.tgz#e7c89e5ad15d17dcd8e5a62758358936827658fa" + dependencies: + "@textlint/ast-node-types" "^4.0.3" + debug "^2.1.3" + remark-frontmatter "^1.2.0" + remark-parse "^5.0.0" + structured-source "^3.0.2" + traverse "^0.6.6" + unified "^6.1.6" + +"@textlint/text-to-ast@^3.0.8": + version "3.0.9" + resolved "https://registry.yarnpkg.com/@textlint/text-to-ast/-/text-to-ast-3.0.9.tgz#dcb63f09cc79ea2096fc823c3b6cd07c79a060b5" + dependencies: + "@textlint/ast-node-types" "^4.0.3" + +"@textlint/textlint-plugin-markdown@^4.0.10": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@textlint/textlint-plugin-markdown/-/textlint-plugin-markdown-4.0.10.tgz#a99b4a308067597e89439a9e87bc1c4a7f4d076b" + dependencies: + "@textlint/markdown-to-ast" "^6.0.8" + +"@textlint/textlint-plugin-text@^3.0.10": + version "3.0.10" + resolved "https://registry.yarnpkg.com/@textlint/textlint-plugin-text/-/textlint-plugin-text-3.0.10.tgz#619600bdc352d33a68e7a73d77d58b0c52b2a44f" + dependencies: + "@textlint/text-to-ast" "^3.0.8" + +"@types/bluebird@^3.5.18": + version "3.5.23" + resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.23.tgz#e805da976b76892b2b2e50eec29e84914c730670" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +adverb-where@0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/adverb-where/-/adverb-where-0.0.9.tgz#09c5cddd8d503b9fe5f76e0b8dc5c70a8f193e34" + +aggregate-error@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-1.0.0.tgz#888344dad0220a72e3af50906117f48771925fac" + dependencies: + clean-stack "^1.0.0" + indent-string "^3.0.0" + +ajv-keywords@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + +ajv@^4.7.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ajv@^5.1.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-iterate@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.2.tgz#f66a57e84426f8097f4197fbb6c051b8e5cdf7d8" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.6.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + +bail@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.3.tgz#63cfb9ddbac829b02a3128cd53224be78e6c21a3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +bluebird@^3.0.5, bluebird@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" + +boundary@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/boundary/-/boundary-1.0.1.tgz#4d67dc2602c0cc16dd9bce7ebf87e948290f5812" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" + +camelcase@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +capture-stack-trace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +ccount@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.3.tgz#f1cec43f332e2ea5a569fd46f9f5bde4e6102aff" + +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +character-entities-html4@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.2.tgz#c44fdde3ce66b52e8d321d6c1bf46101f0150610" + +character-entities-legacy@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz#7c6defb81648498222c9855309953d05f4d63a9c" + +character-entities@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.2.tgz#58c8f371c0774ef0ba9b2aca5f00d8f100e6e363" + +character-reference-invalid@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz#21e421ad3d84055952dab4a43a04e73cd425d3ed" + +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + +chokidar@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +clean-stack@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" + +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + +co@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/co/-/co-3.1.0.tgz#4ea54ea5a08938153185e15210c68d9092bc1b78" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collapse-white-space@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.4.tgz#ce05cf49e54c3277ae573036a26851ba430a0091" + +color-convert@^1.9.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + dependencies: + color-name "1.1.1" + +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + +combined-stream@1.0.6, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug@^2.1.0, debug@^2.1.2, debug@^2.1.3, debug@^2.6.6: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + +deep-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +diff@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99" + +dns-packet@^1.1.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" + dependencies: + ip "^1.1.0" + safe-buffer "^5.0.1" + +dns-socket@^1.6.2: + version "1.6.3" + resolved "https://registry.yarnpkg.com/dns-socket/-/dns-socket-1.6.3.tgz#5268724fad4aa46ad9c5ca4ffcd16e1de5342aab" + dependencies: + dns-packet "^1.1.0" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +e-prime@^0.10.2: + version "0.10.2" + resolved "https://registry.yarnpkg.com/e-prime/-/e-prime-0.10.2.tgz#ea9375eb985636de88013c7a9fb129ad9e15eff8" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.4.3: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@^3.0.0, extend@~3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fault@^1.0.0, fault@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.2.tgz#c3d0fec202f172a3a4d414042ad2bb5e2a3ffbaa" + dependencies: + format "^0.2.2" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +fn-name@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" + dependencies: + asynckit "^0.4.0" + combined-stream "1.0.6" + mime-types "^2.1.12" + +format@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" + +from2@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stream@3.0.0, get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +got@^8.0.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/got/-/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.4.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@^0.4.4: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +ignore@^3.2.0: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + +indent-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +interop-require@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/interop-require/-/interop-require-1.0.0.tgz#e53103679944c88d7e6105b62a9f4475c783971e" + +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + +ip-regex@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + +ip@^1.1.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + +is-absolute-url@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" + +is-alphabetical@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.2.tgz#1fa6e49213cb7885b75d15862fb3f3d96c884f41" + +is-alphanumeric@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" + +is-alphanumerical@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz#1138e9ae5040158dc6ff76b820acd6b7a181fd40" + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.4, is-buffer@^1.1.5, is-buffer@~1.1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-decimal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.2.tgz#894662d6a8709d307f3a276ca4339c8fa5dff0ff" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-empty@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-empty/-/is-empty-1.2.0.tgz#de9bb5b278738a05a0b09a57e1fb4d4a341a9f6b" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-file/-/is-file-1.0.0.tgz#28a44cfbd9d3db193045f22b65fce8edf9620596" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-hexadecimal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz#b6e710d7d07bb66b98cb8cece5c9b4921deeb835" + +is-hidden@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-hidden/-/is-hidden-1.1.1.tgz#82ee6a93aeef3fb007ad5b9457c0584d45329f38" + +is-ip@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-2.0.0.tgz#68eea07e8a0a0a94c2d080dd674c731ab2a461ab" + dependencies: + ip-regex "^2.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" + +is-online@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-online/-/is-online-7.0.0.tgz#7e2408c0ae1e7e37ba8d50bdb237260d32bfd96e" + dependencies: + got "^6.7.1" + p-any "^1.0.0" + p-timeout "^1.0.0" + public-ip "^2.3.0" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-relative-url@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-relative-url/-/is-relative-url-2.0.0.tgz#72902d7fe04b3d4792e7db15f9db84b7204c9cef" + dependencies: + is-absolute-url "^2.0.0" + +is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-stream@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-whitespace-character@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed" + +is-word-character@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.2.tgz#46a5dac3f2a1840898b91e576cd40d493f3ae553" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isemail@^3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.3.tgz#64f37fc113579ea12523165c3ebe3a71a56ce571" + dependencies: + punycode "2.x.x" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + +js-yaml@^3.12.0, js-yaml@^3.2.4, js-yaml@^3.6.1: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + dependencies: + json-buffer "3.0.0" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +link-check@^4.1.0: + version "4.4.4" + resolved "https://registry.yarnpkg.com/link-check/-/link-check-4.4.4.tgz#08dbb881b70c23f1c173889c3a34d682c2e68c1a" + dependencies: + is-relative-url "^2.0.0" + isemail "^3.1.2" + ms "^2.1.1" + request "^2.87.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +load-plugin@^2.0.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/load-plugin/-/load-plugin-2.2.2.tgz#ebc7599491ff33e5077719fbe051d5725a9f7a89" + dependencies: + npm-prefix "^1.2.0" + resolve-from "^4.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.0.0, lodash@^4.17.4: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +longest-streak@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.2.tgz#2421b6ba939a443bb9ffebf596585a50b4c38e2e" + +lowercase-keys@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + +map-like@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/map-like/-/map-like-2.0.0.tgz#94496d49ad333c0dc3234b27adbbd1e8535953b4" + +markdown-escapes@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.2.tgz#e639cbde7b99c841c0bacc8a07982873b46d2122" + +markdown-extensions@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" + +markdown-table@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.2.tgz#c78db948fa879903a41bce522e3b96f801c63786" + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +md5@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + +mdast-util-compact@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz#cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a" + dependencies: + unist-util-modify-children "^1.0.0" + unist-util-visit "^1.1.0" + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" + +mime-types@^2.1.12, mime-types@~2.1.17: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" + dependencies: + mime-db "~1.35.0" + +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + +nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +needle@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +nlcst-to-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/nlcst-to-string/-/nlcst-to-string-2.0.2.tgz#7125af4d4d369850c697192a658f01f36af9937b" + +no-cliches@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/no-cliches/-/no-cliches-0.1.0.tgz#f4eb81a551fecde813f8c611e35e64a5118dc38c" + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" + dependencies: + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.11" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-prefix@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-prefix/-/npm-prefix-1.2.0.tgz#e619455f7074ba54cc66d6d0d37dd9f1be6bcbc0" + dependencies: + rc "^1.1.0" + shellsubstitute "^1.1.0" + untildify "^2.1.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.8: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + +object.assign@^4.0.4: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optionator@^0.8.0, optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-any@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-any/-/p-any-1.1.0.tgz#1d03835c7eed1e34b8e539c47b7b60d0d015d4e1" + dependencies: + p-some "^2.0.0" + +p-cancelable@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-some@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-some/-/p-some-2.0.1.tgz#65d87c8b154edbcf5221d167778b6d2e150f6f06" + dependencies: + aggregate-error "^1.0.0" + +p-timeout@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + dependencies: + p-finally "^1.0.0" + +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" + dependencies: + p-finally "^1.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +parse-entities@^1.0.2, parse-entities@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.2.tgz#9eaf719b29dc3bd62246b4332009072e01527777" + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +passive-voice@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/passive-voice/-/passive-voice-0.1.0.tgz#16ff91ae40ba0e92c43e671763fdc842a70270b1" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-to-glob-pattern@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-to-glob-pattern/-/path-to-glob-pattern-1.0.2.tgz#473e6a3a292a9d13fbae3edccee72d3baba8c619" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pluralize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-2.0.0.tgz#72b726aa6fac1edeee42256c7d8dc256b335677f" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +prettier@^1.13.7: + version "1.14.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +public-ip@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/public-ip/-/public-ip-2.4.0.tgz#f00c028a15366d8c798e47efab6acd09a17666da" + dependencies: + dns-socket "^1.6.2" + got "^8.0.0" + is-ip "^2.0.0" + pify "^3.0.0" + +punycode@2.x.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.5.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +randomatic@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc-config-loader@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/rc-config-loader/-/rc-config-loader-2.0.2.tgz#46eb2f98fb5b2aa7b1119d66c0554de5133f1bc1" + dependencies: + debug "^3.1.0" + js-yaml "^3.12.0" + json5 "^1.0.1" + object-assign "^4.1.0" + object-keys "^1.0.12" + path-exists "^3.0.0" + require-from-string "^2.0.2" + +rc@^1.1.0, rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +remark-cli@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-cli/-/remark-cli-5.0.0.tgz#9feefd06474f3d0ff132df21b5334c546df12ab6" + dependencies: + markdown-extensions "^1.1.0" + remark "^9.0.0" + unified-args "^5.0.0" + +remark-frontmatter@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-1.2.0.tgz#67905d178c0fe531ed12c57b98759f101fc2c1b5" + dependencies: + fault "^1.0.1" + xtend "^4.0.1" + +remark-lint-no-dead-urls@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/remark-lint-no-dead-urls/-/remark-lint-no-dead-urls-0.3.0.tgz#b640ecbb4ccaf780afe28c8d13e79f5dc6769449" + dependencies: + is-online "^7.0.0" + is-relative-url "^2.0.0" + link-check "^4.1.0" + unified-lint-rule "^1.0.1" + unist-util-visit "^1.1.3" + +remark-lint-write-good@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/remark-lint-write-good/-/remark-lint-write-good-1.0.3.tgz#daa4cf122212cfa06e437702ef7b43a12875bd5d" + dependencies: + nlcst-to-string "^2.0.0" + unified-lint-rule "^1.0.1" + unist-util-visit "^1.1.1" + write-good "^0.11.1" + +remark-parse@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" + dependencies: + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^1.1.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^1.0.0" + vfile-location "^2.0.0" + xtend "^4.0.1" + +remark-stringify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-5.0.0.tgz#336d3a4d4a6a3390d933eeba62e8de4bd280afba" + dependencies: + ccount "^1.0.0" + is-alphanumeric "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + longest-streak "^2.0.1" + markdown-escapes "^1.0.0" + markdown-table "^1.1.0" + mdast-util-compact "^1.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + stringify-entities "^1.0.1" + unherit "^1.0.4" + xtend "^4.0.1" + +remark@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-9.0.0.tgz#c5cfa8ec535c73a67c4b0f12bfdbd3a67d8b2f60" + dependencies: + remark-parse "^5.0.0" + remark-stringify "^5.0.0" + unified "^6.0.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +replace-ext@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + +request@^2.87.0: + version "2.87.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" + +rimraf@^2.2.8, rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +shellsubstitute@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shellsubstitute/-/shellsubstitute-1.2.0.tgz#e4f702a50c518b0f6fe98451890d705af29b6b70" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +sliced@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" + +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + +split-lines@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-lines/-/split-lines-1.1.0.tgz#3abba8f598614142f9db8d27ab6ab875662a1e09" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + safer-buffer "^2.0.2" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +state-toggle@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.1.tgz#c3cb0974f40a6a0f8e905b96789eb41afa1cde3a" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + +string-width@^1.0.0, string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.padstart@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padstart/-/string.prototype.padstart-3.0.0.tgz#5bcfad39f4649bb2d031292e19bcf0b510d4b242" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" + function-bind "^1.0.2" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +stringify-entities@^1.0.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.2.tgz#a98417e5471fd227b3e45d3db1861c11caf668f7" + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +structured-source@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/structured-source/-/structured-source-3.0.2.tgz#dd802425e0f53dc4a6e7aca3752901a1ccda7af5" + dependencies: + boundary "^1.0.1" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + dependencies: + has-flag "^2.0.0" + +supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +tar@^4: + version "4.4.6" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +textlint-rule-helper@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/textlint-rule-helper/-/textlint-rule-helper-2.0.0.tgz#95cb4696c95c4258d2e3389e9e64b849f9721382" + dependencies: + unist-util-visit "^1.1.0" + +textlint-rule-stop-words@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/textlint-rule-stop-words/-/textlint-rule-stop-words-1.0.3.tgz#fe2f40cbe5837331b2a09fdec57cc71758093bf0" + dependencies: + lodash "^4.17.4" + split-lines "^1.1.0" + textlint-rule-helper "^2.0.0" + +textlint@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/textlint/-/textlint-10.2.1.tgz#ee22b7967d59cef7c74a04a5f4e8883134e5c79d" + dependencies: + "@textlint/ast-node-types" "^4.0.2" + "@textlint/ast-traverse" "^2.0.8" + "@textlint/feature-flag" "^3.0.4" + "@textlint/fixer-formatter" "^3.0.7" + "@textlint/kernel" "^2.0.9" + "@textlint/linter-formatter" "^3.0.7" + "@textlint/textlint-plugin-markdown" "^4.0.10" + "@textlint/textlint-plugin-text" "^3.0.10" + "@types/bluebird" "^3.5.18" + bluebird "^3.0.5" + debug "^2.1.0" + deep-equal "^1.0.1" + file-entry-cache "^2.0.0" + get-stdin "^5.0.1" + glob "^7.1.1" + interop-require "^1.0.0" + is-file "^1.0.0" + log-symbols "^1.0.2" + map-like "^2.0.0" + md5 "^2.2.1" + mkdirp "^0.5.0" + object-assign "^4.0.1" + optionator "^0.8.0" + path-to-glob-pattern "^1.0.2" + rc-config-loader "^2.0.1" + read-pkg "^1.1.0" + read-pkg-up "^3.0.0" + structured-source "^3.0.2" + try-resolve "^1.0.1" + unique-concat "^0.2.2" + +timed-out@^4.0.0, timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + +to-vfile@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-2.2.0.tgz#342d1705e6df526d569b1fc8bfa29f1f36d6c416" + dependencies: + is-buffer "^1.1.4" + vfile "^2.0.0" + x-is-function "^1.0.4" + +too-wordy@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/too-wordy/-/too-wordy-0.1.4.tgz#8e7b20a7b7a4d8fc3759f4e00c4929993d1b12f0" + +tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +traverse@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + +trim-trailing-lines@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz#e0ec0810fd3c3f1730516b45f49083caaf2774d9" + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + +trough@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.3.tgz#e29bd1614c6458d44869fc28b255ab7857ef7c24" + +try-resolve@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +unherit@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.1.tgz#132748da3e88eab767e08fabfbb89c5e9d28628c" + dependencies: + inherits "^2.0.1" + xtend "^4.0.1" + +unified-args@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/unified-args/-/unified-args-5.1.0.tgz#1889200e072998a662e6e84d817d6f4b5f448dd1" + dependencies: + camelcase "^4.0.0" + chalk "^2.0.0" + chokidar "^1.5.1" + json5 "^0.5.1" + minimist "^1.2.0" + text-table "^0.2.0" + unified-engine "^5.1.0" + +unified-engine@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/unified-engine/-/unified-engine-5.1.0.tgz#30db83bcc76c821f773bb5a8a491aa0e2471e3d1" + dependencies: + concat-stream "^1.5.1" + debug "^3.1.0" + fault "^1.0.0" + fn-name "^2.0.1" + glob "^7.0.3" + ignore "^3.2.0" + is-empty "^1.0.0" + is-hidden "^1.0.1" + is-object "^1.0.1" + js-yaml "^3.6.1" + load-plugin "^2.0.0" + parse-json "^4.0.0" + to-vfile "^2.0.0" + trough "^1.0.0" + unist-util-inspect "^4.1.2" + vfile-reporter "^4.0.0" + vfile-statistics "^1.1.0" + x-is-function "^1.0.4" + x-is-string "^0.1.0" + xtend "^4.0.1" + +unified-lint-rule@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unified-lint-rule/-/unified-lint-rule-1.0.3.tgz#e302b0c4a7ac428c0980e049a500e59528001299" + dependencies: + wrapped "^1.0.1" + +unified@^6.0.0, unified@^6.1.6: + version "6.2.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.2.0.tgz#7fbd630f719126d67d40c644b7e3f617035f6dba" + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-plain-obj "^1.1.0" + trough "^1.0.0" + vfile "^2.0.0" + x-is-string "^0.1.0" + +unique-concat@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/unique-concat/-/unique-concat-0.2.2.tgz#9210f9bdcaacc5e1e3929490d7c019df96f18712" + +unist-util-inspect@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/unist-util-inspect/-/unist-util-inspect-4.1.3.tgz#39470e6d77485db285966df78431219aa1287822" + dependencies: + is-empty "^1.0.0" + +unist-util-is@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.2.tgz#1193fa8f2bfbbb82150633f3a8d2eb9a1c1d55db" + +unist-util-modify-children@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.2.tgz#c7f1b91712554ee59c47a05b551ed3e052a4e2d1" + dependencies: + array-iterate "^1.0.0" + +unist-util-remove-position@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz#86b5dad104d0bbfbeb1db5f5c92f3570575c12cb" + dependencies: + unist-util-visit "^1.1.0" + +unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" + +unist-util-visit-parents@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz#63fffc8929027bee04bfef7d2cce474f71cb6217" + dependencies: + unist-util-is "^2.1.2" + +unist-util-visit@^1.1.0, unist-util-visit@^1.1.1, unist-util-visit@^1.1.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.0.tgz#1cb763647186dc26f5e1df5db6bd1e48b3cc2fb1" + dependencies: + unist-util-visit-parents "^2.0.0" + +untildify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-2.1.0.tgz#17eb2807987f76952e9c0485fc311d06a826a2e0" + dependencies: + os-homedir "^1.0.0" + +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + dependencies: + prepend-http "^2.0.0" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.1.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vfile-location@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.3.tgz#083ba80e50968e8d420be49dd1ea9a992131df77" + +vfile-message@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.0.1.tgz#51a2ccd8a6b97a7980bb34efb9ebde9632e93677" + dependencies: + unist-util-stringify-position "^1.1.1" + +vfile-reporter@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-4.0.0.tgz#ea6f0ae1342f4841573985e05f941736f27de9da" + dependencies: + repeat-string "^1.5.0" + string-width "^1.0.0" + supports-color "^4.1.0" + unist-util-stringify-position "^1.0.0" + vfile-statistics "^1.1.0" + +vfile-statistics@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.1.tgz#a22fd4eb844c9eaddd781ad3b3246db88375e2e3" + +vfile@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" + dependencies: + is-buffer "^1.1.4" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vfile-message "^1.0.0" + +weasel-words@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/weasel-words/-/weasel-words-0.1.1.tgz#7137946585c73fe44882013853bd000c5d687a4e" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrapped@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wrapped/-/wrapped-1.0.1.tgz#c783d9d807b273e9b01e851680a938c87c907242" + dependencies: + co "3.1.0" + sliced "^1.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-good@^0.11.1: + version "0.11.3" + resolved "https://registry.yarnpkg.com/write-good/-/write-good-0.11.3.tgz#8eeb5da9a8e155dafb1325d27eba33cb67d24d8c" + dependencies: + adverb-where "0.0.9" + e-prime "^0.10.2" + no-cliches "^0.1.0" + object.assign "^4.0.4" + passive-voice "^0.1.0" + too-wordy "^0.1.4" + weasel-words "^0.1.1" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +x-is-function@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" + +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + +xml-escape@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xml-escape/-/xml-escape-1.1.0.tgz#3904c143fa8eb3a0030ec646d2902a2f1b706c44" + +xtend@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" From 5f255f0f711e7c5bbbf6932c2349990a37395651 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 27 Aug 2018 14:27:18 +0100 Subject: [PATCH 093/149] Replace db_path with db_dir in default configuration (#2284) * db_path is not being parsed Fix default configuration, db_path is now db_dir. Closes: cosmos/cosmos-sdk#1712 * Update CHANGELOG_PENDING.md --- CHANGELOG_PENDING.md | 2 ++ config/toml.go | 2 +- docs/tendermint-core/configuration.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 36f80992..4ad90b0f 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -26,6 +26,8 @@ IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) +- [config] Replace db_path with db_dir from automatically generated configuration files. + Issue reported to Cosmos SDK ([#1712](https://github.com/cosmos/cosmos-sdk/issues/1712)) BUG FIXES: - [mempool] No longer possible to fill up linked list without getting caching diff --git a/config/toml.go b/config/toml.go index c85609b6..255fa2b5 100644 --- a/config/toml.go +++ b/config/toml.go @@ -81,7 +81,7 @@ fast_sync = {{ .BaseConfig.FastSync }} db_backend = "{{ .BaseConfig.DBBackend }}" # Database directory -db_path = "{{ js .BaseConfig.DBPath }}" +db_dir = "{{ js .BaseConfig.DBPath }}" # Output level for logging, including package level options log_level = "{{ .BaseConfig.LogLevel }}" diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 5b5c4a29..099b9dbd 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -34,7 +34,7 @@ fast_sync = true db_backend = "leveldb" # Database directory -db_path = "data" +db_dir = "data" # Output level for logging log_level = "state:info,*:error" From 8972b6e2935b26ecd4958c98e55770615ea8c60a Mon Sep 17 00:00:00 2001 From: Zach Date: Mon, 27 Aug 2018 21:37:35 -0700 Subject: [PATCH 094/149] Update config.js (#2287) --- docs/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.js b/docs/config.js index db17adfa..65a08d53 100644 --- a/docs/config.js +++ b/docs/config.js @@ -1,7 +1,7 @@ module.exports = { title: "Tendermint Core", description: "Documentation for Tendermint Core", - dest: "./site-docs", + dest: "./dist/docs", base: "/", markdown: { lineNumbers: true From 38b401657e4ad7a7eeb3c30a3cbf512037df3740 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 28 Aug 2018 00:41:40 -0400 Subject: [PATCH 095/149] Cleanup up Multisig naming (#2255) * crypto/multisig: Pubkey -> PubKey * crypto/encoding/amino: use pkg vars for routes * crypto/multisig/bitarray * crypto/multisig: ThresholdMultiSignaturePubKey -> PubKeyMultisigThreshold * crypto/encoding/amino: add PubKeyMultisig to table * remove bA import alias https://github.com/tendermint/tendermint/pull/2255#discussion_r211900709 --- crypto/encoding/amino/amino.go | 12 ++++-- crypto/encoding/amino/encode_test.go | 1 + .../{ => bitarray}/compact_bit_array.go | 2 +- .../{ => bitarray}/compact_bit_array_test.go | 2 +- crypto/multisig/multisignature.go | 9 +++-- ...eshold_multisig.go => threshold_pubkey.go} | 38 +++++++++---------- ...tisig_test.go => threshold_pubkey_test.go} | 24 ++++++------ crypto/multisig/wire.go | 6 +-- 8 files changed, 50 insertions(+), 44 deletions(-) rename crypto/multisig/{ => bitarray}/compact_bit_array.go (99%) rename crypto/multisig/{ => bitarray}/compact_bit_array_test.go (99%) rename crypto/multisig/{threshold_multisig.go => threshold_pubkey.go} (58%) rename crypto/multisig/{threshold_multisig_test.go => threshold_pubkey_test.go} (83%) diff --git a/crypto/encoding/amino/amino.go b/crypto/encoding/amino/amino.go index fd9a0844..7728e6af 100644 --- a/crypto/encoding/amino/amino.go +++ b/crypto/encoding/amino/amino.go @@ -2,8 +2,10 @@ package cryptoAmino import ( amino "github.com/tendermint/go-amino" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/tendermint/tendermint/crypto/multisig" "github.com/tendermint/tendermint/crypto/secp256k1" ) @@ -24,15 +26,17 @@ func RegisterAmino(cdc *amino.Codec) { // These are all written here instead of cdc.RegisterInterface((*crypto.PubKey)(nil), nil) cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, - "tendermint/PubKeyEd25519", nil) + ed25519.PubKeyAminoRoute, nil) cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, - "tendermint/PubKeySecp256k1", nil) + secp256k1.PubKeyAminoRoute, nil) + cdc.RegisterConcrete(multisig.PubKeyMultisigThreshold{}, + multisig.PubKeyMultisigThresholdAminoRoute, nil) cdc.RegisterInterface((*crypto.PrivKey)(nil), nil) cdc.RegisterConcrete(ed25519.PrivKeyEd25519{}, - "tendermint/PrivKeyEd25519", nil) + ed25519.PrivKeyAminoRoute, nil) cdc.RegisterConcrete(secp256k1.PrivKeySecp256k1{}, - "tendermint/PrivKeySecp256k1", nil) + secp256k1.PrivKeyAminoRoute, nil) } func PrivKeyFromBytes(privKeyBytes []byte) (privKey crypto.PrivKey, err error) { diff --git a/crypto/encoding/amino/encode_test.go b/crypto/encoding/amino/encode_test.go index 0581ba64..ea9e9809 100644 --- a/crypto/encoding/amino/encode_test.go +++ b/crypto/encoding/amino/encode_test.go @@ -53,6 +53,7 @@ func ExamplePrintRegisteredTypes() { //| ---- | ---- | ------ | ----- | ------ | //| PubKeyEd25519 | tendermint/PubKeyEd25519 | 0x1624DE64 | 0x20 | | //| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | | + //| PubKeyMultisigThreshold | tendermint/PubKeyMultisigThreshold | 0x22C1F7E2 | variable | | //| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | | //| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | | } diff --git a/crypto/multisig/compact_bit_array.go b/crypto/multisig/bitarray/compact_bit_array.go similarity index 99% rename from crypto/multisig/compact_bit_array.go rename to crypto/multisig/bitarray/compact_bit_array.go index 94e9791c..0152db72 100644 --- a/crypto/multisig/compact_bit_array.go +++ b/crypto/multisig/bitarray/compact_bit_array.go @@ -1,4 +1,4 @@ -package multisig +package bitarray import ( "bytes" diff --git a/crypto/multisig/compact_bit_array_test.go b/crypto/multisig/bitarray/compact_bit_array_test.go similarity index 99% rename from crypto/multisig/compact_bit_array_test.go rename to crypto/multisig/bitarray/compact_bit_array_test.go index 4684ba23..4612ae25 100644 --- a/crypto/multisig/compact_bit_array_test.go +++ b/crypto/multisig/bitarray/compact_bit_array_test.go @@ -1,4 +1,4 @@ -package multisig +package bitarray import ( "encoding/json" diff --git a/crypto/multisig/multisignature.go b/crypto/multisig/multisignature.go index 29e8a30b..0d179689 100644 --- a/crypto/multisig/multisignature.go +++ b/crypto/multisig/multisignature.go @@ -4,12 +4,13 @@ import ( "errors" "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/multisig/bitarray" ) // Multisignature is used to represent the signature object used in the multisigs. // Sigs is a list of signatures, sorted by corresponding index. type Multisignature struct { - BitArray *CompactBitArray + BitArray *bitarray.CompactBitArray Sigs [][]byte } @@ -17,7 +18,7 @@ type Multisignature struct { func NewMultisig(n int) *Multisignature { // Default the signature list to have a capacity of two, since we can // expect that most multisigs will require multiple signers. - return &Multisignature{NewCompactBitArray(n), make([][]byte, 0, 2)} + return &Multisignature{bitarray.NewCompactBitArray(n), make([][]byte, 0, 2)} } // GetIndex returns the index of pk in keys. Returns -1 if not found @@ -52,9 +53,9 @@ func (mSig *Multisignature) AddSignature(sig []byte, index int) { mSig.Sigs[newSigIndex] = sig } -// AddSignatureFromPubkey adds a signature to the multisig, +// AddSignatureFromPubKey adds a signature to the multisig, // at the index in keys corresponding to the provided pubkey. -func (mSig *Multisignature) AddSignatureFromPubkey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) error { +func (mSig *Multisignature) AddSignatureFromPubKey(sig []byte, pubkey crypto.PubKey, keys []crypto.PubKey) error { index := getIndex(pubkey, keys) if index == -1 { return errors.New("provided key didn't exist in pubkeys") diff --git a/crypto/multisig/threshold_multisig.go b/crypto/multisig/threshold_pubkey.go similarity index 58% rename from crypto/multisig/threshold_multisig.go rename to crypto/multisig/threshold_pubkey.go index 58a3ea0e..ca8d4230 100644 --- a/crypto/multisig/threshold_multisig.go +++ b/crypto/multisig/threshold_pubkey.go @@ -5,24 +5,24 @@ import ( "github.com/tendermint/tendermint/crypto/tmhash" ) -// ThresholdMultiSignaturePubKey implements a K of N threshold multisig. -type ThresholdMultiSignaturePubKey struct { +// PubKeyMultisigThreshold implements a K of N threshold multisig. +type PubKeyMultisigThreshold struct { K uint `json:"threshold"` - Pubkeys []crypto.PubKey `json:"pubkeys"` + PubKeys []crypto.PubKey `json:"pubkeys"` } -var _ crypto.PubKey = &ThresholdMultiSignaturePubKey{} +var _ crypto.PubKey = &PubKeyMultisigThreshold{} -// NewThresholdMultiSignaturePubKey returns a new ThresholdMultiSignaturePubKey. +// NewPubKeyMultisigThreshold returns a new PubKeyMultisigThreshold. // Panics if len(pubkeys) < k or 0 >= k. -func NewThresholdMultiSignaturePubKey(k int, pubkeys []crypto.PubKey) crypto.PubKey { +func NewPubKeyMultisigThreshold(k int, pubkeys []crypto.PubKey) crypto.PubKey { if k <= 0 { panic("threshold k of n multisignature: k <= 0") } if len(pubkeys) < k { panic("threshold k of n multisignature: len(pubkeys) < k") } - return &ThresholdMultiSignaturePubKey{uint(k), pubkeys} + return &PubKeyMultisigThreshold{uint(k), pubkeys} } // VerifyBytes expects sig to be an amino encoded version of a MultiSignature. @@ -31,7 +31,7 @@ func NewThresholdMultiSignaturePubKey(k int, pubkeys []crypto.PubKey) crypto.Pub // and all signatures are valid. (Not just k of the signatures) // The multisig uses a bitarray, so multiple signatures for the same key is not // a concern. -func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig []byte) bool { +func (pk *PubKeyMultisigThreshold) VerifyBytes(msg []byte, marshalledSig []byte) bool { var sig *Multisignature err := cdc.UnmarshalBinaryBare(marshalledSig, &sig) if err != nil { @@ -39,7 +39,7 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ } size := sig.BitArray.Size() // ensure bit array is the correct size - if len(pk.Pubkeys) != size { + if len(pk.PubKeys) != size { return false } // ensure size of signature list @@ -54,7 +54,7 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ sigIndex := 0 for i := 0; i < size; i++ { if sig.BitArray.GetIndex(i) { - if !pk.Pubkeys[i].VerifyBytes(msg, sig.Sigs[sigIndex]) { + if !pk.PubKeys[i].VerifyBytes(msg, sig.Sigs[sigIndex]) { return false } sigIndex++ @@ -63,28 +63,28 @@ func (pk *ThresholdMultiSignaturePubKey) VerifyBytes(msg []byte, marshalledSig [ return true } -// Bytes returns the amino encoded version of the ThresholdMultiSignaturePubKey -func (pk *ThresholdMultiSignaturePubKey) Bytes() []byte { +// Bytes returns the amino encoded version of the PubKeyMultisigThreshold +func (pk *PubKeyMultisigThreshold) Bytes() []byte { return cdc.MustMarshalBinaryBare(pk) } -// Address returns tmhash(ThresholdMultiSignaturePubKey.Bytes()) -func (pk *ThresholdMultiSignaturePubKey) Address() crypto.Address { +// Address returns tmhash(PubKeyMultisigThreshold.Bytes()) +func (pk *PubKeyMultisigThreshold) Address() crypto.Address { return crypto.Address(tmhash.Sum(pk.Bytes())) } // Equals returns true iff pk and other both have the same number of keys, and // all constituent keys are the same, and in the same order. -func (pk *ThresholdMultiSignaturePubKey) Equals(other crypto.PubKey) bool { - otherKey, sameType := other.(*ThresholdMultiSignaturePubKey) +func (pk *PubKeyMultisigThreshold) Equals(other crypto.PubKey) bool { + otherKey, sameType := other.(*PubKeyMultisigThreshold) if !sameType { return false } - if pk.K != otherKey.K || len(pk.Pubkeys) != len(otherKey.Pubkeys) { + if pk.K != otherKey.K || len(pk.PubKeys) != len(otherKey.PubKeys) { return false } - for i := 0; i < len(pk.Pubkeys); i++ { - if !pk.Pubkeys[i].Equals(otherKey.Pubkeys[i]) { + for i := 0; i < len(pk.PubKeys); i++ { + if !pk.PubKeys[i].Equals(otherKey.PubKeys[i]) { return false } } diff --git a/crypto/multisig/threshold_multisig_test.go b/crypto/multisig/threshold_pubkey_test.go similarity index 83% rename from crypto/multisig/threshold_multisig_test.go rename to crypto/multisig/threshold_pubkey_test.go index 2d2fdeec..bfc874eb 100644 --- a/crypto/multisig/threshold_multisig_test.go +++ b/crypto/multisig/threshold_pubkey_test.go @@ -34,30 +34,30 @@ func TestThresholdMultisigValidCases(t *testing.T) { }, } for tcIndex, tc := range cases { - multisigKey := NewThresholdMultiSignaturePubKey(tc.k, tc.pubkeys) + multisigKey := NewPubKeyMultisigThreshold(tc.k, tc.pubkeys) multisignature := NewMultisig(len(tc.pubkeys)) for i := 0; i < tc.k-1; i++ { signingIndex := tc.signingIndices[i] - multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + multisignature.AddSignatureFromPubKey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) require.False(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), "multisig passed when i < k, tc %d, i %d", tcIndex, i) - multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + multisignature.AddSignatureFromPubKey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) require.Equal(t, i+1, len(multisignature.Sigs), "adding a signature for the same pubkey twice increased signature count by 2, tc %d", tcIndex) } require.False(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), "multisig passed with k - 1 sigs, tc %d", tcIndex) - multisignature.AddSignatureFromPubkey(tc.signatures[tc.signingIndices[tc.k]], tc.pubkeys[tc.signingIndices[tc.k]], tc.pubkeys) + multisignature.AddSignatureFromPubKey(tc.signatures[tc.signingIndices[tc.k]], tc.pubkeys[tc.signingIndices[tc.k]], tc.pubkeys) require.True(t, multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), "multisig failed after k good signatures, tc %d", tcIndex) for i := tc.k + 1; i < len(tc.signingIndices); i++ { signingIndex := tc.signingIndices[i] - multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + multisignature.AddSignatureFromPubKey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) require.Equal(t, tc.passAfterKSignatures[i-tc.k-1], multisigKey.VerifyBytes(tc.msg, multisignature.Marshal()), "multisig didn't verify as expected after k sigs, tc %d, i %d", tcIndex, i) - multisignature.AddSignatureFromPubkey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) + multisignature.AddSignatureFromPubKey(tc.signatures[signingIndex], tc.pubkeys[signingIndex], tc.pubkeys) require.Equal(t, i+1, len(multisignature.Sigs), "adding a signature for the same pubkey twice increased signature count by 2, tc %d", tcIndex) } @@ -68,21 +68,21 @@ func TestThresholdMultisigValidCases(t *testing.T) { func TestThresholdMultisigDuplicateSignatures(t *testing.T) { msg := []byte{1, 2, 3, 4, 5} pubkeys, sigs := generatePubKeysAndSignatures(5, msg) - multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) + multisigKey := NewPubKeyMultisigThreshold(2, pubkeys) multisignature := NewMultisig(5) require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) - multisignature.AddSignatureFromPubkey(sigs[0], pubkeys[0], pubkeys) + multisignature.AddSignatureFromPubKey(sigs[0], pubkeys[0], pubkeys) // Add second signature manually multisignature.Sigs = append(multisignature.Sigs, sigs[0]) require.False(t, multisigKey.VerifyBytes(msg, multisignature.Marshal())) } // TODO: Fully replace this test with table driven tests -func TestMultiSigPubkeyEquality(t *testing.T) { +func TestMultiSigPubKeyEquality(t *testing.T) { msg := []byte{1, 2, 3, 4} pubkeys, _ := generatePubKeysAndSignatures(5, msg) - multisigKey := NewThresholdMultiSignaturePubKey(2, pubkeys) - var unmarshalledMultisig *ThresholdMultiSignaturePubKey + multisigKey := NewPubKeyMultisigThreshold(2, pubkeys) + var unmarshalledMultisig *PubKeyMultisigThreshold cdc.MustUnmarshalBinaryBare(multisigKey.Bytes(), &unmarshalledMultisig) require.True(t, multisigKey.Equals(unmarshalledMultisig)) @@ -91,7 +91,7 @@ func TestMultiSigPubkeyEquality(t *testing.T) { copy(pubkeysCpy, pubkeys) pubkeysCpy[4] = pubkeys[3] pubkeysCpy[3] = pubkeys[4] - multisigKey2 := NewThresholdMultiSignaturePubKey(2, pubkeysCpy) + multisigKey2 := NewPubKeyMultisigThreshold(2, pubkeysCpy) require.False(t, multisigKey.Equals(multisigKey2)) } diff --git a/crypto/multisig/wire.go b/crypto/multisig/wire.go index 4c48c664..68b84fbf 100644 --- a/crypto/multisig/wire.go +++ b/crypto/multisig/wire.go @@ -10,15 +10,15 @@ import ( // TODO: Figure out API for others to either add their own pubkey types, or // to make verify / marshal accept a cdc. const ( - ThresholdPubkeyAminoRoute = "tendermint/PubkeyMultisigThreshold" + PubKeyMultisigThresholdAminoRoute = "tendermint/PubKeyMultisigThreshold" ) var cdc = amino.NewCodec() func init() { cdc.RegisterInterface((*crypto.PubKey)(nil), nil) - cdc.RegisterConcrete(ThresholdMultiSignaturePubKey{}, - ThresholdPubkeyAminoRoute, nil) + cdc.RegisterConcrete(PubKeyMultisigThreshold{}, + PubKeyMultisigThresholdAminoRoute, nil) cdc.RegisterConcrete(ed25519.PubKeyEd25519{}, ed25519.PubKeyAminoRoute, nil) cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{}, From b1bc3e4f894c840d7b311af28fc9e1c58bbc8769 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 27 Aug 2018 22:32:54 -0700 Subject: [PATCH 096/149] =?UTF-8?q?crypto/secp256k1:=20Fix=20signature=20m?= =?UTF-8?q?alleability,=20adopt=20more=20efficient=20en=E2=80=A6=20(#2239)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * crypto/secp256k1: Fix signature malleability, adopt more efficient encoding This removes signature malleability per ADR 14, and makes secp match the encoding in ADR 15. * (squash this) add lock --- CHANGELOG_PENDING.md | 2 + Gopkg.lock | 49 +++++++++++-------- Gopkg.toml | 4 ++ crypto/encoding/amino/encode_test.go | 8 +-- crypto/secp256k1/secp256k1.go | 6 ++- crypto/secp256k1/secpk256k1_test.go | 2 +- .../architecture/adr-014-secp-malleability.md | 2 +- docs/architecture/adr-015-crypto-encoding.md | 3 +- 8 files changed, 46 insertions(+), 30 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 4ad90b0f..0b31025c 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -14,6 +14,8 @@ BREAKING CHANGES: - [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. - [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers - [node] NewNode now accepts a `*p2p.NodeKey` +- [crypto] Secp256k1 signature format changed from DER to `r || s`, both little endian encoded as 32 bytes. +- [crypto] Secp256k1 signature malleability removed by requiring s to be in canonical form. (See ADR 14) - [abci] \#2159 Update use of `Validator` ala ADR-018: - Remove PubKey from `Validator` and introduce `ValidatorUpdate` - InitChain and EndBlock use ValidatorUpdate diff --git a/Gopkg.lock b/Gopkg.lock index 270e9c5c..012bf2ed 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,14 +11,14 @@ [[projects]] branch = "master" - digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" + digest = "1:6aabc1566d6351115d561d038da82a4c19b46c3b6e17f4a0a2fa60260663dc79" name = "github.com/btcsuite/btcd" packages = ["btcec"] pruneopts = "UT" revision = "f5e261fc9ec3437697fb31d8b38453c293204b29" [[projects]] - digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" + digest = "1:df684ed7fed3fb406ec421424aaf5fc9c63ccc2f428b25b842da78e634482e4b" name = "github.com/btcsuite/btcutil" packages = [ "base58", @@ -59,7 +59,7 @@ version = "v1.4.7" [[projects]] - digest = "1:fdf5169073fb0ad6dc12a70c249145e30f4058647bea25f0abd48b6d9f228a11" + digest = "1:fa30c0652956e159cdb97dcb2ef8b8db63ed668c02a5c3a40961c8f0641252fe" name = "github.com/go-kit/kit" packages = [ "log", @@ -91,7 +91,7 @@ version = "v1.7.0" [[projects]] - digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" + digest = "1:212285efb97b9ec2e20550d81f0446cb7897e57cbdfd7301b1363ab113d8be45" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -106,7 +106,7 @@ version = "v1.1.1" [[projects]] - digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" + digest = "1:cb22af0ed7c72d495d8be1106233ee553898950f15fd3f5404406d44c2e86888" name = "github.com/golang/protobuf" packages = [ "proto", @@ -137,7 +137,7 @@ [[projects]] branch = "master" - digest = "1:12247a2e99a060cc692f6680e5272c8adf0b8f572e6bce0d7095e624c958a240" + digest = "1:8951fe6e358876736d8fa1f3992624fdbb2dec6bc49401c1381d1ef8abbb544f" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -225,7 +225,7 @@ version = "v1.0.0" [[projects]] - digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" + digest = "1:98225904b7abff96c052b669b25788f18225a36673fba022fb93514bb9a2a64e" name = "github.com/prometheus/client_golang" packages = [ "prometheus", @@ -236,7 +236,7 @@ [[projects]] branch = "master" - digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" + digest = "1:0f37e09b3e92aaeda5991581311f8dbf38944b36a3edec61cc2d1991f527554a" name = "github.com/prometheus/client_model" packages = ["go"] pruneopts = "UT" @@ -244,7 +244,7 @@ [[projects]] branch = "master" - digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" + digest = "1:dad2e5a2153ee7a6c9ab8fc13673a16ee4fb64434a7da980965a3741b0c981a3" name = "github.com/prometheus/common" packages = [ "expfmt", @@ -256,7 +256,7 @@ [[projects]] branch = "master" - digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" + digest = "1:a37c98f4b7a66bb5c539c0539f0915a74ef1c8e0b3b6f45735289d94cae92bfd" name = "github.com/prometheus/procfs" packages = [ ".", @@ -275,7 +275,7 @@ revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" + digest = "1:37ace7f35375adec11634126944bdc45a673415e2fcc07382d03b75ec76ea94c" name = "github.com/spf13/afero" packages = [ ".", @@ -294,7 +294,7 @@ version = "v1.2.0" [[projects]] - digest = "1:7ffc0983035bc7e297da3688d9fe19d60a420e9c38bef23f845c53788ed6a05e" + digest = "1:627ab2f549a6a55c44f46fa24a4307f4d0da81bfc7934ed0473bf38b24051d26" name = "github.com/spf13/cobra" packages = ["."] pruneopts = "UT" @@ -326,7 +326,7 @@ version = "v1.0.0" [[projects]] - digest = "1:7e8d267900c7fa7f35129a2a37596e38ed0f11ca746d6d9ba727980ee138f9f6" + digest = "1:73697231b93fb74a73ebd8384b68b9a60c57ea6b13c56d2425414566a72c8e6d" name = "github.com/stretchr/testify" packages = [ "assert", @@ -338,7 +338,7 @@ [[projects]] branch = "master" - digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" + digest = "1:922191411ad8f61bcd8018ac127589bb489712c1d1a0ab2497aca4b16de417d2" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -357,9 +357,16 @@ pruneopts = "UT" revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445" +[[projects]] + digest = "1:34a30b75b54e4b73090d0cafc7884950f020272e36813201ba3860822c46c6dd" + name = "github.com/tendermint/btcd" + packages = ["btcec"] + pruneopts = "UT" + revision = "e5840949ff4fff0c56f9b6a541e22b63581ea9df" + [[projects]] branch = "master" - digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" + digest = "1:203b409c21115233a576f99e8f13d8e07ad82b25500491f7e1cca12588fb3232" name = "github.com/tendermint/ed25519" packages = [ ".", @@ -379,7 +386,7 @@ [[projects]] branch = "master" - digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" + digest = "1:df132ec33d5acb4a1ab58d637f1bc3557be49456ca59b9198f5c1e7fa32e0d31" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -401,7 +408,7 @@ revision = "56440b844dfe139a8ac053f4ecac0b20b79058f4" [[projects]] - digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" + digest = "1:04dda8391c3e2397daf254ac68003f30141c069b228d06baec8324a5f81dc1e9" name = "golang.org/x/net" packages = [ "context", @@ -418,7 +425,7 @@ [[projects]] branch = "master" - digest = "1:bb0fe59917bdd5b89f49b9a8b26e5f465e325d9223b3a8e32254314bdf51e0f1" + digest = "1:70656e26ab4a96e683a21d677630edb5239a3d60b2d54bdc861c808ab5aa42c7" name = "golang.org/x/sys" packages = [ "cpu", @@ -428,7 +435,7 @@ revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" [[projects]] - digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" + digest = "1:7509ba4347d1f8de6ae9be8818b0cd1abc3deeffe28aeaf4be6d4b6b5178d9ca" name = "golang.org/x/text" packages = [ "collate", @@ -459,7 +466,7 @@ revision = "daca94659cb50e9f37c1b834680f2e46358f10b0" [[projects]] - digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" + digest = "1:4515e3030c440845b046354fd5d57671238428b820deebce2e9dabb5cd3c51ac" name = "google.golang.org/grpc" packages = [ ".", @@ -504,7 +511,6 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ - "github.com/btcsuite/btcd/btcec", "github.com/btcsuite/btcutil/base58", "github.com/btcsuite/btcutil/bech32", "github.com/ebuchman/fail-test", @@ -536,6 +542,7 @@ "github.com/syndtr/goleveldb/leveldb/errors", "github.com/syndtr/goleveldb/leveldb/iterator", "github.com/syndtr/goleveldb/leveldb/opt", + "github.com/tendermint/btcd/btcec", "github.com/tendermint/ed25519", "github.com/tendermint/ed25519/extra25519", "github.com/tendermint/go-amino", diff --git a/Gopkg.toml b/Gopkg.toml index e61a37f2..d3bca19e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -85,6 +85,10 @@ name = "github.com/btcsuite/btcutil" revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4" +[[constraint]] + name = "github.com/tendermint/btcd" + revision = "e5840949ff4fff0c56f9b6a541e22b63581ea9df" + # Haven't made a release since 2016. [[constraint]] name = "github.com/prometheus/client_golang" diff --git a/crypto/encoding/amino/encode_test.go b/crypto/encoding/amino/encode_test.go index ea9e9809..7235ba69 100644 --- a/crypto/encoding/amino/encode_test.go +++ b/crypto/encoding/amino/encode_test.go @@ -60,18 +60,20 @@ func ExamplePrintRegisteredTypes() { func TestKeyEncodings(t *testing.T) { cases := []struct { - privKey crypto.PrivKey - privSize, pubSize int // binary sizes + privKey crypto.PrivKey + privSize, pubSize, sigSize int // binary sizes }{ { privKey: ed25519.GenPrivKey(), privSize: 69, pubSize: 37, + sigSize: 65, }, { privKey: secp256k1.GenPrivKey(), privSize: 37, pubSize: 38, + sigSize: 65, }, } @@ -88,7 +90,7 @@ func TestKeyEncodings(t *testing.T) { var sig1, sig2 []byte sig1, err := tc.privKey.Sign([]byte("something")) assert.NoError(t, err, "tc #%d", tcIndex) - checkAminoBinary(t, sig1, &sig2, -1) // Signature size changes for Secp anyways. + checkAminoBinary(t, sig1, &sig2, tc.sigSize) assert.EqualValues(t, sig1, sig2, "tc #%d", tcIndex) // Check (de/en)codings of PubKeys. diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index 0e9ed853..2c64d1e9 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -7,7 +7,7 @@ import ( "fmt" "io" - secp256k1 "github.com/btcsuite/btcd/btcec" + secp256k1 "github.com/tendermint/btcd/btcec" amino "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/crypto" "golang.org/x/crypto/ripemd160" @@ -141,10 +141,12 @@ func (pubKey PubKeySecp256k1) VerifyBytes(msg []byte, sig []byte) bool { if err != nil { return false } - parsedSig, err := secp256k1.ParseDERSignature(sig[:], secp256k1.S256()) + parsedSig, err := secp256k1.ParseSignature(sig[:], secp256k1.S256()) if err != nil { return false } + // Underlying library ensures that this signature is in canonical form, to + // prevent Secp256k1 malleability from altering the sign of the s term. return parsedSig.Verify(crypto.Sha256(msg), pub) } diff --git a/crypto/secp256k1/secpk256k1_test.go b/crypto/secp256k1/secpk256k1_test.go index 0f0b5adc..2fa48301 100644 --- a/crypto/secp256k1/secpk256k1_test.go +++ b/crypto/secp256k1/secpk256k1_test.go @@ -11,7 +11,7 @@ import ( "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/secp256k1" - underlyingSecp256k1 "github.com/btcsuite/btcd/btcec" + underlyingSecp256k1 "github.com/tendermint/btcd/btcec" ) type keyData struct { diff --git a/docs/architecture/adr-014-secp-malleability.md b/docs/architecture/adr-014-secp-malleability.md index ce84c7eb..e6014c09 100644 --- a/docs/architecture/adr-014-secp-malleability.md +++ b/docs/architecture/adr-014-secp-malleability.md @@ -47,7 +47,7 @@ Fork https://github.com/btcsuite/btcd, and just update the [parse sig method](ht ## Status -Proposed. +Implemented ## Consequences diff --git a/docs/architecture/adr-015-crypto-encoding.md b/docs/architecture/adr-015-crypto-encoding.md index f6818d5d..665129f1 100644 --- a/docs/architecture/adr-015-crypto-encoding.md +++ b/docs/architecture/adr-015-crypto-encoding.md @@ -67,8 +67,7 @@ This is basically Ethereum's encoding, but without the leading recovery bit. ## Status -Proposed. The signature section seems to be agreed upon for the most part. -Needs decision on Enum types. +Implemented ## Consequences From 9d06d7e3064a2fd17376334e18e672212c447797 Mon Sep 17 00:00:00 2001 From: Ismail Khoffi Date: Tue, 28 Aug 2018 06:37:38 +0100 Subject: [PATCH 097/149] update secret connection to use a little endian encoded nonce (#2264) * update secret connection to use a little endian encoded nonce * update encoding of chunk length to be little endian, too * update comment * Change comment slightly to trigger circelci --- p2p/conn/secret_connection.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/p2p/conn/secret_connection.go b/p2p/conn/secret_connection.go index 75199ee6..3628eb4a 100644 --- a/p2p/conn/secret_connection.go +++ b/p2p/conn/secret_connection.go @@ -123,7 +123,7 @@ func (sc *SecretConnection) Write(data []byte) (n int, err error) { data = nil } chunkLength := len(chunk) - binary.BigEndian.PutUint32(frame, uint32(chunkLength)) + binary.LittleEndian.PutUint32(frame, uint32(chunkLength)) copy(frame[dataLenSize:], chunk) aead, err := chacha20poly1305.New(sc.sendSecret[:]) @@ -172,7 +172,7 @@ func (sc *SecretConnection) Read(data []byte) (n int, err error) { incrNonce(sc.recvNonce) // end decryption - var chunkLength = binary.BigEndian.Uint32(frame) // read the first two bytes + var chunkLength = binary.LittleEndian.Uint32(frame) // read the first four bytes if chunkLength > dataMaxSize { return 0, errors.New("chunkLength is greater than dataMaxSize") } @@ -332,13 +332,12 @@ func shareAuthSignature(sc *SecretConnection, pubKey crypto.PubKey, signature [] //-------------------------------------------------------------------------------- -// increment nonce big-endian by 1 with wraparound. +// Increment nonce little-endian by 1 with wraparound. +// Due to chacha20poly1305 expecting a 12 byte nonce we do not use the first four +// bytes. We only increment a 64 bit unsigned int in the remaining 8 bytes +// (little-endian in nonce[4:]). func incrNonce(nonce *[aeadNonceSize]byte) { - for i := aeadNonceSize - 1; 0 <= i; i-- { - nonce[i]++ - // if this byte wrapped around to zero, we need to increment the next byte - if nonce[i] != 0 { - return - } - } + counter := binary.LittleEndian.Uint64(nonce[4:]) + counter++ + binary.LittleEndian.PutUint64(nonce[4:], counter) } From bd531401a0ed903ace22f1154408360984323500 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 28 Aug 2018 21:10:06 -0700 Subject: [PATCH 098/149] mempool: Store txs by hash inside of cache (#2234) * mempool: Store txs by hash inside of cache This allows for large cachesizes, without fear of the memory consumption growing rapidly. * (squash this) rename hashedTx -> txHash --- CHANGELOG_PENDING.md | 1 + docs/spec/reactors/mempool/functionality.md | 10 ++++++-- mempool/mempool.go | 28 ++++++++++++--------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 0b31025c..15576a4e 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -28,6 +28,7 @@ IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) +- [mempool] Now stores txs by hash inside of the cache, to mitigate memory leakage - [config] Replace db_path with db_dir from automatically generated configuration files. Issue reported to Cosmos SDK ([#1712](https://github.com/cosmos/cosmos-sdk/issues/1712)) diff --git a/docs/spec/reactors/mempool/functionality.md b/docs/spec/reactors/mempool/functionality.md index 8c9847e8..4f811801 100644 --- a/docs/spec/reactors/mempool/functionality.md +++ b/docs/spec/reactors/mempool/functionality.md @@ -32,5 +32,11 @@ What guarantees does it need from the ABCI app? ## Optimizations -Talk about the LRU cache to make sure we don't process any -tx that we have seen before +The implementation within this library also implements a tx cache. +This is so that signatures don't have to be reverified if the tx has +already been seen before. +However, we only store valid txs in the cache, not invalid ones. +This is because invalid txs could become good later. +Txs that are included in a block aren't removed from the cache, +as they still may be getting received over the p2p network. +These txs are stored in the cache by their hash, to mitigate memory concerns. \ No newline at end of file diff --git a/mempool/mempool.go b/mempool/mempool.go index f336585b..b86dd81f 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -3,6 +3,7 @@ package mempool import ( "bytes" "container/list" + "crypto/sha256" "fmt" "sync" "sync/atomic" @@ -484,11 +485,12 @@ type txCache interface { Remove(tx types.Tx) } -// mapTxCache maintains a cache of transactions. +// mapTxCache maintains a cache of transactions. This only stores +// the hash of the tx, due to memory concerns. type mapTxCache struct { mtx sync.Mutex size int - map_ map[string]*list.Element + map_ map[[sha256.Size]byte]*list.Element list *list.List // to remove oldest tx when cache gets too big } @@ -498,7 +500,7 @@ var _ txCache = (*mapTxCache)(nil) func newMapTxCache(cacheSize int) *mapTxCache { return &mapTxCache{ size: cacheSize, - map_: make(map[string]*list.Element, cacheSize), + map_: make(map[[sha256.Size]byte]*list.Element, cacheSize), list: list.New(), } } @@ -506,7 +508,7 @@ func newMapTxCache(cacheSize int) *mapTxCache { // Reset resets the cache to an empty state. func (cache *mapTxCache) Reset() { cache.mtx.Lock() - cache.map_ = make(map[string]*list.Element, cache.size) + cache.map_ = make(map[[sha256.Size]byte]*list.Element, cache.size) cache.list.Init() cache.mtx.Unlock() } @@ -517,29 +519,31 @@ func (cache *mapTxCache) Push(tx types.Tx) bool { cache.mtx.Lock() defer cache.mtx.Unlock() - if _, exists := cache.map_[string(tx)]; exists { + // Use the tx hash in the cache + txHash := sha256.Sum256(tx) + if _, exists := cache.map_[txHash]; exists { return false } if cache.list.Len() >= cache.size { popped := cache.list.Front() - poppedTx := popped.Value.(types.Tx) - delete(cache.map_, string(poppedTx)) + poppedTxHash := popped.Value.([sha256.Size]byte) + delete(cache.map_, poppedTxHash) if popped != nil { cache.list.Remove(popped) } } - cache.list.PushBack(tx) - cache.map_[string(tx)] = cache.list.Back() + cache.list.PushBack(txHash) + cache.map_[txHash] = cache.list.Back() return true } // Remove removes the given tx from the cache. func (cache *mapTxCache) Remove(tx types.Tx) { cache.mtx.Lock() - stx := string(tx) - popped := cache.map_[stx] - delete(cache.map_, stx) + txHash := sha256.Sum256(tx) + popped := cache.map_[txHash] + delete(cache.map_, txHash) if popped != nil { cache.list.Remove(popped) } From c43fb700e39326bf384f6a9077d92ad303f4188e Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Wed, 29 Aug 2018 05:44:55 +0100 Subject: [PATCH 099/149] New NewGoLevelDBWithOpts() to pass opts down to goleveldb (#2293) Closes: #2292 --- CHANGELOG_PENDING.md | 1 + libs/db/go_level_db.go | 6 +++++- libs/db/go_level_db_test.go | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 15576a4e..6f594f69 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -23,6 +23,7 @@ BREAKING CHANGES: FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) +- [libs] allow passing options through when creating instances of leveldb dbs ([#2292](https://github.com/tendermint/tendermint/issues/2292)) IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. diff --git a/libs/db/go_level_db.go b/libs/db/go_level_db.go index 349e447b..8a488792 100644 --- a/libs/db/go_level_db.go +++ b/libs/db/go_level_db.go @@ -28,8 +28,12 @@ type GoLevelDB struct { } func NewGoLevelDB(name string, dir string) (*GoLevelDB, error) { + return NewGoLevelDBWithOpts(name, dir, nil) +} + +func NewGoLevelDBWithOpts(name string, dir string, o *opt.Options) (*GoLevelDB, error) { dbPath := filepath.Join(dir, name+".db") - db, err := leveldb.OpenFile(dbPath, nil) + db, err := leveldb.OpenFile(dbPath, o) if err != nil { return nil, err } diff --git a/libs/db/go_level_db_test.go b/libs/db/go_level_db_test.go index e262fccd..2b234658 100644 --- a/libs/db/go_level_db_test.go +++ b/libs/db/go_level_db_test.go @@ -6,9 +6,30 @@ import ( "fmt" "testing" + "github.com/syndtr/goleveldb/leveldb/opt" + + "github.com/stretchr/testify/require" cmn "github.com/tendermint/tendermint/libs/common" ) +func TestNewGoLevelDB(t *testing.T) { + name := fmt.Sprintf("test_%x", cmn.RandStr(12)) + // Test write locks + db, err := NewGoLevelDB(name, "") + require.Nil(t, err) + _, err = NewGoLevelDB(name, "") + require.NotNil(t, err) + db.Close() // Close the db to release the lock + + // Open the db twice in a row to test read-only locks + ro1, err := NewGoLevelDBWithOpts(name, "", &opt.Options{ReadOnly: true}) + defer ro1.Close() + require.Nil(t, err) + ro2, err := NewGoLevelDBWithOpts(name, "", &opt.Options{ReadOnly: true}) + defer ro2.Close() + require.Nil(t, err) +} + func BenchmarkRandomReadsWrites(b *testing.B) { b.StopTimer() From 3a6cc5e6afc122b7242686ae32276035ac5f8ef6 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Aug 2018 10:11:33 +0400 Subject: [PATCH 100/149] cache codecov script (#2291) --- .circleci/codecov.sh | 1550 ++++++++++++++++++++++++++++++++++++++++++ .circleci/config.yml | 2 +- 2 files changed, 1551 insertions(+), 1 deletion(-) create mode 100644 .circleci/codecov.sh diff --git a/.circleci/codecov.sh b/.circleci/codecov.sh new file mode 100644 index 00000000..1ef332b1 --- /dev/null +++ b/.circleci/codecov.sh @@ -0,0 +1,1550 @@ +#!/usr/bin/env bash + +# Apache License Version 2.0, January 2004 +# https://github.com/codecov/codecov-bash/blob/master/LICENSE + + +set -e +o pipefail + +VERSION="0b37652" + +url="https://codecov.io" +env="$CODECOV_ENV" +service="" +token="" +search_in="" +flags="" +exit_with=0 +curlargs="" +curlawsargs="" +dump="0" +clean="0" +curl_s="-s" +name="$CODECOV_NAME" +include_cov="" +exclude_cov="" +ddp="$(echo ~)/Library/Developer/Xcode/DerivedData" +xp="" +files="" +cacert="$CODECOV_CA_BUNDLE" +gcov_ignore="-not -path './bower_components/**' -not -path './node_modules/**' -not -path './vendor/**'" +gcov_include="" + +ft_gcov="1" +ft_coveragepy="1" +ft_fix="1" +ft_search="1" +ft_s3="1" +ft_network="1" +ft_xcodellvm="1" +ft_xcodeplist="0" + +_git_root=$(git rev-parse --show-toplevel 2>/dev/null || hg root 2>/dev/null || echo $PWD) +git_root="$_git_root" +codecov_yml="" +remote_addr="" +if [ "$git_root" = "$PWD" ]; +then + git_root="." +fi + +url_o="" +pr_o="" +build_o="" +commit_o="" +search_in_o="" +tag_o="" +branch_o="" +slug_o="" +prefix_o="" + +commit="$VCS_COMMIT_ID" +branch="$VCS_BRANCH_NAME" +pr="$VCS_PULL_REQUEST" +slug="$VCS_SLUG" +tag="$VCS_TAG" +build_url="$CI_BUILD_URL" +build="$CI_BUILD_ID" +job="$CI_JOB_ID" + +beta_xcode_partials="" + +proj_root="$git_root" +gcov_exe="gcov" +gcov_arg="" + +b="\033[0;36m" +g="\033[0;32m" +r="\033[0;31m" +e="\033[0;90m" +x="\033[0m" + +show_help() { +cat << EOF + + Codecov Bash $VERSION + + Global report uploading tool for Codecov + Documentation at https://docs.codecov.io/docs + Contribute at https://github.com/codecov/codecov-bash + + + -h Display this help and exit + -f FILE Target file(s) to upload + + -f "path/to/file" only upload this file + skips searching unless provided patterns below + + -f '!*.bar' ignore all files at pattern *.bar + -f '*.foo' include all files at pattern *.foo + Must use single quotes. + This is non-exclusive, use -s "*.foo" to match specific paths. + + -s DIR Directory to search for coverage reports. + Already searches project root and artifact folders. + -t TOKEN Set the private repository token + (option) set environment variable CODECOV_TOKEN=:uuid + + -t @/path/to/token_file + -t uuid + + -n NAME Custom defined name of the upload. Visible in Codecov UI + + -e ENV Specify environment variables to be included with this build + Also accepting environment variables: CODECOV_ENV=VAR,VAR2 + + -e VAR,VAR2 + + -X feature Toggle functionalities + + -X gcov Disable gcov + -X coveragepy Disable python coverage + -X fix Disable report fixing + -X search Disable searching for reports + -X xcode Disable xcode processing + -X network Disable uploading the file network + + -R root dir Used when not in git/hg project to identify project root directory + -y conf file Used to specify the location of the .codecov.yml config file + -F flag Flag the upload to group coverage metrics + + -F unittests This upload is only unittests + -F integration This upload is only integration tests + -F ui,chrome This upload is Chrome - UI tests + + -c Move discovered coverage reports to the trash + -Z Exit with 1 if not successful. Default will Exit with 0 + + -- xcode -- + -D Custom Derived Data Path for Coverage.profdata and gcov processing + Default '~/Library/Developer/Xcode/DerivedData' + -J Specify packages to build coverage. + This can significantly reduces time to build coverage reports. + + -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" + -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" + + -- gcov -- + -g GLOB Paths to ignore during gcov gathering + -G GLOB Paths to include during gcov gathering + -p dir Project root directory + Also used when preparing gcov + -k prefix Prefix filepaths to help resolve path fixing: https://github.com/codecov/support/issues/472 + -x gcovexe gcov executable to run. Defaults to 'gcov' + -a gcovargs extra arguments to pass to gcov + + -- Override CI Environment Variables -- + These variables are automatically detected by popular CI providers + + -B branch Specify the branch name + -C sha Specify the commit sha + -P pr Specify the pull request number + -b build Specify the build number + -T tag Specify the git tag + + -- Enterprise -- + -u URL Set the target url for Enterprise customers + Not required when retrieving the bash uploader from your CCE + (option) Set environment variable CODECOV_URL=https://my-hosted-codecov.com + -r SLUG owner/repo slug used instead of the private repo token in Enterprise + (option) set environment variable CODECOV_SLUG=:owner/:repo + (option) set in your codecov.yml "codecov.slug" + -S PATH File path to your cacert.pem file used to verify ssl with Codecov Enterprise (optional) + (option) Set environment variable: CODECOV_CA_BUNDLE="/path/to/ca.pem" + -U curlargs Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy" + -A curlargs Extra curl arguments to communicate with AWS. + + -- Debugging -- + -d Don't upload, but dump upload file to stdout + -K Remove color from the output + -v Verbose mode + +EOF +} + + +say() { + echo -e "$1" +} + + +urlencode() { + echo "$1" | curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | cut -c 3- | sed -e 's/%0A//' +} + + +swiftcov() { + _dir=$(dirname "$1" | sed 's/\(Build\).*/\1/g') + for _type in app framework xctest + do + find "$_dir" -name "*.$_type" | while read f + do + _proj=${f##*/} + _proj=${_proj%."$_type"} + if [ "$2" = "" ] || [ "$(echo "$_proj" | grep -i "$2")" != "" ]; + then + say " $g+$x Building reports for $_proj $_type" + dest=$([ -f "$f/$_proj" ] && echo "$f/$_proj" || echo "$f/Contents/MacOS/$_proj") + _proj_name=$(echo "$_proj" | sed -e 's/[[:space:]]//g') + xcrun llvm-cov show $beta_xcode_partials -instr-profile "$1" "$dest" > "$_proj_name.$_type.coverage.txt" \ + || say " ${r}x>${x} llvm-cov failed to produce results for $dest" + fi + done + done +} + + +# Credits to: https://gist.github.com/pkuczynski/8665367 +parse_yaml() { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + awk -F$fs '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; if (indent > 0) {vn=(vn)(vname[0])("_")} + printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3); + } + }' +} + + +if [ $# != 0 ]; +then + while getopts "a:A:b:B:cC:dD:e:f:F:g:G:hJ:k:Kn:p:P:r:R:y:s:S:t:T:u:U:vx:X:Z" o + do + case "$o" in + "a") + gcov_arg=$OPTARG + ;; + "A") + curlawsargs="$OPTARG" + ;; + "b") + build_o="$OPTARG" + ;; + "B") + branch_o="$OPTARG" + ;; + "c") + clean="1" + ;; + "C") + commit_o="$OPTARG" + ;; + "d") + dump="1" + ;; + "D") + ddp="$OPTARG" + ;; + "e") + env="$env,$OPTARG" + ;; + "f") + if [ "${OPTARG::1}" = "!" ]; + then + exclude_cov="$exclude_cov -not -path '${OPTARG:1}'" + + elif [[ "$OPTARG" = *"*"* ]]; + then + include_cov="$include_cov -or -name '$OPTARG'" + + else + ft_search=0 + if [ "$files" = "" ]; + then + files="$OPTARG" + else + files="$files +$OPTARG" + fi + fi + ;; + "F") + if [ "$flags" = "" ]; + then + flags="$OPTARG" + else + flags="$flags,$OPTARG" + fi + ;; + "g") + gcov_ignore="$gcov_ignore -not -path '$OPTARG'" + ;; + "G") + gcov_include="$gcov_include -path '$OPTARG'" + ;; + "h") + show_help + exit 0; + ;; + "J") + ft_xcodellvm="1" + ft_xcodeplist="0" + if [ "$xp" = "" ]; + then + xp="$OPTARG" + else + xp="$xp\|$OPTARG" + fi + ;; + "k") + prefix_o=$(echo "$OPTARG" | sed -e 's:^/*::' -e 's:/*$::') + ;; + "K") + b="" + g="" + r="" + e="" + x="" + ;; + "n") + name="$OPTARG" + ;; + "p") + proj_root="$OPTARG" + ;; + "P") + pr_o="$OPTARG" + ;; + "r") + slug_o="$OPTARG" + ;; + "R") + git_root="$OPTARG" + ;; + "s") + if [ "$search_in_o" = "" ]; + then + search_in_o="$OPTARG" + else + search_in_o="$search_in_o $OPTARG" + fi + ;; + "S") + cacert="--cacert \"$OPTARG\"" + ;; + "t") + if [ "${OPTARG::1}" = "@" ]; + then + token=$(cat "${OPTARG:1}" | tr -d ' \n') + else + token="$OPTARG" + fi + ;; + "T") + tag_o="$OPTARG" + ;; + "u") + url_o=$(echo "$OPTARG" | sed -e 's/\/$//') + ;; + "U") + curlargs="$OPTARG" + ;; + "v") + set -x + curl_s="" + ;; + "x") + gcov_exe=$OPTARG + ;; + "X") + if [ "$OPTARG" = "gcov" ]; + then + ft_gcov="0" + elif [ "$OPTARG" = "coveragepy" ] || [ "$OPTARG" = "py" ]; + then + ft_coveragepy="0" + elif [ "$OPTARG" = "xcodellvm" ]; + then + ft_xcodellvm="1" + ft_xcodeplist="0" + elif [ "$OPTARG" = "fix" ] || [ "$OPTARG" = "fixes" ]; + then + ft_fix="0" + elif [ "$OPTARG" = "xcode" ]; + then + ft_xcodellvm="0" + ft_xcodeplist="0" + elif [ "$OPTARG" = "search" ]; + then + ft_search="0" + elif [ "$OPTARG" = "xcodepartials" ]; + then + beta_xcode_partials="-use-color" + elif [ "$OPTARG" = "network" ]; + then + ft_network="0" + elif [ "$OPTARG" = "s3" ]; + then + ft_s3="0" + fi + ;; + "y") + codecov_yml="$OPTARG" + ;; + "Z") + exit_with=1 + ;; + esac + done +fi + +say " + _____ _ + / ____| | | +| | ___ __| | ___ ___ _____ __ +| | / _ \\ / _\` |/ _ \\/ __/ _ \\ \\ / / +| |___| (_) | (_| | __/ (_| (_) \\ V / + \\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/ + Bash-$VERSION + +" + +search_in="$proj_root" + +if [ "$JENKINS_URL" != "" ]; +then + say "$e==>$x Jenkins CI detected." + # https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project + # https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables + service="jenkins" + + if [ "$ghprbSourceBranch" != "" ]; + then + branch="$ghprbSourceBranch" + elif [ "$GIT_BRANCH" != "" ]; + then + branch="$GIT_BRANCH" + elif [ "$BRANCH_NAME" != "" ]; + then + branch="$BRANCH_NAME" + fi + + if [ "$ghprbActualCommit" != "" ]; + then + commit="$ghprbActualCommit" + elif [ "$GIT_COMMIT" != "" ]; + then + commit="$GIT_COMMIT" + fi + + if [ "$ghprbPullId" != "" ]; + then + pr="$ghprbPullId" + elif [ "$CHANGE_ID" != "" ]; + then + pr="$CHANGE_ID" + fi + + build="$BUILD_NUMBER" + build_url=$(urlencode "$BUILD_URL") + +elif [ "$CI" = "true" ] && [ "$TRAVIS" = "true" ] && [ "$SHIPPABLE" != "true" ]; +then + say "$e==>$x Travis CI detected." + # https://docs.travis-ci.com/user/environment-variables/ + service="travis" + commit="${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}" + build="$TRAVIS_JOB_NUMBER" + pr="$TRAVIS_PULL_REQUEST" + job="$TRAVIS_JOB_ID" + slug="$TRAVIS_REPO_SLUG" + env="$env,TRAVIS_OS_NAME" + tag="$TRAVIS_TAG" + if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ]; + then + branch="$TRAVIS_BRANCH" + fi + + language=$(printenv | grep "TRAVIS_.*_VERSION" | head -1) + if [ "$language" != "" ]; + then + env="$env,${language%=*}" + fi + +elif [ "$DOCKER_REPO" != "" ]; +then + say "$e==>$x Docker detected." + # https://docs.docker.com/docker-cloud/builds/advanced/ + service="docker" + branch="$SOURCE_BRANCH" + commit="$SOURCE_COMMIT" + slug="$DOCKER_REPO" + tag="$CACHE_TAG" + env="$env,IMAGE_NAME" + +elif [ "$CI" = "true" ] && [ "$CI_NAME" = "codeship" ]; +then + say "$e==>$x Codeship CI detected." + # https://www.codeship.io/documentation/continuous-integration/set-environment-variables/ + service="codeship" + branch="$CI_BRANCH" + build="$CI_BUILD_NUMBER" + build_url=$(urlencode "$CI_BUILD_URL") + commit="$CI_COMMIT_ID" + +elif [ ! -z "$CF_BUILD_URL" ] && [ ! -z "$CF_BUILD_ID" ]; +then + say "$e==>$x Codefresh CI detected." + # https://docs.codefresh.io/v1.0/docs/variables + service="codefresh" + branch="$CF_BRANCH" + build="$CF_BUILD_ID" + build_url=$(urlencode "$CF_BUILD_URL") + commit="$CF_REVISION" + +elif [ "$TEAMCITY_VERSION" != "" ]; +then + say "$e==>$x TeamCity CI detected." + # https://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters + # https://confluence.jetbrains.com/plugins/servlet/mobile#content/view/74847298 + if [ "$TEAMCITY_BUILD_BRANCH" = '' ]; + then + echo " Teamcity does not automatically make build parameters available as environment variables." + echo " Add the following environment parameters to the build configuration" + echo " env.TEAMCITY_BUILD_BRANCH = %teamcity.build.branch%" + echo " env.TEAMCITY_BUILD_ID = %teamcity.build.id%" + echo " env.TEAMCITY_BUILD_URL = %teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%" + echo " env.TEAMCITY_BUILD_COMMIT = %system.build.vcs.number%" + echo " env.TEAMCITY_BUILD_REPOSITORY = %vcsroot..url%" + fi + service="teamcity" + branch="$TEAMCITY_BUILD_BRANCH" + build="$TEAMCITY_BUILD_ID" + build_url=$(urlencode "$TEAMCITY_BUILD_URL") + if [ "$TEAMCITY_BUILD_COMMIT" != "" ]; + then + commit="$TEAMCITY_BUILD_COMMIT" + else + commit="$BUILD_VCS_NUMBER" + fi + remote_addr="$TEAMCITY_BUILD_REPOSITORY" + +elif [ "$CI" = "true" ] && [ "$CIRCLECI" = "true" ]; +then + say "$e==>$x Circle CI detected." + # https://circleci.com/docs/environment-variables + service="circleci" + branch="$CIRCLE_BRANCH" + build="$CIRCLE_BUILD_NUM" + job="$CIRCLE_NODE_INDEX" + if [ "$CIRCLE_PROJECT_REPONAME" != "" ]; + then + slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" + else + # git@github.com:owner/repo.git + slug="${CIRCLE_REPOSITORY_URL##*:}" + # owner/repo.git + slug="${slug%%.git}" + fi + pr="$CIRCLE_PR_NUMBER" + commit="$CIRCLE_SHA1" + search_in="$search_in $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS" + +elif [ "$BUDDYBUILD_BRANCH" != "" ]; +then + say "$e==>$x buddybuild detected" + # http://docs.buddybuild.com/v6/docs/custom-prebuild-and-postbuild-steps + service="buddybuild" + branch="$BUDDYBUILD_BRANCH" + build="$BUDDYBUILD_BUILD_NUMBER" + build_url="https://dashboard.buddybuild.com/public/apps/$BUDDYBUILD_APP_ID/build/$BUDDYBUILD_BUILD_ID" + # BUDDYBUILD_TRIGGERED_BY + if [ "$ddp" = "$(echo ~)/Library/Developer/Xcode/DerivedData" ]; + then + ddp="/private/tmp/sandbox/${BUDDYBUILD_APP_ID}/bbtest" + fi + +elif [ "${bamboo_planRepository_revision}" != "" ]; +then + say "$e==>$x Bamboo detected" + # https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html#Bamboovariables-Build-specificvariables + service="bamboo" + commit="${bamboo_planRepository_revision}" + branch="${bamboo_planRepository_branch}" + build="${bamboo_buildNumber}" + build_url="${bamboo_buildResultsUrl}" + remote_addr="${bamboo_planRepository_repositoryUrl}" + +elif [ "$CI" = "true" ] && [ "$BITRISE_IO" = "true" ]; +then + # http://devcenter.bitrise.io/faq/available-environment-variables/ + say "$e==>$x Bitrise CI detected." + service="bitrise" + branch="$BITRISE_GIT_BRANCH" + build="$BITRISE_BUILD_NUMBER" + build_url=$(urlencode "$BITRISE_BUILD_URL") + pr="$BITRISE_PULL_REQUEST" + if [ "$GIT_CLONE_COMMIT_HASH" != "" ]; + then + commit="$GIT_CLONE_COMMIT_HASH" + fi + +elif [ "$CI" = "true" ] && [ "$SEMAPHORE" = "true" ]; +then + say "$e==>$x Semaphore CI detected." + # https://semaphoreapp.com/docs/available-environment-variables.html + service="semaphore" + branch="$BRANCH_NAME" + build="$SEMAPHORE_BUILD_NUMBER" + job="$SEMAPHORE_CURRENT_THREAD" + pr="$PULL_REQUEST_NUMBER" + slug="$SEMAPHORE_REPO_SLUG" + commit="$REVISION" + env="$env,SEMAPHORE_TRIGGER_SOURCE" + +elif [ "$CI" = "true" ] && [ "$BUILDKITE" = "true" ]; +then + say "$e==>$x Buildkite CI detected." + # https://buildkite.com/docs/guides/environment-variables + service="buildkite" + branch="$BUILDKITE_BRANCH" + build="$BUILDKITE_BUILD_NUMBER" + job="$BUILDKITE_JOB_ID" + build_url=$(urlencode "$BUILDKITE_BUILD_URL") + slug="$BUILDKITE_PROJECT_SLUG" + commit="$BUILDKITE_COMMIT" + if [[ "$BUILDKITE_PULL_REQUEST" != "false" ]]; then + pr="$BUILDKITE_PULL_REQUEST" + fi + tag="$BUILDKITE_TAG" + +elif [ "$CI" = "drone" ] || [ "$DRONE" = "true" ]; +then + say "$e==>$x Drone CI detected." + # http://docs.drone.io/env.html + # drone commits are not full shas + service="drone.io" + branch="$DRONE_BRANCH" + build="$DRONE_BUILD_NUMBER" + build_url=$(urlencode "${DRONE_BUILD_LINK}") + pr="$DRONE_PULL_REQUEST" + job="$DRONE_JOB_NUMBER" + tag="$DRONE_TAG" + +elif [ "$HEROKU_TEST_RUN_BRANCH" != "" ]; +then + say "$e==>$x Heroku CI detected." + # https://devcenter.heroku.com/articles/heroku-ci#environment-variables + service="heroku" + branch="$HEROKU_TEST_RUN_BRANCH" + build="$HEROKU_TEST_RUN_ID" + +elif [ "$CI" = "True" ] && [ "$APPVEYOR" = "True" ]; +then + say "$e==>$x Appveyor CI detected." + # http://www.appveyor.com/docs/environment-variables + service="appveyor" + branch="$APPVEYOR_REPO_BRANCH" + build=$(urlencode "$APPVEYOR_JOB_ID") + pr="$APPVEYOR_PULL_REQUEST_NUMBER" + job="$APPVEYOR_ACCOUNT_NAME%2F$APPVEYOR_PROJECT_SLUG%2F$APPVEYOR_BUILD_VERSION" + slug="$APPVEYOR_REPO_NAME" + commit="$APPVEYOR_REPO_COMMIT" + +elif [ "$CI" = "true" ] && [ "$WERCKER_GIT_BRANCH" != "" ]; +then + say "$e==>$x Wercker CI detected." + # http://devcenter.wercker.com/articles/steps/variables.html + service="wercker" + branch="$WERCKER_GIT_BRANCH" + build="$WERCKER_MAIN_PIPELINE_STARTED" + slug="$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY" + commit="$WERCKER_GIT_COMMIT" + +elif [ "$CI" = "true" ] && [ "$MAGNUM" = "true" ]; +then + say "$e==>$x Magnum CI detected." + # https://magnum-ci.com/docs/environment + service="magnum" + branch="$CI_BRANCH" + build="$CI_BUILD_NUMBER" + commit="$CI_COMMIT" + +elif [ "$SHIPPABLE" = "true" ]; +then + say "$e==>$x Shippable CI detected." + # http://docs.shippable.com/ci_configure/ + service="shippable" + branch=$([ "$HEAD_BRANCH" != "" ] && echo "$HEAD_BRANCH" || echo "$BRANCH") + build="$BUILD_NUMBER" + build_url=$(urlencode "$BUILD_URL") + pr="$PULL_REQUEST" + slug="$REPO_FULL_NAME" + commit="$COMMIT" + +elif [ "$TDDIUM" = "true" ]; +then + say "Solano CI detected." + # http://docs.solanolabs.com/Setup/tddium-set-environment-variables/ + service="solano" + commit="$TDDIUM_CURRENT_COMMIT" + branch="$TDDIUM_CURRENT_BRANCH" + build="$TDDIUM_TID" + pr="$TDDIUM_PR_ID" + +elif [ "$GREENHOUSE" = "true" ]; +then + say "$e==>$x Greenhouse CI detected." + # http://docs.greenhouseci.com/docs/environment-variables-files + service="greenhouse" + branch="$GREENHOUSE_BRANCH" + build="$GREENHOUSE_BUILD_NUMBER" + build_url=$(urlencode "$GREENHOUSE_BUILD_URL") + pr="$GREENHOUSE_PULL_REQUEST" + commit="$GREENHOUSE_COMMIT" + search_in="$search_in $GREENHOUSE_EXPORT_DIR" + +elif [ "$GITLAB_CI" != "" ]; +then + say "$e==>$x GitLab CI detected." + # http://doc.gitlab.com/ce/ci/variables/README.html + service="gitlab" + branch="${CI_BUILD_REF_NAME:-$CI_COMMIT_REF_NAME}" + build="${CI_BUILD_ID:-$CI_JOB_ID}" + remote_addr="${CI_BUILD_REPO:-$CI_REPOSITORY_URL}" + commit="${CI_BUILD_REF:-$CI_COMMIT_SHA}" + +else + say "${r}x>${x} No CI provider detected." + say " Testing inside Docker? ${b}http://docs.codecov.io/docs/testing-with-docker${x}" + say " Testing with Tox? ${b}https://docs.codecov.io/docs/python#section-testing-with-tox${x}" + +fi + +say " ${e}project root:${x} $git_root" + +# find branch, commit, repo from git command +if [ "$GIT_BRANCH" != "" ]; +then + branch="$GIT_BRANCH" + +elif [ "$branch" = "" ]; +then + branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || hg branch 2>/dev/null || echo "") + if [ "$branch" = "HEAD" ]; + then + branch="" + fi +fi + +if [ "$commit_o" = "" ]; +then + # merge commit -> actual commit + mc= + if [ -n "$pr" ] && [ "$pr" != false ]; + then + mc=$(git show --no-patch --format="%P" 2>/dev/null || echo "") + fi + if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]]; + then + say " Fixing merge commit SHA" + commit=$(echo "$mc" | cut -d' ' -f2) + elif [ "$GIT_COMMIT" != "" ]; + then + commit="$GIT_COMMIT" + elif [ "$commit" = "" ]; + then + commit=$(git log -1 --format="%H" 2>/dev/null || hg id -i --debug 2>/dev/null | tr -d '+' || echo "") + fi +else + commit="$commit_o" +fi + +if [ "$CODECOV_TOKEN" != "" ] && [ "$token" = "" ]; +then + say "${e}-->${x} token set from env" + token="$CODECOV_TOKEN" +fi + +if [ "$CODECOV_URL" != "" ] && [ "$url_o" = "" ]; +then + say "${e}-->${x} url set from env" + url_o=$(echo "$CODECOV_URL" | sed -e 's/\/$//') +fi + +if [ "$CODECOV_SLUG" != "" ]; +then + say "${e}-->${x} slug set from env" + slug_o="$CODECOV_SLUG" + +elif [ "$slug" = "" ]; +then + if [ "$remote_addr" = "" ]; + then + remote_addr=$(git config --get remote.origin.url || hg paths default || echo '') + fi + if [ "$remote_addr" != "" ]; + then + if echo "$remote_addr" | grep -q "//"; then + # https + slug=$(echo "$remote_addr" | cut -d / -f 4,5 | sed -e 's/\.git$//') + else + # ssh + slug=$(echo "$remote_addr" | cut -d : -f 2 | sed -e 's/\.git$//') + fi + fi + if [ "$slug" = "/" ]; + then + slug="" + fi +fi + +yaml=$(test -n "$codecov_yml" && echo "$codecov_yml" \ + || cd "$git_root" && \ + git ls-files "*codecov.yml" "*codecov.yaml" 2>/dev/null \ + || hg locate "*codecov.yml" "*codecov.yaml" 2>/dev/null \ + || cd $proj_root && find . -type f -name '*codecov.y*ml' -depth 1 2>/dev/null \ + || echo '') +yaml=$(echo "$yaml" | head -1) + +if [ "$yaml" != "" ]; +then + say " ${e}Yaml found at:${x} $yaml" + config=$(parse_yaml "$git_root/$yaml" || echo '') + + # TODO validate the yaml here + + if [ "$(echo "$config" | grep 'codecov_token="')" != "" ] && [ "$token" = "" ]; + then + say "${e}-->${x} token set from yaml" + token="$(echo "$config" | grep 'codecov_token="' | sed -e 's/codecov_token="//' | sed -e 's/"\.*//')" + fi + + if [ "$(echo "$config" | grep 'codecov_url="')" != "" ] && [ "$url_o" = "" ]; + then + say "${e}-->${x} url set from yaml" + url_o="$(echo "$config" | grep 'codecov_url="' | sed -e 's/codecov_url="//' | sed -e 's/"\.*//')" + fi + + if [ "$(echo "$config" | grep 'codecov_slug="')" != "" ] && [ "$slug_o" = "" ]; + then + say "${e}-->${x} slug set from yaml" + slug_o="$(echo "$config" | grep 'codecov_slug="' | sed -e 's/codecov_slug="//' | sed -e 's/"\.*//')" + fi +else + say " ${g}Yaml not found, that's ok! Learn more at${x} ${b}http://docs.codecov.io/docs/codecov-yaml${x}" + +fi + +if [ "$branch_o" != "" ]; +then + branch=$(urlencode "$branch_o") +else + branch=$(urlencode "$branch") +fi + +query="branch=$branch\ + &commit=$commit\ + &build=$([ "$build_o" = "" ] && echo "$build" || echo "$build_o")\ + &build_url=$build_url\ + &name=$(urlencode "$name")\ + &tag=$([ "$tag_o" = "" ] && echo "$tag" || echo "$tag_o")\ + &slug=$([ "$slug_o" = "" ] && urlencode "$slug" || urlencode "$slug_o")\ + &service=$service\ + &flags=$flags\ + &pr=$([ "$pr_o" = "" ] && echo "${pr##\#}" || echo "${pr_o##\#}")\ + &job=$job" + +if [ "$ft_search" = "1" ]; +then + # detect bower comoponents location + bower_components="bower_components" + bower_rc=$(cd "$git_root" && cat .bowerrc 2>/dev/null || echo "") + if [ "$bower_rc" != "" ]; + then + bower_components=$(echo "$bower_rc" | tr -d '\n' | grep '"directory"' | cut -d'"' -f4 | sed -e 's/\/$//') + if [ "$bower_components" = "" ]; + then + bower_components="bower_components" + fi + fi + + # Swift Coverage + if [ "$ft_xcodellvm" = "1" ] && [ -d "$ddp" ]; + then + say "${e}==>${x} Processing Xcode reports via llvm-cov" + say " DerivedData folder: $ddp" + profdata_files=$(find "$ddp" -name '*.profdata' 2>/dev/null || echo '') + if [ "$profdata_files" != "" ]; + then + # xcode via profdata + if [ "$xp" = "" ]; + then + # xp=$(xcodebuild -showBuildSettings 2>/dev/null | grep -i "^\s*PRODUCT_NAME" | sed -e 's/.*= \(.*\)/\1/') + # say " ${e}->${x} Speed up Xcode processing by adding ${e}-J '$xp'${x}" + say " ${g}hint${x} Speed up Swift processing by using use ${g}-J 'AppName'${x} (regexp accepted)" + say " ${g}hint${x} This will remove Pods/ from your report. Also ${b}https://docs.codecov.io/docs/ignoring-paths${x}" + fi + while read -r profdata; + do + if [ "$profdata" != "" ]; + then + swiftcov "$profdata" "$xp" + fi + done <<< "$profdata_files" + else + say " ${e}->${x} No Swift coverage found" + fi + + # Obj-C Gcov Coverage + if [ "$ft_gcov" = "1" ]; + then + say " ${e}->${x} Running $gcov_exe for Obj-C" + bash -c "find $ddp -type f -name '*.gcda' $gcov_include $gcov_ignore -exec $gcov_exe -p $gcov_arg {} +" || true + fi + fi + + if [ "$ft_xcodeplist" = "1" ] && [ -d "$ddp" ]; + then + say "${e}==>${x} Processing Xcode plists" + plists_files=$(find "$ddp" -name '*.xccoverage' 2>/dev/null || echo '') + if [ "$plists_files" != "" ]; + then + while read -r plist; + do + if [ "$plist" != "" ]; + then + say " ${g}Found${x} plist file at $plist" + plutil -convert xml1 -o "$(basename "$plist").plist" -- $plist + fi + done <<< "$plists_files" + fi + fi + + # Gcov Coverage + if [ "$ft_gcov" = "1" ]; + then + say "${e}==>${x} Running gcov in $proj_root ${e}(disable via -X gcov)${x}" + bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" || true + else + say "${e}==>${x} gcov disabled" + fi + + # Python Coverage + if [ "$ft_coveragepy" = "1" ]; + then + if [ ! -f coverage.xml ]; + then + if which coverage >/dev/null 2>&1; + then + say "${e}==>${x} Python coveragepy exists ${e}disable via -X coveragepy${x}" + + dotcoverage=$(find "$git_root" -name '.coverage' -or -name '.coverage.*' | head -1 || echo '') + if [ "$dotcoverage" != "" ]; + then + cd "$(dirname "$dotcoverage")" + if [ ! -f .coverage ]; + then + say " ${e}->${x} Running coverage combine" + coverage combine -a + fi + say " ${e}->${x} Running coverage xml" + if [ "$(coverage xml -i)" != "No data to report." ]; + then + files="$files +$PWD/coverage.xml" + else + say " ${r}No data to report.${x}" + fi + cd "$proj_root" + else + say " ${r}No .coverage file found.${x}" + fi + else + say "${e}==>${x} Python coveragepy not found" + fi + fi + else + say "${e}==>${x} Python coveragepy disabled" + fi + + if [ "$search_in_o" != "" ]; + then + # location override + search_in="$search_in_o" + fi + + say "$e==>$x Searching for coverage reports in:" + for _path in $search_in + do + say " ${g}+${x} $_path" + done + + patterns="find $search_in \( \ + -name vendor \ + -or -name htmlcov \ + -or -name virtualenv \ + -or -name js/generated/coverage \ + -or -name .virtualenv \ + -or -name virtualenvs \ + -or -name .virtualenvs \ + -or -name .env \ + -or -name .envs \ + -or -name env \ + -or -name .yarn-cache \ + -or -name envs \ + -or -name .venv \ + -or -name .venvs \ + -or -name venv \ + -or -name venvs \ + -or -name .git \ + -or -name .hg \ + -or -name .tox \ + -or -name __pycache__ \ + -or -name '.egg-info*' \ + -or -name '$bower_components' \ + -or -name node_modules \ + -or -name 'conftest_*.c.gcov' \ + \) -prune -or \ + -type f \( -name '*coverage*.*' \ + -or -name 'nosetests.xml' \ + -or -name 'jacoco*.xml' \ + -or -name 'clover.xml' \ + -or -name 'report.xml' \ + -or -name '*.codecov.*' \ + -or -name 'codecov.*' \ + -or -name 'cobertura.xml' \ + -or -name 'excoveralls.json' \ + -or -name 'luacov.report.out' \ + -or -name 'coverage-final.json' \ + -or -name 'naxsi.info' \ + -or -name 'lcov.info' \ + -or -name 'lcov.dat' \ + -or -name '*.lcov' \ + -or -name '*.clover' \ + -or -name 'cover.out' \ + -or -name 'gcov.info' \ + -or -name '*.gcov' \ + -or -name '*.lst' \ + $include_cov \) \ + $exclude_cov \ + -not -name '*.profdata' \ + -not -name 'coverage-summary.json' \ + -not -name 'phpunit-code-coverage.xml' \ + -not -name '*/classycle/report.xml' \ + -not -name 'remapInstanbul.coverage*.json' \ + -not -name 'phpunit-coverage.xml' \ + -not -name '*codecov.yml' \ + -not -name '*.serialized' \ + -not -name '.coverage*' \ + -not -name '.*coveragerc' \ + -not -name '*.sh' \ + -not -name '*.bat' \ + -not -name '*.ps1' \ + -not -name '*.env' \ + -not -name '*.cmake' \ + -not -name '*.dox' \ + -not -name '*.ec' \ + -not -name '*.rst' \ + -not -name '*.h' \ + -not -name '*.scss' \ + -not -name '*.o' \ + -not -name '*.proto' \ + -not -name '*.sbt' \ + -not -name '*.xcoverage.*' \ + -not -name '*.gz' \ + -not -name '*.conf' \ + -not -name '*.p12' \ + -not -name '*.csv' \ + -not -name '*.rsp' \ + -not -name '*.m4' \ + -not -name '*.pem' \ + -not -name '*~' \ + -not -name '*.exe' \ + -not -name '*.am' \ + -not -name '*.template' \ + -not -name '*.cp' \ + -not -name '*.bw' \ + -not -name '*.crt' \ + -not -name '*.log' \ + -not -name '*.cmake' \ + -not -name '*.pth' \ + -not -name '*.in' \ + -not -name '*.jar*' \ + -not -name '*.pom*' \ + -not -name '*.png' \ + -not -name '*.jpg' \ + -not -name '*.sql' \ + -not -name '*.jpeg' \ + -not -name '*.svg' \ + -not -name '*.gif' \ + -not -name '*.csv' \ + -not -name '*.snapshot' \ + -not -name '*.mak*' \ + -not -name '*.bash' \ + -not -name '*.data' \ + -not -name '*.py' \ + -not -name '*.class' \ + -not -name '*.xcconfig' \ + -not -name '*.ec' \ + -not -name '*.coverage' \ + -not -name '*.pyc' \ + -not -name '*.cfg' \ + -not -name '*.egg' \ + -not -name '*.ru' \ + -not -name '*.css' \ + -not -name '*.less' \ + -not -name '*.pyo' \ + -not -name '*.whl' \ + -not -name '*.html' \ + -not -name '*.ftl' \ + -not -name '*.erb' \ + -not -name '*.rb' \ + -not -name '*.js' \ + -not -name '*.jade' \ + -not -name '*.db' \ + -not -name '*.md' \ + -not -name '*.cpp' \ + -not -name '*.gradle' \ + -not -name '*.tar.tz' \ + -not -name '*.scss' \ + -not -name 'include.lst' \ + -not -name 'fullLocaleNames.lst' \ + -not -name 'inputFiles.lst' \ + -not -name 'createdFiles.lst' \ + -not -name 'scoverage.measurements.*' \ + -not -name 'test_*_coverage.txt' \ + -not -name 'testrunner-coverage*' \ + -print 2>/dev/null" + files=$(eval "$patterns" || echo '') + +elif [ "$include_cov" != "" ]; +then + files=$(eval "find $search_in -type f \( ${include_cov:5} \)$exclude_cov 2>/dev/null" || echo '') +fi + +num_of_files=$(echo "$files" | wc -l | tr -d ' ') +if [ "$num_of_files" != '' ] && [ "$files" != '' ]; +then + say " ${e}->${x} Found $num_of_files reports" +fi + +# no files found +if [ "$files" = "" ]; +then + say "${r}-->${x} No coverage report found." + say " Please visit ${b}http://docs.codecov.io/docs/supported-languages${x}" + exit ${exit_with}; +fi + +if [ "$ft_network" == "1" ]; +then + say "${e}==>${x} Detecting git/mercurial file structure" + network=$(cd "$git_root" && git ls-files 2>/dev/null || hg locate 2>/dev/null || echo "") + if [ "$network" = "" ]; + then + network=$(find "$git_root" \( \ + -name virtualenv \ + -name .virtualenv \ + -name virtualenvs \ + -name .virtualenvs \ + -name '*.png' \ + -name '*.gif' \ + -name '*.jpg' \ + -name '*.jpeg' \ + -name '*.md' \ + -name .env \ + -name .envs \ + -name env \ + -name envs \ + -name .venv \ + -name .venvs \ + -name venv \ + -name venvs \ + -name .git \ + -name .egg-info \ + -name shunit2-2.1.6 \ + -name vendor \ + -name __pycache__ \ + -name node_modules \ + -path '*/$bower_components/*' \ + -path '*/target/delombok/*' \ + -path '*/build/lib/*' \ + -path '*/js/generated/coverage/*' \ + \) -prune -or \ + -type f -print 2>/dev/null || echo '') + fi + + if [ "$prefix_o" != "" ]; + then + network=$(echo "$network" | awk "{print \"$prefix_o/\"\$0}") + fi +fi + +upload_file=`mktemp /tmp/codecov.XXXXXX` +adjustments_file=`mktemp /tmp/codecov.adjustments.XXXXXX` + +cleanup() { + rm -f $upload_file $adjustments_file $upload_file.gz +} + +trap cleanup INT ABRT TERM + +if [ "$env" != "" ]; +then + inc_env="" + say "${e}==>${x} Appending build variables" + for varname in $(echo "$env" | tr ',' ' ') + do + if [ "$varname" != "" ]; + then + say " ${g}+${x} $varname" + inc_env="${inc_env}${varname}=$(eval echo "\$${varname}") +" + fi + done + +echo "$inc_env<<<<<< ENV" >> $upload_file +fi + +# Append git file list +# write discovered yaml location +echo "$yaml" >> $upload_file +if [ "$ft_network" == "1" ]; +then + i="woff|eot|otf" # fonts + i="$i|gif|png|jpg|jpeg|psd" # images + i="$i|ptt|pptx|numbers|pages|md|txt|xlsx|docx|doc|pdf|html|csv" # docs + i="$i|yml|yaml|.gitignore" # supporting docs + echo "$network" | grep -vwE "($i)$" >> $upload_file +fi +echo "<<<<<< network" >> $upload_file + +fr=0 +say "${e}==>${x} Reading reports" +while IFS='' read -r file; +do + # read the coverage file + if [ "$(echo "$file" | tr -d ' ')" != '' ]; + then + if [ -f "$file" ]; + then + report_len=$(wc -c < "$file") + if [ "$report_len" -ne 0 ]; + then + say " ${g}+${x} $file ${e}bytes=$(echo "$report_len" | tr -d ' ')${x}" + # append to to upload + _filename=$(basename "$file") + if [ "${_filename##*.}" = 'gcov' ]; + then + echo "# path=$(echo "$file.reduced" | sed "s|^$git_root/||")" >> $upload_file + # get file name + head -1 $file >> $upload_file + # 1. remove source code + # 2. remove ending bracket lines + # 3. remove whitespace + # 4. remove contextual lines + # 5. remove function names + awk -F': *' '{print $1":"$2":"}' $file \ + | sed '\/: *} *$/d' \ + | sed 's/^ *//' \ + | sed '/^-/d' \ + | sed 's/^function.*/func/' >> $upload_file + else + echo "# path=$(echo "$file" | sed "s|^$git_root/||")" >> $upload_file + cat "$file" >> $upload_file + fi + echo "<<<<<< EOF" >> $upload_file + fr=1 + if [ "$clean" = "1" ]; + then + rm "$file" + fi + else + say " ${r}-${x} Skipping empty file $file" + fi + else + say " ${r}-${x} file not found at $file" + fi + fi +done <<< "$(echo -e "$files")" + +if [ "$fr" = "0" ]; +then + say "${r}-->${x} No coverage data found." + say " Please visit ${b}http://docs.codecov.io/docs/supported-languages${x}" + say " search for your projects language to learn how to collect reports." + exit ${exit_with}; +fi + +if [ "$ft_fix" = "1" ]; +then + say "${e}==>${x} Appending adjustments" + say " ${b}http://docs.codecov.io/docs/fixing-reports${x}" + + empty_line='^[[:space:]]*$' + # // + syntax_comment='^[[:space:]]*//.*' + # /* or */ + syntax_comment_block='^[[:space:]]*(\/\*|\*\/)[[:space:]]*$' + # { or } + syntax_bracket='^[[:space:]]*[\{\}][[:space:]]*(//.*)?$' + # [ or ] + syntax_list='^[[:space:]]*[][][[:space:]]*(//.*)?$' + + skip_dirs="-not -path '*/$bower_components/*' \ + -not -path '*/node_modules/*'" + + cut_and_join() { + awk 'BEGIN { FS=":" } + $3 ~ /\/\*/ || $3 ~ /\*\// { print $0 ; next } + $1!=key { if (key!="") print out ; key=$1 ; out=$1":"$2 ; next } + { out=out","$2 } + END { print out }' 2>/dev/null + } + + if echo "$network" | grep -m1 '.kt$' 1>/dev/null; + then + # skip brackets and comments + find "$git_root" -type f \ + -name '*.kt' \ + -exec \ + grep -nIHE -e $syntax_bracket \ + -e $syntax_comment_block {} \; \ + | cut_and_join \ + >> $adjustments_file \ + || echo '' + + # last line in file + find "$git_root" -type f \ + -name '*.kt' -exec \ + wc -l {} \; \ + | while read l; do echo "EOF: $l"; done \ + 2>/dev/null \ + >> $adjustments_file \ + || echo '' + + fi + + if echo "$network" | grep -m1 '.go$' 1>/dev/null; + then + # skip empty lines, comments, and brackets + find "$git_root" -not -path '*/vendor/*' \ + -type f \ + -name '*.go' \ + -exec \ + grep -nIHE \ + -e $empty_line \ + -e $syntax_comment \ + -e $syntax_comment_block \ + -e $syntax_bracket \ + {} \; \ + | cut_and_join \ + >> $adjustments_file \ + || echo '' + fi + + if echo "$network" | grep -m1 '.dart$' 1>/dev/null; + then + # skip brackets + find "$git_root" -type f \ + -name '*.dart' \ + -exec \ + grep -nIHE \ + -e $syntax_bracket \ + {} \; \ + | cut_and_join \ + >> $adjustments_file \ + || echo '' + fi + + if echo "$network" | grep -m1 '.php$' 1>/dev/null; + then + # skip empty lines, comments, and brackets + find "$git_root" -not -path "*/vendor/*" \ + -type f \ + -name '*.php' \ + -exec \ + grep -nIHE \ + -e $syntax_list \ + -e $syntax_bracket \ + -e '^[[:space:]]*\);[[:space:]]*(//.*)?$' \ + {} \; \ + | cut_and_join \ + >> $adjustments_file \ + || echo '' + fi + + if echo "$network" | grep -m1 '\(.cpp\|.h\|.cxx\|.c\|.hpp\|.m\)$' 1>/dev/null; + then + # skip brackets + find "$git_root" -type f \ + $skip_dirs \ + \( \ + -name '*.h' \ + -or -name '*.cpp' \ + -or -name '*.cxx' \ + -or -name '*.m' \ + -or -name '*.c' \ + -or -name '*.hpp' \ + \) -exec \ + grep -nIHE \ + -e $empty_line \ + -e $syntax_bracket \ + -e '// LCOV_EXCL' \ + {} \; \ + | cut_and_join \ + >> $adjustments_file \ + || echo '' + + # skip brackets + find "$git_root" -type f \ + $skip_dirs \ + \( \ + -name '*.h' \ + -or -name '*.cpp' \ + -or -name '*.cxx' \ + -or -name '*.m' \ + -or -name '*.c' \ + -or -name '*.hpp' \ + \) -exec \ + grep -nIH '// LCOV_EXCL' \ + {} \; \ + >> $adjustments_file \ + || echo '' + + fi + + found=$(cat $adjustments_file | tr -d ' ') + + if [ "$found" != "" ]; + then + say " ${g}+${x} Found adjustments" + echo "# path=fixes" >> $upload_file + cat $adjustments_file >> $upload_file + echo "<<<<<< EOF" >> $upload_file + rm -rf $adjustments_file + else + say " ${e}->${x} No adjustments found" + fi +fi + +if [ "$url_o" != "" ]; +then + url="$url_o" +fi + +if [ "$dump" != "0" ]; +then + # trim whitespace from query + say " ${e}->${x} Dumping upload file (no upload)" + echo "$url/upload/v4?$(echo "package=bash-$VERSION&token=$token&$query" | tr -d ' ')" + cat $upload_file +else + + say "${e}==>${x} Gzipping contents" + gzip -nf9 $upload_file + + query=$(echo "${query}" | tr -d ' ') + say "${e}==>${x} Uploading reports" + say " ${e}url:${x} $url" + say " ${e}query:${x} $query" + + # now add token to query + query=$(echo "package=bash-$VERSION&token=$token&$query" | tr -d ' ') + + if [ "$ft_s3" = "1" ]; + then + i="0" + while [ $i -lt 4 ] + do + i=$[$i+1] + say " ${e}->${x} Pinging Codecov" + res=$(curl $curl_s -X POST $curlargs $cacert \ + -H 'X-Reduced-Redundancy: false' \ + -H 'X-Content-Type: application/x-gzip' \ + "$url/upload/v4?$query" || true) + # a good replay is "https://codecov.io" + "\n" + "https://codecov.s3.amazonaws.com/..." + status=$(echo "$res" | head -1 | grep 'HTTP ' | cut -d' ' -f2) + if [ "$status" = "" ]; + then + s3target=$(echo "$res" | sed -n 2p) + say " ${e}->${x} Uploading" + s3=$(curl $curl_s -fiX PUT $curlawsargs \ + --data-binary @$upload_file.gz \ + -H 'Content-Type: application/x-gzip' \ + -H 'Content-Encoding: gzip' \ + -H 'x-amz-acl: public-read' \ + "$s3target" || true) + if [ "$s3" != "" ]; + then + say " ${g}->${x} View reports at ${b}$(echo "$res" | sed -n 1p)${x}" + exit 0 + else + say " ${r}X>${x} Failed to upload" + fi + elif [ "$status" = "400" ]; + then + # 400 Error + say "${g}${res}${x}" + exit ${exit_with} + fi + say " ${e}->${x} Sleeping for 30s and trying again..." + sleep 30 + done + fi + + say " ${e}->${x} Uploading to Codecov" + i="0" + while [ $i -lt 4 ] + do + i=$[$i+1] + + res=$(curl $curl_s -X POST $curlargs $cacert \ + --data-binary @$upload_file.gz \ + -H 'Content-Type: text/plain' \ + -H 'Content-Encoding: gzip' \ + -H 'X-Content-Encoding: gzip' \ + -H 'Accept: text/plain' \ + "$url/upload/v2?$query" || echo 'HTTP 500') + # HTTP 200 + # http://.... + status=$(echo "$res" | head -1 | cut -d' ' -f2) + if [ "$status" = "" ]; + then + say " View reports at ${b}$(echo "$res" | head -2 | tail -1)${x}" + exit 0 + + elif [ "${status:0:1}" = "5" ]; + then + say " ${e}->${x} Sleeping for 30s and trying again..." + sleep 30 + + else + say " ${g}${res}${x}" + exit 0 + exit ${exit_with} + fi + + done + + say " ${r}X> Failed to upload coverage reports${x}" +fi + +exit ${exit_with} diff --git a/.circleci/config.yml b/.circleci/config.yml index 312d04ca..e1751907 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -312,7 +312,7 @@ jobs: done - run: name: upload - command: bash <(curl -s https://codecov.io/bash) -f coverage.txt + command: bash .circleci/codecov.sh -f coverage.txt workflows: version: 2 From 61ab10d6550a0e3dc31beae97f3193f968741aa1 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 30 Aug 2018 14:41:58 -0700 Subject: [PATCH 101/149] config: reduce default mempool size (#2300) * config: reduce default mempool size This reduces the mempool size from 100k to 5k. Note that each secp256k1 sig takes .5ms to compute. Therefore an adversary could previously delay every node on the network's computation time upon receiving a block by 50 seconds. This now reduces that ability to being able to only delay each node by 2.5 seconds. This change should be reverted once ABCI recheck is implemented. * (squash this) fix test --- CHANGELOG_PENDING.md | 1 + config/config.go | 6 ++++-- consensus/mempool_test.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 6f594f69..ade22d21 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -32,6 +32,7 @@ IMPROVEMENTS: - [mempool] Now stores txs by hash inside of the cache, to mitigate memory leakage - [config] Replace db_path with db_dir from automatically generated configuration files. Issue reported to Cosmos SDK ([#1712](https://github.com/cosmos/cosmos-sdk/issues/1712)) +- [config] Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. BUG FIXES: - [mempool] No longer possible to fill up linked list without getting caching diff --git a/config/config.go b/config/config.go index 51683ef0..48793f0f 100644 --- a/config/config.go +++ b/config/config.go @@ -421,8 +421,10 @@ func DefaultMempoolConfig() *MempoolConfig { RecheckEmpty: true, Broadcast: true, WalPath: filepath.Join(defaultDataDir, "mempool.wal"), - Size: 100000, - CacheSize: 100000, + // Each signature verification takes .5ms, size reduced until we implement + // ABCI Recheck + Size: 5000, + CacheSize: 10000, } } diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index c905f50b..81d7693f 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -99,7 +99,7 @@ func TestMempoolTxConcurrentWithCommit(t *testing.T) { height, round := cs.Height, cs.Round newBlockCh := subscribe(cs.eventBus, types.EventQueryNewBlock) - NTxs := 10000 + NTxs := 3000 go deliverTxsRange(cs, 0, NTxs) startTestRound(cs, height, round) From 7b2f7090fd9f01a33385955b20706d0c8375d33c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 31 Aug 2018 11:59:52 +0400 Subject: [PATCH 102/149] add missing changelog entry (#2303) https://github.com/tendermint/tendermint/pull/2264#issuecomment-417378396 --- CHANGELOG_PENDING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index ade22d21..811b561c 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -20,6 +20,7 @@ BREAKING CHANGES: - Remove PubKey from `Validator` and introduce `ValidatorUpdate` - InitChain and EndBlock use ValidatorUpdate - Update field names and types in BeginBlock +- [p2p] update secret connection to use a little endian encoded nonce FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) From d73c5cbdb16e35624885f73e7e5c4897094d73be Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 8 Aug 2018 16:03:58 +0400 Subject: [PATCH 103/149] 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 --- Gopkg.lock | 1 - abci/types/types.pb.go | 398 +++++++++++------------- abci/types/types.proto | 3 +- abci/types/types_test.go | 31 -- consensus/mempool_test.go | 2 +- consensus/reactor_test.go | 5 +- consensus/state.go | 22 +- docs/architecture/adr-020-block-size.md | 72 +++++ evidence/pool.go | 7 +- evidence/reactor_test.go | 4 +- evidence/store.go | 20 +- evidence/store_test.go | 8 +- mempool/mempool.go | 68 +++- mempool/mempool_test.go | 8 +- mempool/reactor_test.go | 2 +- node/node.go | 7 +- rpc/client/rpc_test.go | 2 +- rpc/core/mempool.go | 2 +- rpc/core/pipe.go | 5 +- state/execution.go | 8 +- state/services.go | 38 ++- state/state_test.go | 21 +- types/block.go | 11 + types/block_test.go | 46 ++- types/evidence.go | 5 + types/evidence_test.go | 33 +- types/params.go | 14 +- types/params_test.go | 56 ++-- types/protobuf.go | 11 +- types/protobuf_test.go | 4 +- types/tx.go | 5 + types/vote.go | 5 + types/vote_test.go | 22 +- 33 files changed, 545 insertions(+), 401 deletions(-) delete mode 100644 abci/types/types_test.go create mode 100644 docs/architecture/adr-020-block-size.md diff --git a/Gopkg.lock b/Gopkg.lock index 012bf2ed..aecf4de7 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -525,7 +525,6 @@ "github.com/gogo/protobuf/gogoproto", "github.com/gogo/protobuf/jsonpb", "github.com/gogo/protobuf/proto", - "github.com/gogo/protobuf/types", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 79e16006..7873f097 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -60,7 +60,7 @@ func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{0} + return fileDescriptor_types_c68d3007ea320b94, []int{0} } func (m *Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +482,7 @@ func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} func (*RequestEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{1} + return fileDescriptor_types_c68d3007ea320b94, []int{1} } func (m *RequestEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,7 +528,7 @@ func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} func (*RequestFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{2} + return fileDescriptor_types_c68d3007ea320b94, []int{2} } func (m *RequestFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -568,7 +568,7 @@ func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{3} + return fileDescriptor_types_c68d3007ea320b94, []int{3} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -617,7 +617,7 @@ func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} func (*RequestSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{4} + return fileDescriptor_types_c68d3007ea320b94, []int{4} } func (m *RequestSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -675,7 +675,7 @@ func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} func (*RequestInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{5} + return fileDescriptor_types_c68d3007ea320b94, []int{5} } func (m *RequestInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +753,7 @@ func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{6} + return fileDescriptor_types_c68d3007ea320b94, []int{6} } func (m *RequestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -825,7 +825,7 @@ func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{7} + return fileDescriptor_types_c68d3007ea320b94, []int{7} } func (m *RequestBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -893,7 +893,7 @@ func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} func (*RequestCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{8} + return fileDescriptor_types_c68d3007ea320b94, []int{8} } func (m *RequestCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -940,7 +940,7 @@ func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} func (*RequestDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{9} + return fileDescriptor_types_c68d3007ea320b94, []int{9} } func (m *RequestDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +987,7 @@ func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{10} + return fileDescriptor_types_c68d3007ea320b94, []int{10} } func (m *RequestEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,7 +1033,7 @@ func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} func (*RequestCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{11} + return fileDescriptor_types_c68d3007ea320b94, []int{11} } func (m *RequestCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1086,7 +1086,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{12} + return fileDescriptor_types_c68d3007ea320b94, []int{12} } func (m *Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1539,7 +1539,7 @@ func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} func (*ResponseException) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{13} + return fileDescriptor_types_c68d3007ea320b94, []int{13} } func (m *ResponseException) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1586,7 +1586,7 @@ func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} func (*ResponseEcho) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{14} + return fileDescriptor_types_c68d3007ea320b94, []int{14} } func (m *ResponseEcho) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1632,7 +1632,7 @@ func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{15} + return fileDescriptor_types_c68d3007ea320b94, []int{15} } func (m *ResponseFlush) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1675,7 +1675,7 @@ func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{16} + return fileDescriptor_types_c68d3007ea320b94, []int{16} } func (m *ResponseInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1747,7 +1747,7 @@ func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{17} + return fileDescriptor_types_c68d3007ea320b94, []int{17} } func (m *ResponseSetOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1809,7 +1809,7 @@ func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} func (*ResponseInitChain) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{18} + return fileDescriptor_types_c68d3007ea320b94, []int{18} } func (m *ResponseInitChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1871,7 +1871,7 @@ func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{19} + return fileDescriptor_types_c68d3007ea320b94, []int{19} } func (m *ResponseQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1967,7 +1967,7 @@ func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{20} + return fileDescriptor_types_c68d3007ea320b94, []int{20} } func (m *ResponseBeginBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2020,7 +2020,7 @@ func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{21} + return fileDescriptor_types_c68d3007ea320b94, []int{21} } func (m *ResponseCheckTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2115,7 +2115,7 @@ func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{22} + return fileDescriptor_types_c68d3007ea320b94, []int{22} } func (m *ResponseDeliverTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2206,7 +2206,7 @@ func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} func (*ResponseEndBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{23} + return fileDescriptor_types_c68d3007ea320b94, []int{23} } func (m *ResponseEndBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2268,7 +2268,7 @@ func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{24} + return fileDescriptor_types_c68d3007ea320b94, []int{24} } func (m *ResponseCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2319,7 +2319,7 @@ func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } func (*ConsensusParams) ProtoMessage() {} func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{25} + return fileDescriptor_types_c68d3007ea320b94, []int{25} } func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2372,8 +2372,7 @@ func (m *ConsensusParams) GetBlockGossip() *BlockGossip { // BlockSize contains limits on the block size. type BlockSize struct { MaxBytes int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - MaxTxs int32 `protobuf:"varint,2,opt,name=max_txs,json=maxTxs,proto3" json:"max_txs,omitempty"` - MaxGas int64 `protobuf:"varint,3,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` + MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2383,7 +2382,7 @@ func (m *BlockSize) Reset() { *m = BlockSize{} } func (m *BlockSize) String() string { return proto.CompactTextString(m) } func (*BlockSize) ProtoMessage() {} func (*BlockSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{26} + return fileDescriptor_types_c68d3007ea320b94, []int{26} } func (m *BlockSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2419,13 +2418,6 @@ func (m *BlockSize) GetMaxBytes() int32 { return 0 } -func (m *BlockSize) GetMaxTxs() int32 { - if m != nil { - return m.MaxTxs - } - return 0 -} - func (m *BlockSize) GetMaxGas() int64 { if m != nil { return m.MaxGas @@ -2446,7 +2438,7 @@ func (m *TxSize) Reset() { *m = TxSize{} } func (m *TxSize) String() string { return proto.CompactTextString(m) } func (*TxSize) ProtoMessage() {} func (*TxSize) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{27} + return fileDescriptor_types_c68d3007ea320b94, []int{27} } func (m *TxSize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2503,7 +2495,7 @@ func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{28} + return fileDescriptor_types_c68d3007ea320b94, []int{28} } func (m *BlockGossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2551,7 +2543,7 @@ func (m *LastCommitInfo) Reset() { *m = LastCommitInfo{} } func (m *LastCommitInfo) String() string { return proto.CompactTextString(m) } func (*LastCommitInfo) ProtoMessage() {} func (*LastCommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{29} + return fileDescriptor_types_c68d3007ea320b94, []int{29} } func (m *LastCommitInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2624,7 +2616,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{30} + return fileDescriptor_types_c68d3007ea320b94, []int{30} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2770,7 +2762,7 @@ func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{31} + return fileDescriptor_types_c68d3007ea320b94, []int{31} } func (m *BlockID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2825,7 +2817,7 @@ func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{32} + return fileDescriptor_types_c68d3007ea320b94, []int{32} } func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2882,7 +2874,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{33} + return fileDescriptor_types_c68d3007ea320b94, []int{33} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2938,7 +2930,7 @@ func (m *ValidatorUpdate) Reset() { *m = ValidatorUpdate{} } func (m *ValidatorUpdate) String() string { return proto.CompactTextString(m) } func (*ValidatorUpdate) ProtoMessage() {} func (*ValidatorUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{34} + return fileDescriptor_types_c68d3007ea320b94, []int{34} } func (m *ValidatorUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2994,7 +2986,7 @@ func (m *VoteInfo) Reset() { *m = VoteInfo{} } func (m *VoteInfo) String() string { return proto.CompactTextString(m) } func (*VoteInfo) ProtoMessage() {} func (*VoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{35} + return fileDescriptor_types_c68d3007ea320b94, []int{35} } func (m *VoteInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3049,7 +3041,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{36} + return fileDescriptor_types_c68d3007ea320b94, []int{36} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3107,7 +3099,7 @@ func (m *Evidence) Reset() { *m = Evidence{} } func (m *Evidence) String() string { return proto.CompactTextString(m) } func (*Evidence) ProtoMessage() {} func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_types_bafb6deff4c77e13, []int{37} + return fileDescriptor_types_c68d3007ea320b94, []int{37} } func (m *Evidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4688,9 +4680,6 @@ func (this *BlockSize) Equal(that interface{}) bool { if this.MaxBytes != that1.MaxBytes { return false } - if this.MaxTxs != that1.MaxTxs { - return false - } if this.MaxGas != that1.MaxGas { return false } @@ -5212,7 +5201,8 @@ func (c *aBCIApplicationClient) EndBlock(ctx context.Context, in *RequestEndBloc return out, nil } -// ABCIApplicationServer is the server API for ABCIApplication service. +// Server API for ABCIApplication service + type ABCIApplicationServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) @@ -6821,13 +6811,8 @@ func (m *BlockSize) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxBytes)) } - if m.MaxTxs != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTxs)) - } if m.MaxGas != 0 { - dAtA[i] = 0x18 + dAtA[i] = 0x10 i++ i = encodeVarintTypes(dAtA, i, uint64(m.MaxGas)) } @@ -7899,16 +7884,12 @@ func NewPopulatedBlockSize(r randyTypes, easy bool) *BlockSize { if r.Intn(2) == 0 { this.MaxBytes *= -1 } - this.MaxTxs = int32(r.Int31()) - if r.Intn(2) == 0 { - this.MaxTxs *= -1 - } this.MaxGas = int64(r.Int63()) if r.Intn(2) == 0 { this.MaxGas *= -1 } if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTypes(r, 4) + this.XXX_unrecognized = randUnrecognizedTypes(r, 3) } return this } @@ -8905,9 +8886,6 @@ func (m *BlockSize) Size() (n int) { if m.MaxBytes != 0 { n += 1 + sovTypes(uint64(m.MaxBytes)) } - if m.MaxTxs != 0 { - n += 1 + sovTypes(uint64(m.MaxTxs)) - } if m.MaxGas != 0 { n += 1 + sovTypes(uint64(m.MaxGas)) } @@ -12960,25 +12938,6 @@ func (m *BlockSize) Unmarshal(dAtA []byte) error { } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTxs", wireType) - } - m.MaxTxs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTxs |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) } @@ -14664,144 +14623,143 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) } +func init() { proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_c68d3007ea320b94) } func init() { - golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_bafb6deff4c77e13) + golang_proto.RegisterFile("abci/types/types.proto", fileDescriptor_types_c68d3007ea320b94) } -var fileDescriptor_types_bafb6deff4c77e13 = []byte{ - // 2115 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6e, 0x1b, 0xc9, - 0xd1, 0xd7, 0x50, 0x14, 0xc9, 0x29, 0x4a, 0xa4, 0xdc, 0xb6, 0x25, 0x9a, 0xfb, 0x7d, 0x92, 0x31, - 0x49, 0xbc, 0x52, 0x56, 0x2b, 0x6d, 0xb4, 0x71, 0x20, 0xaf, 0x37, 0x8b, 0x88, 0xb6, 0xb3, 0x12, - 0x76, 0x93, 0x28, 0x63, 0x5b, 0x01, 0x82, 0x00, 0x83, 0x26, 0xa7, 0x45, 0x0e, 0x4c, 0xce, 0xcc, - 0x4e, 0x37, 0xb5, 0x94, 0x9f, 0x61, 0x0f, 0x7b, 0x08, 0x90, 0x73, 0x6e, 0x79, 0x81, 0x00, 0x39, - 0xe6, 0x14, 0xec, 0x31, 0x08, 0x12, 0xe4, 0xe6, 0x24, 0x0a, 0x72, 0x48, 0x9e, 0x20, 0xc7, 0xa0, - 0xab, 0x7b, 0xfe, 0x6a, 0x68, 0xd8, 0xce, 0x2d, 0x17, 0x72, 0xba, 0xab, 0xaa, 0xbb, 0xab, 0xba, - 0xaa, 0x7e, 0x55, 0x0d, 0x6b, 0xb4, 0x3f, 0xf0, 0xf6, 0xc4, 0x45, 0xc8, 0xb8, 0xfa, 0xdd, 0x0d, - 0xa3, 0x40, 0x04, 0x64, 0x09, 0x07, 0xdd, 0x77, 0x87, 0x9e, 0x18, 0x4d, 0xfb, 0xbb, 0x83, 0x60, - 0xb2, 0x37, 0x0c, 0x86, 0xc1, 0x1e, 0x52, 0xfb, 0xd3, 0x33, 0x1c, 0xe1, 0x00, 0xbf, 0x94, 0x54, - 0x77, 0x73, 0x18, 0x04, 0xc3, 0x31, 0x4b, 0xb9, 0x84, 0x37, 0x61, 0x5c, 0xd0, 0x49, 0xa8, 0x19, - 0x0e, 0x32, 0xeb, 0x09, 0xe6, 0xbb, 0x2c, 0x9a, 0x78, 0xbe, 0xc8, 0x7e, 0x8e, 0xbd, 0x3e, 0xdf, - 0x1b, 0x04, 0x93, 0x49, 0xe0, 0x67, 0x0f, 0x64, 0xfd, 0xae, 0x0a, 0x75, 0x9b, 0x7d, 0x36, 0x65, - 0x5c, 0x90, 0x2d, 0xa8, 0xb2, 0xc1, 0x28, 0xe8, 0x54, 0x6e, 0x1b, 0x5b, 0xcd, 0x7d, 0xb2, 0xab, - 0xf8, 0x34, 0xf5, 0xd1, 0x60, 0x14, 0x1c, 0x2d, 0xd8, 0xc8, 0x41, 0xde, 0x81, 0xa5, 0xb3, 0xf1, - 0x94, 0x8f, 0x3a, 0x8b, 0xc8, 0x7a, 0x3d, 0xcf, 0xfa, 0x7d, 0x49, 0x3a, 0x5a, 0xb0, 0x15, 0x8f, - 0x5c, 0xd6, 0xf3, 0xcf, 0x82, 0x4e, 0xb5, 0x6c, 0xd9, 0x63, 0xff, 0x0c, 0x97, 0x95, 0x1c, 0xe4, - 0x00, 0x80, 0x33, 0xe1, 0x04, 0xa1, 0xf0, 0x02, 0xbf, 0xb3, 0x84, 0xfc, 0xeb, 0x79, 0xfe, 0xc7, - 0x4c, 0xfc, 0x08, 0xc9, 0x47, 0x0b, 0xb6, 0xc9, 0xe3, 0x81, 0x94, 0xf4, 0x7c, 0x4f, 0x38, 0x83, - 0x11, 0xf5, 0xfc, 0x4e, 0xad, 0x4c, 0xf2, 0xd8, 0xf7, 0xc4, 0x03, 0x49, 0x96, 0x92, 0x5e, 0x3c, - 0x90, 0xaa, 0x7c, 0x36, 0x65, 0xd1, 0x45, 0xa7, 0x5e, 0xa6, 0xca, 0x8f, 0x25, 0x49, 0xaa, 0x82, - 0x3c, 0xe4, 0x3e, 0x34, 0xfb, 0x6c, 0xe8, 0xf9, 0x4e, 0x7f, 0x1c, 0x0c, 0x9e, 0x75, 0x1a, 0x28, - 0xd2, 0xc9, 0x8b, 0xf4, 0x24, 0x43, 0x4f, 0xd2, 0x8f, 0x16, 0x6c, 0xe8, 0x27, 0x23, 0xb2, 0x0f, - 0x8d, 0xc1, 0x88, 0x0d, 0x9e, 0x39, 0x62, 0xd6, 0x31, 0x51, 0xf2, 0x66, 0x5e, 0xf2, 0x81, 0xa4, - 0x3e, 0x99, 0x1d, 0x2d, 0xd8, 0xf5, 0x81, 0xfa, 0x24, 0x77, 0xc1, 0x64, 0xbe, 0xab, 0xb7, 0x6b, - 0xa2, 0xd0, 0x5a, 0xe1, 0x5e, 0x7c, 0x37, 0xde, 0xac, 0xc1, 0xf4, 0x37, 0xd9, 0x85, 0x9a, 0xbc, - 0x6b, 0x4f, 0x74, 0x96, 0x51, 0xe6, 0x46, 0x61, 0x23, 0xa4, 0x1d, 0x2d, 0xd8, 0x9a, 0x4b, 0x9a, - 0xcf, 0x65, 0x63, 0xef, 0x9c, 0x45, 0xf2, 0x70, 0xd7, 0xcb, 0xcc, 0xf7, 0x50, 0xd1, 0xf1, 0x78, - 0xa6, 0x1b, 0x0f, 0x7a, 0x75, 0x58, 0x3a, 0xa7, 0xe3, 0x29, 0xb3, 0xde, 0x86, 0x66, 0xc6, 0x53, - 0x48, 0x07, 0xea, 0x13, 0xc6, 0x39, 0x1d, 0xb2, 0x8e, 0x71, 0xdb, 0xd8, 0x32, 0xed, 0x78, 0x68, - 0xb5, 0x60, 0x39, 0xeb, 0x27, 0x19, 0x41, 0xe9, 0x0b, 0x52, 0xf0, 0x9c, 0x45, 0x5c, 0x3a, 0x80, - 0x16, 0xd4, 0x43, 0xeb, 0x03, 0x58, 0x2d, 0x3a, 0x01, 0x59, 0x85, 0xc5, 0x67, 0xec, 0x42, 0x73, - 0xca, 0x4f, 0x72, 0x43, 0x1f, 0x08, 0xbd, 0xd8, 0xb4, 0xf5, 0xe9, 0xbe, 0xac, 0x24, 0xc2, 0x89, - 0x1f, 0x90, 0x03, 0xa8, 0xca, 0x40, 0x42, 0xe9, 0xe6, 0x7e, 0x77, 0x57, 0x45, 0xd9, 0x6e, 0x1c, - 0x65, 0xbb, 0x4f, 0xe2, 0x28, 0xeb, 0x35, 0xbe, 0x7a, 0xb1, 0xb9, 0xf0, 0xe5, 0x5f, 0x36, 0x0d, - 0x1b, 0x25, 0xc8, 0x2d, 0x79, 0x95, 0xd4, 0xf3, 0x1d, 0xcf, 0xd5, 0xfb, 0xd4, 0x71, 0x7c, 0xec, - 0x92, 0x43, 0x58, 0x1d, 0x04, 0x3e, 0x67, 0x3e, 0x9f, 0x72, 0x27, 0xa4, 0x11, 0x9d, 0x70, 0x1d, - 0x25, 0xf1, 0xc5, 0x3d, 0x88, 0xc9, 0x27, 0x48, 0xb5, 0xdb, 0x83, 0xfc, 0x04, 0xf9, 0x10, 0xe0, - 0x9c, 0x8e, 0x3d, 0x97, 0x8a, 0x20, 0xe2, 0x9d, 0xea, 0xed, 0xc5, 0x8c, 0xf0, 0x69, 0x4c, 0x78, - 0x1a, 0xba, 0x54, 0xb0, 0x5e, 0x55, 0x9e, 0xcc, 0xce, 0xf0, 0x93, 0x3b, 0xd0, 0xa6, 0x61, 0xe8, - 0x70, 0x41, 0x05, 0x73, 0xfa, 0x17, 0x82, 0x71, 0x8c, 0xa4, 0x65, 0x7b, 0x85, 0x86, 0xe1, 0x63, - 0x39, 0xdb, 0x93, 0x93, 0x96, 0x9b, 0xdc, 0x03, 0x3a, 0x39, 0x21, 0x50, 0x75, 0xa9, 0xa0, 0x68, - 0x8d, 0x65, 0x1b, 0xbf, 0xe5, 0x5c, 0x48, 0xc5, 0x48, 0xeb, 0x88, 0xdf, 0x64, 0x0d, 0x6a, 0x23, - 0xe6, 0x0d, 0x47, 0x02, 0xd5, 0x5a, 0xb4, 0xf5, 0x48, 0x1a, 0x3e, 0x8c, 0x82, 0x73, 0x86, 0x71, - 0xde, 0xb0, 0xd5, 0xc0, 0xfa, 0x87, 0x01, 0xd7, 0xae, 0x04, 0x86, 0x5c, 0x77, 0x44, 0xf9, 0x28, - 0xde, 0x4b, 0x7e, 0x93, 0x77, 0xe4, 0xba, 0xd4, 0x65, 0x91, 0xce, 0x3f, 0x2b, 0x5a, 0xe3, 0x23, - 0x9c, 0xd4, 0x8a, 0x6a, 0x16, 0xf2, 0x08, 0x56, 0xc7, 0x94, 0x0b, 0x47, 0xf9, 0xaf, 0x83, 0xf9, - 0x65, 0x31, 0x17, 0x53, 0x9f, 0xd2, 0xd8, 0xcf, 0xa5, 0x5b, 0x69, 0xf1, 0xd6, 0x38, 0x37, 0x4b, - 0x8e, 0xe0, 0x46, 0xff, 0xe2, 0x39, 0xf5, 0x85, 0xe7, 0x33, 0xe7, 0x8a, 0xcd, 0xdb, 0x7a, 0xa9, - 0x47, 0xe7, 0x9e, 0xcb, 0xfc, 0x41, 0x6c, 0xec, 0xeb, 0x89, 0x48, 0x72, 0x19, 0xdc, 0xba, 0x0d, - 0xad, 0x7c, 0x14, 0x93, 0x16, 0x54, 0xc4, 0x4c, 0x6b, 0x58, 0x11, 0x33, 0xcb, 0x4a, 0x3c, 0x30, - 0x09, 0xa5, 0x2b, 0x3c, 0xdb, 0xd0, 0x2e, 0x84, 0x75, 0xc6, 0xdc, 0x46, 0xd6, 0xdc, 0x56, 0x1b, - 0x56, 0x72, 0xd1, 0x6c, 0x7d, 0xb1, 0x04, 0x0d, 0x9b, 0xf1, 0x50, 0x3a, 0x13, 0x39, 0x00, 0x93, - 0xcd, 0x06, 0x4c, 0x25, 0x52, 0xa3, 0x90, 0xa6, 0x14, 0xcf, 0xa3, 0x98, 0x2e, 0x03, 0x3a, 0x61, - 0x26, 0xdb, 0x39, 0x10, 0xb8, 0x5e, 0x14, 0xca, 0xa2, 0xc0, 0x4e, 0x1e, 0x05, 0x6e, 0x14, 0x78, - 0x0b, 0x30, 0xb0, 0x9d, 0x83, 0x81, 0xe2, 0xc2, 0x39, 0x1c, 0xb8, 0x57, 0x82, 0x03, 0xc5, 0xe3, - 0xcf, 0x01, 0x82, 0x7b, 0x25, 0x40, 0xd0, 0xb9, 0xb2, 0x57, 0x29, 0x12, 0xec, 0xe4, 0x91, 0xa0, - 0xa8, 0x4e, 0x01, 0x0a, 0x3e, 0x2c, 0x83, 0x82, 0x5b, 0x05, 0x99, 0xb9, 0x58, 0xf0, 0xfe, 0x15, - 0x2c, 0x58, 0x2b, 0x88, 0x96, 0x80, 0xc1, 0xbd, 0x5c, 0x96, 0x86, 0x52, 0xdd, 0xca, 0xd3, 0x34, - 0xf9, 0xce, 0x55, 0x1c, 0x59, 0x2f, 0x5e, 0x6d, 0x19, 0x90, 0xec, 0x15, 0x80, 0xe4, 0x66, 0xf1, - 0x94, 0x05, 0x24, 0x49, 0xf1, 0x60, 0x5b, 0xc6, 0x7d, 0xc1, 0xd3, 0x64, 0x8e, 0x60, 0x51, 0x14, - 0x44, 0x3a, 0x61, 0xab, 0x81, 0xb5, 0x25, 0x33, 0x51, 0xea, 0x5f, 0x2f, 0xc1, 0x0e, 0x74, 0xfa, - 0x8c, 0x77, 0x59, 0xbf, 0x30, 0x52, 0x59, 0x8c, 0xe8, 0x6c, 0x16, 0x33, 0x75, 0x16, 0xcb, 0x40, - 0x4a, 0x25, 0x07, 0x29, 0xe4, 0x9b, 0x70, 0x0d, 0xd3, 0x08, 0xda, 0xc5, 0xc9, 0xa5, 0xb5, 0xb6, - 0x24, 0x28, 0x83, 0xa8, 0xfc, 0xf6, 0x2e, 0x5c, 0xcf, 0xf0, 0xca, 0x14, 0x8b, 0x29, 0xac, 0x8a, - 0xc1, 0xbb, 0x9a, 0x70, 0x1f, 0x86, 0xe1, 0x11, 0xe5, 0x23, 0xeb, 0x07, 0xa9, 0xfe, 0x29, 0x5c, - 0x11, 0xa8, 0x0e, 0x02, 0x57, 0xa9, 0xb5, 0x62, 0xe3, 0xb7, 0x84, 0xb0, 0x71, 0x30, 0xc4, 0x5d, - 0x4d, 0x5b, 0x7e, 0x4a, 0xae, 0x24, 0x52, 0x4c, 0x15, 0x12, 0xd6, 0xcf, 0x8d, 0x74, 0xbd, 0x14, - 0xc1, 0xca, 0xc0, 0xc6, 0xf8, 0x6f, 0xc0, 0xa6, 0xf2, 0x7a, 0x60, 0x63, 0xfd, 0xda, 0x48, 0x6f, - 0x24, 0x81, 0x91, 0x37, 0x53, 0x51, 0x3a, 0x87, 0xe7, 0xbb, 0x6c, 0x86, 0x01, 0xbf, 0x68, 0xab, - 0x41, 0x8c, 0xf0, 0x35, 0x34, 0x73, 0x1e, 0xe1, 0xeb, 0x38, 0xa7, 0x06, 0x1a, 0x7e, 0x82, 0x33, - 0x8c, 0xc4, 0x65, 0x5b, 0x0d, 0x32, 0xd9, 0xd3, 0xcc, 0x65, 0xcf, 0x13, 0x20, 0x57, 0x63, 0x94, - 0x7c, 0x00, 0x55, 0x41, 0x87, 0xd2, 0x84, 0xd2, 0x0a, 0xad, 0x5d, 0x55, 0x2f, 0xef, 0x7e, 0x72, - 0x7a, 0x42, 0xbd, 0xa8, 0xb7, 0x26, 0xb5, 0xff, 0xd7, 0x8b, 0xcd, 0x96, 0xe4, 0xd9, 0x09, 0x26, - 0x9e, 0x60, 0x93, 0x50, 0x5c, 0xd8, 0x28, 0x63, 0xfd, 0xc9, 0x90, 0xb9, 0x3b, 0x17, 0xbb, 0xa5, - 0xb6, 0x88, 0x1d, 0xb4, 0x92, 0x81, 0xd9, 0x57, 0xb3, 0xcf, 0xff, 0x03, 0x0c, 0x29, 0x77, 0x3e, - 0xa7, 0xbe, 0x60, 0xae, 0x36, 0x92, 0x39, 0xa4, 0xfc, 0x27, 0x38, 0x21, 0x6b, 0x12, 0x49, 0x9e, - 0x72, 0xe6, 0xa2, 0xb5, 0x16, 0xed, 0xfa, 0x90, 0xf2, 0xa7, 0x9c, 0xb9, 0x89, 0x5e, 0xf5, 0x37, - 0xd0, 0xeb, 0xcf, 0x19, 0xc7, 0x4b, 0x81, 0xeb, 0x7f, 0x41, 0xb3, 0x7f, 0x1a, 0x12, 0x91, 0xf3, - 0xc9, 0x8f, 0x1c, 0xc3, 0xb5, 0xc4, 0xbd, 0x9d, 0x29, 0xba, 0x7d, 0xec, 0x0f, 0x2f, 0x8f, 0x8a, - 0xd5, 0xf3, 0xfc, 0x34, 0x27, 0x3f, 0x84, 0xf5, 0x42, 0x70, 0x26, 0x0b, 0x56, 0x5e, 0x1a, 0xa3, - 0x37, 0xf3, 0x31, 0x1a, 0xaf, 0x17, 0xeb, 0xba, 0xf8, 0x06, 0xba, 0x7e, 0x5d, 0x96, 0x27, 0xd9, - 0x94, 0x5d, 0x76, 0x5b, 0xd6, 0x2f, 0x0d, 0x68, 0x17, 0x0e, 0x43, 0xf6, 0x00, 0x54, 0xc6, 0xe3, - 0xde, 0xf3, 0xb8, 0x54, 0x5e, 0xd5, 0x07, 0x47, 0x93, 0x3d, 0xf6, 0x9e, 0x33, 0xdb, 0xec, 0xc7, - 0x9f, 0xe4, 0x0e, 0xd4, 0xc5, 0x4c, 0x71, 0xe7, 0x0b, 0xb9, 0x27, 0x33, 0x64, 0xad, 0x09, 0xfc, - 0x27, 0x77, 0x61, 0x59, 0x2d, 0x3c, 0x0c, 0x38, 0xf7, 0x42, 0x5d, 0x44, 0x90, 0xec, 0xd2, 0x1f, - 0x23, 0xc5, 0x6e, 0xf6, 0xd3, 0x81, 0xf5, 0x53, 0x30, 0x93, 0x6d, 0xc9, 0x5b, 0x60, 0x4e, 0xe8, - 0x4c, 0x57, 0xb9, 0xf2, 0x6c, 0x4b, 0x76, 0x63, 0x42, 0x67, 0x58, 0xe0, 0x92, 0x75, 0xa8, 0x4b, - 0xa2, 0x98, 0x29, 0x7b, 0x2f, 0xd9, 0xb5, 0x09, 0x9d, 0x3d, 0x99, 0x25, 0x84, 0x21, 0xe5, 0x71, - 0x09, 0x3b, 0xa1, 0xb3, 0x8f, 0x29, 0xb7, 0x3e, 0x82, 0x9a, 0x3a, 0xe4, 0x2b, 0x2d, 0x2c, 0xe5, - 0x2b, 0x39, 0xf9, 0xef, 0x41, 0x33, 0x73, 0x6e, 0xf2, 0x2d, 0xb8, 0xa9, 0x34, 0x0c, 0x69, 0x24, - 0xd0, 0x22, 0xb9, 0x05, 0x09, 0x12, 0x4f, 0x68, 0x24, 0xe4, 0x96, 0xaa, 0x28, 0x7f, 0x0c, 0xad, - 0x7c, 0xe1, 0x2a, 0xf3, 0x5a, 0x14, 0x4c, 0x7d, 0x57, 0x0b, 0xa9, 0x81, 0xec, 0x5a, 0xcf, 0x03, - 0xe5, 0x49, 0xd9, 0x4a, 0xf5, 0x34, 0x10, 0x2c, 0x53, 0xee, 0x2a, 0x1e, 0xeb, 0x0f, 0x55, 0xa8, - 0xa9, 0x2a, 0x9a, 0xdc, 0xc9, 0x34, 0x2e, 0x08, 0x91, 0xbd, 0xe6, 0xe5, 0x8b, 0xcd, 0x3a, 0xa2, - 0xc9, 0xf1, 0xc3, 0xb4, 0x8b, 0x49, 0xf3, 0x66, 0x25, 0x57, 0xe4, 0xc7, 0x2d, 0xd3, 0xe2, 0x6b, - 0xb7, 0x4c, 0xeb, 0x50, 0xf7, 0xa7, 0x13, 0xbc, 0x8d, 0xaa, 0x5a, 0xd2, 0x9f, 0x4e, 0xe4, 0x6d, - 0xbc, 0x05, 0xa6, 0x08, 0x04, 0x1d, 0x23, 0x49, 0xc5, 0x7e, 0x03, 0x27, 0x24, 0xf1, 0x00, 0x56, - 0x32, 0xa0, 0xeb, 0xb9, 0xba, 0xa2, 0x6b, 0x65, 0xbd, 0xe4, 0xf8, 0xa1, 0x56, 0xb7, 0x99, 0x80, - 0xf0, 0xb1, 0x4b, 0xb6, 0xf2, 0x1d, 0x02, 0x62, 0xb5, 0x02, 0x8c, 0x4c, 0x13, 0x20, 0x91, 0x5a, - 0x1e, 0x40, 0x7a, 0xbf, 0x62, 0x51, 0xe8, 0xd1, 0x90, 0x13, 0x48, 0x7c, 0x1b, 0xda, 0x29, 0xdc, - 0x29, 0x16, 0x53, 0xad, 0x92, 0x4e, 0x23, 0xe3, 0x7b, 0x70, 0xc3, 0x67, 0x33, 0xe1, 0x14, 0xb9, - 0x01, 0xb9, 0x89, 0xa4, 0x9d, 0xe6, 0x25, 0xbe, 0x01, 0xad, 0x34, 0x3f, 0x20, 0x6f, 0x53, 0xf5, - 0x69, 0xc9, 0x2c, 0xb2, 0xdd, 0x82, 0x46, 0x52, 0x6c, 0x2c, 0x23, 0x43, 0x9d, 0xaa, 0x1a, 0x23, - 0x29, 0x5f, 0x22, 0xc6, 0xa7, 0x63, 0xa1, 0x17, 0x59, 0x41, 0x1e, 0x2c, 0x5f, 0x6c, 0x35, 0x8f, - 0xbc, 0x5f, 0x83, 0x15, 0xa6, 0xfb, 0x18, 0xc5, 0xd7, 0x42, 0xbe, 0xe5, 0x78, 0x12, 0x99, 0xb6, - 0x61, 0x35, 0x8c, 0x82, 0x30, 0xe0, 0x2c, 0x72, 0xa8, 0xeb, 0x46, 0x8c, 0xf3, 0x4e, 0x5b, 0xad, - 0x17, 0xcf, 0x1f, 0xaa, 0x69, 0xeb, 0x67, 0x50, 0xd7, 0xd6, 0x2f, 0xed, 0xe6, 0xbe, 0x0b, 0xcb, - 0xd2, 0xeb, 0xb9, 0x93, 0xeb, 0xe9, 0xe2, 0x9a, 0x1a, 0x9d, 0x9e, 0x89, 0x5c, 0x6b, 0xd7, 0x44, - 0x7e, 0x35, 0x65, 0xdd, 0x83, 0x95, 0x1c, 0x8f, 0x0c, 0x03, 0x74, 0x8a, 0x38, 0x0c, 0x70, 0x90, - 0xec, 0x5c, 0x49, 0x77, 0xb6, 0xee, 0x83, 0x99, 0x18, 0x5a, 0x96, 0x7e, 0xb1, 0x1e, 0x86, 0xb6, - 0x9d, 0x1a, 0x62, 0xbd, 0x10, 0x7c, 0xce, 0x22, 0x9d, 0x02, 0xd4, 0xc0, 0x7a, 0x0a, 0xed, 0x42, - 0x7a, 0x27, 0x3b, 0x50, 0x0f, 0xa7, 0x7d, 0x27, 0x7e, 0x66, 0x48, 0xf3, 0xd9, 0xc9, 0xb4, 0xff, - 0x09, 0xbb, 0x88, 0x1b, 0xd3, 0x10, 0x47, 0xe9, 0xb2, 0x95, 0xec, 0xb2, 0x63, 0x68, 0xc4, 0xa1, - 0x49, 0xbe, 0x0d, 0x66, 0xe2, 0x23, 0x85, 0x7c, 0x9a, 0x6c, 0xad, 0x17, 0x4d, 0x19, 0xe5, 0x55, - 0x73, 0x6f, 0xe8, 0x33, 0xd7, 0x49, 0xe3, 0x01, 0xf7, 0x68, 0xd8, 0x6d, 0x45, 0xf8, 0x34, 0x76, - 0x7e, 0xeb, 0x3d, 0xa8, 0xa9, 0xb3, 0x49, 0xfb, 0xc8, 0x95, 0xe3, 0x6a, 0x58, 0x7e, 0x97, 0x26, - 0xfe, 0x3f, 0x1a, 0xd0, 0x88, 0xbb, 0xdc, 0x52, 0xa1, 0xdc, 0xa1, 0x2b, 0xaf, 0x7a, 0xe8, 0x79, - 0x4f, 0x05, 0x71, 0x16, 0xa9, 0xbe, 0x76, 0x16, 0xd9, 0x01, 0xa2, 0x92, 0xc5, 0x79, 0x20, 0x3c, - 0x7f, 0xe8, 0x28, 0x5b, 0xab, 0xac, 0xb1, 0x8a, 0x94, 0x53, 0x24, 0x9c, 0xc8, 0xf9, 0xfd, 0x2f, - 0x96, 0xa0, 0x7d, 0xd8, 0x7b, 0x70, 0x7c, 0x18, 0x86, 0x63, 0x6f, 0x40, 0xb1, 0x04, 0xdf, 0x83, - 0x2a, 0x36, 0x19, 0x25, 0xcf, 0x9b, 0xdd, 0xb2, 0x6e, 0x97, 0xec, 0xc3, 0x12, 0xf6, 0x1a, 0xa4, - 0xec, 0x95, 0xb3, 0x5b, 0xda, 0xf4, 0xca, 0x4d, 0x54, 0x37, 0x72, 0xf5, 0xb1, 0xb3, 0x5b, 0xd6, - 0xf9, 0x92, 0x8f, 0xc0, 0x4c, 0xbb, 0x84, 0x79, 0x4f, 0x9e, 0xdd, 0xb9, 0x3d, 0xb0, 0x94, 0x4f, - 0x8b, 0xb3, 0x79, 0x2f, 0x77, 0xdd, 0xb9, 0xcd, 0x22, 0x39, 0x80, 0x7a, 0x5c, 0xb4, 0x96, 0x3f, - 0x4a, 0x76, 0xe7, 0xf4, 0xa7, 0xd2, 0x3c, 0xaa, 0xf0, 0x2f, 0x7b, 0x39, 0xed, 0x96, 0x36, 0xd1, - 0xe4, 0x2e, 0xd4, 0x74, 0x15, 0x52, 0xfa, 0x30, 0xd9, 0x2d, 0xef, 0x32, 0xa5, 0x92, 0x69, 0xeb, - 0x33, 0xef, 0x75, 0xb7, 0x3b, 0xb7, 0xdb, 0x27, 0x87, 0x00, 0x99, 0x62, 0x7f, 0xee, 0xb3, 0x6d, - 0x77, 0x7e, 0x17, 0x4f, 0xee, 0x43, 0x23, 0x7d, 0x99, 0x29, 0x7f, 0x88, 0xed, 0xce, 0x6b, 0xac, - 0x7b, 0xff, 0xf7, 0xef, 0xbf, 0x6d, 0x18, 0xbf, 0xba, 0xdc, 0x30, 0x7e, 0x73, 0xb9, 0x61, 0x7c, - 0x75, 0xb9, 0x61, 0xfc, 0xfe, 0x72, 0xc3, 0xf8, 0xeb, 0xe5, 0x86, 0xf1, 0xdb, 0xbf, 0x6f, 0x18, - 0xfd, 0x1a, 0xba, 0xff, 0xfb, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x32, 0xa1, 0x6a, 0x3b, +var fileDescriptor_types_c68d3007ea320b94 = []byte{ + // 2099 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0xf7, 0x48, 0xb2, 0xfe, 0x3c, 0xd9, 0x92, 0xd3, 0x76, 0x6c, 0x45, 0x80, 0x9d, 0x1a, 0x20, + 0x6b, 0xb3, 0x5e, 0x7b, 0xf1, 0x12, 0xca, 0xd9, 0x2c, 0x5b, 0x58, 0x49, 0x58, 0xbb, 0x76, 0x01, + 0x33, 0x49, 0xcc, 0x85, 0xaa, 0xa9, 0x96, 0xa6, 0x2d, 0x4d, 0x45, 0x9a, 0x99, 0x9d, 0x6e, 0x79, + 0xe5, 0x7c, 0x86, 0x3d, 0xec, 0x81, 0x2a, 0xce, 0xdc, 0xf8, 0x02, 0x54, 0x71, 0xe4, 0x44, 0xed, + 0x91, 0xa2, 0xa0, 0xb8, 0x05, 0x30, 0xc5, 0x01, 0x3e, 0x01, 0x47, 0xaa, 0x5f, 0xf7, 0xfc, 0xf5, + 0x28, 0x95, 0x84, 0xdb, 0x5e, 0xa4, 0xee, 0x7e, 0xef, 0x75, 0xf7, 0x7b, 0xf3, 0xde, 0xfb, 0xbd, + 0xd7, 0xb0, 0x4e, 0xfb, 0x03, 0x77, 0x5f, 0x5c, 0x06, 0x8c, 0xab, 0xdf, 0xbd, 0x20, 0xf4, 0x85, + 0x4f, 0x16, 0x71, 0xd2, 0x7d, 0x67, 0xe8, 0x8a, 0xd1, 0xb4, 0xbf, 0x37, 0xf0, 0x27, 0xfb, 0x43, + 0x7f, 0xe8, 0xef, 0x23, 0xb5, 0x3f, 0x3d, 0xc7, 0x19, 0x4e, 0x70, 0xa4, 0xa4, 0xba, 0x5b, 0x43, + 0xdf, 0x1f, 0x8e, 0x59, 0xc2, 0x25, 0xdc, 0x09, 0xe3, 0x82, 0x4e, 0x02, 0xcd, 0x70, 0x98, 0xda, + 0x4f, 0x30, 0xcf, 0x61, 0xe1, 0xc4, 0xf5, 0x44, 0x7a, 0x38, 0x76, 0xfb, 0x7c, 0x7f, 0xe0, 0x4f, + 0x26, 0xbe, 0x97, 0xbe, 0x90, 0xf9, 0x87, 0x0a, 0xd4, 0x2c, 0xf6, 0xe9, 0x94, 0x71, 0x41, 0xb6, + 0xa1, 0xc2, 0x06, 0x23, 0xbf, 0x53, 0xba, 0x6d, 0x6c, 0x37, 0x0f, 0xc8, 0x9e, 0xe2, 0xd3, 0xd4, + 0x47, 0x83, 0x91, 0x7f, 0xbc, 0x60, 0x21, 0x07, 0x79, 0x1b, 0x16, 0xcf, 0xc7, 0x53, 0x3e, 0xea, + 0x94, 0x91, 0x75, 0x35, 0xcb, 0xfa, 0x23, 0x49, 0x3a, 0x5e, 0xb0, 0x14, 0x8f, 0xdc, 0xd6, 0xf5, + 0xce, 0xfd, 0x4e, 0xa5, 0x68, 0xdb, 0x13, 0xef, 0x1c, 0xb7, 0x95, 0x1c, 0xe4, 0x10, 0x80, 0x33, + 0x61, 0xfb, 0x81, 0x70, 0x7d, 0xaf, 0xb3, 0x88, 0xfc, 0x1b, 0x59, 0xfe, 0xc7, 0x4c, 0xfc, 0x14, + 0xc9, 0xc7, 0x0b, 0x56, 0x83, 0x47, 0x13, 0x29, 0xe9, 0x7a, 0xae, 0xb0, 0x07, 0x23, 0xea, 0x7a, + 0x9d, 0x6a, 0x91, 0xe4, 0x89, 0xe7, 0x8a, 0x07, 0x92, 0x2c, 0x25, 0xdd, 0x68, 0x22, 0x55, 0xf9, + 0x74, 0xca, 0xc2, 0xcb, 0x4e, 0xad, 0x48, 0x95, 0x9f, 0x49, 0x92, 0x54, 0x05, 0x79, 0xc8, 0x7d, + 0x68, 0xf6, 0xd9, 0xd0, 0xf5, 0xec, 0xfe, 0xd8, 0x1f, 0x3c, 0xeb, 0xd4, 0x51, 0xa4, 0x93, 0x15, + 0xe9, 0x49, 0x86, 0x9e, 0xa4, 0x1f, 0x2f, 0x58, 0xd0, 0x8f, 0x67, 0xe4, 0x00, 0xea, 0x83, 0x11, + 0x1b, 0x3c, 0xb3, 0xc5, 0xac, 0xd3, 0x40, 0xc9, 0x9b, 0x59, 0xc9, 0x07, 0x92, 0xfa, 0x64, 0x76, + 0xbc, 0x60, 0xd5, 0x06, 0x6a, 0x48, 0xee, 0x42, 0x83, 0x79, 0x8e, 0x3e, 0xae, 0x89, 0x42, 0xeb, + 0xb9, 0xef, 0xe2, 0x39, 0xd1, 0x61, 0x75, 0xa6, 0xc7, 0x64, 0x0f, 0xaa, 0xf2, 0x5b, 0xbb, 0xa2, + 0xb3, 0x84, 0x32, 0x6b, 0xb9, 0x83, 0x90, 0x76, 0xbc, 0x60, 0x69, 0x2e, 0x69, 0x3e, 0x87, 0x8d, + 0xdd, 0x0b, 0x16, 0xca, 0xcb, 0xad, 0x16, 0x99, 0xef, 0xa1, 0xa2, 0xe3, 0xf5, 0x1a, 0x4e, 0x34, + 0xe9, 0xd5, 0x60, 0xf1, 0x82, 0x8e, 0xa7, 0xcc, 0x7c, 0x0b, 0x9a, 0x29, 0x4f, 0x21, 0x1d, 0xa8, + 0x4d, 0x18, 0xe7, 0x74, 0xc8, 0x3a, 0xc6, 0x6d, 0x63, 0xbb, 0x61, 0x45, 0x53, 0xb3, 0x05, 0x4b, + 0x69, 0x3f, 0x49, 0x09, 0x4a, 0x5f, 0x90, 0x82, 0x17, 0x2c, 0xe4, 0xd2, 0x01, 0xb4, 0xa0, 0x9e, + 0x9a, 0xef, 0xc3, 0x4a, 0xde, 0x09, 0xc8, 0x0a, 0x94, 0x9f, 0xb1, 0x4b, 0xcd, 0x29, 0x87, 0x64, + 0x4d, 0x5f, 0x08, 0xbd, 0xb8, 0x61, 0xe9, 0xdb, 0x7d, 0x51, 0x8a, 0x85, 0x63, 0x3f, 0x20, 0x87, + 0x50, 0x91, 0x81, 0x84, 0xd2, 0xcd, 0x83, 0xee, 0x9e, 0x8a, 0xb2, 0xbd, 0x28, 0xca, 0xf6, 0x9e, + 0x44, 0x51, 0xd6, 0xab, 0x7f, 0xf9, 0x62, 0x6b, 0xe1, 0x8b, 0xbf, 0x6d, 0x19, 0x16, 0x4a, 0x90, + 0x5b, 0xf2, 0x53, 0x52, 0xd7, 0xb3, 0x5d, 0x47, 0x9f, 0x53, 0xc3, 0xf9, 0x89, 0x43, 0x8e, 0x60, + 0x65, 0xe0, 0x7b, 0x9c, 0x79, 0x7c, 0xca, 0xed, 0x80, 0x86, 0x74, 0xc2, 0x75, 0x94, 0x44, 0x1f, + 0xee, 0x41, 0x44, 0x3e, 0x45, 0xaa, 0xd5, 0x1e, 0x64, 0x17, 0xc8, 0x07, 0x00, 0x17, 0x74, 0xec, + 0x3a, 0x54, 0xf8, 0x21, 0xef, 0x54, 0x6e, 0x97, 0x53, 0xc2, 0x67, 0x11, 0xe1, 0x69, 0xe0, 0x50, + 0xc1, 0x7a, 0x15, 0x79, 0x33, 0x2b, 0xc5, 0x4f, 0xee, 0x40, 0x9b, 0x06, 0x81, 0xcd, 0x05, 0x15, + 0xcc, 0xee, 0x5f, 0x0a, 0xc6, 0x31, 0x92, 0x96, 0xac, 0x65, 0x1a, 0x04, 0x8f, 0xe5, 0x6a, 0x4f, + 0x2e, 0x9a, 0x4e, 0xfc, 0x1d, 0xd0, 0xc9, 0x09, 0x81, 0x8a, 0x43, 0x05, 0x45, 0x6b, 0x2c, 0x59, + 0x38, 0x96, 0x6b, 0x01, 0x15, 0x23, 0xad, 0x23, 0x8e, 0xc9, 0x3a, 0x54, 0x47, 0xcc, 0x1d, 0x8e, + 0x04, 0xaa, 0x55, 0xb6, 0xf4, 0x4c, 0x1a, 0x3e, 0x08, 0xfd, 0x0b, 0x86, 0x71, 0x5e, 0xb7, 0xd4, + 0xc4, 0xfc, 0x97, 0x01, 0x37, 0xae, 0x05, 0x86, 0xdc, 0x77, 0x44, 0xf9, 0x28, 0x3a, 0x4b, 0x8e, + 0xc9, 0xdb, 0x72, 0x5f, 0xea, 0xb0, 0x50, 0xe7, 0x9f, 0x65, 0xad, 0xf1, 0x31, 0x2e, 0x6a, 0x45, + 0x35, 0x0b, 0x79, 0x04, 0x2b, 0x63, 0xca, 0x85, 0xad, 0xfc, 0xd7, 0xc6, 0xfc, 0x52, 0xce, 0xc4, + 0xd4, 0x27, 0x34, 0xf2, 0x73, 0xe9, 0x56, 0x5a, 0xbc, 0x35, 0xce, 0xac, 0x92, 0x63, 0x58, 0xeb, + 0x5f, 0x3e, 0xa7, 0x9e, 0x70, 0x3d, 0x66, 0x5f, 0xb3, 0x79, 0x5b, 0x6f, 0xf5, 0xe8, 0xc2, 0x75, + 0x98, 0x37, 0x88, 0x8c, 0xbd, 0x1a, 0x8b, 0xc4, 0x1f, 0x83, 0x9b, 0xb7, 0xa1, 0x95, 0x8d, 0x62, + 0xd2, 0x82, 0x92, 0x98, 0x69, 0x0d, 0x4b, 0x62, 0x66, 0x9a, 0xb1, 0x07, 0xc6, 0xa1, 0x74, 0x8d, + 0x67, 0x07, 0xda, 0xb9, 0xb0, 0x4e, 0x99, 0xdb, 0x48, 0x9b, 0xdb, 0x6c, 0xc3, 0x72, 0x26, 0x9a, + 0xcd, 0xcf, 0x17, 0xa1, 0x6e, 0x31, 0x1e, 0x48, 0x67, 0x22, 0x87, 0xd0, 0x60, 0xb3, 0x01, 0x53, + 0x89, 0xd4, 0xc8, 0xa5, 0x29, 0xc5, 0xf3, 0x28, 0xa2, 0xcb, 0x80, 0x8e, 0x99, 0xc9, 0x4e, 0x06, + 0x04, 0x56, 0xf3, 0x42, 0x69, 0x14, 0xd8, 0xcd, 0xa2, 0xc0, 0x5a, 0x8e, 0x37, 0x07, 0x03, 0x3b, + 0x19, 0x18, 0xc8, 0x6f, 0x9c, 0xc1, 0x81, 0x7b, 0x05, 0x38, 0x90, 0xbf, 0xfe, 0x1c, 0x20, 0xb8, + 0x57, 0x00, 0x04, 0x9d, 0x6b, 0x67, 0x15, 0x22, 0xc1, 0x6e, 0x16, 0x09, 0xf2, 0xea, 0xe4, 0xa0, + 0xe0, 0x83, 0x22, 0x28, 0xb8, 0x95, 0x93, 0x99, 0x8b, 0x05, 0xef, 0x5d, 0xc3, 0x82, 0xf5, 0x9c, + 0x68, 0x01, 0x18, 0xdc, 0xcb, 0x64, 0x69, 0x28, 0xd4, 0xad, 0x38, 0x4d, 0x93, 0xef, 0x5f, 0xc7, + 0x91, 0x8d, 0xfc, 0xa7, 0x2d, 0x02, 0x92, 0xfd, 0x1c, 0x90, 0xdc, 0xcc, 0xdf, 0x32, 0x87, 0x24, + 0x09, 0x1e, 0xec, 0xc8, 0xb8, 0xcf, 0x79, 0x9a, 0xcc, 0x11, 0x2c, 0x0c, 0xfd, 0x50, 0x27, 0x6c, + 0x35, 0x31, 0xb7, 0x65, 0x26, 0x4a, 0xfc, 0xeb, 0x25, 0xd8, 0x81, 0x4e, 0x9f, 0xf2, 0x2e, 0xf3, + 0x57, 0x46, 0x22, 0x8b, 0x11, 0x9d, 0xce, 0x62, 0x0d, 0x9d, 0xc5, 0x52, 0x90, 0x52, 0xca, 0x40, + 0x0a, 0xf9, 0x0e, 0xdc, 0xc0, 0x34, 0x82, 0x76, 0xb1, 0x33, 0x69, 0xad, 0x2d, 0x09, 0xca, 0x20, + 0x2a, 0xbf, 0xbd, 0x03, 0xab, 0x29, 0x5e, 0x99, 0x62, 0x31, 0x85, 0x55, 0x30, 0x78, 0x57, 0x62, + 0xee, 0xa3, 0x20, 0x38, 0xa6, 0x7c, 0x64, 0xfe, 0x38, 0xd1, 0x3f, 0x81, 0x2b, 0x02, 0x95, 0x81, + 0xef, 0x28, 0xb5, 0x96, 0x2d, 0x1c, 0x4b, 0x08, 0x1b, 0xfb, 0x43, 0x3c, 0xb5, 0x61, 0xc9, 0xa1, + 0xe4, 0x8a, 0x23, 0xa5, 0xa1, 0x42, 0xc2, 0xfc, 0xa5, 0x91, 0xec, 0x97, 0x20, 0x58, 0x11, 0xd8, + 0x18, 0xff, 0x0f, 0xd8, 0x94, 0x5e, 0x0f, 0x6c, 0xcc, 0xdf, 0x1a, 0xc9, 0x17, 0x89, 0x61, 0xe4, + 0xcd, 0x54, 0x94, 0xce, 0xe1, 0x7a, 0x0e, 0x9b, 0x61, 0xc0, 0x97, 0x2d, 0x35, 0x89, 0x10, 0xbe, + 0x8a, 0x66, 0xce, 0x22, 0x7c, 0x0d, 0xd7, 0xd4, 0x44, 0xc3, 0x8f, 0x7f, 0x8e, 0x91, 0xb8, 0x64, + 0xa9, 0x49, 0x2a, 0x7b, 0x36, 0x32, 0xd9, 0xf3, 0x14, 0xc8, 0xf5, 0x18, 0x25, 0xef, 0x43, 0x45, + 0xd0, 0xa1, 0x34, 0xa1, 0xb4, 0x42, 0x6b, 0x4f, 0xd5, 0xcb, 0x7b, 0x1f, 0x9f, 0x9d, 0x52, 0x37, + 0xec, 0xad, 0x4b, 0xed, 0xff, 0xf3, 0x62, 0xab, 0x25, 0x79, 0x76, 0xfd, 0x89, 0x2b, 0xd8, 0x24, + 0x10, 0x97, 0x16, 0xca, 0x98, 0x7f, 0x31, 0x64, 0xee, 0xce, 0xc4, 0x6e, 0xa1, 0x2d, 0x22, 0x07, + 0x2d, 0xa5, 0x60, 0xf6, 0xd5, 0xec, 0xf3, 0x0d, 0x80, 0x21, 0xe5, 0xf6, 0x67, 0xd4, 0x13, 0xcc, + 0xd1, 0x46, 0x6a, 0x0c, 0x29, 0xff, 0x39, 0x2e, 0xc8, 0x9a, 0x44, 0x92, 0xa7, 0x9c, 0x39, 0x68, + 0xad, 0xb2, 0x55, 0x1b, 0x52, 0xfe, 0x94, 0x33, 0x27, 0xd6, 0xab, 0xf6, 0x06, 0x7a, 0xfd, 0x35, + 0xe5, 0x78, 0x09, 0x70, 0x7d, 0x15, 0x34, 0xfb, 0xb7, 0x21, 0x11, 0x39, 0x9b, 0xfc, 0xc8, 0x09, + 0xdc, 0x88, 0xdd, 0xdb, 0x9e, 0xa2, 0xdb, 0x47, 0xfe, 0xf0, 0xf2, 0xa8, 0x58, 0xb9, 0xc8, 0x2e, + 0x73, 0xf2, 0x13, 0xd8, 0xc8, 0x05, 0x67, 0xbc, 0x61, 0xe9, 0xa5, 0x31, 0x7a, 0x33, 0x1b, 0xa3, + 0xd1, 0x7e, 0x91, 0xae, 0xe5, 0x37, 0xd0, 0xf5, 0x5b, 0xb2, 0x3c, 0x49, 0xa7, 0xec, 0xa2, 0xaf, + 0x65, 0xfe, 0xda, 0x80, 0x76, 0xee, 0x32, 0x64, 0x1f, 0x40, 0x65, 0x3c, 0xee, 0x3e, 0x8f, 0x4a, + 0xe5, 0x15, 0x7d, 0x71, 0x34, 0xd9, 0x63, 0xf7, 0x39, 0xb3, 0x1a, 0xfd, 0x68, 0x48, 0xee, 0x40, + 0x4d, 0xcc, 0x14, 0x77, 0xb6, 0x90, 0x7b, 0x32, 0x43, 0xd6, 0xaa, 0xc0, 0x7f, 0x72, 0x17, 0x96, + 0xd4, 0xc6, 0x43, 0x9f, 0x73, 0x37, 0xd0, 0x45, 0x04, 0x49, 0x6f, 0xfd, 0x11, 0x52, 0xac, 0x66, + 0x3f, 0x99, 0x98, 0x47, 0xd0, 0x88, 0x8f, 0x25, 0x5f, 0x83, 0xc6, 0x84, 0xce, 0x74, 0x95, 0x2b, + 0xef, 0xb6, 0x68, 0xd5, 0x27, 0x74, 0x86, 0x05, 0x2e, 0xd9, 0x80, 0x9a, 0x24, 0x0e, 0xa9, 0xb2, + 0x77, 0xd9, 0xaa, 0x4e, 0xe8, 0xec, 0x23, 0xca, 0xcd, 0x0f, 0xa1, 0xaa, 0xee, 0xf2, 0x86, 0xf2, + 0x3f, 0x84, 0x66, 0xea, 0x7a, 0xe4, 0xbb, 0x70, 0x53, 0x29, 0x12, 0xd0, 0x50, 0xa0, 0xe2, 0x99, + 0x0d, 0x09, 0x12, 0x4f, 0x69, 0x28, 0xe4, 0x91, 0xaa, 0xf6, 0x7e, 0x0c, 0xad, 0x6c, 0x7d, 0x2a, + 0xd3, 0x57, 0xe8, 0x4f, 0x3d, 0x47, 0x0b, 0xa9, 0x89, 0x6c, 0x4e, 0x2f, 0x7c, 0xe5, 0x30, 0xe9, + 0x82, 0xf4, 0xcc, 0x17, 0x2c, 0x55, 0xd5, 0x2a, 0x1e, 0xf3, 0x4f, 0x15, 0xa8, 0xaa, 0x62, 0x99, + 0xdc, 0x49, 0xf5, 0x27, 0x88, 0x84, 0xbd, 0xe6, 0xd5, 0x8b, 0xad, 0x1a, 0x82, 0xc6, 0xc9, 0xc3, + 0xa4, 0x59, 0x49, 0xd2, 0x63, 0x29, 0x53, 0xcb, 0x47, 0x9d, 0x51, 0xf9, 0xb5, 0x3b, 0xa3, 0x0d, + 0xa8, 0x79, 0xd3, 0x89, 0x2d, 0x66, 0x1c, 0x23, 0xbc, 0x6c, 0x55, 0xbd, 0xe9, 0xe4, 0xc9, 0x8c, + 0x4b, 0x53, 0x0b, 0x5f, 0xd0, 0x31, 0x92, 0x54, 0x88, 0xd7, 0x71, 0x41, 0x12, 0x0f, 0x61, 0x39, + 0x85, 0xad, 0xae, 0xa3, 0x0b, 0xb7, 0x56, 0xda, 0x19, 0x4e, 0x1e, 0x6a, 0x75, 0x9b, 0x31, 0xd6, + 0x9e, 0x38, 0x64, 0x3b, 0xdb, 0x08, 0x20, 0x24, 0x2b, 0x5c, 0x48, 0xd5, 0xfa, 0x12, 0x90, 0xe5, + 0x05, 0xa4, 0x93, 0x2b, 0x16, 0x05, 0x12, 0x75, 0xb9, 0x80, 0xc4, 0xb7, 0xa0, 0x9d, 0xa0, 0x9a, + 0x62, 0x69, 0xa8, 0x5d, 0x92, 0x65, 0x64, 0x7c, 0x17, 0xd6, 0x3c, 0x36, 0x13, 0x76, 0x9e, 0x1b, + 0x90, 0x9b, 0x48, 0xda, 0x59, 0x56, 0xe2, 0xdb, 0xd0, 0x4a, 0xd2, 0x00, 0xf2, 0x36, 0x55, 0x3b, + 0x16, 0xaf, 0x22, 0xdb, 0x2d, 0xa8, 0xc7, 0x35, 0xc5, 0x12, 0x32, 0xd4, 0xa8, 0x2a, 0x25, 0xe2, + 0x2a, 0x25, 0x64, 0x7c, 0x3a, 0x16, 0x7a, 0x93, 0x65, 0xe4, 0xc1, 0x2a, 0xc5, 0x52, 0xeb, 0xc8, + 0xfb, 0x4d, 0x58, 0x66, 0xba, 0x5d, 0x51, 0x7c, 0x2d, 0xe4, 0x5b, 0x8a, 0x16, 0x91, 0x69, 0x07, + 0x56, 0x82, 0xd0, 0x0f, 0x7c, 0xce, 0x42, 0x9b, 0x3a, 0x4e, 0xc8, 0x38, 0xef, 0xb4, 0xd5, 0x7e, + 0xd1, 0xfa, 0x91, 0x5a, 0x36, 0x7f, 0x01, 0x35, 0x6d, 0xfd, 0xc2, 0xa6, 0xed, 0x07, 0xb0, 0x24, + 0xbd, 0x9e, 0xdb, 0x99, 0xd6, 0x2d, 0x2a, 0x9d, 0xd1, 0xe9, 0x99, 0xc8, 0x74, 0x70, 0x4d, 0xe4, + 0x57, 0x4b, 0xe6, 0x3d, 0x58, 0xce, 0xf0, 0xc8, 0x30, 0x40, 0xa7, 0x88, 0xc2, 0x00, 0x27, 0xf1, + 0xc9, 0xa5, 0xe4, 0x64, 0xf3, 0x3e, 0x34, 0x62, 0x43, 0xcb, 0x0a, 0x2f, 0xd2, 0xc3, 0xd0, 0xb6, + 0x53, 0x53, 0x2c, 0x0b, 0xfc, 0xcf, 0x58, 0xa8, 0xab, 0x3a, 0x35, 0x31, 0x9f, 0x42, 0x3b, 0x97, + 0xc5, 0xc9, 0x2e, 0xd4, 0x82, 0x69, 0xdf, 0x8e, 0x5e, 0x13, 0x92, 0xb4, 0x75, 0x3a, 0xed, 0x7f, + 0xcc, 0x2e, 0xa3, 0xfe, 0x33, 0xc0, 0x59, 0xb2, 0x6d, 0x29, 0xbd, 0xed, 0x18, 0xea, 0x51, 0x68, + 0x92, 0xef, 0x41, 0x23, 0xf6, 0x91, 0x5c, 0xda, 0x8c, 0x8f, 0xd6, 0x9b, 0x26, 0x8c, 0xf2, 0x53, + 0x73, 0x77, 0xe8, 0x31, 0xc7, 0x4e, 0xe2, 0x01, 0xcf, 0xa8, 0x5b, 0x6d, 0x45, 0xf8, 0x24, 0x72, + 0x7e, 0xf3, 0x5d, 0xa8, 0xaa, 0xbb, 0x49, 0xfb, 0xc8, 0x9d, 0xa3, 0xa2, 0x57, 0x8e, 0x0b, 0xf3, + 0xfb, 0x9f, 0x0d, 0xa8, 0x47, 0xcd, 0x6c, 0xa1, 0x50, 0xe6, 0xd2, 0xa5, 0x57, 0xbd, 0xf4, 0xbc, + 0x17, 0x81, 0x28, 0x8b, 0x54, 0x5e, 0x3b, 0x8b, 0xec, 0x02, 0x51, 0xc9, 0xe2, 0xc2, 0x17, 0xae, + 0x37, 0xb4, 0x95, 0xad, 0x55, 0xd6, 0x58, 0x41, 0xca, 0x19, 0x12, 0x4e, 0xe5, 0xfa, 0xc1, 0xe7, + 0x8b, 0xd0, 0x3e, 0xea, 0x3d, 0x38, 0x39, 0x0a, 0x82, 0xb1, 0x3b, 0xa0, 0x58, 0x69, 0xef, 0x43, + 0x05, 0x7b, 0x89, 0x82, 0x57, 0xcc, 0x6e, 0x51, 0x53, 0x4b, 0x0e, 0x60, 0x11, 0x5b, 0x0a, 0x52, + 0xf4, 0x98, 0xd9, 0x2d, 0xec, 0x6d, 0xe5, 0x21, 0xaa, 0xe9, 0xb8, 0xfe, 0xa6, 0xd9, 0x2d, 0x6a, + 0x70, 0xc9, 0x87, 0xd0, 0x48, 0x9a, 0x81, 0x79, 0x2f, 0x9b, 0xdd, 0xb9, 0xad, 0xae, 0x94, 0x4f, + 0x6a, 0xb0, 0x79, 0x0f, 0x74, 0xdd, 0xb9, 0x3d, 0x21, 0x39, 0x84, 0x5a, 0x54, 0x9b, 0x16, 0xbf, + 0x3d, 0x76, 0xe7, 0xb4, 0xa1, 0xd2, 0x3c, 0xaa, 0xbe, 0x2f, 0x7a, 0x20, 0xed, 0x16, 0xf6, 0xca, + 0xe4, 0x2e, 0x54, 0x75, 0xb1, 0x51, 0xf8, 0xfe, 0xd8, 0x2d, 0x6e, 0x26, 0xa5, 0x92, 0x49, 0x87, + 0x33, 0xef, 0x11, 0xb7, 0x3b, 0xb7, 0xa9, 0x27, 0x47, 0x00, 0xa9, 0x9a, 0x7e, 0xee, 0xeb, 0x6c, + 0x77, 0x7e, 0xb3, 0x4e, 0xee, 0x43, 0x3d, 0x79, 0x80, 0x29, 0x7e, 0x6f, 0xed, 0xce, 0xeb, 0x9f, + 0x7b, 0x5f, 0xff, 0xef, 0x3f, 0x36, 0x8d, 0xdf, 0x5c, 0x6d, 0x1a, 0xbf, 0xbb, 0xda, 0x34, 0xbe, + 0xbc, 0xda, 0x34, 0xfe, 0x78, 0xb5, 0x69, 0xfc, 0xfd, 0x6a, 0xd3, 0xf8, 0xfd, 0x3f, 0x37, 0x8d, + 0x7e, 0x15, 0xdd, 0xff, 0xbd, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x48, 0x26, 0x13, 0xca, 0x22, 0x18, 0x00, 0x00, } diff --git a/abci/types/types.proto b/abci/types/types.proto index ae550c0a..75a53ac4 100644 --- a/abci/types/types.proto +++ b/abci/types/types.proto @@ -207,8 +207,7 @@ message ConsensusParams { // BlockSize contains limits on the block size. message BlockSize { int32 max_bytes = 1; - int32 max_txs = 2; - int64 max_gas = 3; + int64 max_gas = 2; } // TxSize contains limits on the tx size. diff --git a/abci/types/types_test.go b/abci/types/types_test.go deleted file mode 100644 index baa8155c..00000000 --- a/abci/types/types_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import ( - "testing" - - asrt "github.com/stretchr/testify/assert" -) - -func TestConsensusParams(t *testing.T) { - assert := asrt.New(t) - - params := &ConsensusParams{ - BlockSize: &BlockSize{MaxGas: 12345}, - BlockGossip: &BlockGossip{BlockPartSizeBytes: 54321}, - } - var noParams *ConsensusParams // nil - - // no error with nil fields - assert.Nil(noParams.GetBlockSize()) - assert.EqualValues(noParams.GetBlockSize().GetMaxGas(), 0) - - // get values with real fields - assert.NotNil(params.GetBlockSize()) - assert.EqualValues(params.GetBlockSize().GetMaxTxs(), 0) - assert.EqualValues(params.GetBlockSize().GetMaxGas(), 12345) - assert.NotNil(params.GetBlockGossip()) - assert.EqualValues(params.GetBlockGossip().GetBlockPartSizeBytes(), 54321) - assert.Nil(params.GetTxSize()) - assert.EqualValues(params.GetTxSize().GetMaxBytes(), 0) - -} diff --git a/consensus/mempool_test.go b/consensus/mempool_test.go index 81d7693f..16a167fd 100644 --- a/consensus/mempool_test.go +++ b/consensus/mempool_test.go @@ -148,7 +148,7 @@ func TestMempoolRmBadTx(t *testing.T) { // check for the tx for { - txs := cs.mempool.Reap(1) + txs := cs.mempool.ReapMaxBytes(len(txBytes)) if len(txs) == 0 { emptyMempoolCh <- struct{}{} return diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 4a6d4b9d..364b6fb0 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -194,7 +194,8 @@ func newMockEvidencePool(val []byte) *mockEvidencePool { } } -func (m *mockEvidencePool) PendingEvidence() []types.Evidence { +// NOTE: maxBytes is ignored +func (m *mockEvidencePool) PendingEvidence(maxBytes int) []types.Evidence { if m.height > 0 { return m.ev } @@ -207,7 +208,7 @@ func (m *mockEvidencePool) Update(block *types.Block, state sm.State) { panic("block has no evidence") } } - m.height += 1 + m.height++ } //------------------------------------ diff --git a/consensus/state.go b/consensus/state.go index debe94da..65f5b6b3 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -153,6 +153,7 @@ func NewConsensusState( cs.setProposal = cs.defaultSetProposal cs.updateToState(state) + // Don't call scheduleRound0 yet. // We do that upon Start(). cs.reconstructLastCommit(state) @@ -946,14 +947,25 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts return } + maxBytes := cs.state.ConsensusParams.BlockSize.MaxBytes + // bound evidence to 1/10th of the block + evidence := cs.evpool.PendingEvidence(maxBytes / 10) // Mempool validated transactions - txs := cs.mempool.Reap(cs.state.ConsensusParams.BlockSize.MaxTxs) - evidence := cs.evpool.PendingEvidence() + txs := cs.mempool.ReapMaxBytes(maxDataBytes(maxBytes, cs.state.Validators.Size(), len(evidence))) proposerAddr := cs.privValidator.GetAddress() block, parts := cs.state.MakeBlock(cs.Height, txs, commit, evidence, proposerAddr) + return block, parts } +func maxDataBytes(maxBytes, valsCount, evidenceCount int) int { + return maxBytes - + types.MaxAminoOverheadForBlock - + types.MaxHeaderBytes - + (valsCount * types.MaxVoteBytes) - + (evidenceCount * types.MaxEvidenceBytes) +} + // Enter: `timeoutPropose` after entering Propose. // Enter: proposal block and POL is ready. // Enter: any +2/3 prevotes for future round. @@ -1438,7 +1450,11 @@ func (cs *ConsensusState) addProposalBlockPart(msg *BlockPartMessage, peerID p2p } if added && cs.ProposalBlockParts.IsComplete() { // Added and completed! - _, err = cdc.UnmarshalBinaryReader(cs.ProposalBlockParts.GetReader(), &cs.ProposalBlock, int64(cs.state.ConsensusParams.BlockSize.MaxBytes)) + _, err = cdc.UnmarshalBinaryReader( + cs.ProposalBlockParts.GetReader(), + &cs.ProposalBlock, + int64(cs.state.ConsensusParams.BlockSize.MaxBytes), + ) if err != nil { return true, err } diff --git a/docs/architecture/adr-020-block-size.md b/docs/architecture/adr-020-block-size.md new file mode 100644 index 00000000..d40766b5 --- /dev/null +++ b/docs/architecture/adr-020-block-size.md @@ -0,0 +1,72 @@ +# ADR 020: Limiting txs size inside a block + +## Changelog + +13-08-2018: Initial Draft +15-08-2018: Second version after Dev's comments +28-08-2018: Third version after Ethan's comments +30-08-2018: AminoOverheadForBlock => MaxAminoOverheadForBlock, added MaxAminoOverheadForTx + +## Context + +We currently use MaxTxs to reap txs from the mempool when proposing a block, +but enforce MaxBytes when unmarshalling a block, so we could easily propose a +block thats too large to be valid. + +We should just remove MaxTxs all together and stick with MaxBytes, and have a +`mempool.ReapMaxBytes`. + +But we can't just reap BlockSize.MaxBytes, since MaxBytes is for the entire block, +not for the txs inside the block. There's extra amino overhead + the actual +headers on top of the actual transactions + evidence + last commit. + +## Proposed solution + +Therefore, we should + +1) Get rid of MaxTxs. +2) Rename MaxTxsBytes to MaxBytes. + +When we need to ReapMaxBytes from the mempool, we calculate the upper bound as follows: + +``` +ExactLastCommitBytes = {number of validators currently enabled} * {MaxVoteBytes} +MaxEvidenceBytesPerBlock = MaxBytes / 10 +ExactEvidenceBytes = cs.evpool.PendingEvidence(MaxEvidenceBytesPerBlock) * MaxEvidenceBytes + +mempool.ReapMaxBytes(MaxBytes - MaxAminoOverheadForBlock - ExactLastCommitBytes - ExactEvidenceBytes - MaxHeaderBytes) +``` + +where MaxVoteBytes, MaxEvidenceBytes, MaxHeaderBytes and MaxAminoOverheadForBlock +are constants defined inside the `types` package: + +- MaxVoteBytes - 170 bytes +- MaxEvidenceBytes - 364 bytes +- MaxHeaderBytes - 476 bytes (~276 bytes hashes + 200 bytes - 50 UTF-8 encoded + symbols of chain ID 4 bytes each in the worst case + amino overhead) +- MaxAminoOverheadForBlock - 4 bytes (assuming MaxHeaderBytes includes amino + overhead for encoding header, MaxVoteBytes - for encoding vote, etc.) + +NOTE while reaping the `max int` bytes in mempool, we should account that every +transaction will take `len(tx)+aminoOverhead`, where aminoOverhead=1-4 bytes. +Therefore, MaxAminoOverheadForTx should be added. + +We should write a test that fails if the underlying structs got changed, but +MaxXXX stayed the same. + +## Status + +Proposed. + +## Consequences + +### Positive + +* one way to limit the size of a block +* less variables to configure + +### Negative + +* constants that need to be adjusted if the underlying structs got changed + +### Neutral diff --git a/evidence/pool.go b/evidence/pool.go index 247629b6..21cab5e0 100644 --- a/evidence/pool.go +++ b/evidence/pool.go @@ -57,9 +57,10 @@ func (evpool *EvidencePool) PriorityEvidence() []types.Evidence { return evpool.evidenceStore.PriorityEvidence() } -// PendingEvidence returns all uncommitted evidence. -func (evpool *EvidencePool) PendingEvidence() []types.Evidence { - return evpool.evidenceStore.PendingEvidence() +// PendingEvidence returns uncommitted evidence up to maxBytes. +// If maxBytes is -1, all evidence is returned. +func (evpool *EvidencePool) PendingEvidence(maxBytes int) []types.Evidence { + return evpool.evidenceStore.PendingEvidence(maxBytes) } // State returns the current state of the evpool. diff --git a/evidence/reactor_test.go b/evidence/reactor_test.go index 1687f25a..23fd008a 100644 --- a/evidence/reactor_test.go +++ b/evidence/reactor_test.go @@ -79,11 +79,11 @@ func waitForEvidence(t *testing.T, evs types.EvidenceList, reactors []*EvidenceR func _waitForEvidence(t *testing.T, wg *sync.WaitGroup, evs types.EvidenceList, reactorIdx int, reactors []*EvidenceReactor) { evpool := reactors[reactorIdx].evpool - for len(evpool.PendingEvidence()) != len(evs) { + for len(evpool.PendingEvidence(-1)) != len(evs) { time.Sleep(time.Millisecond * 100) } - reapedEv := evpool.PendingEvidence() + reapedEv := evpool.PendingEvidence(-1) // put the reaped evidence in a map so we can quickly check we got everything evMap := make(map[string]types.Evidence) for _, e := range reapedEv { diff --git a/evidence/store.go b/evidence/store.go index ba2e0afd..60656f05 100644 --- a/evidence/store.go +++ b/evidence/store.go @@ -78,7 +78,7 @@ func NewEvidenceStore(db dbm.DB) *EvidenceStore { // PriorityEvidence returns the evidence from the outqueue, sorted by highest priority. func (store *EvidenceStore) PriorityEvidence() (evidence []types.Evidence) { // reverse the order so highest priority is first - l := store.ListEvidence(baseKeyOutqueue) + l := store.listEvidence(baseKeyOutqueue, -1) l2 := make([]types.Evidence, len(l)) for i := range l { l2[i] = l[len(l)-1-i] @@ -86,18 +86,26 @@ func (store *EvidenceStore) PriorityEvidence() (evidence []types.Evidence) { return l2 } -// PendingEvidence returns all known uncommitted evidence. -func (store *EvidenceStore) PendingEvidence() (evidence []types.Evidence) { - return store.ListEvidence(baseKeyPending) +// PendingEvidence returns known uncommitted evidence up to maxBytes. +// If maxBytes is -1, all evidence is returned. +func (store *EvidenceStore) PendingEvidence(maxBytes int) (evidence []types.Evidence) { + return store.listEvidence(baseKeyPending, maxBytes) } -// ListEvidence lists the evidence for the given prefix key. +// listEvidence lists the evidence for the given prefix key up to maxBytes. // It is wrapped by PriorityEvidence and PendingEvidence for convenience. -func (store *EvidenceStore) ListEvidence(prefixKey string) (evidence []types.Evidence) { +// If maxBytes is -1, there's no cap on the size of returned evidence. +func (store *EvidenceStore) listEvidence(prefixKey string, maxBytes int) (evidence []types.Evidence) { + var bytes int iter := dbm.IteratePrefix(store.db, []byte(prefixKey)) for ; iter.Valid(); iter.Next() { val := iter.Value() + if maxBytes > 0 && bytes+len(val) > maxBytes { + return evidence + } + bytes += len(val) + var ei EvidenceInfo err := cdc.UnmarshalBinaryBare(val, &ei) if err != nil { diff --git a/evidence/store_test.go b/evidence/store_test.go index 1eb5b7f6..35eb28d0 100644 --- a/evidence/store_test.go +++ b/evidence/store_test.go @@ -35,7 +35,7 @@ func TestStoreMark(t *testing.T) { // before we do anything, priority/pending are empty priorityEv := store.PriorityEvidence() - pendingEv := store.PendingEvidence() + pendingEv := store.PendingEvidence(-1) assert.Equal(0, len(priorityEv)) assert.Equal(0, len(pendingEv)) @@ -53,21 +53,21 @@ func TestStoreMark(t *testing.T) { // new evidence should be returns in priority/pending priorityEv = store.PriorityEvidence() - pendingEv = store.PendingEvidence() + pendingEv = store.PendingEvidence(-1) assert.Equal(1, len(priorityEv)) assert.Equal(1, len(pendingEv)) // priority is now empty store.MarkEvidenceAsBroadcasted(ev) priorityEv = store.PriorityEvidence() - pendingEv = store.PendingEvidence() + pendingEv = store.PendingEvidence(-1) assert.Equal(0, len(priorityEv)) assert.Equal(1, len(pendingEv)) // priority and pending are now empty store.MarkEvidenceAsCommitted(ev) priorityEv = store.PriorityEvidence() - pendingEv = store.PendingEvidence() + pendingEv = store.PendingEvidence(-1) assert.Equal(0, len(priorityEv)) assert.Equal(0, len(pendingEv)) diff --git a/mempool/mempool.go b/mempool/mempool.go index b86dd81f..ec93202e 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -80,6 +80,8 @@ type Mempool struct { recheckEnd *clist.CElement // re-checking stops here notifiedTxsAvailable bool txsAvailable chan struct{} // fires once for each height, when the mempool is not empty + // Filter mempool to only accept txs for which filter(tx) returns true. + filter func(types.Tx) bool // Keep a cache of already-seen txs. // This reduces the pressure on the proxyApp. @@ -139,6 +141,14 @@ func (mem *Mempool) SetLogger(l log.Logger) { mem.logger = l } +// SetFilter sets a filter for mempool to only accept txs for which f(tx) +// returns true. +func (mem *Mempool) SetFilter(f func(types.Tx) bool) { + mem.proxyMtx.Lock() + mem.filter = f + mem.proxyMtx.Unlock() +} + // WithMetrics sets the metrics. func WithMetrics(metrics *Metrics) MempoolOption { return func(mem *Mempool) { mem.metrics = metrics } @@ -240,6 +250,10 @@ func (mem *Mempool) CheckTx(tx types.Tx, cb func(*abci.Response)) (err error) { return ErrMempoolIsFull } + if mem.filter != nil && !mem.filter(tx) { + return + } + // CACHE if !mem.cache.Push(tx) { return ErrTxInCache @@ -367,9 +381,10 @@ func (mem *Mempool) notifyTxsAvailable() { } } -// Reap returns a list of transactions currently in the mempool. -// If maxTxs is -1, there is no cap on the number of returned transactions. -func (mem *Mempool) Reap(maxTxs int) types.Txs { +// ReapMaxBytes reaps transactions from the mempool up to n bytes total. +// If max is negative, there is no cap on the size of all returned +// transactions (~ all available transactions). +func (mem *Mempool) ReapMaxBytes(max int) types.Txs { mem.proxyMtx.Lock() defer mem.proxyMtx.Unlock() @@ -378,19 +393,39 @@ func (mem *Mempool) Reap(maxTxs int) types.Txs { time.Sleep(time.Millisecond * 10) } - txs := mem.collectTxs(maxTxs) + var cur int + // TODO: we will get a performance boost if we have a good estimate of avg + // size per tx, and set the initial capacity based off of that. + // txs := make([]types.Tx, 0, cmn.MinInt(mem.txs.Len(), max/mem.avgTxSize)) + txs := make([]types.Tx, 0, mem.txs.Len()) + for e := mem.txs.Front(); e != nil; e = e.Next() { + memTx := e.Value.(*mempoolTx) + if max > 0 && cur+len(memTx.tx)+types.MaxAminoOverheadForTx > max { + return txs + } + cur += len(memTx.tx) + types.MaxAminoOverheadForTx + txs = append(txs, memTx.tx) + } return txs } -// maxTxs: -1 means uncapped, 0 means none -func (mem *Mempool) collectTxs(maxTxs int) types.Txs { - if maxTxs == 0 { - return []types.Tx{} - } else if maxTxs < 0 { - maxTxs = mem.txs.Len() +// ReapMaxTxs reaps up to max transactions from the mempool. +// If max is negative, function panics. +func (mem *Mempool) ReapMaxTxs(max int) types.Txs { + mem.proxyMtx.Lock() + defer mem.proxyMtx.Unlock() + + if max < 0 { + panic("Called ReapMaxTxs with negative max") } - txs := make([]types.Tx, 0, cmn.MinInt(mem.txs.Len(), maxTxs)) - for e := mem.txs.Front(); e != nil && len(txs) < maxTxs; e = e.Next() { + + for atomic.LoadInt32(&mem.rechecking) > 0 { + // TODO: Something better? + time.Sleep(time.Millisecond * 10) + } + + txs := make([]types.Tx, 0, cmn.MinInt(mem.txs.Len(), max)) + for e := mem.txs.Front(); e != nil && len(txs) <= max; e = e.Next() { memTx := e.Value.(*mempoolTx) txs = append(txs, memTx.tx) } @@ -400,7 +435,7 @@ func (mem *Mempool) collectTxs(maxTxs int) types.Txs { // Update informs the mempool that the given txs were committed and can be discarded. // NOTE: this should be called *after* block is committed by consensus. // NOTE: unsafe; Lock/Unlock must be managed by caller -func (mem *Mempool) Update(height int64, txs types.Txs) error { +func (mem *Mempool) Update(height int64, txs types.Txs, filter func(types.Tx) bool) error { // First, create a lookup map of txns in new txs. txsMap := make(map[string]struct{}, len(txs)) for _, tx := range txs { @@ -411,6 +446,10 @@ func (mem *Mempool) Update(height int64, txs types.Txs) error { mem.height = height mem.notifiedTxsAvailable = false + if filter != nil { + mem.filter = filter + } + // Remove transactions that are already in txs. goodTxs := mem.filterTxs(txsMap) // Recheck mempool txs if any txs were committed in the block @@ -423,7 +462,10 @@ func (mem *Mempool) Update(height int64, txs types.Txs) error { // mem.recheckCursor re-scans mem.txs and possibly removes some txs. // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. } + + // Update metrics mem.metrics.Size.Set(float64(mem.Size())) + return nil } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index c29578ef..0dbe2bb6 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -91,7 +91,7 @@ func TestTxsAvailable(t *testing.T) { // it should fire once now for the new height // since there are still txs left committedTxs, txs := txs[:50], txs[50:] - if err := mempool.Update(1, committedTxs); err != nil { + if err := mempool.Update(1, committedTxs, nil); err != nil { t.Error(err) } ensureFire(t, mempool.TxsAvailable(), timeoutMS) @@ -103,7 +103,7 @@ func TestTxsAvailable(t *testing.T) { // now call update with all the txs. it should not fire as there are no txs left committedTxs = append(txs, moreTxs...) - if err := mempool.Update(2, committedTxs); err != nil { + if err := mempool.Update(2, committedTxs, nil); err != nil { t.Error(err) } ensureNoFire(t, mempool.TxsAvailable(), timeoutMS) @@ -149,7 +149,7 @@ func TestSerialReap(t *testing.T) { } reapCheck := func(exp int) { - txs := mempool.Reap(-1) + txs := mempool.ReapMaxBytes(-1) require.Equal(t, len(txs), exp, fmt.Sprintf("Expected to reap %v txs but got %v", exp, len(txs))) } @@ -160,7 +160,7 @@ func TestSerialReap(t *testing.T) { binary.BigEndian.PutUint64(txBytes, uint64(i)) txs = append(txs, txBytes) } - if err := mempool.Update(0, txs); err != nil { + if err := mempool.Update(0, txs, nil); err != nil { t.Error(err) } } diff --git a/mempool/reactor_test.go b/mempool/reactor_test.go index b4362032..8ac400b0 100644 --- a/mempool/reactor_test.go +++ b/mempool/reactor_test.go @@ -86,7 +86,7 @@ func _waitForTxs(t *testing.T, wg *sync.WaitGroup, txs types.Txs, reactorIdx int time.Sleep(time.Millisecond * 100) } - reapedTxs := mempool.Reap(len(txs)) + reapedTxs := mempool.ReapMaxTxs(len(txs)) for i, tx := range txs { assert.Equal(t, tx, reapedTxs[i], fmt.Sprintf("txs at index %d on reactor %d don't match: %v vs %v", i, reactorIdx, tx, reapedTxs[i])) } diff --git a/node/node.go b/node/node.go index 7f96e0e0..7e6603d9 100644 --- a/node/node.go +++ b/node/node.go @@ -83,7 +83,7 @@ func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error) { // Generate node PrivKey nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) if err != nil { - return nil,err + return nil, err } return NewNode(config, privval.LoadOrGenFilePV(config.PrivValidatorFile()), @@ -248,6 +248,8 @@ func NewNode(config *cfg.Config, mempl.WithMetrics(memplMetrics), ) mempool.SetLogger(mempoolLogger) + maxBytes := state.ConsensusParams.TxSize.MaxBytes + mempool.SetFilter(func(tx types.Tx) bool { return len(tx) <= maxBytes }) mempool.InitWAL() // no need to have the mempool wal during tests mempoolReactor := mempl.NewMempoolReactor(config.Mempool, mempool) mempoolReactor.SetLogger(mempoolLogger) @@ -401,7 +403,7 @@ func NewNode(config *cfg.Config, sw: sw, addrBook: addrBook, - nodeKey: nodeKey, + nodeKey: nodeKey, stateDB: stateDB, blockStore: blockStore, @@ -434,7 +436,6 @@ func (n *Node) OnStart() error { n.Logger.With("module", "p2p")) n.sw.AddListener(l) - nodeInfo := n.makeNodeInfo(n.nodeKey.ID()) n.sw.SetNodeInfo(nodeInfo) n.sw.SetNodeKey(n.nodeKey) diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index e7e9042a..3eabaa97 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -242,7 +242,7 @@ func TestBroadcastTxSync(t *testing.T) { require.Equal(initMempoolSize+1, mempool.Size()) - txs := mempool.Reap(1) + txs := mempool.ReapMaxTxs(len(tx)) require.EqualValues(tx, txs[0]) mempool.Flush() } diff --git a/rpc/core/mempool.go b/rpc/core/mempool.go index 47776d3e..728d77f6 100644 --- a/rpc/core/mempool.go +++ b/rpc/core/mempool.go @@ -243,7 +243,7 @@ func UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error) { // reuse per_page validator limit = validatePerPage(limit) - txs := mempool.Reap(limit) + txs := mempool.ReapMaxTxs(limit) return &ctypes.ResultUnconfirmedTxs{len(txs), txs}, nil } diff --git a/rpc/core/pipe.go b/rpc/core/pipe.go index 9c162e9e..1d1f6146 100644 --- a/rpc/core/pipe.go +++ b/rpc/core/pipe.go @@ -7,6 +7,7 @@ import ( crypto "github.com/tendermint/tendermint/crypto" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" + mempl "github.com/tendermint/tendermint/mempool" "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/proxy" sm "github.com/tendermint/tendermint/state" @@ -53,7 +54,6 @@ var ( // interfaces defined in types and above stateDB dbm.DB blockStore sm.BlockStore - mempool sm.Mempool evidencePool sm.EvidencePool consensusState Consensus p2pSwitch P2P @@ -65,6 +65,7 @@ var ( txIndexer txindex.TxIndexer consensusReactor *consensus.ConsensusReactor eventBus *types.EventBus // thread safe + mempool *mempl.Mempool logger log.Logger ) @@ -77,7 +78,7 @@ func SetBlockStore(bs sm.BlockStore) { blockStore = bs } -func SetMempool(mem sm.Mempool) { +func SetMempool(mem *mempl.Mempool) { mempool = mem } diff --git a/state/execution.go b/state/execution.go index ab689f5f..b1859c22 100644 --- a/state/execution.go +++ b/state/execution.go @@ -92,7 +92,7 @@ func (blockExec *BlockExecutor) ApplyBlock(state State, blockID types.BlockID, b } // Lock mempool, commit app state, update mempoool. - appHash, err := blockExec.Commit(block) + appHash, err := blockExec.Commit(state, block) if err != nil { return state, fmt.Errorf("Commit failed for application: %v", err) } @@ -119,7 +119,7 @@ func (blockExec *BlockExecutor) ApplyBlock(state State, blockID types.BlockID, b // It returns the result of calling abci.Commit (the AppHash), and an error. // The Mempool must be locked during commit and update because state is typically reset on Commit and old txs must be replayed // against committed state before new txs are run in the mempool, lest they be invalid. -func (blockExec *BlockExecutor) Commit(block *types.Block) ([]byte, error) { +func (blockExec *BlockExecutor) Commit(state State, block *types.Block) ([]byte, error) { blockExec.mempool.Lock() defer blockExec.mempool.Unlock() @@ -145,7 +145,9 @@ func (blockExec *BlockExecutor) Commit(block *types.Block) ([]byte, error) { "appHash", fmt.Sprintf("%X", res.Data)) // Update mempool. - if err := blockExec.mempool.Update(block.Height, block.Txs); err != nil { + maxBytes := state.ConsensusParams.TxSize.MaxBytes + filter := func(tx types.Tx) bool { return len(tx) <= maxBytes } + if err := blockExec.mempool.Update(block.Height, block.Txs, filter); err != nil { return nil, err } diff --git a/state/services.go b/state/services.go index c51fa975..13ab7383 100644 --- a/state/services.go +++ b/state/services.go @@ -22,8 +22,8 @@ type Mempool interface { Size() int CheckTx(types.Tx, func(*abci.Response)) error - Reap(int) types.Txs - Update(height int64, txs types.Txs) error + ReapMaxBytes(max int) types.Txs + Update(height int64, txs types.Txs, filter func(types.Tx) bool) error Flush() FlushAppConn() error @@ -32,19 +32,18 @@ type Mempool interface { } // MockMempool is an empty implementation of a Mempool, useful for testing. -type MockMempool struct { -} +type MockMempool struct{} -func (m MockMempool) Lock() {} -func (m MockMempool) Unlock() {} -func (m MockMempool) Size() int { return 0 } -func (m MockMempool) CheckTx(tx types.Tx, cb func(*abci.Response)) error { return nil } -func (m MockMempool) Reap(n int) types.Txs { return types.Txs{} } -func (m MockMempool) Update(height int64, txs types.Txs) error { return nil } -func (m MockMempool) Flush() {} -func (m MockMempool) FlushAppConn() error { return nil } -func (m MockMempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } -func (m MockMempool) EnableTxsAvailable() {} +func (MockMempool) Lock() {} +func (MockMempool) Unlock() {} +func (MockMempool) Size() int { return 0 } +func (MockMempool) CheckTx(tx types.Tx, cb func(*abci.Response)) error { return nil } +func (MockMempool) ReapMaxBytes(max int) types.Txs { return types.Txs{} } +func (MockMempool) Update(height int64, txs types.Txs, filter func(types.Tx) bool) error { return nil } +func (MockMempool) Flush() {} +func (MockMempool) FlushAppConn() error { return nil } +func (MockMempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } +func (MockMempool) EnableTxsAvailable() {} //------------------------------------------------------ // blockstore @@ -72,15 +71,14 @@ type BlockStore interface { // EvidencePool defines the EvidencePool interface used by the ConsensusState. type EvidencePool interface { - PendingEvidence() []types.Evidence + PendingEvidence(int) []types.Evidence AddEvidence(types.Evidence) error Update(*types.Block, State) } // MockMempool is an empty implementation of a Mempool, useful for testing. -type MockEvidencePool struct { -} +type MockEvidencePool struct{} -func (m MockEvidencePool) PendingEvidence() []types.Evidence { return nil } -func (m MockEvidencePool) AddEvidence(types.Evidence) error { return nil } -func (m MockEvidencePool) Update(*types.Block, State) {} +func (m MockEvidencePool) PendingEvidence(int) []types.Evidence { return nil } +func (m MockEvidencePool) AddEvidence(types.Evidence) error { return nil } +func (m MockEvidencePool) Update(*types.Block, State) {} diff --git a/state/state_test.go b/state/state_test.go index d8a8c0b8..9a793c8e 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -373,13 +373,10 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) { } } -func makeParams(blockBytes, blockTx, blockGas, txBytes, - txGas, partSize int) types.ConsensusParams { - +func makeParams(txsBytes, blockGas, txBytes, txGas, partSize int) types.ConsensusParams { return types.ConsensusParams{ BlockSize: types.BlockSize{ - MaxBytes: blockBytes, - MaxTxs: blockTx, + MaxBytes: txsBytes, MaxGas: int64(blockGas), }, TxSize: types.TxSize{ @@ -397,7 +394,7 @@ func pk() []byte { } func TestApplyUpdates(t *testing.T) { - initParams := makeParams(1, 2, 3, 4, 5, 6) + initParams := makeParams(1, 2, 3, 4, 5) cases := [...]struct { init types.ConsensusParams @@ -412,19 +409,19 @@ func TestApplyUpdates(t *testing.T) { MaxBytes: 123, }, }, - makeParams(1, 2, 3, 123, 5, 6)}, + makeParams(1, 2, 123, 4, 5)}, 3: {initParams, abci.ConsensusParams{ BlockSize: &abci.BlockSize{ - MaxTxs: 44, - MaxGas: 55, + MaxBytes: 1, + MaxGas: 55, }, }, - makeParams(1, 44, 55, 4, 5, 6)}, + makeParams(1, 55, 3, 4, 5)}, 4: {initParams, abci.ConsensusParams{ BlockSize: &abci.BlockSize{ - MaxTxs: 789, + MaxBytes: 1, }, TxSize: &abci.TxSize{ MaxGas: 888, @@ -433,7 +430,7 @@ func TestApplyUpdates(t *testing.T) { BlockPartSizeBytes: 2002, }, }, - makeParams(1, 789, 3, 4, 888, 2002)}, + makeParams(1, 2, 3, 888, 2002)}, } for i, tc := range cases { diff --git a/types/block.go b/types/block.go index 8588d557..1037cacc 100644 --- a/types/block.go +++ b/types/block.go @@ -13,6 +13,17 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" ) +const ( + // MaxHeaderBytes is a maximum header size (including amino overhead). + MaxHeaderBytes = 478 + + // MaxAminoOverheadForBlock - amino overhead to encode the block. + MaxAminoOverheadForBlock = 4 + + // MaxChainIDLen is a maximum length of the chain ID. + MaxChainIDLen = 50 +) + // Block defines the atomic unit of a Tendermint blockchain. // TODO: add Version byte type Block struct { diff --git a/types/block_test.go b/types/block_test.go index 8e595776..3ca1da61 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -2,11 +2,13 @@ package types import ( "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto/tmhash" cmn "github.com/tendermint/tendermint/libs/common" ) @@ -118,7 +120,7 @@ func TestBlockMakePartSetWithEvidence(t *testing.T) { partSet := MakeBlock(h, txs, commit, evList).MakePartSet(1024) assert.NotNil(t, partSet) - assert.Equal(t, 3, partSet.Total()) + assert.Equal(t, 2, partSet.Total()) } func TestBlockHashesTo(t *testing.T) { @@ -159,16 +161,16 @@ func TestBlockString(t *testing.T) { } func makeBlockIDRandom() BlockID { - blockHash, blockPartsHeader := crypto.CRandBytes(32), PartSetHeader{123, crypto.CRandBytes(32)} + blockHash, blockPartsHeader := crypto.CRandBytes(tmhash.Size), PartSetHeader{123, crypto.CRandBytes(tmhash.Size)} return BlockID{blockHash, blockPartsHeader} } -func makeBlockID(hash string, partSetSize int, partSetHash string) BlockID { +func makeBlockID(hash []byte, partSetSize int, partSetHash []byte) BlockID { return BlockID{ - Hash: []byte(hash), + Hash: hash, PartsHeader: PartSetHeader{ Total: partSetSize, - Hash: []byte(partSetHash), + Hash: partSetHash, }, } @@ -233,6 +235,40 @@ func TestCommitValidateBasic(t *testing.T) { assert.Error(t, commit.ValidateBasic()) } +func TestMaxHeaderBytes(t *testing.T) { + // Construct a UTF-8 string of MaxChainIDLen length using the supplementary + // characters. + // Each supplementary character takes 4 bytes. + // http://www.i18nguy.com/unicode/supplementary-test.html + 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")), + } + + bz, err := cdc.MarshalBinary(h) + require.NoError(t, err) + + assert.Equal(t, MaxHeaderBytes, len(bz)) +} + func randCommit() *Commit { lastID := makeBlockIDRandom() h := int64(3) diff --git a/types/evidence.go b/types/evidence.go index 92675868..096e3503 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -10,6 +10,11 @@ import ( "github.com/tendermint/tendermint/crypto/merkle" ) +const ( + // MaxEvidenceBytes is a maximum size of any evidence (including amino overhead). + MaxEvidenceBytes = 364 +) + // ErrEvidenceInvalid wraps a piece of evidence and the error denoting how or why it is invalid. type ErrEvidenceInvalid struct { Evidence Evidence diff --git a/types/evidence_test.go b/types/evidence_test.go index 54eba01c..fab26b61 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -4,6 +4,9 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" + "github.com/tendermint/tendermint/crypto/tmhash" ) type voteData struct { @@ -31,10 +34,11 @@ func makeVote(val PrivValidator, chainID string, valIndex int, height int64, rou func TestEvidence(t *testing.T) { val := NewMockPV() val2 := NewMockPV() - blockID := makeBlockID("blockhash", 1000, "partshash") - blockID2 := makeBlockID("blockhash2", 1000, "partshash") - blockID3 := makeBlockID("blockhash", 10000, "partshash") - blockID4 := makeBlockID("blockhash", 10000, "partshash2") + + blockID := makeBlockID([]byte("blockhash"), 1000, []byte("partshash")) + blockID2 := makeBlockID([]byte("blockhash2"), 1000, []byte("partshash")) + blockID3 := makeBlockID([]byte("blockhash"), 10000, []byte("partshash")) + blockID4 := makeBlockID([]byte("blockhash"), 10000, []byte("partshash2")) const chainID = "mychain" @@ -89,10 +93,27 @@ func TestEvidenceList(t *testing.T) { assert.False(t, evl.Has(&DuplicateVoteEvidence{})) } +func TestMaxEvidenceBytes(t *testing.T) { + val := NewMockPV() + blockID := makeBlockID(tmhash.Sum([]byte("blockhash")), 1000, tmhash.Sum([]byte("partshash"))) + blockID2 := makeBlockID(tmhash.Sum([]byte("blockhash2")), 1000, tmhash.Sum([]byte("partshash"))) + const chainID = "mychain" + ev := &DuplicateVoteEvidence{ + PubKey: secp256k1.GenPrivKey().PubKey(), // use secp because it's pubkey is longer + VoteA: makeVote(val, chainID, 0, 10, 2, 1, blockID), + VoteB: makeVote(val, chainID, 0, 10, 2, 1, blockID2), + } + + bz, err := cdc.MarshalBinary(ev) + require.NoError(t, err) + + assert.Equal(t, MaxEvidenceBytes, len(bz)) +} + func randomDuplicatedVoteEvidence() *DuplicateVoteEvidence { val := NewMockPV() - blockID := makeBlockID("blockhash", 1000, "partshash") - blockID2 := makeBlockID("blockhash2", 1000, "partshash") + blockID := makeBlockID([]byte("blockhash"), 1000, []byte("partshash")) + blockID2 := makeBlockID([]byte("blockhash2"), 1000, []byte("partshash")) const chainID = "mychain" return &DuplicateVoteEvidence{ VoteA: makeVote(val, chainID, 0, 10, 2, 1, blockID), diff --git a/types/params.go b/types/params.go index 3056c82a..77f68eb7 100644 --- a/types/params.go +++ b/types/params.go @@ -22,9 +22,8 @@ type ConsensusParams struct { // BlockSize contain limits on the block size. type BlockSize struct { - MaxBytes int `json:"max_bytes"` // NOTE: must not be 0 nor greater than 100MB - MaxTxs int `json:"max_txs"` - MaxGas int64 `json:"max_gas"` + MaxBytes int `json:"max_txs_bytes"` // NOTE: must not be 0 nor greater than 100MB + MaxGas int64 `json:"max_gas"` } // TxSize contain limits on the tx size. @@ -56,9 +55,8 @@ func DefaultConsensusParams() *ConsensusParams { // DefaultBlockSize returns a default BlockSize. func DefaultBlockSize() BlockSize { return BlockSize{ - MaxBytes: 22020096, // 21MB - MaxTxs: 10000, - MaxGas: -1, + MaxBytes: 22020096, // 21MB + MaxGas: -1, } } @@ -110,7 +108,6 @@ func (params *ConsensusParams) Hash() []byte { "block_gossip_part_size_bytes": aminoHasher(params.BlockGossip.BlockPartSizeBytes), "block_size_max_bytes": aminoHasher(params.BlockSize.MaxBytes), "block_size_max_gas": aminoHasher(params.BlockSize.MaxGas), - "block_size_max_txs": aminoHasher(params.BlockSize.MaxTxs), "tx_size_max_bytes": aminoHasher(params.TxSize.MaxBytes), "tx_size_max_gas": aminoHasher(params.TxSize.MaxGas), }) @@ -132,9 +129,6 @@ func (params ConsensusParams) Update(params2 *abci.ConsensusParams) ConsensusPar if params2.BlockSize.MaxBytes > 0 { res.BlockSize.MaxBytes = int(params2.BlockSize.MaxBytes) } - if params2.BlockSize.MaxTxs > 0 { - res.BlockSize.MaxTxs = int(params2.BlockSize.MaxTxs) - } if params2.BlockSize.MaxGas > 0 { res.BlockSize.MaxGas = params2.BlockSize.MaxGas } diff --git a/types/params_test.go b/types/params_test.go index e8e13dba..119109ce 100644 --- a/types/params_test.go +++ b/types/params_test.go @@ -9,9 +9,9 @@ import ( abci "github.com/tendermint/tendermint/abci/types" ) -func newConsensusParams(blockSize, partSize int) ConsensusParams { +func newConsensusParams(txsBytes, partSize int) ConsensusParams { return ConsensusParams{ - BlockSize: BlockSize{MaxBytes: blockSize}, + BlockSize: BlockSize{MaxBytes: txsBytes}, BlockGossip: BlockGossip{BlockPartSizeBytes: partSize}, } } @@ -33,22 +33,19 @@ func TestConsensusParamsValidation(t *testing.T) { {newConsensusParams(101*1024*1024, 400), false}, {newConsensusParams(1024*1024*1024, 400), false}, } - for _, testCase := range testCases { - if testCase.valid { - assert.NoError(t, testCase.params.Validate(), "expected no error for valid params") + for _, tc := range testCases { + if tc.valid { + assert.NoError(t, tc.params.Validate(), "expected no error for valid params") } else { - assert.Error(t, testCase.params.Validate(), "expected error for non valid params") + assert.Error(t, tc.params.Validate(), "expected error for non valid params") } } } -func makeParams(blockBytes, blockTx, blockGas, txBytes, - txGas, partSize int) ConsensusParams { - +func makeParams(txsBytes, blockGas, txBytes, txGas, partSize int) ConsensusParams { return ConsensusParams{ BlockSize: BlockSize{ - MaxBytes: blockBytes, - MaxTxs: blockTx, + MaxBytes: txsBytes, MaxGas: int64(blockGas), }, TxSize: TxSize{ @@ -63,14 +60,11 @@ func makeParams(blockBytes, blockTx, blockGas, txBytes, func TestConsensusParamsHash(t *testing.T) { params := []ConsensusParams{ - makeParams(1, 2, 3, 4, 5, 6), - makeParams(7, 2, 3, 4, 5, 6), - makeParams(1, 7, 3, 4, 5, 6), - makeParams(1, 2, 7, 4, 5, 6), - makeParams(1, 2, 3, 7, 5, 6), - makeParams(1, 2, 3, 4, 7, 6), - makeParams(1, 2, 3, 4, 5, 7), - makeParams(6, 5, 4, 3, 2, 1), + makeParams(6, 2, 3, 4, 5), + makeParams(1, 6, 3, 4, 5), + makeParams(1, 2, 6, 4, 5), + makeParams(1, 2, 3, 6, 5), + makeParams(1, 2, 3, 4, 6), } hashes := make([][]byte, len(params)) @@ -96,18 +90,17 @@ func TestConsensusParamsUpdate(t *testing.T) { }{ // empty updates { - makeParams(1, 2, 3, 4, 5, 6), + makeParams(1, 2, 3, 4, 5), &abci.ConsensusParams{}, - makeParams(1, 2, 3, 4, 5, 6), + makeParams(1, 2, 3, 4, 5), }, // negative BlockPartSizeBytes { - makeParams(1, 2, 3, 4, 5, 6), + makeParams(1, 2, 3, 4, 5), &abci.ConsensusParams{ BlockSize: &abci.BlockSize{ MaxBytes: -100, - MaxTxs: -200, - MaxGas: -300, + MaxGas: -200, }, TxSize: &abci.TxSize{ MaxBytes: -400, @@ -117,26 +110,25 @@ func TestConsensusParamsUpdate(t *testing.T) { BlockPartSizeBytes: -600, }, }, - makeParams(1, 2, 3, 4, 5, 6), + makeParams(1, 2, 3, 4, 5), }, // fine updates { - makeParams(1, 2, 3, 4, 5, 6), + makeParams(1, 2, 3, 4, 5), &abci.ConsensusParams{ BlockSize: &abci.BlockSize{ MaxBytes: 100, - MaxTxs: 200, - MaxGas: 300, + MaxGas: 200, }, TxSize: &abci.TxSize{ - MaxBytes: 400, - MaxGas: 500, + MaxBytes: 300, + MaxGas: 400, }, BlockGossip: &abci.BlockGossip{ - BlockPartSizeBytes: 600, + BlockPartSizeBytes: 500, }, }, - makeParams(100, 200, 300, 400, 500, 600), + makeParams(100, 200, 300, 400, 500), }, } for _, tc := range testCases { diff --git a/types/protobuf.go b/types/protobuf.go index 30e74f15..9c448cd8 100644 --- a/types/protobuf.go +++ b/types/protobuf.go @@ -115,10 +115,8 @@ func (tm2pb) ValidatorUpdates(vals *ValidatorSet) []abci.ValidatorUpdate { func (tm2pb) ConsensusParams(params *ConsensusParams) *abci.ConsensusParams { return &abci.ConsensusParams{ BlockSize: &abci.BlockSize{ - - MaxBytes: int32(params.BlockSize.MaxBytes), - MaxTxs: int32(params.BlockSize.MaxTxs), - MaxGas: params.BlockSize.MaxGas, + MaxBytes: int32(params.BlockSize.MaxBytes), + MaxGas: params.BlockSize.MaxGas, }, TxSize: &abci.TxSize{ MaxBytes: int32(params.TxSize.MaxBytes), @@ -217,9 +215,8 @@ func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error) func (pb2tm) ConsensusParams(csp *abci.ConsensusParams) ConsensusParams { return ConsensusParams{ BlockSize: BlockSize{ - MaxBytes: int(csp.BlockSize.MaxBytes), // XXX - MaxTxs: int(csp.BlockSize.MaxTxs), // XXX - MaxGas: csp.BlockSize.MaxGas, + MaxBytes: int(csp.BlockSize.MaxBytes), // XXX + MaxGas: csp.BlockSize.MaxGas, }, TxSize: TxSize{ MaxBytes: int(csp.TxSize.MaxBytes), // XXX diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 8bdf094b..2a511225 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -89,8 +89,8 @@ func TestABCIHeader(t *testing.T) { func TestABCIEvidence(t *testing.T) { val := NewMockPV() - blockID := makeBlockID("blockhash", 1000, "partshash") - blockID2 := makeBlockID("blockhash2", 1000, "partshash") + blockID := makeBlockID([]byte("blockhash"), 1000, []byte("partshash")) + blockID2 := makeBlockID([]byte("blockhash2"), 1000, []byte("partshash")) const chainID = "mychain" ev := &DuplicateVoteEvidence{ PubKey: val.GetPubKey(), diff --git a/types/tx.go b/types/tx.go index 489f0b23..53fd79c5 100644 --- a/types/tx.go +++ b/types/tx.go @@ -11,6 +11,11 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" ) +const ( + // MaxAminoOverheadForTx - amino overhead to encode a transaction. + MaxAminoOverheadForTx = 4 +) + // Tx is an arbitrary byte array. // NOTE: Tx has no types at this level, so when wire encoded it's just length-prefixed. // Might we want types here ? diff --git a/types/vote.go b/types/vote.go index 9a6180d7..ac163e8d 100644 --- a/types/vote.go +++ b/types/vote.go @@ -10,6 +10,11 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" ) +const ( + // MaxVoteBytes is a maximum vote size (including amino overhead). + MaxVoteBytes = 170 +) + var ( ErrVoteUnexpectedStep = errors.New("Unexpected step") ErrVoteInvalidValidatorIndex = errors.New("Invalid validator index") diff --git a/types/vote_test.go b/types/vote_test.go index 836baa61..679fcd56 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/tendermint/tendermint/crypto/tmhash" ) func examplePrevote() *Vote { @@ -24,17 +25,17 @@ func exampleVote(t byte) *Vote { } return &Vote{ - ValidatorAddress: []byte("addr"), + ValidatorAddress: tmhash.Sum([]byte("validator_address")), ValidatorIndex: 56789, Height: 12345, Round: 2, Timestamp: stamp, Type: t, BlockID: BlockID{ - Hash: []byte("hash"), + Hash: tmhash.Sum([]byte("blockID_hash")), PartsHeader: PartSetHeader{ Total: 1000000, - Hash: []byte("parts_hash"), + Hash: tmhash.Sum([]byte("blockID_part_set_header_hash")), }, }, } @@ -45,7 +46,7 @@ func TestVoteSignable(t *testing.T) { signBytes := vote.SignBytes("test_chain_id") signStr := string(signBytes) - expected := `{"@chain_id":"test_chain_id","@type":"vote","block_id":{"hash":"68617368","parts":{"hash":"70617274735F68617368","total":"1000000"}},"height":"12345","round":"2","timestamp":"2017-12-25T03:00:01.234Z","type":2}` + expected := `{"@chain_id":"test_chain_id","@type":"vote","block_id":{"hash":"8B01023386C371778ECB6368573E539AFC3CC860","parts":{"hash":"72DB3D959635DFF1BB567BEDAA70573392C51596","total":"1000000"}},"height":"12345","round":"2","timestamp":"2017-12-25T03:00:01.234Z","type":2}` if signStr != expected { // NOTE: when this fails, you probably want to fix up consensus/replay_test too t.Errorf("Got unexpected sign string for Vote. Expected:\n%v\nGot:\n%v", expected, signStr) @@ -119,3 +120,16 @@ func TestVoteVerify(t *testing.T) { assert.Equal(t, ErrVoteInvalidSignature, err) } } + +func TestMaxVoteBytes(t *testing.T) { + vote := examplePrevote() + + privVal := NewMockPV() + err := privVal.SignVote("test_chain_id", vote) + require.NoError(t, err) + + bz, err := cdc.MarshalBinary(vote) + require.NoError(t, err) + + assert.Equal(t, MaxVoteBytes, len(bz)) +} From 0f7485690e51c81c9169a889c922913ab4e5c93b Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Aug 2018 12:59:05 +0400 Subject: [PATCH 104/149] limit chain ID to 50 symbols max --- types/block.go | 3 --- types/genesis.go | 9 ++++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/types/block.go b/types/block.go index 1037cacc..7d4551e5 100644 --- a/types/block.go +++ b/types/block.go @@ -19,9 +19,6 @@ const ( // MaxAminoOverheadForBlock - amino overhead to encode the block. MaxAminoOverheadForBlock = 4 - - // MaxChainIDLen is a maximum length of the chain ID. - MaxChainIDLen = 50 ) // Block defines the atomic unit of a Tendermint blockchain. diff --git a/types/genesis.go b/types/genesis.go index ccfd019c..0594c0e3 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -10,6 +10,11 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" ) +const ( + // MaxChainIDLen is a maximum length of the chain ID. + MaxChainIDLen = 50 +) + //------------------------------------------------------------ // core types for a genesis definition @@ -52,10 +57,12 @@ func (genDoc *GenesisDoc) ValidatorHash() []byte { // ValidateAndComplete checks that all necessary fields are present // and fills in defaults for optional fields left empty func (genDoc *GenesisDoc) ValidateAndComplete() error { - if genDoc.ChainID == "" { return cmn.NewError("Genesis doc must include non-empty chain_id") } + if len(genDoc.ChainID) > MaxChainIDLen { + return cmn.NewError(fmt.Sprintf("chain_id in genesis doc is too long (max: %d)", MaxChainIDLen)) + } if genDoc.ConsensusParams == nil { genDoc.ConsensusParams = DefaultConsensusParams() From ad3d42981a4c92e0d99b3e7ed46e3bca8d5988e5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Aug 2018 12:59:29 +0400 Subject: [PATCH 105/149] update Gopkg.lock --- Gopkg.lock | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index aecf4de7..8deb0637 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,14 +11,14 @@ [[projects]] branch = "master" - digest = "1:6aabc1566d6351115d561d038da82a4c19b46c3b6e17f4a0a2fa60260663dc79" + digest = "1:2c00f064ba355903866cbfbf3f7f4c0fe64af6638cc7d1b8bdcf3181bc67f1d8" name = "github.com/btcsuite/btcd" packages = ["btcec"] pruneopts = "UT" revision = "f5e261fc9ec3437697fb31d8b38453c293204b29" [[projects]] - digest = "1:df684ed7fed3fb406ec421424aaf5fc9c63ccc2f428b25b842da78e634482e4b" + digest = "1:1d8e1cb71c33a9470bbbae09bfec09db43c6bf358dfcae13cd8807c4e2a9a2bf" name = "github.com/btcsuite/btcutil" packages = [ "base58", @@ -59,7 +59,7 @@ version = "v1.4.7" [[projects]] - digest = "1:fa30c0652956e159cdb97dcb2ef8b8db63ed668c02a5c3a40961c8f0641252fe" + digest = "1:fdf5169073fb0ad6dc12a70c249145e30f4058647bea25f0abd48b6d9f228a11" name = "github.com/go-kit/kit" packages = [ "log", @@ -91,7 +91,7 @@ version = "v1.7.0" [[projects]] - digest = "1:212285efb97b9ec2e20550d81f0446cb7897e57cbdfd7301b1363ab113d8be45" + digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -106,7 +106,7 @@ version = "v1.1.1" [[projects]] - digest = "1:cb22af0ed7c72d495d8be1106233ee553898950f15fd3f5404406d44c2e86888" + digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" name = "github.com/golang/protobuf" packages = [ "proto", @@ -137,7 +137,7 @@ [[projects]] branch = "master" - digest = "1:8951fe6e358876736d8fa1f3992624fdbb2dec6bc49401c1381d1ef8abbb544f" + digest = "1:12247a2e99a060cc692f6680e5272c8adf0b8f572e6bce0d7095e624c958a240" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -225,7 +225,7 @@ version = "v1.0.0" [[projects]] - digest = "1:98225904b7abff96c052b669b25788f18225a36673fba022fb93514bb9a2a64e" + digest = "1:c1a04665f9613e082e1209cf288bf64f4068dcd6c87a64bf1c4ff006ad422ba0" name = "github.com/prometheus/client_golang" packages = [ "prometheus", @@ -236,7 +236,7 @@ [[projects]] branch = "master" - digest = "1:0f37e09b3e92aaeda5991581311f8dbf38944b36a3edec61cc2d1991f527554a" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] pruneopts = "UT" @@ -244,7 +244,7 @@ [[projects]] branch = "master" - digest = "1:dad2e5a2153ee7a6c9ab8fc13673a16ee4fb64434a7da980965a3741b0c981a3" + digest = "1:63b68062b8968092eb86bedc4e68894bd096ea6b24920faca8b9dcf451f54bb5" name = "github.com/prometheus/common" packages = [ "expfmt", @@ -256,7 +256,7 @@ [[projects]] branch = "master" - digest = "1:a37c98f4b7a66bb5c539c0539f0915a74ef1c8e0b3b6f45735289d94cae92bfd" + digest = "1:8c49953a1414305f2ff5465147ee576dd705487c35b15918fcd4efdc0cb7a290" name = "github.com/prometheus/procfs" packages = [ ".", @@ -275,7 +275,7 @@ revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] - digest = "1:37ace7f35375adec11634126944bdc45a673415e2fcc07382d03b75ec76ea94c" + digest = "1:bd1ae00087d17c5a748660b8e89e1043e1e5479d0fea743352cda2f8dd8c4f84" name = "github.com/spf13/afero" packages = [ ".", @@ -294,7 +294,7 @@ version = "v1.2.0" [[projects]] - digest = "1:627ab2f549a6a55c44f46fa24a4307f4d0da81bfc7934ed0473bf38b24051d26" + digest = "1:7ffc0983035bc7e297da3688d9fe19d60a420e9c38bef23f845c53788ed6a05e" name = "github.com/spf13/cobra" packages = ["."] pruneopts = "UT" @@ -326,7 +326,7 @@ version = "v1.0.0" [[projects]] - digest = "1:73697231b93fb74a73ebd8384b68b9a60c57ea6b13c56d2425414566a72c8e6d" + digest = "1:7e8d267900c7fa7f35129a2a37596e38ed0f11ca746d6d9ba727980ee138f9f6" name = "github.com/stretchr/testify" packages = [ "assert", @@ -338,7 +338,7 @@ [[projects]] branch = "master" - digest = "1:922191411ad8f61bcd8018ac127589bb489712c1d1a0ab2497aca4b16de417d2" + digest = "1:b3cfb8d82b1601a846417c3f31c03a7961862cb2c98dcf0959c473843e6d9a2b" name = "github.com/syndtr/goleveldb" packages = [ "leveldb", @@ -358,7 +358,7 @@ revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445" [[projects]] - digest = "1:34a30b75b54e4b73090d0cafc7884950f020272e36813201ba3860822c46c6dd" + digest = "1:605b6546f3f43745695298ec2d342d3e952b6d91cdf9f349bea9315f677d759f" name = "github.com/tendermint/btcd" packages = ["btcec"] pruneopts = "UT" @@ -366,7 +366,7 @@ [[projects]] branch = "master" - digest = "1:203b409c21115233a576f99e8f13d8e07ad82b25500491f7e1cca12588fb3232" + digest = "1:087aaa7920e5d0bf79586feb57ce01c35c830396ab4392798112e8aae8c47722" name = "github.com/tendermint/ed25519" packages = [ ".", @@ -386,7 +386,7 @@ [[projects]] branch = "master" - digest = "1:df132ec33d5acb4a1ab58d637f1bc3557be49456ca59b9198f5c1e7fa32e0d31" + digest = "1:c31a37cafc12315b8bd745c8ad6a006ac25350472488162a821e557b3e739d67" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -408,7 +408,7 @@ revision = "56440b844dfe139a8ac053f4ecac0b20b79058f4" [[projects]] - digest = "1:04dda8391c3e2397daf254ac68003f30141c069b228d06baec8324a5f81dc1e9" + digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" name = "golang.org/x/net" packages = [ "context", @@ -425,7 +425,7 @@ [[projects]] branch = "master" - digest = "1:70656e26ab4a96e683a21d677630edb5239a3d60b2d54bdc861c808ab5aa42c7" + digest = "1:bb0fe59917bdd5b89f49b9a8b26e5f465e325d9223b3a8e32254314bdf51e0f1" name = "golang.org/x/sys" packages = [ "cpu", @@ -435,7 +435,7 @@ revision = "3dc4335d56c789b04b0ba99b7a37249d9b614314" [[projects]] - digest = "1:7509ba4347d1f8de6ae9be8818b0cd1abc3deeffe28aeaf4be6d4b6b5178d9ca" + digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" name = "golang.org/x/text" packages = [ "collate", @@ -466,7 +466,7 @@ revision = "daca94659cb50e9f37c1b834680f2e46358f10b0" [[projects]] - digest = "1:4515e3030c440845b046354fd5d57671238428b820deebce2e9dabb5cd3c51ac" + digest = "1:2dab32a43451e320e49608ff4542fdfc653c95dcc35d0065ec9c6c3dd540ed74" name = "google.golang.org/grpc" packages = [ ".", @@ -525,6 +525,7 @@ "github.com/gogo/protobuf/gogoproto", "github.com/gogo/protobuf/jsonpb", "github.com/gogo/protobuf/proto", + "github.com/gogo/protobuf/types", "github.com/golang/protobuf/proto", "github.com/golang/protobuf/ptypes/timestamp", "github.com/gorilla/websocket", From e957f322c7ce17f7e2c7696f6af479816e40bcf9 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Aug 2018 13:07:39 +0400 Subject: [PATCH 106/149] be more precise in comments --- types/block.go | 3 ++- types/block_test.go | 3 +-- types/tx.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/block.go b/types/block.go index 7d4551e5..b13b3ac1 100644 --- a/types/block.go +++ b/types/block.go @@ -17,7 +17,8 @@ const ( // MaxHeaderBytes is a maximum header size (including amino overhead). MaxHeaderBytes = 478 - // MaxAminoOverheadForBlock - amino overhead to encode the block. + // MaxAminoOverheadForBlock - maximum amino overhead to encode a block (up to + // MaxBlockSizeBytes in size). MaxAminoOverheadForBlock = 4 ) diff --git a/types/block_test.go b/types/block_test.go index 3ca1da61..4c74439c 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -107,7 +107,6 @@ func TestBlockMakePartSet(t *testing.T) { func TestBlockMakePartSetWithEvidence(t *testing.T) { assert.Nil(t, (*Block)(nil).MakePartSet(2)) - txs := []Tx{Tx("foo"), Tx("bar")} lastID := makeBlockIDRandom() h := int64(3) @@ -118,7 +117,7 @@ func TestBlockMakePartSetWithEvidence(t *testing.T) { ev := NewMockGoodEvidence(h, 0, valSet.Validators[0].Address) evList := []Evidence{ev} - partSet := MakeBlock(h, txs, commit, evList).MakePartSet(1024) + partSet := MakeBlock(h, []Tx{Tx("Hello World")}, commit, evList).MakePartSet(1024) assert.NotNil(t, partSet) assert.Equal(t, 2, partSet.Total()) } diff --git a/types/tx.go b/types/tx.go index 53fd79c5..896d7be0 100644 --- a/types/tx.go +++ b/types/tx.go @@ -12,7 +12,8 @@ import ( ) const ( - // MaxAminoOverheadForTx - amino overhead to encode a transaction. + // MaxAminoOverheadForTx - maximum amino overhead to encode a transaction + // (ranges from 1 to 4 bytes). MaxAminoOverheadForTx = 4 ) From e873fed81540b916c803120fa3b0639bffdec383 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 31 Aug 2018 15:55:07 +0400 Subject: [PATCH 107/149] calculate amino overhead on the fly --- mempool/mempool.go | 9 +++++++-- types/tx.go | 6 ------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mempool/mempool.go b/mempool/mempool.go index ec93202e..6ee6c42b 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -4,6 +4,7 @@ import ( "bytes" "container/list" "crypto/sha256" + "encoding/binary" "fmt" "sync" "sync/atomic" @@ -385,6 +386,8 @@ func (mem *Mempool) notifyTxsAvailable() { // If max is negative, there is no cap on the size of all returned // transactions (~ all available transactions). func (mem *Mempool) ReapMaxBytes(max int) types.Txs { + var buf [binary.MaxVarintLen64]byte + mem.proxyMtx.Lock() defer mem.proxyMtx.Unlock() @@ -400,10 +403,12 @@ func (mem *Mempool) ReapMaxBytes(max int) types.Txs { txs := make([]types.Tx, 0, mem.txs.Len()) for e := mem.txs.Front(); e != nil; e = e.Next() { memTx := e.Value.(*mempoolTx) - if max > 0 && cur+len(memTx.tx)+types.MaxAminoOverheadForTx > max { + // amino.UvarintSize is not used here because it won't be possible to reuse buf + aminoOverhead := binary.PutUvarint(buf[:], uint64(len(memTx.tx))) + if max > 0 && cur+len(memTx.tx)+aminoOverhead > max { return txs } - cur += len(memTx.tx) + types.MaxAminoOverheadForTx + cur += len(memTx.tx) + aminoOverhead txs = append(txs, memTx.tx) } return txs diff --git a/types/tx.go b/types/tx.go index 896d7be0..489f0b23 100644 --- a/types/tx.go +++ b/types/tx.go @@ -11,12 +11,6 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" ) -const ( - // MaxAminoOverheadForTx - maximum amino overhead to encode a transaction - // (ranges from 1 to 4 bytes). - MaxAminoOverheadForTx = 4 -) - // Tx is an arbitrary byte array. // NOTE: Tx has no types at this level, so when wire encoded it's just length-prefixed. // Might we want types here ? From 02d1b03abbe5d59f6caf8e6d63228b24b2670c97 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 31 Aug 2018 15:55:30 +0400 Subject: [PATCH 108/149] update comment for MaxBlockSizeBytes --- types/block.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/block.go b/types/block.go index b13b3ac1..18214c57 100644 --- a/types/block.go +++ b/types/block.go @@ -18,8 +18,12 @@ const ( MaxHeaderBytes = 478 // MaxAminoOverheadForBlock - maximum amino overhead to encode a block (up to - // MaxBlockSizeBytes in size). - MaxAminoOverheadForBlock = 4 + // MaxBlockSizeBytes in size) not including it's parts (only varint len + + // fields without data). + // + // Uvarint length of MaxBlockSizeBytes: 4 bytes + // 4 fields: 4 bytes + MaxAminoOverheadForBlock = 8 ) // Block defines the atomic unit of a Tendermint blockchain. From 4147f856dc8329e367b8f870366751799aa39866 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 31 Aug 2018 16:10:41 +0400 Subject: [PATCH 109/149] update arch doc --- docs/architecture/adr-020-block-size.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/architecture/adr-020-block-size.md b/docs/architecture/adr-020-block-size.md index d40766b5..aebf3069 100644 --- a/docs/architecture/adr-020-block-size.md +++ b/docs/architecture/adr-020-block-size.md @@ -5,7 +5,8 @@ 13-08-2018: Initial Draft 15-08-2018: Second version after Dev's comments 28-08-2018: Third version after Ethan's comments -30-08-2018: AminoOverheadForBlock => MaxAminoOverheadForBlock, added MaxAminoOverheadForTx +30-08-2018: AminoOverheadForBlock => MaxAminoOverheadForBlock +31-08-2018: Bounding evidence and chain ID ## Context @@ -44,12 +45,16 @@ are constants defined inside the `types` package: - MaxEvidenceBytes - 364 bytes - MaxHeaderBytes - 476 bytes (~276 bytes hashes + 200 bytes - 50 UTF-8 encoded symbols of chain ID 4 bytes each in the worst case + amino overhead) -- MaxAminoOverheadForBlock - 4 bytes (assuming MaxHeaderBytes includes amino +- MaxAminoOverheadForBlock - 8 bytes (assuming MaxHeaderBytes includes amino overhead for encoding header, MaxVoteBytes - for encoding vote, etc.) +ChainID needs to bound to 50 symbols max. + +When reaping evidence, we use MaxBytes to calculate the upper bound (e.g. 1/10) +to save some space for transactions. + NOTE while reaping the `max int` bytes in mempool, we should account that every transaction will take `len(tx)+aminoOverhead`, where aminoOverhead=1-4 bytes. -Therefore, MaxAminoOverheadForTx should be added. We should write a test that fails if the underlying structs got changed, but MaxXXX stayed the same. From 5ecdfacb8e7eba146eccd7a8ce33e756afc7ab60 Mon Sep 17 00:00:00 2001 From: Peng Zhong <172531+nylira@users.noreply.github.com> Date: Sat, 1 Sep 2018 02:09:43 +0800 Subject: [PATCH 110/149] fix docs base directory (#2295) --- docs/config.js | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/docs/config.js b/docs/config.js index 65a08d53..09d0112e 100644 --- a/docs/config.js +++ b/docs/config.js @@ -2,15 +2,13 @@ module.exports = { title: "Tendermint Core", description: "Documentation for Tendermint Core", dest: "./dist/docs", - base: "/", + base: "/docs/", markdown: { lineNumbers: true }, themeConfig: { - lastUpdated: 'Last Updated', - nav: [ - { text: 'Back to Tendermint', link: 'https://tendermint.com' }, - ], + lastUpdated: "Last Updated", + nav: [{ text: "Back to Tendermint", link: "https://tendermint.com" }], sidebar: [ { title: "Getting Started", @@ -18,7 +16,7 @@ module.exports = { children: [ "/introduction/quick-start", "/introduction/install", - "/introduction/introduction", + "/introduction/introduction" ] }, { @@ -28,54 +26,48 @@ module.exports = { "/tendermint-core/using-tendermint", "/tendermint-core/configuration", "/tendermint-core/rpc", - "/tendermint-core/running-in-production", - "/tendermint-core/how-to-read-logs", - "/tendermint-core/block-structure", - "/tendermint-core/light-client-protocol", - "/tendermint-core/metrics", - "/tendermint-core/secure-p2p", - "/tendermint-core/validators", + "/tendermint-core/running-in-production", + "/tendermint-core/how-to-read-logs", + "/tendermint-core/block-structure", + "/tendermint-core/light-client-protocol", + "/tendermint-core/metrics", + "/tendermint-core/secure-p2p", + "/tendermint-core/validators" ] }, { title: "Tendermint Tools", collapsable: false, - children: [ - "tools/benchmarking", - "tools/monitoring", - ] - }, + children: ["tools/benchmarking", "tools/monitoring"] + }, { title: "Tendermint Networks", collapsable: false, children: [ "/networks/deploy-testnets", "/networks/terraform-and-ansible", - "/networks/fast-sync", + "/networks/fast-sync" ] }, { title: "Application Development", collapsable: false, children: [ - "/app-dev/getting-started", + "/app-dev/getting-started", "/app-dev/abci-cli", "/app-dev/app-architecture", "/app-dev/app-development", - "/app-dev/subscribing-to-events-via-websocket", + "/app-dev/subscribing-to-events-via-websocket", "/app-dev/indexing-transactions", - "/app-dev/abci-spec", - "/app-dev/ecosystem", + "/app-dev/abci-spec", + "/app-dev/ecosystem" ] }, { title: "Research", collapsable: false, - children: [ - "/research/determinism", - "/research/transactional-semantics", - ] - }, + children: ["/research/determinism", "/research/transactional-semantics"] + } ] } -} +}; From 7b88172f41faa88107880774c338a953df7f6686 Mon Sep 17 00:00:00 2001 From: Zarko Milosevic Date: Sat, 1 Sep 2018 01:33:51 +0200 Subject: [PATCH 111/149] Implement BFT time (#2203) * Implement BFT time * set LastValidators when creating state in state helper for heights >= 2 --- CHANGELOG_PENDING.md | 1 + blockchain/store_test.go | 12 ++-- cmd/tendermint/commands/init.go | 4 +- cmd/tendermint/commands/testnet.go | 4 +- config/config.go | 12 ++++ consensus/common_test.go | 5 +- consensus/reactor.go | 3 +- consensus/reactor_test.go | 3 +- consensus/state.go | 31 ++++++++-- consensus/types/height_vote_set_test.go | 4 +- consensus/types/round_state_test.go | 14 ++--- consensus/wal.go | 3 +- consensus/wal_test.go | 5 +- docs/spec/consensus/bft-time.md | 79 +++++++++++++------------ evidence/pool_test.go | 4 +- libs/log/tmfmt_logger.go | 2 +- lite/helpers.go | 9 ++- privval/priv_validator.go | 5 +- privval/priv_validator_test.go | 5 +- scripts/json2wal/main.go | 7 ++- state/execution_test.go | 7 ++- state/state.go | 31 ++++++++++ state/validation.go | 27 ++++++--- types/block.go | 1 - types/genesis_test.go | 4 +- types/proposal.go | 3 +- types/test_util.go | 6 +- types/time/time.go | 49 +++++++++++++++ types/time/time_test.go | 56 ++++++++++++++++++ types/validator_set_test.go | 6 +- types/vote_set_test.go | 16 ++--- 31 files changed, 306 insertions(+), 112 deletions(-) create mode 100644 types/time/time.go create mode 100644 types/time/time_test.go diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 811b561c..aab9096a 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -20,6 +20,7 @@ BREAKING CHANGES: - Remove PubKey from `Validator` and introduce `ValidatorUpdate` - InitChain and EndBlock use ValidatorUpdate - Update field names and types in BeginBlock +- [state] Implement BFT time - [p2p] update secret connection to use a little endian encoded nonce FEATURES: diff --git a/blockchain/store_test.go b/blockchain/store_test.go index 21ee529f..9c8fdb23 100644 --- a/blockchain/store_test.go +++ b/blockchain/store_test.go @@ -6,7 +6,6 @@ import ( "runtime/debug" "strings" "testing" - "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -14,6 +13,7 @@ import ( "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) func TestLoadBlockStoreStateJSON(t *testing.T) { @@ -70,7 +70,7 @@ var ( part1 = partSet.GetPart(0) part2 = partSet.GetPart(1) seenCommit1 = &types.Commit{Precommits: []*types.Vote{{Height: 10, - Timestamp: time.Now().UTC()}}} + Timestamp: tmtime.Now()}}} ) // TODO: This test should be simplified ... @@ -91,7 +91,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) { block := makeBlock(bs.Height()+1, state) validPartSet := block.MakePartSet(2) seenCommit := &types.Commit{Precommits: []*types.Vote{{Height: 10, - Timestamp: time.Now().UTC()}}} + Timestamp: tmtime.Now()}}} bs.SaveBlock(block, partSet, seenCommit) require.Equal(t, bs.Height(), block.Header.Height, "expecting the new height to be changed") @@ -103,7 +103,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) { Height: 1, NumTxs: 100, ChainID: "block_test", - Time: time.Now(), + Time: tmtime.Now(), } header2 := header1 header2.Height = 4 @@ -111,7 +111,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) { // End of setup, test data commitAtH10 := &types.Commit{Precommits: []*types.Vote{{Height: 10, - Timestamp: time.Now().UTC()}}} + Timestamp: tmtime.Now()}}} tuples := []struct { block *types.Block parts *types.PartSet @@ -335,7 +335,7 @@ func TestBlockFetchAtHeight(t *testing.T) { partSet := block.MakePartSet(2) seenCommit := &types.Commit{Precommits: []*types.Vote{{Height: 10, - Timestamp: time.Now().UTC()}}} + Timestamp: tmtime.Now()}}} bs.SaveBlock(block, partSet, seenCommit) require.Equal(t, bs.Height(), block.Header.Height, "expecting the new height to be changed") diff --git a/cmd/tendermint/commands/init.go b/cmd/tendermint/commands/init.go index d39a27da..dac4cd9a 100644 --- a/cmd/tendermint/commands/init.go +++ b/cmd/tendermint/commands/init.go @@ -2,7 +2,6 @@ package commands import ( "fmt" - "time" "github.com/spf13/cobra" @@ -11,6 +10,7 @@ import ( "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) // InitFilesCmd initialises a fresh Tendermint Core instance. @@ -54,7 +54,7 @@ func initFilesWithConfig(config *cfg.Config) error { } else { genDoc := types.GenesisDoc{ ChainID: fmt.Sprintf("test-chain-%v", cmn.RandStr(6)), - GenesisTime: time.Now(), + GenesisTime: tmtime.Now(), ConsensusParams: types.DefaultConsensusParams(), } genDoc.Validators = []types.GenesisValidator{{ diff --git a/cmd/tendermint/commands/testnet.go b/cmd/tendermint/commands/testnet.go index 69fbe1f6..d29c29eb 100644 --- a/cmd/tendermint/commands/testnet.go +++ b/cmd/tendermint/commands/testnet.go @@ -6,7 +6,6 @@ import ( "os" "path/filepath" "strings" - "time" "github.com/spf13/cobra" @@ -15,6 +14,7 @@ import ( "github.com/tendermint/tendermint/p2p" "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) var ( @@ -112,7 +112,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error { // Generate genesis doc from generated validators genDoc := &types.GenesisDoc{ - GenesisTime: time.Now(), + GenesisTime: tmtime.Now(), ChainID: "chain-" + cmn.RandStr(6), Validators: genVals, } diff --git a/config/config.go b/config/config.go index 48793f0f..de225140 100644 --- a/config/config.go +++ b/config/config.go @@ -469,6 +469,9 @@ type ConsensusConfig struct { // Reactor sleep duration parameters are in milliseconds PeerGossipSleepDuration int `mapstructure:"peer_gossip_sleep_duration"` PeerQueryMaj23SleepDuration int `mapstructure:"peer_query_maj23_sleep_duration"` + + // Block time parameters in milliseconds. Corresponds to the minimum time increment between consecutive blocks. + BlockTimeIota int `mapstructure:"blocktime_iota"` } // DefaultConsensusConfig returns a default configuration for the consensus service @@ -487,6 +490,7 @@ func DefaultConsensusConfig() *ConsensusConfig { CreateEmptyBlocksInterval: 0, PeerGossipSleepDuration: 100, PeerQueryMaj23SleepDuration: 2000, + BlockTimeIota: 1000, } } @@ -503,9 +507,17 @@ func TestConsensusConfig() *ConsensusConfig { cfg.SkipTimeoutCommit = true cfg.PeerGossipSleepDuration = 5 cfg.PeerQueryMaj23SleepDuration = 250 + cfg.BlockTimeIota = 10 return cfg } +// MinValidVoteTime returns the minimum acceptable block time. +// See the [BFT time spec](https://godoc.org/github.com/tendermint/tendermint/docs/spec/consensus/bft-time.md). +func (cfg *ConsensusConfig) MinValidVoteTime(lastBlockTime time.Time) time.Time { + return lastBlockTime. + Add(time.Duration(cfg.BlockTimeIota) * time.Millisecond) +} + // WaitForTxs returns true if the consensus should wait for transactions before entering the propose step func (cfg *ConsensusConfig) WaitForTxs() bool { return !cfg.CreateEmptyBlocks || cfg.CreateEmptyBlocksInterval > 0 diff --git a/consensus/common_test.go b/consensus/common_test.go index dc055959..d7e66148 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -25,6 +25,7 @@ import ( "github.com/tendermint/tendermint/privval" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" "github.com/tendermint/tendermint/abci/example/counter" "github.com/tendermint/tendermint/abci/example/kvstore" @@ -75,7 +76,7 @@ func (vs *validatorStub) signVote(voteType byte, hash []byte, header types.PartS ValidatorAddress: vs.PrivValidator.GetAddress(), Height: vs.Height, Round: vs.Round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: voteType, BlockID: types.BlockID{hash, header}, } @@ -423,7 +424,7 @@ func randGenesisDoc(numValidators int, randPower bool, minPower int64) (*types.G sort.Sort(types.PrivValidatorsByAddress(privValidators)) return &types.GenesisDoc{ - GenesisTime: time.Now(), + GenesisTime: tmtime.Now(), ChainID: config.ChainID(), Validators: validators, }, privValidators diff --git a/consensus/reactor.go b/consensus/reactor.go index 88557185..6ba81726 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -17,6 +17,7 @@ import ( "github.com/tendermint/tendermint/p2p" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) const ( @@ -1165,7 +1166,7 @@ func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) { psCatchupCommitRound := ps.PRS.CatchupCommitRound psCatchupCommit := ps.PRS.CatchupCommit - startTime := time.Now().Add(-1 * time.Duration(msg.SecondsSinceStartTime) * time.Second) + startTime := tmtime.Now().Add(-1 * time.Duration(msg.SecondsSinceStartTime) * time.Second) ps.PRS.Height = msg.Height ps.PRS.Round = msg.Round ps.PRS.Step = msg.Step diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index 364b6fb0..98b058b8 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -20,6 +20,7 @@ import ( "github.com/tendermint/tendermint/libs/log" mempl "github.com/tendermint/tendermint/mempool" sm "github.com/tendermint/tendermint/state" + tmtime "github.com/tendermint/tendermint/types/time" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/p2p" @@ -321,7 +322,7 @@ func TestReactorRecordsVotes(t *testing.T) { ValidatorAddress: val.Address, Height: 2, Round: 0, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: types.VoteTypePrevote, BlockID: types.BlockID{}, } diff --git a/consensus/state.go b/consensus/state.go index 65f5b6b3..d77afafe 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -12,6 +12,7 @@ import ( fail "github.com/ebuchman/fail-test" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" + tmtime "github.com/tendermint/tendermint/types/time" cfg "github.com/tendermint/tendermint/config" cstypes "github.com/tendermint/tendermint/consensus/types" @@ -422,8 +423,8 @@ func (cs *ConsensusState) updateRoundStep(round int, step cstypes.RoundStepType) // enterNewRound(height, 0) at cs.StartTime. func (cs *ConsensusState) scheduleRound0(rs *cstypes.RoundState) { - //cs.Logger.Info("scheduleRound0", "now", time.Now(), "startTime", cs.StartTime) - sleepDuration := rs.StartTime.Sub(time.Now()) // nolint: gotype, gosimple + //cs.Logger.Info("scheduleRound0", "now", tmtime.Now(), "startTime", cs.StartTime) + sleepDuration := rs.StartTime.Sub(tmtime.Now()) // nolint: gotype, gosimple cs.scheduleTimeout(sleepDuration, rs.Height, 0, cstypes.RoundStepNewHeight) } @@ -516,7 +517,7 @@ func (cs *ConsensusState) updateToState(state sm.State) { // to be gathered for the first block. // And alternative solution that relies on clocks: // cs.StartTime = state.LastBlockTime.Add(timeoutCommit) - cs.StartTime = cs.config.Commit(time.Now()) + cs.StartTime = cs.config.Commit(tmtime.Now()) } else { cs.StartTime = cs.config.Commit(cs.CommitTime) } @@ -729,7 +730,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { return } - if now := time.Now(); cs.StartTime.After(now) { + if now := tmtime.Now(); cs.StartTime.After(now) { logger.Info("Need to set a buffer and log message here for sanity.", "startTime", cs.StartTime, "now", now) } @@ -1195,7 +1196,7 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) { // keep cs.Round the same, commitRound points to the right Precommits set. cs.updateRoundStep(cs.Round, cstypes.RoundStepCommit) cs.CommitRound = commitRound - cs.CommitTime = time.Now() + cs.CommitTime = tmtime.Now() cs.newStep() // Maybe finalize immediately. @@ -1660,12 +1661,13 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool, func (cs *ConsensusState) signVote(type_ byte, hash []byte, header types.PartSetHeader) (*types.Vote, error) { addr := cs.privValidator.GetAddress() valIndex, _ := cs.Validators.GetByAddress(addr) + vote := &types.Vote{ ValidatorAddress: addr, ValidatorIndex: valIndex, Height: cs.Height, Round: cs.Round, - Timestamp: time.Now().UTC(), + Timestamp: cs.voteTime(), Type: type_, BlockID: types.BlockID{hash, header}, } @@ -1673,6 +1675,23 @@ func (cs *ConsensusState) signVote(type_ byte, hash []byte, header types.PartSet return vote, err } +func (cs *ConsensusState) voteTime() time.Time { + now := tmtime.Now() + minVoteTime := now + // TODO: We should remove next line in case we don't vote for v in case cs.ProposalBlock == nil, + // even if cs.LockedBlock != nil. See https://github.com/tendermint/spec. + if cs.LockedBlock != nil { + minVoteTime = cs.config.MinValidVoteTime(cs.LockedBlock.Time) + } else if cs.ProposalBlock != nil { + minVoteTime = cs.config.MinValidVoteTime(cs.ProposalBlock.Time) + } + + if now.After(minVoteTime) { + return now + } + return minVoteTime +} + // sign the vote and publish on internalMsgQueue func (cs *ConsensusState) signAddVote(type_ byte, hash []byte, header types.PartSetHeader) *types.Vote { // if we don't have a key or we're not in the validator set, do nothing diff --git a/consensus/types/height_vote_set_test.go b/consensus/types/height_vote_set_test.go index 77b5bfcb..5f469221 100644 --- a/consensus/types/height_vote_set_test.go +++ b/consensus/types/height_vote_set_test.go @@ -3,10 +3,10 @@ package types import ( "fmt" "testing" - "time" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) var config *cfg.Config // NOTE: must be reset for each _test.go file @@ -55,7 +55,7 @@ func makeVoteHR(t *testing.T, height int64, round int, privVals []types.PrivVali ValidatorIndex: valIndex, Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: types.VoteTypePrecommit, BlockID: types.BlockID{[]byte("fakehash"), types.PartSetHeader{}}, } diff --git a/consensus/types/round_state_test.go b/consensus/types/round_state_test.go index 4d128b18..a330981f 100644 --- a/consensus/types/round_state_test.go +++ b/consensus/types/round_state_test.go @@ -2,12 +2,12 @@ package types import ( "testing" - "time" - amino "github.com/tendermint/go-amino" + "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/crypto/ed25519" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) func BenchmarkRoundStateDeepCopy(b *testing.B) { @@ -27,7 +27,7 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { for i := 0; i < nval; i++ { precommits[i] = &types.Vote{ ValidatorAddress: types.Address(cmn.RandBytes(20)), - Timestamp: time.Now(), + Timestamp: tmtime.Now(), BlockID: blockID, Signature: sig, } @@ -40,7 +40,7 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { block := &types.Block{ Header: types.Header{ ChainID: cmn.RandStr(12), - Time: time.Now(), + Time: tmtime.Now(), LastBlockID: blockID, LastCommitHash: cmn.RandBytes(20), DataHash: cmn.RandBytes(20), @@ -62,7 +62,7 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { parts := block.MakePartSet(4096) // Random Proposal proposal := &types.Proposal{ - Timestamp: time.Now(), + Timestamp: tmtime.Now(), BlockPartsHeader: types.PartSetHeader{ Hash: cmn.RandBytes(20), }, @@ -73,8 +73,8 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { // TODO: hvs := rs := &RoundState{ - StartTime: time.Now(), - CommitTime: time.Now(), + StartTime: tmtime.Now(), + CommitTime: tmtime.Now(), Validators: vset, Proposal: proposal, ProposalBlock: block, diff --git a/consensus/wal.go b/consensus/wal.go index 5c22bb93..870701f1 100644 --- a/consensus/wal.go +++ b/consensus/wal.go @@ -14,6 +14,7 @@ import ( auto "github.com/tendermint/tendermint/libs/autofile" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) const ( @@ -119,7 +120,7 @@ func (wal *baseWAL) Write(msg WALMessage) { } // Write the wal message - if err := wal.enc.Encode(&TimedWALMessage{time.Now(), msg}); err != nil { + if err := wal.enc.Encode(&TimedWALMessage{tmtime.Now(), msg}); err != nil { panic(fmt.Sprintf("Error writing msg to consensus wal: %v \n\nMessage: %v", err, msg)) } } diff --git a/consensus/wal_test.go b/consensus/wal_test.go index 9a101bb7..e5744c0a 100644 --- a/consensus/wal_test.go +++ b/consensus/wal_test.go @@ -10,13 +10,14 @@ import ( "github.com/tendermint/tendermint/consensus/types" tmtypes "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestWALEncoderDecoder(t *testing.T) { - now := time.Now() + now := tmtime.Now() msgs := []TimedWALMessage{ TimedWALMessage{Time: now, Msg: EndHeightMessage{0}}, TimedWALMessage{Time: now, Msg: timeoutInfo{Duration: time.Second, Height: 1, Round: 1, Step: types.RoundStepPropose}}, @@ -93,7 +94,7 @@ func benchmarkWalDecode(b *testing.B, n int) { enc := NewWALEncoder(buf) data := nBytes(n) - enc.Encode(&TimedWALMessage{Msg: data, Time: time.Now().Round(time.Second)}) + enc.Encode(&TimedWALMessage{Msg: data, Time: time.Now().Round(time.Second).UTC()}) encoded := buf.Bytes() diff --git a/docs/spec/consensus/bft-time.md b/docs/spec/consensus/bft-time.md index c53c8042..06e66dbf 100644 --- a/docs/spec/consensus/bft-time.md +++ b/docs/spec/consensus/bft-time.md @@ -1,53 +1,54 @@ -# BFT time in Tendermint +# BFT time in Tendermint -Tendermint provides a deterministic, Byzantine fault-tolerant, source of time. -Time in Tendermint is defined with the Time field of the block header. +Tendermint provides a deterministic, Byzantine fault-tolerant, source of time. +Time in Tendermint is defined with the Time field of the block header. It satisfies the following properties: -- Time Monotonicity: Time is monotonically increasing, i.e., given - a header H1 for height h1 and a header H2 for height `h2 = h1 + 1`, `H1.Time < H2.Time`. -- Time Validity: Given a set of Commit votes that forms the `block.LastCommit` field, a range of - valid values for the Time field of the block header is defined only by - Precommit messages (from the LastCommit field) sent by correct processes, i.e., - a faulty process cannot arbitrarily increase the Time value. +- Time Monotonicity: Time is monotonically increasing, i.e., given +a header H1 for height h1 and a header H2 for height `h2 = h1 + 1`, `H1.Time < H2.Time`. +- Time Validity: Given a set of Commit votes that forms the `block.LastCommit` field, a range of +valid values for the Time field of the block header is defined only by +Precommit messages (from the LastCommit field) sent by correct processes, i.e., +a faulty process cannot arbitrarily increase the Time value. -In the context of Tendermint, time is of type int64 and denotes UNIX time in milliseconds, i.e., -corresponds to the number of milliseconds since January 1, 1970. Before defining rules that need to be enforced by the +In the context of Tendermint, time is of type int64 and denotes UNIX time in milliseconds, i.e., +corresponds to the number of milliseconds since January 1, 1970. Before defining rules that need to be enforced by the Tendermint consensus protocol, so the properties above holds, we introduce the following definition: -- median of a set of `Vote` messages is equal to the median of `Vote.Time` fields of the corresponding `Vote` messages, - where the value of `Vote.Time` is counted number of times proportional to the process voting power. As in Tendermint - the voting power is not uniform (one process one vote), a vote message is actually an aggregator of the same votes whose - number is equal to the voting power of the process that has casted the corresponding votes message. +- median of a Commit is equal to the median of `Vote.Time` fields of the `Vote` messages, +where the value of `Vote.Time` is counted number of times proportional to the process voting power. As in Tendermint +the voting power is not uniform (one process one vote), a vote message is actually an aggregator of the same votes whose +number is equal to the voting power of the process that has casted the corresponding votes message. Let's consider the following example: + - we have four processes p1, p2, p3 and p4, with the following voting power distribution (p1, 23), (p2, 27), (p3, 10) +and (p4, 10). The total voting power is 70 (`N = 3f+1`, where `N` is the total voting power, and `f` is the maximum voting +power of the faulty processes), so we assume that the faulty processes have at most 23 of voting power. +Furthermore, we have the following vote messages in some LastCommit field (we ignore all fields except Time field): + - (p1, 100), (p2, 98), (p3, 1000), (p4, 500). We assume that p3 and p4 are faulty processes. Let's assume that the + `block.LastCommit` message contains votes of processes p2, p3 and p4. Median is then chosen the following way: + the value 98 is counted 27 times, the value 1000 is counted 10 times and the value 500 is counted also 10 times. + So the median value will be the value 98. No matter what set of messages with at least `2f+1` voting power we + choose, the median value will always be between the values sent by correct processes. -- we have four processes p1, p2, p3 and p4, with the following voting power distribution (p1, 23), (p2, 27), (p3, 10) - and (p4, 10). The total voting power is 70 (`N = 3f+1`, where `N` is the total voting power, and `f` is the maximum voting - power of the faulty processes), so we assume that the faulty processes have at most 23 of voting power. - Furthermore, we have the following vote messages in some LastCommit field (we ignore all fields except Time field): - (p1, 100), (p2, 98), (p3, 1000), (p4, 500). We assume that p3 and p4 are faulty processes. Let's assume that the - `block.LastCommit` message contains votes of processes p2, p3 and p4. Median is then chosen the following way: - the value 98 is counted 27 times, the value 1000 is counted 10 times and the value 500 is counted also 10 times. - So the median value will be the value 98. No matter what set of messages with at least `2f+1` voting power we - choose, the median value will always be between the values sent by correct processes. +We ensure Time Monotonicity and Time Validity properties by the following rules: + +- let rs denotes `RoundState` (consensus internal state) of some process. Then +`rs.ProposalBlock.Header.Time == median(rs.LastCommit) && +rs.Proposal.Timestamp == rs.ProposalBlock.Header.Time`. -We ensure Time Monotonicity and Time Validity properties by the following rules: +- Furthermore, when creating the `vote` message, the following rules for determining `vote.Time` field should hold: -- let rs denotes `RoundState` (consensus internal state) of some process. Then - `rs.ProposalBlock.Header.Time == median(rs.LastCommit) && rs.Proposal.Timestamp == rs.ProposalBlock.Header.Time`. + - if `rs.LockedBlock` is defined then + `vote.Time = max(rs.LockedBlock.Timestamp + config.BlockTimeIota, time.Now())`, where `time.Now()` + denotes local Unix time in milliseconds, and `config.BlockTimeIota` is a configuration parameter that corresponds + to the minimum timestamp increment of the next block. + + - else if `rs.Proposal` is defined then + `vote.Time = max(rs.Proposal.Timestamp + config.BlockTimeIota, time.Now())`, + + - otherwise, `vote.Time = time.Now())`. In this case vote is for `nil` so it is not taken into account for + the timestamp of the next block. -- Furthermore, when creating the `vote` message, the following rules for determining `vote.Time` field should hold: - - if `rs.Proposal` is defined then - `vote.Time = max(rs.Proposal.Timestamp + 1, time.Now())`, where `time.Now()` - denotes local Unix time in milliseconds. - - - if `rs.Proposal` is not defined and `rs.Votes` contains +2/3 of the corresponding vote messages (votes for the - current height and round, and with the corresponding type (`Prevote` or `Precommit`)), then - - `vote.Time = max(median(getVotes(rs.Votes, vote.Height, vote.Round, vote.Type)), time.Now())`, - - where `getVotes` function returns the votes for particular `Height`, `Round` and `Type`. - The second rule is relevant for the case when a process jumps to a higher round upon receiving +2/3 votes for a higher - round, but the corresponding `Proposal` message for the higher round hasn't been received yet. diff --git a/evidence/pool_test.go b/evidence/pool_test.go index a38be0ab..159ae7cd 100644 --- a/evidence/pool_test.go +++ b/evidence/pool_test.go @@ -3,13 +3,13 @@ package evidence import ( "sync" "testing" - "time" "github.com/stretchr/testify/assert" dbm "github.com/tendermint/tendermint/libs/db" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) var mockState = sm.State{} @@ -25,7 +25,7 @@ func initializeValidatorState(valAddr []byte, height int64) dbm.DB { } state := sm.State{ LastBlockHeight: 0, - LastBlockTime: time.Now(), + LastBlockTime: tmtime.Now(), Validators: valSet, NextValidators: valSet.CopyIncrementAccum(1), LastHeightValidatorsChanged: 1, diff --git a/libs/log/tmfmt_logger.go b/libs/log/tmfmt_logger.go index d0397971..de155fef 100644 --- a/libs/log/tmfmt_logger.go +++ b/libs/log/tmfmt_logger.go @@ -90,7 +90,7 @@ func (l tmfmtLogger) Log(keyvals ...interface{}) error { // D - first character of the level, uppercase (ASCII only) // [05-02|11:06:44.322] - our time format (see https://golang.org/src/time/format.go) // Stopping ... - message - enc.buf.WriteString(fmt.Sprintf("%c[%s] %-44s ", lvl[0]-32, time.Now().UTC().Format("01-02|15:04:05.000"), msg)) + enc.buf.WriteString(fmt.Sprintf("%c[%s] %-44s ", lvl[0]-32, time.Now().Format("01-02|15:04:05.000"), msg)) if module != unknown { enc.buf.WriteString("module=" + module + " ") diff --git a/lite/helpers.go b/lite/helpers.go index 9265aeea..16d22e70 100644 --- a/lite/helpers.go +++ b/lite/helpers.go @@ -1,13 +1,12 @@ package lite import ( - "time" - - crypto "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) // privKeys is a helper type for testing. @@ -97,7 +96,7 @@ func makeVote(header *types.Header, valset *types.ValidatorSet, key crypto.PrivK ValidatorIndex: idx, Height: header.Height, Round: 1, - Timestamp: time.Now().Round(0).UTC(), + Timestamp: tmtime.Now(), Type: types.VoteTypePrecommit, BlockID: types.BlockID{Hash: header.Hash()}, } @@ -119,7 +118,7 @@ func genHeader(chainID string, height int64, txs types.Txs, return &types.Header{ ChainID: chainID, Height: height, - Time: time.Now().Round(0).UTC(), + Time: tmtime.Now(), NumTxs: int64(len(txs)), TotalTxs: int64(len(txs)), // LastBlockID diff --git a/privval/priv_validator.go b/privval/priv_validator.go index 83fbb7e4..3ba0519c 100644 --- a/privval/priv_validator.go +++ b/privval/priv_validator.go @@ -12,6 +12,7 @@ import ( "github.com/tendermint/tendermint/crypto/ed25519" cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) // TODO: type ? @@ -324,7 +325,7 @@ func checkVotesOnlyDifferByTimestamp(lastSignBytes, newSignBytes []byte) (time.T } // set the times to the same value and check equality - now := types.CanonicalTime(time.Now()) + now := types.CanonicalTime(tmtime.Now()) lastVote.Timestamp = now newVote.Timestamp = now lastVoteBytes, _ := cdc.MarshalJSON(lastVote) @@ -350,7 +351,7 @@ func checkProposalsOnlyDifferByTimestamp(lastSignBytes, newSignBytes []byte) (ti } // set the times to the same value and check equality - now := types.CanonicalTime(time.Now()) + now := types.CanonicalTime(tmtime.Now()) lastProposal.Timestamp = now newProposal.Timestamp = now lastProposalBytes, _ := cdc.MarshalJSON(lastProposal) diff --git a/privval/priv_validator_test.go b/privval/priv_validator_test.go index b4f9ddbc..404ff770 100644 --- a/privval/priv_validator_test.go +++ b/privval/priv_validator_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) func TestGenLoadValidator(t *testing.T) { @@ -235,7 +236,7 @@ func newVote(addr types.Address, idx int, height int64, round int, typ byte, blo Height: height, Round: round, Type: typ, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), BlockID: blockID, } } @@ -245,6 +246,6 @@ func newProposal(height int64, round int, partsHeader types.PartSetHeader) *type Height: height, Round: round, BlockPartsHeader: partsHeader, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), } } diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go index acf58603..be3487e5 100644 --- a/scripts/json2wal/main.go +++ b/scripts/json2wal/main.go @@ -10,12 +10,13 @@ package main import ( "bufio" "fmt" - "github.com/tendermint/go-amino" - cs "github.com/tendermint/tendermint/consensus" - "github.com/tendermint/tendermint/types" "io" "os" "strings" + + "github.com/tendermint/go-amino" + cs "github.com/tendermint/tendermint/consensus" + "github.com/tendermint/tendermint/types" ) var cdc = amino.NewCodec() diff --git a/state/execution_test.go b/state/execution_test.go index 4d7c4f99..6a200849 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -15,6 +15,7 @@ import ( cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" "github.com/tendermint/tendermint/libs/log" + tmtime "github.com/tendermint/tendermint/types/time" "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/types" @@ -62,7 +63,7 @@ func TestBeginBlockValidators(t *testing.T) { prevParts := types.PartSetHeader{} prevBlockID := types.BlockID{prevHash, prevParts} - now := time.Now().UTC() + now := tmtime.Now() vote0 := &types.Vote{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit} vote1 := &types.Vote{ValidatorIndex: 1, Timestamp: now} @@ -81,6 +82,7 @@ func TestBeginBlockValidators(t *testing.T) { // block for height 2 block, _ := state.MakeBlock(2, makeTxs(2), lastCommit, nil, state.Validators.GetProposer().Address) + _, err = ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), state.Validators, stateDB) require.Nil(t, err, tc.desc) @@ -119,7 +121,7 @@ func TestBeginBlockByzantineValidators(t *testing.T) { ev1 := types.NewMockGoodEvidence(height1, idx1, val1) ev2 := types.NewMockGoodEvidence(height2, idx2, val2) - now := time.Now() + now := tmtime.Now() valSet := state.Validators testCases := []struct { desc string @@ -320,6 +322,7 @@ func state(nVals, height int) (State, dbm.DB) { for i := 1; i < height; i++ { s.LastBlockHeight++ + s.LastValidators = s.Validators.Copy() SaveState(stateDB, s) } return s, stateDB diff --git a/state/state.go b/state/state.go index 0315e734..10da67e9 100644 --- a/state/state.go +++ b/state/state.go @@ -7,6 +7,7 @@ import ( "time" "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" ) // database keys @@ -115,6 +116,16 @@ func (state State) MakeBlock( // Fill rest of header with state data. block.ChainID = state.ChainID + // Set time + if height == 1 { + block.Time = tmtime.Now() + if block.Time.Before(state.LastBlockTime) { + block.Time = state.LastBlockTime // state.LastBlockTime for height == 1 is genesis time + } + } else { + block.Time = MedianTime(commit, state.LastValidators) + } + block.LastBlockID = state.LastBlockID block.TotalTxs = state.LastBlockTotalTx + block.NumTxs @@ -131,6 +142,26 @@ func (state State) MakeBlock( return block, block.MakePartSet(state.ConsensusParams.BlockGossip.BlockPartSizeBytes) } +// MedianTime computes a median time for a given Commit (based on Timestamp field of votes messages) and the +// corresponding validator set. The computed time is always between timestamps of +// the votes sent by honest processes, i.e., a faulty processes can not arbitrarily increase or decrease the +// computed value. +func MedianTime(commit *types.Commit, validators *types.ValidatorSet) time.Time { + + weightedTimes := make([]*tmtime.WeightedTime, len(commit.Precommits)) + totalVotingPower := int64(0) + + for i, vote := range commit.Precommits { + if vote != nil { + _, validator := validators.GetByIndex(vote.ValidatorIndex) + totalVotingPower += validator.VotingPower + weightedTimes[i] = tmtime.NewWeightedTime(vote.Timestamp, validator.VotingPower) + } + } + + return tmtime.WeightedMedian(weightedTimes, totalVotingPower) +} + //------------------------------------------------------------------------ // Genesis diff --git a/state/validation.go b/state/validation.go index 5c88d97b..ccfe1ef1 100644 --- a/state/validation.go +++ b/state/validation.go @@ -34,13 +34,6 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { block.Height, ) } - /* TODO: Determine bounds for Time - See blockchain/reactor "stopSyncingDurationMinutes" - - if !block.Time.After(lastBlockTime) { - return errors.New("Invalid Block.Header.Time") - } - */ // Validate prev block info. if !block.LastBlockID.Equals(state.LastBlockID) { @@ -112,6 +105,26 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error { } } + // Validate block Time + if block.Height > 1 { + if !block.Time.After(state.LastBlockTime) { + return fmt.Errorf( + "Block time %v not greater than last block time %v", + block.Time, + state.LastBlockTime, + ) + } + + medianTime := MedianTime(block.LastCommit, state.LastValidators) + if !block.Time.Equal(medianTime) { + return fmt.Errorf( + "Invalid block time. Expected %v, got %v", + medianTime, + block.Time, + ) + } + } + // Validate all evidence. // TODO: Each check requires loading an old validator set. // We should cap the amount of evidence per block diff --git a/types/block.go b/types/block.go index 18214c57..7d29c578 100644 --- a/types/block.go +++ b/types/block.go @@ -43,7 +43,6 @@ func MakeBlock(height int64, txs []Tx, lastCommit *Commit, evidence []Evidence) block := &Block{ Header: Header{ Height: height, - Time: time.Now(), NumTxs: int64(len(txs)), }, Data: Data{ diff --git a/types/genesis_test.go b/types/genesis_test.go index 50134d03..c0cfcdea 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "os" "testing" - "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" + tmtime "github.com/tendermint/tendermint/types/time" ) func TestGenesisBad(t *testing.T) { @@ -110,7 +110,7 @@ func TestGenesisValidatorHash(t *testing.T) { func randomGenesisDoc() *GenesisDoc { return &GenesisDoc{ - GenesisTime: time.Now().UTC(), + GenesisTime: tmtime.Now(), ChainID: "abc", Validators: []GenesisValidator{{ed25519.GenPrivKey().PubKey(), 10, "myval"}}, ConsensusParams: DefaultConsensusParams(), diff --git a/types/proposal.go b/types/proposal.go index 325efa85..97e0dca3 100644 --- a/types/proposal.go +++ b/types/proposal.go @@ -6,6 +6,7 @@ import ( "time" cmn "github.com/tendermint/tendermint/libs/common" + tmtime "github.com/tendermint/tendermint/types/time" ) var ( @@ -34,7 +35,7 @@ func NewProposal(height int64, round int, blockPartsHeader PartSetHeader, polRou return &Proposal{ Height: height, Round: round, - Timestamp: time.Now().Round(0).UTC(), + Timestamp: tmtime.Now(), BlockPartsHeader: blockPartsHeader, POLRound: polRound, POLBlockID: polBlockID, diff --git a/types/test_util.go b/types/test_util.go index f21c2831..e20ea212 100644 --- a/types/test_util.go +++ b/types/test_util.go @@ -1,6 +1,8 @@ package types -import "time" +import ( + tmtime "github.com/tendermint/tendermint/types/time" +) func MakeCommit(blockID BlockID, height int64, round int, voteSet *VoteSet, @@ -16,7 +18,7 @@ func MakeCommit(blockID BlockID, height int64, round int, Round: round, Type: VoteTypePrecommit, BlockID: blockID, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), } _, err := signAddVote(validators[i], vote, voteSet) diff --git a/types/time/time.go b/types/time/time.go new file mode 100644 index 00000000..2f6b7899 --- /dev/null +++ b/types/time/time.go @@ -0,0 +1,49 @@ +package time + +import ( + "sort" + "time" +) + +// Now returns UTC time rounded since the zero time. +func Now() time.Time { + return time.Now().Round(0).UTC() +} + +type WeightedTime struct { + Time time.Time + Weight int64 +} + +func NewWeightedTime(time time.Time, weight int64) *WeightedTime { + return &WeightedTime{ + Time: time, + Weight: weight, + } +} + +// WeightedMedian computes weighted median time for a given array of WeightedTime and the total voting power. +func WeightedMedian(weightedTimes []*WeightedTime, totalVotingPower int64) (res time.Time) { + median := totalVotingPower / 2 + + sort.Slice(weightedTimes, func(i, j int) bool { + if weightedTimes[i] == nil { + return false + } + if weightedTimes[j] == nil { + return true + } + return weightedTimes[i].Time.UnixNano() < weightedTimes[j].Time.UnixNano() + }) + + for _, weightedTime := range weightedTimes { + if weightedTime != nil { + if median <= weightedTime.Weight { + res = weightedTime.Time + break + } + median -= weightedTime.Weight + } + } + return +} diff --git a/types/time/time_test.go b/types/time/time_test.go new file mode 100644 index 00000000..1b1a30e5 --- /dev/null +++ b/types/time/time_test.go @@ -0,0 +1,56 @@ +package time + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestWeightedMedian(t *testing.T) { + m := make([]*WeightedTime, 3) + + t1 := Now() + t2 := t1.Add(5 * time.Second) + t3 := t1.Add(10 * time.Second) + + m[2] = NewWeightedTime(t1, 33) // faulty processes + m[0] = NewWeightedTime(t2, 40) // correct processes + m[1] = NewWeightedTime(t3, 27) // correct processes + totalVotingPower := int64(100) + + median := WeightedMedian(m, totalVotingPower) + assert.Equal(t, t2, median) + // median always returns value between values of correct processes + assert.Equal(t, true, (median.After(t1) || median.Equal(t1)) && + (median.Before(t3) || median.Equal(t3))) + + m[1] = NewWeightedTime(t1, 40) // correct processes + m[2] = NewWeightedTime(t2, 27) // correct processes + m[0] = NewWeightedTime(t3, 33) // faulty processes + totalVotingPower = int64(100) + + median = WeightedMedian(m, totalVotingPower) + assert.Equal(t, t2, median) + // median always returns value between values of correct processes + assert.Equal(t, true, (median.After(t1) || median.Equal(t1)) && + (median.Before(t2) || median.Equal(t2))) + + m = make([]*WeightedTime, 8) + t4 := t1.Add(15 * time.Second) + t5 := t1.Add(60 * time.Second) + + m[3] = NewWeightedTime(t1, 10) // correct processes + m[1] = NewWeightedTime(t2, 10) // correct processes + m[5] = NewWeightedTime(t2, 10) // correct processes + m[4] = NewWeightedTime(t3, 23) // faulty processes + m[0] = NewWeightedTime(t4, 20) // correct processes + m[7] = NewWeightedTime(t5, 10) // faulty processes + totalVotingPower = int64(83) + + median = WeightedMedian(m, totalVotingPower) + assert.Equal(t, t3, median) + // median always returns value between values of correct processes + assert.Equal(t, true, (median.After(t1) || median.Equal(t1)) && + (median.Before(t4) || median.Equal(t4))) +} diff --git a/types/validator_set_test.go b/types/validator_set_test.go index ad9a2b00..e4111707 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -7,13 +7,13 @@ import ( "strings" "testing" "testing/quick" - "time" "github.com/stretchr/testify/assert" - crypto "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" cmn "github.com/tendermint/tendermint/libs/common" + tmtime "github.com/tendermint/tendermint/types/time" ) func TestValidatorSetBasic(t *testing.T) { @@ -384,7 +384,7 @@ func TestValidatorSetVerifyCommit(t *testing.T) { ValidatorIndex: 0, Height: height, Round: 0, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: VoteTypePrecommit, BlockID: blockID, } diff --git a/types/vote_set_test.go b/types/vote_set_test.go index 32ceb7b1..995fb94b 100644 --- a/types/vote_set_test.go +++ b/types/vote_set_test.go @@ -3,11 +3,11 @@ package types import ( "bytes" "testing" - "time" - crypto "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/crypto" cmn "github.com/tendermint/tendermint/libs/common" tst "github.com/tendermint/tendermint/libs/test" + tmtime "github.com/tendermint/tendermint/types/time" ) // NOTE: privValidators are in order @@ -83,7 +83,7 @@ func TestAddVote(t *testing.T) { Height: height, Round: round, Type: VoteTypePrevote, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), BlockID: BlockID{nil, PartSetHeader{}}, } _, err := signAddVote(val0, vote, voteSet) @@ -113,7 +113,7 @@ func Test2_3Majority(t *testing.T) { Height: height, Round: round, Type: VoteTypePrevote, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), BlockID: BlockID{nil, PartSetHeader{}}, } // 6 out of 10 voted for nil. @@ -169,7 +169,7 @@ func Test2_3MajorityRedux(t *testing.T) { ValidatorIndex: -1, // NOTE: must fill in Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: VoteTypePrevote, BlockID: BlockID{blockHash, blockPartsHeader}, } @@ -264,7 +264,7 @@ func TestBadVotes(t *testing.T) { ValidatorIndex: -1, Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: VoteTypePrevote, BlockID: BlockID{nil, PartSetHeader{}}, } @@ -326,7 +326,7 @@ func TestConflicts(t *testing.T) { ValidatorIndex: -1, Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: VoteTypePrevote, BlockID: BlockID{nil, PartSetHeader{}}, } @@ -455,7 +455,7 @@ func TestMakeCommit(t *testing.T) { ValidatorIndex: -1, Height: height, Round: round, - Timestamp: time.Now().UTC(), + Timestamp: tmtime.Now(), Type: VoteTypePrecommit, BlockID: BlockID{blockHash, blockPartsHeader}, } From 1de32fba17a392b656c73a917843724b92b8989d Mon Sep 17 00:00:00 2001 From: Ismail Khoffi Date: Sun, 2 Sep 2018 07:13:09 +0100 Subject: [PATCH 112/149] Check for int overflow in clist (#2289) * explicitly panic if max capacity is reached * address review comments * comments and a test --- CHANGELOG_PENDING.md | 1 + libs/clist/clist.go | 23 ++++++++++++++++++++++- libs/clist/clist_test.go | 13 +++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index aab9096a..30303008 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -22,6 +22,7 @@ BREAKING CHANGES: - Update field names and types in BeginBlock - [state] Implement BFT time - [p2p] update secret connection to use a little endian encoded nonce +- [libs/clist] Panics if list extends beyond MaxLength FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) diff --git a/libs/clist/clist.go b/libs/clist/clist.go index b3e66efc..c69d3d5f 100644 --- a/libs/clist/clist.go +++ b/libs/clist/clist.go @@ -12,9 +12,15 @@ to ensure garbage collection of removed elements. */ import ( + "fmt" "sync" ) +// MaxLength is the max allowed number of elements a linked list is +// allowed to contain. +// If more elements are pushed to the list it will panic. +const MaxLength = int(^uint(0) >> 1) + /* CElement is an element of a linked-list @@ -210,6 +216,7 @@ func (e *CElement) SetRemoved() { // CList represents a linked list. // The zero value for CList is an empty list ready to use. // Operations are goroutine-safe. +// Panics if length grows beyond the max. type CList struct { mtx sync.RWMutex wg *sync.WaitGroup @@ -217,6 +224,7 @@ type CList struct { head *CElement // first element tail *CElement // last element len int // list length + maxLen int // max list length } func (l *CList) Init() *CList { @@ -231,7 +239,16 @@ func (l *CList) Init() *CList { return l } -func New() *CList { return new(CList).Init() } +// Return CList with MaxLength. CList will panic if it goes beyond MaxLength. +func New() *CList { return newWithMax(MaxLength) } + +// Return CList with given maxLength. +// Will panic if list exceeds given maxLength. +func newWithMax(maxLength int) *CList { + l := new(CList) + l.maxLen = maxLength + return l.Init() +} func (l *CList) Len() int { l.mtx.RLock() @@ -295,6 +312,7 @@ func (l *CList) WaitChan() <-chan struct{} { return l.waitCh } +// Panics if list grows beyond its max length. func (l *CList) PushBack(v interface{}) *CElement { l.mtx.Lock() @@ -315,6 +333,9 @@ func (l *CList) PushBack(v interface{}) *CElement { l.wg.Done() close(l.waitCh) } + if l.len >= l.maxLen { + panic(fmt.Sprintf("clist: maximum length list reached %d", l.maxLen)) + } l.len++ // Modify the tail diff --git a/libs/clist/clist_test.go b/libs/clist/clist_test.go index f6653d22..4ded6177 100644 --- a/libs/clist/clist_test.go +++ b/libs/clist/clist_test.go @@ -7,9 +7,22 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" cmn "github.com/tendermint/tendermint/libs/common" ) +func TestPanicOnMaxLength(t *testing.T) { + maxLength := 1000 + + l := newWithMax(maxLength) + for i := 0; i < maxLength; i++ { + l.PushBack(1) + } + assert.Panics(t, func() { + l.PushBack(1) + }) +} + func TestSmall(t *testing.T) { l := New() el1 := l.PushBack(1) From 166fd82b70b76f0216cf3dacda9714e9eb19ba1c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 4 Sep 2018 11:46:34 +0400 Subject: [PATCH 113/149] max-bytes PR follow-up (#2318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- mempool/mempool.go | 13 ++++++------- node/node.go | 6 +++--- types/block.go | 11 ++++++----- types/block_test.go | 9 +++++---- types/evidence.go | 2 +- types/evidence_test.go | 9 +++++---- types/vote.go | 2 +- types/vote_test.go | 18 +++++++++++++++++- 8 files changed, 44 insertions(+), 26 deletions(-) diff --git a/mempool/mempool.go b/mempool/mempool.go index 6ee6c42b..381653e6 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -142,12 +142,10 @@ func (mem *Mempool) SetLogger(l log.Logger) { mem.logger = l } -// SetFilter sets a filter for mempool to only accept txs for which f(tx) +// WithFilter sets a filter for mempool to only accept txs for which f(tx) // returns true. -func (mem *Mempool) SetFilter(f func(types.Tx) bool) { - mem.proxyMtx.Lock() - mem.filter = f - mem.proxyMtx.Unlock() +func WithFilter(f func(types.Tx) bool) MempoolOption { + return func(mem *Mempool) { mem.filter = f } } // WithMetrics sets the metrics. @@ -415,13 +413,14 @@ func (mem *Mempool) ReapMaxBytes(max int) types.Txs { } // ReapMaxTxs reaps up to max transactions from the mempool. -// If max is negative, function panics. +// If max is negative, there is no cap on the size of all returned +// transactions (~ all available transactions). func (mem *Mempool) ReapMaxTxs(max int) types.Txs { mem.proxyMtx.Lock() defer mem.proxyMtx.Unlock() if max < 0 { - panic("Called ReapMaxTxs with negative max") + max = mem.txs.Len() } for atomic.LoadInt32(&mem.rechecking) > 0 { diff --git a/node/node.go b/node/node.go index 7e6603d9..330095f8 100644 --- a/node/node.go +++ b/node/node.go @@ -240,16 +240,16 @@ func NewNode(config *cfg.Config, csMetrics, p2pMetrics, memplMetrics := metricsProvider() // Make MempoolReactor - mempoolLogger := logger.With("module", "mempool") + maxBytes := state.ConsensusParams.TxSize.MaxBytes mempool := mempl.NewMempool( config.Mempool, proxyApp.Mempool(), state.LastBlockHeight, mempl.WithMetrics(memplMetrics), + mempl.WithFilter(func(tx types.Tx) bool { return len(tx) <= maxBytes }), ) + mempoolLogger := logger.With("module", "mempool") mempool.SetLogger(mempoolLogger) - maxBytes := state.ConsensusParams.TxSize.MaxBytes - mempool.SetFilter(func(tx types.Tx) bool { return len(tx) <= maxBytes }) mempool.InitWAL() // no need to have the mempool wal during tests mempoolReactor := mempl.NewMempoolReactor(config.Mempool, mempool) mempoolReactor.SetLogger(mempoolLogger) diff --git a/types/block.go b/types/block.go index 7d29c578..f705c7db 100644 --- a/types/block.go +++ b/types/block.go @@ -15,15 +15,16 @@ import ( const ( // MaxHeaderBytes is a maximum header size (including amino overhead). - MaxHeaderBytes = 478 + MaxHeaderBytes = 511 // MaxAminoOverheadForBlock - maximum amino overhead to encode a block (up to - // MaxBlockSizeBytes in size) not including it's parts (only varint len + - // fields without data). + // MaxBlockSizeBytes in size) not including it's parts except Data. // // Uvarint length of MaxBlockSizeBytes: 4 bytes - // 4 fields: 4 bytes - MaxAminoOverheadForBlock = 8 + // 2 fields (2 embedded): 2 bytes + // Uvarint length of Data.Txs: 4 bytes + // Data.Txs field: 1 byte + MaxAminoOverheadForBlock = 11 ) // Block defines the atomic unit of a Tendermint blockchain. diff --git a/types/block_test.go b/types/block_test.go index 4c74439c..c2a73bf8 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -1,6 +1,7 @@ package types import ( + "math" "testing" "time" @@ -246,11 +247,11 @@ func TestMaxHeaderBytes(t *testing.T) { h := Header{ ChainID: maxChainID, - Height: 10, + Height: math.MaxInt64, Time: time.Now().UTC(), - NumTxs: 100, - TotalTxs: 200, - LastBlockID: makeBlockID(make([]byte, 20), 300, make([]byte, 20)), + NumTxs: math.MaxInt64, + TotalTxs: math.MaxInt64, + LastBlockID: makeBlockID(make([]byte, tmhash.Size), math.MaxInt64, make([]byte, tmhash.Size)), LastCommitHash: tmhash.Sum([]byte("last_commit_hash")), DataHash: tmhash.Sum([]byte("data_hash")), ValidatorsHash: tmhash.Sum([]byte("validators_hash")), diff --git a/types/evidence.go b/types/evidence.go index 096e3503..8377fcd7 100644 --- a/types/evidence.go +++ b/types/evidence.go @@ -12,7 +12,7 @@ import ( const ( // MaxEvidenceBytes is a maximum size of any evidence (including amino overhead). - MaxEvidenceBytes = 364 + MaxEvidenceBytes = 440 ) // ErrEvidenceInvalid wraps a piece of evidence and the error denoting how or why it is invalid. diff --git a/types/evidence_test.go b/types/evidence_test.go index fab26b61..68c68351 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -1,6 +1,7 @@ package types import ( + "math" "testing" "github.com/stretchr/testify/assert" @@ -95,13 +96,13 @@ func TestEvidenceList(t *testing.T) { func TestMaxEvidenceBytes(t *testing.T) { val := NewMockPV() - blockID := makeBlockID(tmhash.Sum([]byte("blockhash")), 1000, tmhash.Sum([]byte("partshash"))) - blockID2 := makeBlockID(tmhash.Sum([]byte("blockhash2")), 1000, tmhash.Sum([]byte("partshash"))) + blockID := makeBlockID(tmhash.Sum([]byte("blockhash")), math.MaxInt64, tmhash.Sum([]byte("partshash"))) + blockID2 := makeBlockID(tmhash.Sum([]byte("blockhash2")), math.MaxInt64, tmhash.Sum([]byte("partshash"))) const chainID = "mychain" ev := &DuplicateVoteEvidence{ PubKey: secp256k1.GenPrivKey().PubKey(), // use secp because it's pubkey is longer - VoteA: makeVote(val, chainID, 0, 10, 2, 1, blockID), - VoteB: makeVote(val, chainID, 0, 10, 2, 1, blockID2), + VoteA: makeVote(val, chainID, math.MaxInt64, math.MaxInt64, math.MaxInt64, math.MaxInt64, blockID), + VoteB: makeVote(val, chainID, math.MaxInt64, math.MaxInt64, math.MaxInt64, math.MaxInt64, blockID2), } bz, err := cdc.MarshalBinary(ev) diff --git a/types/vote.go b/types/vote.go index ac163e8d..6481f56b 100644 --- a/types/vote.go +++ b/types/vote.go @@ -12,7 +12,7 @@ import ( const ( // MaxVoteBytes is a maximum vote size (including amino overhead). - MaxVoteBytes = 170 + MaxVoteBytes = 200 ) var ( diff --git a/types/vote_test.go b/types/vote_test.go index 679fcd56..4f544935 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -1,6 +1,7 @@ package types import ( + "math" "testing" "time" @@ -8,6 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/tmhash" + tmtime "github.com/tendermint/tendermint/types/time" ) func examplePrevote() *Vote { @@ -122,7 +124,21 @@ func TestVoteVerify(t *testing.T) { } func TestMaxVoteBytes(t *testing.T) { - vote := examplePrevote() + vote := &Vote{ + ValidatorAddress: tmhash.Sum([]byte("validator_address")), + ValidatorIndex: math.MaxInt64, + Height: math.MaxInt64, + Round: math.MaxInt64, + Timestamp: tmtime.Now(), + Type: VoteTypePrevote, + BlockID: BlockID{ + Hash: tmhash.Sum([]byte("blockID_hash")), + PartsHeader: PartSetHeader{ + Total: math.MaxInt64, + Hash: tmhash.Sum([]byte("blockID_part_set_header_hash")), + }, + }, + } privVal := NewMockPV() err := privVal.SignVote("test_chain_id", vote) From eabb1ece8ecedc42fb74d5bc83b42a76cd42fa38 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 4 Sep 2018 04:20:58 -0400 Subject: [PATCH 114/149] tmtime: Canonical, some comments (#2312) --- types/canonical_json.go | 3 ++- types/genesis.go | 3 ++- types/protobuf_test.go | 3 ++- types/time/time.go | 11 +++++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/types/canonical_json.go b/types/canonical_json.go index 4f512af8..d8399ff1 100644 --- a/types/canonical_json.go +++ b/types/canonical_json.go @@ -4,6 +4,7 @@ import ( "time" cmn "github.com/tendermint/tendermint/libs/common" + tmtime "github.com/tendermint/tendermint/types/time" ) // Canonical json is amino's json for structs with fields in alphabetical order @@ -110,5 +111,5 @@ func CanonicalTime(t time.Time) string { // Note that sending time over amino resets it to // local time, we need to force UTC here, so the // signatures match - return t.Round(0).UTC().Format(TimeFormat) + return tmtime.Canonical(t).Format(TimeFormat) } diff --git a/types/genesis.go b/types/genesis.go index 0594c0e3..4cf3b730 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -8,6 +8,7 @@ import ( "github.com/tendermint/tendermint/crypto" cmn "github.com/tendermint/tendermint/libs/common" + tmtime "github.com/tendermint/tendermint/types/time" ) const ( @@ -79,7 +80,7 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error { } if genDoc.GenesisTime.IsZero() { - genDoc.GenesisTime = time.Now() + genDoc.GenesisTime = tmtime.Now() } return nil diff --git a/types/protobuf_test.go b/types/protobuf_test.go index 2a511225..f8682abf 100644 --- a/types/protobuf_test.go +++ b/types/protobuf_test.go @@ -9,6 +9,7 @@ import ( "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/secp256k1" + tmtime "github.com/tendermint/tendermint/types/time" ) func TestABCIPubKey(t *testing.T) { @@ -77,7 +78,7 @@ func TestABCIConsensusParams(t *testing.T) { func TestABCIHeader(t *testing.T) { header := &Header{ Height: int64(3), - Time: time.Now(), + Time: tmtime.Now(), NumTxs: int64(10), ProposerAddress: []byte("cloak"), } diff --git a/types/time/time.go b/types/time/time.go index 2f6b7899..62aca9ec 100644 --- a/types/time/time.go +++ b/types/time/time.go @@ -5,16 +5,23 @@ import ( "time" ) -// Now returns UTC time rounded since the zero time. +// Now returns the current time in UTC with no monotonic component. func Now() time.Time { - return time.Now().Round(0).UTC() + return Canonical(time.Now()) } +// Canonical returns UTC time with no monotonic component. +func Canonical(t time.Time) time.Time { + return t.Round(0).UTC() +} + +// WeightedTime for computing a median. type WeightedTime struct { Time time.Time Weight int64 } +// NewWeightedTime with time and weight. func NewWeightedTime(time time.Time, weight int64) *WeightedTime { return &WeightedTime{ Time: time, From 29d2db352ec89a8af626bd98e9cbceaabb4df2d7 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 4 Sep 2018 23:20:45 +0400 Subject: [PATCH 115/149] update outdated abci-cli install instructions (#2325) https://github.com/tendermint/tendermint/pull/2301 --- abci/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/abci/README.md b/abci/README.md index 493d862f..c536a3bd 100644 --- a/abci/README.md +++ b/abci/README.md @@ -24,7 +24,7 @@ For more background information on ABCI, motivations, and tendermint, please vis The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`. -## Protocl Buffers +## Protocol Buffers To compile the protobuf file, run: @@ -42,10 +42,13 @@ The `abci-cli` is a simple tool for debugging ABCI servers and running some example apps. To install it: ``` -go get github.com/tendermint/abci -cd $GOPATH/src/github.com/tendermint/abci +mkdir -p $GOPATH/src/github.com/tendermint +cd $GOPATH/src/github.com/tendermint +git clone https://github.com/tendermint/tendermint.git +cd tendermint +make get_tools make get_vendor_deps -make install +make install_abci ``` ## Implementation From d27cd972d28b4018c5864bbff4065014224ae643 Mon Sep 17 00:00:00 2001 From: cong Date: Wed, 5 Sep 2018 14:00:10 +0800 Subject: [PATCH 116/149] Index tx.height (#2324) Refs #2051 --- CHANGELOG_PENDING.md | 1 + state/txindex/kv/kv.go | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 30303008..844dc869 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -40,3 +40,4 @@ IMPROVEMENTS: BUG FIXES: - [mempool] No longer possible to fill up linked list without getting caching benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) +- [state] kv store index tx.height to support search diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 70732592..363ab119 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -89,6 +89,11 @@ func (txi *TxIndex) AddBatch(b *txindex.Batch) error { } } + // index tx by height + if txi.indexAllTags || cmn.StringInSlice(types.TxHeightKey, txi.tagsToIndex) { + storeBatch.Set(keyForHeight(result), hash) + } + // index tx by hash rawBytes, err := cdc.MarshalBinaryBare(result) if err != nil { @@ -114,6 +119,11 @@ func (txi *TxIndex) Index(result *types.TxResult) error { } } + // index tx by height + if txi.indexAllTags || cmn.StringInSlice(types.TxHeightKey, txi.tagsToIndex) { + b.Set(keyForHeight(result), hash) + } + // index tx by hash rawBytes, err := cdc.MarshalBinaryBare(result) if err != nil { @@ -153,12 +163,6 @@ func (txi *TxIndex) Search(q *query.Query) ([]*types.TxResult, error) { // conditions to skip because they're handled before "everything else" skipIndexes := make([]int, 0) - // if there is a height condition ("tx.height=3"), extract it for faster lookups - height, heightIndex := lookForHeight(conditions) - if heightIndex >= 0 { - skipIndexes = append(skipIndexes, heightIndex) - } - // extract ranges // if both upper and lower bounds exist, it's better to get them in order not // no iterate over kvs that are not within range. @@ -176,6 +180,9 @@ func (txi *TxIndex) Search(q *query.Query) ([]*types.TxResult, error) { } } + // if there is a height condition ("tx.height=3"), extract it + height := lookForHeight(conditions) + // for all other conditions for i, c := range conditions { if cmn.IntInSlice(i, skipIndexes) { @@ -218,13 +225,13 @@ func lookForHash(conditions []query.Condition) (hash []byte, err error, ok bool) return } -func lookForHeight(conditions []query.Condition) (height int64, index int) { - for i, c := range conditions { +func lookForHeight(conditions []query.Condition) (height int64) { + for _, c := range conditions { if c.Tag == types.TxHeightKey { - return c.Operand.(int64), i + return c.Operand.(int64) } } - return 0, -1 + return 0 } // special map to hold range conditions @@ -421,6 +428,10 @@ func keyForTag(tag cmn.KVPair, result *types.TxResult) []byte { return []byte(fmt.Sprintf("%s/%s/%d/%d", tag.Key, tag.Value, result.Height, result.Index)) } +func keyForHeight(result *types.TxResult) []byte { + return []byte(fmt.Sprintf("%s/%d/%d/%d", types.TxHeightKey, result.Height, result.Height, result.Index)) +} + /////////////////////////////////////////////////////////////////////////////// // Utils From d0bb1ab2b084f3db774ff41ca3bd45673576d80c Mon Sep 17 00:00:00 2001 From: JamesRay <66258875@qq.com> Date: Wed, 5 Sep 2018 14:13:25 +0800 Subject: [PATCH 117/149] Filter out empty addresses in persistent_peers/seeds lists (#2323) Fixes #2320 --- CHANGELOG_PENDING.md | 1 + libs/common/string_test.go | 19 ------------------- node/node.go | 33 ++++++++++++++++++++++++++++----- node/node_test.go | 19 +++++++++++++++++++ 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 844dc869..11e5fc8d 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -23,6 +23,7 @@ BREAKING CHANGES: - [state] Implement BFT time - [p2p] update secret connection to use a little endian encoded nonce - [libs/clist] Panics if list extends beyond MaxLength +- [common] SplitAndTrim was deleted FEATURES: - [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) diff --git a/libs/common/string_test.go b/libs/common/string_test.go index 5d1b68fe..0fc677a9 100644 --- a/libs/common/string_test.go +++ b/libs/common/string_test.go @@ -31,25 +31,6 @@ func TestIsHex(t *testing.T) { } } -func TestSplitAndTrim(t *testing.T) { - testCases := []struct { - s string - sep string - cutset string - expected []string - }{ - {"a,b,c", ",", " ", []string{"a", "b", "c"}}, - {" a , b , c ", ",", " ", []string{"a", "b", "c"}}, - {" a, b, c ", ",", " ", []string{"a", "b", "c"}}, - {" , ", ",", " ", []string{"", ""}}, - {" ", ",", " ", []string{""}}, - } - - for _, tc := range testCases { - assert.Equal(t, tc.expected, SplitAndTrim(tc.s, tc.sep, tc.cutset), "%s", tc.s) - } -} - func TestIsASCIIText(t *testing.T) { notASCIIText := []string{ "", "\xC2", "\xC2\xA2", "\xFF", "\x80", "\xF0", "\n", "\t", diff --git a/node/node.go b/node/node.go index 330095f8..76f23dfd 100644 --- a/node/node.go +++ b/node/node.go @@ -40,6 +40,7 @@ import ( "github.com/tendermint/tendermint/version" _ "net/http/pprof" + "strings" ) //------------------------------------------------------------------------------ @@ -323,7 +324,7 @@ func NewNode(config *cfg.Config, // TODO persistent peers ? so we can have their DNS addrs saved pexReactor := pex.NewPEXReactor(addrBook, &pex.PEXReactorConfig{ - Seeds: cmn.SplitAndTrim(config.P2P.Seeds, ",", " "), + Seeds: splitAndTrimEmpty(config.P2P.Seeds, ",", " "), SeedMode: config.P2P.SeedMode, }) pexReactor.SetLogger(p2pLogger) @@ -375,7 +376,7 @@ func NewNode(config *cfg.Config, return nil, err } if config.TxIndex.IndexTags != "" { - txIndexer = kv.NewTxIndex(store, kv.IndexTags(cmn.SplitAndTrim(config.TxIndex.IndexTags, ",", " "))) + txIndexer = kv.NewTxIndex(store, kv.IndexTags(splitAndTrimEmpty(config.TxIndex.IndexTags, ",", " "))) } else if config.TxIndex.IndexAllTags { txIndexer = kv.NewTxIndex(store, kv.IndexAllTags()) } else { @@ -444,7 +445,7 @@ func (n *Node) OnStart() error { n.addrBook.AddOurAddress(nodeInfo.NetAddress()) // Add private IDs to addrbook to block those peers being added - n.addrBook.AddPrivateIDs(cmn.SplitAndTrim(n.config.P2P.PrivatePeerIDs, ",", " ")) + n.addrBook.AddPrivateIDs(splitAndTrimEmpty(n.config.P2P.PrivatePeerIDs, ",", " ")) // Start the RPC server before the P2P server // so we can eg. receive txs for the first block @@ -469,7 +470,7 @@ func (n *Node) OnStart() error { // Always connect to persistent peers if n.config.P2P.PersistentPeers != "" { - err = n.sw.DialPeersAsync(n.addrBook, cmn.SplitAndTrim(n.config.P2P.PersistentPeers, ",", " "), true) + err = n.sw.DialPeersAsync(n.addrBook, splitAndTrimEmpty(n.config.P2P.PersistentPeers, ",", " "), true) if err != nil { return err } @@ -551,7 +552,7 @@ func (n *Node) ConfigureRPC() { func (n *Node) startRPC() ([]net.Listener, error) { n.ConfigureRPC() - listenAddrs := cmn.SplitAndTrim(n.config.RPC.ListenAddress, ",", " ") + listenAddrs := splitAndTrimEmpty(n.config.RPC.ListenAddress, ",", " ") coreCodec := amino.NewCodec() ctypes.RegisterAmino(coreCodec) @@ -749,3 +750,25 @@ func saveGenesisDoc(db dbm.DB, genDoc *types.GenesisDoc) { } db.SetSync(genesisDocKey, bytes) } + + +// splitAndTrimEmpty slices s into all subslices separated by sep and returns a +// slice of the string s with all leading and trailing Unicode code points +// contained in cutset removed. If sep is empty, SplitAndTrim splits after each +// UTF-8 sequence. First part is equivalent to strings.SplitN with a count of +// -1. also filter out empty strings, only return non-empty strings. +func splitAndTrimEmpty(s, sep, cutset string) []string { + if s == "" { + return []string{} + } + + spl := strings.Split(s, sep) + nonEmptyStrings := make([]string, 0, len(spl)) + for i := 0; i < len(spl); i++ { + element := strings.Trim(spl[i], cutset) + if element != "" { + nonEmptyStrings = append(nonEmptyStrings, element) + } + } + return nonEmptyStrings +} diff --git a/node/node_test.go b/node/node_test.go index ca074e1b..d4e35f73 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -56,3 +56,22 @@ func TestNodeStartStop(t *testing.T) { t.Fatal("timed out waiting for shutdown") } } + +func TestSplitAndTrimEmpty(t *testing.T) { + testCases := []struct { + s string + sep string + cutset string + expected []string + }{ + {"a,b,c", ",", " ", []string{"a", "b", "c"}}, + {" a , b , c ", ",", " ", []string{"a", "b", "c"}}, + {" a, b, c ", ",", " ", []string{"a", "b", "c"}}, + {" a, ", ",", " ", []string{"a"}}, + {" ", ",", " ", []string{}}, + } + + for _, tc := range testCases { + assert.Equal(t, tc.expected, splitAndTrimEmpty(tc.s, tc.sep, tc.cutset), "%s", tc.s) + } +} From 92185c017cf93769bc9750a91fc156862faa81c1 Mon Sep 17 00:00:00 2001 From: Zach Date: Wed, 5 Sep 2018 02:30:36 -0400 Subject: [PATCH 118/149] Several minor docs & spec cleanup (#2330) * addr_book_strick=false on local nets * link to spec * spec: remove TODO, see #1749 instead * spec: make issues from TODOs * update docs on addr_book_strict option --- config/config.go | 1 + config/toml.go | 1 + docs/spec/README.md | 2 +- docs/spec/blockchain/blockchain.md | 2 +- docs/spec/blockchain/encoding.md | 2 +- docs/spec/blockchain/state.md | 4 ++-- docs/spec/reactors/block_sync/impl.md | 5 ----- docs/tendermint-core/configuration.md | 1 + docs/tendermint-core/running-in-production.md | 4 ++-- docs/tendermint-core/secure-p2p.md | 4 ++++ 10 files changed, 14 insertions(+), 12 deletions(-) diff --git a/config/config.go b/config/config.go index de225140..facb415f 100644 --- a/config/config.go +++ b/config/config.go @@ -293,6 +293,7 @@ type P2PConfig struct { AddrBook string `mapstructure:"addr_book_file"` // Set true for strict address routability rules + // Set false for private or local networks AddrBookStrict bool `mapstructure:"addr_book_strict"` // Maximum number of inbound peers diff --git a/config/toml.go b/config/toml.go index 255fa2b5..184ce87b 100644 --- a/config/toml.go +++ b/config/toml.go @@ -165,6 +165,7 @@ upnp = {{ .P2P.UPNP }} addr_book_file = "{{ js .P2P.AddrBook }}" # Set true for strict address routability rules +# Set false for private or local networks addr_book_strict = {{ .P2P.AddrBookStrict }} # Time to wait before flushing messages out on the connection, in ms diff --git a/docs/spec/README.md b/docs/spec/README.md index 82ed9717..4de5104f 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -31,7 +31,7 @@ please submit them to our [bug bounty](https://tendermint.com/security)! - [Block Sync](https://github.com/tendermint/tendermint/tree/master/docs/spec/reactors/block_sync): gossip blocks so peers can catch up quickly - [Consensus](https://github.com/tendermint/tendermint/tree/master/docs/spec/reactors/consensus): gossip votes and block parts so new blocks can be committed - [Mempool](https://github.com/tendermint/tendermint/tree/master/docs/spec/reactors/mempool): gossip transactions so they get included in blocks -- Evidence: TODO +- Evidence: Forthcoming, see [this issue](https://github.com/tendermint/tendermint/issues/2329). ### Software diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index e1e0c3fe..ec1ab48c 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -147,7 +147,7 @@ where `Signature` is the DER encoded signature, ie: ## Evidence -TODO +Forthcoming, see [this issue](https://github.com/tendermint/tendermint/issues/2329) ## Validation diff --git a/docs/spec/blockchain/encoding.md b/docs/spec/blockchain/encoding.md index a0acad39..3ed06260 100644 --- a/docs/spec/blockchain/encoding.md +++ b/docs/spec/blockchain/encoding.md @@ -275,7 +275,7 @@ Because Tendermint only uses a Simple Merkle Tree, application developers are ex ### Amino -TODO: improve this +This section is pending an update, see [this issue](https://github.com/tendermint/tendermint/issues/1749). Amino also supports JSON encoding - registered types are simply encoded as: diff --git a/docs/spec/blockchain/state.md b/docs/spec/blockchain/state.md index 726015ea..92df20f3 100644 --- a/docs/spec/blockchain/state.md +++ b/docs/spec/blockchain/state.md @@ -11,7 +11,7 @@ included in a block or gossipped over the network, and we never compute its hash. However, the types it contains are part of the specification, since their Merkle roots are included in blocks. -For details on an implementation of `State` with persistence, see TODO +Details on an implementation of `State` with persistence is forthcoming, see [this issue](https://github.com/tendermint/tendermint/issues/1152) ```go type State struct { @@ -77,4 +77,4 @@ func TotalVotingPower(vals []Validators) int64{ ### ConsensusParams -TODO +This section is forthcoming. See [this issue](https://github.com/tendermint/tendermint/issues/1152). diff --git a/docs/spec/reactors/block_sync/impl.md b/docs/spec/reactors/block_sync/impl.md index ff067b84..195f9b86 100644 --- a/docs/spec/reactors/block_sync/impl.md +++ b/docs/spec/reactors/block_sync/impl.md @@ -39,8 +39,3 @@ ## Block Store - persists blocks to disk - -# TODO - -- How does the switch from bcR to conR happen? Does conR persist blocks to disk too? -- What is the interaction between the consensus and blockchain reactors? diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 099b9dbd..13ea76da 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -112,6 +112,7 @@ upnp = false addr_book_file = "addrbook.json" # Set true for strict address routability rules +# Set false for private or local networks addr_book_strict = true # Time to wait before flushing messages out on the connection, in ms diff --git a/docs/tendermint-core/running-in-production.md b/docs/tendermint-core/running-in-production.md index 76465b8e..cb228be4 100644 --- a/docs/tendermint-core/running-in-production.md +++ b/docs/tendermint-core/running-in-production.md @@ -270,9 +270,9 @@ saving it to the address book. The address is considered as routable if the IP is [valid and within allowed ranges](https://github.com/tendermint/tendermint/blob/27bd1deabe4ba6a2d9b463b8f3e3f1e31b993e61/p2p/netaddress.go#L209). -This may not be the case for private networks, where your IP range is usually +This may not be the case for private or local networks, where your IP range is usually strictly limited and private. If that case, you need to set `addr_book_strict` -to `false` (turn off). +to `false` (turn it off). - `rpc.max_open_connections` diff --git a/docs/tendermint-core/secure-p2p.md b/docs/tendermint-core/secure-p2p.md index 1d90e058..01d2f22b 100644 --- a/docs/tendermint-core/secure-p2p.md +++ b/docs/tendermint-core/secure-p2p.md @@ -59,6 +59,10 @@ are connected to at least one validator. Authenticated encryption is enabled by default. +## Specification + +The full p2p specification can be found [here](https://github.com/tendermint/tendermint/tree/master/docs/spec/p2p). + ## Additional Reading - [Implementation](https://github.com/tendermint/tendermint/blob/64bae01d007b5bee0d0827ab53259ffd5910b4e6/p2p/conn/secret_connection.go#L47) From cb91cd5965fd318e1b3adaf03cfd7bdfb08d38b6 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 5 Sep 2018 11:05:06 +0400 Subject: [PATCH 119/149] [docs] one can also index txs by height now --- config/config.go | 17 +++++++++++------ config/toml.go | 13 +++++++++---- docs/app-dev/indexing-transactions.md | 14 +++++++++----- docs/tendermint-core/configuration.md | 13 +++++++++---- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/config/config.go b/config/config.go index facb415f..ef53c21c 100644 --- a/config/config.go +++ b/config/config.go @@ -575,8 +575,8 @@ func (cfg *ConsensusConfig) SetWalFile(walFile string) { //----------------------------------------------------------------------------- // TxIndexConfig -// TxIndexConfig defines the configuration for the transaction -// indexer, including tags to index. +// TxIndexConfig defines the configuration for the transaction indexer, +// including tags to index. type TxIndexConfig struct { // What indexer to use for transactions // @@ -585,16 +585,21 @@ type TxIndexConfig struct { // 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). Indexer string `mapstructure:"indexer"` - // Comma-separated list of tags to index (by default the only tag is tx hash) + // Comma-separated list of tags to index (by default the only tag is "tx.hash") // + // You can also index transactions by height by adding "tx.height" tag here. + // // It's recommended to index only a subset of tags due to possible memory // bloat. This is, of course, depends on the indexer's DB and the volume of // transactions. IndexTags string `mapstructure:"index_tags"` - // When set to true, tells indexer to index all tags. Note this may be not - // desirable (see the comment above). IndexTags has a precedence over - // IndexAllTags (i.e. when given both, IndexTags will be indexed). + // When set to true, tells indexer to index all tags (predefined tags: + // "tx.hash", "tx.height" and all tags from DeliverTx responses). + // + // Note this may be not desirable (see the comment above). IndexTags has a + // precedence over IndexAllTags (i.e. when given both, IndexTags will be + // indexed). IndexAllTags bool `mapstructure:"index_all_tags"` } diff --git a/config/toml.go b/config/toml.go index 184ce87b..3f85eaad 100644 --- a/config/toml.go +++ b/config/toml.go @@ -247,16 +247,21 @@ peer_query_maj23_sleep_duration = {{ .Consensus.PeerQueryMaj23SleepDuration }} # 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "{{ .TxIndex.Indexer }}" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") +# +# You can also index transactions by height by adding "tx.height" tag here. # # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "{{ .TxIndex.IndexTags }}" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = {{ .TxIndex.IndexAllTags }} ##### instrumentation configuration options ##### diff --git a/docs/app-dev/indexing-transactions.md b/docs/app-dev/indexing-transactions.md index 3bca1095..3ba097c4 100644 --- a/docs/app-dev/indexing-transactions.md +++ b/docs/app-dev/indexing-transactions.md @@ -16,16 +16,21 @@ Let's take a look at the `[tx_index]` config section: # 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "kv" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") +# +# You can also index transactions by height by adding "tx.height" tag here. # # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = false ``` @@ -59,7 +64,6 @@ all tags, set `index_all_tags=true` Note, there are a few predefined tags: -- `tm.event` (event type) - `tx.hash` (transaction's hash) - `tx.height` (height of the block transaction was committed in) diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 13ea76da..7e20277f 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -194,16 +194,21 @@ peer_query_maj23_sleep_duration = 2000 # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "kv" -# Comma-separated list of tags to index (by default the only tag is tx hash) +# Comma-separated list of tags to index (by default the only tag is "tx.hash") # +# You can also index transactions by height by adding "tx.height" tag here. +# # It's recommended to index only a subset of tags due to possible memory # bloat. This is, of course, depends on the indexer's DB and the volume of # transactions. index_tags = "" -# When set to true, tells indexer to index all tags. Note this may be not -# desirable (see the comment above). IndexTags has a precedence over -# IndexAllTags (i.e. when given both, IndexTags will be indexed). +# When set to true, tells indexer to index all tags (predefined tags: +# "tx.hash", "tx.height" and all tags from DeliverTx responses). +# +# Note this may be not desirable (see the comment above). IndexTags has a +# precedence over IndexAllTags (i.e. when given both, IndexTags will be +# indexed). index_all_tags = false ##### instrumentation configuration options ##### From 098681fd9109a50f8ec9035ae8cdb6b8d7a5049b Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 5 Sep 2018 12:01:38 +0400 Subject: [PATCH 120/149] test searching txs by height Refs #2051 --- rpc/client/rpc_test.go | 5 +++++ rpc/test/helpers.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 3eabaa97..767ae684 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -351,6 +351,11 @@ func TestTxSearch(t *testing.T) { assert.True(t, proof.Proof.Verify(proof.Index, proof.Total, txHash, proof.RootHash)) } + // query by height + result, err = c.TxSearch(fmt.Sprintf("tx.height >= %d", txHeight), true, 1, 30) + require.Nil(t, err, "%+v", err) + require.Len(t, result.Txs, 1) + // we query for non existing tx result, err = c.TxSearch(fmt.Sprintf("tx.hash='%X'", anotherTxHash), false, 1, 30) require.Nil(t, err, "%+v", err) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index b0dd77ec..0a9cd984 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -85,7 +85,7 @@ func GetConfig() *cfg.Config { globalConfig.P2P.ListenAddress = tm globalConfig.RPC.ListenAddress = rpc globalConfig.RPC.GRPCListenAddress = grpc - globalConfig.TxIndex.IndexTags = "app.creator" // see kvstore application + globalConfig.TxIndex.IndexTags = "app.creator,tx.height" // see kvstore application } return globalConfig } From 9db66deaa22eb84e8a2e4cc0fdb84256f9a171be Mon Sep 17 00:00:00 2001 From: Zach Date: Wed, 5 Sep 2018 05:25:15 -0400 Subject: [PATCH 121/149] test make localnet in CI (#2281) * tests: use make localnet based on @jackzampolin work in: https://github.com/cosmos/cosmos-sdk/pull/2067 * keep the p2p tests for now * fixes after my own review * nohup * remove nohup --- .circleci/config.yml | 25 ++++++++++++++++++++ scripts/localnet-blocks-test.sh | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100755 scripts/localnet-blocks-test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index e1751907..9d284be6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -268,6 +268,28 @@ jobs: name: Run tests command: bash test/persist/test_failure_indices.sh + localnet: + working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint + machine: + image: circleci/classic:latest + environment: + GOBIN: /home/circleci/.go_workspace/bin + GOPATH: /home/circleci/.go_workspace/ + GOOS: linux + GOARCH: amd64 + parallelism: 1 + steps: + - checkout + - run: + name: run localnet and exit on failure + command: | + set -x + make get_tools + make get_vendor_deps + make build-linux + make localnet-start & + ./scripts/localnet-blocks-test.sh 40 5 10 localhost + test_p2p: environment: GOBIN: /home/circleci/.go_workspace/bin @@ -337,6 +359,9 @@ workflows: - test_persistence: requires: - setup_dependencies + - localnet: + requires: + - setup_dependencies - test_p2p - upload_coverage: requires: diff --git a/scripts/localnet-blocks-test.sh b/scripts/localnet-blocks-test.sh new file mode 100755 index 00000000..a33ab00f --- /dev/null +++ b/scripts/localnet-blocks-test.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +ITERATIONS=$1 +SLEEP=$2 +NUMBLOCKS=$3 +NODEADDR=$4 + +if [ -z "$1" ]; then + echo "Need to input number of iterations to run..." + exit 1 +fi + +if [ -z "$2" ]; then + echo "Need to input number of seconds to sleep between iterations" + exit 1 +fi + +if [ -z "$3" ]; then + echo "Need to input block height to declare completion..." + exit 1 +fi + +if [ -z "$4" ]; then + echo "Need to input node address to poll..." + exit 1 +fi + +I=0 +while [ ${I} -lt "$ITERATIONS" ]; do + var=$(curl -s "$NODEADDR:26657/status" | jq -r ".result.sync_info.latest_block_height") + echo "Number of Blocks: ${var}" + if [ ! -z "${var}" ] && [ "${var}" -gt "${NUMBLOCKS}" ]; then + echo "Number of blocks reached, exiting success..." + exit 0 + fi + I=$((I+1)) + sleep "$SLEEP" +done + +echo "Timeout reached, exiting failure..." +exit 1 From eb5cf0f0dd054517a029dc41ee73934de388fef5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 5 Sep 2018 19:52:22 +0400 Subject: [PATCH 122/149] ignore existing peers in DialPeersAsync (#2327) * ignore existing peers in DialPeersAsync Fixes #2253 * rename HasPeerWithAddress to IsDialingOrExistingAddress [breaking] remove Switch#IsDialing * check if addrBook is nil to be consistent with other usages of addrBook across Switch * different log messages for 2 use-cases --- CHANGELOG_PENDING.md | 3 ++- p2p/pex/pex_reactor.go | 5 +---- p2p/switch.go | 26 +++++++++++++++++--------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 11e5fc8d..08461ba2 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -20,7 +20,7 @@ BREAKING CHANGES: - Remove PubKey from `Validator` and introduce `ValidatorUpdate` - InitChain and EndBlock use ValidatorUpdate - Update field names and types in BeginBlock -- [state] Implement BFT time +- [state] Implement BFT time - [p2p] update secret connection to use a little endian encoded nonce - [libs/clist] Panics if list extends beyond MaxLength - [common] SplitAndTrim was deleted @@ -42,3 +42,4 @@ BUG FIXES: - [mempool] No longer possible to fill up linked list without getting caching benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) - [state] kv store index tx.height to support search +- [rpc] /dial_peers does not try to dial existing peers diff --git a/p2p/pex/pex_reactor.go b/p2p/pex/pex_reactor.go index b3c50a18..c919794a 100644 --- a/p2p/pex/pex_reactor.go +++ b/p2p/pex/pex_reactor.go @@ -392,10 +392,7 @@ func (r *PEXReactor) ensurePeers() { if _, selected := toDial[try.ID]; selected { continue } - if dialling := r.Switch.IsDialing(try.ID); dialling { - continue - } - if connected := r.Switch.Peers().Has(try.ID); connected { + if r.Switch.IsDialingOrExistingAddress(try) { continue } // TODO: consider moving some checks from toDial into here diff --git a/p2p/switch.go b/p2p/switch.go index b26e1147..b5413dab 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -376,11 +376,6 @@ func (sw *Switch) MarkPeerAsGood(peer Peer) { //--------------------------------------------------------------------- // Dialing -// IsDialing returns true if the switch is currently dialing the given ID. -func (sw *Switch) IsDialing(id ID) bool { - return sw.dialing.Has(string(id)) -} - // DialPeersAsync dials a list of peers asynchronously in random order (optionally, making them persistent). // Used to dial peers from config on startup or from unsafe-RPC (trusted sources). // TODO: remove addrBook arg since it's now set on the switch @@ -417,10 +412,13 @@ func (sw *Switch) DialPeersAsync(addrBook AddrBook, peers []string, persistent b for i := 0; i < len(perm); i++ { go func(i int) { j := perm[i] - addr := netAddrs[j] - // do not dial ourselves + if addr.Same(ourAddr) { + sw.Logger.Debug("Ignore attempt to connect to ourselves", "addr", addr, "ourAddr", ourAddr) + return + } else if sw.IsDialingOrExistingAddress(addr) { + sw.Logger.Debug("Ignore attempt to connect to an existing peer", "addr", addr) return } @@ -453,6 +451,14 @@ func (sw *Switch) randomSleep(interval time.Duration) { time.Sleep(r + interval) } +// IsDialingOrExistingAddress returns true if switch has a peer with the given +// address or dialing it at the moment. +func (sw *Switch) IsDialingOrExistingAddress(addr *NetAddress) bool { + return sw.dialing.Has(string(addr.ID)) || + sw.peers.Has(addr.ID) || + (!sw.config.AllowDuplicateIP && sw.peers.HasIP(addr.IP)) +} + //------------------------------------------------------------------------------------ // Connection filtering @@ -607,8 +613,10 @@ func (sw *Switch) addPeer(pc peerConn) error { addr := peerNodeInfo.NetAddress() // remove the given address from the address book // and add to our addresses to avoid dialing again - sw.addrBook.RemoveAddress(addr) - sw.addrBook.AddOurAddress(addr) + if sw.addrBook != nil { + sw.addrBook.RemoveAddress(addr) + sw.addrBook.AddOurAddress(addr) + } return ErrSwitchConnectToSelf{addr} } From 7f6bd5c16127703c061db78c1db0f3aa3cbb842c Mon Sep 17 00:00:00 2001 From: Zach Date: Wed, 5 Sep 2018 12:21:04 -0400 Subject: [PATCH 123/149] docs & spec: deduplicate block-structure.md (#2331) --- docs/spec/blockchain/blockchain.md | 62 +++++--- docs/spec/consensus/consensus.md | 2 +- docs/tendermint-core/block-structure.md | 198 +----------------------- types/block.go | 1 + 4 files changed, 43 insertions(+), 220 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index ec1ab48c..73f4f35a 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -27,6 +27,13 @@ type Block struct { } ``` +The signatures returned along with block `X` are those validating block +`X-1`. This can be a little confusing, but consider that +the `Header` also contains the `LastCommitHash`. It would be impossible +for a Header to include the commits that sign it, as it would cause an +infinite loop here. But when we get block `X`, we find +`Header.LastCommitHash`, which must match the hash of `LastCommit`. + ## Header A block header contains metadata about the block and about the consensus, as well as commitments to @@ -34,32 +41,30 @@ the data in the current block, the previous block, and the results returned by t ```go type Header struct { - // block metadata - Version string // Version string - ChainID string // ID of the chain - Height int64 // Current block height - Time int64 // UNIX time, in millisconds + // basic block info + ChainID string `json:"chain_id"` + Height int64 `json:"height"` + Time time.Time `json:"time"` + NumTxs int64 `json:"num_txs"` + TotalTxs int64 `json:"total_txs"` - // current block - NumTxs int64 // Number of txs in this block - TxHash []byte // SimpleMerkle of the block.Txs - LastCommitHash []byte // SimpleMerkle of the block.LastCommit + // prev block info + LastBlockID BlockID `json:"last_block_id"` - // previous block - TotalTxs int64 // prevBlock.TotalTxs + block.NumTxs - LastBlockID BlockID // BlockID of prevBlock + // hashes of block data + LastCommitHash cmn.HexBytes `json:"last_commit_hash"` // commit from validators from the last block + DataHash cmn.HexBytes `json:"data_hash"` // transactions - // application - ResultsHash []byte // SimpleMerkle of []abci.Result from prevBlock - AppHash []byte // Arbitrary state digest - ValidatorsHash []byte // SimpleMerkle of the current ValidatorSet - NextValidatorsHash []byte // SimpleMerkle of the next ValidatorSet - ConsensusParamsHash []byte // SimpleMerkle of the ConsensusParams + // hashes from the app output from the prev block + ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block + NextValidatorsHash cmn.HexBytes `json:"next_validators_hash"` // validators for the next block + ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block + AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block + LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block - // consensus - EvidenceHash []byte // SimpleMerkle of []Evidence - ProposerAddress []byte // Address of the original proposer of the block -} + // consensus info + EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block + ProposerAddress Address `json:"proposer_address"` // original proposer of the block ``` Further details on each of these fields is described below. @@ -224,6 +229,17 @@ These are the votes that committed the previous block. The first block has `block.Header.LastCommitHash == []byte{}` +### DataHash + +The `DataHash` can provide a nice check on the +[Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) +returned in this same block. If you are subscribed to new blocks, via +tendermint RPC, in order to display or process the new transactions you +should at least validate that the `DataHash` is valid. If it is +important to verify autheniticity, you must wait for the `LastCommit` +from the next block to make sure the block header (including `DataHash`) +was properly signed. + ### TotalTxs ```go @@ -270,7 +286,7 @@ The first block has `block.Header.ResultsHash == []byte{}`. block.AppHash == state.AppHash ``` -Arbitrary byte array returned by the application after executing and commiting the previous block. +Arbitrary byte array returned by the application after executing and commiting the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. The first block has `block.Header.AppHash == []byte{}`. diff --git a/docs/spec/consensus/consensus.md b/docs/spec/consensus/consensus.md index 842c73a6..c77c09d2 100644 --- a/docs/spec/consensus/consensus.md +++ b/docs/spec/consensus/consensus.md @@ -17,7 +17,7 @@ vote](https://godoc.org/github.com/tendermint/tendermint/types#FirstPrecommit) for something. - A vote _at_ `(H,R)` is a vote signed with the bytes for `H` and `R` - included in its [sign-bytes](block-structure.html#vote-sign-bytes). + included in its [sign-bytes](../blockchain/blockchain.md). - _+2/3_ is short for "more than 2/3" - _1/3+_ is short for "1/3 or more" - A set of +2/3 of prevotes for a particular block or `` at diff --git a/docs/tendermint-core/block-structure.md b/docs/tendermint-core/block-structure.md index f58e83aa..587db0ff 100644 --- a/docs/tendermint-core/block-structure.md +++ b/docs/tendermint-core/block-structure.md @@ -7,200 +7,6 @@ nodes. This blockchain is accessible via various rpc endpoints, mainly `/blockchain?minHeight=_&maxHeight=_` to get a list of headers. But what exactly is stored in these blocks? -## Block +The [specification](../spec/blockchain/blockchain.md) contains a detailed description of each component - that's the best place to get started. -A -[Block](https://godoc.org/github.com/tendermint/tendermint/types#Block) -contains: - -- a [Header](#header) contains merkle hashes for various chain states -- the - [Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) - is all transactions which are to be processed -- the [LastCommit](#commit) > 2/3 signatures for the last block - -The signatures returned along with block `H` are those validating block -`H-1`. This can be a little confusing, but we must also consider that -the `Header` also contains the `LastCommitHash`. It would be impossible -for a Header to include the commits that sign it, as it would cause an -infinite loop here. But when we get block `H`, we find -`Header.LastCommitHash`, which must match the hash of `LastCommit`. - -## Header - -The -[Header](https://godoc.org/github.com/tendermint/tendermint/types#Header) -contains lots of information (follow link for up-to-date info). Notably, -it maintains the `Height`, the `LastBlockID` (to make it a chain), and -hashes of the data, the app state, and the validator set. This is -important as the only item that is signed by the validators is the -`Header`, and all other data must be validated against one of the merkle -hashes in the `Header`. - -The `DataHash` can provide a nice check on the -[Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) -returned in this same block. If you are subscribed to new blocks, via -tendermint RPC, in order to display or process the new transactions you -should at least validate that the `DataHash` is valid. If it is -important to verify autheniticity, you must wait for the `LastCommit` -from the next block to make sure the block header (including `DataHash`) -was properly signed. - -The `ValidatorHash` contains a hash of the current -[Validators](https://godoc.org/github.com/tendermint/tendermint/types#Validator). -Tracking all changes in the validator set is complex, but a client can -quickly compare this hash with the [hash of the currently known -validators](https://godoc.org/github.com/tendermint/tendermint/types#ValidatorSet.Hash) -to see if there have been changes. - -The `AppHash` serves as the basis for validating any merkle proofs that -come from the ABCI application. It represents the state of the actual -application, rather that the state of the blockchain itself. This means -it's necessary in order to perform any business logic, such as verifying -an account balance. - -**Note** After the transactions are committed to a block, they still -need to be processed in a separate step, which happens between the -blocks. If you find a given transaction in the block at height `H`, the -effects of running that transaction will be first visible in the -`AppHash` from the block header at height `H+1`. - -Like the `LastCommit` issue, this is a requirement of the immutability -of the block chain, as the application only applies transactions _after_ -they are commited to the chain. - -## Commit - -The -[Commit](https://godoc.org/github.com/tendermint/tendermint/types#Commit) -contains a set of -[Votes](https://godoc.org/github.com/tendermint/tendermint/types#Vote) -that were made by the validator set to reach consensus on this block. -This is the key to the security in any PoS system, and actually no data -that cannot be traced back to a block header with a valid set of Votes -can be trusted. Thus, getting the Commit data and verifying the votes is -extremely important. - -As mentioned above, in order to find the `precommit votes` for block -header `H`, we need to query block `H+1`. Then we need to check the -votes, make sure they really are for that block, and properly formatted. -Much of this code is implemented in Go in the -[light-client](https://github.com/tendermint/light-client) package. If -you look at the code, you will notice that we need to provide the -`chainID` of the blockchain in order to properly calculate the votes. -This is to protect anyone from swapping votes between chains to fake (or -frame) a validator. Also note that this `chainID` is in the -`genesis.json` from _Tendermint_, not the `genesis.json` from the -basecoin app ([that is a different -chainID...](https://github.com/cosmos/cosmos-sdk/issues/32)). - -Once we have those votes, and we calculated the proper [sign -bytes](https://godoc.org/github.com/tendermint/tendermint/types#Vote.WriteSignBytes) -using the chainID and a [nice helper -function](https://godoc.org/github.com/tendermint/tendermint/types#SignBytes), -we can verify them. The light client is responsible for maintaining a -set of validators that we trust. Each vote only stores the validators -`Address`, as well as the `Signature`. Assuming we have a local copy of -the trusted validator set, we can look up the `Public Key` of the -validator given its `Address`, then verify that the `Signature` matches -the `SignBytes` and `Public Key`. Then we sum up the total voting power -of all validators, whose votes fulfilled all these stringent -requirements. If the total number of voting power for a single block is -greater than 2/3 of all voting power, then we can finally trust the -block header, the AppHash, and the proof we got from the ABCI -application. - -### Vote Sign Bytes - -The `sign-bytes` of a vote is produced by taking a -[stable-json](https://github.com/substack/json-stable-stringify)-like -deterministic JSON [wire](./wire-protocol.html) encoding of the vote -(excluding the `Signature` field), and wrapping it with -`{"chain_id":"my_chain","vote":...}`. - -For example, a precommit vote might have the following `sign-bytes`: - -``` -{"chain_id":"my_chain","vote":{"block_hash":"611801F57B4CE378DF1A3FFF1216656E89209A99","block_parts_header":{"hash":"B46697379DBE0774CC2C3B656083F07CA7E0F9CE","total":123},"height":1234,"round":1,"type":2}} -``` - -## Block Hash - -The [block -hash](https://godoc.org/github.com/tendermint/tendermint/types#Block.Hash) -is the [Simple Tree hash](./merkle.html#simple-tree-with-dictionaries) -of the fields of the block `Header` encoded as a list of `KVPair`s. - -## Transaction - -A transaction is any sequence of bytes. It is up to your ABCI -application to accept or reject transactions. - -## BlockID - -Many of these data structures refer to the -[BlockID](https://godoc.org/github.com/tendermint/tendermint/types#BlockID), -which is the `BlockHash` (hash of the block header, also referred to by -the next block) along with the `PartSetHeader`. The `PartSetHeader` is -explained below and is used internally to orchestrate the p2p -propogation. For clients, it is basically opaque bytes, but they must -match for all votes. - -## PartSetHeader - -The -[PartSetHeader](https://godoc.org/github.com/tendermint/tendermint/types#PartSetHeader) -contains the total number of pieces in a -[PartSet](https://godoc.org/github.com/tendermint/tendermint/types#PartSet), -and the Merkle root hash of those pieces. - -## PartSet - -PartSet is used to split a byteslice of data into parts (pieces) for -transmission. By splitting data into smaller parts and computing a -Merkle root hash on the list, you can verify that a part is legitimately -part of the complete data, and the part can be forwarded to other peers -before all the parts are known. In short, it's a fast way to securely -propagate a large chunk of data (like a block) over a gossip network. - -PartSet was inspired by the LibSwift project. - -Usage: - -``` -data := RandBytes(2 << 20) // Something large - -partSet := NewPartSetFromData(data) -partSet.Total() // Total number of 4KB parts -partSet.Count() // Equal to the Total, since we already have all the parts -partSet.Hash() // The Merkle root hash -partSet.BitArray() // A BitArray of partSet.Total() 1's - -header := partSet.Header() // Send this to the peer -header.Total // Total number of parts -header.Hash // The merkle root hash - -// Now we'll reconstruct the data from the parts -partSet2 := NewPartSetFromHeader(header) -partSet2.Total() // Same total as partSet.Total() -partSet2.Count() // Zero, since this PartSet doesn't have any parts yet. -partSet2.Hash() // Same hash as in partSet.Hash() -partSet2.BitArray() // A BitArray of partSet.Total() 0's - -// In a gossip network the parts would arrive in arbitrary order, perhaps -// in response to explicit requests for parts, or optimistically in response -// to the receiving peer's partSet.BitArray(). -for !partSet2.IsComplete() { - part := receivePartFromGossipNetwork() - added, err := partSet2.AddPart(part) - if err != nil { - // A wrong part, - // the merkle trail does not hash to partSet2.Hash() - } else if !added { - // A duplicate part already received - } -} - -data2, _ := ioutil.ReadAll(partSet2.GetReader()) -bytes.Equal(data, data2) // true -``` +To dig deeper, check out the [types package documentation](https://godoc.org/github.com/tendermint/tendermint/types). diff --git a/types/block.go b/types/block.go index f705c7db..d0a1a826 100644 --- a/types/block.go +++ b/types/block.go @@ -207,6 +207,7 @@ func (b *Block) StringShort() string { // Header defines the structure of a Tendermint block header // TODO: limit header size // NOTE: changes to the Header should be duplicated in the abci Header +// and in /docs/spec/blockchain/blockchain.md type Header struct { // basic block info ChainID string `json:"chain_id"` From 892b170818cd3be4cd3f919d72dde1ad60c28bbb Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:02:45 -0400 Subject: [PATCH 124/149] Bucky/changelog (#2339) * update changelog pending * fixes from review --- CHANGELOG_PENDING.md | 90 +++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 08461ba2..de91f52e 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,45 +1,73 @@ # Pending BREAKING CHANGES: -- [types] Header ... -- [state] Add NextValidatorSet, changes on-disk representation of state -- [state] Validator set changes are delayed by one block (!) -- [lite] Complete refactor of the package -- [rpc] `/commit` returns a `signed_header` field instead of everything being - top-level -- [abci] Added address of the original proposer of the block to Header. -- [abci] Change ABCI Header to match Tendermint exactly -- [libs] Remove cmn.Fmt, in favor of fmt.Sprintf -- [blockchain] fix go-amino routes for blockchain messages -- [crypto] Rename AminoRoute variables to no longer be prefixed by signature type. -- [config] Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers -- [node] NewNode now accepts a `*p2p.NodeKey` -- [crypto] Secp256k1 signature format changed from DER to `r || s`, both little endian encoded as 32 bytes. -- [crypto] Secp256k1 signature malleability removed by requiring s to be in canonical form. (See ADR 14) -- [abci] \#2159 Update use of `Validator` ala ADR-018: - - Remove PubKey from `Validator` and introduce `ValidatorUpdate` + +* CLI/RPC/Config + - [config] \#2169 Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers + - [config] \#2300 Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. + - [rpc] \#1815 `/commit` returns a `signed_header` field instead of everything being top-level + +* Apps + - [abci] Added address of the original proposer of the block to Header + - [abci] Change ABCI Header to match Tendermint exactly + - [abci] \#2159 Update use of `Validator` (see + [ADR-018](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-018-ABCI-Validators.md)): + - Remove PubKey from `Validator` (so it's just Address and Power) + - Introduce `ValidatorUpdate` (with just PubKey and Power) - InitChain and EndBlock use ValidatorUpdate - Update field names and types in BeginBlock -- [state] Implement BFT time -- [p2p] update secret connection to use a little endian encoded nonce -- [libs/clist] Panics if list extends beyond MaxLength -- [common] SplitAndTrim was deleted + - [state] \#1815 Validator set changes are now delayed by one block + - updates returned in ResponseEndBlock for block H will be included in RequestBeginBlock for block H+2 + +* Go API + - [lite] \#1815 Complete refactor of the package + - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` + - [libs/common] \#2199 Remove Fmt, in favor of fmt.Sprintf + - [libs/common] SplitAndTrim was deleted + - [libs/clist] Panics if list extends beyond MaxLength + - [crypto] \#2205 Rename AminoRoute variables to no longer be prefixed by signature type. + +* Blockchain Protocol + - [state] \#1815 Validator set changes are now delayed by one block (!) + - Add NextValidatorSet to State, changes on-disk representation of state + - [state] \#2184 Enforce ConsensusParams.BlockSize.MaxBytes (See + [ADR-020](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-020-block-size.md)). + - Remove ConsensusParams.BlockSize.MaxTxs + - Introduce maximum sizes for all components of a block, including ChainID + - [types] Updates to the block Header: + - \#1815 NextValidatorsHash - hash of the validator set for the next block, + so the current validators actually sign over the hash for the new + validators + - \#2106 ProposerAddress - address of the block's original proposer + - [consensus] \#2203 Implement BFT time + - Timestamp in block must be monotonic and equal the median of timestamps in block's LastCommit + - [crypto] \#2239 Secp256k1 signature changes (See + [ADR-014](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-014-secp-malleability.md)): + - format changed from DER to `r || s`, both little endian encoded as 32 bytes. + - malleability removed by requiring `s` to be in canonical form. + +* P2P Protocol + - [p2p] \#2263 Update secret connection to use a little endian encoded nonce + - [blockchain] \#2213 Fix Amino routes for blockchain reactor messages + FEATURES: -- [types] allow genesis file to have 0 validators ([#2015](https://github.com/tendermint/tendermint/issues/2015)) -- [libs] allow passing options through when creating instances of leveldb dbs ([#2292](https://github.com/tendermint/tendermint/issues/2292)) +- [types] \#2015 Allow genesis file to have 0 validators + - Initial validator set can be determined by the app in ResponseInitChain +- [rpc] \#2161 New event `ValidatorSetUpdates` for when the validator set changes +- [crypto/multisig] \#2164 Introduce multisig pubkey and signature format +- [libs/db] \#2293 Allow passing options through when creating instances of leveldb dbs IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. - [scripts] Added json2wal tool, which is supposed to help our users restore corrupted WAL files and compose test WAL files (@bradyjoestar) -- [mempool] Now stores txs by hash inside of the cache, to mitigate memory leakage -- [config] Replace db_path with db_dir from automatically generated configuration files. - Issue reported to Cosmos SDK ([#1712](https://github.com/cosmos/cosmos-sdk/issues/1712)) -- [config] Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. +- [mempool] \#2234 Now stores txs by hash inside of the cache, to mitigate memory leakage BUG FIXES: -- [mempool] No longer possible to fill up linked list without getting caching - benefits [#2180](https://github.com/tendermint/tendermint/issues/2180) -- [state] kv store index tx.height to support search -- [rpc] /dial_peers does not try to dial existing peers +- [config] \#2284 Replace `db_path` with `db_dir` from automatically generated configuration files. +- [mempool] \#2188 Fix OOM issue from cache map and list getting out of sync +- [state] \#2051 KV store index supports searching by `tx.height` +- [rpc] \#2327 `/dial_peers` does not try to dial existing peers +- [node] \#2323 Filter empty strings from config lists +- [abci/client] \#2236 Fix closing GRPC connection From c9510d0f50e455acf8e438a6b72cf9d6c7effc0d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:26:12 -0400 Subject: [PATCH 125/149] name drop external contribs in changelog --- CHANGELOG_PENDING.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index de91f52e..2d591275 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,5 +1,8 @@ # Pending +Special thanks to external contributors with PRs included in this release: ackratos, james-ray, bradyjoestar, +peerlink, Ahmah2009, bluele, b00f + BREAKING CHANGES: * CLI/RPC/Config @@ -21,9 +24,11 @@ BREAKING CHANGES: * Go API - [lite] \#1815 Complete refactor of the package - - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` + - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) - [libs/common] \#2199 Remove Fmt, in favor of fmt.Sprintf - [libs/common] SplitAndTrim was deleted + - [libs/common] \#2274 Remove unused Math functions like MaxInt, MaxInt64, + MinInt, MinInt64 (@Ahmah2009) - [libs/clist] Panics if list extends beyond MaxLength - [crypto] \#2205 Rename AminoRoute variables to no longer be prefixed by signature type. @@ -49,10 +54,11 @@ BREAKING CHANGES: * P2P Protocol - [p2p] \#2263 Update secret connection to use a little endian encoded nonce - [blockchain] \#2213 Fix Amino routes for blockchain reactor messages + (@peerlink) FEATURES: -- [types] \#2015 Allow genesis file to have 0 validators +- [types] \#2015 Allow genesis file to have 0 validators (@b00f) - Initial validator set can be determined by the app in ResponseInitChain - [rpc] \#2161 New event `ValidatorSetUpdates` for when the validator set changes - [crypto/multisig] \#2164 Introduce multisig pubkey and signature format @@ -60,14 +66,15 @@ FEATURES: IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. -- [scripts] Added json2wal tool, which is supposed to help our users restore +- [scripts] \#2196 Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) corrupted WAL files and compose test WAL files (@bradyjoestar) - [mempool] \#2234 Now stores txs by hash inside of the cache, to mitigate memory leakage +- [mempool] \#2166 Set explicit capacity for map when updating txs (@bluele) BUG FIXES: - [config] \#2284 Replace `db_path` with `db_dir` from automatically generated configuration files. - [mempool] \#2188 Fix OOM issue from cache map and list getting out of sync -- [state] \#2051 KV store index supports searching by `tx.height` +- [state] \#2051 KV store index supports searching by `tx.height` (@ackratos) - [rpc] \#2327 `/dial_peers` does not try to dial existing peers -- [node] \#2323 Filter empty strings from config lists -- [abci/client] \#2236 Fix closing GRPC connection +- [node] \#2323 Filter empty strings from config lists (@james-ray) +- [abci/client] \#2236 Fix closing GRPC connection (@bradyjoestar) From 4416c9e4bc81c89ddebcfb1434c211dab9ece028 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:43:21 -0400 Subject: [PATCH 126/149] fix links in abci readme. fixes #2335 --- abci/README.md | 8 ++++---- docs/app-dev/ecosystem.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/abci/README.md b/abci/README.md index c536a3bd..63b43e54 100644 --- a/abci/README.md +++ b/abci/README.md @@ -17,10 +17,10 @@ The community has provided a number of addtional implementations, see the [Tende A detailed description of the ABCI methods and message types is contained in: - [A prose specification](specification.md) -- [A protobuf file](https://github.com/tendermint/abci/blob/master/types/types.proto) -- [A Go interface](https://github.com/tendermint/abci/blob/master/types/application.go). +- [A protobuf file](https://github.com/tendermint/tendermint/blob/master/abci/types/types.proto) +- [A Go interface](https://github.com/tendermint/tendermint/blob/master/abci/types/application.go). -For more background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/). +For more background information on ABCI, motivations, and tendermint, please visit [the documentation](https://tendermint.com/docs/). The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`. @@ -94,7 +94,7 @@ Note the length-prefixing used in the socket implementation does not apply for G The `abci-cli` tool wraps an ABCI client and can be used for probing/testing an ABCI server. For instance, `abci-cli test` will run a test sequence against a listening server running the Counter application (see below). It can also be used to run some example applications. -See [the documentation](http://tendermint.readthedocs.io/en/master/) for more details. +See [the documentation](https://tendermint.com/docs/) for more details. ### Examples diff --git a/docs/app-dev/ecosystem.json b/docs/app-dev/ecosystem.json index 728f3a53..67aca2ef 100644 --- a/docs/app-dev/ecosystem.json +++ b/docs/app-dev/ecosystem.json @@ -123,7 +123,7 @@ "abciServers": [ { "name": "abci", - "url": "https://github.com/tendermint/abci", + "url": "https://github.com/tendermint/tendermint/tree/master/abci", "language": "Go", "author": "Tendermint" }, From 61914cf48e6512195dfb3b54fb3cd07d0867cfbf Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:56:58 -0400 Subject: [PATCH 127/149] docs/tm-core/using-tm: fix indentation for genesis.validators --- docs/tendermint-core/using-tendermint.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index 71b773f0..a14392c4 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -42,12 +42,14 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g - `genesis_time`: Official time of blockchain start. - `chain_id`: ID of the blockchain. This must be unique for every blockchain. If your testnet blockchains do not have unique - chain IDs, you will have a bad time. -- `validators`: -- `pub_key`: The first element specifies the `pub_key` type. 1 + chain IDs, you will have a bad time. The ChainID must be less than 50 bytes. +- `validators`: List of initial validators. Note this may be overridden entirely by the + application, and may be left empty to make explicit that the + application will initialize the validator set with ResponseInitChain. + - `pub_key`: The first element specifies the `pub_key` type. 1 == Ed25519. The second element are the pubkey bytes. -- `power`: The validator's voting power. -- `name`: Name of the validator (optional). + - `power`: The validator's voting power. + - `name`: Name of the validator (optional). - `app_hash`: The expected application hash (as returned by the `ResponseInfo` ABCI message) upon genesis. If the app's hash does not match, Tendermint will panic. @@ -93,8 +95,7 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g "power": "1", "name": "node3" } - ], - "app_hash": "" + ] } ``` From 80c217089ada28f9545d5cdac6eea321d435d59c Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 18:57:54 -0400 Subject: [PATCH 128/149] docs/spec/blockchain: remove json tags, dont use HexBytes --- docs/spec/blockchain/blockchain.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index 73f4f35a..35fb9d67 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -42,29 +42,29 @@ the data in the current block, the previous block, and the results returned by t ```go type Header struct { // basic block info - ChainID string `json:"chain_id"` - Height int64 `json:"height"` - Time time.Time `json:"time"` - NumTxs int64 `json:"num_txs"` - TotalTxs int64 `json:"total_txs"` + ChainID string + Height int64 + Time time.Time + NumTxs int64 + TotalTxs int64 // prev block info - LastBlockID BlockID `json:"last_block_id"` + LastBlockID BlockID // hashes of block data - LastCommitHash cmn.HexBytes `json:"last_commit_hash"` // commit from validators from the last block - DataHash cmn.HexBytes `json:"data_hash"` // transactions + LastCommitHash []byte // commit from validators from the last block + DataHash []byte // Merkle root of transactions // hashes from the app output from the prev block - ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block - NextValidatorsHash cmn.HexBytes `json:"next_validators_hash"` // validators for the next block - ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block - AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block - LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block + ValidatorsHash []byte // validators for the current block + NextValidatorsHash []byte // validators for the next block + ConsensusHash []byte // consensus params for current block + AppHash []byte // state after txs from the previous block + LastResultsHash []byte // root hash of all results from the txs from the previous block // consensus info - EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block - ProposerAddress Address `json:"proposer_address"` // original proposer of the block + EvidenceHash []byte // evidence included in the block + ProposerAddress []byte // original proposer of the block ``` Further details on each of these fields is described below. From 0881068d76c3d7868365845a91e01862552c4822 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Wed, 5 Sep 2018 15:58:29 -0700 Subject: [PATCH 129/149] add script to add links in changelog --- scripts/linkify_changelog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/linkify_changelog.py diff --git a/scripts/linkify_changelog.py b/scripts/linkify_changelog.py new file mode 100644 index 00000000..16647c05 --- /dev/null +++ b/scripts/linkify_changelog.py @@ -0,0 +1,13 @@ +import fileinput +import re + +# This script goes through the provided file, and replaces any " \#", +# with the valid mark down formatted link to it. e.g. +# " [\#number](https://github.com/tendermint/tendermint/issues/) +# Note that if the number is for a PR, github will auto-redirect you when you click the link. +# It is safe to run the script multiple times in succession. +# +# Example usage $ python3 linkify_changelog.py ../CHANGELOG_PENDING.md +for line in fileinput.input(inplace=1): + line = re.sub(r"\s\\#([0-9]*)", r" [\\#\1](https://github.com/tendermint/tendermint/issues/\1)", line.rstrip()) + print(line) \ No newline at end of file From 91f8af8fd8a85200ab09a5a610c7b657796c23d9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 19:14:18 -0400 Subject: [PATCH 130/149] docs/spec/blockchain: update vote, signature, time --- docs/spec/blockchain/blockchain.md | 68 ++++++++++-------------------- 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index 35fb9d67..dc3ba64b 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -8,9 +8,9 @@ The Tendermint blockchains consists of a short list of basic data types: - `Block` - `Header` -- `Vote` - `BlockID` -- `Signature` +- `Time` +- `Vote` - `Evidence` ## Block @@ -90,6 +90,16 @@ type PartsHeader struct { } ``` +## Time + +Tendermint uses the +[Google.Protobuf.WellKnownTypes.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/timestamp) +format, which uses two integers, one for Seconds and for Nanoseconds. + +TODO: clarify exact format and reconcile [this +comment](https://github.com/tendermint/tendermint/blob/892b170818cd3be4cd3f919d72dde1ad60c28bbb/types/proto3/block.proto#L43). + + ## Vote A vote is a signed message from a validator for a particular block. @@ -97,14 +107,14 @@ The vote includes information about the validator signing it. ```go type Vote struct { - Timestamp int64 - Address []byte - Index int - Height int64 - Round int - Type int8 - BlockID BlockID - Signature Signature + ValidatorAddress []byte + ValidatorIndex int + Height int64 + Round int + Timestamp Time + Type int8 + BlockID BlockID + Signature []byte } ``` @@ -114,41 +124,9 @@ a _precommit_ has `vote.Type == 2`. ## Signature -Tendermint allows for multiple signature schemes to be used by prepending a single type-byte -to the signature bytes. Different signatures may also come with fixed or variable lengths. -Currently, Tendermint supports Ed25519 and Secp256k1. - -### ED25519 - -An ED25519 signature has `Type == 0x1`. It looks like: - -```go -// Implements Signature -type Ed25519Signature struct { - Type int8 = 0x1 - Signature [64]byte -} -``` - -where `Signature` is the 64 byte signature. - -### Secp256k1 - -A `Secp256k1` signature has `Type == 0x2`. It looks like: - -```go -// Implements Signature -type Secp256k1Signature struct { - Type int8 = 0x2 - Signature []byte -} -``` - -where `Signature` is the DER encoded signature, ie: - -```hex -0x30 <0x02> 0x2 . -``` +Signatures in Tendermint are raw bytes representing the underlying signature. +The only signature scheme currently supported for Tendermint validators is +ED25519. The signature is the raw 64-byte ED25519 signature. ## Evidence From fae21c9f525b54b03dbd0a9a57ba74db8828f568 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 19:25:22 -0400 Subject: [PATCH 131/149] linkify changelog pending --- CHANGELOG_PENDING.md | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 2d591275..875ee773 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -6,75 +6,75 @@ peerlink, Ahmah2009, bluele, b00f BREAKING CHANGES: * CLI/RPC/Config - - [config] \#2169 Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers - - [config] \#2300 Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. - - [rpc] \#1815 `/commit` returns a `signed_header` field instead of everything being top-level + - [config] [\#2169](https://github.com/tendermint/tendermint/issues/2169) Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers + - [config] [\#2300](https://github.com/tendermint/tendermint/issues/2300) Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. + - [rpc] [\#1815](https://github.com/tendermint/tendermint/issues/1815) `/commit` returns a `signed_header` field instead of everything being top-level * Apps - [abci] Added address of the original proposer of the block to Header - [abci] Change ABCI Header to match Tendermint exactly - - [abci] \#2159 Update use of `Validator` (see + - [abci] [\#2159](https://github.com/tendermint/tendermint/issues/2159) Update use of `Validator` (see [ADR-018](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-018-ABCI-Validators.md)): - Remove PubKey from `Validator` (so it's just Address and Power) - Introduce `ValidatorUpdate` (with just PubKey and Power) - InitChain and EndBlock use ValidatorUpdate - Update field names and types in BeginBlock - - [state] \#1815 Validator set changes are now delayed by one block + - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block - updates returned in ResponseEndBlock for block H will be included in RequestBeginBlock for block H+2 * Go API - - [lite] \#1815 Complete refactor of the package - - [node] \#2212 NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) - - [libs/common] \#2199 Remove Fmt, in favor of fmt.Sprintf + - [lite] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Complete refactor of the package + - [node] [\#2212](https://github.com/tendermint/tendermint/issues/2212) NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) + - [libs/common] [\#2199](https://github.com/tendermint/tendermint/issues/2199) Remove Fmt, in favor of fmt.Sprintf - [libs/common] SplitAndTrim was deleted - - [libs/common] \#2274 Remove unused Math functions like MaxInt, MaxInt64, + - [libs/common] [\#2274](https://github.com/tendermint/tendermint/issues/2274) Remove unused Math functions like MaxInt, MaxInt64, MinInt, MinInt64 (@Ahmah2009) - [libs/clist] Panics if list extends beyond MaxLength - - [crypto] \#2205 Rename AminoRoute variables to no longer be prefixed by signature type. + - [crypto] [\#2205](https://github.com/tendermint/tendermint/issues/2205) Rename AminoRoute variables to no longer be prefixed by signature type. * Blockchain Protocol - - [state] \#1815 Validator set changes are now delayed by one block (!) + - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block (!) - Add NextValidatorSet to State, changes on-disk representation of state - - [state] \#2184 Enforce ConsensusParams.BlockSize.MaxBytes (See + - [state] [\#2184](https://github.com/tendermint/tendermint/issues/2184) Enforce ConsensusParams.BlockSize.MaxBytes (See [ADR-020](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-020-block-size.md)). - Remove ConsensusParams.BlockSize.MaxTxs - Introduce maximum sizes for all components of a block, including ChainID - [types] Updates to the block Header: - - \#1815 NextValidatorsHash - hash of the validator set for the next block, + - [\#1815](https://github.com/tendermint/tendermint/issues/1815) NextValidatorsHash - hash of the validator set for the next block, so the current validators actually sign over the hash for the new validators - - \#2106 ProposerAddress - address of the block's original proposer - - [consensus] \#2203 Implement BFT time + - [\#2106](https://github.com/tendermint/tendermint/issues/2106) ProposerAddress - address of the block's original proposer + - [consensus] [\#2203](https://github.com/tendermint/tendermint/issues/2203) Implement BFT time - Timestamp in block must be monotonic and equal the median of timestamps in block's LastCommit - - [crypto] \#2239 Secp256k1 signature changes (See + - [crypto] [\#2239](https://github.com/tendermint/tendermint/issues/2239) Secp256k1 signature changes (See [ADR-014](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-014-secp-malleability.md)): - format changed from DER to `r || s`, both little endian encoded as 32 bytes. - malleability removed by requiring `s` to be in canonical form. * P2P Protocol - - [p2p] \#2263 Update secret connection to use a little endian encoded nonce - - [blockchain] \#2213 Fix Amino routes for blockchain reactor messages + - [p2p] [\#2263](https://github.com/tendermint/tendermint/issues/2263) Update secret connection to use a little endian encoded nonce + - [blockchain] [\#2213](https://github.com/tendermint/tendermint/issues/2213) Fix Amino routes for blockchain reactor messages (@peerlink) FEATURES: -- [types] \#2015 Allow genesis file to have 0 validators (@b00f) +- [types] [\#2015](https://github.com/tendermint/tendermint/issues/2015) Allow genesis file to have 0 validators (@b00f) - Initial validator set can be determined by the app in ResponseInitChain -- [rpc] \#2161 New event `ValidatorSetUpdates` for when the validator set changes -- [crypto/multisig] \#2164 Introduce multisig pubkey and signature format -- [libs/db] \#2293 Allow passing options through when creating instances of leveldb dbs +- [rpc] [\#2161](https://github.com/tendermint/tendermint/issues/2161) New event `ValidatorSetUpdates` for when the validator set changes +- [crypto/multisig] [\#2164](https://github.com/tendermint/tendermint/issues/2164) Introduce multisig pubkey and signature format +- [libs/db] [\#2293](https://github.com/tendermint/tendermint/issues/2293) Allow passing options through when creating instances of leveldb dbs IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. -- [scripts] \#2196 Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) +- [scripts] [\#2196](https://github.com/tendermint/tendermint/issues/2196) Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) corrupted WAL files and compose test WAL files (@bradyjoestar) -- [mempool] \#2234 Now stores txs by hash inside of the cache, to mitigate memory leakage -- [mempool] \#2166 Set explicit capacity for map when updating txs (@bluele) +- [mempool] [\#2234](https://github.com/tendermint/tendermint/issues/2234) Now stores txs by hash inside of the cache, to mitigate memory leakage +- [mempool] [\#2166](https://github.com/tendermint/tendermint/issues/2166) Set explicit capacity for map when updating txs (@bluele) BUG FIXES: -- [config] \#2284 Replace `db_path` with `db_dir` from automatically generated configuration files. -- [mempool] \#2188 Fix OOM issue from cache map and list getting out of sync -- [state] \#2051 KV store index supports searching by `tx.height` (@ackratos) -- [rpc] \#2327 `/dial_peers` does not try to dial existing peers -- [node] \#2323 Filter empty strings from config lists (@james-ray) -- [abci/client] \#2236 Fix closing GRPC connection (@bradyjoestar) +- [config] [\#2284](https://github.com/tendermint/tendermint/issues/2284) Replace `db_path` with `db_dir` from automatically generated configuration files. +- [mempool] [\#2188](https://github.com/tendermint/tendermint/issues/2188) Fix OOM issue from cache map and list getting out of sync +- [state] [\#2051](https://github.com/tendermint/tendermint/issues/2051) KV store index supports searching by `tx.height` (@ackratos) +- [rpc] [\#2327](https://github.com/tendermint/tendermint/issues/2327) `/dial_peers` does not try to dial existing peers +- [node] [\#2323](https://github.com/tendermint/tendermint/issues/2323) Filter empty strings from config lists (@james-ray) +- [abci/client] [\#2236](https://github.com/tendermint/tendermint/issues/2236) Fix closing GRPC connection (@bradyjoestar) From b616e54c9b2308c942c3993a7bdb0c946e4515f3 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 5 Sep 2018 19:24:19 -0400 Subject: [PATCH 132/149] changelog and version --- CHANGELOG.md | 97 ++++++++++++++++++++++++++++++++++++++++++++ CHANGELOG_PENDING.md | 60 +-------------------------- version/version.go | 6 +-- 3 files changed, 101 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ccafa5..14615ab1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,102 @@ # Changelog +## 0.24.0 + +*September 6th, 2018* + +Special thanks to external contributors with PRs included in this release: ackratos, james-ray, bradyjoestar, +peerlink, Ahmah2009, bluele, b00f. + +This release includes breaking upgrades in the block header, +including the long awaited changes for delaying validator set updates by one +block. It also fixes enforcement on the max size of blocks, and includes a BFT +timestamp in each block that can be safely used by applications. There are also some +minor breaking changes to the rpc, config, and ABCI. + +From here on, breaking changes will be broken down to better reflect how users +are affected by a change. + +A few more breaking changes are in the works - each will come with a clear +Architecture Decision Record (ADR) explaining the change. You can review ADRs +[here](https://github.com/tendermint/tendermint/tree/develop/docs/architecture) +or in the [open Pull Requests](https://github.com/tendermint/tendermint/pulls). + +BREAKING CHANGES: + +* CLI/RPC/Config + - [config] [\#2169](https://github.com/tendermint/tendermint/issues/2169) Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers + - [config] [\#2300](https://github.com/tendermint/tendermint/issues/2300) Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. + - [rpc] [\#1815](https://github.com/tendermint/tendermint/issues/1815) `/commit` returns a `signed_header` field instead of everything being top-level + +* Apps + - [abci] Added address of the original proposer of the block to Header + - [abci] Change ABCI Header to match Tendermint exactly + - [abci] [\#2159](https://github.com/tendermint/tendermint/issues/2159) Update use of `Validator` (see + [ADR-018](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-018-ABCI-Validators.md)): + - Remove PubKey from `Validator` (so it's just Address and Power) + - Introduce `ValidatorUpdate` (with just PubKey and Power) + - InitChain and EndBlock use ValidatorUpdate + - Update field names and types in BeginBlock + - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block + - updates returned in ResponseEndBlock for block H will be included in RequestBeginBlock for block H+2 + +* Go API + - [lite] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Complete refactor of the package + - [node] [\#2212](https://github.com/tendermint/tendermint/issues/2212) NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) + - [libs/common] [\#2199](https://github.com/tendermint/tendermint/issues/2199) Remove Fmt, in favor of fmt.Sprintf + - [libs/common] SplitAndTrim was deleted + - [libs/common] [\#2274](https://github.com/tendermint/tendermint/issues/2274) Remove unused Math functions like MaxInt, MaxInt64, + MinInt, MinInt64 (@Ahmah2009) + - [libs/clist] Panics if list extends beyond MaxLength + - [crypto] [\#2205](https://github.com/tendermint/tendermint/issues/2205) Rename AminoRoute variables to no longer be prefixed by signature type. + +* Blockchain Protocol + - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block (!) + - Add NextValidatorSet to State, changes on-disk representation of state + - [state] [\#2184](https://github.com/tendermint/tendermint/issues/2184) Enforce ConsensusParams.BlockSize.MaxBytes (See + [ADR-020](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-020-block-size.md)). + - Remove ConsensusParams.BlockSize.MaxTxs + - Introduce maximum sizes for all components of a block, including ChainID + - [types] Updates to the block Header: + - [\#1815](https://github.com/tendermint/tendermint/issues/1815) NextValidatorsHash - hash of the validator set for the next block, + so the current validators actually sign over the hash for the new + validators + - [\#2106](https://github.com/tendermint/tendermint/issues/2106) ProposerAddress - address of the block's original proposer + - [consensus] [\#2203](https://github.com/tendermint/tendermint/issues/2203) Implement BFT time + - Timestamp in block must be monotonic and equal the median of timestamps in block's LastCommit + - [crypto] [\#2239](https://github.com/tendermint/tendermint/issues/2239) Secp256k1 signature changes (See + [ADR-014](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-014-secp-malleability.md)): + - format changed from DER to `r || s`, both little endian encoded as 32 bytes. + - malleability removed by requiring `s` to be in canonical form. + +* P2P Protocol + - [p2p] [\#2263](https://github.com/tendermint/tendermint/issues/2263) Update secret connection to use a little endian encoded nonce + - [blockchain] [\#2213](https://github.com/tendermint/tendermint/issues/2213) Fix Amino routes for blockchain reactor messages + (@peerlink) + + +FEATURES: +- [types] [\#2015](https://github.com/tendermint/tendermint/issues/2015) Allow genesis file to have 0 validators (@b00f) + - Initial validator set can be determined by the app in ResponseInitChain +- [rpc] [\#2161](https://github.com/tendermint/tendermint/issues/2161) New event `ValidatorSetUpdates` for when the validator set changes +- [crypto/multisig] [\#2164](https://github.com/tendermint/tendermint/issues/2164) Introduce multisig pubkey and signature format +- [libs/db] [\#2293](https://github.com/tendermint/tendermint/issues/2293) Allow passing options through when creating instances of leveldb dbs + +IMPROVEMENTS: +- [docs] Lint documentation with `write-good` and `stop-words`. +- [scripts] [\#2196](https://github.com/tendermint/tendermint/issues/2196) Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) + corrupted WAL files and compose test WAL files (@bradyjoestar) +- [mempool] [\#2234](https://github.com/tendermint/tendermint/issues/2234) Now stores txs by hash inside of the cache, to mitigate memory leakage +- [mempool] [\#2166](https://github.com/tendermint/tendermint/issues/2166) Set explicit capacity for map when updating txs (@bluele) + +BUG FIXES: +- [config] [\#2284](https://github.com/tendermint/tendermint/issues/2284) Replace `db_path` with `db_dir` from automatically generated configuration files. +- [mempool] [\#2188](https://github.com/tendermint/tendermint/issues/2188) Fix OOM issue from cache map and list getting out of sync +- [state] [\#2051](https://github.com/tendermint/tendermint/issues/2051) KV store index supports searching by `tx.height` (@ackratos) +- [rpc] [\#2327](https://github.com/tendermint/tendermint/issues/2327) `/dial_peers` does not try to dial existing peers +- [node] [\#2323](https://github.com/tendermint/tendermint/issues/2323) Filter empty strings from config lists (@james-ray) +- [abci/client] [\#2236](https://github.com/tendermint/tendermint/issues/2236) Fix closing GRPC connection (@bradyjoestar) + ## 0.23.1 *August 22nd, 2018* diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 875ee773..cd5dc06d 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,80 +1,22 @@ # Pending -Special thanks to external contributors with PRs included in this release: ackratos, james-ray, bradyjoestar, -peerlink, Ahmah2009, bluele, b00f +Special thanks to external contributors with PRs included in this release: BREAKING CHANGES: * CLI/RPC/Config - - [config] [\#2169](https://github.com/tendermint/tendermint/issues/2169) Replace MaxNumPeers with MaxNumInboundPeers and MaxNumOutboundPeers - - [config] [\#2300](https://github.com/tendermint/tendermint/issues/2300) Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented. - - [rpc] [\#1815](https://github.com/tendermint/tendermint/issues/1815) `/commit` returns a `signed_header` field instead of everything being top-level * Apps - - [abci] Added address of the original proposer of the block to Header - - [abci] Change ABCI Header to match Tendermint exactly - - [abci] [\#2159](https://github.com/tendermint/tendermint/issues/2159) Update use of `Validator` (see - [ADR-018](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-018-ABCI-Validators.md)): - - Remove PubKey from `Validator` (so it's just Address and Power) - - Introduce `ValidatorUpdate` (with just PubKey and Power) - - InitChain and EndBlock use ValidatorUpdate - - Update field names and types in BeginBlock - - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block - - updates returned in ResponseEndBlock for block H will be included in RequestBeginBlock for block H+2 * Go API - - [lite] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Complete refactor of the package - - [node] [\#2212](https://github.com/tendermint/tendermint/issues/2212) NewNode now accepts a `*p2p.NodeKey` (@bradyjoestar) - - [libs/common] [\#2199](https://github.com/tendermint/tendermint/issues/2199) Remove Fmt, in favor of fmt.Sprintf - - [libs/common] SplitAndTrim was deleted - - [libs/common] [\#2274](https://github.com/tendermint/tendermint/issues/2274) Remove unused Math functions like MaxInt, MaxInt64, - MinInt, MinInt64 (@Ahmah2009) - - [libs/clist] Panics if list extends beyond MaxLength - - [crypto] [\#2205](https://github.com/tendermint/tendermint/issues/2205) Rename AminoRoute variables to no longer be prefixed by signature type. * Blockchain Protocol - - [state] [\#1815](https://github.com/tendermint/tendermint/issues/1815) Validator set changes are now delayed by one block (!) - - Add NextValidatorSet to State, changes on-disk representation of state - - [state] [\#2184](https://github.com/tendermint/tendermint/issues/2184) Enforce ConsensusParams.BlockSize.MaxBytes (See - [ADR-020](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-020-block-size.md)). - - Remove ConsensusParams.BlockSize.MaxTxs - - Introduce maximum sizes for all components of a block, including ChainID - - [types] Updates to the block Header: - - [\#1815](https://github.com/tendermint/tendermint/issues/1815) NextValidatorsHash - hash of the validator set for the next block, - so the current validators actually sign over the hash for the new - validators - - [\#2106](https://github.com/tendermint/tendermint/issues/2106) ProposerAddress - address of the block's original proposer - - [consensus] [\#2203](https://github.com/tendermint/tendermint/issues/2203) Implement BFT time - - Timestamp in block must be monotonic and equal the median of timestamps in block's LastCommit - - [crypto] [\#2239](https://github.com/tendermint/tendermint/issues/2239) Secp256k1 signature changes (See - [ADR-014](https://github.com/tendermint/tendermint/blob/develop/docs/architecture/adr-014-secp-malleability.md)): - - format changed from DER to `r || s`, both little endian encoded as 32 bytes. - - malleability removed by requiring `s` to be in canonical form. * P2P Protocol - - [p2p] [\#2263](https://github.com/tendermint/tendermint/issues/2263) Update secret connection to use a little endian encoded nonce - - [blockchain] [\#2213](https://github.com/tendermint/tendermint/issues/2213) Fix Amino routes for blockchain reactor messages - (@peerlink) FEATURES: -- [types] [\#2015](https://github.com/tendermint/tendermint/issues/2015) Allow genesis file to have 0 validators (@b00f) - - Initial validator set can be determined by the app in ResponseInitChain -- [rpc] [\#2161](https://github.com/tendermint/tendermint/issues/2161) New event `ValidatorSetUpdates` for when the validator set changes -- [crypto/multisig] [\#2164](https://github.com/tendermint/tendermint/issues/2164) Introduce multisig pubkey and signature format -- [libs/db] [\#2293](https://github.com/tendermint/tendermint/issues/2293) Allow passing options through when creating instances of leveldb dbs IMPROVEMENTS: -- [docs] Lint documentation with `write-good` and `stop-words`. -- [scripts] [\#2196](https://github.com/tendermint/tendermint/issues/2196) Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) - corrupted WAL files and compose test WAL files (@bradyjoestar) -- [mempool] [\#2234](https://github.com/tendermint/tendermint/issues/2234) Now stores txs by hash inside of the cache, to mitigate memory leakage -- [mempool] [\#2166](https://github.com/tendermint/tendermint/issues/2166) Set explicit capacity for map when updating txs (@bluele) BUG FIXES: -- [config] [\#2284](https://github.com/tendermint/tendermint/issues/2284) Replace `db_path` with `db_dir` from automatically generated configuration files. -- [mempool] [\#2188](https://github.com/tendermint/tendermint/issues/2188) Fix OOM issue from cache map and list getting out of sync -- [state] [\#2051](https://github.com/tendermint/tendermint/issues/2051) KV store index supports searching by `tx.height` (@ackratos) -- [rpc] [\#2327](https://github.com/tendermint/tendermint/issues/2327) `/dial_peers` does not try to dial existing peers -- [node] [\#2323](https://github.com/tendermint/tendermint/issues/2323) Filter empty strings from config lists (@james-ray) -- [abci/client] [\#2236](https://github.com/tendermint/tendermint/issues/2236) Fix closing GRPC connection (@bradyjoestar) diff --git a/version/version.go b/version/version.go index 68a9954f..27b325f0 100644 --- a/version/version.go +++ b/version/version.go @@ -3,14 +3,14 @@ package version // Version components const ( Maj = "0" - Min = "23" - Fix = "1" + Min = "24" + Fix = "0" ) var ( // Version is the current version of Tendermint // Must be a string because scripts like dist.sh read this file. - Version = "0.23.1" + Version = "0.24.0" // GitCommit is the current HEAD set using ldflags. GitCommit string From ed9e00a8a709c368159613dad64118255d454c29 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 12:41:02 -0400 Subject: [PATCH 133/149] docs/spec/blockchain: fix encoding JSON --- docs/spec/blockchain/encoding.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/spec/blockchain/encoding.md b/docs/spec/blockchain/encoding.md index 3ed06260..1af47040 100644 --- a/docs/spec/blockchain/encoding.md +++ b/docs/spec/blockchain/encoding.md @@ -275,13 +275,11 @@ Because Tendermint only uses a Simple Merkle Tree, application developers are ex ### Amino -This section is pending an update, see [this issue](https://github.com/tendermint/tendermint/issues/1749). - Amino also supports JSON encoding - registered types are simply encoded as: ``` { - "type": "", + "type": "", "value": } ``` @@ -296,19 +294,18 @@ For instance, an ED25519 PubKey would look like: ``` Where the `"value"` is the base64 encoding of the raw pubkey bytes, and the -`"type"` is the full disfix bytes for Ed25519 pubkeys. +`"type"` is the amino name for Ed25519 pubkeys. ### Signed Messages -Signed messages (eg. votes, proposals) in the consensus are encoded using Amino-JSON, rather than in the standard binary format. +Signed messages (eg. votes, proposals) in the consensus are encoded using Amino-JSON, rather than in the standard binary format +(NOTE: this is subject to change: https://github.com/tendermint/tendermint/issues/1622) -When signing, the elements of a message are sorted by key and the sorted message is embedded in an -outer JSON that includes a `chain_id` field. +When signing, the elements of a message are sorted by key and prepended with +a `@chain_id` and `@type` field. We call this encoding the CanonicalSignBytes. For instance, CanonicalSignBytes for a vote would look like: ```json -{"chain_id":"my-chain-id","vote":{"block_id":{"hash":DEADBEEF,"parts":{"hash":BEEFDEAD,"total":3}},"height":3,"round":2,"timestamp":1234567890, "type":2} +{"@chain_id":"test_chain_id","@type":"vote","block_id":{"hash":"8B01023386C371778ECB6368573E539AFC3CC860","parts":{"hash":"72DB3D959635DFF1BB567BEDAA70573392C51596","total":"1000000"}},"height":"12345","round":"2","timestamp":"2017-12-25T03:00:01.234Z","type":2} ``` - -Note how the fields within each level are sorted. From bdf32387106011e4e7a4645b0700d297e1e8e0b3 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 12:41:33 -0400 Subject: [PATCH 134/149] docs/spec/blockchain: bring blockchain.md up-to-date --- docs/spec/blockchain/blockchain.md | 188 +++++++++++++++++------------ 1 file changed, 109 insertions(+), 79 deletions(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index dc3ba64b..c24d2e10 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -10,29 +10,25 @@ The Tendermint blockchains consists of a short list of basic data types: - `Header` - `BlockID` - `Time` -- `Vote` -- `Evidence` +- `Data` (for transactions) +- `Commit` and `Vote` +- `EvidenceData` and `Evidence` ## Block -A block consists of a header, a list of transactions, a list of votes (the commit), +A block consists of a header, transactions, votes (the commit), and a list of evidence of malfeasance (ie. signing conflicting votes). ```go type Block struct { Header Header - Txs [][]byte - LastCommit []Vote - Evidence []Evidence + Txs Data + Evidence EvidenceData + LastCommit Commit } ``` -The signatures returned along with block `X` are those validating block -`X-1`. This can be a little confusing, but consider that -the `Header` also contains the `LastCommitHash`. It would be impossible -for a Header to include the commits that sign it, as it would cause an -infinite loop here. But when we get block `X`, we find -`Header.LastCommitHash`, which must match the hash of `LastCommit`. +Note the `LastCommit` is the set of votes that committed the last block. ## Header @@ -44,7 +40,7 @@ type Header struct { // basic block info ChainID string Height int64 - Time time.Time + Time Time NumTxs int64 TotalTxs int64 @@ -90,15 +86,43 @@ type PartsHeader struct { } ``` +TODO: link to details of merkle sums. + ## Time Tendermint uses the [Google.Protobuf.WellKnownTypes.Timestamp](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/timestamp) format, which uses two integers, one for Seconds and for Nanoseconds. -TODO: clarify exact format and reconcile [this -comment](https://github.com/tendermint/tendermint/blob/892b170818cd3be4cd3f919d72dde1ad60c28bbb/types/proto3/block.proto#L43). +NOTE: there is currently a small divergence between Tendermint and the +Google.Protobuf.WellKnownTypes.Timestamp that should be resolved. See [this +issue](https://github.com/tendermint/go-amino/issues/223) for details. +## Data + +Data is just a wrapper for a list of transactions, where transactions are +arbitrary byte arrays: + +``` +type Data struct { + Txs [][]byte +} +``` + +## Commit + +Commit is a simple wrapper for a list of votes, with one vote for each +validator. It also contains the relevant BlockID: + +``` +type Commit struct { + BlockID BlockID + Precommits []Vote +} +``` + +NOTE: this will likely change to reduce the commit size by eliminating redundant +information - see [issue #1648](https://github.com/tendermint/tendermint/issues/1648). ## Vote @@ -128,9 +152,30 @@ Signatures in Tendermint are raw bytes representing the underlying signature. The only signature scheme currently supported for Tendermint validators is ED25519. The signature is the raw 64-byte ED25519 signature. +## EvidenceData + +EvidenceData is a simple wrapper for a list of evidence: + +``` +type EvidenceData struct { + Evidence []Evidence +} +``` + ## Evidence -Forthcoming, see [this issue](https://github.com/tendermint/tendermint/issues/2329) +Evidence in Tendermint is implemented as an interface. +This means any evidence is encoded using its Amino prefix. +There is currently only a single type, the `DuplicateVoteEvidence`. + +``` +// amino name: "tendermint/DuplicateVoteEvidence" +type DuplicateVoteEvidence struct { + PubKey PubKey + VoteA Vote + VoteB Vote +} +``` ## Validation @@ -155,13 +200,13 @@ See [here](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockc A Header is valid if its corresponding fields are valid. -### Version - -Arbitrary string. - ### ChainID -Arbitrary constant string. +``` +len(block.ChainID) < 50 +``` + +ChainID must be maximum 50 UTF-8 symbols. ### Height @@ -174,50 +219,27 @@ The height is an incrementing integer. The first block has `block.Header.Height ### Time -The median of the timestamps of the valid votes in the block.LastCommit. -Corresponds to the number of nanoseconds, with millisecond resolution, since January 1, 1970. +``` +block.Header.Timestamp >= prevBlock.Header.Timestamp + 1 ms +block.Header.Timestamp == MedianTime(block.LastCommit, state.LastValidators) +``` + +The block timestamp must be monotonic. +It must equal the weighted median of the timestamps of the valid votes in the block.LastCommit. Note: the timestamp of a vote must be greater by at least one millisecond than that of the block being voted on. +See the section on [BFT time](../consensus/bft-time.md) for more details. + ### NumTxs ```go -block.Header.NumTxs == len(block.Txs) +block.Header.NumTxs == len(block.Txs.Txs) ``` Number of transactions included in the block. -### TxHash - -```go -block.Header.TxHash == SimpleMerkleRoot(block.Txs) -``` - -Simple Merkle root of the transactions in the block. - -### LastCommitHash - -```go -block.Header.LastCommitHash == SimpleMerkleRoot(block.LastCommit) -``` - -Simple Merkle root of the votes included in the block. -These are the votes that committed the previous block. - -The first block has `block.Header.LastCommitHash == []byte{}` - -### DataHash - -The `DataHash` can provide a nice check on the -[Data](https://godoc.org/github.com/tendermint/tendermint/types#Data) -returned in this same block. If you are subscribed to new blocks, via -tendermint RPC, in order to display or process the new transactions you -should at least validate that the `DataHash` is valid. If it is -important to verify autheniticity, you must wait for the `LastCommit` -from the next block to make sure the block header (including `DataHash`) -was properly signed. - ### TotalTxs ```go @@ -248,25 +270,24 @@ which are held in the `state` and may be updated by the application. The first block has `block.Header.LastBlockID == BlockID{}`. -### ResultsHash +### LastCommitHash ```go -block.ResultsHash == SimpleMerkleRoot(state.LastResults) +block.Header.LastCommitHash == SimpleMerkleRoot(block.LastCommit) ``` -Simple Merkle root of the results of the transactions in the previous block. +Simple Merkle root of the votes included in the block. +These are the votes that committed the previous block. -The first block has `block.Header.ResultsHash == []byte{}`. +The first block has `block.Header.LastCommitHash == []byte{}` -### AppHash +### DataHash ```go -block.AppHash == state.AppHash +block.Header.DataHash == SimpleMerkleRoot(block.Txs.Txs) ``` -Arbitrary byte array returned by the application after executing and commiting the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. - -The first block has `block.Header.AppHash == []byte{}`. +Simple Merkle root of the transactions included in the block. ### ValidatorsHash @@ -284,7 +305,8 @@ block.NextValidatorsHash == SimpleMerkleRoot(state.NextValidators) ``` Simple Merkle root of the next validator set that will be the validator set that commits the next block. -Modifications to the validator set are defined by the application. +This is included so that the current validator set gets a chance to sign the +next validator sets Merkle root. ### ConsensusParamsHash @@ -293,17 +315,26 @@ block.ConsensusParamsHash == SimpleMerkleRoot(state.ConsensusParams) ``` Simple Merkle root of the consensus parameters. -May be updated by the application. -### ProposerAddress +### AppHash ```go -block.Header.ProposerAddress in state.Validators +block.AppHash == state.AppHash ``` -Address of the original proposer of the block. Must be a current validator. +Arbitrary byte array returned by the application after executing and commiting the previous block. It serves as the basis for validating any merkle proofs that comes from the ABCI application and represents the state of the actual application rather than the state of the blockchain itself. -NOTE: we also need to track the round. +The first block has `block.Header.AppHash == []byte{}`. + +### LastResultsHash + +```go +block.ResultsHash == SimpleMerkleRoot(state.LastResults) +``` + +Simple Merkle root of the results of the transactions in the previous block. + +The first block has `block.Header.ResultsHash == []byte{}`. ## EvidenceHash @@ -313,6 +344,14 @@ block.EvidenceHash == SimpleMerkleRoot(block.Evidence) Simple Merkle root of the evidence of Byzantine behaviour included in this block. +### ProposerAddress + +```go +block.Header.ProposerAddress in state.Validators +``` + +Address of the original proposer of the block. Must be a current validator. + ## Txs Arbitrary length array of arbitrary length byte-arrays. @@ -378,16 +417,7 @@ against the given signature and message bytes. ## Evidence -There is currently only one kind of evidence: - -``` -// amino: "tendermint/DuplicateVoteEvidence" -type DuplicateVoteEvidence struct { - PubKey crypto.PubKey - VoteA *Vote - VoteB *Vote -} -``` +There is currently only one kind of evidence, `DuplicateVoteEvidence`. DuplicateVoteEvidence `ev` is valid if From e0fa827a53d57bb87383454dea6aa1908972ddf0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 12:41:57 -0400 Subject: [PATCH 135/149] docs/spec/blockchain: specify consensus params in state.md --- docs/spec/blockchain/state.md | 59 +++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/docs/spec/blockchain/state.md b/docs/spec/blockchain/state.md index 92df20f3..ff5c9a76 100644 --- a/docs/spec/blockchain/state.md +++ b/docs/spec/blockchain/state.md @@ -60,7 +60,7 @@ type Validator struct { } ``` -The `state.Validators` and `state.LastValidators` must always by sorted by validator address, +The `state.Validators`, `state.LastValidators`, and `state.NextValidators`, must always by sorted by validator address, so that there is a canonical order for computing the SimpleMerkleRoot. We also define a `TotalVotingPower` function, to return the total voting power: @@ -77,4 +77,59 @@ func TotalVotingPower(vals []Validators) int64{ ### ConsensusParams -This section is forthcoming. See [this issue](https://github.com/tendermint/tendermint/issues/1152). +ConsensusParams define various limits for blockchain data structures. +Like validator sets, they are set during genesis and can be updated by the application through ABCI. + +``` +type ConsensusParams struct { + BlockSize + TxSize + BlockGossip + EvidenceParams +} + +type BlockSize struct { + MaxBytes int + MaxGas int64 +} + +type TxSize struct { + MaxBytes int + MaxGas int64 +} + +type BlockGossip struct { + BlockPartSizeBytes int +} + +type EvidenceParams struct { + MaxAge int64 +} +``` + +#### BlockSize + +The total size of a block is limitted in bytes by the `ConsensusParams.BlockSize.MaxBytes`. +Proposed blocks must be less than this size, and will be considered invalid +otherwise. + +Blocks should additionally be limitted by the amount of "gas" consumed by the +transactions in the block, though this is not yet implemented. + +#### TxSize + +These parameters are not yet enforced and may disappear. See [issue +#2347](https://github.com/tendermint/tendermint/issues/2347). + +#### BlockGossip + +When gossipping blocks in the consensus, they are first split into parts. The +size of each part is `ConsensusParams.BlockGossip.BlockPartSizeBytes`. + +#### EvidenceParams + +For evidence in a block to be valid, it must satisfy: + +``` +block.Header.Height - evidence.Height < ConsensusParams.EvidenceParams.MaxAge +``` From 8fcabe8b05490365106309a59df2d72aecd77957 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 12:42:23 -0400 Subject: [PATCH 136/149] docs: fix note about ChainID size --- docs/tendermint-core/using-tendermint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index a14392c4..28acc046 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -42,7 +42,7 @@ definition](https://github.com/tendermint/tendermint/blob/master/types/genesis.g - `genesis_time`: Official time of blockchain start. - `chain_id`: ID of the blockchain. This must be unique for every blockchain. If your testnet blockchains do not have unique - chain IDs, you will have a bad time. The ChainID must be less than 50 bytes. + chain IDs, you will have a bad time. The ChainID must be less than 50 symbols. - `validators`: List of initial validators. Note this may be overridden entirely by the application, and may be left empty to make explicit that the application will initialize the validator set with ResponseInitChain. From 6fd79d154543714136b8895abbbb6d5e196f730d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 12:47:26 -0400 Subject: [PATCH 137/149] docs/spec/blockchain: remove tags from result for now --- docs/spec/blockchain/state.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/docs/spec/blockchain/state.md b/docs/spec/blockchain/state.md index ff5c9a76..3bad68bd 100644 --- a/docs/spec/blockchain/state.md +++ b/docs/spec/blockchain/state.md @@ -8,10 +8,10 @@ transactions are never included in blocks, but their Merkle roots are - the stat Note that the `State` object itself is an implementation detail, since it is never included in a block or gossipped over the network, and we never compute -its hash. However, the types it contains are part of the specification, since -their Merkle roots are included in blocks. - -Details on an implementation of `State` with persistence is forthcoming, see [this issue](https://github.com/tendermint/tendermint/issues/1152) +its hash. Thus we do not include here details of how the `State` object is +persisted or queried. That said, the types it contains are part of the specification, since +their Merkle roots are included in blocks and their values are used in +validation. ```go type State struct { @@ -32,20 +32,15 @@ type State struct { type Result struct { Code uint32 Data []byte - Tags []KVPair -} - -type KVPair struct { - Key []byte - Value []byte } ``` `Result` is the result of executing a transaction against the application. -It returns a result code, an arbitrary byte array (ie. a return value), -and a list of key-value pairs ordered by key. The key-value pairs, or tags, -can be used to index transactions according to their "effects", which are -represented in the tags. +It returns a result code and an arbitrary byte array (ie. a return value). + +NOTE: the Result needs to be updated to include more fields returned from +processing transactions, like gas variables and tags - see +[issue 1007](https://github.com/tendermint/tendermint/issues/1007). ### Validator From 54fe6ef73c635cd52c824a1ad96582679b9f9a7e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 17:58:12 -0400 Subject: [PATCH 138/149] version: add and bump abci version --- abci/version/version.go | 10 +++++----- version/version.go | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/abci/version/version.go b/abci/version/version.go index 7223a86a..f4dc4d23 100644 --- a/abci/version/version.go +++ b/abci/version/version.go @@ -1,9 +1,9 @@ package version -// NOTE: we should probably be versioning the ABCI and the abci-cli separately +import ( + "github.com/tendermint/tendermint/version" +) -const Maj = "0" -const Min = "12" -const Fix = "0" +// TODO: eliminate this after some version refactor -const Version = "0.12.0" +const Version = version.ABCIVersion diff --git a/version/version.go b/version/version.go index 27b325f0..337ce4ea 100644 --- a/version/version.go +++ b/version/version.go @@ -16,6 +16,9 @@ var ( GitCommit string ) +// ABCIVersion is the version of the ABCI library +const ABCIVersion = "0.14.0" + func init() { if GitCommit != "" { Version += "-" + GitCommit From dea34506fbcb251d3a119556f642248b94a5bd99 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 17:58:52 -0400 Subject: [PATCH 139/149] types/time: add note about stripping monotonic part --- types/time/time.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/time/time.go b/types/time/time.go index 62aca9ec..022bdf57 100644 --- a/types/time/time.go +++ b/types/time/time.go @@ -11,6 +11,8 @@ func Now() time.Time { } // Canonical returns UTC time with no monotonic component. +// Stripping the monotonic component is for time equality. +// See https://github.com/tendermint/tendermint/pull/2203#discussion_r215064334 func Canonical(t time.Time) time.Time { return t.Round(0).UTC() } From 20c55cffc428892b27ce14821e3e944f7350e8ba Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 18:36:11 -0400 Subject: [PATCH 140/149] docs: move app-dev/abci-spec.md to spec/abci/abci.md --- docs/app-dev/abci-spec.md | 13 +- docs/spec/abci/abci.md | 363 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 374 insertions(+), 2 deletions(-) create mode 100644 docs/spec/abci/abci.md diff --git a/docs/app-dev/abci-spec.md b/docs/app-dev/abci-spec.md index 63570f7f..6d0f712a 100644 --- a/docs/app-dev/abci-spec.md +++ b/docs/app-dev/abci-spec.md @@ -1,5 +1,9 @@ # ABCI Specification +### XXX + +DEPRECATED: Moved [here](../spec/abci/abci.md) + ## Message Types ABCI requests/responses are defined as simple Protobuf messages in [this @@ -177,7 +181,8 @@ See below for more details on the message types and how they are used. - **Usage**: - Signals the beginning of a new block. Called prior to any DeliverTxs. - - The header is expected to at least contain the Height. + - The header contains the height, timestamp, and more - it exactly matches the + Tendermint block header. We may seek to generalize this in the future. - The `LastCommitInfo` and `ByzantineValidators` can be used to determine rewards and punishments for the validators. NOTE validators here do not include pubkeys. @@ -253,7 +258,11 @@ See below for more details on the message types and how they are used. - **Usage**: - Signals the end of a block. - Called prior to each Commit, after all transactions. - - Validator set and consensus params are updated with the result. + - Validator updates returned for block H: + - apply to the NextValidatorsHash of block H+1 + - apply to the ValidatorsHash (and thus the validator set) for block H+2 + - apply to the RequestBeginBlock.LastCommitInfo (ie. the last validator set) for block H+3 + - Consensus params returned for block H apply for block H+1 ### Commit diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md new file mode 100644 index 00000000..f09cb1db --- /dev/null +++ b/docs/spec/abci/abci.md @@ -0,0 +1,363 @@ +# ABCI Specification + +## Message Types + +ABCI requests/responses are defined as simple Protobuf messages in [this +schema file](https://github.com/tendermint/tendermint/blob/master/abci/types/types.proto). +TendermintCore sends the requests, and the ABCI application sends the +responses. Here, we provide an overview of the messages types and how +they are used by Tendermint. Then we describe each request-response pair +as a function with arguments and return values, and add some notes on +usage. + +Some messages (`Echo, Info, InitChain, BeginBlock, EndBlock, Commit`), +don't return errors because an error would indicate a critical failure +in the application and there's nothing Tendermint can do. The problem +should be addressed and both Tendermint and the application restarted. +All other messages (`SetOption, Query, CheckTx, DeliverTx`) return an +application-specific response `Code uint32`, where only `0` is reserved +for `OK`. + +Some messages (`SetOption, Query, CheckTx, DeliverTx`) return +non-deterministic data in the form of `Info` and `Log`. The `Log` is +intended for the literal output from the application's logger, while the +`Info` is any additional info that should be returned. + +The first time a new blockchain is started, Tendermint calls +`InitChain`. From then on, the Block Execution Sequence that causes the +committed state to be updated is as follows: + +`BeginBlock, [DeliverTx], EndBlock, Commit` + +where one `DeliverTx` is called for each transaction in the block. +Cryptographic commitments to the results of DeliverTx, EndBlock, and +Commit are included in the header of the next block. + +Tendermint opens three connections to the application to handle the +different message types: + +- `Consensus Connection - InitChain, BeginBlock, DeliverTx, EndBlock, Commit` +- `Mempool Connection - CheckTx` +- `Info Connection - Info, SetOption, Query` + +The `Flush` message is used on every connection, and the `Echo` message +is only used for debugging. + +Note that messages may be sent concurrently across all connections -a +typical application will thus maintain a distinct state for each +connection. They may be referred to as the `DeliverTx state`, the +`CheckTx state`, and the `Commit state` respectively. + +See below for more details on the message types and how they are used. + +## Request/Response Messages + +### Echo + +- **Request**: + - `Message (string)`: A string to echo back +- **Response**: + - `Message (string)`: The input string +- **Usage**: + - Echo a string to test an abci client/server implementation + +### Flush + +- **Usage**: + - Signals that messages queued on the client should be flushed to + the server. It is called periodically by the client + implementation to ensure asynchronous requests are actually + sent, and is called immediately to make a synchronous request, + which returns when the Flush response comes back. + +### Info + +- **Request**: + - `Version (string)`: The Tendermint version +- **Response**: + - `Data (string)`: Some arbitrary information + - `Version (Version)`: Version information + - `LastBlockHeight (int64)`: Latest block for which the app has + called Commit + - `LastBlockAppHash ([]byte)`: Latest result of Commit +- **Usage**: + - Return information about the application state. + - Used to sync Tendermint with the application during a handshake + that happens on startup. + - Tendermint expects `LastBlockAppHash` and `LastBlockHeight` to + be updated during `Commit`, ensuring that `Commit` is never + called twice for the same block height. + +### SetOption + +- **Request**: + - `Key (string)`: Key to set + - `Value (string)`: Value to set for key +- **Response**: + - `Code (uint32)`: Response code + - `Log (string)`: The output of the application's logger. May + be non-deterministic. + - `Info (string)`: Additional information. May + be non-deterministic. +- **Usage**: + - Set non-consensus critical application specific options. + - e.g. Key="min-fee", Value="100fermion" could set the minimum fee + required for CheckTx (but not DeliverTx - that would be + consensus critical). + +### InitChain + +- **Request**: + - `Time (google.protobuf.Timestamp)`: Genesis time. + - `ChainID (string)`: ID of the blockchain. + - `ConsensusParams (ConsensusParams)`: Initial consensus-critical parameters. + - `Validators ([]ValidatorUpdate)`: Initial genesis validators. + - `AppStateBytes ([]byte)`: Serialized initial application state. Amino-encoded JSON bytes. +- **Response**: + - `ConsensusParams (ConsensusParams)`: Initial + consensus-critical parameters. + - `Validators ([]ValidatorUpdate)`: Initial validator set (if non empty). +- **Usage**: + - Called once upon genesis. + - If ResponseInitChain.Validators is empty, the initial validator set will be the RequestInitChain.Validators + - If ResponseInitChain.Validators is not empty, the initial validator set will be the + ResponseInitChain.Validators (regardless of what is in RequestInitChain.Validators). + - This allows the app to decide if it wants to accept the initial validator + set proposed by tendermint (ie. in the genesis file), or if it wants to use + a different one (perhaps computed based on some application specific + information in the genesis file). + +### Query + +- **Request**: + - `Data ([]byte)`: Raw query bytes. Can be used with or in lieu + of Path. + - `Path (string)`: Path of request, like an HTTP GET path. Can be + used with or in liue of Data. + - Apps MUST interpret '/store' as a query by key on the + underlying store. The key SHOULD be specified in the Data field. + - Apps SHOULD allow queries over specific types like + '/accounts/...' or '/votes/...' + - `Height (int64)`: The block height for which you want the query + (default=0 returns data for the latest committed block). Note + that this is the height of the block containing the + application's Merkle root hash, which represents the state as it + was after committing the block at Height-1 + - `Prove (bool)`: Return Merkle proof with response if possible +- **Response**: + - `Code (uint32)`: Response code. + - `Log (string)`: The output of the application's logger. May + be non-deterministic. + - `Info (string)`: Additional information. May + be non-deterministic. + - `Index (int64)`: The index of the key in the tree. + - `Key ([]byte)`: The key of the matching data. + - `Value ([]byte)`: The value of the matching data. + - `Proof ([]byte)`: Proof for the data, if requested. + - `Height (int64)`: The block height from which data was derived. + Note that this is the height of the block containing the + application's Merkle root hash, which represents the state as it + was after committing the block at Height-1 +- **Usage**: + - Query for data from the application at current or past height. + - Optionally return Merkle proof. + +### BeginBlock + +- **Request**: + - `Hash ([]byte)`: The block's hash. This can be derived from the + block header. + - `Header (struct{})`: The block header. + - `LastCommitInfo (LastCommitInfo)`: Info about the last commit, including the + round, and the list of validators and which ones signed the last block. + - `ByzantineValidators ([]Evidence)`: List of evidence of + validators that acted maliciously. +- **Response**: + - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing +- **Usage**: + - Signals the beginning of a new block. Called prior to + any DeliverTxs. + - The header contains the height, timestamp, and more - it exactly matches the + Tendermint block header. We may seek to generalize this in the future. + - The `LastCommitInfo` and `ByzantineValidators` can be used to determine + rewards and punishments for the validators. NOTE validators here do not + include pubkeys. + +### CheckTx + +- **Request**: + - `Tx ([]byte)`: The request transaction bytes +- **Response**: + - `Code (uint32)`: Response code + - `Data ([]byte)`: Result bytes, if any. + - `Log (string)`: The output of the application's logger. May + be non-deterministic. + - `Info (string)`: Additional information. May + be non-deterministic. + - `GasWanted (int64)`: Amount of gas request for transaction. + - `GasUsed (int64)`: Amount of gas consumed by transaction. + - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing + transactions (eg. by account). +- **Usage**: Validate a mempool transaction, prior to broadcasting + or proposing. CheckTx should perform stateful but light-weight + checks of the validity of the transaction (like checking signatures + and account balances), but need not execute in full (like running a + smart contract). + + Tendermint runs CheckTx and DeliverTx concurrently with eachother, + though on distinct ABCI connections - the mempool connection and the + consensus connection, respectively. + + The application should maintain a separate state to support CheckTx. + This state can be reset to the latest committed state during + `Commit`. Before calling Commit, Tendermint will lock and flush the mempool, + ensuring that all existing CheckTx are responded to and no new ones can + begin. After `Commit`, the mempool will rerun + CheckTx for all remaining transactions, throwing out any that are no longer valid. + Then the mempool will unlock and start sending CheckTx again. + + Keys and values in Tags must be UTF-8 encoded strings (e.g. + "account.owner": "Bob", "balance": "100.0", "date": "2018-01-02") + +### DeliverTx + +- **Request**: + - `Tx ([]byte)`: The request transaction bytes. +- **Response**: + - `Code (uint32)`: Response code. + - `Data ([]byte)`: Result bytes, if any. + - `Log (string)`: The output of the application's logger. May + be non-deterministic. + - `Info (string)`: Additional information. May + be non-deterministic. + - `GasWanted (int64)`: Amount of gas requested for transaction. + - `GasUsed (int64)`: Amount of gas consumed by transaction. + - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing + transactions (eg. by account). +- **Usage**: + - Deliver a transaction to be executed in full by the application. + If the transaction is valid, returns CodeType.OK. + - Keys and values in Tags must be UTF-8 encoded strings (e.g. + "account.owner": "Bob", "balance": "100.0", + "time": "2018-01-02T12:30:00Z") + +### EndBlock + +- **Request**: + - `Height (int64)`: Height of the block just executed. +- **Response**: + - `ValidatorUpdates ([]ValidatorUpdate)`: Changes to validator set (set + voting power to 0 to remove). + - `ConsensusParamUpdates (ConsensusParams)`: Changes to + consensus-critical time, size, and other parameters. + - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing +- **Usage**: + - Signals the end of a block. + - Called prior to each Commit, after all transactions. + - Validator updates returned for block H: + - apply to the NextValidatorsHash of block H+1 + - apply to the ValidatorsHash (and thus the validator set) for block H+2 + - apply to the RequestBeginBlock.LastCommitInfo (ie. the last validator set) for block H+3 + - Consensus params returned for block H apply for block H+1 + +### Commit + +- **Response**: + - `Data ([]byte)`: The Merkle root hash +- **Usage**: + - Persist the application state. + - Return a Merkle root hash of the application state. + - It's critical that all application instances return the + same hash. If not, they will not be able to agree on the next + block, because the hash is included in the next block! + +## Data Messages + +### Header + +- **Fields**: + - `ChainID (string)`: ID of the blockchain + - `Height (int64)`: Height of the block in the chain + - `Time (google.protobuf.Timestamp)`: Time of the block. It is the proposer's + local time when block was created. + - `NumTxs (int32)`: Number of transactions in the block + - `TotalTxs (int64)`: Total number of transactions in the blockchain until + now + - `LastBlockID (BlockID)`: Hash of the previous (parent) block + - `LastCommitHash ([]byte)`: Hash of the previous block's commit + - `ValidatorsHash ([]byte)`: Hash of the validator set for this block + - `NextValidatorsHash ([]byte)`: Hash of the validator set for the next block + - `ConsensusHash ([]byte)`: Hash of the consensus parameters for this block + - `AppHash ([]byte)`: Data returned by the last call to `Commit` - typically the + Merkle root of the application state after executing the previous block's + transactions + - `LastResultsHash ([]byte)`: Hash of the ABCI results returned by the last block + - `EvidenceHash ([]byte)`: Hash of the evidence included in this block + - `ProposerAddress ([]byte)`: Original proposer for the block +- **Usage**: + - Provided in RequestBeginBlock + - Provides important context about the current state of the blockchain - + especially height and time. + - Provides the proposer of the current block, for use in proposer-based + reward mechanisms. + +### Validator + +- **Fields**: + - `Address ([]byte)`: Address of the validator (hash of the public key) + - `Power (int64)`: Voting power of the validator +- **Usage**: + - Validator identified by address + - Used in RequestBeginBlock as part of VoteInfo + - Does not include PubKey to avoid sending potentially large quantum pubkeys + over the ABCI + +### ValidatorUpdate + +- **Fields**: + - `PubKey (PubKey)`: Public key of the validator + - `Power (int64)`: Voting power of the validator +- **Usage**: + - Validator identified by PubKey + - Used to tell Tendermint to update the validator set + +### VoteInfo + +- **Fields**: + - `Validator (Validator)`: A validator + - `SignedLastBlock (bool)`: Indicates whether or not the validator signed + the last block +- **Usage**: + - Indicates whether a validator signed the last block, allowing for rewards + based on validator availability + +### PubKey + +- **Fields**: + - `Type (string)`: Type of the public key. A simple string like `"ed25519"`. + In the future, may indicate a serialization algorithm to parse the `Data`, + for instance `"amino"`. + - `Data ([]byte)`: Public key data. For a simple public key, it's just the + raw bytes. If the `Type` indicates an encoding algorithm, this is the + encoded public key. +- **Usage**: + - A generic and extensible typed public key + +### Evidence + +- **Fields**: + - `Type (string)`: Type of the evidence. A hierarchical path like + "duplicate/vote". + - `Validator (Validator`: The offending validator + - `Height (int64)`: Height when the offense was committed + - `Time (google.protobuf.Timestamp)`: Time of the block at height `Height`. + It is the proposer's local time when block was created. + - `TotalVotingPower (int64)`: Total voting power of the validator set at + height `Height` + +### LastCommitInfo + +- **Fields**: + - `Round (int32)`: Commit round. + - `Votes ([]VoteInfo)`: List of validators addresses in the last validator set + with their voting power and whether or not they signed a vote. From 3fd54c5df5367eac08674185badb30ca94872d8d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 19:36:30 -0400 Subject: [PATCH 141/149] docs/spec/abci: update spec * better overview section * section on tags * remove notes about state/concurrency from CheckTx * incorporate feedback from #2249 * explain how validator set updates effect future blocks --- docs/spec/abci/abci.md | 144 +++++++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 64 deletions(-) diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md index f09cb1db..d2638f6c 100644 --- a/docs/spec/abci/abci.md +++ b/docs/spec/abci/abci.md @@ -1,56 +1,82 @@ -# ABCI Specification +# Application Blockchain Interface (ABCI) -## Message Types +## Overview -ABCI requests/responses are defined as simple Protobuf messages in [this -schema file](https://github.com/tendermint/tendermint/blob/master/abci/types/types.proto). -TendermintCore sends the requests, and the ABCI application sends the -responses. Here, we provide an overview of the messages types and how -they are used by Tendermint. Then we describe each request-response pair -as a function with arguments and return values, and add some notes on -usage. +ABCI is the interface between Tendermint (a state-machine replication engine) +and an application (the actual state machine). It consists of a set of +*methods*, where each method has a corresponding `Request` and `Response` type. +Tendermint calls the methods on the ABCI application by sending the `Request*` +messages and receiving the `Response*` messages in return. -Some messages (`Echo, Info, InitChain, BeginBlock, EndBlock, Commit`), +The ABCI message types are defined in a [protobuf +file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). + +ABCI methods are split across 3 separate ABCI *connections*: + +- `Consensus Connection: InitChain, BeginBlock, DeliverTx, EndBlock, Commit` +- `Mempool Connection: CheckTx` +- `Info Connection: Info, SetOption, Query` + +The `Consensus Connection` is driven by a consensus protocol and is responsible +for block exection. +The `Mempool Connection` is for validating new transactions, before they're +shared or included in a block. +The `Info Connection` is for initialization and for queries from the user. + +Additionally, there is a `Flush` method that is called on every connection, +and an `Echo` method that is just for debugging. + + +## Errors + +Some methods (`Echo, Info, InitChain, BeginBlock, EndBlock, Commit`), don't return errors because an error would indicate a critical failure in the application and there's nothing Tendermint can do. The problem should be addressed and both Tendermint and the application restarted. -All other messages (`SetOption, Query, CheckTx, DeliverTx`) return an +All other methods (`SetOption, Query, CheckTx, DeliverTx`) return an application-specific response `Code uint32`, where only `0` is reserved for `OK`. -Some messages (`SetOption, Query, CheckTx, DeliverTx`) return +## Tags + +Some methods (`CheckTx, BeginBlock, DeliverTx, EndBlock`) +include a `Tags` field in their `Response*`. Each tag is key-value pair denoting +something about what happened during the methods execution. + +Tags can be used to index transactions and blocks according to what happened +during their execution. + +Keys and values in tags must be UTF-8 encoded strings (e.g. +"account.owner": "Bob", "balance": "100.0", +"time": "2018-01-02T12:30:00Z") + +## Determinism + +Some methods (`SetOption, Query, CheckTx, DeliverTx`) return non-deterministic data in the form of `Info` and `Log`. The `Log` is intended for the literal output from the application's logger, while the `Info` is any additional info that should be returned. +All other fields in the `Response*` of all methods must be strictly deterministic. + +For this reason, it is recommended that applications not be exposed to any +external user or process except via the ABCI connections to a consensus engine +like Tendermint Core. + +## Block Execution + The first time a new blockchain is started, Tendermint calls -`InitChain`. From then on, the Block Execution Sequence that causes the -committed state to be updated is as follows: +`InitChain`. From then on, the follow sequence of methods is executed for each +block: `BeginBlock, [DeliverTx], EndBlock, Commit` where one `DeliverTx` is called for each transaction in the block. +The result is an updated application state. Cryptographic commitments to the results of DeliverTx, EndBlock, and Commit are included in the header of the next block. -Tendermint opens three connections to the application to handle the -different message types: - -- `Consensus Connection - InitChain, BeginBlock, DeliverTx, EndBlock, Commit` -- `Mempool Connection - CheckTx` -- `Info Connection - Info, SetOption, Query` - -The `Flush` message is used on every connection, and the `Echo` message -is only used for debugging. - -Note that messages may be sent concurrently across all connections -a -typical application will thus maintain a distinct state for each -connection. They may be referred to as the `DeliverTx state`, the -`CheckTx state`, and the `Commit state` respectively. - -See below for more details on the message types and how they are used. - -## Request/Response Messages +## Messages ### Echo @@ -198,26 +224,17 @@ See below for more details on the message types and how they are used. - `GasUsed (int64)`: Amount of gas consumed by transaction. - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). -- **Usage**: Validate a mempool transaction, prior to broadcasting - or proposing. CheckTx should perform stateful but light-weight - checks of the validity of the transaction (like checking signatures - and account balances), but need not execute in full (like running a - smart contract). - - Tendermint runs CheckTx and DeliverTx concurrently with eachother, - though on distinct ABCI connections - the mempool connection and the - consensus connection, respectively. - - The application should maintain a separate state to support CheckTx. - This state can be reset to the latest committed state during - `Commit`. Before calling Commit, Tendermint will lock and flush the mempool, - ensuring that all existing CheckTx are responded to and no new ones can - begin. After `Commit`, the mempool will rerun - CheckTx for all remaining transactions, throwing out any that are no longer valid. - Then the mempool will unlock and start sending CheckTx again. - - Keys and values in Tags must be UTF-8 encoded strings (e.g. - "account.owner": "Bob", "balance": "100.0", "date": "2018-01-02") +- **Usage**: + - Technically optional - not involved in processing blocks. + - Guardian of the mempool: every node runs CheckTx before letting a + transaction into its local mempool. + - The transaction may come from an external user or another node + - CheckTx need not execute the transaction in full, but rather a light-weight + yet stateful validation, like checking signatures and account balances, but + not running code in a virtual machine. + - Transactions where `ResponseCheckTx.Code != 0` will be rejected - they will not be broadcast to + other nodes or included in a proposal block. + - Tendermint attributes no other value to the response code ### DeliverTx @@ -235,11 +252,9 @@ See below for more details on the message types and how they are used. - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). - **Usage**: - - Deliver a transaction to be executed in full by the application. - If the transaction is valid, returns CodeType.OK. - - Keys and values in Tags must be UTF-8 encoded strings (e.g. - "account.owner": "Bob", "balance": "100.0", - "time": "2018-01-02T12:30:00Z") + - The workhorse of the application - non-optional. + - Execute the transaction in full. + - `ResponseDeliverTx.Code == 0` only if the transaction is fully valid. ### EndBlock @@ -253,12 +268,13 @@ See below for more details on the message types and how they are used. - `Tags ([]cmn.KVPair)`: Key-Value tags for filtering and indexing - **Usage**: - Signals the end of a block. - - Called prior to each Commit, after all transactions. - - Validator updates returned for block H: - - apply to the NextValidatorsHash of block H+1 - - apply to the ValidatorsHash (and thus the validator set) for block H+2 - - apply to the RequestBeginBlock.LastCommitInfo (ie. the last validator set) for block H+3 - - Consensus params returned for block H apply for block H+1 + - Called after all transactions, prior to each Commit. + - Validator updates returned by block `H` impact blocks `H+1`, `H+2`, and + `H+3`, but only effects changes on the validator set of `H+2`: + - `H+1`: NextValidatorsHash + - `H+2`: ValidatorsHash (and thus the validator set) + - `H+3`: LastCommitInfo (ie. the last validator set) + - Consensus params returned for block `H` apply for block `H+1` ### Commit @@ -271,7 +287,7 @@ See below for more details on the message types and how they are used. same hash. If not, they will not be able to agree on the next block, because the hash is included in the next block! -## Data Messages +## Data Types ### Header From 1144e72c61e839aff0813efe3282dfc70fbede07 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 20:51:36 -0400 Subject: [PATCH 142/149] docs: refactor ABCI docs * move spec/software/abci.md to spec/abci/apps.md and improve it * move some of app-dev/app-development.md to spec/abci/client-server.md --- docs/app-dev/app-development.md | 5 + docs/spec/abci/README.md | 19 +++ docs/spec/abci/abci.md | 9 +- docs/spec/abci/apps.md | 207 ++++++++++++++++++++++++++++++++ docs/spec/abci/client-server.md | 104 ++++++++++++++++ docs/spec/software/abci.md | 184 +--------------------------- 6 files changed, 337 insertions(+), 191 deletions(-) create mode 100644 docs/spec/abci/README.md create mode 100644 docs/spec/abci/apps.md create mode 100644 docs/spec/abci/client-server.md diff --git a/docs/app-dev/app-development.md b/docs/app-dev/app-development.md index 6c2ae9ab..3aaebb23 100644 --- a/docs/app-dev/app-development.md +++ b/docs/app-dev/app-development.md @@ -1,5 +1,10 @@ # Application Development Guide +## XXX + +This page is undergoing deprecation. All content is being moved to the new [home +of the ABCI specification](../spec/abci/README.md). + ## ABCI Design The purpose of ABCI is to provide a clean interface between state diff --git a/docs/spec/abci/README.md b/docs/spec/abci/README.md new file mode 100644 index 00000000..c0956db6 --- /dev/null +++ b/docs/spec/abci/README.md @@ -0,0 +1,19 @@ +# ABCI + +ABCI is the interface between Tendermint (a state-machine replication engine) +and an application (the actual state machine). It consists of a set of +*methods*, where each method has a corresponding `Request` and `Response` +message type. Tendermint calls the ABCI methods on the ABCI application by sending the `Request*` +messages and receiving the `Response*` messages in return. + +All message types are defined in a [protobuf file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). +This allows Tendermint to run applications written in any programming language. + +This specification is split as follows: + +- [Methods and Types](abci.md) - complete details on all ABCI methods and + message types +- [Applications](apps.md) - how to manage ABCI application state and other + details about building ABCI applications +- [Client and Server](client-server.md) - for those looking to implement their + own ABCI application servers diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md index d2638f6c..a1ca42f0 100644 --- a/docs/spec/abci/abci.md +++ b/docs/spec/abci/abci.md @@ -1,13 +1,7 @@ -# Application Blockchain Interface (ABCI) +# ABCI Methods and Types ## Overview -ABCI is the interface between Tendermint (a state-machine replication engine) -and an application (the actual state machine). It consists of a set of -*methods*, where each method has a corresponding `Request` and `Response` type. -Tendermint calls the methods on the ABCI application by sending the `Request*` -messages and receiving the `Response*` messages in return. - The ABCI message types are defined in a [protobuf file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). @@ -26,7 +20,6 @@ The `Info Connection` is for initialization and for queries from the user. Additionally, there is a `Flush` method that is called on every connection, and an `Echo` method that is just for debugging. - ## Errors Some methods (`Echo, Info, InitChain, BeginBlock, EndBlock, Commit`), diff --git a/docs/spec/abci/apps.md b/docs/spec/abci/apps.md new file mode 100644 index 00000000..fcba4735 --- /dev/null +++ b/docs/spec/abci/apps.md @@ -0,0 +1,207 @@ +# ABCI Applications + +Please ensure you've first read the spec for [ABCI Methods and Types](abci.md) + +Here we cover the following components of ABCI applications: + +- [State](#State) - the interplay between ABCI connections and application state + and the differences between `CheckTx` and `DeliverTx`. +- [Validator Set Updates](#Validator-Set-Updates) - how validator sets are + changed during `InitChain` and `EndBlock` +- [Query](#Query) - standards for using the `Query` method +- [Crash Recovery](#Crash-Recovery) - handshake protocol to synchronize + Tendermint and the application on startup. + +## State + +Since Tendermint maintains multiple concurrent ABCI connections, it is typical +for an application to maintain a distinct state for each, and for the states to +be sycnronized during `Commit`. + +### Commit + +Before `Commit` is called, Tendermint locks and flushes the mempool so that no new messages will +be received on the mempool connection. This provides an opportunity to safely update all three +states to the latest committed state at once. + +When `Commit` completes, it unlocks the mempool. + +Note that it is not possible to send transactions to Tendermint during `Commit` - if your app +tries to send a `/broadcast_tx` to Tendermint during Commit, it will deadlock. + +### Consensus Connection + +The Consensus Connection should maintain a `DeliverTxState` - +the working state for block execution. It should be updated by the calls to +`BeginBlock`, `DeliverTx`, and `EndBlock` during block execution and committed to +disk as the "latest committed state" during `Commit`. + +Updates made to the DeliverTxState by each method call must be readable by each subsequent method - +ie. the updates are linearizeable. + +### Mempool Connection + +The Mempool Connection should maintain a `CheckTxState` - +to process pending transactions in the mempool that have +not yet been committed. It should be initialized to the latest committed state +at the end of every `Commit`. Note it may be updated concurrently with the +DeliverTxState. + +Before calling `Commit`, Tendermint will lock and flush the mempool, +ensuring that all existing CheckTx are responded to and no new ones can +begin. + +After `Commit`, CheckTx is run again on all transactions that remain in the +node's local mempool after filtering those included in the block. To prevent the +mempool from rechecking all transactions every time a block is committed, set +the configuration option `mempool.recheck=false`. + +Finally, the mempool will unlock and new transactions can be processed through CheckTx again. + +Note that CheckTx doesn't have to check everything that affects transaction validity; the +expensive things can be skipped. In fact, CheckTx doesn't have to check +anything; it might say that any transaction is a valid transaction. +Unlike DeliverTx, CheckTx is just there as +a sort of weak filter to keep invalid transactions out of the blockchain. It's +weak, because a Byzantine node doesn't care about CheckTx; it can propose a +block full of invalid transactions if it wants. + +### Info Connection + +The Mempool Connection should maintain a `QueryState` for answering queries from the user, +and for initialization when Tendermint first starts up. +It should always contain the latest committed state associated with the +latest commited block. + +QueryState should be set to the latest `DeliverTxState` at the end of every `Commit`, +ie. after the full block has been processed and the state committed to disk. +Otherwise it should never be modified. + +## Validator Updates + +### EndBlock + +Updates to the Tendermint validator set can be made by returning +`ValidatorUpdate` objects in the `ResponseEndBlock`: + +``` +message ValidatorUpdate { + PubKey pub_key + int64 power +} + +message PubKey { + string type + bytes data +} +``` + +The `pub_key` currently supports only one type: + +- `type = "ed25519" and`data = ` + +The `power` is the new voting power for the validator, with the +following rules: + +- power must be non-negative +- if power is 0, the validator must already exist, and will be removed from the + validator set +- if power is non-0: + - if the validator does not already exist, it will be added to the validator + set with the given power + - if the validator does already exist, its power will be adjusted to the given power + +### InitChain + +ResponseInitChain has the option to return a list of validators. +If the list is not empty, Tendermint will adopt it for the validator set. +This way the application can determine the initial validator set for the +blockchain. + +ResponseInitChain also includes ConsensusParams, but these are presently +ignored. + +## Query + +Query is a generic message type with lots of flexibility to enable diverse sets +of queries from applications. Tendermint has no requirements from the Query +message for normal operation - that is, the ABCI app developer need not implement Query functionality if they do not wish too. +That said, Tendermint makes a number of queries to support some optional +features. These are: + +### Peer Filtering + +When Tendermint connects to a peer, it sends two queries to the ABCI application +using the following paths, with no additional data: + +- `/p2p/filter/addr/`, where `` denote the IP address and + the port of the connection +- `p2p/filter/id/`, where `` is the peer node ID (ie. the + pubkey.Address() for the peer's PubKey) + +If either of these queries return a non-zero ABCI code, Tendermint will refuse +to connect to the peer. + + +## Crash Recovery + +On startup, Tendermint calls the `Info` method on the Info Connection to get the latest +committed state of the app. The app MUST return information consistent with the +last block it succesfully completed Commit for. + +If the app succesfully committed block H but not H+1, then `last_block_height = H` and `last_block_app_hash = `. If the app +failed during the Commit of block H, then `last_block_height = H-1` and +`last_block_app_hash = `. + +We now distinguish three heights, and describe how Tendermint syncs itself with +the app. + +``` +storeBlockHeight = height of the last block Tendermint saw a commit for +stateBlockHeight = height of the last block for which Tendermint completed all + block processing and saved all ABCI results to disk +appBlockHeight = height of the last block for which ABCI app succesfully + completely Commit +``` + +Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight` +Note also we never call Commit on an ABCI app twice for the same height. + +The procedure is as follows. + +First, some simeple start conditions: + +If `appBlockHeight == 0`, then call InitChain. + +If `storeBlockHeight == 0`, we're done. + +Now, some sanity checks: + +If `storeBlockHeight < appBlockHeight`, error +If `storeBlockHeight < stateBlockHeight`, panic +If `storeBlockHeight > stateBlockHeight+1`, panic + +Now, the meat: + +If `storeBlockHeight == stateBlockHeight && appBlockHeight < storeBlockHeight`, +replay all blocks in full from `appBlockHeight` to `storeBlockHeight`. +This happens if we completed processing the block, but the app forgot its height. + +If `storeBlockHeight == stateBlockHeight && appBlockHeight == storeBlockHeight`, we're done +This happens if we crashed at an opportune spot. + +If `storeBlockHeight == stateBlockHeight+1` +This happens if we started processing the block but didn't finish. + + If `appBlockHeight < stateBlockHeight` + replay all blocks in full from `appBlockHeight` to `storeBlockHeight-1`, + and replay the block at `storeBlockHeight` using the WAL. + This happens if the app forgot the last block it committed. + + If `appBlockHeight == stateBlockHeight`, + replay the last block (storeBlockHeight) in full. + This happens if we crashed before the app finished Commit + + If appBlockHeight == storeBlockHeight { + update the state using the saved ABCI responses but dont run the block against the real app. + This happens if we crashed after the app finished Commit but before Tendermint saved the state. diff --git a/docs/spec/abci/client-server.md b/docs/spec/abci/client-server.md new file mode 100644 index 00000000..1923b5e0 --- /dev/null +++ b/docs/spec/abci/client-server.md @@ -0,0 +1,104 @@ +# ABCI Client and Server + +This section is for those looking to implement their own ABCI Server, perhaps in +a new programming language. + +You are expected to have read [ABCI Methods and Types](abci.md) and [ABCI +Applications](apps.md). + +See additional details in the [ABCI +readme](https://github.com/tendermint/tendermint/blob/develop/abci/README.md)(TODO: deduplicate +those details). + +## Message Protocol + +The message protocol consists of pairs of requests and responses defined in the +[protobuf file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). + +Some messages have no fields, while others may include byte-arrays, strings, integers, +or custom protobuf types. + +For more details on protobuf, see the [documentation](https://developers.google.com/protocol-buffers/docs/overview). + +For each request, a server should respond with the corresponding +response, where the order of requests is preserved in the order of +responses. + +## Server + +To use ABCI in your programming language of choice, there must be a ABCI +server in that language. Tendermint supports two kinds of implementation +of the server: + +- Asynchronous, raw socket server (Tendermint Socket Protocol, also + known as TSP or Teaspoon) +- GRPC + +Both can be tested using the `abci-cli` by setting the `--abci` flag +appropriately (ie. to `socket` or `grpc`). + +See examples, in various stages of maintenance, in +[Go](https://github.com/tendermint/tendermint/tree/develop/abci/server), +[JavaScript](https://github.com/tendermint/js-abci), +[Python](https://github.com/tendermint/tendermint/tree/develop/abci/example/python3/abci), +[C++](https://github.com/mdyring/cpp-tmsp), and +[Java](https://github.com/jTendermint/jabci). + +### GRPC + +If GRPC is available in your language, this is the easiest approach, +though it will have significant performance overhead. + +To get started with GRPC, copy in the [protobuf +file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto) +and compile it using the GRPC plugin for your language. For instance, +for golang, the command is `protoc --go_out=plugins=grpc:. types.proto`. +See the [grpc documentation for more details](http://www.grpc.io/docs/). +`protoc` will autogenerate all the necessary code for ABCI client and +server in your language, including whatever interface your application +must satisfy to be used by the ABCI server for handling requests. + +### TSP + +If GRPC is not available in your language, or you require higher +performance, or otherwise enjoy programming, you may implement your own +ABCI server using the Tendermint Socket Protocol, known affectionately +as Teaspoon. The first step is still to auto-generate the relevant data +types and codec in your language using `protoc`. Messages coming over +the socket are proto3 encoded, but additionally length-prefixed to +facilitate use as a streaming protocol. proto3 doesn't have an +official length-prefix standard, so we use our own. The first byte in +the prefix represents the length of the Big Endian encoded length. The +remaining bytes in the prefix are the Big Endian encoded length. + +For example, if the proto3 encoded ABCI message is 0xDEADBEEF (4 +bytes), the length-prefixed message is 0x0104DEADBEEF. If the proto3 +encoded ABCI message is 65535 bytes long, the length-prefixed message +would be like 0x02FFFF.... + +Note this prefixing does not apply for grpc. + +An ABCI server must also be able to support multiple connections, as +Tendermint uses three connections. + + +### Async vs Sync + +The main ABCI server (ie. non-GRPC) provides ordered asynchronous messages. +This is useful for DeliverTx and CheckTx, since it allows Tendermint to forward +transactions to the app before it's finished processing previous ones. + +Thus, DeliverTx and CheckTx messages are sent asycnhronously, while all other +messages are sent synchronously. + +## Client + +There are currently two use-cases for an ABCI client. One is a testing +tool, as in the `abci-cli`, which allows ABCI requests to be sent via +command line. The other is a consensus engine, such as Tendermint Core, +which makes requests to the application every time a new transaction is +received or a block is committed. + +It is unlikely that you will need to implement a client. For details of +our client, see +[here](https://github.com/tendermint/tendermint/tree/develop/abci/client). diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index aacdb43d..44d48f17 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -1,185 +1,3 @@ # Application Blockchain Interface (ABCI) -ABCI is the interface between Tendermint (a state-machine replication engine) -and an application (the actual state machine). - -The ABCI message types are defined in a [protobuf -file](https://github.com/tendermint/tendermint/blob/develop/abci/types/types.proto). - -For full details on the ABCI message types and protocol, see the [ABCI -specification](https://github.com/tendermint/tendermint/blob/develop/docs/app-dev/abci-spec.md). -Be sure to read the specification if you're trying to build an ABCI app! - -For additional details on server implementation, see the [ABCI -readme](https://github.com/tendermint/tendermint/blob/develop/abci/README.md). - -Here we provide some more details around the use of ABCI by Tendermint and -clarify common "gotchas". - -## ABCI connections - -Tendermint opens 3 ABCI connections to the app: one for Consensus, one for -Mempool, one for Queries. - -## Async vs Sync - -The main ABCI server (ie. non-GRPC) provides ordered asynchronous messages. -This is useful for DeliverTx and CheckTx, since it allows Tendermint to forward -transactions to the app before it's finished processing previous ones. - -Thus, DeliverTx and CheckTx messages are sent asycnhronously, while all other -messages are sent synchronously. - -## CheckTx and Commit - -It is typical to hold three distinct states in an ABCI app: CheckTxState, DeliverTxState, -QueryState. The QueryState contains the latest committed state for a block. -The CheckTxState and DeliverTxState may be updated concurrently with one another. -Before Commit is called, Tendermint locks and flushes the mempool so that no new changes will happen -to CheckTxState. When Commit completes, it unlocks the mempool. - -Thus, during Commit, it is safe to reset the QueryState and the CheckTxState to the latest DeliverTxState -(ie. the new state from executing all the txs in the block). - -Note, however, that it is not possible to send transactions to Tendermint during Commit - if your app -tries to send a `/broadcast_tx` to Tendermint during Commit, it will deadlock. - -## EndBlock Validator Updates - -Updates to the Tendermint validator set can be made by returning `Validator` -objects in the `ResponseBeginBlock`: - -``` -message Validator { - PubKey pub_key - int64 power -} - -message PubKey { - string type - bytes data -} -``` - -The `pub_key` currently supports two types: - -- `type = "ed25519" and`data = ` -- `type = "secp256k1" and `data = <33-byte OpenSSL compressed public key>` - -If the address is provided, it must match the address of the pubkey, as -specified [here](/docs/spec/blockchain/encoding.md#Addresses) - -(Note: In the v0.19 series, the `pub_key` is the [Amino encoded public -key](/docs/spec/blockchain/encoding.md#public-key-cryptography). -For Ed25519 pubkeys, the Amino prefix is always "1624DE6220". For example, the 32-byte Ed25519 pubkey -`76852933A4686A721442E931A8415F62F5F1AEDF4910F1F252FB393F74C40C85` would be -Amino encoded as -`1624DE622076852933A4686A721442E931A8415F62F5F1AEDF4910F1F252FB393F74C40C85`) - -(Note: In old versions of Tendermint (pre-v0.19.0), the pubkey is just prefixed with a -single type byte, so for ED25519 we'd have `pub_key = 0x1 | pub`) - -The `power` is the new voting power for the validator, with the -following rules: - -- power must be non-negative -- if power is 0, the validator must already exist, and will be removed from the - validator set -- if power is non-0: - - if the validator does not already exist, it will be added to the validator - set with the given power - - if the validator does already exist, its power will be adjusted to the given power - -## InitChain Validator Updates - -ResponseInitChain has the option to return a list of validators. -If the list is not empty, Tendermint will adopt it for the validator set. -This way the application can determine the initial validator set for the -blockchain. - -ResponseInitChain also includes ConsensusParams, but these are presently -ignored. - -## Query - -Query is a generic message type with lots of flexibility to enable diverse sets -of queries from applications. Tendermint has no requirements from the Query -message for normal operation - that is, the ABCI app developer need not implement Query functionality if they do not wish too. -That said, Tendermint makes a number of queries to support some optional -features. These are: - -### Peer Filtering - -When Tendermint connects to a peer, it sends two queries to the ABCI application -using the following paths, with no additional data: - -- `/p2p/filter/addr/`, where `` denote the IP address and - the port of the connection -- `p2p/filter/id/`, where `` is the peer node ID (ie. the - pubkey.Address() for the peer's PubKey) - -If either of these queries return a non-zero ABCI code, Tendermint will refuse -to connect to the peer. - -## Info and the Handshake/Replay - -On startup, Tendermint calls Info on the Query connection to get the latest -committed state of the app. The app MUST return information consistent with the -last block it succesfully completed Commit for. - -If the app succesfully committed block H but not H+1, then `last_block_height = H` and `last_block_app_hash = `. If the app -failed during the Commit of block H, then `last_block_height = H-1` and -`last_block_app_hash = `. - -We now distinguish three heights, and describe how Tendermint syncs itself with -the app. - -``` -storeBlockHeight = height of the last block Tendermint saw a commit for -stateBlockHeight = height of the last block for which Tendermint completed all - block processing and saved all ABCI results to disk -appBlockHeight = height of the last block for which ABCI app succesfully - completely Commit -``` - -Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight` -Note also we never call Commit on an ABCI app twice for the same height. - -The procedure is as follows. - -First, some simeple start conditions: - -If `appBlockHeight == 0`, then call InitChain. - -If `storeBlockHeight == 0`, we're done. - -Now, some sanity checks: - -If `storeBlockHeight < appBlockHeight`, error -If `storeBlockHeight < stateBlockHeight`, panic -If `storeBlockHeight > stateBlockHeight+1`, panic - -Now, the meat: - -If `storeBlockHeight == stateBlockHeight && appBlockHeight < storeBlockHeight`, -replay all blocks in full from `appBlockHeight` to `storeBlockHeight`. -This happens if we completed processing the block, but the app forgot its height. - -If `storeBlockHeight == stateBlockHeight && appBlockHeight == storeBlockHeight`, we're done -This happens if we crashed at an opportune spot. - -If `storeBlockHeight == stateBlockHeight+1` -This happens if we started processing the block but didn't finish. - - If `appBlockHeight < stateBlockHeight` - replay all blocks in full from `appBlockHeight` to `storeBlockHeight-1`, - and replay the block at `storeBlockHeight` using the WAL. - This happens if the app forgot the last block it committed. - - If `appBlockHeight == stateBlockHeight`, - replay the last block (storeBlockHeight) in full. - This happens if we crashed before the app finished Commit - - If appBlockHeight == storeBlockHeight { - update the state using the saved ABCI responses but dont run the block against the real app. - This happens if we crashed after the app finished Commit but before Tendermint saved the state. +This page has [moved](../spec/abci/apps.md). From 114c4051209f449dc365ac4e8123ce0a343d5904 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 22:17:00 -0400 Subject: [PATCH 143/149] docs/spec/abci: fixes and more from #2249 --- docs/spec/abci/abci.md | 3 ++ docs/spec/abci/apps.md | 92 +++++++++++++++++++++++++++++++++--------- 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md index a1ca42f0..17d0a1ef 100644 --- a/docs/spec/abci/abci.md +++ b/docs/spec/abci/abci.md @@ -20,6 +20,9 @@ The `Info Connection` is for initialization and for queries from the user. Additionally, there is a `Flush` method that is called on every connection, and an `Echo` method that is just for debugging. +More details on managing state across connections can be found in the section on +[ABCI Applications](apps.md). + ## Errors Some methods (`Echo, Info, InitChain, BeginBlock, EndBlock, Commit`), diff --git a/docs/spec/abci/apps.md b/docs/spec/abci/apps.md index fcba4735..84cd3431 100644 --- a/docs/spec/abci/apps.md +++ b/docs/spec/abci/apps.md @@ -4,12 +4,14 @@ Please ensure you've first read the spec for [ABCI Methods and Types](abci.md) Here we cover the following components of ABCI applications: -- [State](#State) - the interplay between ABCI connections and application state +- [State](#state) - the interplay between ABCI connections and application state and the differences between `CheckTx` and `DeliverTx`. -- [Validator Set Updates](#Validator-Set-Updates) - how validator sets are +- [Transaction Results](#transaction-results) - rules around transaction + results and validity +- [Validator Set Updates](#validator-updates) - how validator sets are changed during `InitChain` and `EndBlock` -- [Query](#Query) - standards for using the `Query` method -- [Crash Recovery](#Crash-Recovery) - handshake protocol to synchronize +- [Query](#query) - standards for using the `Query` method +- [Crash Recovery](#crash-recovery) - handshake protocol to synchronize Tendermint and the application on startup. ## State @@ -20,6 +22,8 @@ be sycnronized during `Commit`. ### Commit +Application state should only be persisted to disk during `Commit`. + Before `Commit` is called, Tendermint locks and flushes the mempool so that no new messages will be received on the mempool connection. This provides an opportunity to safely update all three states to the latest committed state at once. @@ -41,13 +45,14 @@ ie. the updates are linearizeable. ### Mempool Connection -The Mempool Connection should maintain a `CheckTxState` - -to process pending transactions in the mempool that have +The Mempool Connection should maintain a `CheckTxState` +to sequentially process pending transactions in the mempool that have not yet been committed. It should be initialized to the latest committed state -at the end of every `Commit`. Note it may be updated concurrently with the -DeliverTxState. +at the end of every `Commit`. -Before calling `Commit`, Tendermint will lock and flush the mempool, +The CheckTxState may be updated concurrently with the DeliverTxState, as +messages may be sent concurrently on the Consensus and Mempool connections. However, +before calling `Commit`, Tendermint will lock and flush the mempool connection, ensuring that all existing CheckTx are responded to and no new ones can begin. @@ -77,8 +82,67 @@ QueryState should be set to the latest `DeliverTxState` at the end of every `Com ie. after the full block has been processed and the state committed to disk. Otherwise it should never be modified. +## Transaction Results + +`ResponseCheckTx` and `ResponseDeliverTx` contain the same fields, though they +have slightly different effects. + +In both cases, `Info` and `Log` are non-deterministic values for debugging/convenience purposes +that are otherwise ignored. + +In both cases, `GasWanted` and `GasUsed` parameters are currently ignored, +though see issues +[#1861](https://github.com/tendermint/tendermint/issues/1861), +[#2299](https://github.com/tendermint/tendermint/issues/2299) and +[#2310](https://github.com/tendermint/tendermint/issues/2310) for how this may +change. + +## CheckTx + +If `Code != 0`, it will be rejected from the mempool and hence +not broadcasted to other peers and not included in a proposal block. + +`Data` contains the result of the CheckTx transaction execution, if any. It is +semantically meaningless to Tendermint. + +`Tags` include any tags for the execution, though since the transaction has not +been committed yet, they are effectively ignored by Tendermint. + +## DeliverTx + +If DeliverTx returns `Code != 0`, the transaction will be considered invalid, +though it is still included in the block. + +`Data` contains the result of the CheckTx transaction execution, if any. It is +semantically meaningless to Tendermint. + +Both the `Code` and `Data` are included in a structure that is hashed into the +`LastResultsHash` of the next block header. + +`Tags` include any tags for the execution, which Tendermint will use to index +the transaction by. This allows transactions to be queried according to what +events took place during their execution. + +See issue [#1007](https://github.com/tendermint/tendermint/issues/1007) for how +the tags will be hashed into the next block header. + ## Validator Updates +The application may set the validator set during InitChain, and update it during +EndBlock. + +### InitChain + +ResponseInitChain can return a list of validators. +If the list is empty, Tendermint will use the validators loaded in the genesis +file. +If the list is not empty, Tendermint will use it for the validator set. +This way the application can determine the initial validator set for the +blockchain. + +ResponseInitChain also includes ConsensusParams, but these are presently +ignored. + ### EndBlock Updates to the Tendermint validator set can be made by returning @@ -111,15 +175,7 @@ following rules: set with the given power - if the validator does already exist, its power will be adjusted to the given power -### InitChain - -ResponseInitChain has the option to return a list of validators. -If the list is not empty, Tendermint will adopt it for the validator set. -This way the application can determine the initial validator set for the -blockchain. - -ResponseInitChain also includes ConsensusParams, but these are presently -ignored. +Note the updates returned in block `H` will only take effect at block `H+2`. ## Query From 5106af484f3bfe74eaec51aa38a85ea8cf6d8986 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 22:18:15 -0400 Subject: [PATCH 144/149] docs: add abci spec to config.js --- docs/config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/config.js b/docs/config.js index 09d0112e..a006a075 100644 --- a/docs/config.js +++ b/docs/config.js @@ -63,6 +63,15 @@ module.exports = { "/app-dev/ecosystem" ] }, + { + title: "ABCI Specification", + collapsable: false, + children: [ + "/spec/abci/abci", + "/spec/abci/apps", + "/spec/abci/client-server" + ] + }, { title: "Research", collapsable: false, From 299d46304decdf9eb68225e7e6615b2fa7ae1ba2 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 22:35:31 -0400 Subject: [PATCH 145/149] update UPGRADING.md and minor docs fixes --- CHANGELOG.md | 13 ++++++++++--- UPGRADING.md | 38 ++++++++++++++++++++++++++++++++++---- docs/spec/software/abci.md | 2 +- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14615ab1..726ca9ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,13 @@ peerlink, Ahmah2009, bluele, b00f. This release includes breaking upgrades in the block header, including the long awaited changes for delaying validator set updates by one -block. It also fixes enforcement on the max size of blocks, and includes a BFT -timestamp in each block that can be safely used by applications. There are also some -minor breaking changes to the rpc, config, and ABCI. +block to better support light clients. +It also fixes enforcement on the maximum size of blocks, and includes a BFT +timestamp in each block that can be safely used by applications. +There are also some minor breaking changes to the rpc, config, and ABCI. + +See the [UPGRADING.md](UPGRADING.md#v0.24.0) for details on upgrading to the new +version. From here on, breaking changes will be broken down to better reflect how users are affected by a change. @@ -20,6 +24,8 @@ A few more breaking changes are in the works - each will come with a clear Architecture Decision Record (ADR) explaining the change. You can review ADRs [here](https://github.com/tendermint/tendermint/tree/develop/docs/architecture) or in the [open Pull Requests](https://github.com/tendermint/tendermint/pulls). +You can also check in on the [issues marked as +breaking](https://github.com/tendermint/tendermint/issues?q=is%3Aopen+is%3Aissue+label%3Abreaking). BREAKING CHANGES: @@ -84,6 +90,7 @@ FEATURES: IMPROVEMENTS: - [docs] Lint documentation with `write-good` and `stop-words`. +- [docs] [\#2249](https://github.com/tendermint/tendermint/issues/2249) Refactor, deduplicate, and improve the ABCI docs and spec (with thanks to @ttmc). - [scripts] [\#2196](https://github.com/tendermint/tendermint/issues/2196) Added json2wal tool, which is supposed to help our users restore (@bradyjoestar) corrupted WAL files and compose test WAL files (@bradyjoestar) - [mempool] [\#2234](https://github.com/tendermint/tendermint/issues/2234) Now stores txs by hash inside of the cache, to mitigate memory leakage diff --git a/UPGRADING.md b/UPGRADING.md index a290d57d..66a78295 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -3,10 +3,11 @@ This guide provides steps to be followed when you upgrade your applications to a newer version of Tendermint Core. -## Upgrading from 0.23.0 to 0.24.0 +## v0.24.0 New 0.24.0 release contains a lot of changes to the state and types. It's not -compatible to the old versions. +compatible to the old versions and there is no straight forward way to update +old data to be compatible with the new version. To reset the state do: @@ -14,10 +15,12 @@ To reset the state do: $ tendermint unsafe_reset_all ``` +Here we summarize some other notable changes to be mindful of. + ### Config changes `p2p.max_num_peers` was removed in favor of `p2p.max_num_inbound_peers` and -`p2p.max_num_outbound_peers`. +`p2p.max_num_outbound_peers`. ``` # Maximum number of inbound peers @@ -28,5 +31,32 @@ max_num_outbound_peers = 10 ``` As you can see, the default ratio of inbound/outbound peers is 4/1. The reason -as we want it to be easier for new nodes to connect to the network. You can +is we want it to be easier for new nodes to connect to the network. You can tweak these parameters to alter the network topology. + +### RPC Changes + +The result of `/commit` used to contain `header` and `commit` fields at the top level. These are now contained under the `signed_header` field. + +### ABCI Changes + +The header has been upgraded and contains new fields, but none of the existing +fields were changed, except their order. + +The `Validator` type was split into two, one containing an `Address` and one +containing a `PubKey`. When processing `RequestBeginBlock`, use the `Validator` +type, which contains just the `Address`. When returning `ResponseEndBlock`, use +the `ValidatorUpdate` type, which contains just the `PubKey`. + +### Validator Set Updates + +Validator set updates returned in ResponseEndBlock for height `H` used to take +effect immediately at height `H+1`. Now they will be delayed one block, to take +effect at height `H+2`. Note this means that the change will be seen by the ABCI +app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. + +### Block Size + +The `ConsensusParams.BlockSize.MaxTxs` was removed in favour of +`ConsensusParams.BlockSize.MaxBytes`, which is now enforced. This means blocks +are limitted only by byte-size, not by number of transactions. diff --git a/docs/spec/software/abci.md b/docs/spec/software/abci.md index 44d48f17..6e17089f 100644 --- a/docs/spec/software/abci.md +++ b/docs/spec/software/abci.md @@ -1,3 +1,3 @@ # Application Blockchain Interface (ABCI) -This page has [moved](../spec/abci/apps.md). +This page has [moved](../abci/apps.md). From 94288006baadc2debff6354596d87d4804ada96a Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 6 Sep 2018 22:47:05 -0400 Subject: [PATCH 146/149] minor fixes --- docs/spec/abci/abci.md | 2 +- docs/spec/abci/apps.md | 11 ++++++----- docs/spec/abci/client-server.md | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md index 17d0a1ef..0637ab30 100644 --- a/docs/spec/abci/abci.md +++ b/docs/spec/abci/abci.md @@ -1,4 +1,4 @@ -# ABCI Methods and Types +# Methods and Types ## Overview diff --git a/docs/spec/abci/apps.md b/docs/spec/abci/apps.md index 84cd3431..1bc36a49 100644 --- a/docs/spec/abci/apps.md +++ b/docs/spec/abci/apps.md @@ -1,4 +1,4 @@ -# ABCI Applications +# Applications Please ensure you've first read the spec for [ABCI Methods and Types](abci.md) @@ -73,8 +73,9 @@ block full of invalid transactions if it wants. ### Info Connection -The Mempool Connection should maintain a `QueryState` for answering queries from the user, -and for initialization when Tendermint first starts up. +The Info Connection should maintain a `QueryState` for answering queries from the user, +and for initialization when Tendermint first starts up (both described further +below). It should always contain the latest committed state associated with the latest commited block. @@ -97,7 +98,7 @@ though see issues [#2310](https://github.com/tendermint/tendermint/issues/2310) for how this may change. -## CheckTx +### CheckTx If `Code != 0`, it will be rejected from the mempool and hence not broadcasted to other peers and not included in a proposal block. @@ -108,7 +109,7 @@ semantically meaningless to Tendermint. `Tags` include any tags for the execution, though since the transaction has not been committed yet, they are effectively ignored by Tendermint. -## DeliverTx +### DeliverTx If DeliverTx returns `Code != 0`, the transaction will be considered invalid, though it is still included in the block. diff --git a/docs/spec/abci/client-server.md b/docs/spec/abci/client-server.md index 1923b5e0..36b6faf3 100644 --- a/docs/spec/abci/client-server.md +++ b/docs/spec/abci/client-server.md @@ -1,4 +1,4 @@ -# ABCI Client and Server +# Client and Server This section is for those looking to implement their own ABCI Server, perhaps in a new programming language. From 47dc4e64280cebf4a5da73ab0a02056bfa1ce7ff Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 7 Sep 2018 11:40:16 +0400 Subject: [PATCH 147/149] fix a few typos in spec --- docs/spec/abci/abci.md | 2 +- docs/spec/abci/apps.md | 10 +++++----- docs/spec/abci/client-server.md | 2 +- docs/spec/blockchain/state.md | 4 ++-- docs/spec/p2p/peer.md | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/spec/abci/abci.md b/docs/spec/abci/abci.md index 17d0a1ef..ccf6bf30 100644 --- a/docs/spec/abci/abci.md +++ b/docs/spec/abci/abci.md @@ -12,7 +12,7 @@ ABCI methods are split across 3 separate ABCI *connections*: - `Info Connection: Info, SetOption, Query` The `Consensus Connection` is driven by a consensus protocol and is responsible -for block exection. +for block execution. The `Mempool Connection` is for validating new transactions, before they're shared or included in a block. The `Info Connection` is for initialization and for queries from the user. diff --git a/docs/spec/abci/apps.md b/docs/spec/abci/apps.md index 84cd3431..2fbfa30c 100644 --- a/docs/spec/abci/apps.md +++ b/docs/spec/abci/apps.md @@ -18,7 +18,7 @@ Here we cover the following components of ABCI applications: Since Tendermint maintains multiple concurrent ABCI connections, it is typical for an application to maintain a distinct state for each, and for the states to -be sycnronized during `Commit`. +be synchronized during `Commit`. ### Commit @@ -41,7 +41,7 @@ the working state for block execution. It should be updated by the calls to disk as the "latest committed state" during `Commit`. Updates made to the DeliverTxState by each method call must be readable by each subsequent method - -ie. the updates are linearizeable. +ie. the updates are linearizable. ### Mempool Connection @@ -76,7 +76,7 @@ block full of invalid transactions if it wants. The Mempool Connection should maintain a `QueryState` for answering queries from the user, and for initialization when Tendermint first starts up. It should always contain the latest committed state associated with the -latest commited block. +latest committed block. QueryState should be set to the latest `DeliverTxState` at the end of every `Commit`, ie. after the full block has been processed and the state committed to disk. @@ -217,7 +217,7 @@ storeBlockHeight = height of the last block Tendermint saw a commit for stateBlockHeight = height of the last block for which Tendermint completed all block processing and saved all ABCI results to disk appBlockHeight = height of the last block for which ABCI app succesfully - completely Commit + completed Commit ``` Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight` @@ -225,7 +225,7 @@ Note also we never call Commit on an ABCI app twice for the same height. The procedure is as follows. -First, some simeple start conditions: +First, some simple start conditions: If `appBlockHeight == 0`, then call InitChain. diff --git a/docs/spec/abci/client-server.md b/docs/spec/abci/client-server.md index 1923b5e0..f88ac6c4 100644 --- a/docs/spec/abci/client-server.md +++ b/docs/spec/abci/client-server.md @@ -88,7 +88,7 @@ The main ABCI server (ie. non-GRPC) provides ordered asynchronous messages. This is useful for DeliverTx and CheckTx, since it allows Tendermint to forward transactions to the app before it's finished processing previous ones. -Thus, DeliverTx and CheckTx messages are sent asycnhronously, while all other +Thus, DeliverTx and CheckTx messages are sent asynchronously, while all other messages are sent synchronously. ## Client diff --git a/docs/spec/blockchain/state.md b/docs/spec/blockchain/state.md index 3bad68bd..e9da53b5 100644 --- a/docs/spec/blockchain/state.md +++ b/docs/spec/blockchain/state.md @@ -104,11 +104,11 @@ type EvidenceParams struct { #### BlockSize -The total size of a block is limitted in bytes by the `ConsensusParams.BlockSize.MaxBytes`. +The total size of a block is limited in bytes by the `ConsensusParams.BlockSize.MaxBytes`. Proposed blocks must be less than this size, and will be considered invalid otherwise. -Blocks should additionally be limitted by the amount of "gas" consumed by the +Blocks should additionally be limited by the amount of "gas" consumed by the transactions in the block, though this is not yet implemented. #### TxSize diff --git a/docs/spec/p2p/peer.md b/docs/spec/p2p/peer.md index f9d2d8bc..116fec4f 100644 --- a/docs/spec/p2p/peer.md +++ b/docs/spec/p2p/peer.md @@ -40,7 +40,7 @@ It goes as follows: - get 96 bytes of output from hkdf-sha256 - if we had the smaller ephemeral pubkey, use the first 32 bytes for the key for receiving, the second 32 bytes for sending; else the opposite - use the last 32 bytes of output for the challenge -- use a seperate nonce for receiving and sending. Both nonces start at 0, and should support the full 96 bit nonce range +- use a separate nonce for receiving and sending. Both nonces start at 0, and should support the full 96 bit nonce range - all communications from now on are encrypted in 1024 byte frames, using the respective secret and nonce. Each nonce is incremented by one after each use. - we now have an encrypted channel, but still need to authenticate From 4cd2e40fb19162996fa9be1b0770633ff0b9fd12 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 7 Sep 2018 07:28:58 -0400 Subject: [PATCH 148/149] TMBIN -> Amino --- docs/spec/blockchain/blockchain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/blockchain/blockchain.md b/docs/spec/blockchain/blockchain.md index c24d2e10..795a2292 100644 --- a/docs/spec/blockchain/blockchain.md +++ b/docs/spec/blockchain/blockchain.md @@ -400,7 +400,7 @@ must be greater than 2/3 of the total voting power of the complete validator set ### Vote A vote is a signed message broadcast in the consensus for a particular block at a particular height and round. -When stored in the blockchain or propagated over the network, votes are encoded in TMBIN. +When stored in the blockchain or propagated over the network, votes are encoded in Amino. For signing, votes are encoded in JSON, and the ChainID is included, in the form of the `CanonicalSignBytes`. We define a method `Verify` that returns `true` if the signature verifies against the pubkey for the CanonicalSignBytes From c8895dab984ec50eef90d280db758cf6b3b49943 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 7 Sep 2018 07:43:22 -0400 Subject: [PATCH 149/149] minor note in UPGRADING.md --- UPGRADING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index 66a78295..16e397b2 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -53,7 +53,11 @@ the `ValidatorUpdate` type, which contains just the `PubKey`. Validator set updates returned in ResponseEndBlock for height `H` used to take effect immediately at height `H+1`. Now they will be delayed one block, to take effect at height `H+2`. Note this means that the change will be seen by the ABCI -app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. +app in the `RequestBeginBlock.LastCommitInfo` at block `H+3`. Apps were already +required to maintain a map from validator addresses to pubkeys since v0.23 (when +pubkeys were removed from RequestBeginBlock), but now they may need to track +multiple validator sets at once to accomodate this delay. + ### Block Size