From dbddf7d452e9e74e98546cbffddc58a6848c26ff Mon Sep 17 00:00:00 2001 From: KeefeL <90749943+KeefeL@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:52:01 +0800 Subject: [PATCH 01/12] chore: add potential impacts for PR template (#503) Co-authored-by: Keefe Liu --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index acf0007d8..03273c93e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,3 +15,7 @@ add an example CLI or API response... Notable changes: * add each change in a bullet point here * ... + +### Potential Impacts +* add potential impacts for other components here +* ... From 148c9c486d004cb1a8728e71978454e0c2331879 Mon Sep 17 00:00:00 2001 From: Roshan <48975233+Pythonberg1997@users.noreply.github.com> Date: Tue, 17 Oct 2023 20:33:38 +0800 Subject: [PATCH 02/12] fix: add `GlobalVirtualGroupFamilyId` to `createBucketPackage` (#506) --- x/storage/keeper/cross_app_bucket.go | 5 +++-- x/storage/types/crosschain.go | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/x/storage/keeper/cross_app_bucket.go b/x/storage/keeper/cross_app_bucket.go index 87d813ea6..6fd06f9ac 100644 --- a/x/storage/keeper/cross_app_bucket.go +++ b/x/storage/keeper/cross_app_bucket.go @@ -235,8 +235,9 @@ func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk. ChargedReadQuota: createBucketPackage.ChargedReadQuota, PaymentAddress: createBucketPackage.PaymentAddress.String(), PrimarySpApproval: &common.Approval{ - ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight, - Sig: createBucketPackage.PrimarySpApprovalSignature, + ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: createBucketPackage.GlobalVirtualGroupFamilyId, + Sig: createBucketPackage.PrimarySpApprovalSignature, }, ApprovalMsgBytes: createBucketPackage.GetApprovalBytes(), }, diff --git a/x/storage/types/crosschain.go b/x/storage/types/crosschain.go index 563ac6fda..852051887 100644 --- a/x/storage/types/crosschain.go +++ b/x/storage/types/crosschain.go @@ -347,6 +347,7 @@ type CreateBucketSynPackage struct { PaymentAddress sdk.AccAddress PrimarySpAddress sdk.AccAddress PrimarySpApprovalExpiredHeight uint64 + GlobalVirtualGroupFamilyId uint32 PrimarySpApprovalSignature []byte ChargedReadQuota uint64 ExtraData []byte @@ -359,6 +360,7 @@ type CreateBucketSynPackageStruct struct { PaymentAddress common.Address PrimarySpAddress common.Address PrimarySpApprovalExpiredHeight uint64 + GlobalVirtualGroupFamilyId uint32 PrimarySpApprovalSignature []byte ChargedReadQuota uint64 ExtraData []byte @@ -372,6 +374,7 @@ var ( {Name: "PaymentAddress", Type: "address"}, {Name: "PrimarySpAddress", Type: "address"}, {Name: "PrimarySpApprovalExpiredHeight", Type: "uint64"}, + {Name: "GlobalVirtualGroupFamilyId", Type: "uint32"}, {Name: "PrimarySpApprovalSignature", Type: "bytes"}, {Name: "ChargedReadQuota", Type: "uint64"}, {Name: "ExtraData", Type: "bytes"}, @@ -390,6 +393,7 @@ func (p CreateBucketSynPackage) MustSerialize() []byte { PaymentAddress: common.BytesToAddress(p.PaymentAddress), PrimarySpAddress: common.BytesToAddress(p.PrimarySpAddress), PrimarySpApprovalExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, PrimarySpApprovalSignature: p.PrimarySpApprovalSignature, ChargedReadQuota: p.ChargedReadQuota, ExtraData: p.ExtraData, @@ -408,8 +412,9 @@ func (p CreateBucketSynPackage) ValidateBasic() error { PaymentAddress: p.PaymentAddress.String(), PrimarySpAddress: p.PrimarySpAddress.String(), PrimarySpApproval: &gnfdcommon.Approval{ - ExpiredHeight: p.PrimarySpApprovalExpiredHeight, - Sig: p.PrimarySpApprovalSignature, + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, + Sig: p.PrimarySpApprovalSignature, }, ChargedReadQuota: p.ChargedReadQuota, } @@ -425,8 +430,9 @@ func (p CreateBucketSynPackage) GetApprovalBytes() []byte { PaymentAddress: p.PaymentAddress.String(), PrimarySpAddress: p.PrimarySpAddress.String(), PrimarySpApproval: &gnfdcommon.Approval{ - ExpiredHeight: p.PrimarySpApprovalExpiredHeight, - Sig: p.PrimarySpApprovalSignature, + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, + Sig: p.PrimarySpApprovalSignature, }, ChargedReadQuota: p.ChargedReadQuota, } @@ -452,6 +458,7 @@ func DeserializeCreateBucketSynPackage(serializedPackage []byte) (interface{}, e pkgStruct.PaymentAddress.Bytes(), pkgStruct.PrimarySpAddress.Bytes(), pkgStruct.PrimarySpApprovalExpiredHeight, + pkgStruct.GlobalVirtualGroupFamilyId, pkgStruct.PrimarySpApprovalSignature, pkgStruct.ChargedReadQuota, pkgStruct.ExtraData, From acc5aa3970c15593389809149146d82e85225b59 Mon Sep 17 00:00:00 2001 From: yutianwu Date: Wed, 18 Oct 2023 11:32:14 +0800 Subject: [PATCH 03/12] feat: add a hardfork for the link to opBNB (#504) * feat: add hardfork for link to opBNB * fix localup script * fix go.mod * open the cross chain channels for opbnb * fix comment * fix imports --- app/config.go | 5 +++++ app/upgrade.go | 27 +++++++++++++++++++++++++++ deployment/localup/.env | 1 + deployment/localup/localup.sh | 2 ++ go.mod | 3 ++- go.sum | 6 +++--- x/storage/keeper/msg_server.go | 6 +++--- 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/app/config.go b/app/config.go index 95f0949c4..017a094d8 100644 --- a/app/config.go +++ b/app/config.go @@ -14,6 +14,8 @@ type CrossChainConfig struct { SrcChainId uint32 `mapstructure:"src-chain-id"` DestBscChainId uint32 `mapstructure:"dest-bsc-chain-id"` + + DestOpChainId uint32 `mapstructure:"dest-op-chain-id"` } var CustomAppTemplate = serverconfig.DefaultConfigTemplate + ` @@ -25,6 +27,8 @@ var CustomAppTemplate = serverconfig.DefaultConfigTemplate + ` src-chain-id = {{ .CrossChain.SrcChainId }} # chain-id for bsc destination chain dest-bsc-chain-id = {{ .CrossChain.DestBscChainId }} +# chain-id for op bnb destination chain +dest-op-chain-id = {{ .CrossChain.DestOpChainId }} ` func NewDefaultAppConfig() *AppConfig { @@ -48,6 +52,7 @@ func NewDefaultAppConfig() *AppConfig { CrossChain: CrossChainConfig{ SrcChainId: 1, DestBscChainId: 2, + DestOpChainId: 3, }, } } diff --git a/app/upgrade.go b/app/upgrade.go index bc26d3f41..13ac1fa05 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -6,8 +6,10 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + bridgemoduletypes "github.com/bnb-chain/greenfield/x/bridge/types" paymentmodule "github.com/bnb-chain/greenfield/x/payment" paymenttypes "github.com/bnb-chain/greenfield/x/payment/types" + storagemoduletypes "github.com/bnb-chain/greenfield/x/storage/types" ) func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig.Config) error { @@ -19,6 +21,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig. // Register the upgrade handlers here app.registerNagquUpgradeHandler() + app.registerPampasUpgradeHandler() // app.register...() // ... return nil @@ -61,6 +64,30 @@ func (app *App) registerNagquUpgradeHandler() { } mm.SetConsensusVersion(2) return nil + }) +} + +func (app *App) registerPampasUpgradeHandler() { + // Register the upgrade handler + app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Pampas, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("upgrade to ", plan.Name) + + // open resource channels for opbnb + app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), bridgemoduletypes.SyncParamsChannelID, sdk.ChannelAllow) + app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.BucketChannelId, sdk.ChannelAllow) + app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.ObjectChannelId, sdk.ChannelAllow) + app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.GroupChannelId, sdk.ChannelAllow) + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + // Register the upgrade initializer + app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Pampas, + func() error { + app.Logger().Info("Init Pampas upgrade") + // enable chain id for opbnb + app.CrossChainKeeper.SetDestOpChainID(sdk.ChainID(app.appConfig.CrossChain.DestOpChainId)) + return nil }) } diff --git a/deployment/localup/.env b/deployment/localup/.env index 10b4837cb..7258221d6 100644 --- a/deployment/localup/.env +++ b/deployment/localup/.env @@ -18,6 +18,7 @@ SP_MIN_DEPOSIT_AMOUNT=10000000000000000000000000 ## CROSS CHAIN SRC_CHAIN_ID=18 DEST_CHAIN_ID=714 +DEST_OP_CHAIN_ID=2320 ## Proposal PROPOSAL_ID_START=1 diff --git a/deployment/localup/localup.sh b/deployment/localup/localup.sh index cd765bb61..1acf7890b 100644 --- a/deployment/localup/localup.sh +++ b/deployment/localup/localup.sh @@ -153,6 +153,7 @@ function generate_genesis() { sed -i -e "s/snapshot-interval = 0/snapshot-interval = ${SNAPSHOT_INTERVAL}/g" ${workspace}/.local/validator${i}/config/app.toml sed -i -e "s/src-chain-id = 1/src-chain-id = ${SRC_CHAIN_ID}/g" ${workspace}/.local/validator${i}/config/app.toml sed -i -e "s/dest-bsc-chain-id = 2/dest-bsc-chain-id = ${DEST_CHAIN_ID}/g" ${workspace}/.local/validator${i}/config/app.toml + sed -i -e "s/dest-op-chain-id = 3/dest-op-chain-id = ${DEST_OP_CHAIN_ID}/g" ${workspace}/.local/validator${i}/config/app.toml sed -i -e "s/snapshot-keep-recent = 2/snapshot-keep-recent = ${SNAPSHOT_KEEP_RECENT}/g" ${workspace}/.local/validator${i}/config/app.toml sed -i -e "s/\"reserve_time\": \"15552000\"/\"reserve_time\": \"60\"/g" ${workspace}/.local/validator${i}/config/genesis.json sed -i -e "s/\"forced_settle_time\": \"86400\"/\"forced_settle_time\": \"30\"/g" ${workspace}/.local/validator${i}/config/genesis.json @@ -171,6 +172,7 @@ function generate_genesis() { #sed -i -e "s/\"community_tax\": \"0.020000000000000000\"/\"community_tax\": \"0\"/g" ${workspace}/.local/validator${i}/config/genesis.json sed -i -e "s/log_level = \"info\"/\log_level= \"debug\"/g" ${workspace}/.local/validator${i}/config/config.toml echo -e '[[upgrade]]\nname = "Nagqu"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml + echo -e '[[upgrade]]\nname = "Pampas"\nheight = 20\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml done # enable swagger API for validator0 diff --git a/go.mod b/go.mod index 9528ccc47..300c95d52 100644 --- a/go.mod +++ b/go.mod @@ -178,7 +178,8 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.0.1 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 ) diff --git a/go.sum b/go.sum index 85901e7ce..1d11bc5b9 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v1.0.1 h1:8RZRfFyY9JdRLApcz+KADXO1Qd2sps6wXT74UAmaMmM= -github.com/bnb-chain/greenfield-cosmos-sdk v1.0.1/go.mod h1:y3hDhQhil5hMIhwBTpu07RZBF30ZITkoE+GHhVZChtY= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1 h1:Wef+0FD76aE9l3DjE4tGqeRKvEw98z1YkjJ5rHPL6G4= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= @@ -1414,7 +1414,7 @@ github.com/wealdtech/go-eth2-util v1.6.3 h1:2INPeOR35x5LdFFpSzyw954WzTD+DFyHe3yK github.com/wealdtech/go-eth2-util v1.6.3/go.mod h1:0hFMj/qtio288oZFHmAbCnPQ9OB3c4WFzs5NVPKTY4k= github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3/go.mod h1:qiIimacW5NhVRy8o+YxWo9YrecXqDAKKbL0+sOa0SJ4= github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2/go.mod h1:k6kmiKWSWBTd4OxFifTEkPaBLhZspnO2KFD5XJY9nqg= -github.com/wercker/journalhook v0.0.0-20180428041537-5d0a5ae867b3/go.mod h1:XCsSkdKK4gwBMNrOCZWww0pX6AOt+2gYc5Z6jBRrNVg= +github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117/go.mod h1:XCsSkdKK4gwBMNrOCZWww0pX6AOt+2gYc5Z6jBRrNVg= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= diff --git a/x/storage/keeper/msg_server.go b/x/storage/keeper/msg_server.go index 84b444088..8f9977935 100644 --- a/x/storage/keeper/msg_server.go +++ b/x/storage/keeper/msg_server.go @@ -465,7 +465,7 @@ func (k msgServer) MirrorObject(goCtx context.Context, msg *types.MsgMirrorObjec relayerFee := k.Keeper.MirrorObjectRelayerFee(ctx, destChainId) ackRelayerFee := k.Keeper.MirrorObjectAckRelayerFee(ctx, destChainId) - _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, k.crossChainKeeper.GetDestBscChainID(), + _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, destChainId, types.ObjectChannelId, sdk.SynCrossChainPackageType, encodedWrapPackage, relayerFee, ackRelayerFee) if err != nil { return nil, err @@ -540,7 +540,7 @@ func (k msgServer) MirrorBucket(goCtx context.Context, msg *types.MsgMirrorBucke relayerFee := k.Keeper.MirrorBucketRelayerFee(ctx, destChainId) ackRelayerFee := k.Keeper.MirrorBucketAckRelayerFee(ctx, destChainId) - _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, k.crossChainKeeper.GetDestBscChainID(), + _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, destChainId, types.BucketChannelId, sdk.SynCrossChainPackageType, encodedWrapPackage, relayerFee, ackRelayerFee) if err != nil { return nil, err @@ -610,7 +610,7 @@ func (k msgServer) MirrorGroup(goCtx context.Context, msg *types.MsgMirrorGroup) relayerFee := k.Keeper.MirrorGroupRelayerFee(ctx, destChainId) ackRelayerFee := k.Keeper.MirrorGroupAckRelayerFee(ctx, destChainId) - _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, k.crossChainKeeper.GetDestBscChainID(), + _, err = k.crossChainKeeper.CreateRawIBCPackageWithFee(ctx, destChainId, types.GroupChannelId, sdk.SynCrossChainPackageType, encodedWrapPackage, relayerFee, ackRelayerFee) if err != nil { return nil, err From a1d5ac05ecefb9bfa13e5e0387f2d80d8f76dba1 Mon Sep 17 00:00:00 2001 From: Alexxxxxx <118710506+alexgao001@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:34:36 +0800 Subject: [PATCH 04/12] chore: add cmd (#497) * add cmd * fix default endpoint of sp issue in cmd --- sdk/client/gnfd_tm.go | 4 + x/sp/client/cli/query.go | 2 - x/storage/client/cli/query.go | 101 +++++++++++++++++- x/storage/client/cli/tx.go | 60 ++++++++--- .../client/cli/tx_cancel_migrate_bucket.go | 13 ++- 5 files changed, 155 insertions(+), 25 deletions(-) diff --git a/sdk/client/gnfd_tm.go b/sdk/client/gnfd_tm.go index c8a82bab7..fb3fb5d22 100644 --- a/sdk/client/gnfd_tm.go +++ b/sdk/client/gnfd_tm.go @@ -8,6 +8,10 @@ import ( "github.com/cometbft/cometbft/votepool" ) +func (c *GreenfieldClient) ABCIInfo(ctx context.Context) (*ctypes.ResultABCIInfo, error) { + return c.tendermintClient.ABCIInfo(ctx) +} + // GetBlock by height, gets the latest block if height is nil func (c *GreenfieldClient) GetBlock(ctx context.Context, height *int64) (*ctypes.ResultBlock, error) { return c.tendermintClient.Block(ctx, height) diff --git a/x/sp/client/cli/query.go b/x/sp/client/cli/query.go index c51b6b507..b8dcdc820 100644 --- a/x/sp/client/cli/query.go +++ b/x/sp/client/cli/query.go @@ -171,9 +171,7 @@ func CmdMaintenanceRecordsBySPOperatorAddress() *cobra.Command { return clientCtx.PrintProto(res) }, } - flags.AddQueryFlagsToCmd(cmd) - return cmd } diff --git a/x/storage/client/cli/query.go b/x/storage/client/cli/query.go index 1da91bc8e..65d784838 100644 --- a/x/storage/client/cli/query.go +++ b/x/storage/client/cli/query.go @@ -3,6 +3,11 @@ package cli import ( "context" "fmt" + "strings" + + gnfd "github.com/bnb-chain/greenfield/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -31,7 +36,10 @@ func GetQueryCmd() *cobra.Command { CmdVerifyPermission(), CmdHeadGroup(), CmdListGroups(), - CmdHeadGroupMember()) + CmdHeadGroupMember(), + CmdQueryAccountPolicy(), + CmdQueryGroupPolicy(), + ) // this line is used by starport scaffolding # 1 @@ -318,3 +326,94 @@ func CmdHeadGroupMember() *cobra.Command { return cmd } + +func CmdQueryAccountPolicy() *cobra.Command { + cmd := &cobra.Command{ + Use: "account-policy [grn] [principle-address]", + Short: "Query the policy for a account that enforced on the resource", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the polciy that a account has on the resource. + +Examples: + $ %s query %s account-policy grn:o::bucketName/objectName 0x.... + `, version.AppName, types.ModuleName), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + grnStr := args[0] + var grn gnfd.GRN + err = grn.ParseFromString(grnStr, false) + if err != nil { + return err + } + principalAcc, err := sdk.AccAddressFromHexUnsafe(args[1]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + params := &types.QueryPolicyForAccountRequest{ + Resource: grn.String(), + PrincipalAddress: principalAcc.String(), + } + res, err := queryClient.QueryPolicyForAccount(cmd.Context(), params) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdQueryGroupPolicy() *cobra.Command { + cmd := &cobra.Command{ + Use: "group-policy [grn] [principle-group-id]", + Short: "Query the policy for a group that enforced on the resource", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the policy for a group that enforced on the resource + +Examples: + $ %s query %s group-policy grn:o::bucketName/objectName 1 + `, version.AppName, types.ModuleName), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + grnStr := args[0] + var grn gnfd.GRN + err = grn.ParseFromString(grnStr, false) + if err != nil { + return err + } + groupID, ok := sdk.NewIntFromString(args[1]) + if !ok { + return fmt.Errorf("failed to convert group id") + } + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + params := &types.QueryPolicyForGroupRequest{ + Resource: grn.String(), + PrincipalGroupId: groupID.String(), + } + res, err := queryClient.QueryPolicyForGroup(cmd.Context(), params) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/storage/client/cli/tx.go b/x/storage/client/cli/tx.go index 8ecb8ea24..469a8d91f 100644 --- a/x/storage/client/cli/tx.go +++ b/x/storage/client/cli/tx.go @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/bnb-chain/greenfield/types/common" + cmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -37,6 +39,8 @@ func GetTxCmd() *cobra.Command { CmdUpdateBucketInfo(), CmdMirrorBucket(), CmdDiscontinueBucket(), + CmdMigrateBucket(), + CmdCancelMigrateBucket(), ) cmd.AddCommand( @@ -63,8 +67,6 @@ func GetTxCmd() *cobra.Command { CmdPutPolicy(), CmdDeletePolicy(), ) - - cmd.AddCommand(CmdCancelMigrateBucket()) // this line is used by starport scaffolding # 1 return cmd @@ -323,19 +325,6 @@ func CmdCreateObject() *cobra.Command { approveTimeoutHeight, approveSignatureBytes, ) - primarySP, err := cmd.Flags().GetString(FlagPrimarySP) - if err != nil { - return err - } - _, spKeyName, _, err := GetPrimarySPField(clientCtx.Keyring, primarySP) - if err != nil { - return err - } - sig, _, err := clientCtx.Keyring.Sign(spKeyName, msg.GetApprovalBytes()) - if err != nil { - return err - } - msg.PrimarySpApproval.Sig = sig if err := msg.ValidateBasic(); err != nil { return err @@ -961,6 +950,47 @@ func CmdDiscontinueBucket() *cobra.Command { return cmd } +func CmdMigrateBucket() *cobra.Command { + cmd := &cobra.Command{ + Use: "migrate-bucket [bucket-name] [dest-primary-sp-id]", + Short: "migrate a bucket to another primary storage provider by user", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + bucketName := args[0] + destPrimarySpID, err := strconv.ParseUint(args[1], 10, 32) + if err != nil { + return err + } + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + approveSignature, _ := cmd.Flags().GetString(FlagApproveSignature) + approveTimeoutHeight, _ := cmd.Flags().GetUint64(FlagApproveTimeoutHeight) + approveSignatureBytes, err := hex.DecodeString(approveSignature) + if err != nil { + return err + } + spApproval := &common.Approval{ExpiredHeight: approveTimeoutHeight, Sig: approveSignatureBytes} + + msg := &types.MsgMigrateBucket{ + Operator: clientCtx.GetFromAddress().String(), + BucketName: bucketName, + DstPrimarySpId: uint32(destPrimarySpID), + DstPrimarySpApproval: spApproval, + } + if err = msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + cmd.Flags().AddFlagSet(FlagSetApproval()) + return cmd +} + func CmdMirrorObject() *cobra.Command { cmd := &cobra.Command{ Use: "mirror-object", diff --git a/x/storage/client/cli/tx_cancel_migrate_bucket.go b/x/storage/client/cli/tx_cancel_migrate_bucket.go index b3a32a621..32895d3e4 100644 --- a/x/storage/client/cli/tx_cancel_migrate_bucket.go +++ b/x/storage/client/cli/tx_cancel_migrate_bucket.go @@ -15,21 +15,20 @@ var _ = strconv.Itoa(0) func CmdCancelMigrateBucket() *cobra.Command { cmd := &cobra.Command{ - Use: "cancel-migrate-bucket", - Short: "Broadcast message CancelMigrateBucket", - Args: cobra.ExactArgs(0), + Use: "cancel-migrate-bucket [bucket-name]", + Short: "cancel a existing bucket migration", + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { - + argBucketName := args[0] clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - msg := types.NewMsgCancelMigrateBucket( clientCtx.GetFromAddress(), - "bucket-name", + argBucketName, ) - if err := msg.ValidateBasic(); err != nil { + if err = msg.ValidateBasic(); err != nil { return err } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) From 0bd5221b70f49792157c27f7b9125c844cf89aa8 Mon Sep 17 00:00:00 2001 From: Alexxxxxx <118710506+alexgao001@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:27:56 +0800 Subject: [PATCH 05/12] feat: support reject bucket migration (#493) * feat: support reject bucket migration * add test * lint * register MsgRejectMigrateBucket Gas param for PampasUpgrade --- app/upgrade.go | 4 + e2e/tests/storage_test.go | 64 ++ proto/greenfield/storage/events.proto | 21 +- proto/greenfield/storage/tx.proto | 13 + sdk/client/gnfd_tm.go | 1 - x/storage/keeper/keeper.go | 34 + x/storage/keeper/msg_server.go | 13 + x/storage/types/codec.go | 4 + x/storage/types/events.pb.go | 490 ++++++++++--- .../types/message_reject_migrate_bucket.go | 53 ++ x/storage/types/tx.pb.go | 664 ++++++++++++++---- 11 files changed, 1105 insertions(+), 256 deletions(-) create mode 100644 x/storage/types/message_reject_migrate_bucket.go diff --git a/app/upgrade.go b/app/upgrade.go index 13ac1fa05..731819f8c 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -4,6 +4,7 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/gashub/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" bridgemoduletypes "github.com/bnb-chain/greenfield/x/bridge/types" @@ -79,6 +80,9 @@ func (app *App) registerPampasUpgradeHandler() { app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.ObjectChannelId, sdk.ChannelAllow) app.CrossChainKeeper.SetChannelSendPermission(ctx, sdk.ChainID(app.appConfig.CrossChain.DestOpChainId), storagemoduletypes.GroupChannelId, sdk.ChannelAllow) + // register MsgRejectMigrateBucket Gas param + app.GashubKeeper.SetMsgGasParams(ctx, *types.NewMsgGasParamsWithFixedGas("/greenfield.storage.MsgRejectMigrateBucket", 1.2e3)) + return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) diff --git a/e2e/tests/storage_test.go b/e2e/tests/storage_test.go index 547fa149f..5ba1b62d9 100644 --- a/e2e/tests/storage_test.go +++ b/e2e/tests/storage_test.go @@ -2010,3 +2010,67 @@ func (s *StorageTestSuite) TestMaintenanceSPCreateBucketAndObject() { s.Require().NoError(err) s.Require().Equal(sptypes.STATUS_IN_SERVICE, spResp.StorageProvider.Status) } + +func (s *StorageTestSuite) TestRejectMigrateBucket() { + // construct bucket and object + primarySP := s.BaseSuite.PickStorageProvider() + gvg, found := primarySP.GetFirstGlobalVirtualGroup() + s.Require().True(found) + user := s.GenAndChargeAccounts(1, 1000000)[0] + bucketName := storageutils.GenRandomBucketName() + objectName := storageutils.GenRandomObjectName() + s.BaseSuite.CreateObject(user, primarySP, gvg.Id, bucketName, objectName) + + var err error + dstPrimarySP := s.CreateNewStorageProvider() + + // migrate bucket + msgMigrationBucket := storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) + msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt + msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) + s.SendTxBlock(user, msgMigrationBucket) + s.Require().NoError(err) + + ctx := context.Background() + queryHeadBucketRequest := storagetypes.QueryHeadBucketRequest{ + BucketName: bucketName, + } + queryHeadBucketResponse, err := s.Client.HeadBucket(ctx, &queryHeadBucketRequest) + s.Require().NoError(err) + s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketName, bucketName) + s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_MIGRATING) + + // Dest SP reject the migration + rejectMigration := storagetypes.NewMsgRejectMigrateBucket(dstPrimarySP.OperatorKey.GetAddr(), bucketName) + s.SendTxBlock(dstPrimarySP.OperatorKey, rejectMigration) + s.Require().NoError(err) + + queryHeadBucketRequest = storagetypes.QueryHeadBucketRequest{ + BucketName: bucketName, + } + queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) + s.Require().NoError(err) + s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) + + // migrate bucket again + msgMigrationBucket = storagetypes.NewMsgMigrateBucket(user.GetAddr(), bucketName, dstPrimarySP.Info.Id) + msgMigrationBucket.DstPrimarySpApproval.ExpiredHeight = math.MaxInt + msgMigrationBucket.DstPrimarySpApproval.Sig, err = dstPrimarySP.ApprovalKey.Sign(msgMigrationBucket.GetApprovalBytes()) + s.SendTxBlock(user, msgMigrationBucket) + s.Require().NoError(err) + + // cancel migration by user + msgCancelMigrationBucket := storagetypes.NewMsgCancelMigrateBucket(user.GetAddr(), bucketName) + s.SendTxBlock(user, msgCancelMigrationBucket) + s.Require().NoError(err) + + queryHeadBucketResponse, err = s.Client.HeadBucket(ctx, &queryHeadBucketRequest) + s.Require().NoError(err) + s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) + + // dest SP should fail to reject + s.Client.SetKeyManager(dstPrimarySP.OperatorKey) + _, err = s.Client.BroadcastTx(context.Background(), []sdk.Msg{rejectMigration}, nil) + s.Require().Error(err) + s.Require().Equal(queryHeadBucketResponse.BucketInfo.BucketStatus, storagetypes.BUCKET_STATUS_CREATED) +} diff --git a/proto/greenfield/storage/events.proto b/proto/greenfield/storage/events.proto index ebe222532..d3dde1f82 100644 --- a/proto/greenfield/storage/events.proto +++ b/proto/greenfield/storage/events.proto @@ -105,7 +105,7 @@ message EventCreateObject { string bucket_name = 3; // object_name define the name of object string object_name = 4; - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket string bucket_id = 6 [ (cosmos_proto.scalar) = "cosmos.Uint", (gogoproto.customtype) = "Uint", @@ -499,7 +499,7 @@ message EventMigrationBucket { string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The name of the bucket to be migrated string bucket_name = 2; - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket string bucket_id = 3 [ (cosmos_proto.scalar) = "cosmos.Uint", (gogoproto.customtype) = "Uint", @@ -515,7 +515,20 @@ message EventCancelMigrationBucket { string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The name of the bucket to be migrated string bucket_name = 2; - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket + string bucket_id = 3 [ + (cosmos_proto.scalar) = "cosmos.Uint", + (gogoproto.customtype) = "Uint", + (gogoproto.nullable) = false + ]; +} + +message EventRejectMigrateBucket { + // The address of the operator that reject the bucket migration, must be the dest SP + string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // The name of the bucket to be migrated + string bucket_name = 2; + // bucket_id define an u256 id for bucket string bucket_id = 3 [ (cosmos_proto.scalar) = "cosmos.Uint", (gogoproto.customtype) = "Uint", @@ -529,7 +542,7 @@ message EventCompleteMigrationBucket { string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The name of the bucket to be migrated string bucket_name = 2; - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket string bucket_id = 3 [ (cosmos_proto.scalar) = "cosmos.Uint", (gogoproto.customtype) = "Uint", diff --git a/proto/greenfield/storage/tx.proto b/proto/greenfield/storage/tx.proto index 232f1b54d..27757cd4b 100644 --- a/proto/greenfield/storage/tx.proto +++ b/proto/greenfield/storage/tx.proto @@ -58,6 +58,7 @@ service Msg { rpc MigrateBucket(MsgMigrateBucket) returns (MsgMigrateBucketResponse); rpc CompleteMigrateBucket(MsgCompleteMigrateBucket) returns (MsgCompleteMigrateBucketResponse); rpc CancelMigrateBucket(MsgCancelMigrateBucket) returns (MsgCancelMigrateBucketResponse); + rpc RejectMigrateBucket(MsgRejectMigrateBucket) returns (MsgRejectMigrateBucketResponse); } message MsgCreateBucket { option (cosmos.msg.v1.signer) = "creator"; @@ -615,3 +616,15 @@ message MsgCancelMigrateBucket { } message MsgCancelMigrateBucketResponse {} + +message MsgRejectMigrateBucket { + option (cosmos.msg.v1.signer) = "operator"; + + // operator defines the account address of the msg operator. + // only the Dest SP can send this transaction to reject the bucket migration. + string operator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // bucket_name defines the name of the bucket that need to be migrated + string bucket_name = 2; +} + +message MsgRejectMigrateBucketResponse {} diff --git a/sdk/client/gnfd_tm.go b/sdk/client/gnfd_tm.go index fb3fb5d22..7ebb463f5 100644 --- a/sdk/client/gnfd_tm.go +++ b/sdk/client/gnfd_tm.go @@ -56,7 +56,6 @@ func (c *GreenfieldClient) GetStatus(ctx context.Context) (*ctypes.ResultStatus, func (c *GreenfieldClient) BroadcastVote(ctx context.Context, vote votepool.Vote) error { _, err := c.tendermintClient.BroadcastVote(ctx, vote) - return err } diff --git a/x/storage/keeper/keeper.go b/x/storage/keeper/keeper.go index cdcad3d5c..ba8033826 100644 --- a/x/storage/keeper/keeper.go +++ b/x/storage/keeper/keeper.go @@ -2075,6 +2075,40 @@ func (k Keeper) CancelBucketMigration(ctx sdk.Context, operator sdk.AccAddress, return nil } +func (k Keeper) RejectBucketMigration(ctx sdk.Context, operator sdk.AccAddress, bucketName string) error { + store := ctx.KVStore(k.storeKey) + bucketInfo, found := k.GetBucketInfo(ctx, bucketName) + if !found { + return types.ErrNoSuchBucket + } + if bucketInfo.BucketStatus != types.BUCKET_STATUS_MIGRATING { + return types.ErrInvalidBucketStatus.Wrapf("The bucket is not in migrating status") + } + + migrationBucketInfo, found := k.GetMigrationBucketInfo(ctx, bucketInfo.Id) + if !found { + return types.ErrMigrationBucketFailed.Wrapf("reject bucket migration failed due to the migrate bucket info not found.") + } + + sp := k.spKeeper.MustGetStorageProvider(ctx, migrationBucketInfo.DstSpId) + if !sdk.MustAccAddressFromHex(sp.OperatorAddress).Equals(operator) { + return types.ErrAccessDenied.Wrap("Only the dest SP can reject the bucket migration.") + } + + bucketInfo.BucketStatus = types.BUCKET_STATUS_CREATED + k.SetBucketInfo(ctx, bucketInfo) + store.Delete(types.GetMigrationBucketKey(bucketInfo.Id)) + + if err := ctx.EventManager().EmitTypedEvents(&types.EventRejectMigrateBucket{ + Operator: operator.String(), + BucketName: bucketName, + BucketId: bucketInfo.Id, + }); err != nil { + return err + } + return nil +} + func (k Keeper) GetMigrationBucketInfo(ctx sdk.Context, bucketID sdkmath.Uint) (*types.MigrationBucketInfo, bool) { store := ctx.KVStore(k.storeKey) diff --git a/x/storage/keeper/msg_server.go b/x/storage/keeper/msg_server.go index 8f9977935..929eb26c6 100644 --- a/x/storage/keeper/msg_server.go +++ b/x/storage/keeper/msg_server.go @@ -688,6 +688,19 @@ func (k msgServer) CancelMigrateBucket(goCtx context.Context, msg *types.MsgCanc return &types.MsgCancelMigrateBucketResponse{}, nil } +func (k msgServer) RejectMigrateBucket(goCtx context.Context, msg *storagetypes.MsgRejectMigrateBucket) (*storagetypes.MsgRejectMigrateBucketResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + operator := sdk.MustAccAddressFromHex(msg.Operator) + + err := k.RejectBucketMigration(ctx, operator, msg.BucketName) + if err != nil { + return nil, err + } + + return &types.MsgRejectMigrateBucketResponse{}, nil +} + func (k Keeper) verifyGVGSignatures(ctx sdk.Context, bucketID math.Uint, dstSP *sptypes.StorageProvider, gvgMappings []*storagetypes.GVGMapping) error { // verify secondary sp signature for _, newLvg2gvg := range gvgMappings { diff --git a/x/storage/types/codec.go b/x/storage/types/codec.go index 0efba3945..3aaf068b7 100644 --- a/x/storage/types/codec.go +++ b/x/storage/types/codec.go @@ -26,6 +26,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgMigrateBucket{}, "storage/MigrateBucket", nil) cdc.RegisterConcrete(&MsgCompleteMigrateBucket{}, "storage/CompleteMigrateBucket", nil) cdc.RegisterConcrete(&MsgCancelMigrateBucket{}, "storage/CancelMigrateBucket", nil) + cdc.RegisterConcrete(&MsgRejectMigrateBucket{}, "storage/RejectMigrateBucket", nil) // this line is used by starport scaffolding # 2 } @@ -112,6 +113,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCancelMigrateBucket{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgRejectMigrateBucket{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/storage/types/events.pb.go b/x/storage/types/events.pb.go index b0837df3f..b8848116b 100644 --- a/x/storage/types/events.pb.go +++ b/x/storage/types/events.pb.go @@ -401,7 +401,7 @@ type EventCreateObject struct { BucketName string `protobuf:"bytes,3,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` // object_name define the name of object ObjectName string `protobuf:"bytes,4,opt,name=object_name,json=objectName,proto3" json:"object_name,omitempty"` - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket BucketId Uint `protobuf:"bytes,6,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` // object_id define an u256 id for object ObjectId Uint `protobuf:"bytes,7,opt,name=object_id,json=objectId,proto3,customtype=Uint" json:"object_id"` @@ -2070,7 +2070,7 @@ type EventMigrationBucket struct { Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // The name of the bucket to be migrated BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket BucketId Uint `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` // The id of the destination primary sp DstPrimarySpId uint32 `protobuf:"varint,4,opt,name=dst_primary_sp_id,json=dstPrimarySpId,proto3" json:"dst_primary_sp_id,omitempty"` @@ -2136,7 +2136,7 @@ type EventCancelMigrationBucket struct { Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // The name of the bucket to be migrated BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket BucketId Uint `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` } @@ -2187,13 +2187,69 @@ func (m *EventCancelMigrationBucket) GetBucketName() string { return "" } +type EventRejectMigrateBucket struct { + // The address of the operator that reject the bucket migration, must be the dest SP + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // The name of the bucket to be migrated + BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` + // bucket_id define an u256 id for bucket + BucketId Uint `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` +} + +func (m *EventRejectMigrateBucket) Reset() { *m = EventRejectMigrateBucket{} } +func (m *EventRejectMigrateBucket) String() string { return proto.CompactTextString(m) } +func (*EventRejectMigrateBucket) ProtoMessage() {} +func (*EventRejectMigrateBucket) Descriptor() ([]byte, []int) { + return fileDescriptor_946dcba4f763ddc4, []int{28} +} +func (m *EventRejectMigrateBucket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRejectMigrateBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRejectMigrateBucket.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 *EventRejectMigrateBucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRejectMigrateBucket.Merge(m, src) +} +func (m *EventRejectMigrateBucket) XXX_Size() int { + return m.Size() +} +func (m *EventRejectMigrateBucket) XXX_DiscardUnknown() { + xxx_messageInfo_EventRejectMigrateBucket.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRejectMigrateBucket proto.InternalMessageInfo + +func (m *EventRejectMigrateBucket) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *EventRejectMigrateBucket) GetBucketName() string { + if m != nil { + return m.BucketName + } + return "" +} + type EventCompleteMigrationBucket struct { // The address of the operator that initiated the bucket migration, // usually the owner of the bucket or another account which has permission to operate Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` // The name of the bucket to be migrated BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - // bucket_id define an u256 id for object + // bucket_id define an u256 id for bucket BucketId Uint `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3,customtype=Uint" json:"bucket_id"` // The family id that the bucket to be migrated to GlobalVirtualGroupFamilyId uint32 `protobuf:"varint,4,opt,name=global_virtual_group_family_id,json=globalVirtualGroupFamilyId,proto3" json:"global_virtual_group_family_id,omitempty"` @@ -2205,7 +2261,7 @@ func (m *EventCompleteMigrationBucket) Reset() { *m = EventCompleteMigra func (m *EventCompleteMigrationBucket) String() string { return proto.CompactTextString(m) } func (*EventCompleteMigrationBucket) ProtoMessage() {} func (*EventCompleteMigrationBucket) Descriptor() ([]byte, []int) { - return fileDescriptor_946dcba4f763ddc4, []int{28} + return fileDescriptor_946dcba4f763ddc4, []int{29} } func (m *EventCompleteMigrationBucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2291,116 +2347,118 @@ func init() { proto.RegisterType((*EventStalePolicyCleanup)(nil), "greenfield.storage.EventStalePolicyCleanup") proto.RegisterType((*EventMigrationBucket)(nil), "greenfield.storage.EventMigrationBucket") proto.RegisterType((*EventCancelMigrationBucket)(nil), "greenfield.storage.EventCancelMigrationBucket") + proto.RegisterType((*EventRejectMigrateBucket)(nil), "greenfield.storage.EventRejectMigrateBucket") proto.RegisterType((*EventCompleteMigrationBucket)(nil), "greenfield.storage.EventCompleteMigrationBucket") } func init() { proto.RegisterFile("greenfield/storage/events.proto", fileDescriptor_946dcba4f763ddc4) } var fileDescriptor_946dcba4f763ddc4 = []byte{ - // 1648 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcb, 0x6f, 0xdb, 0x46, - 0x1a, 0x37, 0x25, 0x4a, 0x96, 0x47, 0x96, 0x14, 0x73, 0xbd, 0x89, 0xd6, 0xc9, 0xca, 0x0a, 0x0f, - 0x59, 0x67, 0xb1, 0x91, 0x16, 0xce, 0xee, 0x22, 0xb7, 0xc0, 0x8f, 0xec, 0x42, 0xd8, 0xe6, 0x51, - 0x3a, 0xc9, 0xa1, 0x17, 0x62, 0x44, 0x8e, 0x65, 0x36, 0x24, 0x87, 0xe5, 0x8c, 0x9c, 0x28, 0xff, - 0x40, 0x4f, 0x05, 0x02, 0x14, 0x05, 0xda, 0x4b, 0xce, 0x05, 0x8a, 0x02, 0x3d, 0xe4, 0xda, 0x7b, - 0x7a, 0x4b, 0xd3, 0x4b, 0x1f, 0x40, 0x5a, 0x24, 0xa7, 0x14, 0x28, 0xda, 0x73, 0x4f, 0x05, 0x67, - 0x86, 0x14, 0x29, 0xca, 0x91, 0xa9, 0xd4, 0xb1, 0xd3, 0x9b, 0x38, 0xfa, 0x0d, 0xf9, 0x3d, 0x7e, - 0xdf, 0xef, 0xfb, 0x38, 0x04, 0xcb, 0x3d, 0x1f, 0x21, 0x77, 0xdb, 0x42, 0xb6, 0xd9, 0x26, 0x14, - 0xfb, 0xb0, 0x87, 0xda, 0x68, 0x17, 0xb9, 0x94, 0xb4, 0x3c, 0x1f, 0x53, 0xac, 0x28, 0x43, 0x40, - 0x4b, 0x00, 0x96, 0xfe, 0x62, 0x60, 0xe2, 0x60, 0xa2, 0x33, 0x44, 0x9b, 0x5f, 0x70, 0xf8, 0xd2, - 0x62, 0x0f, 0xf7, 0x30, 0x5f, 0x0f, 0x7e, 0x89, 0xd5, 0xe5, 0x1e, 0xc6, 0x3d, 0x1b, 0xb5, 0xd9, - 0x55, 0xb7, 0xbf, 0xdd, 0xa6, 0x96, 0x83, 0x08, 0x85, 0x8e, 0x17, 0x01, 0xd2, 0x66, 0x18, 0xd8, - 0x71, 0xb0, 0x2b, 0x00, 0x8d, 0x31, 0x00, 0x3a, 0xf0, 0x90, 0x78, 0xae, 0xfa, 0x95, 0x0c, 0x16, - 0x2e, 0x05, 0x76, 0x6f, 0xf8, 0x08, 0x52, 0xb4, 0x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0x61, 0xe4, 0xcf, 0x80, 0x9a, 0x49, 0x68, 0xe2, 0x7e, 0x5c, 0x76, 0x2b, 0x26, - 0xa1, 0xc9, 0xfb, 0x05, 0xb8, 0xf8, 0xfd, 0x0a, 0x11, 0x2e, 0x76, 0xbf, 0x8b, 0xa0, 0x12, 0x7b, - 0xee, 0xfe, 0x38, 0x59, 0x8e, 0x4c, 0x62, 0x23, 0x74, 0x25, 0xf6, 0xa0, 0xfd, 0x89, 0x75, 0x39, - 0xb2, 0x61, 0xda, 0x04, 0xfd, 0x2a, 0x25, 0x86, 0xcc, 0xa3, 0x54, 0x0e, 0x72, 0x96, 0x72, 0xd8, - 0xdb, 0xf9, 0xc2, 0xde, 0xce, 0x7f, 0x21, 0x89, 0x31, 0x52, 0x43, 0xac, 0x4e, 0x8e, 0x98, 0x1e, - 0x64, 0x09, 0xc0, 0xd8, 0x41, 0x4c, 0x38, 0x33, 0x62, 0x96, 0x34, 0x6e, 0xba, 0x1d, 0x3e, 0x35, - 0x97, 0x25, 0xec, 0x53, 0x0d, 0x62, 0xef, 0xe5, 0x12, 0xd3, 0xbb, 0x20, 0xf0, 0x01, 0x4e, 0xef, - 0x07, 0xc8, 0xbb, 0xe4, 0x74, 0x53, 0x98, 0x66, 0xba, 0x51, 0x7f, 0x91, 0xc0, 0xb1, 0xd8, 0x60, - 0xca, 0xd8, 0x99, 0xf9, 0xf4, 0xe0, 0xaf, 0x00, 0x70, 0xca, 0xc7, 0x62, 0x30, 0xc7, 0x56, 0x98, - 0x87, 0xff, 0x01, 0xa5, 0xa8, 0x22, 0xf6, 0xf1, 0xfe, 0x32, 0xdb, 0x13, 0xaa, 0x3f, 0x32, 0xb2, - 0xc8, 0x99, 0x47, 0x96, 0x45, 0x50, 0x40, 0x77, 0xa8, 0x0f, 0x85, 0x6a, 0xf2, 0x0b, 0xf5, 0xa3, - 0xd0, 0x65, 0x2e, 0x3b, 0x23, 0x2e, 0xe7, 0xa6, 0x71, 0x39, 0xff, 0x22, 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 0x83, 0x77, 0x19, 0x0d, 0x98, 0xd1, 0x6f, 0xf5, 0xb1, 0x04, - 0x16, 0x45, 0x94, 0x7a, 0xbc, 0x4f, 0xbc, 0x42, 0x99, 0xcc, 0xf4, 0xb9, 0xe2, 0x2c, 0x58, 0x30, - 0x09, 0xd5, 0xc7, 0x1d, 0xbf, 0x55, 0x4d, 0x42, 0xaf, 0x0d, 0x4f, 0xe0, 0xd4, 0x4f, 0x25, 0xb0, - 0x14, 0x3b, 0x39, 0x3c, 0xea, 0xae, 0xa9, 0xf7, 0x73, 0xe0, 0x94, 0x38, 0x8b, 0x72, 0xbc, 0x20, - 0x35, 0x47, 0x3e, 0x19, 0x93, 0x3f, 0xd0, 0xc8, 0x13, 0xbf, 0x3f, 0x9e, 0x05, 0x0b, 0xc4, 0x37, - 0x46, 0x12, 0xca, 0x85, 0xa8, 0x4a, 0x7c, 0x23, 0x96, 0xd0, 0xf5, 0xce, 0xc3, 0xa7, 0x0d, 0xe9, - 0xd1, 0xd3, 0x86, 0xf4, 0xc3, 0xd3, 0x86, 0x74, 0xef, 0x59, 0x63, 0xe6, 0xd1, 0xb3, 0xc6, 0xcc, - 0xd7, 0xcf, 0x1a, 0x33, 0x6f, 0xb5, 0x7b, 0x16, 0xdd, 0xe9, 0x77, 0x5b, 0x06, 0x76, 0xda, 0x5d, - 0xb7, 0x7b, 0x8e, 0xd5, 0x58, 0x3b, 0xf6, 0x55, 0xfc, 0x4e, 0xf2, 0xbb, 0x78, 0xb7, 0xc8, 0x66, - 0xa5, 0xf3, 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x24, 0x2e, 0x76, 0xe2, 0x1f, 0x00, 0x00, + // 1658 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x8f, 0xdb, 0x44, + 0x1b, 0x5f, 0x27, 0x4e, 0x36, 0x3b, 0xd9, 0x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 0xca, 0x1d, 0x3f, 0xcd, 0x98, 0xce, 0x36, 0xe6, 0x65, + 0x61, 0x64, 0xb9, 0x63, 0x65, 0x3f, 0x38, 0xcb, 0xa8, 0xc0, 0x88, 0x7e, 0x2b, 0x0f, 0x05, 0xb0, + 0xc8, 0xa3, 0xd4, 0x65, 0x75, 0xe2, 0x05, 0xca, 0x64, 0xa6, 0xcf, 0x15, 0xa7, 0xc1, 0x82, 0xe1, + 0x13, 0x6d, 0xd4, 0xf5, 0x5b, 0xd5, 0xf0, 0xc9, 0x95, 0xc1, 0x0d, 0x9c, 0xf2, 0xa5, 0x00, 0x96, + 0x62, 0x37, 0x87, 0xd3, 0xee, 0x5a, 0x40, 0x55, 0x39, 0x76, 0xda, 0x67, 0xf6, 0xa2, 0x69, 0xb5, + 0xf6, 0x6e, 0x0e, 0x9c, 0xe0, 0x37, 0x67, 0xb6, 0x1b, 0x10, 0x69, 0xea, 0xa9, 0x33, 0xfe, 0x73, + 0x92, 0x38, 0xf6, 0x6b, 0xe9, 0x69, 0xb0, 0xe0, 0x7b, 0xfa, 0x10, 0xfd, 0x98, 0x6c, 0x56, 0x7d, + 0x4f, 0x8f, 0xd1, 0x6f, 0xbd, 0x7d, 0xff, 0x71, 0x5d, 0x78, 0xf0, 0xb8, 0x2e, 0xfc, 0xf2, 0xb8, + 0x2e, 0xdc, 0x79, 0x52, 0x9f, 0x79, 0xf0, 0xa4, 0x3e, 0xf3, 0xfd, 0x93, 0xfa, 0xcc, 0x7b, 0xad, + 0xae, 0x49, 0x76, 0x7a, 0x9d, 0xa6, 0x8e, 0xed, 0x56, 0xc7, 0xe9, 0x9c, 0xa1, 0x8a, 0xd0, 0x8a, + 0x7d, 0xc3, 0xbf, 0x95, 0xfc, 0x8a, 0xdf, 0x29, 0xd2, 0xce, 0xee, 0xec, 0x5f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x47, 0x07, 0x50, 0x6a, 0x90, 0x20, 0x00, 0x00, } func (m *EventCreateBucket) Marshal() (dAtA []byte, err error) { @@ -4108,6 +4166,53 @@ func (m *EventCancelMigrationBucket) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *EventRejectMigrateBucket) 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 *EventRejectMigrateBucket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRejectMigrateBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.BucketId.Size() + i -= size + if _, err := m.BucketId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.BucketName) > 0 { + i -= len(m.BucketName) + copy(dAtA[i:], m.BucketName) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BucketName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EventCompleteMigrationBucket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4927,6 +5032,25 @@ func (m *EventCancelMigrationBucket) Size() (n int) { return n } +func (m *EventRejectMigrateBucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.BucketName) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.BucketId.Size() + n += 1 + l + sovEvents(uint64(l)) + return n +} + func (m *EventCompleteMigrationBucket) Size() (n int) { if m == nil { return 0 @@ -10597,6 +10721,154 @@ func (m *EventCancelMigrationBucket) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventRejectMigrateBucket) 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 ErrIntOverflowEvents + } + 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: EventRejectMigrateBucket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRejectMigrateBucket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BucketName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BucketName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BucketId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BucketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EventCompleteMigrationBucket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/storage/types/message_reject_migrate_bucket.go b/x/storage/types/message_reject_migrate_bucket.go new file mode 100644 index 000000000..ae8af2fa5 --- /dev/null +++ b/x/storage/types/message_reject_migrate_bucket.go @@ -0,0 +1,53 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/bnb-chain/greenfield/types/s3util" +) + +const TypeMsgRejectMigrateBucket = "reject_migrate_bucket" + +var _ sdk.Msg = &MsgRejectMigrateBucket{} + +func NewMsgRejectMigrateBucket(operator sdk.AccAddress, bucketName string) *MsgRejectMigrateBucket { + return &MsgRejectMigrateBucket{ + Operator: operator.String(), + BucketName: bucketName, + } +} + +func (msg *MsgRejectMigrateBucket) Route() string { + return RouterKey +} + +func (msg *MsgRejectMigrateBucket) Type() string { + return TypeMsgRejectMigrateBucket +} + +func (msg *MsgRejectMigrateBucket) GetSigners() []sdk.AccAddress { + operator, err := sdk.AccAddressFromHexUnsafe(msg.Operator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{operator} +} + +func (msg *MsgRejectMigrateBucket) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgRejectMigrateBucket) ValidateBasic() error { + _, err := sdk.AccAddressFromHexUnsafe(msg.Operator) + if err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid operator address (%s)", err) + } + + err = s3util.CheckValidBucketName(msg.BucketName) + if err != nil { + return err + } + return nil +} diff --git a/x/storage/types/tx.pb.go b/x/storage/types/tx.pb.go index 48e739572..95729c350 100644 --- a/x/storage/types/tx.pb.go +++ b/x/storage/types/tx.pb.go @@ -3000,6 +3000,97 @@ func (m *MsgCancelMigrateBucketResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelMigrateBucketResponse proto.InternalMessageInfo +type MsgRejectMigrateBucket struct { + // operator defines the account address of the msg operator. + // only the Dest SP can send this transaction to reject the bucket migration. + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // bucket_name defines the name of the bucket that need to be migrated + BucketName string `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` +} + +func (m *MsgRejectMigrateBucket) Reset() { *m = MsgRejectMigrateBucket{} } +func (m *MsgRejectMigrateBucket) String() string { return proto.CompactTextString(m) } +func (*MsgRejectMigrateBucket) ProtoMessage() {} +func (*MsgRejectMigrateBucket) Descriptor() ([]byte, []int) { + return fileDescriptor_ddb71b028305a3cc, []int{55} +} +func (m *MsgRejectMigrateBucket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRejectMigrateBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRejectMigrateBucket.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 *MsgRejectMigrateBucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRejectMigrateBucket.Merge(m, src) +} +func (m *MsgRejectMigrateBucket) XXX_Size() int { + return m.Size() +} +func (m *MsgRejectMigrateBucket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRejectMigrateBucket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRejectMigrateBucket proto.InternalMessageInfo + +func (m *MsgRejectMigrateBucket) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgRejectMigrateBucket) GetBucketName() string { + if m != nil { + return m.BucketName + } + return "" +} + +type MsgRejectMigrateBucketResponse struct { +} + +func (m *MsgRejectMigrateBucketResponse) Reset() { *m = MsgRejectMigrateBucketResponse{} } +func (m *MsgRejectMigrateBucketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRejectMigrateBucketResponse) ProtoMessage() {} +func (*MsgRejectMigrateBucketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ddb71b028305a3cc, []int{56} +} +func (m *MsgRejectMigrateBucketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRejectMigrateBucketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRejectMigrateBucketResponse.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 *MsgRejectMigrateBucketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRejectMigrateBucketResponse.Merge(m, src) +} +func (m *MsgRejectMigrateBucketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRejectMigrateBucketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRejectMigrateBucketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRejectMigrateBucketResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateBucket)(nil), "greenfield.storage.MsgCreateBucket") proto.RegisterType((*MsgCreateBucketResponse)(nil), "greenfield.storage.MsgCreateBucketResponse") @@ -3056,153 +3147,156 @@ func init() { proto.RegisterType((*MsgCompleteMigrateBucketResponse)(nil), "greenfield.storage.MsgCompleteMigrateBucketResponse") proto.RegisterType((*MsgCancelMigrateBucket)(nil), "greenfield.storage.MsgCancelMigrateBucket") proto.RegisterType((*MsgCancelMigrateBucketResponse)(nil), "greenfield.storage.MsgCancelMigrateBucketResponse") + proto.RegisterType((*MsgRejectMigrateBucket)(nil), "greenfield.storage.MsgRejectMigrateBucket") + proto.RegisterType((*MsgRejectMigrateBucketResponse)(nil), "greenfield.storage.MsgRejectMigrateBucketResponse") } func init() { proto.RegisterFile("greenfield/storage/tx.proto", fileDescriptor_ddb71b028305a3cc) } var fileDescriptor_ddb71b028305a3cc = []byte{ - // 2248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4b, 0x6c, 0x1b, 0xc7, - 0xf9, 0x37, 0x45, 0xea, 0xc1, 0x8f, 0xd4, 0xc3, 0x6b, 0x39, 0x62, 0xa8, 0xbf, 0x29, 0x9a, 0xf9, - 0x23, 0x91, 0x5f, 0xa2, 0xa3, 0xba, 0x46, 0x2a, 0x14, 0x45, 0x25, 0xa5, 0x71, 0x89, 0x84, 0xb5, - 0xb2, 0xb2, 0x5d, 0x20, 0x40, 0xc1, 0x0c, 0x77, 0xc7, 0xab, 0x6d, 0xc8, 0xdd, 0xed, 0xcc, 0x52, - 0x36, 0x53, 0xa0, 0x87, 0x5e, 0x7a, 0x2a, 0x10, 0x20, 0x3d, 0xf4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86, 0x98, - 0x94, 0x85, 0x4c, 0x29, 0xe5, 0x8c, 0xca, 0xa5, 0x1c, 0xc9, 0xa8, 0x5f, 0xca, 0x35, 0x47, 0x38, - 0xff, 0xb5, 0xf5, 0x82, 0x46, 0xcf, 0x94, 0xc2, 0x49, 0x9c, 0x29, 0xb2, 0x9d, 0x23, 0xfd, 0xd3, - 0xcf, 0x79, 0x05, 0xc8, 0xe7, 0x5e, 0xe6, 0x3a, 0x74, 0x24, 0x33, 0x67, 0x94, 0x57, 0xc7, 0x30, - 0x32, 0xbf, 0x5f, 0x49, 0x62, 0x04, 0x12, 0x7e, 0xca, 0x3d, 0x99, 0xdb, 0x77, 0xcf, 0x7b, 0x9c, - 0x51, 0x6e, 0x43, 0x11, 0x0d, 0xdc, 0x03, 0x9b, 0x30, 0x15, 0x67, 0xc9, 0x18, 0x42, 0x95, 0xb7, - 0x60, 0x86, 0x3f, 0xef, 0x84, 0x15, 0x6e, 0xdc, 0x2e, 0x7c, 0x8f, 0x9d, 0x02, 0x53, 0x82, 0x2a, - 0xf0, 0x5b, 0x0b, 0x8c, 0xdd, 0x90, 0x92, 0x30, 0x89, 0xcc, 0x54, 0xc0, 0xf0, 0x7f, 0x73, 0xb0, - 0xe4, 0xc9, 0x62, 0x10, 0x74, 0xca, 0xef, 0x03, 0xca, 0x15, 0x38, 0x1f, 0xe9, 0x23, 0x99, 0xba, - 0x67, 0x8f, 0x79, 0x75, 0x41, 0x6e, 0x12, 0xb5, 0xf4, 0x71, 0x2d, 0xa7, 0xc2, 0x09, 0xb5, 0x9c, - 0xaa, 0x50, 0x89, 0x0a, 0x1e, 0xb6, 0x24, 0xa6, 0xbc, 0xc9, 0x5d, 0xbb, 0xef, 0xb0, 0x7c, 0xff, - 0x95, 0x68, 0x67, 0x07, 0x6a, 0x89, 0x6d, 0xd9, 0x87, 0xa8, 0x6f, 0xf6, 0x86, 0xa1, 0xaa, 0xaa, - 0xf1, 0xee, 0xec, 0x3b, 0x1e, 0xa4, 0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d3, 0x1e, 0x32, 0x98, - 0x24, 0xd2, 0x23, 0x46, 0x9a, 0x24, 0x21, 0x24, 0x55, 0x92, 0x84, 0xd6, 0x7e, 0x10, 0x2a, 0x19, - 0x76, 0x90, 0x41, 0x19, 0xa1, 0x12, 0xd9, 0x81, 0x80, 0x92, 0x70, 0x77, 0x4d, 0x65, 0x31, 0x06, - 0xad, 0xbe, 0x39, 0x31, 0x34, 0x1e, 0x30, 0x19, 0x52, 0xc9, 0xa0, 0x8c, 0x80, 0x89, 0xec, 0x30, - 0x1a, 0x30, 0x62, 0x9b, 0x09, 0x02, 0x46, 0xec, 0x75, 0x73, 0x52, 0x64, 0x3c, 0xe3, 0x48, 0x05, - 0xeb, 0xf8, 0x8c, 0x13, 0x02, 0x33, 0x32, 0x4e, 0xbc, 0x44, 0x56, 0x7e, 0x04, 0x25, 0xf9, 0x29, - 0xa0, 0x31, 0x36, 0xf0, 0x3c, 0x4c, 0xf5, 0x6a, 0x36, 0x46, 0x26, 0x2f, 0xb7, 0xe3, 0x1b, 0x63, - 0xfd, 0x69, 0x3c, 0xf9, 0x84, 0x06, 0x3b, 0x33, 0x4e, 0xbc, 0xb9, 0xbe, 0x3e, 0x56, 0x07, 0x12, - 0x32, 0xd5, 0x38, 0xa9, 0x9d, 0xe6, 0xd0, 0x38, 0x52, 0x07, 0xf3, 0x8d, 0x6c, 0x2a, 0x1e, 0x30, - 0xc3, 0x38, 0xf1, 0x3e, 0x22, 0xcb, 0x07, 0x52, 0x0f, 0x31, 0x2d, 0x1f, 0x84, 0x90, 0xd4, 0x7c, - 0x10, 0xef, 0xef, 0x31, 0xcb, 0xc8, 0x37, 0x83, 0xc6, 0xd8, 0x98, 0x18, 0x6f, 0x99, 0x84, 0xd2, - 0x9c, 0x27, 0xce, 0x48, 0x3b, 0x3e, 0x3d, 0x71, 0x8e, 0x02, 0xc7, 0x24, 0xce, 0xe4, 0x66, 0xb7, - 0xf2, 0x43, 0x28, 0x86, 0x4d, 0xa7, 0x7a, 0xca, 0xea, 0x00, 0x51, 0x5d, 0xcf, 0x42, 0xc4, 0xb3, - 0xa6, 0xa0, 0x3d, 0x3e, 0x6b, 0x0a, 0xf2, 0xd7, 0x26, 0x00, 0xc9, 0x3b, 0x8c, 0xdc, 0x5f, 0x5e, - 0x1b, 0xeb, 0x24, 0x1c, 0x94, 0xba, 0x43, 0xd2, 0xa5, 0x43, 0xd1, 0x60, 0x7e, 0xb4, 0x4e, 0xfc, - 0xff, 0x54, 0x3b, 0x4a, 0xa8, 0xea, 0xf5, 0x49, 0x50, 0xc1, 0x26, 0x3f, 0x85, 0x8b, 0xc9, 0xf5, - 0xfb, 0xf5, 0xd4, 0x23, 0x2a, 0x01, 0x5d, 0xbd, 0x75, 0x14, 0x74, 0xb0, 0xf9, 0x00, 0x2e, 0x24, - 0xd5, 0xc3, 0x57, 0xc7, 0x9e, 0x27, 0xa3, 0x1b, 0x6f, 0x4e, 0x8e, 0xf5, 0xb7, 0xdd, 0x69, 0x3d, - 0x79, 0x5e, 0xcb, 0x3d, 0x7d, 0x5e, 0xcb, 0x7d, 0xf9, 0xbc, 0x96, 0xfb, 0xe4, 0x45, 0xed, 0xdc, - 0xd3, 0x17, 0xb5, 0x73, 0x7f, 0x7d, 0x51, 0x3b, 0xf7, 0x41, 0xd3, 0x30, 0xdd, 0x83, 0x41, 0x97, - 0x5d, 0x95, 0x9a, 0x5d, 0xab, 0x7b, 0xc3, 0xbb, 0xed, 0x36, 0xa5, 0x5f, 0x14, 0x3e, 0x0e, 0x7f, - 0x77, 0x39, 0x74, 0x30, 0xed, 0xce, 0x78, 0x3d, 0xc3, 0x6f, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, - 0xe0, 0x4b, 0x9e, 0x35, 0x9a, 0x29, 0x00, 0x00, + // 2269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x1b, 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, 0x00, 0x53, 0x07, 0x0d, 0x6c, 0x01, 0xa8, 0x4b, 0xb4, 0xf5, 0xac, 0xc1, + 0xc0, 0x32, 0x9b, 0xc8, 0xb6, 0x89, 0x75, 0x80, 0xfa, 0xfe, 0x16, 0x11, 0xc4, 0x43, 0x82, 0x6c, + 0x1b, 0x13, 0x01, 0x68, 0x48, 0x00, 0x1b, 0x93, 0x81, 0x41, 0xa9, 0x61, 0x99, 0x02, 0x1b, 0xb3, + 0x89, 0x27, 0x82, 0x4c, 0x80, 0x8d, 0x08, 0x1a, 0x08, 0xfe, 0x1a, 0x7f, 0xc9, 0xc3, 0x42, 0x9b, + 0xea, 0x3b, 0x04, 0x23, 0x07, 0x6f, 0x0f, 0x7b, 0x1f, 0x61, 0x47, 0xd9, 0x80, 0x99, 0x1e, 0xfb, + 0xb6, 0x48, 0x25, 0x57, 0xcf, 0xad, 0x15, 0xb7, 0x2b, 0x5f, 0x7c, 0x76, 0x7d, 0x49, 0x88, 0x65, + 0x4b, 0xd3, 0x08, 0xa6, 0x74, 0xcf, 0x21, 0x86, 0xa9, 0xab, 0x1e, 0x50, 0x59, 0x85, 0x52, 0xd7, + 0x5d, 0xdd, 0x31, 0xd1, 0x00, 0x57, 0xa6, 0xd8, 0x3a, 0x15, 0xf8, 0xd0, 0x8f, 0xd0, 0x00, 0x2b, + 0xdb, 0x00, 0x07, 0x06, 0x35, 0xba, 0x46, 0xdf, 0x70, 0x46, 0x95, 0x7c, 0x3d, 0xb7, 0x36, 0xbf, + 0xd1, 0x58, 0x8f, 0x6a, 0x69, 0xfd, 0xbe, 0x8f, 0xba, 0x3b, 0xb2, 0xb1, 0x2a, 0xad, 0x52, 0xb6, + 0x60, 0xc1, 0x46, 0xa3, 0x01, 0x36, 0x9d, 0x0e, 0xe2, 0x64, 0x54, 0x0a, 0x19, 0x04, 0xce, 0x8b, + 0x05, 0x62, 0x54, 0x79, 0x07, 0x14, 0x9b, 0x18, 0x03, 0x44, 0x46, 0x1d, 0x6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, 0x79, 0xd7, 0xd8, 0x6a, 0x31, 0x09, 0xcf, + 0xbd, 0x96, 0xe9, 0xdc, 0xba, 0x79, 0x1f, 0xf5, 0x87, 0x38, 0x5a, 0xe8, 0x1f, 0x47, 0xbb, 0xe3, + 0x18, 0x0a, 0xba, 0x34, 0xab, 0x09, 0x24, 0xea, 0x4b, 0xfc, 0xf7, 0x39, 0x9e, 0x96, 0x21, 0xb3, + 0x87, 0xfb, 0x63, 0x55, 0xef, 0x29, 0x49, 0xa4, 0x56, 0xe1, 0x62, 0x2c, 0x7d, 0x3e, 0x07, 0x7f, + 0x9d, 0x82, 0x72, 0x9b, 0xea, 0xbb, 0x43, 0x67, 0xd7, 0xea, 0x1b, 0xbd, 0xd1, 0x11, 0x09, 0xff, + 0x1e, 0x14, 0x6d, 0x62, 0x98, 0x3d, 0xc3, 0x46, 0x7d, 0x11, 0x6f, 0xea, 0xb2, 0xe4, 0x83, 0x9e, + 0xde, 0xfa, 0xae, 0x87, 0x53, 0x83, 0x25, 0x2c, 0xfb, 0x27, 0x98, 0x5a, 0x43, 0xd2, 0xf3, 0x98, + 0xf2, 0xbf, 0x95, 0xef, 0x03, 0x50, 0x07, 0x39, 0x98, 0xa9, 0xda, 0x8b, 0xc2, 0x49, 0x9b, 0xef, + 0x79, 0x40, 0x55, 0x5a, 0xa3, 0xb4, 0xa3, 0x31, 0x71, 0x26, 0x33, 0x26, 0xce, 0x3e, 0x7e, 0xba, + 0x9a, 0x8b, 0x8b, 0x8b, 0x61, 0x19, 0xef, 0xba, 0x19, 0x83, 0x2f, 0x41, 0x39, 0x33, 0xb7, 0xdd, + 0x11, 0xaf, 0x70, 0xcc, 0xca, 0xcc, 0x39, 0xba, 0xa5, 0x35, 0xfe, 0x2c, 0x67, 0xe6, 0xa7, 0x55, + 0x2f, 0x61, 0x31, 0xec, 0x49, 0x39, 0xfb, 0xb1, 0x49, 0xe2, 0xbf, 0x5c, 0x12, 0x6d, 0x83, 0x10, + 0x8b, 0xbc, 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, 0x39, + 0x21, 0x50, 0xe6, 0x67, 0x2c, 0x71, 0x48, 0xe2, 0x47, 0x06, 0x25, 0xf2, 0x13, 0x77, 0x6d, 0x29, + 0x16, 0x9c, 0x8b, 0xbe, 0x54, 0xae, 0x25, 0x49, 0x24, 0x8c, 0xac, 0xde, 0x98, 0x14, 0x29, 0xb3, + 0x34, 0x56, 0x6d, 0xa5, 0x1b, 0x01, 0x07, 0x65, 0x18, 0x41, 0xa8, 0xad, 0xfe, 0x01, 0x80, 0xf4, + 0xa8, 0x72, 0x29, 0x61, 0x69, 0x00, 0xa9, 0x5e, 0xce, 0x84, 0xc8, 0xea, 0x8f, 0x3c, 0xdb, 0x24, + 0xa9, 0x3f, 0x0c, 0x4c, 0x54, 0x7f, 0xd2, 0x53, 0x0b, 0xe3, 0x44, 0x7a, 0x66, 0x49, 0xe2, 0x24, + 0x80, 0x24, 0x72, 0x12, 0xf3, 0xf8, 0xe0, 0xbb, 0x4a, 0x86, 0x1e, 0x64, 0x50, 0x86, 0xab, 0x84, + 0x4e, 0x20, 0xa0, 0xc4, 0x54, 0xd7, 0x89, 0x24, 0x46, 0xa0, 0xd5, 0x37, 0x27, 0x86, 0x46, 0x1d, + 0x26, 0x83, 0x2b, 0x19, 0x94, 0xe1, 0x30, 0xa1, 0x13, 0xc6, 0x1d, 0x46, 0x1c, 0x33, 0x81, 0xc3, + 0x88, 0xb3, 0x6e, 0x4c, 0x8a, 0x8c, 0x46, 0x1c, 0x29, 0xa5, 0x4e, 0x8f, 0x38, 0x01, 0x30, 0x23, + 0xe2, 0x44, 0x93, 0x78, 0xe5, 0x27, 0x50, 0x92, 0x1f, 0x2b, 0x1a, 0xa9, 0x8e, 0xe7, 0x62, 0xaa, + 0x57, 0xb2, 0x31, 0xf2, 0xf6, 0xf2, 0x83, 0x41, 0x23, 0xd5, 0x9e, 0xd2, 0xb7, 0x8f, 0x79, 0x02, + 0x60, 0xca, 0x89, 0xb6, 0xff, 0xd7, 0x52, 0x65, 0x20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b, + 0x7d, 0xf2, 0xbc, 0x76, 0xe6, 0xc9, 0xf3, 0xda, 0x99, 0xbf, 0x3f, 0xaf, 0x9d, 0xf9, 0xa0, 0xa9, + 0x1b, 0xce, 0xfe, 0xb0, 0xcb, 0x6a, 0xc8, 0x66, 0xd7, 0xec, 0x5e, 0x77, 0xdb, 0x00, 0x4d, 0xe9, + 0xa7, 0x96, 0x8f, 0x82, 0x1f, 0xa4, 0x8e, 0x6c, 0x4c, 0xbb, 0x67, 0xdd, 0x66, 0xea, 0xb7, 0xbe, + 0x0a, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x9d, 0xed, 0xbd, 0xb3, 0x2a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3250,6 +3344,7 @@ type MsgClient interface { MigrateBucket(ctx context.Context, in *MsgMigrateBucket, opts ...grpc.CallOption) (*MsgMigrateBucketResponse, error) CompleteMigrateBucket(ctx context.Context, in *MsgCompleteMigrateBucket, opts ...grpc.CallOption) (*MsgCompleteMigrateBucketResponse, error) CancelMigrateBucket(ctx context.Context, in *MsgCancelMigrateBucket, opts ...grpc.CallOption) (*MsgCancelMigrateBucketResponse, error) + RejectMigrateBucket(ctx context.Context, in *MsgRejectMigrateBucket, opts ...grpc.CallOption) (*MsgRejectMigrateBucketResponse, error) } type msgClient struct { @@ -3503,6 +3598,15 @@ func (c *msgClient) CancelMigrateBucket(ctx context.Context, in *MsgCancelMigrat return out, nil } +func (c *msgClient) RejectMigrateBucket(ctx context.Context, in *MsgRejectMigrateBucket, opts ...grpc.CallOption) (*MsgRejectMigrateBucketResponse, error) { + out := new(MsgRejectMigrateBucketResponse) + err := c.cc.Invoke(ctx, "/greenfield.storage.Msg/RejectMigrateBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // basic operation of bucket @@ -3538,6 +3642,7 @@ type MsgServer interface { MigrateBucket(context.Context, *MsgMigrateBucket) (*MsgMigrateBucketResponse, error) CompleteMigrateBucket(context.Context, *MsgCompleteMigrateBucket) (*MsgCompleteMigrateBucketResponse, error) CancelMigrateBucket(context.Context, *MsgCancelMigrateBucket) (*MsgCancelMigrateBucketResponse, error) + RejectMigrateBucket(context.Context, *MsgRejectMigrateBucket) (*MsgRejectMigrateBucketResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -3625,6 +3730,9 @@ func (*UnimplementedMsgServer) CompleteMigrateBucket(ctx context.Context, req *M func (*UnimplementedMsgServer) CancelMigrateBucket(ctx context.Context, req *MsgCancelMigrateBucket) (*MsgCancelMigrateBucketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelMigrateBucket not implemented") } +func (*UnimplementedMsgServer) RejectMigrateBucket(ctx context.Context, req *MsgRejectMigrateBucket) (*MsgRejectMigrateBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RejectMigrateBucket not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -4116,6 +4224,24 @@ func _Msg_CancelMigrateBucket_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_RejectMigrateBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRejectMigrateBucket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RejectMigrateBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greenfield.storage.Msg/RejectMigrateBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RejectMigrateBucket(ctx, req.(*MsgRejectMigrateBucket)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "greenfield.storage.Msg", HandlerType: (*MsgServer)(nil), @@ -4228,6 +4354,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CancelMigrateBucket", Handler: _Msg_CancelMigrateBucket_Handler, }, + { + MethodName: "RejectMigrateBucket", + Handler: _Msg_RejectMigrateBucket_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "greenfield/storage/tx.proto", @@ -6394,6 +6524,66 @@ func (m *MsgCancelMigrateBucketResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgRejectMigrateBucket) 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 *MsgRejectMigrateBucket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRejectMigrateBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BucketName) > 0 { + i -= len(m.BucketName) + copy(dAtA[i:], m.BucketName) + i = encodeVarintTx(dAtA, i, uint64(len(m.BucketName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRejectMigrateBucketResponse) 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 *MsgRejectMigrateBucketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRejectMigrateBucketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -7345,6 +7535,32 @@ func (m *MsgCancelMigrateBucketResponse) Size() (n int) { return n } +func (m *MsgRejectMigrateBucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BucketName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRejectMigrateBucketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -13713,6 +13929,170 @@ func (m *MsgCancelMigrateBucketResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRejectMigrateBucket) 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 ErrIntOverflowTx + } + 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: MsgRejectMigrateBucket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRejectMigrateBucket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BucketName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BucketName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRejectMigrateBucketResponse) 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 ErrIntOverflowTx + } + 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: MsgRejectMigrateBucketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRejectMigrateBucketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 18eaa51871d800d86fa85aa41235fecc7a042306 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Wed, 18 Oct 2023 14:51:09 +0800 Subject: [PATCH 06/12] chore: improve the validations of messages (#484) * chore: improve the validations of messages * add runtime check * add runtime check * add upgrade name * fix review comments * refine codes * refine codes --- app/upgrade.go | 1 + e2e/tests/permission_test.go | 10 ++-- go.mod | 2 +- go.sum | 4 +- x/permission/types/types.go | 87 ++++++++++++++++++++------------- x/sp/types/message.go | 12 ++--- x/sp/types/message_test.go | 4 +- x/sp/types/util.go | 2 +- x/storage/keeper/msg_server.go | 6 --- x/storage/types/message.go | 42 ++++++++++++++-- x/virtualgroup/types/message.go | 2 +- 11 files changed, 114 insertions(+), 58 deletions(-) diff --git a/app/upgrade.go b/app/upgrade.go index 731819f8c..1bc7023e0 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -90,6 +90,7 @@ func (app *App) registerPampasUpgradeHandler() { app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Pampas, func() error { app.Logger().Info("Init Pampas upgrade") + // enable chain id for opbnb app.CrossChainKeeper.SetDestOpChainID(sdk.ChainID(app.appConfig.CrossChain.DestOpChainId)) return nil diff --git a/e2e/tests/permission_test.go b/e2e/tests/permission_test.go index 7e3dafedd..5252b61db 100644 --- a/e2e/tests/permission_test.go +++ b/e2e/tests/permission_test.go @@ -251,14 +251,18 @@ func (s *StorageTestSuite) TestCreateObjectByOthers() { s.Require().Equal(verifyPermResp.Effect, types.EFFECT_DENY) s.T().Logf("resp: %s, rep %s", verifyPermReq.String(), verifyPermResp.String()) - // Put bucket policy - statement := &types.Statement{ + // Put object policy + statement1 := &types.Statement{ Actions: []types.ActionType{types.ACTION_CREATE_OBJECT}, Effect: types.EFFECT_ALLOW, } + statement2 := &types.Statement{ + Actions: []types.ActionType{types.ACTION_UPDATE_OBJECT_INFO}, + Effect: types.EFFECT_ALLOW, + } principal := types.NewPrincipalWithAccount(user[1].GetAddr()) msgPutPolicy := storagetypes.NewMsgPutPolicy(user[0].GetAddr(), types2.NewBucketGRN(bucketName).String(), - principal, []*types.Statement{statement}, nil) + principal, []*types.Statement{statement1, statement2}, nil) s.SendTxBlock(user[0], msgPutPolicy) // verify permission diff --git a/go.mod b/go.mod index 300c95d52..41573629f 100644 --- a/go.mod +++ b/go.mod @@ -178,7 +178,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1 + github.com/cosmos/cosmos-sdk => github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index 1d11bc5b9..c8bd4ad9c 100644 --- a/go.sum +++ b/go.sum @@ -163,8 +163,6 @@ github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1 h1:Wef+0FD76aE9l3DjE4tGqeRKvEw98z1YkjJ5rHPL6G4= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231017121821-7b897e5a86e1/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= @@ -370,6 +368,8 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e h1:nHk7ex6a2iwYl/L5ZpffJSlWC81+2IVyw5q9S1dsnKU= +github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= diff --git a/x/permission/types/types.go b/x/permission/types/types.go index e9be026cd..1f187534d 100644 --- a/x/permission/types/types.go +++ b/x/permission/types/types.go @@ -5,6 +5,8 @@ import ( "time" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" gnfd "github.com/bnb-chain/greenfield/types" "github.com/bnb-chain/greenfield/types/common" @@ -35,6 +37,20 @@ var ( ACTION_TYPE_ALL: true, } + BucketAllowedActionsAfterPampas = map[ActionType]bool{ + ACTION_UPDATE_BUCKET_INFO: true, + ACTION_DELETE_BUCKET: true, + + ACTION_CREATE_OBJECT: true, + ACTION_DELETE_OBJECT: true, + ACTION_GET_OBJECT: true, + ACTION_COPY_OBJECT: true, + ACTION_EXECUTE_OBJECT: true, + ACTION_LIST_OBJECT: true, + ACTION_UPDATE_OBJECT_INFO: true, + + ACTION_TYPE_ALL: true, + } ObjectAllowedActions = map[ActionType]bool{ ACTION_UPDATE_OBJECT_INFO: true, ACTION_CREATE_OBJECT: true, @@ -167,15 +183,6 @@ func (s *Statement) ValidateBasic(resType resource.ResourceType) error { case resource.RESOURCE_TYPE_UNSPECIFIED: return ErrInvalidStatement.Wrap("Please specify the ResourceType explicitly. Not allowed set RESOURCE_TYPE_UNSPECIFIED") case resource.RESOURCE_TYPE_BUCKET: - containsCreateObject := false - for _, a := range s.Actions { - if !BucketAllowedActions[a] { - return ErrInvalidStatement.Wrapf("%s not allowed to be used on bucket.", a.String()) - } - if a == ACTION_CREATE_OBJECT { - containsCreateObject = true - } - } for _, r := range s.Resources { var grn gnfd.GRN err := grn.ParseFromString(r, true) @@ -183,10 +190,6 @@ func (s *Statement) ValidateBasic(resType resource.ResourceType) error { return ErrInvalidStatement.Wrapf("GRN parse from string failed, err: %s", err) } } - - if !containsCreateObject && s.LimitSize != nil { - return ErrInvalidStatement.Wrap("The LimitSize option can only be used with CreateObject actions at the bucket level. .") - } case resource.RESOURCE_TYPE_OBJECT: for _, a := range s.Actions { if !ObjectAllowedActions[a] { @@ -211,30 +214,48 @@ func (s *Statement) ValidateBasic(resType resource.ResourceType) error { return nil } -func (s *Statement) ValidateAfterNagqu(resType resource.ResourceType) error { - if s.Effect == EFFECT_UNSPECIFIED { - return ErrInvalidStatement.Wrap("Please specify the Effect explicitly. Not allowed set EFFECT_UNSPECIFIED") - } - switch resType { - case resource.RESOURCE_TYPE_UNSPECIFIED: - return ErrInvalidStatement.Wrap("Please specify the ResourceType explicitly. Not allowed set RESOURCE_TYPE_UNSPECIFIED") - case resource.RESOURCE_TYPE_BUCKET: - for _, r := range s.Resources { - _, err := regexp.Compile(r) - if err != nil { - return ErrInvalidStatement.Wrapf("The Resources regexp compile failed, err: %s", err) +func (s *Statement) ValidateRuntime(ctx sdk.Context, resType resource.ResourceType) error { + if ctx.IsUpgraded(upgradetypes.Nagqu) { + switch resType { + case resource.RESOURCE_TYPE_BUCKET: + for _, r := range s.Resources { + _, err := regexp.Compile(r) + if err != nil { + return ErrInvalidStatement.Wrapf("The Resources regexp compile failed, err: %s", err) + } + } + case resource.RESOURCE_TYPE_OBJECT: + if s.Resources != nil { + return ErrInvalidStatement.Wrap("The Resources option can only be used at the bucket level. ") + } + case resource.RESOURCE_TYPE_GROUP: + if s.Resources != nil { + return ErrInvalidStatement.Wrap("The Resources option can only be used at the bucket level. ") } + default: + return ErrInvalidStatement.Wrap("unknown resource type.") } - case resource.RESOURCE_TYPE_OBJECT: - if s.Resources != nil { - return ErrInvalidStatement.Wrap("The Resources option can only be used at the bucket level. ") + } + + var bucketAllowedActions map[ActionType]bool + if ctx.IsUpgraded(upgradetypes.Pampas) { + bucketAllowedActions = BucketAllowedActionsAfterPampas + } else { + bucketAllowedActions = BucketAllowedActions + } + if resType == resource.RESOURCE_TYPE_BUCKET { + containsCreateObject := false + for _, a := range s.Actions { + if !bucketAllowedActions[a] { + return ErrInvalidStatement.Wrapf("%s not allowed to be used on bucket.", a.String()) + } + if a == ACTION_CREATE_OBJECT { + containsCreateObject = true + } } - case resource.RESOURCE_TYPE_GROUP: - if s.Resources != nil { - return ErrInvalidStatement.Wrap("The Resources option can only be used at the bucket level. ") + if !containsCreateObject && s.LimitSize != nil { + return ErrInvalidStatement.Wrap("The LimitSize option can only be used with CreateObject actions at the bucket level. .") } - default: - return ErrInvalidStatement.Wrap("unknown resource type.") } return nil } diff --git a/x/sp/types/message.go b/x/sp/types/message.go index 60a5b7409..e9ae11488 100644 --- a/x/sp/types/message.go +++ b/x/sp/types/message.go @@ -105,8 +105,9 @@ func (msg *MsgCreateStorageProvider) ValidateBasic() error { if _, err := sdk.AccAddressFromHexUnsafe(msg.GcAddress); err != nil { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid gc address (%s)", err) } + //MaintenanceAddress is validated in msg server if !msg.Deposit.IsValid() || !msg.Deposit.Amount.IsPositive() { - return errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid deposit amount") + return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid deposit amount") } if msg.Description == (Description{}) { return errors.Wrap(sdkerrors.ErrInvalidRequest, "empty description") @@ -114,11 +115,10 @@ func (msg *MsgCreateStorageProvider) ValidateBasic() error { if err := validateBlsKeyAndProof(msg.BlsKey, msg.BlsProof); err != nil { return err } - err := IsValidEndpointURL(msg.Endpoint) - if err != nil { + if err := ValidateEndpointURL(msg.Endpoint); err != nil { return errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid endpoint (%s)", err) } - if msg.ReadPrice.IsNegative() || msg.StorePrice.IsNegative() { + if msg.ReadPrice.IsNil() || msg.ReadPrice.IsNegative() || msg.StorePrice.IsNil() || msg.StorePrice.IsNegative() { return errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid price") } return nil @@ -177,7 +177,7 @@ func (msg *MsgEditStorageProvider) ValidateBasic() error { } if len(msg.Endpoint) != 0 { - err = IsValidEndpointURL(msg.Endpoint) + err = ValidateEndpointURL(msg.Endpoint) if err != nil { return errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid endpoint (%s)", err) } @@ -369,7 +369,7 @@ func (msg *MsgUpdateStorageProviderStatus) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidRequest, "not allowed to update to status %s", msg.Status) } if msg.Status == STATUS_IN_MAINTENANCE && msg.Duration <= 0 { - return errors.Wrapf(sdkerrors.ErrInvalidRequest, "maintenanceDuration need to be set for %s", msg.Status) + return errors.Wrapf(sdkerrors.ErrInvalidRequest, "maintenance duration need to be set for %s", msg.Status) } return nil } diff --git a/x/sp/types/message_test.go b/x/sp/types/message_test.go index 0d71c20d9..8e67f7443 100644 --- a/x/sp/types/message_test.go +++ b/x/sp/types/message_test.go @@ -30,7 +30,7 @@ func TestMsgCreateStorageProvider_ValidateBasic(t *testing.T) { }{ {"basic", "a", "b", "c", "d", spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, blsPubKey, blsProof, coinPos, nil}, {"basic_empty", "a", "b", "c", "d", sdk.AccAddress{}, spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, blsPubKey, blsProof, coinPos, sdkerrors.ErrInvalidAddress}, - {"zero deposit", "a", "b", "c", "d", spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, blsPubKey, blsProof, coinZero, nil}, + {"zero deposit", "a", "b", "c", "d", spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, spAddr, blsPubKey, blsProof, coinZero, sdkerrors.ErrInvalidCoins}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -48,7 +48,7 @@ func TestMsgCreateStorageProvider_ValidateBasic(t *testing.T) { Endpoint: "http://127.0.0.1:9033", StorePrice: sdk.ZeroDec(), ReadPrice: sdk.ZeroDec(), - Deposit: coinPos, + Deposit: tt.deposit, } err := msg.ValidateBasic() if tt.err != nil { diff --git a/x/sp/types/util.go b/x/sp/types/util.go index 711dbbf50..956b9b104 100644 --- a/x/sp/types/util.go +++ b/x/sp/types/util.go @@ -7,7 +7,7 @@ import ( ) // Verify if input endpoint URL is valid. -func IsValidEndpointURL(endpointURL string) error { +func ValidateEndpointURL(endpointURL string) error { if endpointURL == "" { return errors.Wrap(ErrInvalidEndpointURL, "Endpoint url cannot be empty.") } diff --git a/x/storage/keeper/msg_server.go b/x/storage/keeper/msg_server.go index 929eb26c6..826963f4e 100644 --- a/x/storage/keeper/msg_server.go +++ b/x/storage/keeper/msg_server.go @@ -370,12 +370,6 @@ func (k msgServer) PutPolicy(goCtx context.Context, msg *types.MsgPutPolicy) (*t if s.ExpirationTime != nil && s.ExpirationTime.Before(ctx.BlockTime()) { return nil, permtypes.ErrPermissionExpired.Wrapf("The specified statement expiration time is less than the current block time, block time: %s", ctx.BlockTime().String()) } - if ctx.IsUpgraded(upgradetypes.Nagqu) { - err := s.ValidateAfterNagqu(grn.ResourceType()) - if err != nil { - return nil, err - } - } } policy := &permtypes.Policy{ diff --git a/x/storage/types/message.go b/x/storage/types/message.go index b6282a1ec..1ffb6c133 100644 --- a/x/storage/types/message.go +++ b/x/storage/types/message.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gogoproto/proto" grn2 "github.com/bnb-chain/greenfield/types" @@ -970,6 +971,11 @@ func (msg *MsgLeaveGroup) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } + _, err = sdk.AccAddressFromHexUnsafe(msg.GroupOwner) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid group owner (%s)", err) + } + err = s3util.CheckValidGroupName(msg.GroupName) if err != nil { return err @@ -1158,6 +1164,10 @@ func (msg *MsgPutPolicy) ValidateBasic() error { return errors.Wrapf(gnfderrors.ErrInvalidGRN, "invalid greenfield resource name (%s)", err) } + if msg.Principal == nil { + return gnfderrors.ErrInvalidPrincipal.Wrapf("principal cannot be empty") + } + if msg.Principal.Type == permtypes.PRINCIPAL_TYPE_GNFD_GROUP && grn.ResourceType() == resource.RESOURCE_TYPE_GROUP { return gnfderrors.ErrInvalidPrincipal.Wrapf("Not allow grant group's permission to another group") } @@ -1177,6 +1187,18 @@ func (msg *MsgPutPolicy) ValidateBasic() error { return nil } +func (msg *MsgPutPolicy) ValidateRuntime(ctx sdk.Context) error { + var grn grn2.GRN + _ = grn.ParseFromString(msg.Resource, true) // no error after ValidateBasic + for _, s := range msg.Statements { + err := s.ValidateRuntime(ctx, grn.ResourceType()) + if err != nil { + return err + } + } + return nil +} + func NewMsgDeletePolicy(operator sdk.AccAddress, resource string, principal *permtypes.Principal) *MsgDeletePolicy { return &MsgDeletePolicy{ Operator: operator.String(), @@ -1218,9 +1240,23 @@ func (msg *MsgDeletePolicy) ValidateBasic() error { return errors.Wrapf(gnfderrors.ErrInvalidGRN, "invalid greenfield resource name (%s)", err) } + if msg.Principal == nil { + return gnfderrors.ErrInvalidPrincipal.Wrapf("principal cannot be empty") + } + if msg.Principal.Type == permtypes.PRINCIPAL_TYPE_GNFD_GROUP && grn.ResourceType() == resource.RESOURCE_TYPE_GROUP { return gnfderrors.ErrInvalidPrincipal.Wrapf("Not allow grant group's permission to another group") } + + return nil +} + +func (msg *MsgDeletePolicy) ValidateRuntime(ctx sdk.Context) error { + if ctx.IsUpgraded(upgradetypes.Pampas) { + if err := msg.Principal.ValidateBasic(); err != nil { + return err + } + } return nil } @@ -1266,7 +1302,7 @@ func (msg *MsgMirrorBucket) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } - if msg.Id.GT(sdk.NewUint(0)) { + if !msg.Id.IsNil() && msg.Id.GT(sdk.NewUint(0)) { if msg.BucketName != "" { return errors.Wrap(gnfderrors.ErrInvalidBucketName, "Bucket name should be empty") } @@ -1324,7 +1360,7 @@ func (msg *MsgMirrorObject) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } - if msg.Id.GT(sdk.NewUint(0)) { + if !msg.Id.IsNil() && msg.Id.GT(sdk.NewUint(0)) { if msg.BucketName != "" { return errors.Wrap(gnfderrors.ErrInvalidBucketName, "Bucket name should be empty") } @@ -1389,7 +1425,7 @@ func (msg *MsgMirrorGroup) ValidateBasic() error { return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } - if msg.Id.GT(sdk.NewUint(0)) { + if !msg.Id.IsNil() && msg.Id.GT(sdk.NewUint(0)) { if msg.GroupName != "" { return errors.Wrap(gnfderrors.ErrInvalidGroupName, "Group name should be empty") } diff --git a/x/virtualgroup/types/message.go b/x/virtualgroup/types/message.go index 8bc75b594..d56114c3b 100644 --- a/x/virtualgroup/types/message.go +++ b/x/virtualgroup/types/message.go @@ -192,7 +192,7 @@ func (msg *MsgWithdraw) ValidateBasic() error { } if !msg.Withdraw.IsValid() || !msg.Withdraw.Amount.IsPositive() { - return errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid or non-positive deposit amount") + return errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid or non-positive withdraw amount") } return nil } From ccc5951ffaca6511a2870a5b953a94f3f8f7db94 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Wed, 18 Oct 2023 15:51:45 +0800 Subject: [PATCH 07/12] chore: update cosmos-sdk version (#508) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 41573629f..199ac8b59 100644 --- a/go.mod +++ b/go.mod @@ -178,7 +178,7 @@ replace ( github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index c8bd4ad9c..7902a91fc 100644 --- a/go.sum +++ b/go.sum @@ -163,6 +163,8 @@ github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16 h1:RUkJEmOOOAxE7lsAXFcn0yJ7fydVP5qJbe+70WejCUs= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= @@ -368,8 +370,6 @@ github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e h1:nHk7ex6a2iwYl/L5ZpffJSlWC81+2IVyw5q9S1dsnKU= -github.com/forcodedancing/greenfield-cosmos-sdk v0.2.1-0.20231016120649-fcdced9e012e/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= From 3819c93a266066fe89a81e94cb7944ffab4746c6 Mon Sep 17 00:00:00 2001 From: Roshan <48975233+Pythonberg1997@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:22:53 +0800 Subject: [PATCH 08/12] fix: make `handleCreateBucketSynPackage` forward compatible (#509) * fix: make `handleCreateBucketSynPackage` forward compatible * add annotation * fix lint issues --- x/storage/keeper/cross_app_bucket.go | 94 ++++++++- x/storage/types/crosschain.go | 302 ++++++++++++++++++++++----- 2 files changed, 336 insertions(+), 60 deletions(-) diff --git a/x/storage/keeper/cross_app_bucket.go b/x/storage/keeper/cross_app_bucket.go index 6fd06f9ac..b2f510924 100644 --- a/x/storage/keeper/cross_app_bucket.go +++ b/x/storage/keeper/cross_app_bucket.go @@ -4,10 +4,12 @@ import ( "encoding/hex" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bnb-chain/greenfield/types/common" "github.com/bnb-chain/greenfield/x/storage/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) var _ sdk.CrossChainApplication = &BucketApp{} @@ -57,7 +59,13 @@ func (app *BucketApp) ExecuteAckPackage(ctx sdk.Context, appCtx *sdk.CrossChainA } func (app *BucketApp) ExecuteFailAckPackage(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, payload []byte) sdk.ExecuteResult { - pack, err := types.DeserializeCrossChainPackage(payload, types.BucketChannelId, sdk.FailAckCrossChainPackageType) + var pack interface{} + var err error + if ctx.IsUpgraded(upgradetypes.Pampas) { + pack, err = types.DeserializeCrossChainPackageV2(payload, types.BucketChannelId, sdk.FailAckCrossChainPackageType) + } else { + pack, err = types.DeserializeCrossChainPackage(payload, types.BucketChannelId, sdk.FailAckCrossChainPackageType) + } if err != nil { app.storageKeeper.Logger(ctx).Error("deserialize bucket cross chain package error", "payload", hex.EncodeToString(payload), "error", err.Error()) panic("deserialize bucket cross chain package error") @@ -72,6 +80,9 @@ func (app *BucketApp) ExecuteFailAckPackage(ctx sdk.Context, appCtx *sdk.CrossCh case *types.CreateBucketSynPackage: operationType = types.OperationCreateBucket result = app.handleCreateBucketFailAckPackage(ctx, appCtx, p) + case *types.CreateBucketSynPackageV2: + operationType = types.OperationCreateBucket + result = app.handleCreateBucketFailAckPackageV2(ctx, appCtx, p) case *types.DeleteBucketSynPackage: operationType = types.OperationDeleteBucket result = app.handleDeleteBucketFailAckPackage(ctx, appCtx, p) @@ -91,7 +102,13 @@ func (app *BucketApp) ExecuteFailAckPackage(ctx sdk.Context, appCtx *sdk.CrossCh } func (app *BucketApp) ExecuteSynPackage(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, payload []byte) sdk.ExecuteResult { - pack, err := types.DeserializeCrossChainPackage(payload, types.BucketChannelId, sdk.SynCrossChainPackageType) + var pack interface{} + var err error + if ctx.IsUpgraded(upgradetypes.Pampas) { + pack, err = types.DeserializeCrossChainPackageV2(payload, types.BucketChannelId, sdk.FailAckCrossChainPackageType) + } else { + pack, err = types.DeserializeCrossChainPackage(payload, types.BucketChannelId, sdk.FailAckCrossChainPackageType) + } if err != nil { app.storageKeeper.Logger(ctx).Error("deserialize bucket cross chain package error", "payload", hex.EncodeToString(payload), "error", err.Error()) panic("deserialize bucket cross chain package error") @@ -106,6 +123,9 @@ func (app *BucketApp) ExecuteSynPackage(ctx sdk.Context, appCtx *sdk.CrossChainA case *types.CreateBucketSynPackage: operationType = types.OperationCreateBucket result = app.handleCreateBucketSynPackage(ctx, appCtx, p) + case *types.CreateBucketSynPackageV2: + operationType = types.OperationCreateBucket + result = app.handleCreateBucketSynPackageV2(ctx, appCtx, p) case *types.DeleteBucketSynPackage: operationType = types.OperationDeleteBucket result = app.handleDeleteBucketSynPackage(ctx, appCtx, p) @@ -204,6 +224,12 @@ func (app *BucketApp) handleCreateBucketFailAckPackage(ctx sdk.Context, appCtx * return sdk.ExecuteResult{} } +func (app *BucketApp) handleCreateBucketFailAckPackageV2(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, synPackage *types.CreateBucketSynPackageV2) sdk.ExecuteResult { + app.storageKeeper.Logger(ctx).Error("received create bucket fail ack package ") + + return sdk.ExecuteResult{} +} + func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, createBucketPackage *types.CreateBucketSynPackage) sdk.ExecuteResult { err := createBucketPackage.ValidateBasic() if err != nil { @@ -235,9 +261,8 @@ func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk. ChargedReadQuota: createBucketPackage.ChargedReadQuota, PaymentAddress: createBucketPackage.PaymentAddress.String(), PrimarySpApproval: &common.Approval{ - ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight, - GlobalVirtualGroupFamilyId: createBucketPackage.GlobalVirtualGroupFamilyId, - Sig: createBucketPackage.PrimarySpApprovalSignature, + ExpiredHeight: createBucketPackage.PrimarySpApprovalExpiredHeight, + Sig: createBucketPackage.PrimarySpApprovalSignature, }, ApprovalMsgBytes: createBucketPackage.GetApprovalBytes(), }, @@ -263,6 +288,65 @@ func (app *BucketApp) handleCreateBucketSynPackage(ctx sdk.Context, appCtx *sdk. } } +func (app *BucketApp) handleCreateBucketSynPackageV2(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, createBucketPackageV2 *types.CreateBucketSynPackageV2) sdk.ExecuteResult { + err := createBucketPackageV2.ValidateBasic() + if err != nil { + return sdk.ExecuteResult{ + Payload: types.CreateBucketAckPackage{ + Status: types.StatusFail, + Creator: createBucketPackageV2.Creator, + ExtraData: createBucketPackageV2.ExtraData, + }.MustSerialize(), + Err: err, + } + } + app.storageKeeper.Logger(ctx).Info("process create bucket syn package v2", "bucket name", createBucketPackageV2.BucketName) + + sourceType, err := app.storageKeeper.GetSourceTypeByChainId(ctx, appCtx.SrcChainId) + if err != nil { + return sdk.ExecuteResult{ + Err: err, + } + } + + bucketId, err := app.storageKeeper.CreateBucket(ctx, + createBucketPackageV2.Creator, + createBucketPackageV2.BucketName, + createBucketPackageV2.PrimarySpAddress, + &types.CreateBucketOptions{ + Visibility: types.VisibilityType(createBucketPackageV2.Visibility), + SourceType: sourceType, + ChargedReadQuota: createBucketPackageV2.ChargedReadQuota, + PaymentAddress: createBucketPackageV2.PaymentAddress.String(), + PrimarySpApproval: &common.Approval{ + ExpiredHeight: createBucketPackageV2.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: createBucketPackageV2.GlobalVirtualGroupFamilyId, + Sig: createBucketPackageV2.PrimarySpApprovalSignature, + }, + ApprovalMsgBytes: createBucketPackageV2.GetApprovalBytes(), + }, + ) + if err != nil { + return sdk.ExecuteResult{ + Payload: types.CreateBucketAckPackage{ + Status: types.StatusFail, + Creator: createBucketPackageV2.Creator, + ExtraData: createBucketPackageV2.ExtraData, + }.MustSerialize(), + Err: err, + } + } + + return sdk.ExecuteResult{ + Payload: types.CreateBucketAckPackage{ + Status: types.StatusSuccess, + Id: bucketId.BigInt(), + Creator: createBucketPackageV2.Creator, + ExtraData: createBucketPackageV2.ExtraData, + }.MustSerialize(), + } +} + func (app *BucketApp) handleDeleteBucketAckPackage(ctx sdk.Context, appCtx *sdk.CrossChainAppContext, ackPackage *types.DeleteBucketAckPackage) sdk.ExecuteResult { app.storageKeeper.Logger(ctx).Error("received delete bucket ack package ") diff --git a/x/storage/types/crosschain.go b/x/storage/types/crosschain.go index 852051887..d36d7473f 100644 --- a/x/storage/types/crosschain.go +++ b/x/storage/types/crosschain.go @@ -68,59 +68,116 @@ func DeserializeRawCrossChainPackage(serializedPackage []byte) (*CrossChainPacka type DeserializeFunc func(serializedPackage []byte) (interface{}, error) -var DeserializeFuncMap = map[sdk.ChannelID]map[uint8][3]DeserializeFunc{ - BucketChannelId: { - OperationMirrorBucket: { - DeserializeMirrorBucketSynPackage, - DeserializeMirrorBucketAckPackage, - DeserializeMirrorBucketSynPackage, - }, - OperationCreateBucket: { - DeserializeCreateBucketSynPackage, - DeserializeCreateBucketAckPackage, - DeserializeCreateBucketSynPackage, - }, - OperationDeleteBucket: { - DeserializeDeleteBucketSynPackage, - DeserializeDeleteBucketAckPackage, - DeserializeDeleteBucketSynPackage, - }, - }, - ObjectChannelId: { - OperationMirrorObject: { - DeserializeMirrorObjectSynPackage, - DeserializeMirrorObjectAckPackage, - DeserializeMirrorObjectSynPackage, +var ( + DeserializeFuncMap = map[sdk.ChannelID]map[uint8][3]DeserializeFunc{ + BucketChannelId: { + OperationMirrorBucket: { + DeserializeMirrorBucketSynPackage, + DeserializeMirrorBucketAckPackage, + DeserializeMirrorBucketSynPackage, + }, + OperationCreateBucket: { + DeserializeCreateBucketSynPackage, + DeserializeCreateBucketAckPackage, + DeserializeCreateBucketSynPackage, + }, + OperationDeleteBucket: { + DeserializeDeleteBucketSynPackage, + DeserializeDeleteBucketAckPackage, + DeserializeDeleteBucketSynPackage, + }, }, - OperationDeleteObject: { - DeserializeDeleteObjectSynPackage, - DeserializeDeleteObjectAckPackage, - DeserializeDeleteObjectSynPackage, + ObjectChannelId: { + OperationMirrorObject: { + DeserializeMirrorObjectSynPackage, + DeserializeMirrorObjectAckPackage, + DeserializeMirrorObjectSynPackage, + }, + OperationDeleteObject: { + DeserializeDeleteObjectSynPackage, + DeserializeDeleteObjectAckPackage, + DeserializeDeleteObjectSynPackage, + }, }, - }, - GroupChannelId: { - OperationMirrorGroup: { - DeserializeMirrorGroupSynPackage, - DeserializeMirrorGroupAckPackage, - DeserializeMirrorGroupSynPackage, + GroupChannelId: { + OperationMirrorGroup: { + DeserializeMirrorGroupSynPackage, + DeserializeMirrorGroupAckPackage, + DeserializeMirrorGroupSynPackage, + }, + OperationCreateGroup: { + DeserializeCreateGroupSynPackage, + DeserializeCreateGroupAckPackage, + DeserializeCreateGroupSynPackage, + }, + OperationDeleteGroup: { + DeserializeDeleteGroupSynPackage, + DeserializeDeleteGroupAckPackage, + DeserializeDeleteGroupSynPackage, + }, + OperationUpdateGroupMember: { + DeserializeUpdateGroupMemberSynPackage, + DeserializeUpdateGroupMemberAckPackage, + DeserializeUpdateGroupMemberSynPackage, + }, }, - OperationCreateGroup: { - DeserializeCreateGroupSynPackage, - DeserializeCreateGroupAckPackage, - DeserializeCreateGroupSynPackage, + } + + // DeserializeFuncMapV2 used after Pampas upgrade + DeserializeFuncMapV2 = map[sdk.ChannelID]map[uint8][3]DeserializeFunc{ + BucketChannelId: { + OperationMirrorBucket: { + DeserializeMirrorBucketSynPackage, + DeserializeMirrorBucketAckPackage, + DeserializeMirrorBucketSynPackage, + }, + OperationCreateBucket: { + DeserializeCreateBucketSynPackageV2, + DeserializeCreateBucketAckPackage, + DeserializeCreateBucketSynPackageV2, + }, + OperationDeleteBucket: { + DeserializeDeleteBucketSynPackage, + DeserializeDeleteBucketAckPackage, + DeserializeDeleteBucketSynPackage, + }, }, - OperationDeleteGroup: { - DeserializeDeleteGroupSynPackage, - DeserializeDeleteGroupAckPackage, - DeserializeDeleteGroupSynPackage, + ObjectChannelId: { + OperationMirrorObject: { + DeserializeMirrorObjectSynPackage, + DeserializeMirrorObjectAckPackage, + DeserializeMirrorObjectSynPackage, + }, + OperationDeleteObject: { + DeserializeDeleteObjectSynPackage, + DeserializeDeleteObjectAckPackage, + DeserializeDeleteObjectSynPackage, + }, }, - OperationUpdateGroupMember: { - DeserializeUpdateGroupMemberSynPackage, - DeserializeUpdateGroupMemberAckPackage, - DeserializeUpdateGroupMemberSynPackage, + GroupChannelId: { + OperationMirrorGroup: { + DeserializeMirrorGroupSynPackage, + DeserializeMirrorGroupAckPackage, + DeserializeMirrorGroupSynPackage, + }, + OperationCreateGroup: { + DeserializeCreateGroupSynPackage, + DeserializeCreateGroupAckPackage, + DeserializeCreateGroupSynPackage, + }, + OperationDeleteGroup: { + DeserializeDeleteGroupSynPackage, + DeserializeDeleteGroupAckPackage, + DeserializeDeleteGroupSynPackage, + }, + OperationUpdateGroupMember: { + DeserializeUpdateGroupMemberSynPackage, + DeserializeUpdateGroupMemberAckPackage, + DeserializeUpdateGroupMemberSynPackage, + }, }, - }, -} + } +) func DeserializeCrossChainPackage(rawPack []byte, channelId sdk.ChannelID, packageType sdk.CrossChainPackageType) (interface{}, error) { if packageType >= 3 { @@ -140,6 +197,24 @@ func DeserializeCrossChainPackage(rawPack []byte, channelId sdk.ChannelID, packa return operationMap[packageType](pack.Package) } +func DeserializeCrossChainPackageV2(rawPack []byte, channelId sdk.ChannelID, packageType sdk.CrossChainPackageType) (interface{}, error) { + if packageType >= 3 { + return nil, ErrInvalidCrossChainPackage + } + + pack, err := DeserializeRawCrossChainPackage(rawPack) + if err != nil { + return nil, err + } + + operationMap, ok := DeserializeFuncMapV2[channelId][pack.OperationType] + if !ok { + return nil, ErrInvalidCrossChainPackage + } + + return operationMap[packageType](pack.Package) +} + const ( StatusSuccess = 0 StatusFail = 1 @@ -341,6 +416,18 @@ func DeserializeMirrorGroupAckPackage(serializedPackage []byte) (interface{}, er } type CreateBucketSynPackage struct { + Creator sdk.AccAddress + BucketName string + Visibility uint32 + PaymentAddress sdk.AccAddress + PrimarySpAddress sdk.AccAddress + PrimarySpApprovalExpiredHeight uint64 + PrimarySpApprovalSignature []byte + ChargedReadQuota uint64 + ExtraData []byte +} + +type CreateBucketSynPackageV2 struct { Creator sdk.AccAddress BucketName string Visibility uint32 @@ -354,6 +441,18 @@ type CreateBucketSynPackage struct { } type CreateBucketSynPackageStruct struct { + Creator common.Address + BucketName string + Visibility uint32 + PaymentAddress common.Address + PrimarySpAddress common.Address + PrimarySpApprovalExpiredHeight uint64 + PrimarySpApprovalSignature []byte + ChargedReadQuota uint64 + ExtraData []byte +} + +type CreateBucketSynPackageV2Struct struct { Creator common.Address BucketName string Visibility uint32 @@ -374,7 +473,6 @@ var ( {Name: "PaymentAddress", Type: "address"}, {Name: "PrimarySpAddress", Type: "address"}, {Name: "PrimarySpApprovalExpiredHeight", Type: "uint64"}, - {Name: "GlobalVirtualGroupFamilyId", Type: "uint32"}, {Name: "PrimarySpApprovalSignature", Type: "bytes"}, {Name: "ChargedReadQuota", Type: "uint64"}, {Name: "ExtraData", Type: "bytes"}, @@ -383,6 +481,23 @@ var ( createBucketSynPackageStructArgs = abi.Arguments{ {Type: createBucketSynPackageStructType}, } + + createBucketSynPackageV2StructType, _ = abi.NewType("tuple", "", []abi.ArgumentMarshaling{ + {Name: "Creator", Type: "address"}, + {Name: "BucketName", Type: "string"}, + {Name: "Visibility", Type: "uint32"}, + {Name: "PaymentAddress", Type: "address"}, + {Name: "PrimarySpAddress", Type: "address"}, + {Name: "PrimarySpApprovalExpiredHeight", Type: "uint64"}, + {Name: "GlobalVirtualGroupFamilyId", Type: "uint32"}, + {Name: "PrimarySpApprovalSignature", Type: "bytes"}, + {Name: "ChargedReadQuota", Type: "uint64"}, + {Name: "ExtraData", Type: "bytes"}, + }) + + createBucketSynPackageV2StructArgs = abi.Arguments{ + {Type: createBucketSynPackageV2StructType}, + } ) func (p CreateBucketSynPackage) MustSerialize() []byte { @@ -393,7 +508,6 @@ func (p CreateBucketSynPackage) MustSerialize() []byte { PaymentAddress: common.BytesToAddress(p.PaymentAddress), PrimarySpAddress: common.BytesToAddress(p.PrimarySpAddress), PrimarySpApprovalExpiredHeight: p.PrimarySpApprovalExpiredHeight, - GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, PrimarySpApprovalSignature: p.PrimarySpApprovalSignature, ChargedReadQuota: p.ChargedReadQuota, ExtraData: p.ExtraData, @@ -412,9 +526,8 @@ func (p CreateBucketSynPackage) ValidateBasic() error { PaymentAddress: p.PaymentAddress.String(), PrimarySpAddress: p.PrimarySpAddress.String(), PrimarySpApproval: &gnfdcommon.Approval{ - ExpiredHeight: p.PrimarySpApprovalExpiredHeight, - GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, - Sig: p.PrimarySpApprovalSignature, + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + Sig: p.PrimarySpApprovalSignature, }, ChargedReadQuota: p.ChargedReadQuota, } @@ -430,9 +543,8 @@ func (p CreateBucketSynPackage) GetApprovalBytes() []byte { PaymentAddress: p.PaymentAddress.String(), PrimarySpAddress: p.PrimarySpAddress.String(), PrimarySpApproval: &gnfdcommon.Approval{ - ExpiredHeight: p.PrimarySpApprovalExpiredHeight, - GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, - Sig: p.PrimarySpApprovalSignature, + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + Sig: p.PrimarySpApprovalSignature, }, ChargedReadQuota: p.ChargedReadQuota, } @@ -452,6 +564,86 @@ func DeserializeCreateBucketSynPackage(serializedPackage []byte) (interface{}, e } tp := CreateBucketSynPackage{ + pkgStruct.Creator.Bytes(), + pkgStruct.BucketName, + pkgStruct.Visibility, + pkgStruct.PaymentAddress.Bytes(), + pkgStruct.PrimarySpAddress.Bytes(), + pkgStruct.PrimarySpApprovalExpiredHeight, + pkgStruct.PrimarySpApprovalSignature, + pkgStruct.ChargedReadQuota, + pkgStruct.ExtraData, + } + return &tp, nil +} + +func (p CreateBucketSynPackageV2) MustSerialize() []byte { + encodedBytes, err := createBucketSynPackageStructArgs.Pack(&CreateBucketSynPackageV2Struct{ + Creator: common.BytesToAddress(p.Creator), + BucketName: p.BucketName, + Visibility: p.Visibility, + PaymentAddress: common.BytesToAddress(p.PaymentAddress), + PrimarySpAddress: common.BytesToAddress(p.PrimarySpAddress), + PrimarySpApprovalExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, + PrimarySpApprovalSignature: p.PrimarySpApprovalSignature, + ChargedReadQuota: p.ChargedReadQuota, + ExtraData: p.ExtraData, + }) + if err != nil { + panic("encode create bucket syn package v2 error") + } + return encodedBytes +} + +func (p CreateBucketSynPackageV2) ValidateBasic() error { + msg := MsgCreateBucket{ + Creator: p.Creator.String(), + BucketName: p.BucketName, + Visibility: VisibilityType(p.Visibility), + PaymentAddress: p.PaymentAddress.String(), + PrimarySpAddress: p.PrimarySpAddress.String(), + PrimarySpApproval: &gnfdcommon.Approval{ + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, + Sig: p.PrimarySpApprovalSignature, + }, + ChargedReadQuota: p.ChargedReadQuota, + } + + return msg.ValidateBasic() +} + +func (p CreateBucketSynPackageV2) GetApprovalBytes() []byte { + msg := MsgCreateBucket{ + Creator: p.Creator.String(), + BucketName: p.BucketName, + Visibility: VisibilityType(p.Visibility), + PaymentAddress: p.PaymentAddress.String(), + PrimarySpAddress: p.PrimarySpAddress.String(), + PrimarySpApproval: &gnfdcommon.Approval{ + ExpiredHeight: p.PrimarySpApprovalExpiredHeight, + GlobalVirtualGroupFamilyId: p.GlobalVirtualGroupFamilyId, + Sig: p.PrimarySpApprovalSignature, + }, + ChargedReadQuota: p.ChargedReadQuota, + } + return msg.GetApprovalBytes() +} + +func DeserializeCreateBucketSynPackageV2(serializedPackage []byte) (interface{}, error) { + unpacked, err := createBucketSynPackageV2StructArgs.Unpack(serializedPackage) + if err != nil { + return nil, errors.Wrapf(ErrInvalidCrossChainPackage, "deserialize create bucket syn package v2 failed") + } + + unpackedStruct := abi.ConvertType(unpacked[0], CreateBucketSynPackageV2Struct{}) + pkgStruct, ok := unpackedStruct.(CreateBucketSynPackageV2Struct) + if !ok { + return nil, errors.Wrapf(ErrInvalidCrossChainPackage, "reflect create bucket syn package v2 failed") + } + + tp := CreateBucketSynPackageV2{ pkgStruct.Creator.Bytes(), pkgStruct.BucketName, pkgStruct.Visibility, From 7fd71229ae39d12ee3dc916bd4f8b82ba2577813 Mon Sep 17 00:00:00 2001 From: Alexxxxxx <118710506+alexgao001@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:07:30 +0800 Subject: [PATCH 09/12] fix: policy key is not GC while a expired policy is GC (#511) * fix policy key is not GC when a policy expiration time comes * fix policy key is not GC when a policy expiration time comes * add group policy case * add test * fix test --- e2e/tests/permission_test.go | 123 ++++++++++++++++++++++++++++++++++ x/permission/keeper/keeper.go | 34 +++++++++- 2 files changed, 156 insertions(+), 1 deletion(-) diff --git a/e2e/tests/permission_test.go b/e2e/tests/permission_test.go index 5252b61db..699d4f1b8 100644 --- a/e2e/tests/permission_test.go +++ b/e2e/tests/permission_test.go @@ -1910,3 +1910,126 @@ func (s *StorageTestSuite) TestGrantsPermissionToObjectWithWildcardInName() { _, err := s.Client.HeadObject(context.Background(), &storagetypes.QueryHeadObjectRequest{BucketName: bucketName, ObjectName: objectName}) s.Require().True(strings.Contains(err.Error(), "No such object")) } + +func (s *StorageTestSuite) TestExpiredAccountPolicyGCAndRePut() { + var err error + ctx := context.Background() + user1 := s.GenAndChargeAccounts(1, 1000000)[0] + + _, owner, bucketName, bucketId, _, _ := s.createObjectWithVisibility(storagetypes.VISIBILITY_TYPE_PUBLIC_READ) + + principal := types.NewPrincipalWithAccount(user1.GetAddr()) + + // Put bucket policy + bucketStatement := &types.Statement{ + Actions: []types.ActionType{types.ACTION_DELETE_BUCKET}, + Effect: types.EFFECT_ALLOW, + } + expirationTime := time.Now().Add(5 * time.Second) + + msgPutBucketPolicy := storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), + principal, []*types.Statement{bucketStatement}, &expirationTime) + s.SendTxBlock(owner, msgPutBucketPolicy) + + // Query the policy which is enforced on bucket + grn1 := types2.NewBucketGRN(bucketName) + queryPolicyForAccountResp, err := s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{ + Resource: grn1.String(), + PrincipalAddress: user1.GetAddr().String(), + }) + s.Require().NoError(err) + s.Require().Equal(bucketId, queryPolicyForAccountResp.Policy.ResourceId) + + // wait for policy expired + time.Sleep(5 * time.Second) + + // query the policy, which is already GC, should get err. + _, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{ + Resource: grn1.String(), + PrincipalAddress: user1.GetAddr().String(), + }) + s.Require().Error(err) + + // the user should be able to re-put policy for the bucket. + msgPutBucketPolicy = storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), + principal, []*types.Statement{bucketStatement}, nil) + s.SendTxBlock(owner, msgPutBucketPolicy) + + // Query the policy which is enforced on bucket. + queryPolicyForAccountResp, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{ + Resource: grn1.String(), + PrincipalAddress: user1.GetAddr().String(), + }) + s.Require().NoError(err) + s.Require().Equal(bucketId, queryPolicyForAccountResp.Policy.ResourceId) +} + +func (s *StorageTestSuite) TestExpiredGroupPolicyGCAndRePut() { + ctx := context.Background() + user := s.GenAndChargeAccounts(3, 10000) + _, owner, bucketName, bucketId, _, _ := s.createObjectWithVisibility(storagetypes.VISIBILITY_TYPE_PUBLIC_READ) + + // Create Group + testGroupName := "testGroup" + msgCreateGroup := storagetypes.NewMsgCreateGroup(owner.GetAddr(), testGroupName, "") + s.SendTxBlock(owner, msgCreateGroup) + membersToAdd := []*storagetypes.MsgGroupMember{ + {Member: user[1].GetAddr().String()}, + } + membersToDelete := []sdk.AccAddress{} + msgUpdateGroupMember := storagetypes.NewMsgUpdateGroupMember(owner.GetAddr(), owner.GetAddr(), testGroupName, membersToAdd, membersToDelete) + s.SendTxBlock(owner, msgUpdateGroupMember) + + // Head Group + headGroupRequest := storagetypes.QueryHeadGroupRequest{GroupOwner: owner.GetAddr().String(), GroupName: testGroupName} + headGroupResponse, err := s.Client.HeadGroup(ctx, &headGroupRequest) + s.Require().NoError(err) + s.Require().Equal(headGroupResponse.GroupInfo.GroupName, testGroupName) + s.Require().True(owner.GetAddr().Equals(sdk.MustAccAddressFromHex(headGroupResponse.GroupInfo.Owner))) + s.T().Logf("GroupInfo: %s", headGroupResponse.GetGroupInfo().String()) + + principal := types.NewPrincipalWithGroupId(headGroupResponse.GroupInfo.Id) + // Put bucket policy for group + expirationTime := time.Now().Add(5 * time.Second) + + bucketStatement := &types.Statement{ + Actions: []types.ActionType{types.ACTION_DELETE_BUCKET}, + Effect: types.EFFECT_ALLOW, + } + msgPutBucketPolicy := storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), + principal, []*types.Statement{bucketStatement}, &expirationTime) + s.SendTxBlock(owner, msgPutBucketPolicy) + + // Query bucket policy for group + grn := types2.NewBucketGRN(bucketName) + queryPolicyForGroupReq := storagetypes.QueryPolicyForGroupRequest{ + Resource: grn.String(), + PrincipalGroupId: headGroupResponse.GroupInfo.Id.String(), + } + + queryPolicyForGroupResp, err := s.Client.QueryPolicyForGroup(ctx, &queryPolicyForGroupReq) + s.Require().NoError(err) + s.Require().Equal(bucketId, queryPolicyForGroupResp.Policy.ResourceId) + s.Require().Equal(queryPolicyForGroupResp.Policy.ResourceType, resource.RESOURCE_TYPE_BUCKET) + s.Require().Equal(types.EFFECT_ALLOW, queryPolicyForGroupResp.Policy.Statements[0].Effect) + bucketPolicyId := queryPolicyForGroupResp.Policy.Id + + // wait for policy expired + time.Sleep(5 * time.Second) + + // policy is GC + _, err = s.Client.QueryPolicyById(ctx, &storagetypes.QueryPolicyByIdRequest{PolicyId: bucketPolicyId.String()}) + s.Require().Error(err) + s.Require().ErrorContains(err, "No such Policy") + + // the user should be able to re-put policy for the bucket. + msgPutBucketPolicy = storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), + principal, []*types.Statement{bucketStatement}, nil) + s.SendTxBlock(owner, msgPutBucketPolicy) + + queryPolicyForGroupResp, err = s.Client.QueryPolicyForGroup(ctx, &queryPolicyForGroupReq) + s.Require().NoError(err) + s.Require().Equal(bucketId, queryPolicyForGroupResp.Policy.ResourceId) + s.Require().Equal(queryPolicyForGroupResp.Policy.ResourceType, resource.RESOURCE_TYPE_BUCKET) + s.Require().Equal(types.EFFECT_ALLOW, queryPolicyForGroupResp.Policy.Statements[0].Effect) +} diff --git a/x/permission/keeper/keeper.go b/x/permission/keeper/keeper.go index dc1f618d5..3c105514a 100644 --- a/x/permission/keeper/keeper.go +++ b/x/permission/keeper/keeper.go @@ -531,10 +531,42 @@ func (k Keeper) RemoveExpiredPolicies(ctx sdk.Context) { } store.Delete(iterator.Key()) + // delete policyId -> policy policyId := types.ParsePolicyIdFromQueueKey(iterator.Key()) + var policy types.Policy + k.cdc.MustUnmarshal(store.Get(types.GetPolicyByIDKey(policyId)), &policy) + store.Delete(types.GetPolicyByIDKey(policyId)) ctx.EventManager().EmitTypedEvents(&types.EventDeletePolicy{PolicyId: policyId}) //nolint: errcheck - count++ + + //1. the policy is an account policy, delete policyKey -> policyId. + //2. the policy is group policy within a policy group, delete the index in the policy group + if ctx.IsUpgraded(upgradetypes.Pampas) { + if policy.Principal.Type == types.PRINCIPAL_TYPE_GNFD_ACCOUNT { + policyKey := types.GetPolicyForAccountKey(policy.ResourceId, policy.ResourceType, + policy.Principal.MustGetAccountAddress()) + store.Delete(policyKey) + } else if policy.Principal.Type == types.PRINCIPAL_TYPE_GNFD_GROUP { + policyGroupKey := types.GetPolicyForGroupKey(policy.ResourceId, policy.ResourceType) + bz := store.Get(policyGroupKey) + if bz != nil { + policyGroup := types.PolicyGroup{} + k.cdc.MustUnmarshal(bz, &policyGroup) + for i := 0; i < len(policyGroup.Items); i++ { + if policyGroup.Items[i].PolicyId.Equal(policyId) { + policyGroup.Items = append(policyGroup.Items[:i], policyGroup.Items[i+1:]...) + break + } + } + if len(policyGroup.Items) == 0 { + // delete the key if no item left + store.Delete(policyGroupKey) + } else { + store.Set(policyGroupKey, k.cdc.MustMarshal(&policyGroup)) + } + } + } + } } } From cbf9ea67ff71d65b43d80937ea3aebfb90b67cd8 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 30 Oct 2023 17:36:16 +0800 Subject: [PATCH 10/12] chore: allow anyone to trigger the settlement of GVG/GVG family (#512) * chore: allow anyone to trigger the settlemnt of GVG/GVG family * revert message field name change --- e2e/tests/payment_test.go | 17 +++-------- e2e/tests/virtualgroup_test.go | 34 ++++++---------------- proto/greenfield/virtualgroup/tx.proto | 3 +- x/virtualgroup/client/cli/tx.go | 13 +++++---- x/virtualgroup/keeper/msg_server.go | 40 +++++++++++++++++--------- x/virtualgroup/types/message.go | 6 ++-- x/virtualgroup/types/tx.pb.go | 3 +- 7 files changed, 54 insertions(+), 62 deletions(-) diff --git a/e2e/tests/payment_test.go b/e2e/tests/payment_test.go index 74b858f44..914026688 100644 --- a/e2e/tests/payment_test.go +++ b/e2e/tests/payment_test.go @@ -1147,27 +1147,18 @@ func (s *PaymentTestSuite) TestVirtualGroup_Settle() { // settle gvg family msgSettle := virtualgrouptypes.MsgSettle{ - StorageProvider: sp.FundingKey.GetAddr().String(), + StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: family.Id, } - s.SendTxBlock(sp.FundingKey, &msgSettle) + s.SendTxBlock(user, &msgSettle) // settle gvg - var secondarySp *core.StorageProvider - for _, sp := range s.StorageProviders { - for _, id := range gvg.SecondarySpIds { - if sp.Info.Id == id { - secondarySp = sp - break - } - } - } msgSettle = virtualgrouptypes.MsgSettle{ - StorageProvider: secondarySp.FundingKey.GetAddr().String(), + StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: 0, GlobalVirtualGroupIds: []uint32{gvg.Id}, } - s.SendTxBlock(secondarySp.FundingKey, &msgSettle) + s.SendTxBlock(user, &msgSettle) // assertions - balance has been checked in other tests in virtual group streamRecordsAfter := s.getStreamRecords(streamAddresses) diff --git a/e2e/tests/virtualgroup_test.go b/e2e/tests/virtualgroup_test.go index 37e2abd0a..1d9632177 100644 --- a/e2e/tests/virtualgroup_test.go +++ b/e2e/tests/virtualgroup_test.go @@ -175,6 +175,8 @@ func (s *VirtualGroupTestSuite) TestBasic() { } func (s *VirtualGroupTestSuite) TestSettle() { + user := s.GenAndChargeAccounts(1, 1000000)[0] + _, _, primarySp, secondarySps, gvgFamilyId, gvgId := s.createObject() s.T().Log("gvg family", gvgFamilyId, "gvg", gvgId) @@ -197,12 +199,10 @@ func (s *VirtualGroupTestSuite) TestSettle() { secondarySpIds[id] = struct{}{} } - var lastSecondarySp *core.StorageProvider secondarySpAddrs := make([]string, 0) for _, secondarySp := range secondarySps { if _, ok := secondarySpIds[secondarySp.Info.Id]; ok { secondarySpAddrs = append(secondarySpAddrs, secondarySp.FundingKey.GetAddr().String()) - lastSecondarySp = secondarySp } } @@ -224,17 +224,10 @@ func (s *VirtualGroupTestSuite) TestSettle() { // settle gvg family msgSettle := virtualgroupmoduletypes.MsgSettle{ - StorageProvider: primarySp.FundingKey.GetAddr().String(), + StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: gvgFamily.Id, } - - simulateRes := s.SimulateTx(&msgSettle, primarySp.FundingKey) - gasLimit := simulateRes.GasInfo.GetGasUsed() - gasPrice, _ := sdk.ParseCoinNormalized(simulateRes.GasInfo.GetMinGasPrice()) - feeAmount := gasPrice.Amount.Mul(sdk.NewInt(int64(gasLimit))) - s.T().Logf("fee amount: %s", feeAmount.String()) - - s.SendTxBlock(primarySp.FundingKey, &msgSettle) + s.SendTxBlock(user, &msgSettle) primaryBalanceAfter, err := s.Client.BankQueryClient.Balance(context.Background(), &types2.QueryBalanceRequest{ Denom: s.Config.Denom, Address: primarySp.FundingKey.GetAddr().String(), @@ -242,22 +235,15 @@ func (s *VirtualGroupTestSuite) TestSettle() { s.Require().NoError(err) s.T().Logf("primaryBalance: %s, after: %s", primaryBalance.String(), primaryBalanceAfter.String()) - s.Require().True(primaryBalanceAfter.Balance.Amount.Add(feeAmount).GT(primaryBalance.Balance.Amount)) + s.Require().True(primaryBalanceAfter.Balance.Amount.GT(primaryBalance.Balance.Amount)) // settle gvg msgSettle = virtualgroupmoduletypes.MsgSettle{ - StorageProvider: lastSecondarySp.FundingKey.GetAddr().String(), + StorageProvider: user.GetAddr().String(), GlobalVirtualGroupFamilyId: 0, GlobalVirtualGroupIds: []uint32{gvgId}, } - - simulateRes = s.SimulateTx(&msgSettle, lastSecondarySp.FundingKey) - gasLimit = simulateRes.GasInfo.GetGasUsed() - gasPrice, _ = sdk.ParseCoinNormalized(simulateRes.GasInfo.GetMinGasPrice()) - feeAmount = gasPrice.Amount.Mul(sdk.NewInt(int64(gasLimit))) - s.T().Logf("fee amount: %s", feeAmount.String()) - - s.SendTxBlock(lastSecondarySp.FundingKey, &msgSettle) + s.SendTxBlock(user, &msgSettle) secondaryBalancesAfter := make([]sdkmath.Int, 0, len(secondaryBalances)) for _, addr := range secondarySpAddrs { @@ -270,11 +256,7 @@ func (s *VirtualGroupTestSuite) TestSettle() { for i := range secondaryBalances { s.T().Logf("secondaryBalance: %s, after: %s", secondaryBalances[i].String(), secondaryBalancesAfter[i].String()) - if i != len(secondaryBalances)-1 { - s.Require().True(secondaryBalancesAfter[i].GT(secondaryBalances[i])) - } else { - s.Require().True(secondaryBalancesAfter[i].Add(feeAmount).GT(secondaryBalances[i])) - } + s.Require().True(secondaryBalancesAfter[i].GT(secondaryBalances[i])) } } diff --git a/proto/greenfield/virtualgroup/tx.proto b/proto/greenfield/virtualgroup/tx.proto index a0026bf1d..1e2aa2d34 100644 --- a/proto/greenfield/virtualgroup/tx.proto +++ b/proto/greenfield/virtualgroup/tx.proto @@ -161,7 +161,8 @@ message MsgCancelSwapOutResponse {} message MsgSettle { option (cosmos.msg.v1.signer) = "storage_provider"; - // storage_provider defines the operator/funding account address of the storage provider who initial settle request. + // storage_provider defines the account address who initiates the settle request. + // After Pampas upgrade, not only storage provider, anyone can submit this message. string storage_provider = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // global_virtual_group_family_id is the identifier of the global virtual group family. uint32 global_virtual_group_family_id = 2; diff --git a/x/virtualgroup/client/cli/tx.go b/x/virtualgroup/client/cli/tx.go index d1b891911..38567d27a 100644 --- a/x/virtualgroup/client/cli/tx.go +++ b/x/virtualgroup/client/cli/tx.go @@ -31,19 +31,22 @@ func GetTxCmd() *cobra.Command { func CmdSettle() *cobra.Command { cmd := &cobra.Command{ - Use: "settle", + Use: "settle [gvg family id] [gvg ids]", Short: "Broadcast message settle", - Args: cobra.ExactArgs(2), + Long: `Settle will do the settlement of a GVG family or several GVGs (by specifying comma seperated ids). +If zero is provided for GVG family, then the provided GVGs will be settled. +If none zero is provided for GVG family, then the provided GVG family will be settled and the provided GVGs will be ignored.`, + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { gvgFamilyId, err := strconv.ParseInt(args[0], 10, 32) - if err != nil || gvgFamilyId <= 0 { - return fmt.Errorf("invalid GVG family id %s", args[1]) + if err != nil || gvgFamilyId < 0 { + return fmt.Errorf("invalid GVG family id %s", args[0]) } gvgIds := make([]uint32, 0) splits := strings.Split(args[1], ",") for _, split := range splits { gvgId, err := strconv.ParseInt(split, 10, 32) - if err != nil || gvgFamilyId <= 0 { + if err != nil || gvgId < 0 { return fmt.Errorf("invalid GVG id %s", args[1]) } gvgIds = append(gvgIds, uint32(gvgId)) diff --git a/x/virtualgroup/keeper/msg_server.go b/x/virtualgroup/keeper/msg_server.go index 86f237c74..2d5f9ceac 100644 --- a/x/virtualgroup/keeper/msg_server.go +++ b/x/virtualgroup/keeper/msg_server.go @@ -350,12 +350,16 @@ func (k msgServer) Settle(goCtx context.Context, req *types.MsgSettle) (*types.M addr := sdk.MustAccAddressFromHex(req.StorageProvider) var sp *sptypes.StorageProvider - found := false - sp, found = k.spKeeper.GetStorageProviderByOperatorAddr(ctx, addr) - if !found { - sp, found = k.spKeeper.GetStorageProviderByFundingAddr(ctx, addr) + + pampasUpgraded := ctx.IsUpgraded(upgradetypes.Pampas) + if !pampasUpgraded { + found := false + sp, found = k.spKeeper.GetStorageProviderByOperatorAddr(ctx, addr) if !found { - return nil, sptypes.ErrStorageProviderNotFound.Wrapf("The address must be operator/funding address of sp.") + sp, found = k.spKeeper.GetStorageProviderByFundingAddr(ctx, addr) + if !found { + return nil, sptypes.ErrStorageProviderNotFound.Wrapf("The address must be operator/funding address of sp.") + } } } @@ -365,6 +369,13 @@ func (k msgServer) Settle(goCtx context.Context, req *types.MsgSettle) (*types.M return nil, types.ErrGVGFamilyNotExist } + if pampasUpgraded { + sp, found = k.spKeeper.GetStorageProvider(ctx, family.PrimarySpId) + if !found { + return nil, sptypes.ErrStorageProviderNotFound.Wrapf("Cannot find storage provider %d.", family.PrimarySpId) + } + } + err := k.SettleAndDistributeGVGFamily(ctx, sp, family) if err != nil { return nil, types.ErrSettleFailed @@ -374,21 +385,24 @@ func (k msgServer) Settle(goCtx context.Context, req *types.MsgSettle) (*types.M for _, gvgID := range req.GlobalVirtualGroupIds { m[gvgID] = struct{}{} } + for gvgID := range m { gvg, found := k.GetGVG(ctx, gvgID) if !found { return nil, types.ErrGVGNotExist } - permitted := false - for _, id := range gvg.SecondarySpIds { - if id == sp.Id { - permitted = true - break + if !pampasUpgraded { + permitted := false + for _, id := range gvg.SecondarySpIds { + if id == sp.Id { + permitted = true + break + } + } + if !permitted { + return nil, sdkerrors.Wrapf(types.ErrSettleFailed, "storage provider %d is not in the group", sp.Id) } - } - if !permitted { - return nil, sdkerrors.Wrapf(types.ErrSettleFailed, "storage provider %d is not in the group", sp.Id) } err := k.SettleAndDistributeGVG(ctx, gvg) diff --git a/x/virtualgroup/types/message.go b/x/virtualgroup/types/message.go index d56114c3b..a1e1a08d0 100644 --- a/x/virtualgroup/types/message.go +++ b/x/virtualgroup/types/message.go @@ -283,9 +283,9 @@ func (msg *MsgUpdateParams) ValidateBasic() error { return nil } -func NewMsgSettle(fundingAddress sdk.AccAddress, globalVirtualGroupFamilyID uint32, globalVirtualGroupIDs []uint32) *MsgSettle { +func NewMsgSettle(submitter sdk.AccAddress, globalVirtualGroupFamilyID uint32, globalVirtualGroupIDs []uint32) *MsgSettle { return &MsgSettle{ - StorageProvider: fundingAddress.String(), + StorageProvider: submitter.String(), GlobalVirtualGroupFamilyId: globalVirtualGroupFamilyID, GlobalVirtualGroupIds: globalVirtualGroupIDs, } @@ -314,7 +314,7 @@ func (msg *MsgSettle) GetSigners() []sdk.AccAddress { func (msg *MsgSettle) ValidateBasic() error { _, err := sdk.AccAddressFromHexUnsafe(msg.StorageProvider) if err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("invalid storage provider address (%s)", err) + return sdkerrors.ErrInvalidAddress.Wrapf("invalid submitter address (%s)", err) } if msg.GlobalVirtualGroupFamilyId == NoSpecifiedFamilyId { diff --git a/x/virtualgroup/types/tx.pb.go b/x/virtualgroup/types/tx.pb.go index 51533919e..b05d00332 100644 --- a/x/virtualgroup/types/tx.pb.go +++ b/x/virtualgroup/types/tx.pb.go @@ -853,7 +853,8 @@ var xxx_messageInfo_MsgCancelSwapOutResponse proto.InternalMessageInfo // Firstly, the handler will do stream settlement for the payment account; and // secondly, the income will be distributed to related storage providers. type MsgSettle struct { - // storage_provider defines the operator/funding account address of the storage provider who initial settle request. + // storage_provider defines the account address who initiates the settle request. + // After Pampas upgrade, not only storage provider, anyone can submit this message. StorageProvider string `protobuf:"bytes,1,opt,name=storage_provider,json=storageProvider,proto3" json:"storage_provider,omitempty"` // global_virtual_group_family_id is the identifier of the global virtual group family. GlobalVirtualGroupFamilyId uint32 `protobuf:"varint,2,opt,name=global_virtual_group_family_id,json=globalVirtualGroupFamilyId,proto3" json:"global_virtual_group_family_id,omitempty"` From 5052858e7d48350a04008f88f7aec05c613837ac Mon Sep 17 00:00:00 2001 From: dylanhuang Date: Thu, 2 Nov 2023 10:14:53 +0800 Subject: [PATCH 11/12] chore: update cosmos-sdk and cometbft (#514) * chore: update cosmos-sdk and cometbft * chore: update swagger --- go.mod | 4 ++-- go.sum | 8 ++++---- swagger/static/swagger.yaml | 28 ++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 199ac8b59..5304019c2 100644 --- a/go.mod +++ b/go.mod @@ -175,10 +175,10 @@ replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 - github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0 + github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62 github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231101023808-a3c24a58eca0 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/wercker/journalhook => github.com/wercker/journalhook v0.0.0-20230927020745-64542ffa4117 diff --git a/go.sum b/go.sum index 7902a91fc..026c7f9ea 100644 --- a/go.sum +++ b/go.sum @@ -159,12 +159,12 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr3LCn5/XlcgDWr8= -github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62 h1:pakuREXV/XfWNwgsTXUQwYirem12Tt+2LGGHIar0z8o= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20231030090949-99ef7dbd1e62/go.mod h1:43yICrTxu90VjEUpQN23bsqi9mua5m5sFQq/ekHwN9s= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16 h1:RUkJEmOOOAxE7lsAXFcn0yJ7fydVP5qJbe+70WejCUs= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20231018070449-3803e78a1d16/go.mod h1:BGVMW9gRFKGzCwK/8CmDGe3sK9r9QujL1Uz2FMMM+/s= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231101023808-a3c24a58eca0 h1:5BQrQRqQ0GTR3UgvTtlTCJAYPkWrjk9Yk9kRnmzzut0= +github.com/bnb-chain/greenfield-cosmos-sdk v1.0.2-0.20231101023808-a3c24a58eca0/go.mod h1:ZWyfWX032fdHkICmEoJwylfqmL+Atf/QNVS8GzJq1Kc= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210 h1:GHPbV2bC+gmuO6/sG0Tm8oGal3KKSRlyE+zPscDjlA8= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230816082903-b48770f5e210/go.mod h1:vhsZxXE9tYJeYB5JR4hPhd6Pc/uPf7j1T8IJ7p9FdeM= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230816082903-b48770f5e210 h1:FLVOn4+OVbsKi2+YJX5kmD27/4dRu4FW7xCXFhzDO5s= diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index ad9b46822..680dca680 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -22061,6 +22061,22 @@ paths: value: type: string format: byte + parameters: + - name: claim_src_chain + description: |- + ClaimSrcChain defines the src chain of a claim. + + - CLAIM_SRC_CHAIN_UNSPECIFIED: CLAIM_SRC_CHAIN_UNSPECIFIED + - CLAIM_SRC_CHAIN_BSC: CLAIM_SRC_CHAIN_BSC defines BSC source chain + - CLAIM_SRC_CHAIN_OP_BNB: CLAIM_SRC_CHAIN_OP_BNB defines OPBNB source chain + in: query + required: false + type: string + enum: + - CLAIM_SRC_CHAIN_UNSPECIFIED + - CLAIM_SRC_CHAIN_BSC + - CLAIM_SRC_CHAIN_OP_BNB + default: CLAIM_SRC_CHAIN_UNSPECIFIED tags: - Query /cosmos/oracle/v1/params: @@ -48081,6 +48097,18 @@ definitions: format: uint64 title: expected blocks per year description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.oracle.v1.ClaimSrcChain: + type: string + enum: + - CLAIM_SRC_CHAIN_UNSPECIFIED + - CLAIM_SRC_CHAIN_BSC + - CLAIM_SRC_CHAIN_OP_BNB + default: CLAIM_SRC_CHAIN_UNSPECIFIED + description: |- + - CLAIM_SRC_CHAIN_UNSPECIFIED: CLAIM_SRC_CHAIN_UNSPECIFIED + - CLAIM_SRC_CHAIN_BSC: CLAIM_SRC_CHAIN_BSC defines BSC source chain + - CLAIM_SRC_CHAIN_OP_BNB: CLAIM_SRC_CHAIN_OP_BNB defines OPBNB source chain + title: ClaimSrcChain defines the src chain of a claim cosmos.oracle.v1.Params: type: object properties: From 12abbd906b0093690b23baf221bdbb807884e8f7 Mon Sep 17 00:00:00 2001 From: randyahx <62416962+randyahx@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:55:13 +0800 Subject: [PATCH 12/12] release: draft release for v1.1.0 (#516) --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 863289b72..c3ab569aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## v1.1.0 +This release contains 2 new features, 3 bugfixes and 6 chores. + +Features: +* [#493](https://github.com/bnb-chain/greenfield/pull/493) feat: support reject bucket migration +* [#504](https://github.com/bnb-chain/greenfield/pull/504) feat: add a hardfork for the link to opBNB + +Bugfixes: +* [#506](https://github.com/bnb-chain/greenfield/pull/506) fix: add GlobalVirtualGroupFamilyId to createBucketPackage +* [#509](https://github.com/bnb-chain/greenfield/pull/509) fix: make handleCreateBucketSynPackage forward compatible +* [#511](https://github.com/bnb-chain/greenfield/pull/511) fix: policy key is not GC while a expired policy is GC + +Chores: +* [#484](https://github.com/bnb-chain/greenfield/pull/484) chore: improve the validations of messages +* [#497](https://github.com/bnb-chain/greenfield/pull/497) chore: add cmd +* [#503](https://github.com/bnb-chain/greenfield/pull/503) chore: add potential impacts for PR template +* [#508](https://github.com/bnb-chain/greenfield/pull/508) chore: update cosmos-sdk version +* [#512](https://github.com/bnb-chain/greenfield/pull/512) chore: allow anyone to trigger the settlement of GVG/GVG family +* [#514](https://github.com/bnb-chain/greenfield/pull/514) chore: update cosmos-sdk and cometbft + ## v1.0.1 This release contains 2 chores.