Commit 6904435a authored by caopingcp's avatar caopingcp

tendermint save local state

parent 91390fe4
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"reflect"
"runtime/debug" "runtime/debug"
"sync" "sync"
"sync/atomic" "sync/atomic"
...@@ -89,8 +88,7 @@ type ConsensusState struct { ...@@ -89,8 +88,7 @@ type ConsensusState struct {
broadcastChannel chan<- MsgInfo broadcastChannel chan<- MsgInfo
ourID ID ourID ID
started uint32 // atomic status uint32 // 0-stop, 1-start
stopped uint32 // atomic
Quit chan struct{} Quit chan struct{}
txsAvailable chan int64 txsAvailable chan int64
...@@ -112,6 +110,7 @@ func NewConsensusState(client *Client, state State, blockExec *BlockExecutor, ev ...@@ -112,6 +110,7 @@ func NewConsensusState(client *Client, state State, blockExec *BlockExecutor, ev
txsAvailable: make(chan int64, 1), txsAvailable: make(chan int64, 1),
begCons: time.Time{}, begCons: time.Time{},
} }
atomic.CompareAndSwapUint32(&cs.status, 0, 0)
// set function defaults (may be overwritten before calling Start) // set function defaults (may be overwritten before calling Start)
cs.decideProposal = cs.defaultDecideProposal cs.decideProposal = cs.defaultDecideProposal
cs.doPrevote = cs.defaultDoPrevote cs.doPrevote = cs.defaultDoPrevote
...@@ -137,7 +136,7 @@ func (cs *ConsensusState) SetBroadcastChannel(broadcastChannel chan<- MsgInfo) { ...@@ -137,7 +136,7 @@ func (cs *ConsensusState) SetBroadcastChannel(broadcastChannel chan<- MsgInfo) {
// IsRunning method // IsRunning method
func (cs *ConsensusState) IsRunning() bool { func (cs *ConsensusState) IsRunning() bool {
return atomic.LoadUint32(&cs.started) == 1 && atomic.LoadUint32(&cs.stopped) == 0 return atomic.LoadUint32(&cs.status) == 1
} }
//---------------------------------------- //----------------------------------------
...@@ -189,18 +188,15 @@ func (cs *ConsensusState) SetTimeoutTicker(timeoutTicker TimeoutTicker) { ...@@ -189,18 +188,15 @@ func (cs *ConsensusState) SetTimeoutTicker(timeoutTicker TimeoutTicker) {
func (cs *ConsensusState) LoadCommit(height int64) *tmtypes.TendermintCommit { func (cs *ConsensusState) LoadCommit(height int64) *tmtypes.TendermintCommit {
cs.mtx.Lock() cs.mtx.Lock()
defer cs.mtx.Unlock() defer cs.mtx.Unlock()
if height == cs.client.GetCurrentHeight() { if height == cs.client.csStore.LoadStateHeight() {
return cs.client.LoadSeenCommit(height) return cs.client.csStore.LoadSeenCommit(height)
} }
return cs.client.LoadBlockCommit(height + 1) return cs.client.LoadBlockCommit(height + 1)
} }
// Start It start first time starts the timeout checkTxsAvailable routine and receive routines. // Start It start first time starts the timeout checkTxsAvailable routine and receive routines.
func (cs *ConsensusState) Start() { func (cs *ConsensusState) Start() {
if atomic.CompareAndSwapUint32(&cs.started, 0, 1) { if atomic.CompareAndSwapUint32(&cs.status, 0, 1) {
if atomic.LoadUint32(&cs.stopped) == 1 {
tendermintlog.Error("ConsensusState already stoped")
}
cs.timeoutTicker.Start() cs.timeoutTicker.Start()
go cs.checkTxsAvailable() go cs.checkTxsAvailable()
...@@ -215,6 +211,7 @@ func (cs *ConsensusState) Start() { ...@@ -215,6 +211,7 @@ func (cs *ConsensusState) Start() {
// Stop timer and receive routine // Stop timer and receive routine
func (cs *ConsensusState) Stop() { func (cs *ConsensusState) Stop() {
atomic.CompareAndSwapUint32(&cs.status, 1, 0)
cs.timeoutTicker.Stop() cs.timeoutTicker.Stop()
cs.Quit <- struct{}{} cs.Quit <- struct{}{}
} }
...@@ -262,7 +259,7 @@ func (cs *ConsensusState) reconstructLastCommit(state State) { ...@@ -262,7 +259,7 @@ func (cs *ConsensusState) reconstructLastCommit(state State) {
if state.LastBlockHeight == 0 { if state.LastBlockHeight == 0 {
return return
} }
seenCommit := cs.client.LoadSeenCommit(state.LastBlockHeight) seenCommit := cs.client.csStore.LoadSeenCommit(state.LastBlockHeight)
seenCommitC := ttypes.Commit{TendermintCommit: seenCommit} seenCommitC := ttypes.Commit{TendermintCommit: seenCommit}
lastPrecommits := ttypes.NewVoteSet(state.ChainID, state.LastBlockHeight, seenCommitC.Round(), ttypes.VoteTypePrecommit, state.LastValidators) lastPrecommits := ttypes.NewVoteSet(state.ChainID, state.LastBlockHeight, seenCommitC.Round(), ttypes.VoteTypePrecommit, state.LastValidators)
for _, item := range seenCommit.Precommits { for _, item := range seenCommit.Precommits {
...@@ -333,8 +330,10 @@ func (cs *ConsensusState) updateToState(state State) { ...@@ -333,8 +330,10 @@ func (cs *ConsensusState) updateToState(state State) {
cs.Proposal = nil cs.Proposal = nil
cs.ProposalBlock = nil cs.ProposalBlock = nil
cs.ProposalBlockHash = nil cs.ProposalBlockHash = nil
cs.LockedRound = 0 cs.LockedRound = -1
cs.LockedBlock = nil cs.LockedBlock = nil
cs.ValidRound = -1
cs.ValidBlock = nil
cs.Votes = ttypes.NewHeightVoteSet(state.ChainID, height, validators) cs.Votes = ttypes.NewHeightVoteSet(state.ChainID, height, validators)
cs.CommitRound = -1 cs.CommitRound = -1
cs.LastCommit = lastPrecommits cs.LastCommit = lastPrecommits
...@@ -428,10 +427,11 @@ func (cs *ConsensusState) handleMsg(mi MsgInfo) { ...@@ -428,10 +427,11 @@ func (cs *ConsensusState) handleMsg(mi MsgInfo) {
case *tmtypes.Vote: case *tmtypes.Vote:
// attempt to add the vote and dupeout the validator if its a duplicate signature // attempt to add the vote and dupeout the validator if its a duplicate signature
// if the vote gives us a 2/3-any or 2/3-one, we transition // if the vote gives us a 2/3-any or 2/3-one, we transition
err := cs.tryAddVote(msg, peerID, peerIP) err = cs.tryAddVote(msg, peerID, peerIP)
if err == ErrAddingVote {
// TODO: punish peer //if err == ErrAddingVote {
} // TODO: punish peer
//}
// NOTE: the vote is broadcast to peers by the reactor listening // NOTE: the vote is broadcast to peers by the reactor listening
// for vote events // for vote events
...@@ -443,7 +443,7 @@ func (cs *ConsensusState) handleMsg(mi MsgInfo) { ...@@ -443,7 +443,7 @@ func (cs *ConsensusState) handleMsg(mi MsgInfo) {
tendermintlog.Error("Unknown msg type", msg.String(), "peerid", peerID, "peerip", peerIP) tendermintlog.Error("Unknown msg type", msg.String(), "peerid", peerID, "peerip", peerIP)
} }
if err != nil { if err != nil {
tendermintlog.Error("Error with msg", "type", reflect.TypeOf(msg), "peerid", peerID, "peerip", peerIP, "err", err, "msg", msg) //tendermintlog.Error("Error with msg", "type", reflect.TypeOf(msg), "peerid", peerID, "peerip", peerIP, "err", err, "msg", msg)
} }
} }
...@@ -472,6 +472,7 @@ func (cs *ConsensusState) handleTimeout(ti timeoutInfo, rs ttypes.RoundState) { ...@@ -472,6 +472,7 @@ func (cs *ConsensusState) handleTimeout(ti timeoutInfo, rs ttypes.RoundState) {
case ttypes.RoundStepPrevoteWait: case ttypes.RoundStepPrevoteWait:
cs.enterPrecommit(ti.Height, ti.Round) cs.enterPrecommit(ti.Height, ti.Round)
case ttypes.RoundStepPrecommitWait: case ttypes.RoundStepPrecommitWait:
cs.enterPrecommit(ti.Height, ti.Round)
cs.enterNewRound(ti.Height, ti.Round+1) cs.enterNewRound(ti.Height, ti.Round+1)
default: default:
panic(fmt.Sprintf("Invalid timeout step: %v", ti.Step)) panic(fmt.Sprintf("Invalid timeout step: %v", ti.Step))
...@@ -543,9 +544,9 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) { ...@@ -543,9 +544,9 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) {
if cs.Round < round { if cs.Round < round {
validators = validators.Copy() validators = validators.Copy()
validators.IncrementAccum(round - cs.Round) validators.IncrementAccum(round - cs.Round)
tendermintlog.Debug("enterNewRound validator changed", "csr", cs.Round, "round", round) tendermintlog.Debug("enterNewRound validator changed", "cs.Round", cs.Round, "round", round)
} }
tendermintlog.Debug("enterNewRound proposer ", "proposer", validators.Proposer, "validators", validators) tendermintlog.Debug("enterNewRound proposer", "proposer", validators.Proposer, "validators", validators)
// Setup new round // Setup new round
// we don't fire newStep for this step, // we don't fire newStep for this step,
// but we fire an event, so update the round step first // but we fire an event, so update the round step first
...@@ -647,16 +648,22 @@ func (cs *ConsensusState) enterPropose(height int64, round int) { ...@@ -647,16 +648,22 @@ func (cs *ConsensusState) enterPropose(height int64, round int) {
// if not a validator, we're done // if not a validator, we're done
if !cs.Validators.HasAddress(cs.privValidator.GetAddress()) { if !cs.Validators.HasAddress(cs.privValidator.GetAddress()) {
tendermintlog.Debug("This node is not a validator", "addr", cs.privValidator.GetAddress(), "vals", cs.Validators) tendermintlog.Debug("This node is not a validator",
"privValidator", fmt.Sprintf("%X", ttypes.Fingerprint(cs.privValidator.GetAddress())),
"Validators", cs.Validators.String())
return return
} }
tendermintlog.Debug("This node is a validator") tendermintlog.Debug("This node is a validator")
if cs.isProposer() { if cs.isProposer() {
tendermintlog.Info("enterPropose: Our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator) tendermintlog.Info("enterPropose: Our turn to propose",
"proposer", fmt.Sprintf("%X", ttypes.Fingerprint(cs.Validators.GetProposer().Address)),
"privValidator", fmt.Sprintf("%X", ttypes.Fingerprint(cs.privValidator.GetAddress())))
cs.decideProposal(height, round) cs.decideProposal(height, round)
} else { } else {
tendermintlog.Info("enterPropose: Not our turn to propose", "proposer", cs.Validators.GetProposer().Address, "privValidator", cs.privValidator) tendermintlog.Info("enterPropose: Not our turn to propose",
"proposer", fmt.Sprintf("%X", ttypes.Fingerprint(cs.Validators.GetProposer().Address)),
"privValidator", fmt.Sprintf("%X", ttypes.Fingerprint(cs.privValidator.GetAddress())))
} }
} }
...@@ -669,9 +676,9 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) { ...@@ -669,9 +676,9 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) {
var block *ttypes.TendermintBlock var block *ttypes.TendermintBlock
// Decide on block // Decide on block
if cs.LockedBlock != nil { if cs.ValidBlock != nil {
// If we're locked onto a block, just choose that. // If there is valid block, choose that.
block = cs.LockedBlock block = cs.ValidBlock
} else { } else {
// Create a new proposal block from state/txs from the mempool. // Create a new proposal block from state/txs from the mempool.
block = cs.createProposalBlock() block = cs.createProposalBlock()
...@@ -681,8 +688,8 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) { ...@@ -681,8 +688,8 @@ func (cs *ConsensusState) defaultDecideProposal(height int64, round int) {
} }
// Make proposal // Make proposal
polRound, polBlockID := cs.Votes.POLInfo() propBlockID := tmtypes.BlockID{Hash: block.Hash()}
proposal := ttypes.NewProposal(height, round, block.Hash(), polRound, polBlockID.BlockID) proposal := ttypes.NewProposal(height, round, block.Hash(), cs.ValidRound, propBlockID)
if err := cs.privValidator.SignProposal(cs.state.ChainID, proposal); err == nil { if err := cs.privValidator.SignProposal(cs.state.ChainID, proposal); err == nil {
// send proposal and block on internal msg queue // send proposal and block on internal msg queue
cs.sendInternalMessage(MsgInfo{ttypes.ProposalID, &proposal.Proposal, cs.ourID, ""}) cs.sendInternalMessage(MsgInfo{ttypes.ProposalID, &proposal.Proposal, cs.ourID, ""})
...@@ -737,15 +744,37 @@ func (cs *ConsensusState) createProposalBlock() (block *ttypes.TendermintBlock) ...@@ -737,15 +744,37 @@ func (cs *ConsensusState) createProposalBlock() (block *ttypes.TendermintBlock)
return return
} }
block = cs.state.MakeBlock(cs.Height, int64(cs.Round), pblock.Txs, commit) proposerAddr := cs.privValidator.GetAddress()
tendermintlog.Info("createProposalBlock block", "txs-len", len(block.Txs)) block = cs.state.MakeBlock(cs.Height, int64(cs.Round), pblock, commit, proposerAddr)
block.ProposerAddr = cs.privValidator.GetAddress() baseTx := cs.createBaseTx(block.TendermintBlock)
block.Data.Txs[0] = baseTx
block.Data.TxHash = merkle.CalcMerkleRoot(block.Data.Txs)
pblockNew := cs.client.ExecBlock(block.Data)
if pblockNew == nil {
tendermintlog.Error("createProposalBlock ExecBlock fail")
return
}
block.Data = pblockNew
evidence := cs.evpool.PendingEvidence() evidence := cs.evpool.PendingEvidence()
block.AddEvidence(evidence) block.AddEvidence(evidence)
return block return block
} }
func (cs *ConsensusState) createBaseTx(block *tmtypes.TendermintBlock) (tx *types.Transaction) {
var state *tmtypes.State
if cs.Height == 1 {
state = &tmtypes.State{}
} else {
state = cs.client.csStore.LoadStateFromStore()
if state == nil {
panic("createBaseTx LoadStateFromStore fail")
}
}
tx = CreateBlockInfoTx(cs.client.pubKey, state, block)
return tx
}
// Enter: `timeoutPropose` after entering Propose. // Enter: `timeoutPropose` after entering Propose.
// Enter: proposal block and POL is ready. // Enter: proposal block and POL is ready.
// Enter: any +2/3 prevotes for future round. // Enter: any +2/3 prevotes for future round.
...@@ -763,14 +792,6 @@ func (cs *ConsensusState) enterPrevote(height int64, round int) { ...@@ -763,14 +792,6 @@ func (cs *ConsensusState) enterPrevote(height int64, round int) {
cs.newStep() cs.newStep()
}() }()
// fire event for how we got here
if cs.isProposalComplete() {
//cs.eventBus.PublishEventCompleteProposal(cs.RoundStateEvent())
} else {
// we received +2/3 prevotes for a future round
// TODO: catchup event?
}
tendermintlog.Info(fmt.Sprintf("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step), "cost", types.Since(cs.begCons)) tendermintlog.Info(fmt.Sprintf("enterPrevote(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step), "cost", types.Since(cs.begCons))
// Sign and broadcast vote as necessary // Sign and broadcast vote as necessary
...@@ -868,7 +889,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { ...@@ -868,7 +889,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) {
// the latest POLRound should be this round // the latest POLRound should be this round
polRound, _ := cs.Votes.POLInfo() polRound, _ := cs.Votes.POLInfo()
if polRound < round { if polRound < round {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("This POLRound should be %v but got %v", round, polRound))) panic(fmt.Sprintf("This POLRound should be %v but got %v", round, polRound))
} }
// +2/3 prevoted nil. Unlock and precommit nil. // +2/3 prevoted nil. Unlock and precommit nil.
...@@ -877,7 +898,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { ...@@ -877,7 +898,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) {
tendermintlog.Info("enterPrecommit: +2/3 prevoted for nil.") tendermintlog.Info("enterPrecommit: +2/3 prevoted for nil.")
} else { } else {
tendermintlog.Info("enterPrecommit: +2/3 prevoted for nil. Unlocking") tendermintlog.Info("enterPrecommit: +2/3 prevoted for nil. Unlocking")
cs.LockedRound = 0 cs.LockedRound = -1
cs.LockedBlock = nil cs.LockedBlock = nil
} }
cs.signAddVote(ttypes.VoteTypePrecommit, nil) cs.signAddVote(ttypes.VoteTypePrecommit, nil)
...@@ -911,7 +932,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) { ...@@ -911,7 +932,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) {
// Fetch that block, unlock, and precommit nil. // Fetch that block, unlock, and precommit nil.
// The +2/3 prevotes for this round is the POL for our unlock. // The +2/3 prevotes for this round is the POL for our unlock.
// TODO: In the future save the POL prevotes for justification. // TODO: In the future save the POL prevotes for justification.
cs.LockedRound = 0 cs.LockedRound = -1
cs.LockedBlock = nil cs.LockedBlock = nil
if !bytes.Equal(cs.ProposalBlockHash, blockID.Hash) { if !bytes.Equal(cs.ProposalBlockHash, blockID.Hash) {
cs.ProposalBlock = nil cs.ProposalBlock = nil
...@@ -927,7 +948,7 @@ func (cs *ConsensusState) enterPrecommitWait(height int64, round int) { ...@@ -927,7 +948,7 @@ func (cs *ConsensusState) enterPrecommitWait(height int64, round int) {
return return
} }
if !cs.Votes.Precommits(round).HasTwoThirdsAny() { if !cs.Votes.Precommits(round).HasTwoThirdsAny() {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round))) panic(fmt.Sprintf("enterPrecommitWait(%v/%v), but Precommits does not have any +2/3 votes", height, round))
} }
tendermintlog.Info(fmt.Sprintf("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step)) tendermintlog.Info(fmt.Sprintf("enterPrecommitWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
...@@ -964,7 +985,7 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) { ...@@ -964,7 +985,7 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) {
blockID, ok := cs.Votes.Precommits(commitRound).TwoThirdsMajority() blockID, ok := cs.Votes.Precommits(commitRound).TwoThirdsMajority()
if !ok { if !ok {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", "RunActionCommit() expects +2/3 precommits")) panic("RunActionCommit() expects +2/3 precommits")
} }
// The Locked* fields no longer matter. // The Locked* fields no longer matter.
...@@ -985,16 +1006,25 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) { ...@@ -985,16 +1006,25 @@ func (cs *ConsensusState) enterCommit(height int64, commitRound int) {
// Set up ProposalBlockHash and keep waiting. // Set up ProposalBlockHash and keep waiting.
cs.ProposalBlock = nil cs.ProposalBlock = nil
cs.ProposalBlockHash = blockID.Hash cs.ProposalBlockHash = blockID.Hash
} else {
// We just need to keep waiting. validBlockMsg := &tmtypes.ValidBlockMsg{
Height: cs.Height,
Round: int32(cs.Round),
Blockhash: cs.ProposalBlockHash,
IsCommit: false,
}
cs.broadcastChannel <- MsgInfo{TypeID: ttypes.ValidBlockID, Msg: validBlockMsg, PeerID: cs.ourID, PeerIP: ""}
} }
//else {
// We just need to keep waiting.
//}
} }
} }
// If we have the block AND +2/3 commits for it, finalize. // If we have the block AND +2/3 commits for it, finalize.
func (cs *ConsensusState) tryFinalizeCommit(height int64) { func (cs *ConsensusState) tryFinalizeCommit(height int64) {
if cs.Height != height { if cs.Height != height {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height))) panic(fmt.Sprintf("tryFinalizeCommit() cs.Height: %v vs height: %v", cs.Height, height))
} }
blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority() blockID, ok := cs.Votes.Precommits(cs.CommitRound).TwoThirdsMajority()
...@@ -1027,14 +1057,14 @@ func (cs *ConsensusState) finalizeCommit(height int64) { ...@@ -1027,14 +1057,14 @@ func (cs *ConsensusState) finalizeCommit(height int64) {
block := cs.ProposalBlock block := cs.ProposalBlock
if !ok { if !ok {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("Cannot finalizeCommit, commit does not have two thirds majority"))) panic(fmt.Sprintf("Cannot finalizeCommit, commit does not have two thirds majority"))
} }
if !block.HashesTo(blockID.Hash) { if !block.HashesTo(blockID.Hash) {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("Cannot finalizeCommit, ProposalBlock does not hash to commit hash"))) panic(fmt.Sprintf("Cannot finalizeCommit, ProposalBlock does not hash to commit hash"))
} }
if err := cs.blockExec.ValidateBlock(cs.state, block); err != nil { if err := cs.blockExec.ValidateBlock(cs.state, block); err != nil {
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("+2/3 committed an invalid block: %v", err))) panic(fmt.Sprintf("+2/3 committed an invalid block: %v", err))
} }
stateCopy := cs.state.Copy() stateCopy := cs.state.Copy()
...@@ -1043,55 +1073,21 @@ func (cs *ConsensusState) finalizeCommit(height int64) { ...@@ -1043,55 +1073,21 @@ func (cs *ConsensusState) finalizeCommit(height int64) {
var err error var err error
stateCopy, err = cs.blockExec.ApplyBlock(stateCopy, ttypes.BlockID{BlockID: tmtypes.BlockID{Hash: block.Hash()}}, block) stateCopy, err = cs.blockExec.ApplyBlock(stateCopy, ttypes.BlockID{BlockID: tmtypes.BlockID{Hash: block.Hash()}}, block)
if err != nil { if err != nil {
tendermintlog.Error("Error on ApplyBlock", "err", err) panic(fmt.Sprintf("finalizeCommit ApplyBlock fail: %v", err))
cs.enterNewRound(cs.Height, cs.CommitRound+1)
return
} }
newState := SaveState(stateCopy) // commit block
tendermintlog.Info(fmt.Sprintf("Save consensus state. Current: %v/%v/%v", cs.Height, cs.CommitRound, cs.Step), "cost", types.Since(cs.begCons)) commitBlock := cs.ProposalBlock.Data
// original proposer commit block err = cs.client.CommitBlock(commitBlock)
if bytes.Equal(cs.privValidator.GetAddress(), block.TendermintBlock.ProposerAddr) { if err != nil {
newProposal := cs.Proposal panic(fmt.Sprintf("finalizeCommit CommitBlock fail: %v", err))
tendermintlog.Debug("finalizeCommit proposal block txs hash", "height", block.Header.Height, "tx-hash", fmt.Sprintf("%X", merkle.CalcMerkleRoot(block.Txs))) }
commitBlock := &types.Block{} if bytes.Equal(cs.privValidator.GetAddress(), block.TendermintBlock.Header.ProposerAddr) {
commitBlock.Height = block.Header.Height
commitBlock.Txs = make([]*types.Transaction, 1, len(block.Txs)+1)
commitBlock.Txs = append(commitBlock.Txs, block.Txs...)
lastCommit := block.LastCommit
precommits := cs.Votes.Precommits(cs.CommitRound)
seenCommit := precommits.MakeCommit()
tx0 := CreateBlockInfoTx(cs.client.pubKey, lastCommit, seenCommit, newState, newProposal, cs.ProposalBlock.TendermintBlock)
commitBlock.Txs[0] = tx0
cs.mtx.Unlock()
err = cs.client.CommitBlock(commitBlock)
cs.mtx.Lock()
if err != nil {
cs.LockedRound = 0
cs.LockedBlock = nil
tendermintlog.Info(fmt.Sprintf("Proposer continue consensus. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step),
"CommitRound", cs.CommitRound, "cost", types.Since(cs.begCons))
cs.enterNewRound(cs.Height, cs.CommitRound+1)
return
}
tendermintlog.Info(fmt.Sprintf("Proposer reach consensus. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), "CommitRound", cs.CommitRound, tendermintlog.Info(fmt.Sprintf("Proposer reach consensus. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), "CommitRound", cs.CommitRound,
"tx-len", len(commitBlock.Txs), "cost", types.Since(cs.begCons), "proposer-addr", fmt.Sprintf("%X", ttypes.Fingerprint(block.TendermintBlock.ProposerAddr))) "tx-len", len(commitBlock.Txs), "cost", types.Since(cs.begCons), "proposer-addr", fmt.Sprintf("%X", ttypes.Fingerprint(block.TendermintBlock.Header.ProposerAddr)))
} else { } else {
cs.mtx.Unlock()
reachCons := cs.client.CheckCommit(block.Header.Height)
cs.mtx.Lock()
if !reachCons {
cs.LockedRound = 0
cs.LockedBlock = nil
tendermintlog.Info(fmt.Sprintf("Not-Proposer continue consensus, will catchup. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step),
"CommitRound", cs.CommitRound, "cost", types.Since(cs.begCons))
cs.enterNewRound(cs.Height, cs.CommitRound+1)
return
}
tendermintlog.Info(fmt.Sprintf("Not-Proposer reach consensus. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), "CommitRound", cs.CommitRound, tendermintlog.Info(fmt.Sprintf("Not-Proposer reach consensus. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), "CommitRound", cs.CommitRound,
"tx-len", block.Header.NumTxs+1, "cost", types.Since(cs.begCons), "proposer-addr", fmt.Sprintf("%X", ttypes.Fingerprint(block.TendermintBlock.ProposerAddr))) "tx-len", len(commitBlock.Txs), "cost", types.Since(cs.begCons), "proposer-addr", fmt.Sprintf("%X", ttypes.Fingerprint(block.TendermintBlock.Header.ProposerAddr)))
} }
//check whether need update validator nodes //check whether need update validator nodes
...@@ -1111,7 +1107,18 @@ func (cs *ConsensusState) finalizeCommit(height int64) { ...@@ -1111,7 +1107,18 @@ func (cs *ConsensusState) finalizeCommit(height int64) {
stateCopy.Validators = nextValSet stateCopy.Validators = nextValSet
} }
} }
tendermintlog.Debug("finalizeCommit validators of statecopy", "validators", stateCopy.Validators) tendermintlog.Debug("finalizeCommit validators of statecopy", "validators", stateCopy.Validators.String())
// save local state and seen commit
precommits := cs.Votes.Precommits(cs.CommitRound)
seenCommit := precommits.MakeCommit()
newState := SaveState(stateCopy)
err = cs.client.csStore.SaveConsensusState(height, newState, seenCommit)
if err != nil {
panic(fmt.Sprintf("finalizeCommit SaveSeenCommit fail: %v", err))
}
tendermintlog.Info(fmt.Sprintf("Save consensus state. Current: %v/%v/%v", cs.Height, cs.CommitRound, cs.Step), "cost", types.Since(cs.begCons))
// NewHeightStep! // NewHeightStep!
cs.updateToState(stateCopy) cs.updateToState(stateCopy)
...@@ -1150,15 +1157,9 @@ func (cs *ConsensusState) defaultSetProposal(proposal *tmtypes.Proposal) error { ...@@ -1150,15 +1157,9 @@ func (cs *ConsensusState) defaultSetProposal(proposal *tmtypes.Proposal) error {
cs.begCons = time.Now() cs.begCons = time.Now()
} }
// We don't care about the proposal if we're already in ttypes.RoundStepCommit. // Verify POLRound, which must be -1 or in range [0, proposal.Round).
if ttypes.RoundStepCommit <= cs.Step { if proposal.POLRound != -1 ||
tendermintlog.Error("defaultSetProposal: already in RoundStepCommit") (proposal.POLRound >= 0 && proposal.Round >= proposal.POLRound) {
return nil
}
// Verify POLRound, which must be -1 or between 0 and proposal.Round exclusive.
if proposal.POLRound != -1 &&
(proposal.POLRound < 0 || proposal.Round <= proposal.POLRound) {
return ErrInvalidProposalPOLRound return ErrInvalidProposalPOLRound
} }
...@@ -1221,9 +1222,29 @@ func (cs *ConsensusState) addProposalBlock(proposalBlock *tmtypes.TendermintBloc ...@@ -1221,9 +1222,29 @@ func (cs *ConsensusState) addProposalBlock(proposalBlock *tmtypes.TendermintBloc
tendermintlog.Info(fmt.Sprintf("Consensus set proposal block. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), tendermintlog.Info(fmt.Sprintf("Consensus set proposal block. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step),
"ProposalBlockHash", fmt.Sprintf("%X", cs.ProposalBlockHash), "cost", types.Since(cs.begCons)) "ProposalBlockHash", fmt.Sprintf("%X", cs.ProposalBlockHash), "cost", types.Since(cs.begCons))
if cs.Step <= ttypes.RoundStepPropose { // Update Valid* if we can.
prevotes := cs.Votes.Prevotes(cs.Round)
blockID, hasTwoThirds := prevotes.TwoThirdsMajority()
if hasTwoThirds && len(blockID.Hash) == 0 && (cs.ValidRound < cs.Round) {
if cs.ProposalBlock.HashesTo(blockID.Hash) {
tendermintlog.Info("Updating valid block to new proposal block",
"valid-round", cs.Round, "valid-block-hash", cs.ProposalBlock.Hash())
cs.ValidRound = cs.Round
cs.ValidBlock = cs.ProposalBlock
}
// TODO: In case there is +2/3 majority in Prevotes set for some
// block and cs.ProposalBlock contains different block, either
// proposer is faulty or voting power of faulty processes is more
// than 1/3. We should trigger in the future accountability
// procedure at this point.
}
if cs.Step <= ttypes.RoundStepPropose && cs.isProposalComplete() {
// Move onto the next step // Move onto the next step
cs.enterPrevote(cs.Height, cs.Round) cs.enterPrevote(cs.Height, cs.Round)
if hasTwoThirds { // this is optimisation as this will be triggered when prevote is added
cs.enterPrecommit(cs.Height, cs.Round)
}
} else if cs.Step == ttypes.RoundStepCommit { } else if cs.Step == ttypes.RoundStepCommit {
// If we're waiting on the proposal block... // If we're waiting on the proposal block...
cs.tryFinalizeCommit(cs.Height) cs.tryFinalizeCommit(cs.Height)
...@@ -1264,104 +1285,157 @@ func (cs *ConsensusState) addVote(vote *ttypes.Vote, peerID string, peerIP strin ...@@ -1264,104 +1285,157 @@ func (cs *ConsensusState) addVote(vote *ttypes.Vote, peerID string, peerIP strin
tendermintlog.Debug(fmt.Sprintf("Consensus receive vote. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step), tendermintlog.Debug(fmt.Sprintf("Consensus receive vote. Current: %v/%v/%v", cs.Height, cs.Round, cs.Step),
"vote", fmt.Sprintf("{%v:%X %v/%02d/%v}", vote.ValidatorIndex, ttypes.Fingerprint(vote.ValidatorAddress), vote.Height, vote.Round, vote.Type), "peerip", peerIP) "vote", fmt.Sprintf("{%v:%X %v/%02d/%v}", vote.ValidatorIndex, ttypes.Fingerprint(vote.ValidatorAddress), vote.Height, vote.Round, vote.Type), "peerip", peerIP)
// A prevote/precommit for this height? // A precommit for the previous height
if vote.Height == cs.Height { // These come in while we wait timeoutCommit
if cs.begCons.IsZero() { if vote.Height+1 == cs.Height {
cs.begCons = time.Now() if !(cs.Step == ttypes.RoundStepNewHeight && vote.Type == uint32(ttypes.VoteTypePrecommit)) {
// TODO: give the reason ..
// fmt.Errorf("tryAddVote: Wrong height, not a LastCommit straggler commit.")
return added, ErrVoteHeightMismatch
} }
added, err = cs.LastCommit.AddVote(vote)
if !added {
return added, err
}
tendermintlog.Info(fmt.Sprintf("Added to lastPrecommits: %v", cs.LastCommit.StringShort()))
hasVoteMsg := &tmtypes.HasVoteMsg{
Height: vote.Height,
Round: vote.Round,
Type: int32(vote.Type),
Index: vote.ValidatorIndex,
}
cs.broadcastChannel <- MsgInfo{TypeID: ttypes.HasVoteID, Msg: hasVoteMsg, PeerID: cs.ourID, PeerIP: ""}
// if we can skip timeoutCommit and have all the votes now,
if skipTimeoutCommit && cs.LastCommit.HasAll() {
// go straight to new round (skip timeout commit)
// cs.scheduleTimeout(time.Duration(0), cs.Height, 0, cstypes.RoundStepNewHeight)
cs.enterNewRound(cs.Height, 0)
}
return
}
// Height mismatch is ignored.
// Not necessarily a bad peer, but not favourable behaviour.
if vote.Height != cs.Height {
err = ErrVoteHeightMismatch
tendermintlog.Info("Vote ignored and not added", "voteHeight", vote.Height, "csHeight", cs.Height, "peerID", peerID)
return
}
height := cs.Height height := cs.Height
added, err = cs.Votes.AddVote(vote, peerID) added, err = cs.Votes.AddVote(vote, peerID)
if added { if !added {
//cs.broadcastChannel <- MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: cs.ourID, PeerIP: ""} // Either duplicate, or error upon cs.Votes.AddByIndex()
hasVoteMsg := &tmtypes.HasVoteMsg{ return
Height: vote.Height, }
Round: vote.Round, //cs.broadcastChannel <- MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: cs.ourID, PeerIP: ""}
Type: int32(vote.Type), hasVoteMsg := &tmtypes.HasVoteMsg{
Index: vote.ValidatorIndex, Height: vote.Height,
Round: vote.Round,
Type: int32(vote.Type),
Index: vote.ValidatorIndex,
}
cs.broadcastChannel <- MsgInfo{TypeID: ttypes.HasVoteID, Msg: hasVoteMsg, PeerID: cs.ourID, PeerIP: ""}
switch vote.Type {
case uint32(ttypes.VoteTypePrevote):
prevotes := cs.Votes.Prevotes(int(vote.Round))
tendermintlog.Info("Added to prevote", "vote", vote, "prevotes", prevotes.StringShort())
// If +2/3 prevotes for a block or nil for *any* round:
if blockID, ok := prevotes.TwoThirdsMajority(); ok {
// There was a polka!
// If we're locked but this is a recent polka, unlock.
// If it matches our ProposalBlock, update the ValidBlock
// Unlock if `cs.LockedRound < vote.Round <= cs.Round`
// NOTE: If vote.Round > cs.Round, we'll deal with it when we get to vote.Round
if (cs.LockedBlock != nil) &&
(cs.LockedRound < int(vote.Round)) &&
(int(vote.Round) <= cs.Round) &&
!cs.LockedBlock.HashesTo(blockID.Hash) {
tendermintlog.Info("Unlocking because of POL.", "lockedRound", cs.LockedRound, "POLRound", vote.Round)
cs.LockedRound = -1
cs.LockedBlock = nil
} }
cs.broadcastChannel <- MsgInfo{TypeID: ttypes.HasVoteID, Msg: hasVoteMsg, PeerID: cs.ourID, PeerIP: ""}
switch vote.Type {
case uint32(ttypes.VoteTypePrevote):
prevotes := cs.Votes.Prevotes(int(vote.Round))
tendermintlog.Info("Added to prevote", "vote", vote, "prevotes", prevotes.StringShort())
// If +2/3 prevotes for a block or nil for *any* round:
if blockID, ok := prevotes.TwoThirdsMajority(); ok {
// There was a polka!
// If we're locked but this is a recent polka, unlock.
// If it matches our ProposalBlock, update the ValidBlock
// Unlock if `cs.LockedRound < vote.Round <= cs.Round`
// NOTE: If vote.Round > cs.Round, we'll deal with it when we get to vote.Round
if (cs.LockedBlock != nil) &&
(cs.LockedRound < int(vote.Round)) &&
(int(vote.Round) <= cs.Round) &&
!cs.LockedBlock.HashesTo(blockID.Hash) {
tendermintlog.Info("Unlocking because of POL.", "lockedRound", cs.LockedRound, "POLRound", vote.Round)
cs.LockedRound = 0
cs.LockedBlock = nil
}
}
// If +2/3 prevotes for *anything* for this or future round: // Update Valid* if we can.
if cs.Round <= int(vote.Round) && prevotes.HasTwoThirdsAny() { // NOTE: our proposal block may be nil or not what received a polka..
// Round-skip over to PrevoteWait or goto Precommit. if len(blockID.Hash) != 0 && (cs.ValidRound < int(vote.Round)) && (int(vote.Round) == cs.Round) {
cs.enterNewRound(height, int(vote.Round)) // if the vote is ahead of us
if prevotes.HasTwoThirdsMajority() { if cs.ProposalBlock.HashesTo(blockID.Hash) {
cs.enterPrecommit(height, int(vote.Round)) tendermintlog.Info("Updating ValidBlock because of POL.", "validRound", cs.ValidRound, "POLRound", vote.Round)
} else { cs.ValidRound = int(vote.Round)
cs.enterPrevote(height, int(vote.Round)) // if the vote is ahead of us cs.ValidBlock = cs.ProposalBlock
cs.enterPrevoteWait(height, int(vote.Round)) } else {
} tendermintlog.Info(
} else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round { "Valid block we don't know about. Set ProposalBlock=nil",
// If the proposal is now complete, enter prevote of cs.Round. "proposal", fmt.Sprintf("%X", cs.ProposalBlock.Hash()), "blockId", fmt.Sprintf("%X", blockID.Hash))
if cs.isProposalComplete() { // We're getting the wrong block.
cs.enterPrevote(height, cs.Round) cs.ProposalBlock = nil
}
} }
cs.ProposalBlockHash = blockID.Hash
case uint32(ttypes.VoteTypePrecommit): validBlockMsg := &tmtypes.ValidBlockMsg{
precommits := cs.Votes.Precommits(int(vote.Round)) Height: vote.Height,
tendermintlog.Info("Added to precommit", "vote", vote, "precommits", precommits.StringShort()) Round: vote.Round,
blockID, ok := precommits.TwoThirdsMajority() Blockhash: cs.ProposalBlockHash,
if ok { IsCommit: false,
if len(blockID.Hash) == 0 {
cs.enterNewRound(height, int(vote.Round)+1)
} else {
cs.enterNewRound(height, int(vote.Round))
cs.enterPrecommit(height, int(vote.Round))
cs.enterCommit(height, int(vote.Round))
if skipTimeoutCommit && precommits.HasAll() {
// if we have all the votes now,
// go straight to new round (skip timeout commit)
cs.enterNewRound(cs.Height, 0)
}
}
} else if cs.Round <= int(vote.Round) && precommits.HasTwoThirdsAny() {
cs.enterNewRound(height, int(vote.Round))
cs.enterPrecommit(height, int(vote.Round))
cs.enterPrecommitWait(height, int(vote.Round))
} }
cs.broadcastChannel <- MsgInfo{TypeID: ttypes.ValidBlockID, Msg: validBlockMsg, PeerID: cs.ourID, PeerIP: ""}
}
}
// If +2/3 prevotes for *anything* for this or future round:
switch {
case cs.Round < int(vote.Round) && prevotes.HasTwoThirdsAny():
// Round-skip if there is any 2/3+ of votes ahead of us
cs.enterNewRound(height, int(vote.Round))
case cs.Round == int(vote.Round) && ttypes.RoundStepPrevote <= cs.Step: // current round
blockID, ok := prevotes.TwoThirdsMajority()
if ok && (cs.isProposalComplete() || len(blockID.Hash) == 0) {
cs.enterPrecommit(height, int(vote.Round))
} else if prevotes.HasTwoThirdsAny() {
cs.enterPrevoteWait(height, int(vote.Round))
}
case cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round:
// If the proposal is now complete, enter prevote of cs.Round.
if cs.isProposalComplete() {
cs.enterPrevote(height, cs.Round)
}
}
default: case uint32(ttypes.VoteTypePrecommit):
panic(fmt.Sprintf("Panicked on a Sanity Check: %v", fmt.Sprintf("Unexpected vote type %X", vote.Type))) // Should not happen. precommits := cs.Votes.Precommits(int(vote.Round))
tendermintlog.Info("Added to precommit", "vote", vote, "precommits", precommits.StringShort())
blockID, ok := precommits.TwoThirdsMajority()
if ok {
// Executed as TwoThirdsMajority could be from a higher round
cs.enterNewRound(height, int(vote.Round))
cs.enterPrecommit(height, int(vote.Round))
if len(blockID.Hash) != 0 {
cs.enterCommit(height, int(vote.Round))
if skipTimeoutCommit && precommits.HasAll() {
cs.enterNewRound(cs.Height, 0)
}
} else {
cs.enterPrecommitWait(height, int(vote.Round))
} }
} else if cs.Round <= int(vote.Round) && precommits.HasTwoThirdsAny() {
cs.enterNewRound(height, int(vote.Round))
cs.enterPrecommitWait(height, int(vote.Round))
} }
// Either duplicate, or error upon cs.Votes.AddByIndex()
// return default:
} else { panic(fmt.Sprintf("Unexpected vote type %X", vote.Type)) // Should not happen.
err = ErrVoteHeightMismatch
} }
// Height mismatch, bad peer? return added, err
tendermintlog.Debug("Vote ignored and not added", "voteType", vote.Type, "voteHeight", vote.Height, "csHeight", cs.Height, "err", err)
return
} }
func (cs *ConsensusState) signVote(voteType byte, hash []byte) (*ttypes.Vote, error) { func (cs *ConsensusState) signVote(voteType byte, hash []byte) (*ttypes.Vote, error) {
......
...@@ -6,6 +6,7 @@ package tendermint ...@@ -6,6 +6,7 @@ package tendermint
import ( import (
"bufio" "bufio"
"bytes"
"encoding/binary" "encoding/binary"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
...@@ -374,6 +375,21 @@ func (pc *peerConn) TrySend(msg MsgInfo) bool { ...@@ -374,6 +375,21 @@ func (pc *peerConn) TrySend(msg MsgInfo) bool {
} }
} }
// PickSendVote picks a vote and sends it to the peer.
// Returns true if vote was sent.
func (pc *peerConn) PickSendVote(votes ttypes.VoteSetReader) bool {
if vote, ok := pc.state.PickVoteToSend(votes); ok {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()}
tendermintlog.Debug("Sending vote message", "vote", msg)
if pc.Send(msg) {
pc.state.SetHasVote(vote)
return true
}
return false
}
return false
}
func (pc *peerConn) IsRunning() bool { func (pc *peerConn) IsRunning() bool {
return atomic.LoadUint32(&pc.started) == 1 && atomic.LoadUint32(&pc.stopped) == 0 return atomic.LoadUint32(&pc.started) == 1 && atomic.LoadUint32(&pc.stopped) == 0
} }
...@@ -545,7 +561,8 @@ FOR_LOOP: ...@@ -545,7 +561,8 @@ FOR_LOOP:
tendermintlog.Error("peerConn recvRoutine Unmarshal data failed", "err", err) tendermintlog.Error("peerConn recvRoutine Unmarshal data failed", "err", err)
continue continue
} }
if pc.transferChannel != nil && (pkt.TypeID == ttypes.ProposalID || pkt.TypeID == ttypes.VoteID || pkt.TypeID == ttypes.ProposalBlockID) { if pc.transferChannel != nil && (pkt.TypeID == ttypes.ProposalID || pkt.TypeID == ttypes.VoteID ||
pkt.TypeID == ttypes.ProposalBlockID) {
pc.transferChannel <- MsgInfo{pkt.TypeID, realMsg.(proto.Message), pc.ID(), pc.ip.String()} pc.transferChannel <- MsgInfo{pkt.TypeID, realMsg.(proto.Message), pc.ID(), pc.ip.String()}
if pkt.TypeID == ttypes.ProposalID { if pkt.TypeID == ttypes.ProposalID {
proposal := realMsg.(*tmtypes.Proposal) proposal := realMsg.(*tmtypes.Proposal)
...@@ -601,12 +618,15 @@ FOR_LOOP: ...@@ -601,12 +618,15 @@ FOR_LOOP:
typeID := msg.TypeID typeID := msg.TypeID
if typeID == ttypes.NewRoundStepID { if typeID == ttypes.NewRoundStepID {
pc.state.ApplyNewRoundStepMessage(msg.Msg.(*tmtypes.NewRoundStepMsg)) pc.state.ApplyNewRoundStepMessage(msg.Msg.(*tmtypes.NewRoundStepMsg))
} else if typeID == ttypes.ValidBlockID {
pc.state.ApplyValidBlockMessage(msg.Msg.(*tmtypes.ValidBlockMsg))
} else if typeID == ttypes.CommitStepID { } else if typeID == ttypes.CommitStepID {
pc.state.ApplyCommitStepMessage(msg.Msg.(*tmtypes.CommitStepMsg)) pc.state.ApplyCommitStepMessage(msg.Msg.(*tmtypes.CommitStepMsg))
} else if typeID == ttypes.HasVoteID { } else if typeID == ttypes.HasVoteID {
pc.state.ApplyHasVoteMessage(msg.Msg.(*tmtypes.HasVoteMsg)) pc.state.ApplyHasVoteMessage(msg.Msg.(*tmtypes.HasVoteMsg))
} else if typeID == ttypes.VoteSetMaj23ID { } else if typeID == ttypes.VoteSetMaj23ID {
tmp := msg.Msg.(*tmtypes.VoteSetMaj23Msg) tmp := msg.Msg.(*tmtypes.VoteSetMaj23Msg)
tendermintlog.Debug("updateStateRoutine", "VoteSetMaj23Msg", tmp)
pc.myState.SetPeerMaj23(tmp.Height, int(tmp.Round), byte(tmp.Type), pc.id, tmp.BlockID) pc.myState.SetPeerMaj23(tmp.Height, int(tmp.Round), byte(tmp.Type), pc.id, tmp.BlockID)
var myVotes *ttypes.BitArray var myVotes *ttypes.BitArray
switch byte(tmp.Type) { switch byte(tmp.Type) {
...@@ -692,16 +712,27 @@ OUTER_LOOP: ...@@ -692,16 +712,27 @@ OUTER_LOOP:
// If the peer is on a previous height, help catch up. // If the peer is on a previous height, help catch up.
if (0 < prs.Height) && (prs.Height < rs.Height) { if (0 < prs.Height) && (prs.Height < rs.Height) {
if prs.Height+1 == rs.Height && prs.Round == rs.LastCommit.Round() && prs.Step == ttypes.RoundStepCommit && prs.ProposalBlock { //if prs.Height+1 == rs.Height && prs.Round == rs.LastCommit.Round() && prs.Step == ttypes.RoundStepCommit && prs.ProposalBlock {
tendermintlog.Debug("Peer is waiting for finalizeCommit finish", "peerip", pc.ip.String(), // tendermintlog.Debug("Peer is waiting for finalizeCommit finish", "peerip", pc.ip.String(),
"state", fmt.Sprintf("%v/%v/%v", prs.Height, prs.Round, prs.Step)) // "state", fmt.Sprintf("%v/%v/%v", prs.Height, prs.Round, prs.Step))
time.Sleep(10 * pc.myState.PeerGossipSleep()) // time.Sleep(10 * pc.myState.PeerGossipSleep())
// continue OUTER_LOOP
//}
if prs.ProposalBlockHash == nil || prs.ProposalBlock {
time.Sleep(pc.myState.PeerGossipSleep())
continue OUTER_LOOP continue OUTER_LOOP
} }
tendermintlog.Info("help catch up", "peerip", pc.ip.String(), "selfHeight", rs.Height, "peerHeight", prs.Height) tendermintlog.Info("help catch up", "peerip", pc.ip.String(), "selfHeight", rs.Height, "peerHeight", prs.Height)
proposalBlock := pc.myState.client.LoadProposalBlock(prs.Height) proposalBlock := pc.myState.client.LoadProposalBlock(prs.Height)
newBlock := &ttypes.TendermintBlock{TendermintBlock: proposalBlock}
if proposalBlock == nil { if proposalBlock == nil {
tendermintlog.Error("Failed to load propsal block", "selfHeight", rs.Height, "blockstoreHeight", pc.myState.client.GetCurrentHeight()) tendermintlog.Error("Fail to load propsal block", "selfHeight", rs.Height,
"blockstoreHeight", pc.myState.client.GetCurrentHeight())
time.Sleep(pc.myState.PeerGossipSleep())
continue OUTER_LOOP
} else if !bytes.Equal(newBlock.Hash(), prs.ProposalBlockHash) {
tendermintlog.Error("Peer ProposalBlockHash mismatch", "ProposalBlockHash", fmt.Sprintf("%X", prs.ProposalBlockHash),
"newBlockHash", fmt.Sprintf("%X", newBlock.Hash()))
time.Sleep(pc.myState.PeerGossipSleep()) time.Sleep(pc.myState.PeerGossipSleep())
continue OUTER_LOOP continue OUTER_LOOP
} }
...@@ -709,9 +740,8 @@ OUTER_LOOP: ...@@ -709,9 +740,8 @@ OUTER_LOOP:
tendermintlog.Info("Sending block for catchup", "peerip", pc.ip.String(), "block(H/R)", tendermintlog.Info("Sending block for catchup", "peerip", pc.ip.String(), "block(H/R)",
fmt.Sprintf("%v/%v", proposalBlock.Header.Height, proposalBlock.Header.Round)) fmt.Sprintf("%v/%v", proposalBlock.Header.Height, proposalBlock.Header.Round))
if pc.Send(msg) { if pc.Send(msg) {
//prs.SetHasProposalBlock(rs.ProposalBlock) prs.SetHasProposalBlock(newBlock)
} }
time.Sleep(10 * pc.myState.PeerGossipSleep())
continue OUTER_LOOP continue OUTER_LOOP
} }
...@@ -754,14 +784,16 @@ OUTER_LOOP: ...@@ -754,14 +784,16 @@ OUTER_LOOP:
} }
// Send proposal block // Send proposal block
if rs.ProposalBlock != nil && !prs.ProposalBlock { if rs.Proposal != nil && prs.ProposalBlockHash != nil && bytes.Equal(rs.Proposal.Blockhash, prs.ProposalBlockHash) {
msg := MsgInfo{TypeID: ttypes.ProposalBlockID, Msg: rs.ProposalBlock.TendermintBlock, PeerID: pc.id, PeerIP: pc.ip.String()} if rs.ProposalBlock != nil && !prs.ProposalBlock {
tendermintlog.Debug(fmt.Sprintf("Sending proposal block. Self state: %v/%v/%v", rs.Height, rs.Round, rs.Step), msg := MsgInfo{TypeID: ttypes.ProposalBlockID, Msg: rs.ProposalBlock.TendermintBlock, PeerID: pc.id, PeerIP: pc.ip.String()}
"peerip", pc.ip.String(), "block-height", rs.ProposalBlock.Header.Height, "block-round", rs.ProposalBlock.Header.Round) tendermintlog.Debug(fmt.Sprintf("Sending proposal block. Self state: %v/%v/%v", rs.Height, rs.Round, rs.Step),
if pc.Send(msg) { "peerip", pc.ip.String(), "block-height", rs.ProposalBlock.Header.Height, "block-round", rs.ProposalBlock.Header.Round)
prs.SetHasProposalBlock(rs.ProposalBlock) if pc.Send(msg) {
prs.SetHasProposalBlock(rs.ProposalBlock)
}
continue OUTER_LOOP
} }
continue OUTER_LOOP
} }
// Nothing to do. Sleep. // Nothing to do. Sleep.
...@@ -806,11 +838,8 @@ OUTER_LOOP: ...@@ -806,11 +838,8 @@ OUTER_LOOP:
// Special catchup logic. // Special catchup logic.
// If peer is lagging by height 1, send LastCommit. // If peer is lagging by height 1, send LastCommit.
if prs.Height != 0 && rs.Height == prs.Height+1 { if prs.Height != 0 && rs.Height == prs.Height+1 {
if vote, ok := pc.state.PickVoteToSend(rs.LastCommit); ok { if pc.PickSendVote(rs.LastCommit) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.LastCommit to send", "peerip", pc.ip.String(), "height", prs.Height)
pc.Send(msg)
tendermintlog.Debug("Picked rs.LastCommit to send", "peerip", pc.ip.String(), "height", prs.Height, "vote.Height", vote.Height)
} else {
continue OUTER_LOOP continue OUTER_LOOP
} }
} }
...@@ -820,14 +849,13 @@ OUTER_LOOP: ...@@ -820,14 +849,13 @@ OUTER_LOOP:
if prs.Height != 0 && rs.Height >= prs.Height+2 { if prs.Height != 0 && rs.Height >= prs.Height+2 {
// Load the block commit for prs.Height, // Load the block commit for prs.Height,
// which contains precommit signatures for prs.Height. // which contains precommit signatures for prs.Height.
commit := pc.myState.client.LoadSeenCommit(prs.Height) commit := pc.myState.client.LoadBlockCommit(prs.Height + 1)
commitObj := &ttypes.Commit{TendermintCommit: commit} commitObj := &ttypes.Commit{TendermintCommit: commit}
if vote, ok := pc.state.PickVoteToSend(commitObj); ok { if pc.PickSendVote(commitObj) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Info("Picked Catchup commit to send",
pc.Send(msg) "commit(H/R)", fmt.Sprintf("%v/%v", commitObj.Height(), commitObj.Round()),
tendermintlog.Info("Picked Catchup commit to send", "BitArray", commitObj.BitArray().String(), "valIndex", vote.ValidatorIndex, "BitArray", commitObj.BitArray().String(),
"peerip", pc.ip.String(), "height", prs.Height, "vote.Height", vote.Height) "peerip", pc.ip.String(), "height", prs.Height)
} else {
continue OUTER_LOOP continue OUTER_LOOP
} }
} }
...@@ -851,47 +879,53 @@ OUTER_LOOP: ...@@ -851,47 +879,53 @@ OUTER_LOOP:
func (pc *peerConn) gossipVotesForHeight(rs *ttypes.RoundState, prs *ttypes.PeerRoundState) bool { func (pc *peerConn) gossipVotesForHeight(rs *ttypes.RoundState, prs *ttypes.PeerRoundState) bool {
// If there are lastCommits to send... // If there are lastCommits to send...
if prs.Step == ttypes.RoundStepNewHeight { if prs.Step == ttypes.RoundStepNewHeight {
if vote, ok := pc.state.PickVoteToSend(rs.LastCommit); ok { if pc.PickSendVote(rs.LastCommit) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.LastCommit to send", "peerip", pc.ip.String(),
pc.Send(msg) "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
tendermintlog.Debug("Picked rs.LastCommit to send", "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
return true return true
} }
} }
// If there are POL prevotes to send...
if prs.Step <= ttypes.RoundStepPropose && prs.Round != -1 && prs.Round <= rs.Round && prs.ProposalPOLRound != -1 {
if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil {
if pc.PickSendVote(polPrevotes) {
tendermintlog.Debug("Picked rs.Prevotes(prs.ProposalPOLRound) to send",
"peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round),
"POLRound", prs.ProposalPOLRound)
return true
}
}
}
// If there are prevotes to send... // If there are prevotes to send...
if prs.Step <= ttypes.RoundStepPrevoteWait && prs.Round != -1 && prs.Round <= rs.Round { if prs.Step <= ttypes.RoundStepPrevoteWait && prs.Round != -1 && prs.Round <= rs.Round {
if vote, ok := pc.state.PickVoteToSend(rs.Votes.Prevotes(prs.Round)); ok { if pc.PickSendVote(rs.Votes.Prevotes(prs.Round)) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.Prevotes(prs.Round) to send",
pc.Send(msg) "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
tendermintlog.Debug("Picked rs.Prevotes(prs.Round) to send", "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
return true return true
} }
} }
// If there are precommits to send... // If there are precommits to send...
if prs.Step <= ttypes.RoundStepPrecommitWait && prs.Round != -1 && prs.Round <= rs.Round { if prs.Step <= ttypes.RoundStepPrecommitWait && prs.Round != -1 && prs.Round <= rs.Round {
if vote, ok := pc.state.PickVoteToSend(rs.Votes.Precommits(prs.Round)); ok { if pc.PickSendVote(rs.Votes.Precommits(prs.Round)) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.Precommits(prs.Round) to send",
pc.Send(msg) "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
tendermintlog.Debug("Picked rs.Precommits(prs.Round) to send", "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
return true return true
} }
} }
// If there are prevotes to send...Needed because of validBlock mechanism // If there are prevotes to send...Needed because of validBlock mechanism
if prs.Round != -1 && prs.Round <= rs.Round { if prs.Round != -1 && prs.Round <= rs.Round {
if vote, ok := pc.state.PickVoteToSend(rs.Votes.Prevotes(prs.Round)); ok { if pc.PickSendVote(rs.Votes.Prevotes(prs.Round)) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.Prevotes(prs.Round) to send",
pc.Send(msg) "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
tendermintlog.Debug("Picked rs.Prevotes(prs.Round) to send", "peerip", pc.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", prs.Height, prs.Round))
return true return true
} }
} }
// If there are POLPrevotes to send... // If there are POLPrevotes to send...
if prs.ProposalPOLRound != -1 { if prs.ProposalPOLRound != -1 {
if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil { if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil {
if vote, ok := pc.state.PickVoteToSend(polPrevotes); ok { if pc.PickSendVote(polPrevotes) {
msg := MsgInfo{TypeID: ttypes.VoteID, Msg: vote.Vote, PeerID: pc.id, PeerIP: pc.ip.String()} tendermintlog.Debug("Picked rs.Prevotes(prs.ProposalPOLRound) to send",
pc.Send(msg) "peerip", pc.ip.String(), "round", prs.ProposalPOLRound)
tendermintlog.Debug("Picked rs.Prevotes(prs.ProposalPOLRound) to send", "peerip", pc.ip.String(), "round", prs.ProposalPOLRound)
return true return true
} }
} }
...@@ -972,7 +1006,7 @@ OUTER_LOOP: ...@@ -972,7 +1006,7 @@ OUTER_LOOP:
// Maybe send Height/CatchupCommitRound/CatchupCommit. // Maybe send Height/CatchupCommitRound/CatchupCommit.
{ {
prs := pc.state.GetRoundState() prs := pc.state.GetRoundState()
if prs.CatchupCommitRound != -1 && 0 < prs.Height && prs.Height <= pc.myState.client.GetCurrentHeight() { if prs.CatchupCommitRound != -1 && 0 < prs.Height && prs.Height <= pc.myState.client.csStore.LoadStateHeight() {
commit := pc.myState.LoadCommit(prs.Height) commit := pc.myState.LoadCommit(prs.Height)
commitTmp := ttypes.Commit{TendermintCommit: commit} commitTmp := ttypes.Commit{TendermintCommit: commit}
msg := MsgInfo{TypeID: ttypes.VoteSetMaj23ID, Msg: &tmtypes.VoteSetMaj23Msg{ msg := MsgInfo{TypeID: ttypes.VoteSetMaj23ID, Msg: &tmtypes.VoteSetMaj23Msg{
...@@ -1036,10 +1070,12 @@ func (ps *PeerConnState) SetHasProposal(proposal *tmtypes.Proposal) { ...@@ -1036,10 +1070,12 @@ func (ps *PeerConnState) SetHasProposal(proposal *tmtypes.Proposal) {
if ps.Proposal { if ps.Proposal {
return return
} }
tendermintlog.Debug("Peer set proposal", "peerip", ps.ip.String(), "peer-state", fmt.Sprintf("%v/%v/%v", ps.Height, ps.Round, ps.Step), tendermintlog.Debug("Peer set proposal", "peerip", ps.ip.String(),
"proposal(H/R)", fmt.Sprintf("%v/%v", proposal.Height, proposal.Round)) "peer-state", fmt.Sprintf("%v/%v/%v", ps.Height, ps.Round, ps.Step),
"proposal(H/R/Hash)", fmt.Sprintf("%v/%v/%X", proposal.Height, proposal.Round, proposal.Blockhash))
ps.Proposal = true ps.Proposal = true
ps.ProposalBlockHash = proposal.Blockhash
ps.ProposalPOLRound = int(proposal.POLRound) ps.ProposalPOLRound = int(proposal.POLRound)
ps.ProposalPOL = nil // Nil until ttypes.ProposalPOLMessage received. ps.ProposalPOL = nil // Nil until ttypes.ProposalPOLMessage received.
} }
...@@ -1055,7 +1091,8 @@ func (ps *PeerConnState) SetHasProposalBlock(block *ttypes.TendermintBlock) { ...@@ -1055,7 +1091,8 @@ func (ps *PeerConnState) SetHasProposalBlock(block *ttypes.TendermintBlock) {
if ps.ProposalBlock { if ps.ProposalBlock {
return return
} }
tendermintlog.Debug("Peer set proposal block", "peerip", ps.ip.String(), "peer-state", fmt.Sprintf("%v/%v/%v", ps.Height, ps.Round, ps.Step), tendermintlog.Debug("Peer set proposal block", "peerip", ps.ip.String(),
"peer-state", fmt.Sprintf("%v/%v/%v", ps.Height, ps.Round, ps.Step),
"block(H/R)", fmt.Sprintf("%v/%v", block.Header.Height, block.Header.Round)) "block(H/R)", fmt.Sprintf("%v/%v", block.Header.Height, block.Header.Round))
ps.ProposalBlock = true ps.ProposalBlock = true
} }
...@@ -1088,7 +1125,6 @@ func (ps *PeerConnState) PickVoteToSend(votes ttypes.VoteSetReader) (vote *ttype ...@@ -1088,7 +1125,6 @@ func (ps *PeerConnState) PickVoteToSend(votes ttypes.VoteSetReader) (vote *ttype
tendermintlog.Debug("PickVoteToSend", "peer(H/R)", fmt.Sprintf("%v/%v", ps.Height, ps.Round), tendermintlog.Debug("PickVoteToSend", "peer(H/R)", fmt.Sprintf("%v/%v", ps.Height, ps.Round),
"vote(H/R)", fmt.Sprintf("%v/%v", height, round), "type", voteType, "selfVotes", votes.BitArray().String(), "vote(H/R)", fmt.Sprintf("%v/%v", height, round), "type", voteType, "selfVotes", votes.BitArray().String(),
"peerVotes", psVotes.String(), "peerip", ps.ip.String()) "peerVotes", psVotes.String(), "peerip", ps.ip.String())
ps.setHasVote(height, round, voteType, index)
return votes.GetByIndex(index), true return votes.GetByIndex(index), true
} }
return nil, false return nil, false
...@@ -1211,7 +1247,8 @@ func (ps *PeerConnState) setHasVote(height int64, round int, voteType byte, inde ...@@ -1211,7 +1247,8 @@ func (ps *PeerConnState) setHasVote(height int64, round int, voteType byte, inde
if psVotes != nil { if psVotes != nil {
psVotes.SetIndex(index, true) psVotes.SetIndex(index, true)
} }
tendermintlog.Debug("setHasVote after", "height", height, "index", index, "type", voteType, "peerVotes", psVotes.String(), "peerip", ps.ip.String()) tendermintlog.Debug("setHasVote after", "height", height, "index", index, "type", voteType,
"peerVotes", psVotes.String(), "peerip", ps.ip.String())
} }
// ApplyNewRoundStepMessage updates the peer state for the new round. // ApplyNewRoundStepMessage updates the peer state for the new round.
...@@ -1238,13 +1275,16 @@ func (ps *PeerConnState) ApplyNewRoundStepMessage(msg *tmtypes.NewRoundStepMsg) ...@@ -1238,13 +1275,16 @@ func (ps *PeerConnState) ApplyNewRoundStepMessage(msg *tmtypes.NewRoundStepMsg)
ps.Step = ttypes.RoundStepType(msg.Step) ps.Step = ttypes.RoundStepType(msg.Step)
ps.StartTime = startTime ps.StartTime = startTime
tendermintlog.Debug("ApplyNewRoundStepMessage", "peerip", ps.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound), tendermintlog.Debug("ApplyNewRoundStepMessage", "peerip", ps.ip.String(),
"peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound),
"msg(H/R/S)", fmt.Sprintf("%v/%v/%v", msg.Height, msg.Round, ps.Step)) "msg(H/R/S)", fmt.Sprintf("%v/%v/%v", msg.Height, msg.Round, ps.Step))
if psHeight != msg.Height || psRound != int(msg.Round) { if psHeight != msg.Height || psRound != int(msg.Round) {
tendermintlog.Debug("Reset Proposal, Prevotes, Precommits", "peerip", ps.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound)) tendermintlog.Debug("Reset Proposal, Prevotes, Precommits", "peerip", ps.ip.String(),
"peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound))
ps.Proposal = false ps.Proposal = false
ps.ProposalBlock = false ps.ProposalBlock = false
ps.ProposalBlockHash = nil
ps.ProposalPOLRound = -1 ps.ProposalPOLRound = -1
ps.ProposalPOL = nil ps.ProposalPOL = nil
// We'll update the BitArray capacity later. // We'll update the BitArray capacity later.
...@@ -1256,11 +1296,13 @@ func (ps *PeerConnState) ApplyNewRoundStepMessage(msg *tmtypes.NewRoundStepMsg) ...@@ -1256,11 +1296,13 @@ func (ps *PeerConnState) ApplyNewRoundStepMessage(msg *tmtypes.NewRoundStepMsg)
// Preserve psCatchupCommit! // Preserve psCatchupCommit!
// NOTE: We prefer to use prs.Precommits if // NOTE: We prefer to use prs.Precommits if
// pr.Round matches pr.CatchupCommitRound. // pr.Round matches pr.CatchupCommitRound.
tendermintlog.Debug("Reset Precommits to CatchupCommit", "peerip", ps.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound)) tendermintlog.Debug("Reset Precommits to CatchupCommit", "peerip", ps.ip.String(),
"peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound))
ps.Precommits = psCatchupCommit ps.Precommits = psCatchupCommit
} }
if psHeight != msg.Height { if psHeight != msg.Height {
tendermintlog.Debug("Reset LastCommit, CatchupCommit", "peerip", ps.ip.String(), "peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound)) tendermintlog.Debug("Reset LastCommit, CatchupCommit", "peerip", ps.ip.String(),
"peer(H/R)", fmt.Sprintf("%v/%v", psHeight, psRound))
// Shift Precommits to LastCommit. // Shift Precommits to LastCommit.
if psHeight+1 == msg.Height && psRound == int(msg.LastCommitRound) { if psHeight+1 == msg.Height && psRound == int(msg.LastCommitRound) {
ps.LastCommitRound = int(msg.LastCommitRound) ps.LastCommitRound = int(msg.LastCommitRound)
...@@ -1283,7 +1325,24 @@ func (ps *PeerConnState) ApplyCommitStepMessage(msg *tmtypes.CommitStepMsg) { ...@@ -1283,7 +1325,24 @@ func (ps *PeerConnState) ApplyCommitStepMessage(msg *tmtypes.CommitStepMsg) {
if ps.Height != msg.Height { if ps.Height != msg.Height {
return return
} }
}
// ApplyValidBlockMessage updates the peer state for the new valid block.
func (ps *PeerConnState) ApplyValidBlockMessage(msg *tmtypes.ValidBlockMsg) {
ps.mtx.Lock()
defer ps.mtx.Unlock()
if ps.Height != msg.Height {
return
}
if ps.Round != int(msg.Round) && !msg.IsCommit {
return
}
tendermintlog.Debug("ApplyValidBlockMessage", "peerip", ps.ip.String(),
"peer(H/R)", fmt.Sprintf("%v/%v", ps.Height, ps.Round),
"blockhash", fmt.Sprintf("%X", msg.Blockhash))
ps.ProposalBlockHash = msg.Blockhash
} }
// ApplyProposalPOLMessage updates the peer state for the new proposal POL. // ApplyProposalPOLMessage updates the peer state for the new proposal POL.
...@@ -1312,7 +1371,8 @@ func (ps *PeerConnState) ApplyHasVoteMessage(msg *tmtypes.HasVoteMsg) { ...@@ -1312,7 +1371,8 @@ func (ps *PeerConnState) ApplyHasVoteMessage(msg *tmtypes.HasVoteMsg) {
return return
} }
tendermintlog.Debug("ApplyHasVoteMessage", "msg(H/R)", fmt.Sprintf("%v/%v", msg.Height, msg.Round), "peerip", ps.ip.String()) tendermintlog.Debug("ApplyHasVoteMessage", "msg(H/R)", fmt.Sprintf("%v/%v", msg.Height, msg.Round),
"peerip", ps.ip.String())
ps.setHasVote(msg.Height, int(msg.Round), byte(msg.Type), int(msg.Index)) ps.setHasVote(msg.Height, int(msg.Round), byte(msg.Type), int(msg.Index))
} }
......
...@@ -118,9 +118,9 @@ func (s State) GetValidators() (last *ttypes.ValidatorSet, current *ttypes.Valid ...@@ -118,9 +118,9 @@ func (s State) GetValidators() (last *ttypes.ValidatorSet, current *ttypes.Valid
// Create a block from the latest state // Create a block from the latest state
// MakeBlock builds a block with the given txs and commit from the current state. // MakeBlock builds a block with the given txs and commit from the current state.
func (s State) MakeBlock(height int64, round int64, Txs []*types.Transaction, commit *tmtypes.TendermintCommit) *ttypes.TendermintBlock { func (s State) MakeBlock(height int64, round int64, pblock *types.Block, commit *tmtypes.TendermintCommit, proposerAddr []byte) *ttypes.TendermintBlock {
// build base block // build base block
block := ttypes.MakeBlock(height, round, Txs, commit) block := ttypes.MakeBlock(height, round, pblock, commit)
// fill header with state data // fill header with state data
block.Header.ChainID = s.ChainID block.Header.ChainID = s.ChainID
...@@ -130,6 +130,7 @@ func (s State) MakeBlock(height int64, round int64, Txs []*types.Transaction, co ...@@ -130,6 +130,7 @@ func (s State) MakeBlock(height int64, round int64, Txs []*types.Transaction, co
block.Header.AppHash = s.AppHash block.Header.AppHash = s.AppHash
block.Header.ConsensusHash = s.ConsensusParams.Hash() block.Header.ConsensusHash = s.ConsensusParams.Hash()
block.Header.LastResultsHash = s.LastResultsHash block.Header.LastResultsHash = s.LastResultsHash
block.Header.ProposerAddr = proposerAddr
return block return block
} }
...@@ -226,6 +227,7 @@ func LoadState(state *tmtypes.State) State { ...@@ -226,6 +227,7 @@ func LoadState(state *tmtypes.State) State {
ChainID: state.GetChainID(), ChainID: state.GetChainID(),
LastBlockHeight: state.GetLastBlockHeight(), LastBlockHeight: state.GetLastBlockHeight(),
LastBlockTotalTx: state.GetLastBlockTotalTx(), LastBlockTotalTx: state.GetLastBlockTotalTx(),
LastBlockID: ttypes.BlockID{BlockID: *state.LastBlockID},
LastBlockTime: state.LastBlockTime, LastBlockTime: state.LastBlockTime,
Validators: nil, Validators: nil,
LastValidators: nil, LastValidators: nil,
...@@ -307,7 +309,7 @@ func (csdb *CSStateDB) LoadValidators(height int64) (*ttypes.ValidatorSet, error ...@@ -307,7 +309,7 @@ func (csdb *CSStateDB) LoadValidators(height int64) (*ttypes.ValidatorSet, error
if height == 0 { if height == 0 {
return nil, nil return nil, nil
} }
if csdb.state.LastBlockHeight+1 == height { if csdb.state.LastBlockHeight == height {
return csdb.state.Validators, nil return csdb.state.Validators, nil
} }
...@@ -374,6 +376,7 @@ func SaveState(state State) *tmtypes.State { ...@@ -374,6 +376,7 @@ func SaveState(state State) *tmtypes.State {
ChainID: state.ChainID, ChainID: state.ChainID,
LastBlockHeight: state.LastBlockHeight, LastBlockHeight: state.LastBlockHeight,
LastBlockTotalTx: state.LastBlockTotalTx, LastBlockTotalTx: state.LastBlockTotalTx,
LastBlockID: &state.LastBlockID.BlockID,
LastBlockTime: state.LastBlockTime, LastBlockTime: state.LastBlockTime,
Validators: &tmtypes.ValidatorSet{Validators: make([]*tmtypes.Validator, 0), Proposer: &tmtypes.Validator{}}, Validators: &tmtypes.ValidatorSet{Validators: make([]*tmtypes.Validator, 0), Proposer: &tmtypes.Validator{}},
LastValidators: &tmtypes.ValidatorSet{Validators: make([]*tmtypes.Validator, 0), Proposer: &tmtypes.Validator{}}, LastValidators: &tmtypes.ValidatorSet{Validators: make([]*tmtypes.Validator, 0), Proposer: &tmtypes.Validator{}},
...@@ -458,17 +461,14 @@ func LoadProposer(source *tmtypes.Validator) (*ttypes.Validator, error) { ...@@ -458,17 +461,14 @@ func LoadProposer(source *tmtypes.Validator) (*ttypes.Validator, error) {
} }
// CreateBlockInfoTx make blockInfo to the first transaction of the block and execer is valnode // CreateBlockInfoTx make blockInfo to the first transaction of the block and execer is valnode
func CreateBlockInfoTx(pubkey string, lastCommit *tmtypes.TendermintCommit, seenCommit *tmtypes.TendermintCommit, state *tmtypes.State, proposal *tmtypes.Proposal, block *tmtypes.TendermintBlock) *types.Transaction { func CreateBlockInfoTx(pubkey string, state *tmtypes.State, block *tmtypes.TendermintBlock) *types.Transaction {
blockNoTxs := *block blockSave := *block
blockNoTxs.Txs = make([]*types.Transaction, 0) blockSave.Data = nil
blockInfo := &tmtypes.TendermintBlockInfo{ blockInfo := &tmtypes.TendermintBlockInfo{
SeenCommit: seenCommit, State: state,
LastCommit: lastCommit, Block: &blockSave,
State: state,
Proposal: proposal,
Block: &blockNoTxs,
} }
tendermintlog.Debug("CreateBlockInfoTx", "validators", blockInfo.State.Validators.Validators, "block", block, "block-notxs", blockNoTxs) tendermintlog.Debug("CreateBlockInfoTx", "blockInfo", blockInfo)
nput := &tmtypes.ValNodeAction_BlockInfo{BlockInfo: blockInfo} nput := &tmtypes.ValNodeAction_BlockInfo{BlockInfo: blockInfo}
action := &tmtypes.ValNodeAction{Value: nput, Ty: tmtypes.ValNodeActionBlockInfo} action := &tmtypes.ValNodeAction{Value: nput, Ty: tmtypes.ValNodeActionBlockInfo}
......
package tendermint
import (
"fmt"
dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/types"
tmtypes "github.com/33cn/plugin/plugin/dapp/valnode/types"
)
var (
stateKey = []byte("stateKey")
)
type ConsensusStore struct {
db dbm.DB
}
// NewConsensusStore returns a new ConsensusStore with the given DB
func NewConsensusStore() *ConsensusStore {
db := DefaultDBProvider("state")
db.SetCacheSize(100)
return &ConsensusStore{
db: db,
}
}
// LoadStateFromStore
func (cs *ConsensusStore) LoadStateFromStore() *tmtypes.State {
buf, err := cs.db.Get(stateKey)
if err != nil {
tendermintlog.Error("LoadStateFromStore", "err", err)
return nil
}
state := &tmtypes.State{}
err = types.Decode(buf, state)
if err != nil {
panic(err)
}
return state
}
// LoadStateHeight
func (cs *ConsensusStore) LoadStateHeight() int64 {
state := cs.LoadStateFromStore()
if state == nil {
return int64(0)
}
return state.LastBlockHeight
}
// LoadSeenCommit by height
func (cs *ConsensusStore) LoadSeenCommit(height int64) *tmtypes.TendermintCommit {
buf, err := cs.db.Get(calcSeenCommitKey(height))
if err != nil {
tendermintlog.Error("LoadSeenCommit", "err", err)
return nil
}
commit := &tmtypes.TendermintCommit{}
err = types.Decode(buf, commit)
if err != nil {
panic(err)
}
return commit
}
// SaveConsensusState save state and seenCommit
func (cs *ConsensusStore) SaveConsensusState(height int64, state *tmtypes.State, sc *tmtypes.TendermintCommit) error {
seenCommitBytes := types.Encode(sc)
stateBytes := types.Encode(state)
batch := cs.db.NewBatch(true)
batch.Set(calcSeenCommitKey(height), seenCommitBytes)
batch.Set(stateKey, stateBytes)
err := batch.Write()
if err != nil {
tendermintlog.Error("SaveConsensusState batch.Write", "err", err)
return err
}
return nil
}
func calcSeenCommitKey(height int64) []byte {
return []byte(fmt.Sprintf("SC:%v", height))
}
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
package tendermint package tendermint
import ( import (
"bytes"
"fmt" "fmt"
"os"
"time" "time"
"github.com/33cn/chain33/common/crypto" "github.com/33cn/chain33/common/crypto"
...@@ -38,6 +40,7 @@ var ( ...@@ -38,6 +40,7 @@ var (
timeoutCommit int32 = 1000 timeoutCommit int32 = 1000
skipTimeoutCommit = false skipTimeoutCommit = false
createEmptyBlocks = false createEmptyBlocks = false
fastSync = false
createEmptyBlocksInterval int32 // second createEmptyBlocksInterval int32 // second
validatorNodes = []string{"127.0.0.1:46656"} validatorNodes = []string{"127.0.0.1:46656"}
peerGossipSleepDuration int32 = 100 peerGossipSleepDuration int32 = 100
...@@ -59,6 +62,7 @@ type Client struct { ...@@ -59,6 +62,7 @@ type Client struct {
privKey crypto.PrivKey // local node's p2p key privKey crypto.PrivKey // local node's p2p key
pubKey string pubKey string
csState *ConsensusState csState *ConsensusState
csStore *ConsensusStore // save consensus state
evidenceDB dbm.DB evidenceDB dbm.DB
crypto crypto.Crypto crypto crypto.Crypto
node *Node node *Node
...@@ -81,6 +85,7 @@ type subConfig struct { ...@@ -81,6 +85,7 @@ type subConfig struct {
CreateEmptyBlocks bool `json:"createEmptyBlocks"` CreateEmptyBlocks bool `json:"createEmptyBlocks"`
CreateEmptyBlocksInterval int32 `json:"createEmptyBlocksInterval"` CreateEmptyBlocksInterval int32 `json:"createEmptyBlocksInterval"`
ValidatorNodes []string `json:"validatorNodes"` ValidatorNodes []string `json:"validatorNodes"`
FastSync bool `json:"fastSync"`
} }
func (client *Client) applyConfig(sub []byte) { func (client *Client) applyConfig(sub []byte) {
...@@ -126,12 +131,13 @@ func (client *Client) applyConfig(sub []byte) { ...@@ -126,12 +131,13 @@ func (client *Client) applyConfig(sub []byte) {
if len(subcfg.ValidatorNodes) > 0 { if len(subcfg.ValidatorNodes) > 0 {
validatorNodes = subcfg.ValidatorNodes validatorNodes = subcfg.ValidatorNodes
} }
fastSync = subcfg.FastSync
} }
// DefaultDBProvider returns a database using the DBBackend and DBDir // DefaultDBProvider returns a database using the DBBackend and DBDir
// specified in the ctx.Config. // specified in the ctx.Config.
func DefaultDBProvider(ID string) (dbm.DB, error) { func DefaultDBProvider(name string) dbm.DB {
return dbm.NewDB(ID, "leveldb", "./datadir", 0), nil return dbm.NewDB(name, "leveldb", fmt.Sprintf("datadir%stendermint", string(os.PathSeparator)), 0)
} }
// New ... // New ...
...@@ -140,18 +146,14 @@ func New(cfg *types.Consensus, sub []byte) queue.Module { ...@@ -140,18 +146,14 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
//init rand //init rand
ttypes.Init() ttypes.Init()
genDoc, err := ttypes.GenesisDocFromFile("./genesis.json") genDoc, err := ttypes.GenesisDocFromFile("genesis.json")
if err != nil { if err != nil {
tendermintlog.Error("NewTendermintClient", "msg", "GenesisDocFromFile failded", "error", err) tendermintlog.Error("NewTendermintClient", "msg", "GenesisDocFromFile failded", "error", err)
return nil return nil
} }
// Make Evidence Reactor // Make Evidence Reactor
evidenceDB, err := DefaultDBProvider("CSevidence") evidenceDB := DefaultDBProvider("evidence")
if err != nil {
tendermintlog.Error("NewTendermintClient", "msg", "DefaultDBProvider evidenceDB failded", "error", err)
return nil
}
cr, err := crypto.New(types.GetSignName("", types.ED25519)) cr, err := crypto.New(types.GetSignName("", types.ED25519))
if err != nil { if err != nil {
...@@ -167,7 +169,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module { ...@@ -167,7 +169,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
return nil return nil
} }
privValidator := ttypes.LoadOrGenPrivValidatorFS("./priv_validator.json") privValidator := ttypes.LoadOrGenPrivValidatorFS("priv_validator.json")
if privValidator == nil { if privValidator == nil {
tendermintlog.Error("NewTendermintClient create priv_validator file failed") tendermintlog.Error("NewTendermintClient create priv_validator file failed")
return nil return nil
...@@ -183,6 +185,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module { ...@@ -183,6 +185,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
privValidator: privValidator, privValidator: privValidator,
privKey: priv, privKey: priv,
pubKey: pubkey, pubKey: pubkey,
csStore: NewConsensusStore(),
evidenceDB: evidenceDB, evidenceDB: evidenceDB,
crypto: cr, crypto: cr,
txsAvailable: make(chan int64, 1), txsAvailable: make(chan int64, 1),
...@@ -223,16 +226,13 @@ func (client *Client) SetQueueClient(q queue.Client) { ...@@ -223,16 +226,13 @@ func (client *Client) SetQueueClient(q queue.Client) {
go client.StartConsensus() go client.StartConsensus()
} }
// DebugCatchup define whether catch up now
const DebugCatchup = false
// StartConsensus a routine that make the consensus start // StartConsensus a routine that make the consensus start
func (client *Client) StartConsensus() { func (client *Client) StartConsensus() {
//进入共识前先同步到最大高度 //进入共识前先同步到最大高度
hint := time.NewTicker(5 * time.Second) hint := time.NewTicker(5 * time.Second)
beg := time.Now() beg := time.Now()
OuterLoop: OuterLoop:
for !DebugCatchup { for fastSync {
select { select {
case <-hint.C: case <-hint.C:
tendermintlog.Info("Still catching up max height......", "Height", client.GetCurrentHeight(), "cost", time.Since(beg)) tendermintlog.Info("Still catching up max height......", "Height", client.GetCurrentHeight(), "cost", time.Since(beg))
...@@ -246,60 +246,46 @@ OuterLoop: ...@@ -246,60 +246,46 @@ OuterLoop:
} }
hint.Stop() hint.Stop()
curHeight := client.GetCurrentHeight() // load state
blockInfo, err := client.QueryBlockInfoByHeight(curHeight)
if curHeight != 0 && err != nil {
tendermintlog.Error("StartConsensus GetBlockInfo failed", "error", err)
panic(fmt.Sprintf("StartConsensus GetBlockInfo failed:%v", err))
}
var state State var state State
if blockInfo == nil { if client.GetCurrentHeight() == 0 {
if curHeight != 0 { genState, err := MakeGenesisState(client.genesisDoc)
tendermintlog.Error("StartConsensus", "msg", "block height is not 0 but blockinfo is nil")
panic(fmt.Sprintf("StartConsensus block height is %v but block info is nil", curHeight))
}
statetmp, err := MakeGenesisState(client.genesisDoc)
if err != nil { if err != nil {
tendermintlog.Error("StartConsensus", "msg", "MakeGenesisState failded", "error", err) panic(fmt.Sprintf("StartConsensus MakeGenesisState fail:%v", err))
return }
state = genState.Copy()
} else if client.GetCurrentHeight() <= client.csStore.LoadStateHeight() {
stoState := client.csStore.LoadStateFromStore()
if stoState == nil {
panic("StartConsensus LoadStateFromStore fail")
} }
state = statetmp.Copy() state = LoadState(stoState)
tendermintlog.Info("Load state from store")
} else { } else {
tendermintlog.Debug("StartConsensus", "blockinfo", blockInfo) height := client.GetCurrentHeight()
csState := blockInfo.GetState() blkState := client.LoadBlockState(height)
if csState == nil { if blkState == nil {
tendermintlog.Error("StartConsensus", "msg", "blockInfo.GetState is nil") panic("StartConsensus LoadBlockState fail")
return
} }
state = LoadState(csState) state = LoadState(blkState)
if seenCommit := blockInfo.SeenCommit; seenCommit != nil { tendermintlog.Info("Load state from block")
state.LastBlockID = ttypes.BlockID{ //save initial state in store
BlockID: tmtypes.BlockID{ blkCommit := client.LoadBlockCommit(height)
Hash: seenCommit.BlockID.GetHash(), if blkCommit == nil {
}, panic("StartConsensus LoadBlockCommit fail")
}
} }
} err := client.csStore.SaveConsensusState(height-1, blkState, blkCommit)
if err != nil {
tendermintlog.Debug("Load state finish", "state", state) panic(fmt.Sprintf("StartConsensus SaveConsensusState fail: %v", err))
valNodes, err := client.QueryValidatorsByHeight(curHeight)
if err == nil && valNodes != nil {
if len(valNodes.Nodes) > 0 {
tendermintlog.Info("StartConsensus validators update", "update-valnodes", valNodes)
prevValSet := state.LastValidators.Copy()
nextValSet := prevValSet.Copy()
err := updateValidators(nextValSet, valNodes.Nodes)
if err != nil {
tendermintlog.Error("Error changing validator set", "error", err)
}
// change results from this height but only applies to the next height
state.LastHeightValidatorsChanged = curHeight + 1
nextValSet.IncrementAccum(1)
state.Validators = nextValSet
} }
tendermintlog.Info("Save state from block")
} }
tendermintlog.Info("StartConsensus", "validators", state.Validators) tendermintlog.Debug("Load state finish", "state", state)
// start
tendermintlog.Info("StartConsensus",
"privValidator", fmt.Sprintf("%X", ttypes.Fingerprint(client.privValidator.GetAddress())),
"Validators", state.Validators.String())
// Log whether this node is a validator or an observer // Log whether this node is a validator or an observer
if state.Validators.HasAddress(client.privValidator.GetAddress()) { if state.Validators.HasAddress(client.privValidator.GetAddress()) {
tendermintlog.Info("This node is a validator") tendermintlog.Info("This node is a validator")
...@@ -353,8 +339,57 @@ func (client *Client) CreateGenesisTx() (ret []*types.Transaction) { ...@@ -353,8 +339,57 @@ func (client *Client) CreateGenesisTx() (ret []*types.Transaction) {
return return
} }
func (client *Client) getBlockInfoTx(current *types.Block) (*tmtypes.ValNodeAction, error) {
//检查第一个笔交易的execs, 以及执行状态
if len(current.Txs) == 0 {
return nil, types.ErrEmptyTx
}
baseTx := current.Txs[0]
//判断交易类型和执行情况
var valAction tmtypes.ValNodeAction
err := types.Decode(baseTx.GetPayload(), &valAction)
if err != nil {
return nil, err
}
if valAction.GetTy() != tmtypes.ValNodeActionBlockInfo {
return nil, ttypes.ErrBaseTxType
}
//判断交易执行是否OK
if valAction.GetBlockInfo() == nil {
return nil, ttypes.ErrBlockInfoTx
}
return &valAction, nil
}
// CheckBlock 暂不检查任何的交易 // CheckBlock 暂不检查任何的交易
func (client *Client) CheckBlock(parent *types.Block, current *types.BlockDetail) error { func (client *Client) CheckBlock(parent *types.Block, current *types.BlockDetail) error {
if current.Block.Difficulty != types.GetP(0).PowLimitBits {
return types.ErrBlockHeaderDifficulty
}
valAction, err := client.getBlockInfoTx(current.Block)
if err != nil {
return err
}
if parent.Height+1 != current.Block.Height {
return types.ErrBlockHeight
}
//判断exec 是否成功
if current.Receipts[0].Ty != types.ExecOk {
return ttypes.ErrBaseExecErr
}
info := valAction.GetBlockInfo()
if current.Block.Height > 1 {
lastValAction, err := client.getBlockInfoTx(parent)
if err != nil {
return err
}
lastInfo := lastValAction.GetBlockInfo()
lastProposalBlock := &ttypes.TendermintBlock{TendermintBlock: lastInfo.GetBlock()}
lastProposalBlock.Data = parent
if !lastProposalBlock.HashesTo(info.Block.Header.LastBlockID.Hash) {
return ttypes.ErrLastBlockID
}
}
return nil return nil
} }
...@@ -416,58 +451,65 @@ func (client *Client) CheckTxDup(txs []*types.Transaction, height int64) (transa ...@@ -416,58 +451,65 @@ func (client *Client) CheckTxDup(txs []*types.Transaction, height int64) (transa
return types.CacheToTxs(cacheTxs) return types.CacheToTxs(cacheTxs)
} }
// BuildBlock build a new block contains some transactions // BuildBlock build a new block
func (client *Client) BuildBlock() *types.Block { func (client *Client) BuildBlock() *types.Block {
lastHeight := client.GetCurrentHeight() lastBlock := client.GetCurrentBlock()
txs := client.RequestTx(int(types.GetP(lastHeight+1).MaxTxNumber)-1, nil) txs := client.RequestTx(int(types.GetP(lastBlock.Height+1).MaxTxNumber)-1, nil)
newblock := &types.Block{} // placeholder
newblock.Height = lastHeight + 1 tx0 := &types.Transaction{}
client.AddTxsToBlock(newblock, txs) txs = append([]*types.Transaction{tx0}, txs...)
return newblock
}
// CommitBlock call WriteBlock to real commit to chain var newblock types.Block
func (client *Client) CommitBlock(propBlock *types.Block) error {
newblock := *propBlock
lastBlock, err := client.RequestBlock(newblock.Height - 1)
if err != nil {
tendermintlog.Error("RequestBlock fail", "err", err)
return err
}
newblock.ParentHash = lastBlock.Hash() newblock.ParentHash = lastBlock.Hash()
newblock.TxHash = merkle.CalcMerkleRoot(newblock.Txs) newblock.Height = lastBlock.Height + 1
newblock.BlockTime = time.Now().Unix() client.AddTxsToBlock(&newblock, txs)
//固定难度
newblock.Difficulty = types.GetP(0).PowLimitBits
//newblock.TxHash = merkle.CalcMerkleRoot(newblock.Txs)
newblock.BlockTime = types.Now().Unix()
if lastBlock.BlockTime >= newblock.BlockTime { if lastBlock.BlockTime >= newblock.BlockTime {
newblock.BlockTime = lastBlock.BlockTime + 1 newblock.BlockTime = lastBlock.BlockTime + 1
} }
newblock.Difficulty = types.GetP(0).PowLimitBits return &newblock
}
err = client.WriteBlock(lastBlock.StateHash, &newblock) // CommitBlock call WriteBlock to commit to chain
if err != nil { func (client *Client) CommitBlock(block *types.Block) error {
tendermintlog.Error(fmt.Sprintf("********************CommitBlock err:%v", err.Error())) retErr := client.WriteBlock(nil, block)
return err if retErr != nil {
} tendermintlog.Info("CommitBlock fail", "err", retErr)
tendermintlog.Info("Commit block success", "height", newblock.Height, "CurrentHeight", client.GetCurrentHeight()) if client.WaitBlock(block.Height) == true {
if client.GetCurrentHeight() != newblock.Height { curBlock, err := client.RequestBlock(block.Height)
tendermintlog.Warn("Commit block fail", "height", newblock.Height, "CurrentHeight", client.GetCurrentHeight()) if err == nil {
if bytes.Equal(curBlock.Hash(), block.Hash()) {
tendermintlog.Info("already has block")
return nil
}
tendermintlog.Info("block is different", "block", block, "curBlock", curBlock)
if bytes.Equal(curBlock.Txs[0].Hash(), block.Txs[0].Hash()) {
tendermintlog.Warn("base tx is same, origin maybe same")
return nil
}
}
}
return retErr
} }
return nil return nil
} }
// CheckCommit by height // WaitBlock by height
func (client *Client) CheckCommit(height int64) bool { func (client *Client) WaitBlock(height int64) bool {
retry := 0 retry := 0
var newHeight int64 var newHeight int64
for { for {
newHeight = client.GetCurrentHeight() newHeight = client.GetCurrentHeight()
if newHeight >= height { if newHeight >= height {
tendermintlog.Info("Sync block success", "height", height, "CurrentHeight", newHeight)
return true return true
} }
retry++ retry++
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
if retry >= 600 { if retry >= 100 {
tendermintlog.Warn("Sync block fail", "height", height, "CurrentHeight", newHeight) tendermintlog.Warn("Wait block fail", "height", height, "CurrentHeight", newHeight)
return false return false
} }
} }
...@@ -493,6 +535,7 @@ func (client *Client) QueryValidatorsByHeight(height int64) (*tmtypes.ValNodes, ...@@ -493,6 +535,7 @@ func (client *Client) QueryValidatorsByHeight(height int64) (*tmtypes.ValNodes,
} }
msg, err = client.GetQueueClient().Wait(msg) msg, err = client.GetQueueClient().Wait(msg)
if err != nil { if err != nil {
tendermintlog.Info("QueryValidatorsByHeight result", "err", err)
return nil, err return nil, err
} }
return msg.GetData().(types.Message).(*tmtypes.ValNodes), nil return msg.GetData().(types.Message).(*tmtypes.ValNodes), nil
...@@ -523,30 +566,32 @@ func (client *Client) QueryBlockInfoByHeight(height int64) (*tmtypes.TendermintB ...@@ -523,30 +566,32 @@ func (client *Client) QueryBlockInfoByHeight(height int64) (*tmtypes.TendermintB
return msg.GetData().(types.Message).(*tmtypes.TendermintBlockInfo), nil return msg.GetData().(types.Message).(*tmtypes.TendermintBlockInfo), nil
} }
// LoadSeenCommit by height // LoadBlockCommit by height
func (client *Client) LoadSeenCommit(height int64) *tmtypes.TendermintCommit { func (client *Client) LoadBlockCommit(height int64) *tmtypes.TendermintCommit {
blockInfo, err := client.QueryBlockInfoByHeight(height) blockInfo, err := client.QueryBlockInfoByHeight(height)
if err != nil { if err != nil {
panic(fmt.Sprintf("LoadSeenCommit GetBlockInfo failed:%v", err)) tendermintlog.Error("LoadBlockCommit GetBlockInfo fail", "err", err)
return nil
} }
if blockInfo == nil { if blockInfo == nil {
tendermintlog.Error("LoadSeenCommit get nil block info") tendermintlog.Error("LoadBlockCommit get nil block info")
return nil return nil
} }
return blockInfo.GetSeenCommit() return blockInfo.GetBlock().GetLastCommit()
} }
// LoadBlockCommit by height // LoadBlockState by height
func (client *Client) LoadBlockCommit(height int64) *tmtypes.TendermintCommit { func (client *Client) LoadBlockState(height int64) *tmtypes.State {
blockInfo, err := client.QueryBlockInfoByHeight(height) blockInfo, err := client.QueryBlockInfoByHeight(height)
if err != nil { if err != nil {
panic(fmt.Sprintf("LoadBlockCommit GetBlockInfo failed:%v", err)) tendermintlog.Error("LoadBlockState GetBlockInfo fail", "err", err)
return nil
} }
if blockInfo == nil { if blockInfo == nil {
tendermintlog.Error("LoadBlockCommit get nil block info") tendermintlog.Error("LoadBlockState get nil block info")
return nil return nil
} }
return blockInfo.GetLastCommit() return blockInfo.GetState()
} }
// LoadProposalBlock by height // LoadProposalBlock by height
...@@ -567,8 +612,8 @@ func (client *Client) LoadProposalBlock(height int64) *tmtypes.TendermintBlock { ...@@ -567,8 +612,8 @@ func (client *Client) LoadProposalBlock(height int64) *tmtypes.TendermintBlock {
proposalBlock := blockInfo.GetBlock() proposalBlock := blockInfo.GetBlock()
if proposalBlock != nil { if proposalBlock != nil {
proposalBlock.Txs = append(proposalBlock.Txs, block.Txs[1:]...) proposalBlock.Data = block
txHash := merkle.CalcMerkleRoot(proposalBlock.Txs) txHash := merkle.CalcMerkleRoot(proposalBlock.Data.Txs)
tendermintlog.Debug("LoadProposalBlock txs hash", "height", proposalBlock.Header.Height, "tx-hash", fmt.Sprintf("%X", txHash)) tendermintlog.Debug("LoadProposalBlock txs hash", "height", proposalBlock.Header.Height, "tx-hash", fmt.Sprintf("%X", txHash))
} }
return proposalBlock return proposalBlock
......
...@@ -68,12 +68,12 @@ func TendermintPerf() { ...@@ -68,12 +68,12 @@ func TendermintPerf() {
for err != nil { for err != nil {
err = createConn() err = createConn()
} }
time.Sleep(10 * time.Second) time.Sleep(2 * time.Second)
for i := 0; i < loopCount; i++ { for i := 0; i < loopCount; i++ {
NormPut() NormPut()
time.Sleep(time.Second) time.Sleep(time.Second)
} }
time.Sleep(10 * time.Second) time.Sleep(2 * time.Second)
} }
func initEnvTendermint() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module) { func initEnvTendermint() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module) {
......
...@@ -58,18 +58,19 @@ type TendermintBlock struct { ...@@ -58,18 +58,19 @@ type TendermintBlock struct {
// MakeBlock returns a new block with an empty header, except what can be computed from itself. // 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 // It populates the same set of fields validated by ValidateBasic
func MakeBlock(height int64, round int64, Txs []*types.Transaction, commit *tmtypes.TendermintCommit) *TendermintBlock { func MakeBlock(height int64, round int64, pblock *types.Block, commit *tmtypes.TendermintCommit) *TendermintBlock {
block := &TendermintBlock{&tmtypes.TendermintBlock{ block := &TendermintBlock{
Header: &tmtypes.TendermintBlockHeader{ &tmtypes.TendermintBlock{
Height: height, Header: &tmtypes.TendermintBlockHeader{
Round: round, Height: height,
Time: time.Now().UnixNano(), Round: round,
NumTxs: int64(len(Txs)), Time: pblock.BlockTime,
NumTxs: int64(len(pblock.Txs)),
},
Data: pblock,
LastCommit: commit,
Evidence: &tmtypes.EvidenceData{Evidence: make([]*tmtypes.EvidenceEnvelope, 0)},
}, },
Txs: Txs,
LastCommit: commit,
Evidence: &tmtypes.EvidenceData{Evidence: make([]*tmtypes.EvidenceEnvelope, 0)},
},
} }
block.FillHeader() block.FillHeader()
return block return block
...@@ -97,7 +98,7 @@ func (b *TendermintBlock) AddEvidence(evidence []Evidence) { ...@@ -97,7 +98,7 @@ func (b *TendermintBlock) AddEvidence(evidence []Evidence) {
// ValidateBasic performs basic validation that doesn't involve state data. // ValidateBasic performs basic validation that doesn't involve state data.
// It checks the internal consistency of the block. // It checks the internal consistency of the block.
func (b *TendermintBlock) ValidateBasic() (int64, error) { func (b *TendermintBlock) ValidateBasic() (int64, error) {
newTxs := int64(len(b.Txs)) newTxs := int64(len(b.Data.Txs))
if b.Header.NumTxs != newTxs { if b.Header.NumTxs != newTxs {
return 0, fmt.Errorf("Wrong Block.Header.NumTxs. Expected %v, got %v", newTxs, b.Header.NumTxs) return 0, fmt.Errorf("Wrong Block.Header.NumTxs. Expected %v, got %v", newTxs, b.Header.NumTxs)
...@@ -247,17 +248,13 @@ func (h *Header) StringIndented(indent string) string { ...@@ -247,17 +248,13 @@ func (h *Header) StringIndented(indent string) string {
// Commit struct // Commit struct
type Commit struct { type Commit struct {
*tmtypes.TendermintCommit *tmtypes.TendermintCommit
firstPrecommit *tmtypes.Vote
hash []byte hash []byte
bitArray *BitArray bitArray *BitArray
firstPrecommit *tmtypes.Vote
} }
// FirstPrecommit returns the first non-nil precommit in the commit // FirstPrecommit returns the first non-nil precommit in the commit
func (commit *Commit) FirstPrecommit() *tmtypes.Vote { func (commit *Commit) FirstPrecommit() *tmtypes.Vote {
if len(commit.Precommits) == 0 {
return nil
}
if commit.firstPrecommit != nil { if commit.firstPrecommit != nil {
return commit.firstPrecommit return commit.firstPrecommit
} }
......
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package types
import "errors"
var (
// ErrBaseTxType error type
ErrBaseTxType = errors.New("ErrBaseTxType")
// ErrBlockInfoTx error type
ErrBlockInfoTx = errors.New("ErrBlockInfoTx")
// ErrBaseExecErr error type
ErrBaseExecErr = errors.New("ErrBaseExecErr")
// ErrLastBlockID error type
ErrLastBlockID = errors.New("ErrLastBlockID")
)
...@@ -440,7 +440,7 @@ func (pv *PrivValidatorImp) SignHeartbeat(chainID string, heartbeat *Heartbeat) ...@@ -440,7 +440,7 @@ func (pv *PrivValidatorImp) SignHeartbeat(chainID string, heartbeat *Heartbeat)
// String returns a string representation of the PrivValidatorImp. // String returns a string representation of the PrivValidatorImp.
func (pv *PrivValidatorImp) String() string { func (pv *PrivValidatorImp) String() string {
return Fmt("PrivValidator{%v LH:%v, LR:%v, LS:%v}", pv.GetAddress(), pv.LastHeight, pv.LastRound, pv.LastStep) return Fmt("PrivValidator{%X LH:%v, LR:%v, LS:%v}", pv.GetAddress(), pv.LastHeight, pv.LastRound, pv.LastStep)
} }
// GetLastHeight ... // GetLastHeight ...
......
...@@ -39,10 +39,11 @@ const ( ...@@ -39,10 +39,11 @@ const (
ProposalPOLID = byte(0x05) ProposalPOLID = byte(0x05)
VoteID = byte(0x06) VoteID = byte(0x06)
HasVoteID = byte(0x07) HasVoteID = byte(0x07)
VoteSetMaj23ID = byte(0X08) VoteSetMaj23ID = byte(0x08)
VoteSetBitsID = byte(0x09) VoteSetBitsID = byte(0x09)
ProposalHeartbeatID = byte(0x0a) ProposalHeartbeatID = byte(0x0a)
ProposalBlockID = byte(0x0b) ProposalBlockID = byte(0x0b)
ValidBlockID = byte(0x0c)
PacketTypePing = byte(0xff) PacketTypePing = byte(0xff)
PacketTypePong = byte(0xfe) PacketTypePong = byte(0xfe)
...@@ -62,6 +63,7 @@ func InitMessageMap() { ...@@ -62,6 +63,7 @@ func InitMessageMap() {
VoteSetBitsID: reflect.TypeOf(tmtypes.VoteSetBitsMsg{}), VoteSetBitsID: reflect.TypeOf(tmtypes.VoteSetBitsMsg{}),
ProposalHeartbeatID: reflect.TypeOf(tmtypes.Heartbeat{}), ProposalHeartbeatID: reflect.TypeOf(tmtypes.Heartbeat{}),
ProposalBlockID: reflect.TypeOf(tmtypes.TendermintBlock{}), ProposalBlockID: reflect.TypeOf(tmtypes.TendermintBlock{}),
ValidBlockID: reflect.TypeOf(tmtypes.ValidBlockMsg{}),
} }
} }
...@@ -108,6 +110,8 @@ type RoundState struct { ...@@ -108,6 +110,8 @@ type RoundState struct {
ProposalBlock *TendermintBlock ProposalBlock *TendermintBlock
LockedRound int LockedRound int
LockedBlock *TendermintBlock LockedBlock *TendermintBlock
ValidRound int // Last known round with POL for non-nil valid block.
ValidBlock *TendermintBlock // Last known block of POL mentioned above.
Votes *HeightVoteSet Votes *HeightVoteSet
CommitRound int CommitRound int
LastCommit *VoteSet // Last precommits at Height-1 LastCommit *VoteSet // Last precommits at Height-1
...@@ -117,9 +121,9 @@ type RoundState struct { ...@@ -117,9 +121,9 @@ type RoundState struct {
// RoundStateMessage ... // RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg { func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{ return &tmtypes.NewRoundStepMsg{
Height: rs.Height, Height: rs.Height,
Round: int32(rs.Round), Round: int32(rs.Round),
Step: int32(rs.Step), Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()), SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()), LastCommitRound: int32(rs.LastCommit.Round()),
} }
...@@ -141,6 +145,8 @@ func (rs *RoundState) StringIndented(indent string) string { ...@@ -141,6 +145,8 @@ func (rs *RoundState) StringIndented(indent string) string {
%s ProposalBlock: %v %s ProposalBlock: %v
%s LockedRound: %v %s LockedRound: %v
%s LockedBlock: %v %s LockedBlock: %v
%s ValidRound: %v
%s ValidBlock: %v
%s Votes: %v %s Votes: %v
%s LastCommit: %v %s LastCommit: %v
%s LastValidators:%v %s LastValidators:%v
...@@ -153,6 +159,8 @@ func (rs *RoundState) StringIndented(indent string) string { ...@@ -153,6 +159,8 @@ func (rs *RoundState) StringIndented(indent string) string {
indent, rs.ProposalBlock.StringShort(), indent, rs.ProposalBlock.StringShort(),
indent, rs.LockedRound, indent, rs.LockedRound,
indent, rs.LockedBlock.StringShort(), indent, rs.LockedBlock.StringShort(),
indent, rs.ValidRound,
indent, rs.ValidBlock.StringShort(),
indent, rs.Votes.StringIndented(indent+" "), indent, rs.Votes.StringIndented(indent+" "),
indent, rs.LastCommit.StringShort(), indent, rs.LastCommit.StringShort(),
indent, rs.LastValidators.StringIndented(indent+" "), indent, rs.LastValidators.StringIndented(indent+" "),
...@@ -173,14 +181,15 @@ type PeerRoundState struct { ...@@ -173,14 +181,15 @@ type PeerRoundState struct {
StartTime time.Time // Estimated start of round 0 at this height StartTime time.Time // Estimated start of round 0 at this height
Proposal bool // True if peer has proposal for this round Proposal bool // True if peer has proposal for this round
ProposalBlock bool // True if peer has proposal block for this round ProposalBlock bool // True if peer has proposal block for this round
ProposalPOLRound int // Proposal's POL round. -1 if none. ProposalBlockHash []byte
ProposalPOL *BitArray // nil until ProposalPOLMessage received. ProposalPOLRound int // Proposal's POL round. -1 if none.
Prevotes *BitArray // All votes peer has for this round ProposalPOL *BitArray // nil until ProposalPOLMessage received.
Precommits *BitArray // All precommits peer has for this round Prevotes *BitArray // All votes peer has for this round
LastCommitRound int // Round of commit for last height. -1 if none. Precommits *BitArray // All precommits peer has for this round
LastCommit *BitArray // All commit precommits of commit for last height. LastCommitRound int // Round of commit for last height. -1 if none.
CatchupCommitRound int // Round that we have commit for. Not necessarily unique. -1 if none. LastCommit *BitArray // All commit precommits of commit for last height.
CatchupCommit *BitArray // All commit precommits peer has for this height & CatchupCommitRound 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
} }
// String returns a string representation of the PeerRoundState // String returns a string representation of the PeerRoundState
...@@ -194,6 +203,7 @@ func (prs PeerRoundState) StringIndented(indent string) string { ...@@ -194,6 +203,7 @@ func (prs PeerRoundState) StringIndented(indent string) string {
%s %v/%v/%v @%v %s %v/%v/%v @%v
%s Proposal %v %s Proposal %v
%s ProposalBlock %v %s ProposalBlock %v
%s ProposalBlockHash %X
%s POL %v (round %v) %s POL %v (round %v)
%s Prevotes %v %s Prevotes %v
%s Precommits %v %s Precommits %v
...@@ -203,6 +213,7 @@ func (prs PeerRoundState) StringIndented(indent string) string { ...@@ -203,6 +213,7 @@ func (prs PeerRoundState) StringIndented(indent string) string {
indent, prs.Height, prs.Round, prs.Step, prs.StartTime, indent, prs.Height, prs.Round, prs.Step, prs.StartTime,
indent, prs.Proposal, indent, prs.Proposal,
indent, prs.ProposalBlock, indent, prs.ProposalBlock,
indent, prs.ProposalBlock,
indent, prs.ProposalPOL, prs.ProposalPOLRound, indent, prs.ProposalPOL, prs.ProposalPOLRound,
indent, prs.Prevotes, indent, prs.Prevotes,
indent, prs.Precommits, indent, prs.Precommits,
......
...@@ -70,7 +70,7 @@ func NewProposal(height int64, round int, blockhash []byte, polRound int, polBlo ...@@ -70,7 +70,7 @@ func NewProposal(height int64, round int, blockhash []byte, polRound int, polBlo
// String returns a string representation of the Proposal. // String returns a string representation of the Proposal.
func (p *Proposal) String() string { func (p *Proposal) String() string {
return fmt.Sprintf("Proposal{%v/%v (%v,%v) %X %v @ %s}", return fmt.Sprintf("Proposal{%v/%v (%v, %X) %X %X @ %s}",
p.Height, p.Round, p.POLRound, p.POLBlockID, p.Height, p.Round, p.POLRound, p.POLBlockID,
p.Blockhash, p.Signature, CanonicalTime(time.Unix(0, p.Timestamp))) p.Blockhash, p.Signature, CanonicalTime(time.Unix(0, p.Timestamp)))
} }
...@@ -211,7 +211,7 @@ func (vote *Vote) String() string { ...@@ -211,7 +211,7 @@ func (vote *Vote) String() string {
PanicSanity("Unknown vote type") PanicSanity("Unknown vote type")
} }
return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %v @ %s}", return fmt.Sprintf("Vote{%v:%X %v/%02d/%v(%v) %X %X @ %s}",
vote.ValidatorIndex, Fingerprint(vote.ValidatorAddress), vote.ValidatorIndex, Fingerprint(vote.ValidatorAddress),
vote.Height, vote.Round, vote.Type, typeString, vote.Height, vote.Round, vote.Type, typeString,
Fingerprint(vote.BlockID.Hash), vote.Signature, Fingerprint(vote.BlockID.Hash), vote.Signature,
......
...@@ -70,7 +70,7 @@ func (v *Validator) String() string { ...@@ -70,7 +70,7 @@ func (v *Validator) String() string {
if v == nil { if v == nil {
return "nil-Validator" return "nil-Validator"
} }
return Fmt("Validator{%v %v VP:%v A:%v}", return Fmt("Validator{ADDR:%X PUB:%X VP:%v A:%v}",
v.Address, v.Address,
v.PubKey, v.PubKey,
v.VotingPower, v.VotingPower,
......
syntax = "proto3"; syntax = "proto3";
import "transaction.proto"; import "blockchain.proto";
package types; package types;
...@@ -30,11 +30,9 @@ message TendermintCommit { ...@@ -30,11 +30,9 @@ message TendermintCommit {
} }
message TendermintBlockInfo { message TendermintBlockInfo {
TendermintCommit SeenCommit = 1; State State = 2;
TendermintCommit LastCommit = 2; Proposal Proposal = 3;
State State = 3; TendermintBlock block = 4;
Proposal Proposal = 4;
TendermintBlock block = 5;
} }
message BlockSize { message BlockSize {
...@@ -118,14 +116,14 @@ message TendermintBlockHeader { ...@@ -118,14 +116,14 @@ message TendermintBlockHeader {
bytes appHash = 11; bytes appHash = 11;
bytes lastResultsHash = 12; bytes lastResultsHash = 12;
bytes evidenceHash = 13; bytes evidenceHash = 13;
bytes proposerAddr = 14;
} }
message TendermintBlock { message TendermintBlock {
TendermintBlockHeader header = 1; TendermintBlockHeader header = 1;
repeated Transaction txs = 2; Block data = 2;
EvidenceData evidence = 3; EvidenceData evidence = 3;
TendermintCommit lastCommit = 4; TendermintCommit lastCommit = 4;
bytes proposerAddr = 5;
} }
message Proposal { message Proposal {
...@@ -146,6 +144,13 @@ message NewRoundStepMsg { ...@@ -146,6 +144,13 @@ message NewRoundStepMsg {
int32 lastCommitRound = 5; int32 lastCommitRound = 5;
} }
message ValidBlockMsg {
int64 height = 1;
int32 round = 2;
bytes blockhash = 3;
bool isCommit = 4;
}
message CommitStepMsg { message CommitStepMsg {
int64 height = 1; int64 height = 1;
} }
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: tendermint.proto // source: tendermint.proto
/*
Package types is a generated protocol buffer package.
It is generated from these files:
tendermint.proto
valnode.proto
It has these top-level messages:
BlockID
TendermintBitArray
Vote
TendermintCommit
TendermintBlockInfo
BlockSize
TxSize
BlockGossip
EvidenceParams
ConsensusParams
Validator
ValidatorSet
State
DuplicateVoteEvidence
EvidenceEnvelope
EvidenceData
TendermintBlockHeader
TendermintBlock
Proposal
NewRoundStepMsg
ValidBlockMsg
CommitStepMsg
ProposalPOLMsg
HasVoteMsg
VoteSetMaj23Msg
VoteSetBitsMsg
Heartbeat
IsHealthy
ValNode
ValNodes
ValNodeAction
ReqNodeInfo
ReqBlockInfo
*/
package types package types
import ( import proto "github.com/golang/protobuf/proto"
fmt "fmt" import fmt "fmt"
import math "math"
proto "github.com/golang/protobuf/proto" import types3 "github.com/33cn/chain33/types"
math "math"
types "github.com/33cn/chain33/types"
)
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
...@@ -25,35 +62,13 @@ var _ = math.Inf ...@@ -25,35 +62,13 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type BlockID struct { type BlockID struct {
Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"` Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) Reset() { *m = BlockID{} }
func (m *BlockID) String() string { return proto.CompactTextString(m) } func (m *BlockID) String() string { return proto.CompactTextString(m) }
func (*BlockID) ProtoMessage() {} func (*BlockID) ProtoMessage() {}
func (*BlockID) Descriptor() ([]byte, []int) { func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{0}
}
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 { func (m *BlockID) GetHash() []byte {
if m != nil { if m != nil {
...@@ -63,36 +78,14 @@ func (m *BlockID) GetHash() []byte { ...@@ -63,36 +78,14 @@ func (m *BlockID) GetHash() []byte {
} }
type TendermintBitArray struct { type TendermintBitArray struct {
Bits int32 `protobuf:"varint,1,opt,name=Bits,proto3" json:"Bits,omitempty"` Bits int32 `protobuf:"varint,1,opt,name=Bits" json:"Bits,omitempty"`
Elems []uint64 `protobuf:"varint,2,rep,packed,name=Elems,proto3" json:"Elems,omitempty"` Elems []uint64 `protobuf:"varint,2,rep,packed,name=Elems" json:"Elems,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *TendermintBitArray) Reset() { *m = TendermintBitArray{} } func (m *TendermintBitArray) Reset() { *m = TendermintBitArray{} }
func (m *TendermintBitArray) String() string { return proto.CompactTextString(m) } func (m *TendermintBitArray) String() string { return proto.CompactTextString(m) }
func (*TendermintBitArray) ProtoMessage() {} func (*TendermintBitArray) ProtoMessage() {}
func (*TendermintBitArray) Descriptor() ([]byte, []int) { func (*TendermintBitArray) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{1}
}
func (m *TendermintBitArray) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TendermintBitArray.Unmarshal(m, b)
}
func (m *TendermintBitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TendermintBitArray.Marshal(b, m, deterministic)
}
func (dst *TendermintBitArray) XXX_Merge(src proto.Message) {
xxx_messageInfo_TendermintBitArray.Merge(dst, src)
}
func (m *TendermintBitArray) XXX_Size() int {
return xxx_messageInfo_TendermintBitArray.Size(m)
}
func (m *TendermintBitArray) XXX_DiscardUnknown() {
xxx_messageInfo_TendermintBitArray.DiscardUnknown(m)
}
var xxx_messageInfo_TendermintBitArray proto.InternalMessageInfo
func (m *TendermintBitArray) GetBits() int32 { func (m *TendermintBitArray) GetBits() int32 {
if m != nil { if m != nil {
...@@ -109,42 +102,20 @@ func (m *TendermintBitArray) GetElems() []uint64 { ...@@ -109,42 +102,20 @@ func (m *TendermintBitArray) GetElems() []uint64 {
} }
type Vote struct { type Vote struct {
ValidatorAddress []byte `protobuf:"bytes,1,opt,name=ValidatorAddress,proto3" json:"ValidatorAddress,omitempty"` ValidatorAddress []byte `protobuf:"bytes,1,opt,name=ValidatorAddress,proto3" json:"ValidatorAddress,omitempty"`
ValidatorIndex int32 `protobuf:"varint,2,opt,name=ValidatorIndex,proto3" json:"ValidatorIndex,omitempty"` ValidatorIndex int32 `protobuf:"varint,2,opt,name=ValidatorIndex" json:"ValidatorIndex,omitempty"`
Height int64 `protobuf:"varint,3,opt,name=Height,proto3" json:"Height,omitempty"` Height int64 `protobuf:"varint,3,opt,name=Height" json:"Height,omitempty"`
Round int32 `protobuf:"varint,4,opt,name=Round,proto3" json:"Round,omitempty"` Round int32 `protobuf:"varint,4,opt,name=Round" json:"Round,omitempty"`
Timestamp int64 `protobuf:"varint,5,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` Timestamp int64 `protobuf:"varint,5,opt,name=Timestamp" json:"Timestamp,omitempty"`
Type uint32 `protobuf:"varint,6,opt,name=Type,proto3" json:"Type,omitempty"` Type uint32 `protobuf:"varint,6,opt,name=Type" json:"Type,omitempty"`
BlockID *BlockID `protobuf:"bytes,7,opt,name=BlockID,proto3" json:"BlockID,omitempty"` BlockID *BlockID `protobuf:"bytes,7,opt,name=BlockID" json:"BlockID,omitempty"`
Signature []byte `protobuf:"bytes,8,opt,name=Signature,proto3" json:"Signature,omitempty"` Signature []byte `protobuf:"bytes,8,opt,name=Signature,proto3" json:"Signature,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Vote) Reset() { *m = Vote{} }
func (m *Vote) String() string { return proto.CompactTextString(m) }
func (*Vote) ProtoMessage() {}
func (*Vote) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{2}
}
func (m *Vote) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Vote.Unmarshal(m, b)
}
func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
}
func (dst *Vote) XXX_Merge(src proto.Message) {
xxx_messageInfo_Vote.Merge(dst, src)
}
func (m *Vote) XXX_Size() int {
return xxx_messageInfo_Vote.Size(m)
}
func (m *Vote) XXX_DiscardUnknown() {
xxx_messageInfo_Vote.DiscardUnknown(m)
} }
var xxx_messageInfo_Vote proto.InternalMessageInfo func (m *Vote) Reset() { *m = Vote{} }
func (m *Vote) String() string { return proto.CompactTextString(m) }
func (*Vote) ProtoMessage() {}
func (*Vote) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Vote) GetValidatorAddress() []byte { func (m *Vote) GetValidatorAddress() []byte {
if m != nil { if m != nil {
...@@ -203,36 +174,14 @@ func (m *Vote) GetSignature() []byte { ...@@ -203,36 +174,14 @@ func (m *Vote) GetSignature() []byte {
} }
type TendermintCommit struct { type TendermintCommit struct {
BlockID *BlockID `protobuf:"bytes,1,opt,name=BlockID,proto3" json:"BlockID,omitempty"` BlockID *BlockID `protobuf:"bytes,1,opt,name=BlockID" json:"BlockID,omitempty"`
Precommits []*Vote `protobuf:"bytes,2,rep,name=Precommits,proto3" json:"Precommits,omitempty"` Precommits []*Vote `protobuf:"bytes,2,rep,name=Precommits" json:"Precommits,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TendermintCommit) Reset() { *m = TendermintCommit{} }
func (m *TendermintCommit) String() string { return proto.CompactTextString(m) }
func (*TendermintCommit) ProtoMessage() {}
func (*TendermintCommit) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{3}
}
func (m *TendermintCommit) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TendermintCommit.Unmarshal(m, b)
}
func (m *TendermintCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TendermintCommit.Marshal(b, m, deterministic)
}
func (dst *TendermintCommit) XXX_Merge(src proto.Message) {
xxx_messageInfo_TendermintCommit.Merge(dst, src)
}
func (m *TendermintCommit) XXX_Size() int {
return xxx_messageInfo_TendermintCommit.Size(m)
}
func (m *TendermintCommit) XXX_DiscardUnknown() {
xxx_messageInfo_TendermintCommit.DiscardUnknown(m)
} }
var xxx_messageInfo_TendermintCommit proto.InternalMessageInfo func (m *TendermintCommit) Reset() { *m = TendermintCommit{} }
func (m *TendermintCommit) String() string { return proto.CompactTextString(m) }
func (*TendermintCommit) ProtoMessage() {}
func (*TendermintCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *TendermintCommit) GetBlockID() *BlockID { func (m *TendermintCommit) GetBlockID() *BlockID {
if m != nil { if m != nil {
...@@ -249,53 +198,15 @@ func (m *TendermintCommit) GetPrecommits() []*Vote { ...@@ -249,53 +198,15 @@ func (m *TendermintCommit) GetPrecommits() []*Vote {
} }
type TendermintBlockInfo struct { type TendermintBlockInfo struct {
SeenCommit *TendermintCommit `protobuf:"bytes,1,opt,name=SeenCommit,proto3" json:"SeenCommit,omitempty"` State *State `protobuf:"bytes,2,opt,name=State" json:"State,omitempty"`
LastCommit *TendermintCommit `protobuf:"bytes,2,opt,name=LastCommit,proto3" json:"LastCommit,omitempty"` Proposal *Proposal `protobuf:"bytes,3,opt,name=Proposal" json:"Proposal,omitempty"`
State *State `protobuf:"bytes,3,opt,name=State,proto3" json:"State,omitempty"` Block *TendermintBlock `protobuf:"bytes,4,opt,name=block" json:"block,omitempty"`
Proposal *Proposal `protobuf:"bytes,4,opt,name=Proposal,proto3" json:"Proposal,omitempty"`
Block *TendermintBlock `protobuf:"bytes,5,opt,name=block,proto3" json:"block,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *TendermintBlockInfo) Reset() { *m = TendermintBlockInfo{} } func (m *TendermintBlockInfo) Reset() { *m = TendermintBlockInfo{} }
func (m *TendermintBlockInfo) String() string { return proto.CompactTextString(m) } func (m *TendermintBlockInfo) String() string { return proto.CompactTextString(m) }
func (*TendermintBlockInfo) ProtoMessage() {} func (*TendermintBlockInfo) ProtoMessage() {}
func (*TendermintBlockInfo) Descriptor() ([]byte, []int) { func (*TendermintBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{4}
}
func (m *TendermintBlockInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TendermintBlockInfo.Unmarshal(m, b)
}
func (m *TendermintBlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TendermintBlockInfo.Marshal(b, m, deterministic)
}
func (dst *TendermintBlockInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_TendermintBlockInfo.Merge(dst, src)
}
func (m *TendermintBlockInfo) XXX_Size() int {
return xxx_messageInfo_TendermintBlockInfo.Size(m)
}
func (m *TendermintBlockInfo) XXX_DiscardUnknown() {
xxx_messageInfo_TendermintBlockInfo.DiscardUnknown(m)
}
var xxx_messageInfo_TendermintBlockInfo proto.InternalMessageInfo
func (m *TendermintBlockInfo) GetSeenCommit() *TendermintCommit {
if m != nil {
return m.SeenCommit
}
return nil
}
func (m *TendermintBlockInfo) GetLastCommit() *TendermintCommit {
if m != nil {
return m.LastCommit
}
return nil
}
func (m *TendermintBlockInfo) GetState() *State { func (m *TendermintBlockInfo) GetState() *State {
if m != nil { if m != nil {
...@@ -319,37 +230,15 @@ func (m *TendermintBlockInfo) GetBlock() *TendermintBlock { ...@@ -319,37 +230,15 @@ func (m *TendermintBlockInfo) GetBlock() *TendermintBlock {
} }
type BlockSize struct { type BlockSize struct {
MaxBytes int32 `protobuf:"varint,1,opt,name=MaxBytes,proto3" json:"MaxBytes,omitempty"` MaxBytes int32 `protobuf:"varint,1,opt,name=MaxBytes" json:"MaxBytes,omitempty"`
MaxTxs int32 `protobuf:"varint,2,opt,name=MaxTxs,proto3" json:"MaxTxs,omitempty"` MaxTxs int32 `protobuf:"varint,2,opt,name=MaxTxs" json:"MaxTxs,omitempty"`
MaxGas int64 `protobuf:"varint,3,opt,name=MaxGas,proto3" json:"MaxGas,omitempty"` MaxGas int64 `protobuf:"varint,3,opt,name=MaxGas" json:"MaxGas,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 fileDescriptor_tendermint_73641ebf19da43cb, []int{5}
}
func (m *BlockSize) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BlockSize.Unmarshal(m, b)
}
func (m *BlockSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BlockSize.Marshal(b, m, deterministic)
}
func (dst *BlockSize) XXX_Merge(src proto.Message) {
xxx_messageInfo_BlockSize.Merge(dst, src)
}
func (m *BlockSize) XXX_Size() int {
return xxx_messageInfo_BlockSize.Size(m)
}
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 fileDescriptor0, []int{5} }
func (m *BlockSize) GetMaxBytes() int32 { func (m *BlockSize) GetMaxBytes() int32 {
if m != nil { if m != nil {
...@@ -373,36 +262,14 @@ func (m *BlockSize) GetMaxGas() int64 { ...@@ -373,36 +262,14 @@ func (m *BlockSize) GetMaxGas() int64 {
} }
type TxSize struct { type TxSize struct {
MaxBytes int32 `protobuf:"varint,1,opt,name=MaxBytes,proto3" json:"MaxBytes,omitempty"` MaxBytes int32 `protobuf:"varint,1,opt,name=MaxBytes" json:"MaxBytes,omitempty"`
MaxGas int64 `protobuf:"varint,2,opt,name=MaxGas,proto3" json:"MaxGas,omitempty"` MaxGas int64 `protobuf:"varint,2,opt,name=MaxGas" json:"MaxGas,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 fileDescriptor_tendermint_73641ebf19da43cb, []int{6}
}
func (m *TxSize) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TxSize.Unmarshal(m, b)
}
func (m *TxSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TxSize.Marshal(b, m, deterministic)
}
func (dst *TxSize) XXX_Merge(src proto.Message) {
xxx_messageInfo_TxSize.Merge(dst, src)
}
func (m *TxSize) XXX_Size() int {
return xxx_messageInfo_TxSize.Size(m)
}
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 fileDescriptor0, []int{6} }
func (m *TxSize) GetMaxBytes() int32 { func (m *TxSize) GetMaxBytes() int32 {
if m != nil { if m != nil {
...@@ -419,35 +286,13 @@ func (m *TxSize) GetMaxGas() int64 { ...@@ -419,35 +286,13 @@ func (m *TxSize) GetMaxGas() int64 {
} }
type BlockGossip struct { type BlockGossip struct {
BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=BlockPartSizeBytes,proto3" json:"BlockPartSizeBytes,omitempty"` BlockPartSizeBytes int32 `protobuf:"varint,1,opt,name=BlockPartSizeBytes" json:"BlockPartSizeBytes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *BlockGossip) Reset() { *m = BlockGossip{} } func (m *BlockGossip) Reset() { *m = BlockGossip{} }
func (m *BlockGossip) String() string { return proto.CompactTextString(m) } func (m *BlockGossip) String() string { return proto.CompactTextString(m) }
func (*BlockGossip) ProtoMessage() {} func (*BlockGossip) ProtoMessage() {}
func (*BlockGossip) Descriptor() ([]byte, []int) { func (*BlockGossip) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{7}
}
func (m *BlockGossip) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BlockGossip.Unmarshal(m, b)
}
func (m *BlockGossip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BlockGossip.Marshal(b, m, deterministic)
}
func (dst *BlockGossip) XXX_Merge(src proto.Message) {
xxx_messageInfo_BlockGossip.Merge(dst, src)
}
func (m *BlockGossip) XXX_Size() int {
return xxx_messageInfo_BlockGossip.Size(m)
}
func (m *BlockGossip) XXX_DiscardUnknown() {
xxx_messageInfo_BlockGossip.DiscardUnknown(m)
}
var xxx_messageInfo_BlockGossip proto.InternalMessageInfo
func (m *BlockGossip) GetBlockPartSizeBytes() int32 { func (m *BlockGossip) GetBlockPartSizeBytes() int32 {
if m != nil { if m != nil {
...@@ -457,35 +302,13 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 { ...@@ -457,35 +302,13 @@ func (m *BlockGossip) GetBlockPartSizeBytes() int32 {
} }
type EvidenceParams struct { type EvidenceParams struct {
MaxAge int64 `protobuf:"varint,1,opt,name=MaxAge,proto3" json:"MaxAge,omitempty"` MaxAge int64 `protobuf:"varint,1,opt,name=MaxAge" json:"MaxAge,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } func (m *EvidenceParams) Reset() { *m = EvidenceParams{} }
func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } func (m *EvidenceParams) String() string { return proto.CompactTextString(m) }
func (*EvidenceParams) ProtoMessage() {} func (*EvidenceParams) ProtoMessage() {}
func (*EvidenceParams) Descriptor() ([]byte, []int) { func (*EvidenceParams) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{8}
}
func (m *EvidenceParams) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EvidenceParams.Unmarshal(m, b)
}
func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic)
}
func (dst *EvidenceParams) XXX_Merge(src proto.Message) {
xxx_messageInfo_EvidenceParams.Merge(dst, src)
}
func (m *EvidenceParams) XXX_Size() int {
return xxx_messageInfo_EvidenceParams.Size(m)
}
func (m *EvidenceParams) XXX_DiscardUnknown() {
xxx_messageInfo_EvidenceParams.DiscardUnknown(m)
}
var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo
func (m *EvidenceParams) GetMaxAge() int64 { func (m *EvidenceParams) GetMaxAge() int64 {
if m != nil { if m != nil {
...@@ -495,38 +318,16 @@ func (m *EvidenceParams) GetMaxAge() int64 { ...@@ -495,38 +318,16 @@ func (m *EvidenceParams) GetMaxAge() int64 {
} }
type ConsensusParams struct { type ConsensusParams struct {
BlockSize *BlockSize `protobuf:"bytes,1,opt,name=BlockSize,proto3" json:"BlockSize,omitempty"` BlockSize *BlockSize `protobuf:"bytes,1,opt,name=BlockSize" json:"BlockSize,omitempty"`
TxSize *TxSize `protobuf:"bytes,2,opt,name=TxSize,proto3" json:"TxSize,omitempty"` TxSize *TxSize `protobuf:"bytes,2,opt,name=TxSize" json:"TxSize,omitempty"`
BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=BlockGossip,proto3" json:"BlockGossip,omitempty"` BlockGossip *BlockGossip `protobuf:"bytes,3,opt,name=BlockGossip" json:"BlockGossip,omitempty"`
EvidenceParams *EvidenceParams `protobuf:"bytes,4,opt,name=EvidenceParams,proto3" json:"EvidenceParams,omitempty"` EvidenceParams *EvidenceParams `protobuf:"bytes,4,opt,name=EvidenceParams" json:"EvidenceParams,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 fileDescriptor_tendermint_73641ebf19da43cb, []int{9}
}
func (m *ConsensusParams) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConsensusParams.Unmarshal(m, b)
}
func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic)
}
func (dst *ConsensusParams) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConsensusParams.Merge(dst, src)
}
func (m *ConsensusParams) XXX_Size() int {
return xxx_messageInfo_ConsensusParams.Size(m)
}
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 fileDescriptor0, []int{9} }
func (m *ConsensusParams) GetBlockSize() *BlockSize { func (m *ConsensusParams) GetBlockSize() *BlockSize {
if m != nil { if m != nil {
...@@ -557,38 +358,16 @@ func (m *ConsensusParams) GetEvidenceParams() *EvidenceParams { ...@@ -557,38 +358,16 @@ func (m *ConsensusParams) GetEvidenceParams() *EvidenceParams {
} }
type Validator struct { 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 []byte `protobuf:"bytes,2,opt,name=PubKey,proto3" json:"PubKey,omitempty"` PubKey []byte `protobuf:"bytes,2,opt,name=PubKey,proto3" json:"PubKey,omitempty"`
VotingPower int64 `protobuf:"varint,3,opt,name=VotingPower,proto3" json:"VotingPower,omitempty"` VotingPower int64 `protobuf:"varint,3,opt,name=VotingPower" json:"VotingPower,omitempty"`
Accum int64 `protobuf:"varint,4,opt,name=Accum,proto3" json:"Accum,omitempty"` Accum int64 `protobuf:"varint,4,opt,name=Accum" json:"Accum,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 fileDescriptor_tendermint_73641ebf19da43cb, []int{10}
}
func (m *Validator) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Validator.Unmarshal(m, b)
}
func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Validator.Marshal(b, m, deterministic)
}
func (dst *Validator) XXX_Merge(src proto.Message) {
xxx_messageInfo_Validator.Merge(dst, src)
}
func (m *Validator) XXX_Size() int {
return xxx_messageInfo_Validator.Size(m)
}
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 fileDescriptor0, []int{10} }
func (m *Validator) GetAddress() []byte { func (m *Validator) GetAddress() []byte {
if m != nil { if m != nil {
...@@ -619,36 +398,14 @@ func (m *Validator) GetAccum() int64 { ...@@ -619,36 +398,14 @@ func (m *Validator) GetAccum() int64 {
} }
type ValidatorSet struct { type ValidatorSet struct {
Validators []*Validator `protobuf:"bytes,1,rep,name=Validators,proto3" json:"Validators,omitempty"` Validators []*Validator `protobuf:"bytes,1,rep,name=Validators" json:"Validators,omitempty"`
Proposer *Validator `protobuf:"bytes,2,opt,name=Proposer,proto3" json:"Proposer,omitempty"` Proposer *Validator `protobuf:"bytes,2,opt,name=Proposer" json:"Proposer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ValidatorSet) Reset() { *m = ValidatorSet{} } func (m *ValidatorSet) Reset() { *m = ValidatorSet{} }
func (m *ValidatorSet) String() string { return proto.CompactTextString(m) } func (m *ValidatorSet) String() string { return proto.CompactTextString(m) }
func (*ValidatorSet) ProtoMessage() {} func (*ValidatorSet) ProtoMessage() {}
func (*ValidatorSet) Descriptor() ([]byte, []int) { func (*ValidatorSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{11}
}
func (m *ValidatorSet) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorSet.Unmarshal(m, b)
}
func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic)
}
func (dst *ValidatorSet) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidatorSet.Merge(dst, src)
}
func (m *ValidatorSet) XXX_Size() int {
return xxx_messageInfo_ValidatorSet.Size(m)
}
func (m *ValidatorSet) XXX_DiscardUnknown() {
xxx_messageInfo_ValidatorSet.DiscardUnknown(m)
}
var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo
func (m *ValidatorSet) GetValidators() []*Validator { func (m *ValidatorSet) GetValidators() []*Validator {
if m != nil { if m != nil {
...@@ -665,46 +422,24 @@ func (m *ValidatorSet) GetProposer() *Validator { ...@@ -665,46 +422,24 @@ func (m *ValidatorSet) GetProposer() *Validator {
} }
type State struct { type State struct {
ChainID string `protobuf:"bytes,1,opt,name=ChainID,proto3" json:"ChainID,omitempty"` ChainID string `protobuf:"bytes,1,opt,name=ChainID" json:"ChainID,omitempty"`
LastBlockHeight int64 `protobuf:"varint,2,opt,name=LastBlockHeight,proto3" json:"LastBlockHeight,omitempty"` LastBlockHeight int64 `protobuf:"varint,2,opt,name=LastBlockHeight" json:"LastBlockHeight,omitempty"`
LastBlockTotalTx int64 `protobuf:"varint,3,opt,name=LastBlockTotalTx,proto3" json:"LastBlockTotalTx,omitempty"` LastBlockTotalTx int64 `protobuf:"varint,3,opt,name=LastBlockTotalTx" json:"LastBlockTotalTx,omitempty"`
LastBlockID *BlockID `protobuf:"bytes,4,opt,name=LastBlockID,proto3" json:"LastBlockID,omitempty"` LastBlockID *BlockID `protobuf:"bytes,4,opt,name=LastBlockID" json:"LastBlockID,omitempty"`
LastBlockTime int64 `protobuf:"varint,5,opt,name=LastBlockTime,proto3" json:"LastBlockTime,omitempty"` LastBlockTime int64 `protobuf:"varint,5,opt,name=LastBlockTime" json:"LastBlockTime,omitempty"`
Validators *ValidatorSet `protobuf:"bytes,6,opt,name=Validators,proto3" json:"Validators,omitempty"` Validators *ValidatorSet `protobuf:"bytes,6,opt,name=Validators" json:"Validators,omitempty"`
LastValidators *ValidatorSet `protobuf:"bytes,7,opt,name=LastValidators,proto3" json:"LastValidators,omitempty"` LastValidators *ValidatorSet `protobuf:"bytes,7,opt,name=LastValidators" json:"LastValidators,omitempty"`
LastHeightValidatorsChanged int64 `protobuf:"varint,8,opt,name=LastHeightValidatorsChanged,proto3" json:"LastHeightValidatorsChanged,omitempty"` LastHeightValidatorsChanged int64 `protobuf:"varint,8,opt,name=LastHeightValidatorsChanged" json:"LastHeightValidatorsChanged,omitempty"`
ConsensusParams *ConsensusParams `protobuf:"bytes,9,opt,name=ConsensusParams,proto3" json:"ConsensusParams,omitempty"` ConsensusParams *ConsensusParams `protobuf:"bytes,9,opt,name=ConsensusParams" json:"ConsensusParams,omitempty"`
LastHeightConsensusParamsChanged int64 `protobuf:"varint,10,opt,name=LastHeightConsensusParamsChanged,proto3" json:"LastHeightConsensusParamsChanged,omitempty"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,10,opt,name=LastHeightConsensusParamsChanged" json:"LastHeightConsensusParamsChanged,omitempty"`
LastResultsHash []byte `protobuf:"bytes,11,opt,name=LastResultsHash,proto3" json:"LastResultsHash,omitempty"` LastResultsHash []byte `protobuf:"bytes,11,opt,name=LastResultsHash,proto3" json:"LastResultsHash,omitempty"`
AppHash []byte `protobuf:"bytes,12,opt,name=AppHash,proto3" json:"AppHash,omitempty"` AppHash []byte `protobuf:"bytes,12,opt,name=AppHash,proto3" json:"AppHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *State) Reset() { *m = State{} } func (m *State) Reset() { *m = State{} }
func (m *State) String() string { return proto.CompactTextString(m) } func (m *State) String() string { return proto.CompactTextString(m) }
func (*State) ProtoMessage() {} func (*State) ProtoMessage() {}
func (*State) Descriptor() ([]byte, []int) { func (*State) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{12}
}
func (m *State) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_State.Unmarshal(m, b)
}
func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_State.Marshal(b, m, deterministic)
}
func (dst *State) XXX_Merge(src proto.Message) {
xxx_messageInfo_State.Merge(dst, src)
}
func (m *State) XXX_Size() int {
return xxx_messageInfo_State.Size(m)
}
func (m *State) XXX_DiscardUnknown() {
xxx_messageInfo_State.DiscardUnknown(m)
}
var xxx_messageInfo_State proto.InternalMessageInfo
func (m *State) GetChainID() string { func (m *State) GetChainID() string {
if m != nil { if m != nil {
...@@ -791,37 +526,15 @@ func (m *State) GetAppHash() []byte { ...@@ -791,37 +526,15 @@ func (m *State) GetAppHash() []byte {
} }
type DuplicateVoteEvidence struct { type DuplicateVoteEvidence struct {
PubKey string `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` PubKey string `protobuf:"bytes,1,opt,name=pubKey" json:"pubKey,omitempty"`
VoteA *Vote `protobuf:"bytes,2,opt,name=voteA,proto3" json:"voteA,omitempty"` VoteA *Vote `protobuf:"bytes,2,opt,name=voteA" json:"voteA,omitempty"`
VoteB *Vote `protobuf:"bytes,3,opt,name=voteB,proto3" json:"voteB,omitempty"` VoteB *Vote `protobuf:"bytes,3,opt,name=voteB" json:"voteB,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DuplicateVoteEvidence) Reset() { *m = DuplicateVoteEvidence{} }
func (m *DuplicateVoteEvidence) String() string { return proto.CompactTextString(m) }
func (*DuplicateVoteEvidence) ProtoMessage() {}
func (*DuplicateVoteEvidence) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{13}
}
func (m *DuplicateVoteEvidence) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DuplicateVoteEvidence.Unmarshal(m, b)
}
func (m *DuplicateVoteEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DuplicateVoteEvidence.Marshal(b, m, deterministic)
}
func (dst *DuplicateVoteEvidence) XXX_Merge(src proto.Message) {
xxx_messageInfo_DuplicateVoteEvidence.Merge(dst, src)
}
func (m *DuplicateVoteEvidence) XXX_Size() int {
return xxx_messageInfo_DuplicateVoteEvidence.Size(m)
}
func (m *DuplicateVoteEvidence) XXX_DiscardUnknown() {
xxx_messageInfo_DuplicateVoteEvidence.DiscardUnknown(m)
} }
var xxx_messageInfo_DuplicateVoteEvidence proto.InternalMessageInfo func (m *DuplicateVoteEvidence) Reset() { *m = DuplicateVoteEvidence{} }
func (m *DuplicateVoteEvidence) String() string { return proto.CompactTextString(m) }
func (*DuplicateVoteEvidence) ProtoMessage() {}
func (*DuplicateVoteEvidence) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} }
func (m *DuplicateVoteEvidence) GetPubKey() string { func (m *DuplicateVoteEvidence) GetPubKey() string {
if m != nil { if m != nil {
...@@ -845,36 +558,14 @@ func (m *DuplicateVoteEvidence) GetVoteB() *Vote { ...@@ -845,36 +558,14 @@ func (m *DuplicateVoteEvidence) GetVoteB() *Vote {
} }
type EvidenceEnvelope struct { type EvidenceEnvelope struct {
TypeName string `protobuf:"bytes,1,opt,name=typeName,proto3" json:"typeName,omitempty"` TypeName string `protobuf:"bytes,1,opt,name=typeName" json:"typeName,omitempty"`
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 *EvidenceEnvelope) Reset() { *m = EvidenceEnvelope{} }
func (m *EvidenceEnvelope) String() string { return proto.CompactTextString(m) }
func (*EvidenceEnvelope) ProtoMessage() {}
func (*EvidenceEnvelope) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{14}
}
func (m *EvidenceEnvelope) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EvidenceEnvelope.Unmarshal(m, b)
}
func (m *EvidenceEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EvidenceEnvelope.Marshal(b, m, deterministic)
}
func (dst *EvidenceEnvelope) XXX_Merge(src proto.Message) {
xxx_messageInfo_EvidenceEnvelope.Merge(dst, src)
}
func (m *EvidenceEnvelope) XXX_Size() int {
return xxx_messageInfo_EvidenceEnvelope.Size(m)
}
func (m *EvidenceEnvelope) XXX_DiscardUnknown() {
xxx_messageInfo_EvidenceEnvelope.DiscardUnknown(m)
} }
var xxx_messageInfo_EvidenceEnvelope proto.InternalMessageInfo func (m *EvidenceEnvelope) Reset() { *m = EvidenceEnvelope{} }
func (m *EvidenceEnvelope) String() string { return proto.CompactTextString(m) }
func (*EvidenceEnvelope) ProtoMessage() {}
func (*EvidenceEnvelope) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} }
func (m *EvidenceEnvelope) GetTypeName() string { func (m *EvidenceEnvelope) GetTypeName() string {
if m != nil { if m != nil {
...@@ -891,35 +582,13 @@ func (m *EvidenceEnvelope) GetData() []byte { ...@@ -891,35 +582,13 @@ func (m *EvidenceEnvelope) GetData() []byte {
} }
type EvidenceData struct { type EvidenceData struct {
Evidence []*EvidenceEnvelope `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` Evidence []*EvidenceEnvelope `protobuf:"bytes,1,rep,name=evidence" json:"evidence,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *EvidenceData) Reset() { *m = EvidenceData{} } func (m *EvidenceData) Reset() { *m = EvidenceData{} }
func (m *EvidenceData) String() string { return proto.CompactTextString(m) } func (m *EvidenceData) String() string { return proto.CompactTextString(m) }
func (*EvidenceData) ProtoMessage() {} func (*EvidenceData) ProtoMessage() {}
func (*EvidenceData) Descriptor() ([]byte, []int) { func (*EvidenceData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{15}
}
func (m *EvidenceData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EvidenceData.Unmarshal(m, b)
}
func (m *EvidenceData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EvidenceData.Marshal(b, m, deterministic)
}
func (dst *EvidenceData) XXX_Merge(src proto.Message) {
xxx_messageInfo_EvidenceData.Merge(dst, src)
}
func (m *EvidenceData) XXX_Size() int {
return xxx_messageInfo_EvidenceData.Size(m)
}
func (m *EvidenceData) XXX_DiscardUnknown() {
xxx_messageInfo_EvidenceData.DiscardUnknown(m)
}
var xxx_messageInfo_EvidenceData proto.InternalMessageInfo
func (m *EvidenceData) GetEvidence() []*EvidenceEnvelope { func (m *EvidenceData) GetEvidence() []*EvidenceEnvelope {
if m != nil { if m != nil {
...@@ -929,47 +598,26 @@ func (m *EvidenceData) GetEvidence() []*EvidenceEnvelope { ...@@ -929,47 +598,26 @@ func (m *EvidenceData) GetEvidence() []*EvidenceEnvelope {
} }
type TendermintBlockHeader struct { type TendermintBlockHeader struct {
ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` ChainID string `protobuf:"bytes,1,opt,name=chainID" json:"chainID,omitempty"`
Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"`
Round int64 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` Round int64 `protobuf:"varint,3,opt,name=round" json:"round,omitempty"`
Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` Time int64 `protobuf:"varint,4,opt,name=time" json:"time,omitempty"`
NumTxs int64 `protobuf:"varint,5,opt,name=numTxs,proto3" json:"numTxs,omitempty"` NumTxs int64 `protobuf:"varint,5,opt,name=numTxs" json:"numTxs,omitempty"`
LastBlockID *BlockID `protobuf:"bytes,6,opt,name=lastBlockID,proto3" json:"lastBlockID,omitempty"` LastBlockID *BlockID `protobuf:"bytes,6,opt,name=lastBlockID" json:"lastBlockID,omitempty"`
TotalTxs int64 `protobuf:"varint,7,opt,name=totalTxs,proto3" json:"totalTxs,omitempty"` TotalTxs int64 `protobuf:"varint,7,opt,name=totalTxs" json:"totalTxs,omitempty"`
LastCommitHash []byte `protobuf:"bytes,8,opt,name=lastCommitHash,proto3" json:"lastCommitHash,omitempty"` LastCommitHash []byte `protobuf:"bytes,8,opt,name=lastCommitHash,proto3" json:"lastCommitHash,omitempty"`
ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validatorsHash,proto3" json:"validatorsHash,omitempty"` ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validatorsHash,proto3" json:"validatorsHash,omitempty"`
ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensusHash,proto3" json:"consensusHash,omitempty"` ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensusHash,proto3" json:"consensusHash,omitempty"`
AppHash []byte `protobuf:"bytes,11,opt,name=appHash,proto3" json:"appHash,omitempty"` AppHash []byte `protobuf:"bytes,11,opt,name=appHash,proto3" json:"appHash,omitempty"`
LastResultsHash []byte `protobuf:"bytes,12,opt,name=lastResultsHash,proto3" json:"lastResultsHash,omitempty"` LastResultsHash []byte `protobuf:"bytes,12,opt,name=lastResultsHash,proto3" json:"lastResultsHash,omitempty"`
EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidenceHash,proto3" json:"evidenceHash,omitempty"` EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidenceHash,proto3" json:"evidenceHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` ProposerAddr []byte `protobuf:"bytes,14,opt,name=proposerAddr,proto3" json:"proposerAddr,omitempty"`
XXX_unrecognized []byte `json:"-"` }
XXX_sizecache int32 `json:"-"`
} func (m *TendermintBlockHeader) Reset() { *m = TendermintBlockHeader{} }
func (m *TendermintBlockHeader) String() string { return proto.CompactTextString(m) }
func (m *TendermintBlockHeader) Reset() { *m = TendermintBlockHeader{} } func (*TendermintBlockHeader) ProtoMessage() {}
func (m *TendermintBlockHeader) String() string { return proto.CompactTextString(m) } func (*TendermintBlockHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} }
func (*TendermintBlockHeader) ProtoMessage() {}
func (*TendermintBlockHeader) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{16}
}
func (m *TendermintBlockHeader) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TendermintBlockHeader.Unmarshal(m, b)
}
func (m *TendermintBlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TendermintBlockHeader.Marshal(b, m, deterministic)
}
func (dst *TendermintBlockHeader) XXX_Merge(src proto.Message) {
xxx_messageInfo_TendermintBlockHeader.Merge(dst, src)
}
func (m *TendermintBlockHeader) XXX_Size() int {
return xxx_messageInfo_TendermintBlockHeader.Size(m)
}
func (m *TendermintBlockHeader) XXX_DiscardUnknown() {
xxx_messageInfo_TendermintBlockHeader.DiscardUnknown(m)
}
var xxx_messageInfo_TendermintBlockHeader proto.InternalMessageInfo
func (m *TendermintBlockHeader) GetChainID() string { func (m *TendermintBlockHeader) GetChainID() string {
if m != nil { if m != nil {
...@@ -1062,40 +710,24 @@ func (m *TendermintBlockHeader) GetEvidenceHash() []byte { ...@@ -1062,40 +710,24 @@ func (m *TendermintBlockHeader) GetEvidenceHash() []byte {
return nil return nil
} }
type TendermintBlock struct { func (m *TendermintBlockHeader) GetProposerAddr() []byte {
Header *TendermintBlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` if m != nil {
Txs []*types.Transaction `protobuf:"bytes,2,rep,name=txs,proto3" json:"txs,omitempty"` return m.ProposerAddr
Evidence *EvidenceData `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` }
LastCommit *TendermintCommit `protobuf:"bytes,4,opt,name=lastCommit,proto3" json:"lastCommit,omitempty"` return nil
ProposerAddr []byte `protobuf:"bytes,5,opt,name=proposerAddr,proto3" json:"proposerAddr,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *TendermintBlock) Reset() { *m = TendermintBlock{} } type TendermintBlock struct {
func (m *TendermintBlock) String() string { return proto.CompactTextString(m) } Header *TendermintBlockHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
func (*TendermintBlock) ProtoMessage() {} Data *types3.Block `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"`
func (*TendermintBlock) Descriptor() ([]byte, []int) { Evidence *EvidenceData `protobuf:"bytes,3,opt,name=evidence" json:"evidence,omitempty"`
return fileDescriptor_tendermint_73641ebf19da43cb, []int{17} LastCommit *TendermintCommit `protobuf:"bytes,4,opt,name=lastCommit" json:"lastCommit,omitempty"`
}
func (m *TendermintBlock) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TendermintBlock.Unmarshal(m, b)
}
func (m *TendermintBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TendermintBlock.Marshal(b, m, deterministic)
}
func (dst *TendermintBlock) XXX_Merge(src proto.Message) {
xxx_messageInfo_TendermintBlock.Merge(dst, src)
}
func (m *TendermintBlock) XXX_Size() int {
return xxx_messageInfo_TendermintBlock.Size(m)
}
func (m *TendermintBlock) XXX_DiscardUnknown() {
xxx_messageInfo_TendermintBlock.DiscardUnknown(m)
} }
var xxx_messageInfo_TendermintBlock proto.InternalMessageInfo func (m *TendermintBlock) Reset() { *m = TendermintBlock{} }
func (m *TendermintBlock) String() string { return proto.CompactTextString(m) }
func (*TendermintBlock) ProtoMessage() {}
func (*TendermintBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} }
func (m *TendermintBlock) GetHeader() *TendermintBlockHeader { func (m *TendermintBlock) GetHeader() *TendermintBlockHeader {
if m != nil { if m != nil {
...@@ -1104,9 +736,9 @@ func (m *TendermintBlock) GetHeader() *TendermintBlockHeader { ...@@ -1104,9 +736,9 @@ func (m *TendermintBlock) GetHeader() *TendermintBlockHeader {
return nil return nil
} }
func (m *TendermintBlock) GetTxs() []*types.Transaction { func (m *TendermintBlock) GetData() *types3.Block {
if m != nil { if m != nil {
return m.Txs return m.Data
} }
return nil return nil
} }
...@@ -1125,49 +757,20 @@ func (m *TendermintBlock) GetLastCommit() *TendermintCommit { ...@@ -1125,49 +757,20 @@ func (m *TendermintBlock) GetLastCommit() *TendermintCommit {
return nil return nil
} }
func (m *TendermintBlock) GetProposerAddr() []byte {
if m != nil {
return m.ProposerAddr
}
return nil
}
type Proposal struct { type Proposal struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"`
POLRound int32 `protobuf:"varint,4,opt,name=POLRound,proto3" json:"POLRound,omitempty"` POLRound int32 `protobuf:"varint,4,opt,name=POLRound" json:"POLRound,omitempty"`
POLBlockID *BlockID `protobuf:"bytes,5,opt,name=POLBlockID,proto3" json:"POLBlockID,omitempty"` POLBlockID *BlockID `protobuf:"bytes,5,opt,name=POLBlockID" json:"POLBlockID,omitempty"`
Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
Blockhash []byte `protobuf:"bytes,7,opt,name=blockhash,proto3" json:"blockhash,omitempty"` Blockhash []byte `protobuf:"bytes,7,opt,name=blockhash,proto3" json:"blockhash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Proposal) Reset() { *m = Proposal{} }
func (m *Proposal) String() string { return proto.CompactTextString(m) }
func (*Proposal) ProtoMessage() {}
func (*Proposal) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{18}
}
func (m *Proposal) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Proposal.Unmarshal(m, b)
}
func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Proposal.Marshal(b, m, deterministic)
}
func (dst *Proposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_Proposal.Merge(dst, src)
}
func (m *Proposal) XXX_Size() int {
return xxx_messageInfo_Proposal.Size(m)
}
func (m *Proposal) XXX_DiscardUnknown() {
xxx_messageInfo_Proposal.DiscardUnknown(m)
} }
var xxx_messageInfo_Proposal proto.InternalMessageInfo func (m *Proposal) Reset() { *m = Proposal{} }
func (m *Proposal) String() string { return proto.CompactTextString(m) }
func (*Proposal) ProtoMessage() {}
func (*Proposal) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} }
func (m *Proposal) GetHeight() int64 { func (m *Proposal) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1219,39 +822,17 @@ func (m *Proposal) GetBlockhash() []byte { ...@@ -1219,39 +822,17 @@ func (m *Proposal) GetBlockhash() []byte {
} }
type NewRoundStepMsg struct { type NewRoundStepMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
Step int32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` Step int32 `protobuf:"varint,3,opt,name=step" json:"step,omitempty"`
SecondsSinceStartTime int32 `protobuf:"varint,4,opt,name=secondsSinceStartTime,proto3" json:"secondsSinceStartTime,omitempty"` SecondsSinceStartTime int32 `protobuf:"varint,4,opt,name=secondsSinceStartTime" json:"secondsSinceStartTime,omitempty"`
LastCommitRound int32 `protobuf:"varint,5,opt,name=lastCommitRound,proto3" json:"lastCommitRound,omitempty"` LastCommitRound int32 `protobuf:"varint,5,opt,name=lastCommitRound" json:"lastCommitRound,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *NewRoundStepMsg) Reset() { *m = NewRoundStepMsg{} } func (m *NewRoundStepMsg) Reset() { *m = NewRoundStepMsg{} }
func (m *NewRoundStepMsg) String() string { return proto.CompactTextString(m) } func (m *NewRoundStepMsg) String() string { return proto.CompactTextString(m) }
func (*NewRoundStepMsg) ProtoMessage() {} func (*NewRoundStepMsg) ProtoMessage() {}
func (*NewRoundStepMsg) Descriptor() ([]byte, []int) { func (*NewRoundStepMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{19}
}
func (m *NewRoundStepMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NewRoundStepMsg.Unmarshal(m, b)
}
func (m *NewRoundStepMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NewRoundStepMsg.Marshal(b, m, deterministic)
}
func (dst *NewRoundStepMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_NewRoundStepMsg.Merge(dst, src)
}
func (m *NewRoundStepMsg) XXX_Size() int {
return xxx_messageInfo_NewRoundStepMsg.Size(m)
}
func (m *NewRoundStepMsg) XXX_DiscardUnknown() {
xxx_messageInfo_NewRoundStepMsg.DiscardUnknown(m)
}
var xxx_messageInfo_NewRoundStepMsg proto.InternalMessageInfo
func (m *NewRoundStepMsg) GetHeight() int64 { func (m *NewRoundStepMsg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1288,36 +869,54 @@ func (m *NewRoundStepMsg) GetLastCommitRound() int32 { ...@@ -1288,36 +869,54 @@ func (m *NewRoundStepMsg) GetLastCommitRound() int32 {
return 0 return 0
} }
type CommitStepMsg struct { type ValidBlockMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
XXX_unrecognized []byte `json:"-"` Blockhash []byte `protobuf:"bytes,3,opt,name=blockhash,proto3" json:"blockhash,omitempty"`
XXX_sizecache int32 `json:"-"` IsCommit bool `protobuf:"varint,4,opt,name=isCommit" json:"isCommit,omitempty"`
} }
func (m *CommitStepMsg) Reset() { *m = CommitStepMsg{} } func (m *ValidBlockMsg) Reset() { *m = ValidBlockMsg{} }
func (m *CommitStepMsg) String() string { return proto.CompactTextString(m) } func (m *ValidBlockMsg) String() string { return proto.CompactTextString(m) }
func (*CommitStepMsg) ProtoMessage() {} func (*ValidBlockMsg) ProtoMessage() {}
func (*CommitStepMsg) Descriptor() ([]byte, []int) { func (*ValidBlockMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{20}
} func (m *ValidBlockMsg) GetHeight() int64 {
func (m *CommitStepMsg) XXX_Unmarshal(b []byte) error { if m != nil {
return xxx_messageInfo_CommitStepMsg.Unmarshal(m, b) return m.Height
}
return 0
} }
func (m *CommitStepMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CommitStepMsg.Marshal(b, m, deterministic) func (m *ValidBlockMsg) GetRound() int32 {
if m != nil {
return m.Round
}
return 0
} }
func (dst *CommitStepMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_CommitStepMsg.Merge(dst, src) func (m *ValidBlockMsg) GetBlockhash() []byte {
if m != nil {
return m.Blockhash
}
return nil
} }
func (m *CommitStepMsg) XXX_Size() int {
return xxx_messageInfo_CommitStepMsg.Size(m) func (m *ValidBlockMsg) GetIsCommit() bool {
if m != nil {
return m.IsCommit
}
return false
} }
func (m *CommitStepMsg) XXX_DiscardUnknown() {
xxx_messageInfo_CommitStepMsg.DiscardUnknown(m) type CommitStepMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
} }
var xxx_messageInfo_CommitStepMsg proto.InternalMessageInfo func (m *CommitStepMsg) Reset() { *m = CommitStepMsg{} }
func (m *CommitStepMsg) String() string { return proto.CompactTextString(m) }
func (*CommitStepMsg) ProtoMessage() {}
func (*CommitStepMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} }
func (m *CommitStepMsg) GetHeight() int64 { func (m *CommitStepMsg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1327,37 +926,15 @@ func (m *CommitStepMsg) GetHeight() int64 { ...@@ -1327,37 +926,15 @@ func (m *CommitStepMsg) GetHeight() int64 {
} }
type ProposalPOLMsg struct { type ProposalPOLMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
ProposalPOLRound int32 `protobuf:"varint,2,opt,name=proposalPOLRound,proto3" json:"proposalPOLRound,omitempty"` ProposalPOLRound int32 `protobuf:"varint,2,opt,name=proposalPOLRound" json:"proposalPOLRound,omitempty"`
ProposalPOL *TendermintBitArray `protobuf:"bytes,3,opt,name=proposalPOL,proto3" json:"proposalPOL,omitempty"` ProposalPOL *TendermintBitArray `protobuf:"bytes,3,opt,name=proposalPOL" json:"proposalPOL,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ProposalPOLMsg) Reset() { *m = ProposalPOLMsg{} }
func (m *ProposalPOLMsg) String() string { return proto.CompactTextString(m) }
func (*ProposalPOLMsg) ProtoMessage() {}
func (*ProposalPOLMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{21}
}
func (m *ProposalPOLMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProposalPOLMsg.Unmarshal(m, b)
}
func (m *ProposalPOLMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ProposalPOLMsg.Marshal(b, m, deterministic)
}
func (dst *ProposalPOLMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_ProposalPOLMsg.Merge(dst, src)
}
func (m *ProposalPOLMsg) XXX_Size() int {
return xxx_messageInfo_ProposalPOLMsg.Size(m)
}
func (m *ProposalPOLMsg) XXX_DiscardUnknown() {
xxx_messageInfo_ProposalPOLMsg.DiscardUnknown(m)
} }
var xxx_messageInfo_ProposalPOLMsg proto.InternalMessageInfo func (m *ProposalPOLMsg) Reset() { *m = ProposalPOLMsg{} }
func (m *ProposalPOLMsg) String() string { return proto.CompactTextString(m) }
func (*ProposalPOLMsg) ProtoMessage() {}
func (*ProposalPOLMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} }
func (m *ProposalPOLMsg) GetHeight() int64 { func (m *ProposalPOLMsg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1381,38 +958,16 @@ func (m *ProposalPOLMsg) GetProposalPOL() *TendermintBitArray { ...@@ -1381,38 +958,16 @@ func (m *ProposalPOLMsg) GetProposalPOL() *TendermintBitArray {
} }
type HasVoteMsg struct { type HasVoteMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` Type int32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"`
Index int32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` Index int32 `protobuf:"varint,4,opt,name=index" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *HasVoteMsg) Reset() { *m = HasVoteMsg{} }
func (m *HasVoteMsg) String() string { return proto.CompactTextString(m) }
func (*HasVoteMsg) ProtoMessage() {}
func (*HasVoteMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{22}
}
func (m *HasVoteMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_HasVoteMsg.Unmarshal(m, b)
}
func (m *HasVoteMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_HasVoteMsg.Marshal(b, m, deterministic)
}
func (dst *HasVoteMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_HasVoteMsg.Merge(dst, src)
}
func (m *HasVoteMsg) XXX_Size() int {
return xxx_messageInfo_HasVoteMsg.Size(m)
}
func (m *HasVoteMsg) XXX_DiscardUnknown() {
xxx_messageInfo_HasVoteMsg.DiscardUnknown(m)
} }
var xxx_messageInfo_HasVoteMsg proto.InternalMessageInfo func (m *HasVoteMsg) Reset() { *m = HasVoteMsg{} }
func (m *HasVoteMsg) String() string { return proto.CompactTextString(m) }
func (*HasVoteMsg) ProtoMessage() {}
func (*HasVoteMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} }
func (m *HasVoteMsg) GetHeight() int64 { func (m *HasVoteMsg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1443,38 +998,16 @@ func (m *HasVoteMsg) GetIndex() int32 { ...@@ -1443,38 +998,16 @@ func (m *HasVoteMsg) GetIndex() int32 {
} }
type VoteSetMaj23Msg struct { type VoteSetMaj23Msg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` Type int32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"`
BlockID *BlockID `protobuf:"bytes,4,opt,name=blockID,proto3" json:"blockID,omitempty"` BlockID *BlockID `protobuf:"bytes,4,opt,name=blockID" json:"blockID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VoteSetMaj23Msg) Reset() { *m = VoteSetMaj23Msg{} }
func (m *VoteSetMaj23Msg) String() string { return proto.CompactTextString(m) }
func (*VoteSetMaj23Msg) ProtoMessage() {}
func (*VoteSetMaj23Msg) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{23}
}
func (m *VoteSetMaj23Msg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VoteSetMaj23Msg.Unmarshal(m, b)
}
func (m *VoteSetMaj23Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VoteSetMaj23Msg.Marshal(b, m, deterministic)
}
func (dst *VoteSetMaj23Msg) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteSetMaj23Msg.Merge(dst, src)
}
func (m *VoteSetMaj23Msg) XXX_Size() int {
return xxx_messageInfo_VoteSetMaj23Msg.Size(m)
}
func (m *VoteSetMaj23Msg) XXX_DiscardUnknown() {
xxx_messageInfo_VoteSetMaj23Msg.DiscardUnknown(m)
} }
var xxx_messageInfo_VoteSetMaj23Msg proto.InternalMessageInfo func (m *VoteSetMaj23Msg) Reset() { *m = VoteSetMaj23Msg{} }
func (m *VoteSetMaj23Msg) String() string { return proto.CompactTextString(m) }
func (*VoteSetMaj23Msg) ProtoMessage() {}
func (*VoteSetMaj23Msg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} }
func (m *VoteSetMaj23Msg) GetHeight() int64 { func (m *VoteSetMaj23Msg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1505,39 +1038,17 @@ func (m *VoteSetMaj23Msg) GetBlockID() *BlockID { ...@@ -1505,39 +1038,17 @@ func (m *VoteSetMaj23Msg) GetBlockID() *BlockID {
} }
type VoteSetBitsMsg struct { type VoteSetBitsMsg struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,2,opt,name=round" json:"round,omitempty"`
Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` Type int32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"`
BlockID *BlockID `protobuf:"bytes,4,opt,name=blockID,proto3" json:"blockID,omitempty"` BlockID *BlockID `protobuf:"bytes,4,opt,name=blockID" json:"blockID,omitempty"`
Votes *TendermintBitArray `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes,omitempty"` Votes *TendermintBitArray `protobuf:"bytes,5,opt,name=votes" json:"votes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VoteSetBitsMsg) Reset() { *m = VoteSetBitsMsg{} }
func (m *VoteSetBitsMsg) String() string { return proto.CompactTextString(m) }
func (*VoteSetBitsMsg) ProtoMessage() {}
func (*VoteSetBitsMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{24}
}
func (m *VoteSetBitsMsg) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VoteSetBitsMsg.Unmarshal(m, b)
}
func (m *VoteSetBitsMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VoteSetBitsMsg.Marshal(b, m, deterministic)
}
func (dst *VoteSetBitsMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteSetBitsMsg.Merge(dst, src)
}
func (m *VoteSetBitsMsg) XXX_Size() int {
return xxx_messageInfo_VoteSetBitsMsg.Size(m)
}
func (m *VoteSetBitsMsg) XXX_DiscardUnknown() {
xxx_messageInfo_VoteSetBitsMsg.DiscardUnknown(m)
} }
var xxx_messageInfo_VoteSetBitsMsg proto.InternalMessageInfo func (m *VoteSetBitsMsg) Reset() { *m = VoteSetBitsMsg{} }
func (m *VoteSetBitsMsg) String() string { return proto.CompactTextString(m) }
func (*VoteSetBitsMsg) ProtoMessage() {}
func (*VoteSetBitsMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} }
func (m *VoteSetBitsMsg) GetHeight() int64 { func (m *VoteSetBitsMsg) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -1575,40 +1086,18 @@ func (m *VoteSetBitsMsg) GetVotes() *TendermintBitArray { ...@@ -1575,40 +1086,18 @@ func (m *VoteSetBitsMsg) GetVotes() *TendermintBitArray {
} }
type Heartbeat struct { type Heartbeat struct {
ValidatorAddress []byte `protobuf:"bytes,1,opt,name=validatorAddress,proto3" json:"validatorAddress,omitempty"` ValidatorAddress []byte `protobuf:"bytes,1,opt,name=validatorAddress,proto3" json:"validatorAddress,omitempty"`
ValidatorIndex int32 `protobuf:"varint,2,opt,name=validatorIndex,proto3" json:"validatorIndex,omitempty"` ValidatorIndex int32 `protobuf:"varint,2,opt,name=validatorIndex" json:"validatorIndex,omitempty"`
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"`
Round int32 `protobuf:"varint,4,opt,name=round,proto3" json:"round,omitempty"` Round int32 `protobuf:"varint,4,opt,name=round" json:"round,omitempty"`
Sequence int32 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` Sequence int32 `protobuf:"varint,5,opt,name=sequence" json:"sequence,omitempty"`
Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *Heartbeat) Reset() { *m = Heartbeat{} } func (m *Heartbeat) Reset() { *m = Heartbeat{} }
func (m *Heartbeat) String() string { return proto.CompactTextString(m) } func (m *Heartbeat) String() string { return proto.CompactTextString(m) }
func (*Heartbeat) ProtoMessage() {} func (*Heartbeat) ProtoMessage() {}
func (*Heartbeat) Descriptor() ([]byte, []int) { func (*Heartbeat) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} }
return fileDescriptor_tendermint_73641ebf19da43cb, []int{25}
}
func (m *Heartbeat) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Heartbeat.Unmarshal(m, b)
}
func (m *Heartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Heartbeat.Marshal(b, m, deterministic)
}
func (dst *Heartbeat) XXX_Merge(src proto.Message) {
xxx_messageInfo_Heartbeat.Merge(dst, src)
}
func (m *Heartbeat) XXX_Size() int {
return xxx_messageInfo_Heartbeat.Size(m)
}
func (m *Heartbeat) XXX_DiscardUnknown() {
xxx_messageInfo_Heartbeat.DiscardUnknown(m)
}
var xxx_messageInfo_Heartbeat proto.InternalMessageInfo
func (m *Heartbeat) GetValidatorAddress() []byte { func (m *Heartbeat) GetValidatorAddress() []byte {
if m != nil { if m != nil {
...@@ -1653,35 +1142,13 @@ func (m *Heartbeat) GetSignature() []byte { ...@@ -1653,35 +1142,13 @@ func (m *Heartbeat) GetSignature() []byte {
} }
type IsHealthy struct { type IsHealthy struct {
IsHealthy bool `protobuf:"varint,1,opt,name=isHealthy,proto3" json:"isHealthy,omitempty"` IsHealthy bool `protobuf:"varint,1,opt,name=isHealthy" json:"isHealthy,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IsHealthy) Reset() { *m = IsHealthy{} }
func (m *IsHealthy) String() string { return proto.CompactTextString(m) }
func (*IsHealthy) ProtoMessage() {}
func (*IsHealthy) Descriptor() ([]byte, []int) {
return fileDescriptor_tendermint_73641ebf19da43cb, []int{26}
}
func (m *IsHealthy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IsHealthy.Unmarshal(m, b)
}
func (m *IsHealthy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IsHealthy.Marshal(b, m, deterministic)
}
func (dst *IsHealthy) XXX_Merge(src proto.Message) {
xxx_messageInfo_IsHealthy.Merge(dst, src)
}
func (m *IsHealthy) XXX_Size() int {
return xxx_messageInfo_IsHealthy.Size(m)
}
func (m *IsHealthy) XXX_DiscardUnknown() {
xxx_messageInfo_IsHealthy.DiscardUnknown(m)
} }
var xxx_messageInfo_IsHealthy proto.InternalMessageInfo func (m *IsHealthy) Reset() { *m = IsHealthy{} }
func (m *IsHealthy) String() string { return proto.CompactTextString(m) }
func (*IsHealthy) ProtoMessage() {}
func (*IsHealthy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} }
func (m *IsHealthy) GetIsHealthy() bool { func (m *IsHealthy) GetIsHealthy() bool {
if m != nil { if m != nil {
...@@ -1711,6 +1178,7 @@ func init() { ...@@ -1711,6 +1178,7 @@ func init() {
proto.RegisterType((*TendermintBlock)(nil), "types.TendermintBlock") proto.RegisterType((*TendermintBlock)(nil), "types.TendermintBlock")
proto.RegisterType((*Proposal)(nil), "types.Proposal") proto.RegisterType((*Proposal)(nil), "types.Proposal")
proto.RegisterType((*NewRoundStepMsg)(nil), "types.NewRoundStepMsg") proto.RegisterType((*NewRoundStepMsg)(nil), "types.NewRoundStepMsg")
proto.RegisterType((*ValidBlockMsg)(nil), "types.ValidBlockMsg")
proto.RegisterType((*CommitStepMsg)(nil), "types.CommitStepMsg") proto.RegisterType((*CommitStepMsg)(nil), "types.CommitStepMsg")
proto.RegisterType((*ProposalPOLMsg)(nil), "types.ProposalPOLMsg") proto.RegisterType((*ProposalPOLMsg)(nil), "types.ProposalPOLMsg")
proto.RegisterType((*HasVoteMsg)(nil), "types.HasVoteMsg") proto.RegisterType((*HasVoteMsg)(nil), "types.HasVoteMsg")
...@@ -1720,100 +1188,100 @@ func init() { ...@@ -1720,100 +1188,100 @@ func init() {
proto.RegisterType((*IsHealthy)(nil), "types.IsHealthy") proto.RegisterType((*IsHealthy)(nil), "types.IsHealthy")
} }
func init() { proto.RegisterFile("tendermint.proto", fileDescriptor_tendermint_73641ebf19da43cb) } func init() { proto.RegisterFile("tendermint.proto", fileDescriptor0) }
var fileDescriptor_tendermint_73641ebf19da43cb = []byte{ var fileDescriptor0 = []byte{
// 1472 bytes of a gzipped FileDescriptorProto // 1460 bytes of a gzip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 0x2e, 0x04, 0x47, 0x2d, 0x2c, 0x5e, 0xf3, 0x01, 0xbd, 0x58, 0xf3, 0x01, 0xbd, 0x58, 0xfb,
0x1c, 0xb9, 0x30, 0x7b, 0xc3, 0xeb, 0x79, 0xb6, 0xe4, 0xf5, 0x3c, 0x5b, 0xfa, 0x7a, 0x9e, 0x2d, 0x01, 0xbd, 0x58, 0xf9, 0x80, 0x9e, 0x64, 0x3e, 0xa0, 0xf3, 0xc7, 0x2f, 0xba, 0xc7, 0xbf, 0x0d,
0xbc, 0x9e, 0x47, 0xb9, 0xd7, 0x73, 0xd1, 0xfd, 0xf5, 0xac, 0xfb, 0xb7, 0x61, 0x53, 0x8a, 0x2f, 0x15, 0x29, 0xbe, 0x9e, 0x63, 0x6f, 0x35, 0xd5, 0x97, 0xda, 0xd7, 0x37, 0x1a, 0xfa, 0x21, 0x54,
0xa7, 0xd8, 0x06, 0x4d, 0x11, 0x24, 0xf2, 0xea, 0x7a, 0xa7, 0xef, 0x43, 0xf5, 0x5c, 0x9e, 0x09, 0x4f, 0xe5, 0x89, 0xe0, 0x53, 0x35, 0xb9, 0xd2, 0x54, 0x3f, 0x31, 0xf0, 0x04, 0x15, 0xb6, 0x04,
0x3e, 0x56, 0xa3, 0x6b, 0x0d, 0xf5, 0x9d, 0x80, 0x1e, 0x6c, 0xb2, 0x54, 0x71, 0x55, 0xc1, 0xff, 0x2e, 0xca, 0xf8, 0xb7, 0xc4, 0xc1, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x85, 0xaa, 0x95, 0x93,
0x24, 0x8e, 0x7e, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x20, 0x41, 0x55, 0xc1, 0x10, 0x00, 0x00, 0xc3, 0x10, 0x00, 0x00,
} }
...@@ -3,17 +3,13 @@ ...@@ -3,17 +3,13 @@
package types package types
import ( import proto "github.com/golang/protobuf/proto"
fmt "fmt" import fmt "fmt"
import math "math"
proto "github.com/golang/protobuf/proto" import types1 "github.com/33cn/chain33/types"
math "math"
types "github.com/33cn/chain33/types"
import (
context "golang.org/x/net/context" context "golang.org/x/net/context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )
...@@ -22,43 +18,15 @@ var _ = proto.Marshal ...@@ -22,43 +18,15 @@ var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ValNode struct { type ValNode struct {
PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` Power int64 `protobuf:"varint,2,opt,name=power" json:"power,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValNode) Reset() { *m = ValNode{} }
func (m *ValNode) String() string { return proto.CompactTextString(m) }
func (*ValNode) ProtoMessage() {}
func (*ValNode) Descriptor() ([]byte, []int) {
return fileDescriptor_valnode_51979219d1bb0d85, []int{0}
}
func (m *ValNode) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNode.Unmarshal(m, b)
}
func (m *ValNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNode.Marshal(b, m, deterministic)
}
func (dst *ValNode) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNode.Merge(dst, src)
}
func (m *ValNode) XXX_Size() int {
return xxx_messageInfo_ValNode.Size(m)
}
func (m *ValNode) XXX_DiscardUnknown() {
xxx_messageInfo_ValNode.DiscardUnknown(m)
} }
var xxx_messageInfo_ValNode proto.InternalMessageInfo func (m *ValNode) Reset() { *m = ValNode{} }
func (m *ValNode) String() string { return proto.CompactTextString(m) }
func (*ValNode) ProtoMessage() {}
func (*ValNode) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (m *ValNode) GetPubKey() []byte { func (m *ValNode) GetPubKey() []byte {
if m != nil { if m != nil {
...@@ -75,35 +43,13 @@ func (m *ValNode) GetPower() int64 { ...@@ -75,35 +43,13 @@ func (m *ValNode) GetPower() int64 {
} }
type ValNodes struct { type ValNodes struct {
Nodes []*ValNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` Nodes []*ValNode `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValNodes) Reset() { *m = ValNodes{} }
func (m *ValNodes) String() string { return proto.CompactTextString(m) }
func (*ValNodes) ProtoMessage() {}
func (*ValNodes) Descriptor() ([]byte, []int) {
return fileDescriptor_valnode_51979219d1bb0d85, []int{1}
}
func (m *ValNodes) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNodes.Unmarshal(m, b)
}
func (m *ValNodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNodes.Marshal(b, m, deterministic)
}
func (dst *ValNodes) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNodes.Merge(dst, src)
}
func (m *ValNodes) XXX_Size() int {
return xxx_messageInfo_ValNodes.Size(m)
}
func (m *ValNodes) XXX_DiscardUnknown() {
xxx_messageInfo_ValNodes.DiscardUnknown(m)
} }
var xxx_messageInfo_ValNodes proto.InternalMessageInfo func (m *ValNodes) Reset() { *m = ValNodes{} }
func (m *ValNodes) String() string { return proto.CompactTextString(m) }
func (*ValNodes) ProtoMessage() {}
func (*ValNodes) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *ValNodes) GetNodes() []*ValNode { func (m *ValNodes) GetNodes() []*ValNode {
if m != nil { if m != nil {
...@@ -116,51 +62,27 @@ type ValNodeAction struct { ...@@ -116,51 +62,27 @@ type ValNodeAction struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// *ValNodeAction_Node // *ValNodeAction_Node
// *ValNodeAction_BlockInfo // *ValNodeAction_BlockInfo
Value isValNodeAction_Value `protobuf_oneof:"value"` Value isValNodeAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,3,opt,name=Ty,proto3" json:"Ty,omitempty"` Ty int32 `protobuf:"varint,3,opt,name=Ty" json:"Ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ValNodeAction) Reset() { *m = ValNodeAction{} } func (m *ValNodeAction) Reset() { *m = ValNodeAction{} }
func (m *ValNodeAction) String() string { return proto.CompactTextString(m) } func (m *ValNodeAction) String() string { return proto.CompactTextString(m) }
func (*ValNodeAction) ProtoMessage() {} func (*ValNodeAction) ProtoMessage() {}
func (*ValNodeAction) Descriptor() ([]byte, []int) { func (*ValNodeAction) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
return fileDescriptor_valnode_51979219d1bb0d85, []int{2}
}
func (m *ValNodeAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNodeAction.Unmarshal(m, b)
}
func (m *ValNodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNodeAction.Marshal(b, m, deterministic)
}
func (dst *ValNodeAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNodeAction.Merge(dst, src)
}
func (m *ValNodeAction) XXX_Size() int {
return xxx_messageInfo_ValNodeAction.Size(m)
}
func (m *ValNodeAction) XXX_DiscardUnknown() {
xxx_messageInfo_ValNodeAction.DiscardUnknown(m)
}
var xxx_messageInfo_ValNodeAction proto.InternalMessageInfo
type isValNodeAction_Value interface { type isValNodeAction_Value interface {
isValNodeAction_Value() isValNodeAction_Value()
} }
type ValNodeAction_Node struct { type ValNodeAction_Node struct {
Node *ValNode `protobuf:"bytes,1,opt,name=node,proto3,oneof"` Node *ValNode `protobuf:"bytes,1,opt,name=node,oneof"`
} }
type ValNodeAction_BlockInfo struct { type ValNodeAction_BlockInfo struct {
BlockInfo *TendermintBlockInfo `protobuf:"bytes,2,opt,name=blockInfo,proto3,oneof"` BlockInfo *TendermintBlockInfo `protobuf:"bytes,2,opt,name=blockInfo,oneof"`
} }
func (*ValNodeAction_Node) isValNodeAction_Value() {} func (*ValNodeAction_Node) isValNodeAction_Value() {}
func (*ValNodeAction_BlockInfo) isValNodeAction_Value() {} func (*ValNodeAction_BlockInfo) isValNodeAction_Value() {}
func (m *ValNodeAction) GetValue() isValNodeAction_Value { func (m *ValNodeAction) GetValue() isValNodeAction_Value {
...@@ -250,12 +172,12 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) { ...@@ -250,12 +172,12 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) {
switch x := m.Value.(type) { switch x := m.Value.(type) {
case *ValNodeAction_Node: case *ValNodeAction_Node:
s := proto.Size(x.Node) s := proto.Size(x.Node)
n += 1 // tag and wire n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case *ValNodeAction_BlockInfo: case *ValNodeAction_BlockInfo:
s := proto.Size(x.BlockInfo) s := proto.Size(x.BlockInfo)
n += 1 // tag and wire n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case nil: case nil:
...@@ -266,35 +188,13 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) { ...@@ -266,35 +188,13 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) {
} }
type ReqNodeInfo struct { type ReqNodeInfo struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ReqNodeInfo) Reset() { *m = ReqNodeInfo{} } func (m *ReqNodeInfo) Reset() { *m = ReqNodeInfo{} }
func (m *ReqNodeInfo) String() string { return proto.CompactTextString(m) } func (m *ReqNodeInfo) String() string { return proto.CompactTextString(m) }
func (*ReqNodeInfo) ProtoMessage() {} func (*ReqNodeInfo) ProtoMessage() {}
func (*ReqNodeInfo) Descriptor() ([]byte, []int) { func (*ReqNodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
return fileDescriptor_valnode_51979219d1bb0d85, []int{3}
}
func (m *ReqNodeInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqNodeInfo.Unmarshal(m, b)
}
func (m *ReqNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqNodeInfo.Marshal(b, m, deterministic)
}
func (dst *ReqNodeInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqNodeInfo.Merge(dst, src)
}
func (m *ReqNodeInfo) XXX_Size() int {
return xxx_messageInfo_ReqNodeInfo.Size(m)
}
func (m *ReqNodeInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ReqNodeInfo.DiscardUnknown(m)
}
var xxx_messageInfo_ReqNodeInfo proto.InternalMessageInfo
func (m *ReqNodeInfo) GetHeight() int64 { func (m *ReqNodeInfo) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -304,35 +204,13 @@ func (m *ReqNodeInfo) GetHeight() int64 { ...@@ -304,35 +204,13 @@ func (m *ReqNodeInfo) GetHeight() int64 {
} }
type ReqBlockInfo struct { type ReqBlockInfo struct {
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ReqBlockInfo) Reset() { *m = ReqBlockInfo{} } func (m *ReqBlockInfo) Reset() { *m = ReqBlockInfo{} }
func (m *ReqBlockInfo) String() string { return proto.CompactTextString(m) } func (m *ReqBlockInfo) String() string { return proto.CompactTextString(m) }
func (*ReqBlockInfo) ProtoMessage() {} func (*ReqBlockInfo) ProtoMessage() {}
func (*ReqBlockInfo) Descriptor() ([]byte, []int) { func (*ReqBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
return fileDescriptor_valnode_51979219d1bb0d85, []int{4}
}
func (m *ReqBlockInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqBlockInfo.Unmarshal(m, b)
}
func (m *ReqBlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqBlockInfo.Marshal(b, m, deterministic)
}
func (dst *ReqBlockInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqBlockInfo.Merge(dst, src)
}
func (m *ReqBlockInfo) XXX_Size() int {
return xxx_messageInfo_ReqBlockInfo.Size(m)
}
func (m *ReqBlockInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ReqBlockInfo.DiscardUnknown(m)
}
var xxx_messageInfo_ReqBlockInfo proto.InternalMessageInfo
func (m *ReqBlockInfo) GetHeight() int64 { func (m *ReqBlockInfo) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -357,12 +235,11 @@ var _ grpc.ClientConn ...@@ -357,12 +235,11 @@ var _ grpc.ClientConn
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4 const _ = grpc.SupportPackageIsVersion4
// ValnodeClient is the client API for Valnode service. // Client API for Valnode service
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ValnodeClient interface { type ValnodeClient interface {
IsSync(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*IsHealthy, error) IsSync(ctx context.Context, in *types1.ReqNil, opts ...grpc.CallOption) (*IsHealthy, error)
GetNodeInfo(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*ValidatorSet, error) GetNodeInfo(ctx context.Context, in *types1.ReqNil, opts ...grpc.CallOption) (*ValidatorSet, error)
} }
type valnodeClient struct { type valnodeClient struct {
...@@ -373,28 +250,29 @@ func NewValnodeClient(cc *grpc.ClientConn) ValnodeClient { ...@@ -373,28 +250,29 @@ func NewValnodeClient(cc *grpc.ClientConn) ValnodeClient {
return &valnodeClient{cc} return &valnodeClient{cc}
} }
func (c *valnodeClient) IsSync(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*IsHealthy, error) { func (c *valnodeClient) IsSync(ctx context.Context, in *types1.ReqNil, opts ...grpc.CallOption) (*IsHealthy, error) {
out := new(IsHealthy) out := new(IsHealthy)
err := c.cc.Invoke(ctx, "/types.valnode/IsSync", in, out, opts...) err := grpc.Invoke(ctx, "/types.valnode/IsSync", in, out, c.cc, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *valnodeClient) GetNodeInfo(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*ValidatorSet, error) { func (c *valnodeClient) GetNodeInfo(ctx context.Context, in *types1.ReqNil, opts ...grpc.CallOption) (*ValidatorSet, error) {
out := new(ValidatorSet) out := new(ValidatorSet)
err := c.cc.Invoke(ctx, "/types.valnode/GetNodeInfo", in, out, opts...) err := grpc.Invoke(ctx, "/types.valnode/GetNodeInfo", in, out, c.cc, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
// ValnodeServer is the server API for Valnode service. // Server API for Valnode service
type ValnodeServer interface { type ValnodeServer interface {
IsSync(context.Context, *types.ReqNil) (*IsHealthy, error) IsSync(context.Context, *types1.ReqNil) (*IsHealthy, error)
GetNodeInfo(context.Context, *types.ReqNil) (*ValidatorSet, error) GetNodeInfo(context.Context, *types1.ReqNil) (*ValidatorSet, error)
} }
func RegisterValnodeServer(s *grpc.Server, srv ValnodeServer) { func RegisterValnodeServer(s *grpc.Server, srv ValnodeServer) {
...@@ -402,7 +280,7 @@ func RegisterValnodeServer(s *grpc.Server, srv ValnodeServer) { ...@@ -402,7 +280,7 @@ func RegisterValnodeServer(s *grpc.Server, srv ValnodeServer) {
} }
func _Valnode_IsSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Valnode_IsSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(types.ReqNil) in := new(types1.ReqNil)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
...@@ -414,13 +292,13 @@ func _Valnode_IsSync_Handler(srv interface{}, ctx context.Context, dec func(inte ...@@ -414,13 +292,13 @@ func _Valnode_IsSync_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: "/types.valnode/IsSync", FullMethod: "/types.valnode/IsSync",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValnodeServer).IsSync(ctx, req.(*types.ReqNil)) return srv.(ValnodeServer).IsSync(ctx, req.(*types1.ReqNil))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Valnode_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Valnode_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(types.ReqNil) in := new(types1.ReqNil)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
...@@ -432,7 +310,7 @@ func _Valnode_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func ...@@ -432,7 +310,7 @@ func _Valnode_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func
FullMethod: "/types.valnode/GetNodeInfo", FullMethod: "/types.valnode/GetNodeInfo",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValnodeServer).GetNodeInfo(ctx, req.(*types.ReqNil)) return srv.(ValnodeServer).GetNodeInfo(ctx, req.(*types1.ReqNil))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
...@@ -454,9 +332,9 @@ var _Valnode_serviceDesc = grpc.ServiceDesc{ ...@@ -454,9 +332,9 @@ var _Valnode_serviceDesc = grpc.ServiceDesc{
Metadata: "valnode.proto", Metadata: "valnode.proto",
} }
func init() { proto.RegisterFile("valnode.proto", fileDescriptor_valnode_51979219d1bb0d85) } func init() { proto.RegisterFile("valnode.proto", fileDescriptor1) }
var fileDescriptor_valnode_51979219d1bb0d85 = []byte{ var fileDescriptor1 = []byte{
// 322 bytes of a gzipped FileDescriptorProto // 322 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x51, 0xcd, 0x6a, 0xf2, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x51, 0xcd, 0x6a, 0xf2, 0x40,
0x14, 0x4d, 0xcc, 0x97, 0xf8, 0xf5, 0x46, 0x45, 0xa6, 0x45, 0x42, 0x56, 0x61, 0xb0, 0x25, 0x50, 0x14, 0x4d, 0xcc, 0x97, 0xf8, 0xf5, 0x46, 0x45, 0xa6, 0x45, 0x42, 0x56, 0x61, 0xb0, 0x25, 0x50,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment