From e44fc9e71b6a97c60ca72145e99a88eedea5f32d Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Tue, 6 Aug 2024 10:17:59 +0800 Subject: [PATCH] add epoch num to public randomness commit --- proto/babylon/finality/v1/finality.proto | 2 + proto/babylon/finality/v1/query.proto | 2 + x/btcstaking/keeper/keeper.go | 9 + x/btcstaking/types/errors.go | 1 - x/finality/keeper/msg_server.go | 19 ++- x/finality/types/errors.go | 23 +-- x/finality/types/expected_keepers.go | 1 + x/finality/types/finality.pb.go | 108 ++++++++---- x/finality/types/mocked_keepers.go | 14 ++ x/finality/types/query.pb.go | 205 +++++++++++++---------- 10 files changed, 248 insertions(+), 136 deletions(-) diff --git a/proto/babylon/finality/v1/finality.proto b/proto/babylon/finality/v1/finality.proto index f6f56f6d9..1167e774a 100644 --- a/proto/babylon/finality/v1/finality.proto +++ b/proto/babylon/finality/v1/finality.proto @@ -27,6 +27,8 @@ message PubRandCommit { // commitment is the value of the commitment // currently, it is the root of the merkle tree constructed by the public randomness bytes commitment = 3; + // epoch_num defines the epoch number that the commit falls into + uint64 epoch_num = 4; } // Evidence is the evidence that a finality provider has signed finality diff --git a/proto/babylon/finality/v1/query.proto b/proto/babylon/finality/v1/query.proto index 7b6c9fb0b..159995a69 100644 --- a/proto/babylon/finality/v1/query.proto +++ b/proto/babylon/finality/v1/query.proto @@ -102,6 +102,8 @@ message PubRandCommitResponse { uint64 num_pub_rand = 1; // commitment is the value of the commitment bytes commitment = 2; + // epoch_num defines the epoch number that the commit falls into + uint64 epoch_num = 3; } // QueryListPubRandCommitRequest is the request type for the diff --git a/x/btcstaking/keeper/keeper.go b/x/btcstaking/keeper/keeper.go index 5a992423a..e7cba7c30 100644 --- a/x/btcstaking/keeper/keeper.go +++ b/x/btcstaking/keeper/keeper.go @@ -90,3 +90,12 @@ func (k Keeper) BeginBlocker(ctx context.Context) error { func (k Keeper) GetLastFinalizedEpoch(ctx context.Context) uint64 { return k.ckptKeeper.GetLastFinalizedEpoch(ctx) } + +func (k Keeper) GetEpoch(ctx context.Context) uint64 { + epoch := k.ckptKeeper.GetEpoch(ctx) + if epoch == nil { + panic(fmt.Errorf("epoch cannot be nil")) + } + + return epoch.EpochNumber +} diff --git a/x/btcstaking/types/errors.go b/x/btcstaking/types/errors.go index 5de1421d5..ffca7d9ab 100644 --- a/x/btcstaking/types/errors.go +++ b/x/btcstaking/types/errors.go @@ -11,7 +11,6 @@ var ( ErrBTCDelegationNotFound = errorsmod.Register(ModuleName, 1102, "the BTC delegation is not found") ErrFpRegistered = errorsmod.Register(ModuleName, 1103, "the finality provider has already been registered") ErrFpAlreadySlashed = errorsmod.Register(ModuleName, 1104, "the finality provider has already been slashed") - ErrFpNotBTCTimestamped = errorsmod.Register(ModuleName, 1105, "the finality provider is not BTC timestamped yet") ErrBTCStakingNotActivated = errorsmod.Register(ModuleName, 1106, "the BTC staking protocol is not activated yet") ErrBTCHeightNotFound = errorsmod.Register(ModuleName, 1107, "the BTC height is not found") ErrReusedStakingTx = errorsmod.Register(ModuleName, 1108, "the BTC staking tx is already used") diff --git a/x/finality/keeper/msg_server.go b/x/finality/keeper/msg_server.go index 3576f7cd1..f78af1e46 100644 --- a/x/finality/keeper/msg_server.go +++ b/x/finality/keeper/msg_server.go @@ -7,12 +7,13 @@ import ( "time" errorsmod "cosmossdk.io/errors" - bbn "github.com/babylonlabs-io/babylon/types" - bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" - "github.com/babylonlabs-io/babylon/x/finality/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + bbn "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + "github.com/babylonlabs-io/babylon/x/finality/types" ) type msgServer struct { @@ -82,7 +83,7 @@ func (ms msgServer) AddFinalitySig(goCtx context.Context, req *types.MsgAddFinal } fpPK := req.FpBtcPk if ms.BTCStakingKeeper.GetVotingPower(ctx, fpPK.MustMarshal(), req.BlockHeight) == 0 { - return nil, types.ErrInvalidFinalitySig.Wrapf("the finality provider %v does not have voting power at height %d", fpPK.MustMarshal(), req.BlockHeight) + return nil, types.ErrInvalidFinalitySig.Wrapf("the finality provider %s does not have voting power at height %d", fpPK.MarshalHex(), req.BlockHeight) } // ensure the finality provider has not cast the same vote yet @@ -101,6 +102,13 @@ func (ms msgServer) AddFinalitySig(goCtx context.Context, req *types.MsgAddFinal if err != nil { return nil, err } + // ensure the finality provider's last randomness commit is already finalised by BTC timestamping + finalizedEpoch := ms.BTCStakingKeeper.GetLastFinalizedEpoch(ctx) + if finalizedEpoch < prCommit.EpochNum { + return nil, types.ErrPubRandCommitNotBTCTimestamped. + Wrapf("the finality provider %s last committed epoch number: %d, last finalized epoch number: %d", + fp.BtcPk.MarshalHex(), prCommit.EpochNum, finalizedEpoch) + } // verify the finality signature message w.r.t. the public randomness commitment // including the public randomness inclusion proof and the finality signature @@ -132,7 +140,7 @@ func (ms msgServer) AddFinalitySig(goCtx context.Context, req *types.MsgAddFinal // if this finality provider has also signed canonical block, slash it canonicalSig, err := ms.GetSig(ctx, req.BlockHeight, fpPK) if err == nil { - //set canonial sig + // set canonial sig evidence.CanonicalFinalitySig = canonicalSig // slash this finality provider, including setting its voting power to // zero, extracting its BTC SK, and emit an event @@ -206,6 +214,7 @@ func (ms msgServer) CommitPubRandList(goCtx context.Context, req *types.MsgCommi StartHeight: req.StartHeight, NumPubRand: req.NumPubRand, Commitment: req.Commitment, + EpochNum: ms.BTCStakingKeeper.GetEpoch(ctx), } // get last public randomness commitment diff --git a/x/finality/types/errors.go b/x/finality/types/errors.go index ee10b27fb..6e3b89eea 100644 --- a/x/finality/types/errors.go +++ b/x/finality/types/errors.go @@ -6,15 +6,16 @@ import ( // x/finality module sentinel errors var ( - ErrBlockNotFound = errorsmod.Register(ModuleName, 1100, "Block is not found") - ErrVoteNotFound = errorsmod.Register(ModuleName, 1101, "vote is not found") - ErrHeightTooHigh = errorsmod.Register(ModuleName, 1102, "the chain has not reached the given height yet") - ErrPubRandNotFound = errorsmod.Register(ModuleName, 1103, "public randomness is not found") - ErrPubRandCommitNotFound = errorsmod.Register(ModuleName, 1104, "public randomness commitment is not found") - ErrNoPubRandYet = errorsmod.Register(ModuleName, 1105, "the finality provider has not committed any public randomness yet") - ErrTooFewPubRand = errorsmod.Register(ModuleName, 1106, "the request contains too few public randomness") - ErrInvalidPubRand = errorsmod.Register(ModuleName, 1107, "the public randomness list is invalid") - ErrEvidenceNotFound = errorsmod.Register(ModuleName, 1108, "evidence is not found") - ErrInvalidFinalitySig = errorsmod.Register(ModuleName, 1109, "finality signature is not valid") - ErrNoSlashableEvidence = errorsmod.Register(ModuleName, 1110, "there is no slashable evidence") + ErrBlockNotFound = errorsmod.Register(ModuleName, 1100, "Block is not found") + ErrVoteNotFound = errorsmod.Register(ModuleName, 1101, "vote is not found") + ErrHeightTooHigh = errorsmod.Register(ModuleName, 1102, "the chain has not reached the given height yet") + ErrPubRandNotFound = errorsmod.Register(ModuleName, 1103, "public randomness is not found") + ErrPubRandCommitNotFound = errorsmod.Register(ModuleName, 1104, "public randomness commitment is not found") + ErrNoPubRandYet = errorsmod.Register(ModuleName, 1105, "the finality provider has not committed any public randomness yet") + ErrTooFewPubRand = errorsmod.Register(ModuleName, 1106, "the request contains too few public randomness") + ErrInvalidPubRand = errorsmod.Register(ModuleName, 1107, "the public randomness list is invalid") + ErrEvidenceNotFound = errorsmod.Register(ModuleName, 1108, "evidence is not found") + ErrInvalidFinalitySig = errorsmod.Register(ModuleName, 1109, "finality signature is not valid") + ErrNoSlashableEvidence = errorsmod.Register(ModuleName, 1110, "there is no slashable evidence") + ErrPubRandCommitNotBTCTimestamped = errorsmod.Register(ModuleName, 1111, "the public randomness commit is not BTC timestamped yet") ) diff --git a/x/finality/types/expected_keepers.go b/x/finality/types/expected_keepers.go index f4d6e58d9..9aeb47c6f 100644 --- a/x/finality/types/expected_keepers.go +++ b/x/finality/types/expected_keepers.go @@ -17,6 +17,7 @@ type BTCStakingKeeper interface { GetBTCStakingActivatedHeight(ctx context.Context) (uint64, error) GetVotingPowerDistCache(ctx context.Context, height uint64) (*bstypes.VotingPowerDistCache, error) RemoveVotingPowerDistCache(ctx context.Context, height uint64) + GetEpoch(ctx context.Context) uint64 GetLastFinalizedEpoch(ctx context.Context) uint64 RevertSluggishFinalityProvider(ctx context.Context, fpBTCPK []byte) error } diff --git a/x/finality/types/finality.pb.go b/x/finality/types/finality.pb.go index 8d2eb5f4b..0b1804fbf 100644 --- a/x/finality/types/finality.pb.go +++ b/x/finality/types/finality.pb.go @@ -100,6 +100,8 @@ type PubRandCommit struct { // commitment is the value of the commitment // currently, it is the root of the merkle tree constructed by the public randomness Commitment []byte `protobuf:"bytes,3,opt,name=commitment,proto3" json:"commitment,omitempty"` + // epoch_num defines the epoch number that the commit falls into + EpochNum uint64 `protobuf:"varint,4,opt,name=epoch_num,json=epochNum,proto3" json:"epoch_num,omitempty"` } func (m *PubRandCommit) Reset() { *m = PubRandCommit{} } @@ -156,6 +158,13 @@ func (m *PubRandCommit) GetCommitment() []byte { return nil } +func (m *PubRandCommit) GetEpochNum() uint64 { + if m != nil { + return m.EpochNum + } + return 0 +} + // Evidence is the evidence that a finality provider has signed finality // signatures with correct public randomness on two conflicting Babylon headers type Evidence struct { @@ -304,41 +313,43 @@ func init() { } var fileDescriptor_ca5b87e52e3e6d02 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0x6e, 0x68, 0x69, 0x3b, 0x37, 0x13, 0x90, 0x8d, 0xa9, 0x7c, 0x28, 0x2b, 0x39, 0xf5, 0x00, - 0x2d, 0xfb, 0x10, 0x42, 0xdc, 0xc8, 0x34, 0xb4, 0x0a, 0x24, 0xaa, 0x74, 0x5c, 0xb8, 0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ef, 0x0a, 0xe0, 0x09, 0x09, 0x8d, - 0x00, 0x3c, 0x50, 0xaa, 0x36, 0xc8, 0x5a, 0xff, 0x4d, 0x76, 0x2f, 0x03, 0xbd, 0xc1, 0x63, 0xfd, - 0xd0, 0xc0, 0x93, 0xf2, 0x3c, 0x4e, 0x58, 0x16, 0x89, 0x64, 0x42, 0x42, 0x4a, 0x68, 0x38, 0xa2, - 0x01, 0xbb, 0xbd, 0x6c, 0x6c, 0x64, 0x3c, 0xcb, 0x46, 0x7d, 0x33, 0xe3, 0x87, 0xe0, 0x61, 0x4c, - 0x84, 0xc0, 0x3e, 0x54, 0x89, 0x11, 0xd0, 0x63, 0x29, 0x95, 0x38, 0x51, 0x41, 0xa9, 0x3b, 0x3b, - 0x79, 0x53, 0xfd, 0x94, 0xe2, 0x24, 0x6f, 0xd9, 0x1f, 0xbe, 0x2f, 0x4d, 0xed, 0x72, 0x69, 0x6a, - 0xbf, 0x96, 0xa6, 0xf6, 0x6d, 0x65, 0xd6, 0x2e, 0x57, 0x66, 0xed, 0xe7, 0xca, 0xac, 0x7d, 0x3e, - 0xfc, 0xb3, 0xde, 0x8b, 0xf5, 0x8b, 0xa1, 0xa4, 0xbb, 0x4d, 0xf5, 0x02, 0x1c, 0xfd, 0x0e, 0x00, - 0x00, 0xff, 0xff, 0xb1, 0x31, 0x31, 0x81, 0x52, 0x04, 0x00, 0x00, + // 561 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x8d, 0x49, 0xc8, 0xc7, 0xc6, 0x15, 0xe0, 0x96, 0x2a, 0x50, 0xe4, 0x06, 0x9f, 0x72, 0x80, + 0x84, 0x7e, 0x08, 0x21, 0x6e, 0xb8, 0x2a, 0x6a, 0x04, 0x82, 0xc8, 0x29, 0x17, 0x2e, 0xab, 0xf5, + 0x7a, 0x6d, 0xaf, 0x12, 0xef, 0xae, 0xec, 0x75, 0xd4, 0xf0, 0x03, 0x38, 0xc3, 0xbf, 0x42, 0x9c, + 0x7a, 0x44, 0x3d, 0x54, 0x28, 0xf9, 0x23, 0xc8, 0x6b, 0xc7, 0x69, 0x4e, 0x20, 0x10, 0x37, 0xef, + 0x9b, 0xf1, 0xbc, 0x79, 0xb3, 0x6f, 0x16, 0x58, 0x2e, 0x72, 0xe7, 0x53, 0xce, 0x06, 0x3e, 0x65, + 0x68, 0x4a, 0xe5, 0x7c, 0x30, 0x3b, 0x28, 0xbf, 0xfb, 0x22, 0xe6, 0x92, 0x1b, 0xdb, 0x45, 0x4e, + 0xbf, 0xc4, 0x67, 0x07, 0x0f, 0x77, 0x02, 0x1e, 0x70, 0x15, 0x1f, 0x64, 0x5f, 0x79, 0xaa, 0x05, + 0x81, 0x3e, 0x64, 0x1e, 0xb9, 0x20, 0x9e, 0x3d, 0xe5, 0x78, 0x62, 0xec, 0x82, 0x7a, 0x48, 0x68, + 0x10, 0xca, 0x8e, 0xd6, 0xd5, 0x7a, 0x35, 0xa7, 0x38, 0x19, 0x0f, 0x40, 0x13, 0x09, 0x01, 0x43, + 0x94, 0x84, 0x9d, 0x5b, 0x5d, 0xad, 0xa7, 0x3b, 0x0d, 0x24, 0xc4, 0x19, 0x4a, 0x42, 0xe3, 0x11, + 0x68, 0xe5, 0x3c, 0x9f, 0x88, 0xd7, 0xa9, 0x76, 0xb5, 0x5e, 0xd3, 0x59, 0x03, 0xd6, 0x57, 0x0d, + 0x6c, 0x8d, 0x52, 0xd7, 0x41, 0xcc, 0x3b, 0xe1, 0x51, 0x44, 0xa5, 0xf1, 0x18, 0xe8, 0x89, 0x44, + 0xb1, 0x84, 0x1b, 0x44, 0x6d, 0x85, 0x9d, 0xe5, 0x6c, 0x5d, 0xa0, 0xb3, 0x34, 0x82, 0x22, 0x75, + 0x61, 0x8c, 0x98, 0xa7, 0x18, 0x6b, 0x0e, 0x60, 0x69, 0x54, 0x94, 0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0xff, 0xba, 0xed, 0xd3, 0xf7, 0xe7, 0xe3, 0x31, 0x0d, 0x9c, 0x9d, 0xb2, 0xf2, 0xeb, + 0xa2, 0xf0, 0x98, 0x06, 0x86, 0x0f, 0xee, 0xa9, 0xae, 0x36, 0xc8, 0x1a, 0xff, 0x4c, 0x76, 0x27, + 0x2b, 0x7a, 0x83, 0xc7, 0xfa, 0xae, 0x81, 0xbd, 0xd5, 0x79, 0x14, 0xf3, 0xcc, 0x12, 0xf1, 0x98, + 0x06, 0x8c, 0xb2, 0x60, 0xc8, 0x7c, 0xfe, 0xff, 0xbc, 0xb1, 0xb1, 0x00, 0x99, 0x37, 0xaa, 0x9b, + 0x0b, 0x70, 0x08, 0xee, 0x47, 0x34, 0x49, 0x88, 0x07, 0x95, 0x63, 0x12, 0x88, 0x79, 0xca, 0x24, + 0x89, 0x95, 0x51, 0xaa, 0xce, 0x76, 0x1e, 0x54, 0x2b, 0x9b, 0x9c, 0xe4, 0x21, 0xfb, 0xed, 0xb7, + 0x85, 0xa9, 0x5d, 0x2e, 0x4c, 0xed, 0xe7, 0xc2, 0xd4, 0xbe, 0x2c, 0xcd, 0xca, 0xe5, 0xd2, 0xac, + 0xfc, 0x58, 0x9a, 0x95, 0x8f, 0x87, 0xbf, 0xef, 0xf7, 0x62, 0xfd, 0x9e, 0xa8, 0xd6, 0xdd, 0xba, + 0x7a, 0x1f, 0x8e, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xa1, 0x77, 0x79, 0x70, 0x04, 0x00, + 0x00, } func (m *IndexedBlock) Marshal() (dAtA []byte, err error) { @@ -406,6 +417,11 @@ func (m *PubRandCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EpochNum != 0 { + i = encodeVarintFinality(dAtA, i, uint64(m.EpochNum)) + i-- + dAtA[i] = 0x20 + } if len(m.Commitment) > 0 { i -= len(m.Commitment) copy(dAtA[i:], m.Commitment) @@ -607,6 +623,9 @@ func (m *PubRandCommit) Size() (n int) { if l > 0 { n += 1 + l + sovFinality(uint64(l)) } + if m.EpochNum != 0 { + n += 1 + sovFinality(uint64(m.EpochNum)) + } return n } @@ -895,6 +914,25 @@ func (m *PubRandCommit) Unmarshal(dAtA []byte) error { m.Commitment = []byte{} } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNum", wireType) + } + m.EpochNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFinality + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipFinality(dAtA[iNdEx:]) diff --git a/x/finality/types/mocked_keepers.go b/x/finality/types/mocked_keepers.go index c546a68da..63e698f31 100644 --- a/x/finality/types/mocked_keepers.go +++ b/x/finality/types/mocked_keepers.go @@ -51,6 +51,20 @@ func (mr *MockBTCStakingKeeperMockRecorder) GetBTCStakingActivatedHeight(ctx int return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBTCStakingActivatedHeight", reflect.TypeOf((*MockBTCStakingKeeper)(nil).GetBTCStakingActivatedHeight), ctx) } +// GetEpoch mocks base method. +func (m *MockBTCStakingKeeper) GetEpoch(ctx context.Context) uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEpoch", ctx) + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetEpoch indicates an expected call of GetEpoch. +func (mr *MockBTCStakingKeeperMockRecorder) GetEpoch(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEpoch", reflect.TypeOf((*MockBTCStakingKeeper)(nil).GetEpoch), ctx) +} + // GetFinalityProvider mocks base method. func (m *MockBTCStakingKeeper) GetFinalityProvider(ctx context.Context, fpBTCPK []byte) (*types0.FinalityProvider, error) { m.ctrl.T.Helper() diff --git a/x/finality/types/query.pb.go b/x/finality/types/query.pb.go index a0f7f3271..76aa68501 100644 --- a/x/finality/types/query.pb.go +++ b/x/finality/types/query.pb.go @@ -258,6 +258,8 @@ type PubRandCommitResponse struct { NumPubRand uint64 `protobuf:"varint,1,opt,name=num_pub_rand,json=numPubRand,proto3" json:"num_pub_rand,omitempty"` // commitment is the value of the commitment Commitment []byte `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` + // epoch_num defines the epoch number that the commit falls into + EpochNum uint64 `protobuf:"varint,3,opt,name=epoch_num,json=epochNum,proto3" json:"epoch_num,omitempty"` } func (m *PubRandCommitResponse) Reset() { *m = PubRandCommitResponse{} } @@ -307,6 +309,13 @@ func (m *PubRandCommitResponse) GetCommitment() []byte { return nil } +func (m *PubRandCommitResponse) GetEpochNum() uint64 { + if m != nil { + return m.EpochNum + } + return 0 +} + // QueryListPubRandCommitRequest is the request type for the // Query/ListPubRandCommit RPC method. type QueryListPubRandCommitRequest struct { @@ -1147,90 +1156,91 @@ func init() { func init() { proto.RegisterFile("babylon/finality/v1/query.proto", fileDescriptor_32bddab77af6fdae) } var fileDescriptor_32bddab77af6fdae = []byte{ - // 1318 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdf, 0x6f, 0xdb, 0x54, - 0x14, 0xee, 0xcd, 0xd6, 0x6c, 0x3b, 0x4d, 0xb6, 0xee, 0xae, 0x1b, 0x25, 0xa3, 0x69, 0xea, 0x8d, - 0xb6, 0xb4, 0x9b, 0xbd, 0xa6, 0x65, 0x6c, 0x05, 0xb4, 0x35, 0xd0, 0xd2, 0x88, 0x2e, 0x64, 0x2e, - 0x9a, 0xb4, 0x3d, 0x60, 0xec, 0xd4, 0x49, 0xad, 0x26, 0xbe, 0x5e, 0xec, 0x44, 0x0d, 0xd3, 0x24, - 0x84, 0xc4, 0x1e, 0x10, 0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, 0xb9, 0xfe, 0x63, 0x73, 0xfd, - 0x98, 0x72, 0x40, 0xeb, 0x14, 0x50, 0x0a, 0xdf, 0x3e, 0x6a, 0xc7, 0xb9, 0x37, 0x23, 0xfe, 0x1e, - 0x41, 0xd4, 0x77, 0xdf, 0x76, 0x53, 0x33, 0x68, 0x43, 0xe8, 0xa6, 0x66, 0xe0, 0x45, 0x2e, 0x4c, - 0x53, 0xf0, 0x09, 0x1c, 0x0f, 0x04, 0xdf, 0xbc, 0xb3, 0x7f, 0x41, 0x30, 0xe2, 0x99, 0xee, 0xb8, - 0x4b, 0x2f, 0xb5, 0xdf, 0xc6, 0xb1, 0xab, 0x7d, 0x5a, 0x73, 0x50, 0xcb, 0x14, 0xd4, 0x12, 0x4e, - 0x06, 0x82, 0xf2, 0xdd, 0x59, 0xad, 0x62, 0xe2, 0x1f, 0x10, 0x44, 0x7c, 0xd7, 0x50, 0x7f, 0xb9, - 0x1b, 0x0a, 0x8a, 0xfd, 0x9a, 0x73, 0xac, 0x73, 0x14, 0xeb, 0x65, 0x2c, 0xf4, 0xc6, 0x9a, 0xda, - 0x78, 0xb6, 0x1f, 0x47, 0xcf, 0xf7, 0xe3, 0xe8, 0xef, 0xfd, 0x38, 0xfa, 0xf6, 0x20, 0x3e, 0xf4, - 0xfc, 0x20, 0x3e, 0xf4, 0xe7, 0x41, 0x7c, 0xe8, 0x41, 0xb2, 0xf7, 0x12, 0xbb, 0xdb, 0x0c, 0x4c, - 0xf7, 0x59, 0x2d, 0x4c, 0xff, 0x67, 0xb3, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x6c, - 0x72, 0x7b, 0x91, 0x12, 0x00, 0x00, + // 1338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdf, 0x6f, 0xd3, 0xd6, + 0x17, 0xef, 0x6d, 0x69, 0xa1, 0xa7, 0x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xf7, 0xf8, 0xc4, 0xbf, 0x8f, + 0xbf, 0x42, 0x00, 0x9d, 0x85, 0x8f, 0x4f, 0x0d, 0xa6, 0x28, 0x72, 0xba, 0xa4, 0x4e, 0x8f, 0xa6, + 0x3c, 0x52, 0x33, 0x8b, 0x6b, 0xe1, 0x21, 0x82, 0x64, 0x64, 0x57, 0x63, 0xb9, 0x7f, 0x90, 0xb8, + 0x4b, 0x20, 0xa5, 0x8c, 0xac, 0x2f, 0x70, 0x9d, 0x62, 0xb8, 0x5e, 0xc5, 0xc7, 0x62, 0x71, 0x35, + 0x5a, 0x36, 0x1d, 0xba, 0x7e, 0x41, 0xb0, 0x27, 0x58, 0x41, 0xf8, 0xb5, 0xfe, 0xa1, 0xba, 0xd6, + 0x7f, 0x6a, 0x65, 0x14, 0x55, 0x01, 0xe8, 0x3a, 0x03, 0x94, 0xc3, 0x57, 0x76, 0xda, 0x71, 0xc1, + 0x66, 0xc4, 0xdf, 0x21, 0x48, 0x46, 0xf6, 0xed, 0x20, 0x36, 0xe3, 0x2e, 0x84, 0x41, 0x6c, 0xc6, + 0x2e, 0x72, 0x69, 0x99, 0x81, 0xcf, 0xe0, 0x74, 0x2c, 0xf8, 0xce, 0xce, 0xfe, 0x19, 0xc1, 0x5c, + 0x68, 0xba, 0xe3, 0x01, 0xbd, 0xd4, 0xbb, 0x8d, 0x53, 0x67, 0x46, 0xd4, 0x16, 0xa0, 0x2e, 0x31, + 0x50, 0xe7, 0x70, 0x36, 0x16, 0x54, 0x64, 0x67, 0x75, 0x93, 0x89, 0xbf, 0x47, 0x90, 0x88, 0xac, + 0xa1, 0xd1, 0x62, 0xb7, 0x19, 0x94, 0x47, 0x55, 0x17, 0x58, 0x57, 0x18, 0xd6, 0xe3, 0x58, 0x1a, + 0x8e, 0x35, 0xb7, 0xf1, 0xe8, 0x79, 0x1a, 0x3d, 0x7e, 0x9e, 0x46, 0x7f, 0x3d, 0x4f, 0xa3, 0x6f, + 0x5e, 0xa4, 0x27, 0x1e, 0xbf, 0x48, 0x4f, 0xfc, 0xf1, 0x22, 0x3d, 0x71, 0x27, 0x3b, 0xfc, 0x88, + 0xdd, 0xee, 0x38, 0x66, 0xf7, 0xac, 0x31, 0xc3, 0xfe, 0xa1, 0xb3, 0xf6, 0x4f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xb3, 0x40, 0x11, 0x10, 0xae, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1842,6 +1852,11 @@ func (m *PubRandCommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.EpochNum != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EpochNum)) + i-- + dAtA[i] = 0x18 + } if len(m.Commitment) > 0 { i -= len(m.Commitment) copy(dAtA[i:], m.Commitment) @@ -2563,6 +2578,9 @@ func (m *PubRandCommitResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.EpochNum != 0 { + n += 1 + sovQuery(uint64(m.EpochNum)) + } return n } @@ -3354,6 +3372,25 @@ func (m *PubRandCommitResponse) Unmarshal(dAtA []byte) error { m.Commitment = []byte{} } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNum", wireType) + } + m.EpochNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:])