From 5bf148dd7944afe626c464ffee0049a1fed8edca Mon Sep 17 00:00:00 2001 From: hacheigriega Date: Mon, 2 Dec 2024 14:51:44 -0500 Subject: [PATCH] feat(x/pubkey): add proving scheme activation lag --- app/app.go | 1 + proto/sedachain/pubkey/v1/genesis.proto | 9 +- proto/sedachain/pubkey/v1/pubkey.proto | 14 ++ proto/sedachain/pubkey/v1/query.proto | 12 +- scripts/go-lint-all.bash | 4 +- scripts/local_multi_setup.sh | 6 +- x/batching/types/expected_keepers.go | 1 + x/pubkey/keeper/endblock.go | 63 ++++-- x/pubkey/keeper/genesis.go | 2 +- x/pubkey/keeper/grpc_query.go | 1 + x/pubkey/keeper/keeper.go | 46 ++-- x/pubkey/types/genesis.go | 10 +- x/pubkey/types/genesis.pb.go | 246 +++------------------ x/pubkey/types/pubkey.pb.go | 272 ++++++++++++++++++++++-- x/pubkey/types/query.pb.go | 59 ++--- 15 files changed, 420 insertions(+), 326 deletions(-) diff --git a/app/app.go b/app/app.go index 48425602..178ce6d2 100644 --- a/app/app.go +++ b/app/app.go @@ -648,6 +648,7 @@ func NewApp( ) app.PubKeyKeeper = *pubkeykeeper.NewKeeper( + appCodec, runtime.NewKVStoreService(keys[pubkeytypes.StoreKey]), app.StakingKeeper, authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), diff --git a/proto/sedachain/pubkey/v1/genesis.proto b/proto/sedachain/pubkey/v1/genesis.proto index 5c4d93d1..cc6c6a19 100644 --- a/proto/sedachain/pubkey/v1/genesis.proto +++ b/proto/sedachain/pubkey/v1/genesis.proto @@ -11,8 +11,7 @@ option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; message GenesisState { repeated ValidatorPubKeys validator_pub_keys = 1 [ (gogoproto.nullable) = false ]; - repeated ProvingScheme proving_schemes = 2 - [ (gogoproto.nullable) = false ]; + repeated ProvingScheme proving_schemes = 2 [ (gogoproto.nullable) = false ]; } // ValidatorPubKeys defines a validator's list of registered public keys @@ -22,9 +21,3 @@ message ValidatorPubKeys { [ (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" ]; repeated IndexedPubKey indexed_pub_keys = 2 [ (gogoproto.nullable) = false ]; } - -// ProvingScheme defines the status of a proving scheme. -message ProvingScheme { - uint32 index = 1; - bool is_enabled = 2; -} diff --git a/proto/sedachain/pubkey/v1/pubkey.proto b/proto/sedachain/pubkey/v1/pubkey.proto index e25e3fa9..ac858b0b 100644 --- a/proto/sedachain/pubkey/v1/pubkey.proto +++ b/proto/sedachain/pubkey/v1/pubkey.proto @@ -11,3 +11,17 @@ message IndexedPubKey { bytes pub_key = 2 [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; } + +// ProvingScheme defines a proving scheme. +message ProvingScheme { + // index is the SEDA key index. + uint32 index = 1; + // is_activated indicates if the proving scheme has been activated. + bool is_activated = 2; + // activation_height is the height at which the proving scheme is to + // be activated. This field is set to -1 by default until the public + // key registration rate reaches the activation threshold and is reset + // if the public key registration rate goes below the threshold before + // the scheme is activated. + int64 activation_height = 3; +} diff --git a/proto/sedachain/pubkey/v1/query.proto b/proto/sedachain/pubkey/v1/query.proto index 90fd571e..4416bcda 100644 --- a/proto/sedachain/pubkey/v1/query.proto +++ b/proto/sedachain/pubkey/v1/query.proto @@ -5,6 +5,7 @@ import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "sedachain/pubkey/v1/genesis.proto"; +import "sedachain/pubkey/v1/pubkey.proto"; option go_package = "github.com/sedaprotocol/seda-chain/x/pubkey/types"; @@ -19,10 +20,9 @@ service Query { // ProvingSchemes returns the statuses of the SEDA proving schemes. rpc ProvingSchemes(QueryProvingSchemesRequest) - returns (QueryProvingSchemesResponse) { - option (google.api.http).get = - "/seda-chain/pubkey/proving_schemes"; -} + returns (QueryProvingSchemesResponse) { + option (google.api.http).get = "/seda-chain/pubkey/proving_schemes"; + } } // QueryValidatorKeysRequest is request type for the Query/ValidatorKeys @@ -38,11 +38,11 @@ message QueryValidatorKeysResponse { ValidatorPubKeys validator_pub_keys = 1 [ (gogoproto.nullable) = false ]; } -// QueryProvingSchemesRequest is request type for the Query/ProvingSchemes +// QueryProvingSchemesRequest is request type for the Query/ProvingSchemes // RPC method. message QueryProvingSchemesRequest {} -// QueryProvingSchemesResponse is response type for the Query/ProvingSchemes +// QueryProvingSchemesResponse is response type for the Query/ProvingSchemes // RPC method. message QueryProvingSchemesResponse { repeated ProvingScheme proving_schemes = 1 [ (gogoproto.nullable) = false ]; diff --git a/scripts/go-lint-all.bash b/scripts/go-lint-all.bash index 1397cdd9..e48f1e50 100755 --- a/scripts/go-lint-all.bash +++ b/scripts/go-lint-all.bash @@ -10,7 +10,7 @@ lint_module() { shift cd "$(dirname "$root")" && echo "linting $(grep "^module" go.mod) [$(date -Iseconds -u)]" && - golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" --tests=false --exclude-dirs="e2e" "$@" } export -f lint_module @@ -31,7 +31,7 @@ else for f in $(dirname $(echo "$GIT_DIFF" | tr -d "'") | uniq); do echo "linting $f [$(date -Iseconds -u)]" && cd $f && - golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" "$@" && + golangci-lint run ./... -c "${REPO_ROOT}/.golangci.yml" --tests=false --exclude-dirs="e2e" "$@" && cd $REPO_ROOT done fi diff --git a/scripts/local_multi_setup.sh b/scripts/local_multi_setup.sh index 306d8004..72daded9 100755 --- a/scripts/local_multi_setup.sh +++ b/scripts/local_multi_setup.sh @@ -199,9 +199,9 @@ echo "4 validators are up and running!" # generate and upload SEDA keys $BIN tx pubkey add-seda-keys --from validator1 --keyring-backend test --home $HOME/.sedad/validator1 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes -$BIN tx pubkey add-seda-keys --from validator2 --keyring-backend test --home $HOME/.sedad/validator2 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes -$BIN tx pubkey add-seda-keys --from validator3 --keyring-backend test --home $HOME/.sedad/validator3 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes -$BIN tx pubkey add-seda-keys --from validator4 --keyring-backend test --home $HOME/.sedad/validator4 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes +# $BIN tx pubkey add-seda-keys --from validator2 --keyring-backend test --home $HOME/.sedad/validator2 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes +# $BIN tx pubkey add-seda-keys --from validator3 --keyring-backend test --home $HOME/.sedad/validator3 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes +# $BIN tx pubkey add-seda-keys --from validator4 --keyring-backend test --home $HOME/.sedad/validator4 --gas-prices 10000000000aseda --gas auto --gas-adjustment 2.0 --keyring-backend test --chain-id=testing --node http://localhost:26657 --yes # restart to use SEDA keys sleep 10 diff --git a/x/batching/types/expected_keepers.go b/x/batching/types/expected_keepers.go index 0b8f462e..cba8c2ff 100644 --- a/x/batching/types/expected_keepers.go +++ b/x/batching/types/expected_keepers.go @@ -6,6 +6,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/pubkey/keeper/endblock.go b/x/pubkey/keeper/endblock.go index fddb746d..8069938e 100644 --- a/x/pubkey/keeper/endblock.go +++ b/x/pubkey/keeper/endblock.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/sedaprotocol/seda-chain/app/utils" + "github.com/sedaprotocol/seda-chain/x/pubkey/types" ) func (k Keeper) EndBlock(ctx sdk.Context) (err error) { @@ -25,52 +26,74 @@ func (k Keeper) EndBlock(ctx sdk.Context) (err error) { err = nil }() - // If secp256k1 proving scheme is already enabled, do nothing. - isEnabled, err := k.IsProvingSchemeEnabled(ctx, utils.SEDAKeyIndexSecp256k1) + scheme, err := k.GetProvingScheme(ctx, utils.SEDAKeyIndexSecp256k1) if err != nil { return err } - if isEnabled { + if scheme.ActivationHeight != types.DefaultActivationHeight && ctx.BlockHeight() >= scheme.ActivationHeight { + scheme.IsActivated = true + scheme.ActivationHeight = types.DefaultActivationHeight + err = k.SetProvingScheme(ctx, scheme) + if err != nil { + return err + } + + // TODO: Jail validators (active and inactive) without required + // public keys. + } + if scheme.IsActivated { return } + activationInProgress := scheme.ActivationHeight != types.DefaultActivationHeight + met, err := k.CheckKeyRegistrationRate(ctx, utils.SEDAKeyIndexSecp256k1) + if err != nil { + return err + } + if (activationInProgress && !met) || (!activationInProgress && met) { + err = k.StartProvingSchemeActivation(ctx, utils.SEDAKeyIndexSecp256k1) + if err != nil { + return err + } + } + return +} + +// CheckKeyRegistrationRate checks if the current registration rate of +// public keys of the given key scheme surpasses the threshold. +func (k Keeper) CheckKeyRegistrationRate(ctx sdk.Context, index utils.SEDAKeyIndex) (bool, error) { // If the sum of the voting power has reached 80%, enable secp256k1 // proving scheme. totalPower, err := k.stakingKeeper.GetLastTotalPower(ctx) if err != nil { - return err + return false, err } var powerSum uint64 err = k.stakingKeeper.IterateLastValidatorPowers(ctx, func(valAddr sdk.ValAddress, power int64) (stop bool) { - _, err := k.GetValidatorKeyAtIndex(ctx, valAddr, utils.SEDAKeyIndexSecp256k1) + _, err := k.GetValidatorKeyAtIndex(ctx, valAddr, index) if err != nil { if errors.Is(err, collections.ErrNotFound) { return false - } else { - panic(err) } - } else { - //nolint:gosec // G115: We shouldn't get negative power anyway. - powerSum += uint64(power) + panic(err) } + //nolint:gosec // G115: We shouldn't get negative power anyway. + powerSum += uint64(power) return false }) if err != nil { - return err + return false, err } - gotPower := powerSum * 100 //nolint:gosec // G115: We shouldn't get negative power anyway. requiredPower := uint64(totalPower.Int64()*100*4/5 + 1) + gotPower := powerSum * 100 + + k.Logger(ctx).Info("checked status of secp256k1 proving scheme", "required", requiredPower, "got", gotPower) + if gotPower >= requiredPower { - err = k.EnableProvingScheme(ctx, utils.SEDAKeyIndexSecp256k1) - if err != nil { - return err - } - // TODO: Jail validators (active and inactive) without required - // public keys. + return true, nil } - k.Logger(ctx).Info("checked status of secp256k1 proving scheme", "required", requiredPower, "got", gotPower) - return + return false, nil } diff --git a/x/pubkey/keeper/genesis.go b/x/pubkey/keeper/genesis.go index aeec9478..3b503190 100644 --- a/x/pubkey/keeper/genesis.go +++ b/x/pubkey/keeper/genesis.go @@ -22,7 +22,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } } for _, scheme := range data.ProvingSchemes { - err := k.SetProvingScheme(ctx, utils.SEDAKeyIndex(scheme.Index), scheme.IsEnabled) + err := k.SetProvingScheme(ctx, scheme) if err != nil { panic(err) } diff --git a/x/pubkey/keeper/grpc_query.go b/x/pubkey/keeper/grpc_query.go index 439419e8..426aeaa1 100644 --- a/x/pubkey/keeper/grpc_query.go +++ b/x/pubkey/keeper/grpc_query.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/sedaprotocol/seda-chain/x/pubkey/types" ) diff --git a/x/pubkey/keeper/keeper.go b/x/pubkey/keeper/keeper.go index a194aa03..1c61775f 100644 --- a/x/pubkey/keeper/keeper.go +++ b/x/pubkey/keeper/keeper.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -17,26 +18,31 @@ import ( "github.com/sedaprotocol/seda-chain/x/pubkey/types" ) +// ActivationLag is the number of blocks to wait before activating +// a proving scheme once the threshold of public key registration rate +// is reached. +const ActivationLag = 25 + type Keeper struct { stakingKeeper types.StakingKeeper validatorAddressCodec address.Codec Schema collections.Schema pubKeys collections.Map[collections.Pair[[]byte, uint32], []byte] - provingSchemes collections.Map[uint32, bool] + provingSchemes collections.Map[uint32, types.ProvingScheme] } -func NewKeeper(storeService storetypes.KVStoreService, sk types.StakingKeeper, validatorAddressCodec address.Codec) *Keeper { - if validatorAddressCodec == nil { +func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, sk types.StakingKeeper, valAddrCdc address.Codec) *Keeper { + if valAddrCdc == nil { panic("validator address codec is nil") } sb := collections.NewSchemaBuilder(storeService) k := Keeper{ stakingKeeper: sk, - validatorAddressCodec: validatorAddressCodec, + validatorAddressCodec: valAddrCdc, pubKeys: collections.NewMap(sb, types.PubKeysPrefix, "pubkeys", collections.PairKeyCodec(collections.BytesKey, collections.Uint32Key), collections.BytesValue), - provingSchemes: collections.NewMap(sb, types.ProvingSchemesPrefix, "proving_schemes", collections.Uint32Key, collections.BoolValue), + provingSchemes: collections.NewMap(sb, types.ProvingSchemesPrefix, "proving_schemes", collections.Uint32Key, codec.CollValue[types.ProvingScheme](cdc)), } schema, err := sb.Build() @@ -132,28 +138,35 @@ func (k Keeper) GetAllValidatorPubKeys(ctx context.Context) ([]types.ValidatorPu return valPubKeys, err } -func (k Keeper) SetProvingScheme(ctx context.Context, index utils.SEDAKeyIndex, isEnabled bool) error { - err := k.provingSchemes.Set(ctx, uint32(index), isEnabled) +func (k Keeper) SetProvingScheme(ctx context.Context, scheme types.ProvingScheme) error { + err := k.provingSchemes.Set(ctx, scheme.Index, scheme) if err != nil { return err } return nil } -func (k Keeper) EnableProvingScheme(ctx context.Context, index utils.SEDAKeyIndex) error { - err := k.provingSchemes.Set(ctx, uint32(index), true) +func (k Keeper) GetProvingScheme(ctx context.Context, index utils.SEDAKeyIndex) (types.ProvingScheme, error) { + return k.provingSchemes.Get(ctx, uint32(index)) +} + +// StartProvingSchemeActivation starts the activation of the given +// proving scheme. +func (k Keeper) StartProvingSchemeActivation(ctx sdk.Context, index utils.SEDAKeyIndex) error { + scheme, err := k.provingSchemes.Get(ctx, uint32(index)) if err != nil { return err } - return nil + scheme.ActivationHeight = ctx.BlockHeight() + ActivationLag + return k.SetProvingScheme(ctx, scheme) } -func (k Keeper) IsProvingSchemeEnabled(ctx context.Context, index utils.SEDAKeyIndex) (bool, error) { - isEnabled, err := k.provingSchemes.Get(ctx, uint32(index)) +func (k Keeper) IsProvingSchemeActivated(ctx context.Context, index utils.SEDAKeyIndex) (bool, error) { + scheme, err := k.provingSchemes.Get(ctx, uint32(index)) if err != nil { return false, err } - return isEnabled, nil + return scheme.IsActivated, nil } func (k Keeper) GetAllProvingSchemes(ctx sdk.Context) ([]types.ProvingScheme, error) { @@ -170,14 +183,11 @@ func (k Keeper) GetAllProvingSchemes(ctx sdk.Context) ([]types.ProvingScheme, er return nil, err } - isEnabled, err := k.provingSchemes.Get(ctx, kv.Key) + scheme, err := k.provingSchemes.Get(ctx, kv.Key) if err != nil { return nil, err } - schemes = append(schemes, types.ProvingScheme{ - Index: kv.Key, - IsEnabled: isEnabled, - }) + schemes = append(schemes, scheme) } return schemes, nil } diff --git a/x/pubkey/types/genesis.go b/x/pubkey/types/genesis.go index 287bbe3e..e6002550 100644 --- a/x/pubkey/types/genesis.go +++ b/x/pubkey/types/genesis.go @@ -4,12 +4,18 @@ import ( fmt "fmt" ) +const ( + // DefaultActivationHeight indicates that activation is not in progress. + DefaultActivationHeight = -1 +) + func DefaultGenesisState() *GenesisState { return &GenesisState{ ProvingSchemes: []ProvingScheme{ { - Index: 0, // TODO resolve import cycle for uint32(utils.SEDAKeyIndexSecp256k1), - IsEnabled: false, + Index: 0, // TODO resolve import cycle for uint32(utils.SEDAKeyIndexSecp256k1), + IsActivated: false, + ActivationHeight: DefaultActivationHeight, }, }, } diff --git a/x/pubkey/types/genesis.pb.go b/x/pubkey/types/genesis.pb.go index 14204f6f..c746e5f9 100644 --- a/x/pubkey/types/genesis.pb.go +++ b/x/pubkey/types/genesis.pb.go @@ -131,94 +131,38 @@ func (m *ValidatorPubKeys) GetIndexedPubKeys() []IndexedPubKey { return nil } -// ProvingScheme defines the status of a proving scheme. -type ProvingScheme struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - IsEnabled bool `protobuf:"varint,2,opt,name=is_enabled,json=isEnabled,proto3" json:"is_enabled,omitempty"` -} - -func (m *ProvingScheme) Reset() { *m = ProvingScheme{} } -func (m *ProvingScheme) String() string { return proto.CompactTextString(m) } -func (*ProvingScheme) ProtoMessage() {} -func (*ProvingScheme) Descriptor() ([]byte, []int) { - return fileDescriptor_a68b70401eeae88a, []int{2} -} -func (m *ProvingScheme) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProvingScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProvingScheme.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProvingScheme) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProvingScheme.Merge(m, src) -} -func (m *ProvingScheme) XXX_Size() int { - return m.Size() -} -func (m *ProvingScheme) XXX_DiscardUnknown() { - xxx_messageInfo_ProvingScheme.DiscardUnknown(m) -} - -var xxx_messageInfo_ProvingScheme proto.InternalMessageInfo - -func (m *ProvingScheme) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *ProvingScheme) GetIsEnabled() bool { - if m != nil { - return m.IsEnabled - } - return false -} - func init() { proto.RegisterType((*GenesisState)(nil), "sedachain.pubkey.v1.GenesisState") proto.RegisterType((*ValidatorPubKeys)(nil), "sedachain.pubkey.v1.ValidatorPubKeys") - proto.RegisterType((*ProvingScheme)(nil), "sedachain.pubkey.v1.ProvingScheme") } func init() { proto.RegisterFile("sedachain/pubkey/v1/genesis.proto", fileDescriptor_a68b70401eeae88a) } var fileDescriptor_a68b70401eeae88a = []byte{ - // 397 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0xae, 0xd2, 0x40, - 0x14, 0xc6, 0x3b, 0xf8, 0x27, 0x32, 0x0a, 0x92, 0x91, 0x45, 0x25, 0xa1, 0x96, 0x26, 0x26, 0x6c, - 0x68, 0x83, 0x3e, 0x81, 0x44, 0xa3, 0x86, 0x0d, 0x96, 0xc4, 0x44, 0x37, 0x4d, 0xdb, 0x99, 0x94, - 0x09, 0xd0, 0x69, 0x7a, 0xda, 0x86, 0xbe, 0x85, 0x8f, 0xe2, 0xc2, 0xa5, 0x0f, 0xc0, 0x92, 0xb8, - 0x72, 0x75, 0x73, 0x03, 0x2f, 0x72, 0xc3, 0x4c, 0xf9, 0x73, 0x09, 0xb9, 0xbb, 0x9e, 0xef, 0xfc, - 0xfa, 0x9d, 0x6f, 0x66, 0x0e, 0xee, 0x01, 0xa3, 0x7e, 0x38, 0xf3, 0x79, 0xec, 0x24, 0x79, 0x30, - 0x67, 0xa5, 0x53, 0x0c, 0x9d, 0x88, 0xc5, 0x0c, 0x38, 0xd8, 0x49, 0x2a, 0x32, 0x41, 0x5e, 0x1d, - 0x11, 0x5b, 0x21, 0x76, 0x31, 0xec, 0xb4, 0x23, 0x11, 0x09, 0xd9, 0x77, 0xf6, 0x5f, 0x0a, 0xed, - 0xbc, 0x0e, 0x05, 0x2c, 0x05, 0x78, 0xaa, 0xa1, 0x8a, 0xaa, 0x65, 0x5e, 0x1b, 0x54, 0xf9, 0x49, - 0xc2, 0xfa, 0x8b, 0xf0, 0x8b, 0xcf, 0x6a, 0xf2, 0x34, 0xf3, 0x33, 0x46, 0x7e, 0x60, 0x52, 0xf8, - 0x0b, 0x4e, 0xfd, 0x4c, 0xa4, 0x5e, 0x92, 0x07, 0xde, 0x9c, 0x95, 0xa0, 0x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x46, 0x3c, 0x9b, 0xe5, 0x81, 0x1d, 0x8a, 0xa5, 0xb3, 0xcf, 0x28, 0xdf, 0x39, 0x14, 0x0b, - 0x59, 0x0c, 0xd4, 0x32, 0xac, 0x0e, 0xeb, 0x90, 0x95, 0x09, 0x83, 0xe0, 0xa9, 0x64, 0xde, 0xdf, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x36, 0x7b, 0x80, 0x95, 0x98, 0x02, 0x00, 0x00, + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xcf, 0x4e, 0xf2, 0x40, + 0x14, 0xc5, 0x3b, 0xdf, 0x67, 0x4c, 0xac, 0x8a, 0xa4, 0xba, 0x40, 0x12, 0x2b, 0x90, 0x98, 0xb0, + 0xa1, 0x0d, 0xfa, 0x04, 0xb2, 0x51, 0xc3, 0x06, 0x21, 0x31, 0xd1, 0x4d, 0xd3, 0x76, 0x6e, 0xca, + 0x04, 0xe8, 0x34, 0xbd, 0xd3, 0x86, 0xbe, 0x85, 0x8f, 0xe2, 0xc2, 0xa5, 0x0f, 0xc0, 0x92, 0xb8, + 0x72, 0x65, 0x0c, 0xbc, 0x88, 0x61, 0xa6, 0xfc, 0x09, 0x21, 0xee, 0x7a, 0xcf, 0xfd, 0xf5, 0xdc, + 0x33, 0xf7, 0xea, 0x55, 0x04, 0xea, 0xfa, 0x7d, 0x97, 0x85, 0x76, 0x94, 0x78, 0x03, 0xc8, 0xec, + 0xb4, 0x69, 0x07, 0x10, 0x02, 0x32, 0xb4, 0xa2, 0x98, 0x0b, 0x6e, 0x9c, 0xae, 0x10, 0x4b, 0x21, + 0x56, 0xda, 0x2c, 0x9f, 0x05, 0x3c, 0xe0, 0xb2, 0x6f, 0x2f, 0xbe, 0x14, 0x5a, 0x3e, 0xf7, 0x39, + 0x8e, 0x38, 0x3a, 0xaa, 0xa1, 0x8a, 0xbc, 0x55, 0x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13, 0xcf, 0xf2, + 0xf9, 0xc8, 0x5e, 0xb8, 0xcb, 0x0b, 0xf9, 0x7c, 0x28, 0x8b, 0x86, 0x3a, 0xe3, 0x78, 0x79, 0x48, + 0x91, 0x45, 0x80, 0xde, 0xbe, 0x64, 0x6e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xa2, 0x4b, + 0x64, 0x52, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -316,44 +260,6 @@ func (m *ValidatorPubKeys) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ProvingScheme) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProvingScheme) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProvingScheme) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsEnabled { - i-- - if m.IsEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Index != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -405,21 +311,6 @@ func (m *ValidatorPubKeys) Size() (n int) { return n } -func (m *ProvingScheme) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovGenesis(uint64(m.Index)) - } - if m.IsEnabled { - n += 2 - } - return n -} - func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -660,95 +551,6 @@ func (m *ValidatorPubKeys) Unmarshal(dAtA []byte) error { } return nil } -func (m *ProvingScheme) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProvingScheme: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProvingScheme: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsEnabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/pubkey/types/pubkey.pb.go b/x/pubkey/types/pubkey.pb.go index 312a4726..bd4a8bf5 100644 --- a/x/pubkey/types/pubkey.pb.go +++ b/x/pubkey/types/pubkey.pb.go @@ -76,28 +76,101 @@ func (m *IndexedPubKey) GetPubKey() []byte { return nil } +// ProvingScheme defines a proving scheme. +type ProvingScheme struct { + // index is the SEDA key index. + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + // is_activated indicates if the proving scheme has been activated. + IsActivated bool `protobuf:"varint,2,opt,name=is_activated,json=isActivated,proto3" json:"is_activated,omitempty"` + // activation_height is the height at which the proving scheme is to + // be activated. This field is set to -1 by default until the public + // key registration rate reaches the activation threshold and is reset + // if the public key registration rate goes below the threshold before + // the scheme is activated. + ActivationHeight int64 `protobuf:"varint,3,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height,omitempty"` +} + +func (m *ProvingScheme) Reset() { *m = ProvingScheme{} } +func (m *ProvingScheme) String() string { return proto.CompactTextString(m) } +func (*ProvingScheme) ProtoMessage() {} +func (*ProvingScheme) Descriptor() ([]byte, []int) { + return fileDescriptor_a51ebcd05a6c14e0, []int{1} +} +func (m *ProvingScheme) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProvingScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProvingScheme.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProvingScheme) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProvingScheme.Merge(m, src) +} +func (m *ProvingScheme) XXX_Size() int { + return m.Size() +} +func (m *ProvingScheme) XXX_DiscardUnknown() { + xxx_messageInfo_ProvingScheme.DiscardUnknown(m) +} + +var xxx_messageInfo_ProvingScheme proto.InternalMessageInfo + +func (m *ProvingScheme) GetIndex() uint32 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *ProvingScheme) GetIsActivated() bool { + if m != nil { + return m.IsActivated + } + return false +} + +func (m *ProvingScheme) GetActivationHeight() int64 { + if m != nil { + return m.ActivationHeight + } + return 0 +} + func init() { proto.RegisterType((*IndexedPubKey)(nil), "sedachain.pubkey.v1.IndexedPubKey") + proto.RegisterType((*ProvingScheme)(nil), "sedachain.pubkey.v1.ProvingScheme") } func init() { proto.RegisterFile("sedachain/pubkey/v1/pubkey.proto", fileDescriptor_a51ebcd05a6c14e0) } var fileDescriptor_a51ebcd05a6c14e0 = []byte{ - // 215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x4e, 0x4d, 0x49, - 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2f, 0x28, 0x4d, 0xca, 0x4e, 0xad, 0xd4, 0x2f, 0x33, 0x84, - 0xb2, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0xe1, 0x2a, 0xf4, 0xa0, 0xe2, 0x65, 0x86, - 0x52, 0x92, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xf1, 0x60, 0x25, 0xfa, 0x10, 0x0e, 0x44, 0xbd, - 0x52, 0x04, 0x17, 0xaf, 0x67, 0x5e, 0x4a, 0x6a, 0x45, 0x6a, 0x4a, 0x40, 0x69, 0x92, 0x77, 0x6a, - 0xa5, 0x90, 0x08, 0x17, 0x6b, 0x26, 0x48, 0x40, 0x82, 0x51, 0x81, 0x51, 0x83, 0x37, 0x08, 0xc2, - 0x11, 0x32, 0xe4, 0x62, 0x2f, 0x28, 0x4d, 0x8a, 0xcf, 0x4e, 0xad, 0x94, 0x60, 0x52, 0x60, 0xd4, - 0xe0, 0x71, 0x92, 0x38, 0xb5, 0x45, 0x57, 0x04, 0x6a, 0x52, 0x72, 0x51, 0x65, 0x41, 0x49, 0xbe, - 0x1e, 0xc4, 0x80, 0x20, 0xb6, 0x02, 0x30, 0xed, 0xe4, 0x7d, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, - 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, - 0xc7, 0x72, 0x0c, 0x51, 0x86, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, - 0x20, 0xe7, 0x82, 0x5d, 0x92, 0x9c, 0x9f, 0x03, 0xe6, 0xe8, 0x42, 0xbc, 0x57, 0x01, 0xf3, 0x60, - 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0x8d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf2, - 0x9a, 0x73, 0x37, 0x01, 0x01, 0x00, 0x00, + // 288 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0x83, 0x40, + 0x1c, 0xc6, 0x7b, 0x36, 0x56, 0x73, 0x96, 0x44, 0xb1, 0x03, 0x3a, 0x5c, 0xb0, 0x13, 0x89, 0x29, + 0x84, 0xf8, 0x04, 0x76, 0xd2, 0x74, 0x69, 0x70, 0x31, 0x2e, 0x04, 0x8e, 0x7f, 0xe0, 0x52, 0xe1, + 0x2e, 0xdc, 0x41, 0xca, 0x5b, 0xf8, 0x30, 0x3e, 0x84, 0x71, 0xea, 0xe8, 0x68, 0xe0, 0x45, 0x4c, + 0x0f, 0xaa, 0x93, 0xd3, 0xdd, 0xf7, 0xfd, 0xbf, 0xfc, 0x86, 0x1f, 0xb6, 0x25, 0x24, 0x11, 0xcd, + 0x22, 0x56, 0x78, 0xa2, 0x8a, 0x37, 0xd0, 0x78, 0xb5, 0x3f, 0xfc, 0x5c, 0x51, 0x72, 0xc5, 0xcd, + 0xcb, 0xdf, 0x85, 0x3b, 0xf4, 0xb5, 0x7f, 0x7d, 0x45,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} func (m *IndexedPubKey) Marshal() (dAtA []byte, err error) { @@ -135,6 +208,49 @@ func (m *IndexedPubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ProvingScheme) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProvingScheme) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProvingScheme) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ActivationHeight != 0 { + i = encodeVarintPubkey(dAtA, i, uint64(m.ActivationHeight)) + i-- + dAtA[i] = 0x18 + } + if m.IsActivated { + i-- + if m.IsActivated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Index != 0 { + i = encodeVarintPubkey(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintPubkey(dAtA []byte, offset int, v uint64) int { offset -= sovPubkey(v) base := offset @@ -162,6 +278,24 @@ func (m *IndexedPubKey) Size() (n int) { return n } +func (m *ProvingScheme) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovPubkey(uint64(m.Index)) + } + if m.IsActivated { + n += 2 + } + if m.ActivationHeight != 0 { + n += 1 + sovPubkey(uint64(m.ActivationHeight)) + } + return n +} + func sovPubkey(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -271,6 +405,114 @@ func (m *IndexedPubKey) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProvingScheme) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPubkey + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProvingScheme: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProvingScheme: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPubkey + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsActivated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPubkey + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsActivated = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivationHeight", wireType) + } + m.ActivationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPubkey + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActivationHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPubkey(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPubkey + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipPubkey(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/pubkey/types/query.pb.go b/x/pubkey/types/query.pb.go index 1addf290..4152a56b 100644 --- a/x/pubkey/types/query.pb.go +++ b/x/pubkey/types/query.pb.go @@ -216,36 +216,37 @@ func init() { func init() { proto.RegisterFile("sedachain/pubkey/v1/query.proto", fileDescriptor_ab5fa3182b3fb474) } var fileDescriptor_ab5fa3182b3fb474 = []byte{ - // 460 bytes of a gzipped FileDescriptorProto + // 467 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcb, 0x6e, 0xd4, 0x30, - 0x14, 0x9d, 0x94, 0x87, 0x84, 0xab, 0x0e, 0xc8, 0xb0, 0x68, 0x43, 0x49, 0xdb, 0x08, 0xa4, 0x0a, - 0xa9, 0x31, 0x33, 0xb0, 0x62, 0xc7, 0xac, 0x90, 0xba, 0x69, 0xa7, 0x12, 0x12, 0x6c, 0xa2, 0x3c, - 0xae, 0x3c, 0x56, 0x67, 0x6c, 0x37, 0x76, 0x02, 0x11, 0x62, 0xc3, 0x17, 0x20, 0xf1, 0x01, 0xfc, - 0x00, 0x4b, 0x3e, 0xa2, 0xcb, 0x0a, 0x36, 0x5d, 0x21, 0x34, 0xc3, 0x87, 0xa0, 0x24, 0x9e, 0x69, - 0x53, 0x99, 0x6a, 0x76, 0xf6, 0xbd, 0xe7, 0x9e, 0x73, 0x7c, 0xae, 0xd1, 0x96, 0x82, 0x34, 0x4a, - 0x46, 0x11, 0xe3, 0x44, 0xe6, 0xf1, 0x31, 0x94, 0xa4, 0xe8, 0x91, 0x93, 0x1c, 0xb2, 0x32, 0x90, - 0x99, 0xd0, 0x02, 0xdf, 0x5f, 0x00, 0x82, 0x06, 0x10, 0x14, 0x3d, 0x77, 0x93, 0x0a, 0x41, 0xc7, - 0x40, 0x22, 0xc9, 0x48, 0xc4, 0xb9, 0xd0, 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, 0x88, 0x0d, 0x5f, 0x80, 0xc4, 0x07, 0xf0, + 0x03, 0x2c, 0xf9, 0x88, 0x2e, 0x2b, 0xd8, 0x74, 0x85, 0xd0, 0x0c, 0x1f, 0x82, 0xe2, 0x38, 0xd3, + 0xa6, 0x32, 0x55, 0x77, 0xf6, 0xbd, 0xe7, 0x9e, 0x73, 0x7c, 0xae, 0xd1, 0x96, 0x84, 0x24, 0x8c, + 0x27, 0x21, 0x65, 0x44, 0xe4, 0xd1, 0x11, 0x94, 0xa4, 0xe8, 0x93, 0xe3, 0x1c, 0xb2, 0x32, 0x10, + 0x19, 0x57, 0x1c, 0xdf, 0x5f, 0x02, 0x82, 0x1a, 0x10, 0x14, 0x7d, 0x77, 0x33, 0xe5, 0x3c, 0x9d, + 0x02, 0x09, 0x05, 0x25, 0x21, 0x63, 0x5c, 0x85, 0x8a, 0x72, 0x26, 0xeb, 0x11, 0xf7, 0x41, 0xca, + 0x53, 0xae, 0x8f, 0xa4, 0x3a, 0x99, 0xea, 0x46, 0xcc, 0xe5, 0x8c, 0xcb, 0x71, 0xdd, 0xa8, 0x2f, + 0xa6, 0xb5, 0x6d, 0x33, 0x91, 0x02, 0x03, 0x49, 0x1b, 0x48, 0xcf, 0x06, 0x31, 0x86, 0x34, 0xc2, + 0x07, 0xb4, 0x71, 0x50, 0xf9, 0x7e, 0x13, 0x4e, 0x69, 0x12, 0x2a, 0x9e, 0xed, 0x41, 0x29, 0x47, + 0x70, 0x9c, 0x83, 0x54, 0xf8, 0x35, 0xea, 0x16, 0x4d, 0x7d, 0x1c, 0x26, 0x49, 0xb6, 0xee, 0xf4, + 0x9c, 0x9d, 0x3b, 0xc3, 0xed, 0x9f, 0x3f, 0x76, 0x1f, 0x19, 0x2f, 0xcb, 0xc1, 0x57, 0x49, 0x92, + 0x81, 0x94, 0x87, 0x2a, 0xa3, 0x2c, 0x1d, 0xad, 0x15, 0x17, 0xeb, 0xfe, 0x7b, 0xe4, 0xda, 0x64, + 0xa4, 0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, 0xe1, 0x75, 0xce, 0x16, 0x5e, 0xe7, 0x5d, 0x3f, 0xa5, 0x6a, 0x92, 0x47, 0x41, + 0xcc, 0x67, 0x9a, 0x47, 0x7f, 0xfd, 0x98, 0x4f, 0x2f, 0x92, 0x7e, 0x68, 0x68, 0x55, 0x29, 0x40, + 0x46, 0xb7, 0x35, 0xe6, 0xf9, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xb2, 0x16, 0x8b, 0xea, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.