Skip to content

Commit

Permalink
fix: update the dependencies to the latest develop branch (#416)
Browse files Browse the repository at this point in the history
* fix: update the dependencies to the latest develop branch

* fix the swagger

* fix the swagger file

* fix unit test

* update the default relayer fees for op
  • Loading branch information
yutianwu authored Aug 14, 2023
1 parent 7869d8e commit 9d7b881
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 25 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
18 changes: 18 additions & 0 deletions swagger/static/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x/bridge/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
84 changes: 66 additions & 18 deletions x/storage/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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")
)

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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),
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 9d7b881

Please sign in to comment.