Commit 6904435a authored by caopingcp's avatar caopingcp

tendermint save local state

parent 91390fe4
This diff is collapsed.
...@@ -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))
}
This diff is collapsed.
...@@ -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;
} }
......
This diff is collapsed.
This diff is collapsed.
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