From 663243c4462fa19502bda5e014995737f95b6dee Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Thu, 30 Apr 2020 13:29:04 +0200 Subject: [PATCH] state: export InitStateVersion This is useful for custom state sync `StateProvider` implementations that need to build new states for bootstrapping the node. It will also be useful when implementing other mechanisms to bootstrap nodes, e.g. #4642 and #3713. --- CHANGELOG_PENDING.md | 1 + state/state.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 6ed6f2055..23dac0b03 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -41,6 +41,7 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi - nostrip: don't strip debugging symbols nor DWARF tables. - cleveldb: use cleveldb as db backend instead of goleveldb. - race: pass -race to go build and enable data race detection. +- [state] [\#4781](https://github.com/tendermint/tendermint/pull/4781) Export `InitStateVersion` for the initial state version (@erikgrinaker) ### BUG FIXES: diff --git a/state/state.go b/state/state.go index e0612576a..3143da079 100644 --- a/state/state.go +++ b/state/state.go @@ -27,11 +27,11 @@ type Version struct { Software string } -// initStateVersion sets the Consensus.Block and Software versions, +// InitStateVersion sets the Consensus.Block and Software versions, // but leaves the Consensus.App version blank. // The Consensus.App version will be set during the Handshake, once // we hear from the app what protocol version it is running. -var initStateVersion = Version{ +var InitStateVersion = Version{ Consensus: version.Consensus{ Block: version.BlockProtocol, App: 0, @@ -231,7 +231,7 @@ func MakeGenesisState(genDoc *types.GenesisDoc) (State, error) { } return State{ - Version: initStateVersion, + Version: InitStateVersion, ChainID: genDoc.ChainID, LastBlockHeight: 0,