diff --git a/ibctesting/utils_test.go b/ibctesting/utils_test.go index 4badfe760..6da3282a6 100644 --- a/ibctesting/utils_test.go +++ b/ibctesting/utils_test.go @@ -203,7 +203,7 @@ func (s *utilSuite) updateRollappState(endHeight uint64) { stateInfo, found := rollappKeeper.GetStateInfo(s.hubCtx(), rollappChainID(), latestStateInfoIndex.Index) startHeight := uint64(1) if found { - startHeight = stateInfo.LastHeight() + 1 + startHeight = stateInfo.StartHeight + stateInfo.NumBlocks } numBlocks := endHeight - startHeight + 1 // populate the block descriptors @@ -238,7 +238,8 @@ func (s *utilSuite) finalizeRollappState(index uint64, endHeight uint64) (sdk.Ev stateInfo, found := rollappKeeper.GetStateInfo(ctx, rollappChainID(), stateInfoIdx.Index) s.Require().True(found) // this is a hack to increase the finalized height by modifying the last state info instead of submitting a new one - stateInfo = stateInfo.WithNumBlocks(endHeight - stateInfo.StartHeight + 1) + stateInfo.NumBlocks = endHeight - stateInfo.StartHeight + 1 + stateInfo.BDs.BD = make([]rollapptypes.BlockDescriptor, stateInfo.NumBlocks) stateInfo.Status = common.Status_FINALIZED // update the status of the stateInfo rollappKeeper.SetStateInfo(ctx, stateInfo) diff --git a/proto/dymensionxyz/dymension/rollapp/state_info.proto b/proto/dymensionxyz/dymension/rollapp/state_info.proto index e6db67ec5..a8ade3d99 100644 --- a/proto/dymensionxyz/dymension/rollapp/state_info.proto +++ b/proto/dymensionxyz/dymension/rollapp/state_info.proto @@ -34,7 +34,8 @@ message StateInfo { string sequencer = 2; // startHeight is the block height of the first block in the batch uint64 startHeight = 3; - reserved 4; // used to be num blocks, deprecating in favour of counting len of BDs + // numBlocks is the number of blocks included in this batch update + uint64 numBlocks = 4; // DAPath is the description of the location on the DA layer string DAPath = 5; diff --git a/x/delayedack/keeper/finalize_test.go b/x/delayedack/keeper/finalize_test.go index 3fd96224c..459effe0f 100644 --- a/x/delayedack/keeper/finalize_test.go +++ b/x/delayedack/keeper/finalize_test.go @@ -71,9 +71,10 @@ func (s *DelayedAckTestSuite) TestFinalizePacket() { Index: 1, }, StartHeight: 1, + NumBlocks: tc.rollappHeight, Status: commontypes.Status_FINALIZED, Sequencer: proposer, - }.WithNumBlocks(tc.rollappHeight) + } // save state info s.App.RollappKeeper.SetStateInfo(s.Ctx, stateInfo) @@ -196,9 +197,10 @@ func (s *DelayedAckTestSuite) TestFinalizeRollappPacketsByReceiver() { Index: 1, }, StartHeight: 1, + NumBlocks: tc.rollappHeight, Status: commontypes.Status_FINALIZED, Sequencer: proposer, - }.WithNumBlocks(tc.rollappHeight) + } // save state info s.App.RollappKeeper.SetStateInfo(s.Ctx, stateInfo) diff --git a/x/delayedack/keeper/invariants_test.go b/x/delayedack/keeper/invariants_test.go index 978f1510e..f153e625e 100644 --- a/x/delayedack/keeper/invariants_test.go +++ b/x/delayedack/keeper/invariants_test.go @@ -236,18 +236,20 @@ func (suite *DelayedAckTestSuite) TestRollappPacketsCasesInvariant() { Index: 1, }, StartHeight: 1, + NumBlocks: 10, Status: commontypes.Status_FINALIZED, Sequencer: proposer, - }.WithNumBlocks(10) + } stateInfo2 := rollapptypes.StateInfo{ StateInfoIndex: rollapptypes.StateInfoIndex{ RollappId: rollapp, Index: 2, }, StartHeight: 11, + NumBlocks: 10, Status: commontypes.Status_PENDING, Sequencer: proposer, - }.WithNumBlocks(10) + } // if nothingFinalized true, all the state infos submitted should be pending if tc.nothingFinalized { diff --git a/x/delayedack/keeper/keeper.go b/x/delayedack/keeper/keeper.go index 8bf7c23a6..2d656b630 100644 --- a/x/delayedack/keeper/keeper.go +++ b/x/delayedack/keeper/keeper.go @@ -63,7 +63,7 @@ func (k Keeper) getRollappFinalizedHeight(ctx sdk.Context, chainID string) (uint } stateInfo := k.rollappKeeper.MustGetStateInfo(ctx, chainID, latestFinalizedStateIndex.Index) - return stateInfo.GetLatestHeight(), nil + return stateInfo.StartHeight + stateInfo.NumBlocks - 1, nil } /* -------------------------------------------------------------------------- */ diff --git a/x/lightclient/ante/ibc_msg_update_client_test.go b/x/lightclient/ante/ibc_msg_update_client_test.go index 9f347040a..227ab6a63 100644 --- a/x/lightclient/ante/ibc_msg_update_client_test.go +++ b/x/lightclient/ante/ibc_msg_update_client_test.go @@ -109,6 +109,7 @@ func TestHandleMsgUpdateClient(t *testing.T) { Index: 3, }, StartHeight: 3, + NumBlocks: 1, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { @@ -177,6 +178,7 @@ func TestHandleMsgUpdateClient(t *testing.T) { Index: 1, }, StartHeight: 1, + NumBlocks: 1, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { @@ -193,6 +195,7 @@ func TestHandleMsgUpdateClient(t *testing.T) { Index: 2, }, StartHeight: 2, + NumBlocks: 1, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { @@ -265,6 +268,7 @@ func TestHandleMsgUpdateClient(t *testing.T) { Index: 1, }, StartHeight: 1, + NumBlocks: 2, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { diff --git a/x/lightclient/keeper/hook_listener_test.go b/x/lightclient/keeper/hook_listener_test.go index b1d8ec95a..722ccb10a 100644 --- a/x/lightclient/keeper/hook_listener_test.go +++ b/x/lightclient/keeper/hook_listener_test.go @@ -44,6 +44,7 @@ func TestAfterUpdateState(t *testing.T) { stateInfo: &rollapptypes.StateInfo{ Sequencer: keepertest.Alice, StartHeight: 1, + NumBlocks: 1, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { @@ -70,6 +71,7 @@ func TestAfterUpdateState(t *testing.T) { stateInfo: &rollapptypes.StateInfo{ Sequencer: keepertest.Alice, StartHeight: 1, + NumBlocks: 3, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { @@ -106,6 +108,7 @@ func TestAfterUpdateState(t *testing.T) { stateInfo: &rollapptypes.StateInfo{ Sequencer: keepertest.Alice, StartHeight: 1, + NumBlocks: 3, BDs: rollapptypes.BlockDescriptors{ BD: []rollapptypes.BlockDescriptor{ { diff --git a/x/lightclient/types/expected_keepers.go b/x/lightclient/types/expected_keepers.go index 05820fefc..7acfd4090 100644 --- a/x/lightclient/types/expected_keepers.go +++ b/x/lightclient/types/expected_keepers.go @@ -21,6 +21,7 @@ type SequencerKeeperExpected interface { type RollappKeeperExpected interface { GetRollapp(ctx sdk.Context, rollappId string) (val rollapptypes.Rollapp, found bool) FindStateInfoByHeight(ctx sdk.Context, rollappId string, height uint64) (*rollapptypes.StateInfo, error) + GetStateInfo(ctx sdk.Context, rollappId string, index uint64) (val rollapptypes.StateInfo, found bool) SetRollapp(ctx sdk.Context, rollapp rollapptypes.Rollapp) HandleFraud(ctx sdk.Context, rollappID, clientId string, fraudHeight uint64, seqAddr string) error } diff --git a/x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go b/x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go index 6f093759e..fa3dc0e27 100644 --- a/x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go +++ b/x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go @@ -37,8 +37,9 @@ func createNStateInfoAndIndex(keeper *keeper.Keeper, ctx sdk.Context, n int, rol Index: uint64(i + 1), }, StartHeight: StartHeight, - }.WithNumBlocks(numBlocks) - StartHeight += stateInfo.NumBlocks() + NumBlocks: numBlocks, + } + StartHeight += stateInfo.NumBlocks keeper.SetStateInfo(ctx, stateInfo) keeper.SetLatestStateInfoIndex(ctx, types.StateInfoIndex{ @@ -112,7 +113,8 @@ func TestStateInfoByHeightMissingStateInfo1(t *testing.T) { k.SetStateInfo(ctx, types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappId, Index: 60}, StartHeight: 71, - }.WithNumBlocks(1)) + NumBlocks: 1, + }) _, err := k.StateInfo(wctx, request) errIndex := 1 + (60-1)/2 // Using binary search, the middle index is lookedup first and is missing. require.EqualError(t, err, errorsmod.Wrapf(types.ErrNotFound, @@ -140,7 +142,8 @@ func TestStateInfoByHeightErr(t *testing.T) { response: &types.QueryGetStateInfoResponse{StateInfo: types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 4}, StartHeight: msgs[3].StartHeight, - }.WithNumBlocks(msgs[3].NumBlocks())}, + NumBlocks: msgs[3].NumBlocks, + }}, }, { desc: "StateInfoByHeight_firstBlockInBatch", @@ -151,18 +154,20 @@ func TestStateInfoByHeightErr(t *testing.T) { response: &types.QueryGetStateInfoResponse{StateInfo: types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 3}, StartHeight: msgs[2].StartHeight, - }.WithNumBlocks(msgs[2].NumBlocks())}, + NumBlocks: msgs[2].NumBlocks, + }}, }, { desc: "StateInfoByHeight_lastBlockInBatch", request: &types.QueryGetStateInfoRequest{ RollappId: rollappID, - Height: msgs[2].LastHeight(), + Height: msgs[2].StartHeight + msgs[2].NumBlocks - 1, }, response: &types.QueryGetStateInfoResponse{StateInfo: types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 3}, StartHeight: msgs[2].StartHeight, - }.WithNumBlocks(msgs[2].NumBlocks())}, + NumBlocks: msgs[2].NumBlocks, + }}, }, { desc: "StateInfoByHeight_unknownRollappId", @@ -204,7 +209,7 @@ func TestStateInfoByHeightValidIncreasingBlockBatches(t *testing.T) { msgs := createNStateInfoAndIndex(k, ctx, numOfMsg, rollappID) for i := 0; i < numOfMsg; i += 1 { - for height := msgs[i].StartHeight; height <= msgs[i].LastHeight(); height += 1 { + for height := msgs[i].StartHeight; height < msgs[i].StartHeight+msgs[i].NumBlocks; height += 1 { request := &types.QueryGetStateInfoRequest{ RollappId: rollappID, Height: height, @@ -227,7 +232,7 @@ func TestStateInfoByHeightValidDecreasingBlockBatches(t *testing.T) { msgs := createNStateInfoAndIndex(k, ctx, numOfMsg, rollappID) for i := 0; i < numOfMsg; i += 1 { - for height := msgs[i].StartHeight; height < msgs[i].LastHeight(); height += 1 { + for height := msgs[i].StartHeight; height < msgs[i].StartHeight+msgs[i].NumBlocks; height += 1 { request := &types.QueryGetStateInfoRequest{ RollappId: rollappID, Height: height, diff --git a/x/rollapp/keeper/grpc_query_state_info_test.go b/x/rollapp/keeper/grpc_query_state_info_test.go index 90e1ea288..2513cd07f 100644 --- a/x/rollapp/keeper/grpc_query_state_info_test.go +++ b/x/rollapp/keeper/grpc_query_state_info_test.go @@ -90,15 +90,18 @@ func TestFindStateInfoByHeight(t *testing.T) { keeper.SetStateInfo(ctx, types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 1}, StartHeight: 1, - }.WithNumBlocks(2)) + NumBlocks: 2, + }) keeper.SetStateInfo(ctx, types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 2}, StartHeight: 3, - }.WithNumBlocks(3)) + NumBlocks: 3, + }) keeper.SetStateInfo(ctx, types.StateInfo{ StateInfoIndex: types.StateInfoIndex{RollappId: rollappID, Index: 3}, StartHeight: 6, - }.WithNumBlocks(4)) + NumBlocks: 4, + }) keeper.SetLatestStateInfoIndex(ctx, types.StateInfoIndex{ RollappId: rollappID, Index: 3, diff --git a/x/rollapp/keeper/msg_server_update_state.go b/x/rollapp/keeper/msg_server_update_state.go index d4af560fa..160f1dbb9 100644 --- a/x/rollapp/keeper/msg_server_update_state.go +++ b/x/rollapp/keeper/msg_server_update_state.go @@ -72,7 +72,7 @@ func (k msgServer) UpdateState(goCtx context.Context, msg *types.MsgUpdateState) } // check to see if received height is the one we expected - expectedStartHeight := stateInfo.LastHeight() + 1 + expectedStartHeight := stateInfo.StartHeight + stateInfo.NumBlocks if expectedStartHeight != msg.StartHeight { return nil, errorsmod.Wrapf(types.ErrWrongBlockHeight, "expected height (%d), but received (%d)", @@ -102,6 +102,7 @@ func (k msgServer) UpdateState(goCtx context.Context, msg *types.MsgUpdateState) newIndex, msg.Creator, msg.StartHeight, + msg.NumBlocks, msg.DAPath, creationHeight, msg.BDs, diff --git a/x/rollapp/keeper/msg_server_update_state_test.go b/x/rollapp/keeper/msg_server_update_state_test.go index d4aacfe0f..7ee78e670 100644 --- a/x/rollapp/keeper/msg_server_update_state_test.go +++ b/x/rollapp/keeper/msg_server_update_state_test.go @@ -73,7 +73,7 @@ func (suite *RollappTestSuite) TestUpdateState() { }, "finalization queue", "i", i) // update state - _, err := suite.PostStateUpdate(suite.Ctx, rollappId, proposer, expectedStateInfo.LastHeight()+1, uint64(2)) + _, err := suite.PostStateUpdate(suite.Ctx, rollappId, proposer, expectedStateInfo.StartHeight+expectedStateInfo.NumBlocks, uint64(2)) suite.Require().Nil(err) // end block @@ -174,10 +174,10 @@ func (suite *RollappTestSuite) TestUpdateStateSequencerRollappMismatch() { suite.SetupTest() rollappId, _ := suite.CreateDefaultRollappAndProposer() - _, seq2 := suite.CreateDefaultRollappAndProposer() + _, seq_2 := suite.CreateDefaultRollappAndProposer() // update state from proposer of rollapp2 - _, err := suite.PostStateUpdate(suite.Ctx, rollappId, seq2, 1, uint64(3)) + _, err := suite.PostStateUpdate(suite.Ctx, rollappId, seq_2, 1, uint64(3)) suite.ErrorIs(err, sequencertypes.ErrNotActiveSequencer) } @@ -237,6 +237,7 @@ func (suite *RollappTestSuite) TestUpdateStateErrWrongBlockHeight() { StateInfoIndex: types.StateInfoIndex{RollappId: rollappId, Index: 1}, Sequencer: proposer, StartHeight: 1, + NumBlocks: 3, Status: common.Status_PENDING, BDs: types.BlockDescriptors{BD: []types.BlockDescriptor{{Height: 1}, {Height: 2}, {Height: 3}}}, } @@ -298,6 +299,7 @@ func (suite *RollappTestSuite) TestUpdateStateDowngradeTimestamp() { StateInfoIndex: types.StateInfoIndex{RollappId: rollappId, Index: 1}, Sequencer: proposer, StartHeight: 1, + NumBlocks: 1, DAPath: "", BDs: types.BlockDescriptors{BD: []types.BlockDescriptor{{Height: 1}}}, } diff --git a/x/rollapp/types/state_info.go b/x/rollapp/types/state_info.go index 1c10492f4..af5651a3f 100644 --- a/x/rollapp/types/state_info.go +++ b/x/rollapp/types/state_info.go @@ -5,6 +5,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + common "github.com/dymensionxyz/dymension/v3/x/common/types" ) @@ -13,6 +14,7 @@ func NewStateInfo( newIndex uint64, creator string, startHeight uint64, + numBlocks uint64, daPath string, height uint64, BDs BlockDescriptors, @@ -25,6 +27,7 @@ func NewStateInfo( StateInfoIndex: stateInfoIndex, Sequencer: creator, StartHeight: startHeight, + NumBlocks: numBlocks, DAPath: daPath, CreationHeight: height, Status: status, @@ -38,18 +41,12 @@ func (s *StateInfo) Finalize() { s.Status = common.Status_FINALIZED } -// WithNumBlocks is intended as utility in tests if a certain number of blocks need to be made, but the content is unimportant -func (s StateInfo) WithNumBlocks(n uint64) StateInfo { - s.BDs = BlockDescriptors{BD: make([]BlockDescriptor, n)} - return s -} - func (s *StateInfo) GetIndex() StateInfoIndex { return s.StateInfoIndex } func (s *StateInfo) GetLatestHeight() uint64 { - return s.StartHeight + s.NumBlocks() - 1 + return s.StartHeight + s.NumBlocks - 1 } func (s *StateInfo) ContainsHeight(height uint64) bool { @@ -64,23 +61,16 @@ func (s *StateInfo) GetBlockDescriptor(height uint64) (BlockDescriptor, bool) { } func (s *StateInfo) GetLatestBlockDescriptor() BlockDescriptor { + // return s.BDs.BD[s.NumBlocks-1] // todo: should it be this? or the one below? using this breaks ibctesting tests return s.BDs.BD[len(s.BDs.BD)-1] } -func (s *StateInfo) LastHeight() uint64 { - return s.StartHeight + s.NumBlocks() - 1 -} - -func (s *StateInfo) NumBlocks() uint64 { - return uint64(len(s.BDs.BD)) -} - func (s *StateInfo) GetEvents() []sdk.Attribute { eventAttributes := []sdk.Attribute{ sdk.NewAttribute(AttributeKeyRollappId, s.StateInfoIndex.RollappId), sdk.NewAttribute(AttributeKeyStateInfoIndex, strconv.FormatUint(s.StateInfoIndex.Index, 10)), sdk.NewAttribute(AttributeKeyStartHeight, strconv.FormatUint(s.StartHeight, 10)), - sdk.NewAttribute(AttributeKeyNumBlocks, strconv.FormatUint(s.NumBlocks(), 10)), + sdk.NewAttribute(AttributeKeyNumBlocks, strconv.FormatUint(s.NumBlocks, 10)), sdk.NewAttribute(AttributeKeyDAPath, s.DAPath), sdk.NewAttribute(AttributeKeyStatus, s.Status.String()), sdk.NewAttribute(AttributeKeyCreatedAt, s.CreatedAt.Format(time.RFC3339)), diff --git a/x/rollapp/types/state_info.pb.go b/x/rollapp/types/state_info.pb.go index 74074806b..36748d303 100644 --- a/x/rollapp/types/state_info.pb.go +++ b/x/rollapp/types/state_info.pb.go @@ -99,6 +99,8 @@ type StateInfo struct { Sequencer string `protobuf:"bytes,2,opt,name=sequencer,proto3" json:"sequencer,omitempty"` // startHeight is the block height of the first block in the batch StartHeight uint64 `protobuf:"varint,3,opt,name=startHeight,proto3" json:"startHeight,omitempty"` + // numBlocks is the number of blocks included in this batch update + NumBlocks uint64 `protobuf:"varint,4,opt,name=numBlocks,proto3" json:"numBlocks,omitempty"` // DAPath is the description of the location on the DA layer DAPath string `protobuf:"bytes,5,opt,name=DAPath,proto3" json:"DAPath,omitempty"` // creationHeight is the height at which the UpdateState took place @@ -168,6 +170,13 @@ func (m *StateInfo) GetStartHeight() uint64 { return 0 } +func (m *StateInfo) GetNumBlocks() uint64 { + if m != nil { + return m.NumBlocks + } + return 0 +} + func (m *StateInfo) GetDAPath() string { if m != nil { return m.DAPath @@ -343,43 +352,43 @@ func init() { } var fileDescriptor_750f3a9f16533ec4 = []byte{ - // 562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcd, 0x6a, 0xdb, 0x40, - 0x18, 0xf4, 0xfa, 0x2f, 0xd6, 0x1a, 0x8c, 0xb3, 0x84, 0x22, 0x4c, 0x2b, 0x1b, 0x41, 0x8b, 0xe9, - 0x41, 0x2a, 0x49, 0x7b, 0x29, 0xf4, 0x10, 0x63, 0x4a, 0x9c, 0x43, 0x69, 0x95, 0x50, 0x4a, 0x29, - 0x98, 0xb5, 0xb5, 0x96, 0x97, 0x4a, 0x5a, 0x75, 0x77, 0x15, 0xec, 0x3c, 0x45, 0x1e, 0xa4, 0x0f, - 0x92, 0x63, 0x6e, 0xed, 0x29, 0x2d, 0xf6, 0x1b, 0xf4, 0xd6, 0x5b, 0xd1, 0x4a, 0xb1, 0x13, 0xc7, - 0x6e, 0x20, 0x90, 0x9b, 0xbe, 0x8f, 0x6f, 0x86, 0xd9, 0x99, 0x41, 0xd0, 0x76, 0xa7, 0x01, 0x09, - 0x05, 0x65, 0xe1, 0x64, 0x7a, 0xba, 0x1c, 0x6c, 0xce, 0x7c, 0x1f, 0x47, 0x91, 0x2d, 0x24, 0x96, - 0xa4, 0x4f, 0xc3, 0x11, 0xb3, 0x22, 0xce, 0x24, 0x43, 0xc6, 0x75, 0x80, 0xb5, 0x18, 0xac, 0x0c, - 0xd0, 0xd8, 0xf1, 0x98, 0xc7, 0xd4, 0xa9, 0x9d, 0x7c, 0xa5, 0xa8, 0x46, 0xd3, 0x63, 0xcc, 0xf3, - 0x89, 0xad, 0xa6, 0x41, 0x3c, 0xb2, 0x25, 0x0d, 0x88, 0x90, 0x38, 0x88, 0xb2, 0x83, 0x57, 0x77, - 0xe8, 0x18, 0xf8, 0x6c, 0xf8, 0xb5, 0xef, 0x12, 0x31, 0xe4, 0x34, 0x92, 0x8c, 0x67, 0xb0, 0xe7, - 0x1b, 0x60, 0x43, 0x16, 0x04, 0x2c, 0x54, 0xea, 0x63, 0x91, 0xde, 0x9a, 0x5d, 0x58, 0x3b, 0x4a, - 0x5e, 0xd3, 0x0b, 0x47, 0xac, 0x17, 0xba, 0x64, 0x82, 0x1e, 0x43, 0x2d, 0xe3, 0xef, 0xb9, 0x3a, - 0x68, 0x81, 0xb6, 0xe6, 0x2c, 0x17, 0x68, 0x07, 0x96, 0x68, 0x72, 0xa6, 0xe7, 0x5b, 0xa0, 0x5d, - 0x74, 0xd2, 0xc1,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 0x3f, 0x21, 0x3c, 0x11, 0xa3, - 0x57, 0x95, 0x4f, 0xd0, 0xe5, 0xe2, 0x63, 0xba, 0x39, 0x2c, 0x56, 0x8a, 0xf5, 0xd2, 0x61, 0xb1, - 0x52, 0xae, 0x6f, 0x99, 0x3f, 0x00, 0xac, 0x2f, 0x82, 0x3b, 0x8a, 0x83, 0x00, 0xf3, 0xe9, 0x03, - 0x57, 0x60, 0x19, 0x41, 0xfe, 0x3e, 0x11, 0xdc, 0x4e, 0xba, 0xb0, 0x2e, 0x69, 0xf3, 0x3b, 0x80, - 0x86, 0x0a, 0x20, 0x9d, 0x8f, 0xd9, 0x5b, 0x1a, 0x62, 0x9f, 0x9e, 0xaa, 0x9b, 0x0f, 0x31, 0x89, - 0xc9, 0x1a, 0x2a, 0xb0, 0xb6, 0x34, 0x03, 0xb8, 0x3d, 0x5a, 0x05, 0xeb, 0xf9, 0x56, 0xe1, 0xde, - 0x96, 0xdc, 0xa6, 0xeb, 0xbc, 0x3b, 0x9f, 0x19, 0xe0, 0x62, 0x66, 0x80, 0xdf, 0x33, 0x03, 0x9c, - 0xcd, 0x8d, 0xdc, 0xc5, 0xdc, 0xc8, 0xfd, 0x9c, 0x1b, 0xb9, 0xcf, 0x2f, 0x3d, 0x2a, 0xc7, 0xf1, - 0x20, 0xb1, 0x63, 0xd3, 0xaf, 0xed, 0x64, 0xcf, 0x9e, 0x2c, 0xfe, 0x2b, 0x72, 0x1a, 0x11, 0x31, - 0x28, 0xab, 0x0e, 0xed, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x71, 0x15, 0xb3, 0x0e, 0x05, - 0x00, 0x00, + // 568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x6a, 0xdb, 0x40, + 0x14, 0xf5, 0xd8, 0x8e, 0x13, 0x8d, 0xc1, 0x24, 0x43, 0x28, 0xc2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75, 0x7c, 0x75, 0x71, 0xdd, 0x47, 0x92, 0xfa, 0xe7, 0xb2, 0xb5, + 0x33, 0x73, 0xa3, 0xf0, 0xa5, 0x59, 0x70, 0xcd, 0xb3, 0x5f, 0x2d, 0xe0, 0x68, 0x19, 0x70, 0x20, + 0x50, 0x0b, 0xd6, 0x3d, 0xc6, 0x07, 0x27, 0x98, 0x49, 0x33, 0x7a, 0x5d, 0xe5, 0x04, 0x3d, 0xc6, + 0x3f, 0xa4, 0xc8, 0x9b, 0xea, 0x56, 0x6d, 0x7b, 0xd3, 0xfc, 0x01, 0xe0, 0x76, 0xbe, 0xd0, 0xa3, + 0x24, 0x8a, 0x5c, 0x36, 0xfb, 0xcf, 0xa7, 0x51, 0x84, 0x5f, 0xbe, 0x4f, 0xf8, 0xb7, 0x77, 0x5c, + 0x59, 0xb5, 0x63, 0xf3, 0x3b, 0x80, 0x86, 0x8a, 0x3e, 0xad, 0x8f, 0xe9, 0xeb, 0x80, 0xb8, 0x61, + 0x70, 0xaa, 0x7a, 0xde, 0x27, 0x38, 0xc1, 0x2b, 0xa4, 0xc0, 0xca, 0x73, 0x19, 0xc2, 0x9d, 0xf1, + 0x32, 0x59, 0x2f, 0xb7, 0x2b, 0xf7, 0x8e, 0xe4, 0xb6, 0x5c, 0xf7, 0xed, 0xf9, 0xdc, 0x00, 0x17, + 0x73, 0x03, 0xfc, 0x9e, 0x1b, 0xe0, 0x6c, 0x61, 0x94, 0x2e, 0x16, 0x46, 0xe9, 0xe7, 0xc2, 0x28, + 0x7d, 0x7a, 0xee, 0x07, 0x62, 0x92, 0x0c, 0x65, 0x1c, 0xeb, 0x9e, 0xbc, 0x93, 0x7d, 0x7b, 0x9a, + 0xbf, 0x37, 0x62, 0x16, 0x63, 0x3e, 0xac, 0xa9, 0xeb, 0xd9, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, + 0x8a, 0x35, 0x1b, 0xf6, 0x26, 0x05, 0x00, 0x00, } func (m *StateInfoIndex) Marshal() (dAtA []byte, err error) { @@ -479,6 +488,11 @@ func (m *StateInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } + if m.NumBlocks != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.NumBlocks)) + i-- + dAtA[i] = 0x20 + } if m.StartHeight != 0 { i = encodeVarintStateInfo(dAtA, i, uint64(m.StartHeight)) i-- @@ -631,6 +645,9 @@ func (m *StateInfo) Size() (n int) { if m.StartHeight != 0 { n += 1 + sovStateInfo(uint64(m.StartHeight)) } + if m.NumBlocks != 0 { + n += 1 + sovStateInfo(uint64(m.NumBlocks)) + } l = len(m.DAPath) if l > 0 { n += 1 + l + sovStateInfo(uint64(l)) @@ -907,6 +924,25 @@ func (m *StateInfo) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) + } + m.NumBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DAPath", wireType)