Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not merge this PR #1

Open
wants to merge 91 commits into
base: silei/v0.27.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
adf8cea
Pass nil to NewValidatorSet() when genesis file's Validators field is…
alessio Oct 12, 2018
7220167
set next validators along with validators while replay (#2637)
melekes Oct 15, 2018
1ad379a
Update CHANGELOG_PENDING.md
alessio Oct 18, 2018
90eda9b
changelog and version
ebuchman Oct 18, 2018
c1a7c78
upgrade to version 0.25.1-rc0
wukongcheng Oct 22, 2018
6b9bce4
Merge with v0.26.1-rc0
Nov 9, 2018
164fd2a
Merge pull request #14 from HaoyangLiu/irisnet/v0.26.1-rc0-iris
Nov 9, 2018
58574b7
Require addressbook to only store addresses with valid ID
jaekwon Nov 9, 2018
48ab899
Do not shut down peer immediately after sending pex addrs in SeedMode
jaekwon Nov 10, 2018
67042be
Add reteat last block interface for block store
Nov 13, 2018
1771138
Merge branch 'irisnet/v0.26.1-rc0-iris' of https://github.com/Haoyang…
Nov 14, 2018
7ba4f02
Add tag for future merge
Nov 14, 2018
650b6dd
Merge pull request #17 from HaoyangLiu/irisnet/v0.26.1-rc0-iris
Nov 14, 2018
d72aea0
update
MrXJC Nov 22, 2018
d18b38d
Merge pull request #18 from MrXJC/jiacheng/v0.26.1-rc3-iris
wukongcheng Nov 22, 2018
8c7f910
Enable terminate command from abci and stop p2p gossip when deprecate…
Nov 22, 2018
bb400bc
Add log in query mode
Nov 22, 2018
cfd38fa
Add deprecated flag
Nov 23, 2018
67b9586
Add interval before exit
Nov 23, 2018
b2045b4
Merge tag 'v0.26.1-rc3' into haoyang/v0.26.1-rc3-iris
Nov 26, 2018
5fe0622
Merge branch 'irisnet/v0.26.1-rc3-iris' into haoyang/v0.26.1-rc3-iris
Nov 26, 2018
6a0515f
change terminator tag to the first tag
Nov 26, 2018
e1bfbff
Merge pull request #19 from HaoyangLiu/haoyang/v0.26.1-rc3-iris
wukongcheng Nov 26, 2018
6f2d6ce
Add replay height
Nov 29, 2018
1754662
Fix replay_height flag error
Nov 29, 2018
56f7d01
merge with v0.27.0-dev1
Nov 30, 2018
d19442e
Rename termanate to halt
Dec 5, 2018
aed517b
Merge tag 'v0.27.0' into irinset/merge-0.27.0
Dec 11, 2018
789e9a1
Improve log
Dec 11, 2018
8c40185
Remmove useless change
Dec 11, 2018
b31a2e7
Merge pull request #22 from HaoyangLiu/irinset/merge-0.27.0
wukongcheng Dec 11, 2018
79f7453
modify for class2 upgrade
MrXJC Dec 12, 2018
c09e95e
fix the comment
MrXJC Dec 14, 2018
6472c02
fix the comment
MrXJC Dec 17, 2018
afb2a33
Merge pull request #23 from MrXJC/jiacheng/v0.27.0-iris
wukongcheng Dec 17, 2018
11770df
merge with v0.27.0-iris
chengwenxi Dec 21, 2018
3df7ea0
update HaltTagKey tag handler
chengwenxi Dec 21, 2018
6ca01a2
Merge pull request #24 from chengwenxi/irisnet/v0.27.3-iris
wukongcheng Dec 21, 2018
2892bed
Improve replay_height description
Dec 24, 2018
bf8a3cf
Merge pull request #25 from HaoyangLiu/irisnet/v0.27.3-iris
wukongcheng Dec 24, 2018
7e7484d
Add reteat last block
chengwenxi Dec 28, 2018
f028d0a
Merge pull request #26 from chengwenxi/irisnet/v0.27.3-iris
wukongcheng Dec 28, 2018
d060768
Use Goroutine exit
chengwenxi Jan 4, 2019
ae55f6e
Merge pull request #27 from chengwenxi/v0.27.3-iris
wukongcheng Jan 7, 2019
8f08108
Fix bug in include evidece into block
Jan 9, 2019
f261e73
Merge pull request #28 from HaoyangLiu/irisnet/v0.27.3-iris
Jan 9, 2019
7134300
Update block protocol version
chengwenxi Jan 10, 2019
2313260
disable this check for replay blocks
Jan 15, 2019
c171a68
For replaying blocks, load history validator set
Jan 16, 2019
c88e2ac
Merge pull request #31 from HaoyangLiu/irisnet/v0.27.3-iris
Jan 16, 2019
ef07f82
Add appHash checking in replay mode
Jan 16, 2019
db83c67
stop gorouting instead of stoping process
Jan 16, 2019
e56cb0f
merge with irisnet repo
Jan 16, 2019
49a1e66
Improve panic message
Jan 16, 2019
9505c83
Merge pull request #32 from HaoyangLiu/irisnet/v0.27.3-iris
wukongcheng Jan 16, 2019
3d4486c
Merge pull request #35 from chengwenxi/v0.27.3-iris
wukongcheng Jan 24, 2019
ab90c37
Avoid one evidence being committed multiple times
chengwenxi Jan 25, 2019
41c9964
Fix comment
chengwenxi Jan 25, 2019
7b41941
Vote nil for repeated evidence in one block
chengwenxi Jan 25, 2019
96f5da0
Merge pull request #37 from chengwenxi/v0.27.3-iris
wukongcheng Jan 25, 2019
7653a78
fix DynamicVerifier for large validator set changes
Jan 25, 2019
95de02f
Merge branch 'irisnet/v0.27.3-iris' of https://github.com/irisnet/ten…
Jan 25, 2019
7dfe2e8
Merge pull request #38 from HaoyangLiu/irisnet/v0.27.3-iris
wukongcheng Jan 28, 2019
ea969de
Add consensus failure to metrics
Jan 30, 2019
19b6786
Add appHash conflict and recheck time to metrics
Jan 31, 2019
9bf9ace
Optimize transaction search
chengwenxi Jan 31, 2019
4a9b0fd
Change to count type
Jan 31, 2019
b5282f8
remove height label from recheckTime metrics
Jan 31, 2019
edf68d6
Merge pull request #39 from HaoyangLiu/irisnet/v0.27.3-iris-metrics
wukongcheng Jan 31, 2019
ff8ef6b
Merge pull request #40 from chengwenxi/v0.27.3-iris
wukongcheng Feb 1, 2019
2d13d99
bug fix for evidence check
chengwenxi Feb 13, 2019
95d1adb
Merge pull request #41 from chengwenxi/v0.27.3-iris
wukongcheng Feb 13, 2019
1d89d5d
Patch remote signer to work with the KMS
Feb 21, 2019
9151808
Merge pull request #42 from cryptiumlabs/adrian/fix_remote_signer
Feb 22, 2019
410f72a
switch fields ordering
chengwenxi Feb 22, 2019
537e54d
Merge pull request #43 from chengwenxi/v0.27.3-iris
wukongcheng Feb 22, 2019
a7e5123
Cherry pick from https://github.com/tendermint/tendermint/pull/3150
Feb 27, 2019
fdbb676
Fix mempool reactor goroutine leak
Feb 27, 2019
0481372
Fix consensus round issue
chengwenxi Mar 5, 2019
7715be4
Merge pull request #45 from chengwenxi/consensus-round
Mar 5, 2019
9960b25
Add maximum msg size in CheckTx
Mar 5, 2019
2a50634
Remove useless func
Mar 5, 2019
3267dd1
Add missed cherry pick
Mar 5, 2019
3079771
Add latest tx to the back of cache list, in case of being removed by …
Mar 6, 2019
add95d4
Merge pull request #47 from HaoyangLiu/fix-LRU-cache-issue
wukongcheng Mar 6, 2019
0315579
Merge pull request #46 from HaoyangLiu/check-maximum-message-size
wukongcheng Mar 7, 2019
0a950f9
Cherry pick from https://github.com/tendermint/tendermint/pull/3232
Mar 7, 2019
20afc34
add stopMtx for FlushStop and OnStop
Mar 7, 2019
73e19fe
Merge pull request #50 from HaoyangLiu/fix-FlushStop
Mar 19, 2019
681a9ff
Merge pull request #44 from HaoyangLiu/fix-leak
Mar 20, 2019
facf40e
Merge pull request #48 from HaoyangLiu/infinite-loop-addrbook
Mar 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions abci/types/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package types

import (
"bytes"
common "github.com/tendermint/tendermint/libs/common"
"sort"
)

Expand Down Expand Up @@ -32,3 +33,12 @@ func (v ValidatorUpdates) Swap(i, j int) {
v[i] = v[j]
v[j] = v1
}

func GetTagByKey(tags []common.KVPair, key string) (common.KVPair, bool) {
for _, tag := range tags {
if bytes.Equal(tag.Key, []byte(key)) {
return tag, true
}
}
return common.KVPair{}, false
}
14 changes: 14 additions & 0 deletions blockchain/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, s
bs.db.SetSync(nil, nil)
}

func (bs *BlockStore) RetreatLastBlock() {
height := bs.height
bs.db.Delete(calcBlockMetaKey(height))
bs.db.Delete(calcBlockCommitKey(height-1))
bs.db.Delete(calcSeenCommitKey(height))
BlockStoreStateJSON{Height: height-1 }.Save(bs.db)
// Done!
bs.mtx.Lock()
bs.height = height
bs.mtx.Unlock()
// Flush
bs.db.SetSync(nil, nil)
}

func (bs *BlockStore) saveBlockPart(height int64, index int, part *types.Part) {
if height != bs.Height()+1 {
cmn.PanicSanity(fmt.Sprintf("BlockStore can only save contiguous blocks. Wanted %v, got %v", bs.Height()+1, height))
Expand Down
2 changes: 2 additions & 0 deletions cmd/tendermint/commands/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func AddNodeFlags(cmd *cobra.Command) {

// node flags
cmd.Flags().Bool("fast_sync", config.FastSync, "Fast blockchain syncing")
cmd.Flags().Bool("deprecated", config.Deprecated, "Mark blockchain as deprecated")
cmd.Flags().Int64("replay_height", config.ReplayHeight, "Specify which height to replay to, this is useful for exporting at any height")

// abci flags
cmd.Flags().String("proxy_app", config.ProxyApp, "Proxy app address, or 'nilapp' or 'kvstore' for local testing.")
Expand Down
9 changes: 9 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ type BaseConfig struct {
// and verifying their commits
FastSync bool `mapstructure:"fast_sync"`

// If the blockchain is deprecated, run node with Deprecated will
// work in query only mode. Consensus engine and p2p gossip will be
// shutdown
Deprecated bool `mapstructure:"deprecated"`

ReplayHeight int64 `mapstructure:"replay_height"`

// Database backend: leveldb | memdb | cleveldb
DBBackend string `mapstructure:"db_backend"`

Expand Down Expand Up @@ -193,6 +200,8 @@ func DefaultBaseConfig() BaseConfig {
LogFormat: LogFormatPlain,
ProfListenAddress: "",
FastSync: true,
Deprecated: false,
ReplayHeight: -1,
FilterPeers: false,
DBBackend: "leveldb",
DBPath: "data",
Expand Down
5 changes: 5 additions & 0 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ moniker = "{{ .BaseConfig.Moniker }}"
# and verifying their commits
fast_sync = {{ .BaseConfig.FastSync }}

# If the blockchain is deprecated, run node with Deprecated will
# work in query only mode. Consensus engine and p2p gossip will be
# shutdown
deprecated = {{ .BaseConfig.Deprecated }}

# Database backend: leveldb | memdb | cleveldb
db_backend = "{{ .BaseConfig.DBBackend }}"

Expand Down
10 changes: 10 additions & 0 deletions consensus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const MetricsSubsystem = "consensus"
type Metrics struct {
// Height of the chain.
Height metrics.Gauge
// Consensus Failure
ConsensusFailure metrics.Counter

// Number of rounds.
Rounds metrics.Gauge
Expand Down Expand Up @@ -58,6 +60,12 @@ func PrometheusMetrics(namespace string) *Metrics {
Name: "height",
Help: "Height of the chain.",
}, []string{}),
ConsensusFailure: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "consensus_failure",
Help: "Consensus failure",
}, []string{"height"}),
Rounds: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Expand Down Expand Up @@ -153,6 +161,8 @@ func NopMetrics() *Metrics {
return &Metrics{
Height: discard.NewGauge(),

ConsensusFailure: discard.NewCounter(),

Rounds: discard.NewGauge(),

Validators: discard.NewGauge(),
Expand Down
1 change: 1 addition & 0 deletions consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (m *mockEvidencePool) Update(block *types.Block, state sm.State) {
}
m.height++
}
func (m *mockEvidencePool) IsCommitted(types.Evidence) bool { return false }

//------------------------------------

Expand Down
31 changes: 26 additions & 5 deletions consensus/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"hash/crc32"
"io"
"reflect"
"runtime"
//"strconv"
//"strings"
"time"

abci "github.com/tendermint/tendermint/abci/types"
cfg "github.com/tendermint/tendermint/config"
//auto "github.com/tendermint/tendermint/libs/autofile"
cmn "github.com/tendermint/tendermint/libs/common"
dbm "github.com/tendermint/tendermint/libs/db"
Expand Down Expand Up @@ -224,7 +226,7 @@ func (h *Handshaker) NBlocks() int {
}

// TODO: retry the handshake/replay if it fails ?
func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
func (h *Handshaker) Handshake(proxyApp proxy.AppConns, config *cfg.BaseConfig) error {

// Handshake is done via ABCI Info on the query conn.
res, err := proxyApp.Query().InfoSync(proxy.RequestInfo)
Expand All @@ -249,8 +251,14 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error {
h.initialState.Version.Consensus.App = version.Protocol(res.AppVersion)
sm.SaveState(h.stateDB, h.initialState)

//////////////////// iris/tendermint begin ///////////////////////////
state := sm.LoadState(h.stateDB)
state.Version.Consensus.App = version.Protocol(res.AppVersion)
sm.SaveState(h.stateDB, state)
//////////////////// iris/tendermint end ///////////////////////////

// Replay blocks up to the latest in the blockstore.
_, err = h.ReplayBlocks(h.initialState, appHash, blockHeight, proxyApp)
_, err = h.ReplayBlocks(h.initialState, appHash, blockHeight, proxyApp, config)
if err != nil {
return fmt.Errorf("Error on replay: %v", err)
}
Expand All @@ -270,6 +278,7 @@ func (h *Handshaker) ReplayBlocks(
appHash []byte,
appBlockHeight int64,
proxyApp proxy.AppConns,
config *cfg.BaseConfig,
) ([]byte, error) {
storeBlockHeight := h.store.Height()
stateBlockHeight := state.LastBlockHeight
Expand Down Expand Up @@ -344,7 +353,7 @@ func (h *Handshaker) ReplayBlocks(
// Either the app is asking for replay, or we're all synced up.
if appBlockHeight < storeBlockHeight {
// the app is behind, so replay blocks, but no need to go through WAL (state is already synced to store)
return h.replayBlocks(state, proxyApp, appBlockHeight, storeBlockHeight, false)
return h.replayBlocks(state, proxyApp, appBlockHeight, storeBlockHeight, false, config)

} else if appBlockHeight == storeBlockHeight {
// We're good!
Expand All @@ -357,7 +366,7 @@ func (h *Handshaker) ReplayBlocks(
if appBlockHeight < stateBlockHeight {
// the app is further behind than it should be, so replay blocks
// but leave the last block to go through the WAL
return h.replayBlocks(state, proxyApp, appBlockHeight, storeBlockHeight, true)
return h.replayBlocks(state, proxyApp, appBlockHeight, storeBlockHeight, true, config)

} else if appBlockHeight == stateBlockHeight {
// We haven't run Commit (both the state and app are one block behind),
Expand Down Expand Up @@ -386,7 +395,7 @@ func (h *Handshaker) ReplayBlocks(
return nil, nil
}

func (h *Handshaker) replayBlocks(state sm.State, proxyApp proxy.AppConns, appBlockHeight, storeBlockHeight int64, mutateState bool) ([]byte, error) {
func (h *Handshaker) replayBlocks(state sm.State, proxyApp proxy.AppConns, appBlockHeight, storeBlockHeight int64, mutateState bool, config *cfg.BaseConfig) ([]byte, error) {
// App is further behind than it should be, so we need to replay blocks.
// We replay all blocks from appBlockHeight+1.
//
Expand All @@ -406,11 +415,23 @@ func (h *Handshaker) replayBlocks(state sm.State, proxyApp proxy.AppConns, appBl
for i := appBlockHeight + 1; i <= finalBlock; i++ {
h.logger.Info("Applying block", "height", i)
block := h.store.LoadBlock(i)

if len(appHash) != 0 {
if !bytes.Equal(block.Header.AppHash, appHash) {
panic(fmt.Sprintf("AppHash mismatch: expected %s, actual %s", block.AppHash.String(), cmn.HexBytes(appHash).String()))
}
}

appHash, err = sm.ExecCommitBlock(proxyApp.Consensus(), block, h.logger, state.LastValidators, h.stateDB)
if err != nil {
return nil, err
}

if config.ReplayHeight > 0 && i >= config.ReplayHeight {
fmt.Printf("Replay from height %d to height %d successfully", appBlockHeight, config.ReplayHeight)
runtime.Goexit()
}

h.nBlocks++
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/replay_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func newConsensusStateForReplay(config cfg.BaseConfig, csConfig *cfg.ConsensusCo
}

handshaker := NewHandshaker(stateDB, state, blockStore, gdoc)
err = handshaker.Handshake(proxyApp)
err = handshaker.Handshake(proxyApp, &config)
if err != nil {
cmn.Exit(fmt.Sprintf("Error on handshake: %v", err))
}
Expand Down
28 changes: 21 additions & 7 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"reflect"
"runtime/debug"
"strconv"
"sync"
"time"

Expand All @@ -22,7 +23,10 @@ import (
"github.com/tendermint/tendermint/types"
)

//-----------------------------------------------------------------------------
const (
deprecatedToShutdownInterval = 30
)

// Errors

var (
Expand Down Expand Up @@ -74,9 +78,8 @@ type ConsensusState struct {
evpool sm.EvidencePool

// internal state
mtx sync.RWMutex
mtx sync.RWMutex
cstypes.RoundState
triggeredTimeoutPrecommit bool
state sm.State // State until height-1.

// state changes may be triggered by: msgs from peers,
Expand Down Expand Up @@ -116,6 +119,8 @@ type ConsensusState struct {

// for reporting metrics
metrics *Metrics

Deprecated bool
}

// StateOption sets an optional parameter on the ConsensusState.
Expand Down Expand Up @@ -152,6 +157,7 @@ func NewConsensusState(
cs.doPrevote = cs.defaultDoPrevote
cs.setProposal = cs.defaultSetProposal

cs.Deprecated = state.Deprecated
cs.updateToState(state)

// Don't call scheduleRound0 yet.
Expand Down Expand Up @@ -534,6 +540,7 @@ func (cs *ConsensusState) updateToState(state sm.State) {
cs.LastValidators = state.LastValidators

cs.state = state
cs.Deprecated = state.Deprecated

// Finally, broadcast RoundState
cs.newStep()
Expand Down Expand Up @@ -573,6 +580,7 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {

defer func() {
if r := recover(); r != nil {
cs.metrics.ConsensusFailure.With("height", strconv.Itoa(int(cs.Height))).Add(float64(1))
cs.Logger.Error("CONSENSUS FAILURE!!!", "err", r, "stack", string(debug.Stack()))
// stop gracefully
//
Expand All @@ -587,6 +595,11 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {
}()

for {
if cs.Deprecated {
cs.Logger.Info(fmt.Sprintf("this blockchain has been deprecated. %d seconds later, this node will be shutdown", deprecatedToShutdownInterval))
time.Sleep(deprecatedToShutdownInterval * time.Second)
cmn.Exit("Shutdown this blockchain node")
}
if maxSteps > 0 {
if cs.nSteps >= maxSteps {
cs.Logger.Info("reached max steps. exiting receive routine")
Expand Down Expand Up @@ -714,6 +727,7 @@ func (cs *ConsensusState) handleTxsAvailable() {
cs.mtx.Lock()
defer cs.mtx.Unlock()
// we only need to do this for round 0
cs.enterNewRound(cs.Height, 0)
cs.enterPropose(cs.Height, 0)
}

Expand Down Expand Up @@ -764,7 +778,7 @@ func (cs *ConsensusState) enterNewRound(height int64, round int) {
cs.ProposalBlockParts = nil
}
cs.Votes.SetRound(round + 1) // also track next round (round+1) to allow round-skipping
cs.triggeredTimeoutPrecommit = false
cs.TriggeredTimeoutPrecommit = false

cs.eventBus.PublishEventNewRound(cs.NewRoundEvent())
cs.metrics.Rounds.Set(float64(round))
Expand Down Expand Up @@ -1121,12 +1135,12 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) {
func (cs *ConsensusState) enterPrecommitWait(height int64, round int) {
logger := cs.Logger.With("height", height, "round", round)

if cs.Height != height || round < cs.Round || (cs.Round == round && cs.triggeredTimeoutPrecommit) {
if cs.Height != height || round < cs.Round || (cs.Round == round && cs.TriggeredTimeoutPrecommit) {
logger.Debug(
fmt.Sprintf(
"enterPrecommitWait(%v/%v): Invalid args. "+
"Current state is Height/Round: %v/%v/, triggeredTimeoutPrecommit:%v",
height, round, cs.Height, cs.Round, cs.triggeredTimeoutPrecommit))
height, round, cs.Height, cs.Round, cs.TriggeredTimeoutPrecommit))
return
}
if !cs.Votes.Precommits(round).HasTwoThirdsAny() {
Expand All @@ -1136,7 +1150,7 @@ func (cs *ConsensusState) enterPrecommitWait(height int64, round int) {

defer func() {
// Done enterPrecommitWait:
cs.triggeredTimeoutPrecommit = true
cs.TriggeredTimeoutPrecommit = true
cs.newStep()
}()

Expand Down
39 changes: 20 additions & 19 deletions consensus/types/round_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,26 @@ func (rs RoundStepType) String() string {
// NOTE: Not thread safe. Should only be manipulated by functions downstream
// of the cs.receiveRoutine
type RoundState struct {
Height int64 `json:"height"` // Height we are working on
Round int `json:"round"`
Step RoundStepType `json:"step"`
StartTime time.Time `json:"start_time"`
CommitTime time.Time `json:"commit_time"` // Subjective time when +2/3 precommits for Block at Round were found
Validators *types.ValidatorSet `json:"validators"`
Proposal *types.Proposal `json:"proposal"`
ProposalBlock *types.Block `json:"proposal_block"`
ProposalBlockParts *types.PartSet `json:"proposal_block_parts"`
LockedRound int `json:"locked_round"`
LockedBlock *types.Block `json:"locked_block"`
LockedBlockParts *types.PartSet `json:"locked_block_parts"`
ValidRound int `json:"valid_round"` // Last known round with POL for non-nil valid block.
ValidBlock *types.Block `json:"valid_block"` // Last known block of POL mentioned above.
ValidBlockParts *types.PartSet `json:"valid_block_parts"` // Last known block parts of POL metnioned above.
Votes *HeightVoteSet `json:"votes"`
CommitRound int `json:"commit_round"` //
LastCommit *types.VoteSet `json:"last_commit"` // Last precommits at Height-1
LastValidators *types.ValidatorSet `json:"last_validators"`
Height int64 `json:"height"` // Height we are working on
Round int `json:"round"`
Step RoundStepType `json:"step"`
StartTime time.Time `json:"start_time"`
CommitTime time.Time `json:"commit_time"` // Subjective time when +2/3 precommits for Block at Round were found
Validators *types.ValidatorSet `json:"validators"`
Proposal *types.Proposal `json:"proposal"`
ProposalBlock *types.Block `json:"proposal_block"`
ProposalBlockParts *types.PartSet `json:"proposal_block_parts"`
LockedRound int `json:"locked_round"`
LockedBlock *types.Block `json:"locked_block"`
LockedBlockParts *types.PartSet `json:"locked_block_parts"`
ValidRound int `json:"valid_round"` // Last known round with POL for non-nil valid block.
ValidBlock *types.Block `json:"valid_block"` // Last known block of POL mentioned above.
ValidBlockParts *types.PartSet `json:"valid_block_parts"` // Last known block parts of POL metnioned above.
Votes *HeightVoteSet `json:"votes"`
CommitRound int `json:"commit_round"` //
LastCommit *types.VoteSet `json:"last_commit"` // Last precommits at Height-1
LastValidators *types.ValidatorSet `json:"last_validators"`
TriggeredTimeoutPrecommit bool `json:"triggered_timeout_precommit"`
}

// Compressed version of the RoundState for use in RPC
Expand Down
Loading