mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 14:34:17 +00:00
genesis: add support for arbitrary initial height (#5191)
Adds a genesis parameter `initial_height` which specifies the initial block height, as well as ABCI `RequestInitChain.InitialHeight` to pass it to the ABCI application, and `State.InitialHeight` to keep track of the initial height throughout the code. Fixes #2543, based on [RFC-002](https://github.com/tendermint/spec/pull/119). Spec changes in https://github.com/tendermint/spec/pull/135.
This commit is contained in:
@@ -64,6 +64,7 @@ message RequestInitChain {
|
||||
ConsensusParams consensus_params = 3;
|
||||
repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false];
|
||||
bytes app_state_bytes = 5;
|
||||
int64 initial_height = 6;
|
||||
}
|
||||
|
||||
message RequestQuery {
|
||||
|
||||
@@ -254,7 +254,8 @@ func (m *Version) GetSoftware() string {
|
||||
type State struct {
|
||||
Version Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"`
|
||||
// immutable
|
||||
ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
|
||||
ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
|
||||
InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"`
|
||||
// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
|
||||
LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"`
|
||||
LastBlockID types1.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"`
|
||||
@@ -326,6 +327,13 @@ func (m *State) GetChainID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *State) GetInitialHeight() int64 {
|
||||
if m != nil {
|
||||
return m.InitialHeight
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *State) GetLastBlockHeight() int64 {
|
||||
if m != nil {
|
||||
return m.LastBlockHeight
|
||||
@@ -414,54 +422,55 @@ func init() {
|
||||
func init() { proto.RegisterFile("tendermint/state/types.proto", fileDescriptor_ccfacf933f22bf93) }
|
||||
|
||||
var fileDescriptor_ccfacf933f22bf93 = []byte{
|
||||
// 750 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x4f, 0x6f, 0xd3, 0x3e,
|
||||
0x18, 0xc7, 0x9b, 0x5f, 0xb7, 0xb5, 0x75, 0xd6, 0x75, 0x3f, 0x8f, 0x43, 0xd7, 0xb1, 0xb4, 0x2b,
|
||||
0x08, 0x4d, 0x1c, 0x52, 0x69, 0x1c, 0x10, 0x97, 0x49, 0x4b, 0x8b, 0x58, 0xa5, 0x09, 0x81, 0x37,
|
||||
0xed, 0xc0, 0x25, 0x72, 0x1b, 0x2f, 0x89, 0x68, 0x93, 0x28, 0x76, 0xcb, 0x78, 0x01, 0xdc, 0x77,
|
||||
0xe5, 0xad, 0xf0, 0x0a, 0x76, 0xdc, 0x11, 0x71, 0x18, 0xa8, 0x7b, 0x23, 0xc8, 0x76, 0xfe, 0xb8,
|
||||
0x2d, 0x93, 0x86, 0xb8, 0x39, 0x7e, 0x9e, 0xe7, 0xe3, 0xaf, 0x1f, 0x7f, 0x1f, 0x05, 0x3c, 0x66,
|
||||
0x24, 0x70, 0x48, 0x3c, 0xf6, 0x03, 0xd6, 0xa1, 0x0c, 0x33, 0xd2, 0x61, 0x9f, 0x23, 0x42, 0xcd,
|
||||
0x28, 0x0e, 0x59, 0x08, 0x37, 0xf3, 0xa8, 0x29, 0xa2, 0x8d, 0x47, 0x6e, 0xe8, 0x86, 0x22, 0xd8,
|
||||
0xe1, 0x2b, 0x99, 0xd7, 0xd8, 0x51, 0x28, 0x78, 0x30, 0xf4, 0x55, 0x48, 0x43, 0x3d, 0x42, 0xec,
|
||||
0xcf, 0x45, 0x5b, 0x4b, 0xd1, 0x29, 0x1e, 0xf9, 0x0e, 0x66, 0x61, 0x9c, 0x64, 0xec, 0x2e, 0x65,
|
||||
0x44, 0x38, 0xc6, 0xe3, 0x14, 0x60, 0x28, 0xe1, 0x29, 0x89, 0xa9, 0x1f, 0x06, 0x73, 0x07, 0x34,
|
||||
0xdd, 0x30, 0x74, 0x47, 0xa4, 0x23, 0xbe, 0x06, 0x93, 0x8b, 0x0e, 0xf3, 0xc7, 0x84, 0x32, 0x3c,
|
||||
0x8e, 0x64, 0x42, 0xfb, 0x87, 0x06, 0xaa, 0x47, 0x56, 0xb7, 0x8f, 0x08, 0x8d, 0xc2, 0x80, 0x12,
|
||||
0x0a, 0xbb, 0x40, 0x77, 0xc8, 0xc8, 0x9f, 0x92, 0xd8, 0x66, 0x97, 0xb4, 0xae, 0xb5, 0x8a, 0xfb,
|
||||
0xfa, 0x41, 0xdb, 0x54, 0x9a, 0xc1, 0x2f, 0x69, 0xa6, 0x05, 0x3d, 0x99, 0x7b, 0x76, 0x89, 0x80,
|
||||
0x93, 0x2e, 0x29, 0x3c, 0x04, 0x15, 0x12, 0x38, 0xf6, 0x60, 0x14, 0x0e, 0x3f, 0xd6, 0xff, 0x6b,
|
||||
0x69, 0xfb, 0xfa, 0xc1, 0xde, 0xbd, 0x88, 0xd7, 0x81, 0x63, 0xf1, 0x44, 0x54, 0x26, 0xc9, 0x0a,
|
||||
0xf6, 0x80, 0x3e, 0x20, 0xae, 0x1f, 0x24, 0x84, 0xa2, 0x20, 0x3c, 0xb9, 0x97, 0x60, 0xf1, 0x5c,
|
||||
0xc9, 0x00, 0x83, 0x6c, 0xdd, 0xfe, 0xa2, 0x81, 0x8d, 0xf3, 0xb4, 0xa1, 0xb4, 0x1f, 0x5c, 0x84,
|
||||
0xb0, 0x0b, 0xaa, 0x59, 0x8b, 0x6d, 0x4a, 0x58, 0x5d, 0x13, 0x68, 0x43, 0x45, 0xcb, 0x06, 0x66,
|
||||
0x85, 0xa7, 0x84, 0xa1, 0xf5, 0xa9, 0xf2,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 0x6d, 0x50, 0xc6, 0x51, 0x24, 0x53, 0xaa, 0x22, 0xa5, 0x84, 0xa3, 0x88, 0x87,
|
||||
0xac, 0xf7, 0xd7, 0x33, 0x43, 0xbb, 0x99, 0x19, 0xda, 0xaf, 0x99, 0xa1, 0x5d, 0xdd, 0x19, 0x85,
|
||||
0x9b, 0x3b, 0xa3, 0xf0, 0xfd, 0xce, 0x28, 0x7c, 0x78, 0xe9, 0xfa, 0xcc, 0x9b, 0x0c, 0xcc, 0x61,
|
||||
0x38, 0xee, 0xa8, 0x3f, 0x8b, 0x7c, 0x29, 0xff, 0x58, 0x8b, 0xff, 0xba, 0xc1, 0x9a, 0xd8, 0x7f,
|
||||
0xf1, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xd2, 0xe7, 0x00, 0x06, 0x07, 0x00, 0x00,
|
||||
// 763 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6f, 0xd3, 0x30,
|
||||
0x14, 0x6e, 0xe8, 0xb6, 0xb6, 0xce, 0xda, 0x0e, 0x8f, 0x43, 0xd6, 0xb1, 0xb4, 0x2b, 0x3f, 0x34,
|
||||
0x71, 0x48, 0xa5, 0x71, 0x40, 0x5c, 0x26, 0x2d, 0x2d, 0x62, 0x95, 0x26, 0x04, 0xd9, 0xb4, 0x03,
|
||||
0x97, 0xc8, 0x6d, 0xbc, 0x24, 0xa2, 0x4d, 0xa2, 0xd8, 0x2d, 0xe3, 0x0f, 0xe0, 0xbe, 0x2b, 0xff,
|
||||
0xd1, 0x8e, 0x3b, 0x22, 0x0e, 0x03, 0xba, 0x7f, 0x04, 0xd9, 0xce, 0x0f, 0xb7, 0x65, 0xd2, 0x10,
|
||||
0x37, 0xfb, 0x7d, 0xdf, 0xfb, 0xfc, 0xf9, 0xf9, 0x3d, 0x19, 0x3c, 0xa6, 0x38, 0x70, 0x70, 0x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0x2d, 0x63, 0x71, 0xd6,
|
||||
0x8c, 0xc4, 0x54, 0x72, 0x44, 0xca, 0x87, 0xcf, 0x41, 0x79, 0xe8, 0x21, 0x3f, 0xb0, 0x7d, 0x71,
|
||||
0xa7, 0x8a, 0xa9, 0xce, 0x6e, 0x9a, 0xa5, 0x2e, 0x8b, 0xf5, 0x7b, 0x56, 0x89, 0x83, 0x7d, 0x07,
|
||||
0x3e, 0x03, 0x35, 0x3f, 0xf0, 0xa9, 0x8f, 0x46, 0x49, 0x25, 0xb4, 0x1a, 0xaf, 0x40, 0x35, 0x89,
|
||||
0x8a, 0x22, 0xc0, 0x17, 0x80, 0x97, 0x44, 0xb4, 0x59, 0xca, 0x2c, 0x72, 0x66, 0x9d, 0x01, 0xbc,
|
||||
0x8f, 0x12, 0xae, 0x05, 0xaa, 0x12, 0xd7, 0x77, 0xb4, 0x95, 0x65, 0xef, 0xe2, 0xa9, 0x78, 0x56,
|
||||
0xbf, 0x67, 0x6e, 0x32, 0xef, 0xb3, 0x9b, 0xa6, 0x7a, 0x9c, 0x4a, 0xf5, 0x7b, 0x96, 0x9a, 0xe9,
|
||||
0xf6, 0x1d, 0x78, 0x0c, 0xea, 0x92, 0x26, 0x1b, 0x4e, 0x6d, 0x95, 0xab, 0x36, 0x0c, 0x31, 0xb9,
|
||||
0x46, 0x3a, 0xb9, 0xc6, 0x69, 0x3a, 0xb9, 0x66, 0x99, 0xc9, 0x5e, 0xfe, 0x6c, 0x2a, 0x56, 0x35,
|
||||
0xd3, 0x62, 0x28, 0x7c, 0x0b, 0xea, 0x01, 0xbe, 0xa0, 0x76, 0xd6, 0xac, 0x44, 0x5b, 0xbb, 0x57,
|
||||
0x7b, 0xd7, 0x58, 0x5a, 0x3e, 0x29, 0xf0, 0x00, 0x00, 0x49, 0xa3, 0x74, 0x2f, 0x0d, 0x29, 0x83,
|
||||
0x19, 0xe1, 0xd7, 0x92, 0x44, 0xca, 0xf7, 0x33, 0xc2, 0xd2, 0x24, 0x23, 0x5d, 0xa0, 0xcb, 0xdd,
|
||||
0x9c, 0xeb, 0x65, 0x8d, 0x5d, 0xe1, 0x8f, 0xb5, 0x9d, 0x37, 0x76, 0x9e, 0x9d, 0xb4, 0xf8, 0x5f,
|
||||
0xc7, 0x0c, 0xfc, 0xe7, 0x98, 0xbd, 0x03, 0x4f, 0xe7, 0xc6, 0x6c, 0x41, 0x3f, 0xb3, 0xa7, 0x72,
|
||||
0x7b, 0x2d, 0x69, 0xee, 0xe6, 0x85, 0x52, 0x8f, 0x69, 0x23, 0xc6, 0x98, 0x4c, 0x46, 0x94, 0xd8,
|
||||
0x1e, 0x22, 0x9e, 0xb6, 0xde, 0x52, 0xf6, 0xd6, 0x45, 0x23, 0x5a, 0x22, 0x7e, 0x84, 0x88, 0x07,
|
||||
0xb7, 0x40, 0x19, 0x45, 0x91, 0xa0, 0x54, 0x39, 0xa5, 0x84, 0xa2, 0x88, 0x41, 0xe6, 0x87, 0xab,
|
||||
0x99, 0xae, 0x5c, 0xcf, 0x74, 0xe5, 0xd7, 0x4c, 0x57, 0x2e, 0x6f, 0xf5, 0xc2, 0xf5, 0xad, 0x5e,
|
||||
0xf8, 0x7e, 0xab, 0x17, 0x3e, 0xbe, 0x72, 0x7d, 0xea, 0x4d, 0x06, 0xc6, 0x30, 0x1c, 0x77, 0xe4,
|
||||
0x3f, 0x25, 0x5f, 0x8a, 0x8f, 0x6d, 0xf1, 0x4b, 0x1c, 0xac, 0xf1, 0xf8, 0xcb, 0x3f, 0x01, 0x00,
|
||||
0x00, 0xff, 0xff, 0xa5, 0x17, 0xac, 0x23, 0x2d, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *ABCIResponses) Marshal() (dAtA []byte, err error) {
|
||||
@@ -663,6 +672,11 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.InitialHeight != 0 {
|
||||
i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight))
|
||||
i--
|
||||
dAtA[i] = 0x70
|
||||
}
|
||||
if len(m.AppHash) > 0 {
|
||||
i -= len(m.AppHash)
|
||||
copy(dAtA[i:], m.AppHash)
|
||||
@@ -902,6 +916,9 @@ func (m *State) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.InitialHeight != 0 {
|
||||
n += 1 + sovTypes(uint64(m.InitialHeight))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -1827,6 +1844,25 @@ func (m *State) Unmarshal(dAtA []byte) error {
|
||||
m.AppHash = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 14:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType)
|
||||
}
|
||||
m.InitialHeight = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.InitialHeight |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
|
||||
@@ -41,7 +41,8 @@ message State {
|
||||
Version version = 1 [(gogoproto.nullable) = false];
|
||||
|
||||
// immutable
|
||||
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
|
||||
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
|
||||
int64 initial_height = 14;
|
||||
|
||||
// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
|
||||
int64 last_block_height = 3;
|
||||
|
||||
Reference in New Issue
Block a user