diff --git a/CHANGELOG.md b/CHANGELOG.md index 558fab0d2..c628255ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +##v0.25.0-binance.24 +* [sdk] [\#248](https://github.com/binance-chain/bnc-cosmos-sdk/pull/248) owner transfer +* [sdk] Allow tx send (generate-only) to actually work offline #4234 +* [store] (iavl) #5276 Fix potential race condition in iavlIterator#Close. +* [sdk] [\#247](https://github.com/binance-chain/bnc-cosmos-sdk/pull/247) Fix failack payload +* [sdk] [\#251](https://github.com/binance-chain/bnc-cosmos-sdk/pull/251) change minimum length to 2 +* [sdk] [\#252](https://github.com/binance-chain/bnc-cosmos-sdk/pull/252) Fix Fee compatibility issue + + + ## v0.25.0 binance.20 * [sdk] [\#163](https://github.com/binance-chain/bnc-cosmos-sdk/pull/163) Tss for project team diff --git a/go.mod b/go.mod index 36806c108..3ec4971b4 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,6 @@ require ( github.com/ipfs/go-log v0.0.1 github.com/mattn/go-isatty v0.0.10 github.com/mitchellh/go-homedir v1.1.0 - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect github.com/pelletier/go-toml v1.4.0 github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 @@ -37,7 +35,7 @@ require ( replace ( github.com/tendermint/go-amino => github.com/binance-chain/bnc-go-amino v0.14.1-binance.2 github.com/tendermint/iavl => github.com/binance-chain/bnc-tendermint-iavl v0.12.0-binance.4 - github.com/tendermint/tendermint => github.com/binance-chain/bnc-tendermint v0.32.3-binance.3 + github.com/tendermint/tendermint => github.com/binance-chain/bnc-tendermint v0.32.3-binance.5 github.com/zondax/ledger-cosmos-go => github.com/binance-chain/ledger-cosmos-go v0.9.9-binance.3 golang.org/x/crypto => github.com/tendermint/crypto v0.0.0-20190823183015-45b1026d81ae ) diff --git a/go.sum b/go.sum index 1bbab60e4..11d3ea5f2 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/binance-chain/bnc-go-amino v0.14.1-binance.2 h1:XcbcfisVItk92UKoGbtNT8nbcfadj3H3ayuM2srAfVs= github.com/binance-chain/bnc-go-amino v0.14.1-binance.2/go.mod h1:yaElUUxWtv/TC/ldGtlKAvS1vKwokxgJ1d97I+6is80= -github.com/binance-chain/bnc-tendermint v0.32.3-binance.3 h1:b8SqtWmtHPhPQ2ADzUgO9sr+ChKL9ho4dTorBjGAAyY= -github.com/binance-chain/bnc-tendermint v0.32.3-binance.3/go.mod h1:kN5dNxE8voFtDqx2HjbM8sBIH5cUuMtLg0XEHjqzUiY= +github.com/binance-chain/bnc-tendermint v0.32.3-binance.5 h1:t+gCaAoN3PLMFFayY8EtUkEftir9a0DM9uK2DR6ZCwU= +github.com/binance-chain/bnc-tendermint v0.32.3-binance.5/go.mod h1:kN5dNxE8voFtDqx2HjbM8sBIH5cUuMtLg0XEHjqzUiY= github.com/binance-chain/bnc-tendermint-iavl v0.12.0-binance.4 h1:BhaV2iiGWfRC6iB8HHOYJeUDwtQMB2pUA4ah+KCbBhI= github.com/binance-chain/bnc-tendermint-iavl v0.12.0-binance.4/go.mod h1:Zmh8GRdNJB8DULIOBar3JCZp6tSpcvM1NGKfE9U2EzA= github.com/binance-chain/ledger-cosmos-go v0.9.9-binance.3 h1:FFpFbkzlP2HUyxQCm0eoU6mkfgMNynfqZRbeWqlaLdQ= diff --git a/store/iavlstore.go b/store/iavlstore.go index 1b2b21fab..52c016931 100644 --- a/store/iavlstore.go +++ b/store/iavlstore.go @@ -381,9 +381,13 @@ func (iter *iavlIterator) Value() []byte { return val } -// Implements Iterator. +// Close closes the IAVL iterator by closing the quit channel and waiting for +// the iterCh to finish/close. func (iter *iavlIterator) Close() { close(iter.quitCh) + // wait iterCh to close + for range iter.iterCh { + } } //---------------------------------------- diff --git a/types/coin.go b/types/coin.go index c4efdc1e4..2d8c94433 100644 --- a/types/coin.go +++ b/types/coin.go @@ -285,11 +285,11 @@ func (coins Coins) Sort() Coins { // Parsing var ( - // Denominations can be 3 ~ 10 characters long (8 + .B suffix). + // Denominations can be 2 ~ 10 characters long (8 + .B suffix). // Extra token symbol tx hash suffix can be 2 ~ 6 characters long. reAmt = `[[:digit:]]+` reSpc = `\:` - reDnm = `[[:alnum:]]{3,8}(\.[[:alpha:]])?(-[0-9A-Z]{2,6})?` + reDnm = `[[:alnum:]]{2,8}(\.[[:alpha:]])?(-[0-9A-Z]{2,6})?` reCoin = regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)$`, reAmt, reSpc, reDnm)) ) diff --git a/types/coin_test.go b/types/coin_test.go index 87a32179b..374631644 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -302,6 +302,7 @@ func TestParse(t *testing.T) { {"98:bar , 1:foo ", true, Coins{{"bar", 98}, {"foo", one}}}, {" 55:bling\n", true, Coins{{"bling", 55}}}, {"2:foo, 97:bar", true, Coins{{"bar", 97}, {"foo", 2}}}, + {"10:ba-1BC", true, Coins{{"ba-1BC", 10}}}, {"5:mycoin,", false, nil}, // no empty coins in a list {"2:3foo, 97:bar", true, Coins{{"3foo", 2}, {"bar", 97}}}, // 3foo is invalid coin name {"11me:coin, 12you:coin", false, nil}, // no spaces in coin names diff --git a/types/upgrade.go b/types/upgrade.go index 2f1125018..8e9a8e998 100644 --- a/types/upgrade.go +++ b/types/upgrade.go @@ -11,6 +11,8 @@ const ( BEP3 = "BEP3" // https://github.com/binance-chain/BEPs/pull/30 BEP8 = "BEP8" // Mini-BEP2 token LaunchBscUpgrade = "LaunchBscUpgrade" + BEP82 = "BEP82" // https://github.com/binance-chain/BEPs/pull/82 + FixFailAckPackage = "FixFailAckPackage" ) var MainNetConfig = UpgradeConfig{ diff --git a/x/bank/client/cli/sendtx.go b/x/bank/client/cli/sendtx.go index c8abc3f64..a5b5e9be2 100644 --- a/x/bank/client/cli/sendtx.go +++ b/x/bank/client/cli/sendtx.go @@ -31,10 +31,6 @@ func SendTxCmd(cdc *codec.Codec) *cobra.Command { WithCodec(cdc). WithAccountDecoder(authcmd.GetAccountDecoder(cdc)) - if err := cliCtx.EnsureAccountExists(); err != nil { - return err - } - toStr := viper.GetString(flagTo) to, err := sdk.AccAddressFromBech32(toStr) diff --git a/x/gov/client/utils.go b/x/gov/client/utils.go index 9bed23a3d..15294407c 100644 --- a/x/gov/client/utils.go +++ b/x/gov/client/utils.go @@ -32,6 +32,12 @@ func NormalizeProposalType(proposalType string) string { return "CreateValidator" case "RemoveValidator", "remove_validator": return "RemoveValidator" + case "SCParamsChange", "sc_params_change": + return "SCParamsChange" + case "CSCParamsChange", "csc_params_change": + return "CSCParamsChange" + case "ManageChanPermission", "manage_chan_permission": + return "ManageChanPermission" } return "" } diff --git a/x/oracle/handler.go b/x/oracle/handler.go index b053bd2ab..6deb8ca7d 100644 --- a/x/oracle/handler.go +++ b/x/oracle/handler.go @@ -144,11 +144,19 @@ func handlePackage(ctx sdk.Context, oracleKeeper Keeper, chainId sdk.ChainID, pa var sendSequence int64 = -1 if packageType == sdk.SynCrossChainPackageType { if crash { - sendSeq, err := oracleKeeper.IbcKeeper.CreateRawIBCPackageById(ctx, chainId, - pack.ChannelId, sdk.FailAckCrossChainPackageType, pack.Payload) - if err != nil { + var ibcErr sdk.Error + var sendSeq uint64 + if sdk.IsUpgrade(sdk.FixFailAckPackage) && len(pack.Payload) >= sTypes.PackageHeaderLength { + sendSeq, ibcErr = oracleKeeper.IbcKeeper.CreateRawIBCPackageById(ctx, chainId, + pack.ChannelId, sdk.FailAckCrossChainPackageType, pack.Payload[sTypes.PackageHeaderLength:]) + } else { + logger.Error("found payload without header", "channelID", pack.ChannelId, "sequence", pack.Sequence, "payload", hex.EncodeToString(pack.Payload)) + sendSeq, ibcErr = oracleKeeper.IbcKeeper.CreateRawIBCPackageById(ctx, chainId, + pack.ChannelId, sdk.FailAckCrossChainPackageType, pack.Payload) + } + if ibcErr != nil { logger.Error("failed to write FailAckCrossChainPackage", "err", err) - return sdk.Event{}, err + return sdk.Event{}, ibcErr } sendSequence = int64(sendSeq) } else { diff --git a/x/paramHub/genesis.go b/x/paramHub/genesis.go index d29e36c40..3daa0709f 100644 --- a/x/paramHub/genesis.go +++ b/x/paramHub/genesis.go @@ -7,19 +7,20 @@ import ( const ( // Operate fee - ProposeFee = 10e8 - DepositFee = 125e3 - SideProposeFee = 10e8 - SideDepositFee = 125e3 - SideVoteFee = 1e8 - ListingFee = 2000e8 - IssueFee = 1000e8 - MintFee = 200e8 - BurnFee = 1e8 - FreezeFee = 1e6 - TimeLockFee = 1e6 - TimeUnlockFee = 1e6 - TimeRelockFee = 1e6 + ProposeFee = 10e8 + DepositFee = 125e3 + SideProposeFee = 10e8 + SideDepositFee = 125e3 + SideVoteFee = 1e8 + ListingFee = 2000e8 + IssueFee = 1000e8 + MintFee = 200e8 + BurnFee = 1e8 + FreezeFee = 1e6 + TimeLockFee = 1e6 + TimeUnlockFee = 1e6 + TimeRelockFee = 1e6 + TransferOwnershipFee = 1e6 SetAccountFlagsFee = 1e8 @@ -67,9 +68,9 @@ const ( //MiniToken fee TinyIssueFee = 2e8 - MiniIssueFee = 4e8 + MiniIssueFee = 3e8 MiniSetUriFee = 37500 - MiniListingFee = 10e8 + MiniListingFee = 8e8 ) var DefaultGenesisState = param.GenesisState{ diff --git a/x/paramHub/hub.go b/x/paramHub/hub.go index 4a48196d2..4d66e1ef9 100644 --- a/x/paramHub/hub.go +++ b/x/paramHub/hub.go @@ -70,6 +70,12 @@ func RegisterUpgradeBeginBlocker(paramHub *ParamHub) { } paramHub.UpdateFeeParams(ctx, miniTokenFeeParams) }) + sdk.UpgradeMgr.RegisterBeginBlocker(sdk.BEP82, func(ctx sdk.Context) { + updateFeeParams := []param.FeeParam{ + ¶m.FixedFeeParams{MsgType: "transferOwnership", Fee: TransferOwnershipFee, FeeFor: sdk.FeeForProposer}, + } + paramHub.UpdateFeeParams(ctx, updateFeeParams) + }) } func EndBreatheBlock(ctx sdk.Context, paramHub *ParamHub) { @@ -112,6 +118,7 @@ func init() { "timeLock": fees.FixedFeeCalculatorGen, "timeUnlock": fees.FixedFeeCalculatorGen, "timeRelock": fees.FixedFeeCalculatorGen, + "transferOwnership": fees.FixedFeeCalculatorGen, "send": bank.TransferFeeCalculatorGen, "HTLT": fees.FixedFeeCalculatorGen, "depositHTLT": fees.FixedFeeCalculatorGen, diff --git a/x/paramHub/types/types.go b/x/paramHub/types/types.go index 3b4a4eed7..ebe2897fb 100644 --- a/x/paramHub/types/types.go +++ b/x/paramHub/types/types.go @@ -33,6 +33,7 @@ var ( "tokensBurn": {}, "setAccountFlags": {}, "tokensFreeze": {}, + "transferOwnership": {}, "create_validator": {}, "remove_validator": {}, "timeLock": {},