diff --git a/go.mod b/go.mod index 6eed850d1..a010d7d63 100644 --- a/go.mod +++ b/go.mod @@ -174,10 +174,10 @@ replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 - github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2 + github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.0-20230810120916-f5f3421ab490 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/yutianwu/greenfield-cosmos-sdk v0.0.0-20230810000415-718b1f26fd54 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230814021346-db9421ad0fa2 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 ) diff --git a/go.sum b/go.sum index 1677d806f..7dcd794f8 100644 --- a/go.sum +++ b/go.sum @@ -159,10 +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 v0.0.2 h1:bRamS8Lq1lA3ttRLZBha22uiNG5tqN+diD3hapdUCYI= -github.com/bnb-chain/greenfield-cometbft v0.0.2/go.mod h1:EBmwmUdaNbGPyGjf1cMuoN3pAeM2tQu7Lfg95813EAw= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20230810120916-f5f3421ab490 h1:sztr3uiKE/iI8O6ccIb6Bc9b9K0GVJryPXMhWx6Xk/U= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20230810120916-f5f3421ab490/go.mod h1:3nGT4Z9fHwgRlBY/rofn0rSarnIcNbuhz/eq0XlLlkg= 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.20230814021346-db9421ad0fa2 h1:2jLRWwnqwOS2foqCJaH+z7cStfxo6H9jMTEsRlbjW+4= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230814021346-db9421ad0fa2/go.mod h1:C4iDO5NuIlmlyFsIqhItF1A6ouAwsZmn20LQ0YhE0Mg= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 h1:6fLpmmI0EZvDTfPvI0zy5dBaaTUboHnEkoC5/p/w8TQ= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9/go.mod h1:rbc4o84RSEvhf09o2+4Qiazsv0snRJLiEZdk17HeIDw= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 h1:1ZdK+iR1Up02bOa2YTZCml7PBpP//kcdamOcK6aWO/s= @@ -1423,8 +1425,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yutianwu/greenfield-cosmos-sdk v0.0.0-20230810000415-718b1f26fd54 h1:J6UL48UJAANjch7euMvJDh6z1wYtNGa/f+SX7DDExgQ= -github.com/yutianwu/greenfield-cosmos-sdk v0.0.0-20230810000415-718b1f26fd54/go.mod h1:hpvg93+VGXHAcv/pVVdp24Ik/9miw4uRh8+tD0DDYas= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= diff --git a/swagger/static/swagger.yaml b/swagger/static/swagger.yaml index 651faa94b..548f757cd 100644 --- a/swagger/static/swagger.yaml +++ b/swagger/static/swagger.yaml @@ -15715,6 +15715,12 @@ paths: type: string format: byte parameters: + - name: dest_chain_id + description: destination chain id. + in: query + required: false + type: integer + format: int64 - name: channel_id description: channel id of the cross chain package. in: query @@ -15815,6 +15821,12 @@ paths: type: string format: byte parameters: + - name: dest_chain_id + description: destination chain id. + in: query + required: false + type: integer + format: int64 - name: channel_id description: channel id of the cross chain package. in: query @@ -15863,6 +15875,12 @@ paths: type: string format: byte parameters: + - name: dest_chain_id + description: destination chain id. + in: query + required: false + type: integer + format: int64 - name: channel_id description: channel id of the cross chain package. in: query diff --git a/x/bridge/keeper/genesis_test.go b/x/bridge/keeper/genesis_test.go index 4bf996edf..dc54ae397 100644 --- a/x/bridge/keeper/genesis_test.go +++ b/x/bridge/keeper/genesis_test.go @@ -24,6 +24,6 @@ func (s *TestSuite) TestInitGenesis() { // Check that the genesis state was set correctly. params := k.GetParams(s.ctx) - s.Require().Equal(sdkmath.NewInt(250000000000000), params.BscTransferOutRelayerFee) + s.Require().Equal(sdkmath.NewInt(780000000000000), params.BscTransferOutRelayerFee) s.Require().Equal(sdkmath.NewInt(0), params.BscTransferOutAckRelayerFee) } diff --git a/x/storage/types/params.go b/x/storage/types/params.go index 528705228..9556eb930 100644 --- a/x/storage/types/params.go +++ b/x/storage/types/params.go @@ -26,12 +26,18 @@ const ( DefaultMinUpdateQuotaInterval uint64 = 2592000 // 30 days (in second) DefaultMaxLocalVirtualGroupNumPerBucket uint32 = 10 - DefaultMirrorBucketRelayerFee = "1300000000000000" // 0.0013 - DefaultMirrorBucketAckRelayerFee = "250000000000000" // 0.00025 - DefaultMirrorObjectRelayerFee = "1300000000000000" // 0.0013 - DefaultMirrorObjectAckRelayerFee = "250000000000000" // 0.00025 - DefaultMirrorGroupRelayerFee = "1300000000000000" // 0.0013 - DefaultMirrorGroupAckRelayerFee = "250000000000000" // 0.00025 + DefaultBscMirrorBucketRelayerFee = "1300000000000000" // 0.0013 + DefaultBscMirrorBucketAckRelayerFee = "250000000000000" // 0.00025 + DefaultBscMirrorObjectRelayerFee = "1300000000000000" // 0.0013 + DefaultBscMirrorObjectAckRelayerFee = "250000000000000" // 0.00025 + DefaultBscMirrorGroupRelayerFee = "1300000000000000" // 0.0013 + DefaultBscMirrorGroupAckRelayerFee = "250000000000000" // 0.00025 + DefaultOpMirrorBucketRelayerFee = "130000000000000" // 0.00013 + DefaultOpMirrorBucketAckRelayerFee = "25000000000000" // 0.000025 + DefaultOpMirrorObjectRelayerFee = "130000000000000" // 0.00013 + DefaultOpMirrorObjectAckRelayerFee = "25000000000000" // 0.000025 + DefaultOpMirrorGroupRelayerFee = "130000000000000" // 0.00013 + DefaultOpMirrorGroupAckRelayerFee = "25000000000000" // 0.000025 ) var ( @@ -54,6 +60,12 @@ var ( KeyBscMirrorObjectAckRelayerFee = []byte("BscMirrorObjectAckRelayerFee") KeyBscMirrorGroupRelayerFee = []byte("BscMirrorGroupRelayerFee") KeyBscMirrorGroupAckRelayerFee = []byte("BscMirrorGroupAckRelayerFee") + KeyOpMirrorBucketRelayerFee = []byte("OpMirrorBucketRelayerFee") + KeyOpMirrorBucketAckRelayerFee = []byte("OpMirrorBucketAckRelayerFee") + KeyOpMirrorObjectRelayerFee = []byte("OpMirrorObjectRelayerFee") + KeyOpMirrorObjectAckRelayerFee = []byte("OpMirrorObjectAckRelayerFee") + KeyOpMirrorGroupRelayerFee = []byte("OpMirrorGroupRelayerFee") + KeyOpMirrorGroupAckRelayerFee = []byte("OpMirrorGroupAckRelayerFee") KeyMaxLocalVirtualGroupNumPerBucket = []byte("MaxLocalVirtualGroupNumPerBucket") ) @@ -68,9 +80,12 @@ func ParamKeyTable() paramtypes.KeyTable { func NewParams( maxSegmentSize uint64, redundantDataChunkNum uint32, redundantParityChunkNum uint32, maxPayloadSize uint64, maxBucketsPerAccount uint32, - minChargeSize uint64, mirrorBucketRelayerFee, mirrorBucketAckRelayerFee string, - mirrorObjectRelayerFee, mirrorObjectAckRelayerFee string, - mirrorGroupRelayerFee, mirrorGroupAckRelayerFee string, + minChargeSize uint64, bscMirrorBucketRelayerFee, bscMirrorBucketAckRelayerFee string, + bscMirrorObjectRelayerFee, bscMirrorObjectAckRelayerFee string, + bscMirrorGroupRelayerFee, bscMirrorGroupAckRelayerFee string, + opMirrorBucketRelayerFee, opMirrorBucketAckRelayerFee string, + opMirrorObjectRelayerFee, opMirrorObjectAckRelayerFee string, + opMirrorGroupRelayerFee, opMirrorGroupAckRelayerFee string, discontinueCountingWindow, discontinueObjectMax, discontinueBucketMax uint64, discontinueConfirmPeriod int64, discontinueDeletionMax uint64, @@ -87,12 +102,18 @@ func NewParams( }, MaxPayloadSize: maxPayloadSize, MaxBucketsPerAccount: maxBucketsPerAccount, - BscMirrorBucketRelayerFee: mirrorBucketRelayerFee, - BscMirrorBucketAckRelayerFee: mirrorBucketAckRelayerFee, - BscMirrorObjectRelayerFee: mirrorObjectRelayerFee, - BscMirrorObjectAckRelayerFee: mirrorObjectAckRelayerFee, - BscMirrorGroupRelayerFee: mirrorGroupRelayerFee, - BscMirrorGroupAckRelayerFee: mirrorGroupAckRelayerFee, + BscMirrorBucketRelayerFee: bscMirrorBucketRelayerFee, + BscMirrorBucketAckRelayerFee: bscMirrorBucketAckRelayerFee, + BscMirrorObjectRelayerFee: bscMirrorObjectRelayerFee, + BscMirrorObjectAckRelayerFee: bscMirrorObjectAckRelayerFee, + BscMirrorGroupRelayerFee: bscMirrorGroupRelayerFee, + BscMirrorGroupAckRelayerFee: bscMirrorGroupAckRelayerFee, + OpMirrorBucketRelayerFee: opMirrorBucketRelayerFee, + OpMirrorBucketAckRelayerFee: opMirrorBucketAckRelayerFee, + OpMirrorObjectRelayerFee: opMirrorObjectRelayerFee, + OpMirrorObjectAckRelayerFee: opMirrorObjectAckRelayerFee, + OpMirrorGroupRelayerFee: opMirrorGroupRelayerFee, + OpMirrorGroupAckRelayerFee: opMirrorGroupAckRelayerFee, DiscontinueCountingWindow: discontinueCountingWindow, DiscontinueObjectMax: discontinueObjectMax, DiscontinueBucketMax: discontinueBucketMax, @@ -109,9 +130,12 @@ func DefaultParams() Params { return NewParams( DefaultMaxSegmentSize, DefaultRedundantDataChunkNum, DefaultRedundantParityChunkNum, DefaultMaxPayloadSize, DefaultMaxBucketsPerAccount, - DefaultMinChargeSize, DefaultMirrorBucketRelayerFee, DefaultMirrorBucketAckRelayerFee, - DefaultMirrorObjectRelayerFee, DefaultMirrorObjectAckRelayerFee, - DefaultMirrorGroupRelayerFee, DefaultMirrorGroupAckRelayerFee, + DefaultMinChargeSize, DefaultBscMirrorBucketRelayerFee, DefaultBscMirrorBucketAckRelayerFee, + DefaultBscMirrorObjectRelayerFee, DefaultBscMirrorObjectAckRelayerFee, + DefaultBscMirrorGroupRelayerFee, DefaultBscMirrorGroupAckRelayerFee, + DefaultOpMirrorBucketRelayerFee, DefaultOpMirrorBucketAckRelayerFee, + DefaultOpMirrorObjectRelayerFee, DefaultOpMirrorObjectAckRelayerFee, + DefaultOpMirrorGroupRelayerFee, DefaultOpMirrorGroupAckRelayerFee, DefaultDiscontinueCountingWindow, DefaultDiscontinueObjectMax, DefaultDiscontinueBucketMax, DefaultDiscontinueConfirmPeriod, DefaultDiscontinueDeletionMax, DefaultStalePolicyCleanupMax, DefaultMinUpdateQuotaInterval, DefaultMaxLocalVirtualGroupNumPerBucket, @@ -134,6 +158,12 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyBscMirrorObjectAckRelayerFee, &p.BscMirrorObjectAckRelayerFee, validateRelayerFee), paramtypes.NewParamSetPair(KeyBscMirrorGroupRelayerFee, &p.BscMirrorGroupRelayerFee, validateRelayerFee), paramtypes.NewParamSetPair(KeyBscMirrorGroupAckRelayerFee, &p.BscMirrorGroupAckRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorBucketRelayerFee, &p.OpMirrorBucketRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorBucketAckRelayerFee, &p.OpMirrorBucketAckRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorObjectRelayerFee, &p.OpMirrorObjectRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorObjectAckRelayerFee, &p.OpMirrorObjectAckRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorGroupRelayerFee, &p.OpMirrorGroupRelayerFee, validateRelayerFee), + paramtypes.NewParamSetPair(KeyOpMirrorGroupAckRelayerFee, &p.OpMirrorGroupAckRelayerFee, validateRelayerFee), paramtypes.NewParamSetPair(KeyDiscontinueCountingWindow, &p.DiscontinueCountingWindow, validateDiscontinueCountingWindow), paramtypes.NewParamSetPair(KeyDiscontinueObjectMax, &p.DiscontinueObjectMax, validateDiscontinueObjectMax), paramtypes.NewParamSetPair(KeyDiscontinueBucketMax, &p.DiscontinueBucketMax, validateDiscontinueBucketMax), @@ -183,6 +213,24 @@ func (p Params) Validate() error { if err := validateRelayerFee(p.BscMirrorGroupAckRelayerFee); err != nil { return err } + if err := validateRelayerFee(p.OpMirrorBucketRelayerFee); err != nil { + return err + } + if err := validateRelayerFee(p.OpMirrorBucketAckRelayerFee); err != nil { + return err + } + if err := validateRelayerFee(p.OpMirrorObjectRelayerFee); err != nil { + return err + } + if err := validateRelayerFee(p.OpMirrorObjectAckRelayerFee); err != nil { + return err + } + if err := validateRelayerFee(p.OpMirrorGroupRelayerFee); err != nil { + return err + } + if err := validateRelayerFee(p.OpMirrorGroupAckRelayerFee); err != nil { + return err + } if err := validateDiscontinueCountingWindow(p.DiscontinueCountingWindow); err != nil { return err }