Skip to content

Commit ca95e32

Browse files
committed
fix: strv2 migration has been panicking on blocked addresses
1 parent 05c403d commit ca95e32

File tree

6 files changed

+32
-29
lines changed

6 files changed

+32
-29
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DIFF_TAG=$(shell git rev-list --tags="v*" --max-count=1 --not $(shell git rev-li
66
DEFAULT_TAG=$(shell git rev-list --tags="v*" --max-count=1)
77
# VERSION ?= $(shell echo $(shell git describe --tags $(or $(DIFF_TAG), $(DEFAULT_TAG))) | sed 's/^v//')
88

9-
VERSION := "1.8.4"
9+
VERSION := "1.8.5"
1010
CBFTVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
1111
COMMIT := $(shell git log -1 --format='%H')
1212
LEDGER_ENABLED ?= true

app/app.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ import (
172172
v181 "github.com/haqq-network/haqq/app/upgrades/v1.8.1"
173173
v182 "github.com/haqq-network/haqq/app/upgrades/v1.8.2"
174174
v183 "github.com/haqq-network/haqq/app/upgrades/v1.8.3"
175-
v184 "github.com/haqq-network/haqq/app/upgrades/v1.8.4"
175+
v185 "github.com/haqq-network/haqq/app/upgrades/v1.8.5"
176176

177177
// NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens
178178
"github.com/haqq-network/haqq/x/ibc/transfer"
@@ -565,15 +565,11 @@ func NewHaqq(
565565

566566
epochsKeeper := epochskeeper.NewKeeper(appCodec, keys[epochstypes.StoreKey])
567567
app.EpochsKeeper = *epochsKeeper.SetHooks(
568-
epochskeeper.NewMultiEpochHooks(
569-
// insert epoch hooks receivers here
570-
),
568+
epochskeeper.NewMultiEpochHooks( /* insert epoch hooks receivers here */ ),
571569
)
572570

573571
app.GovKeeper = *govKeeper.SetHooks(
574-
govtypes.NewMultiGovHooks(
575-
// insert gov hooks receivers here
576-
),
572+
govtypes.NewMultiGovHooks( /* insert gov hooks receivers here */ ),
577573
)
578574

579575
// Initialize the packet forward middleware Keeper
@@ -1237,10 +1233,10 @@ func (app *Haqq) setupUpgradeHandlers() {
12371233
v183.CreateUpgradeHandler(app.mm, app.configurator),
12381234
)
12391235

1240-
// v1.8.4 EVM Precompiles upgrade
1236+
// v1.8.5 EVM Precompiles upgrade (hot fix applied to strv2 migration)
12411237
app.UpgradeKeeper.SetUpgradeHandler(
1242-
v184.UpgradeName,
1243-
v184.CreateUpgradeHandler(app.mm, app.configurator, app.AccountKeeper, app.BankKeeper, app.Erc20Keeper, app.EvmKeeper),
1238+
v185.UpgradeName,
1239+
v185.CreateUpgradeHandler(app.mm, app.configurator, app.AccountKeeper, app.BankKeeper, app.Erc20Keeper, app.EvmKeeper),
12441240
)
12451241

12461242
// When a planned update height is reached, the old binary will panic
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package v184
1+
package v185
22

33
const (
44
// UpgradeName is the shared upgrade plan name for mainnet
5-
UpgradeName = "v1.8.4"
5+
UpgradeName = "v1.8.5"
66
)
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v184
1+
package v185
22

33
import (
44
"fmt"
@@ -48,6 +48,13 @@ func executeConversion(
4848
// Create the coin
4949
coins := sdk.Coins{sdk.Coin{Denom: tokenPair.Denom, Amount: sdk.NewIntFromBigInt(balance)}}
5050

51+
if bankKeeper.BlockedAddr(result.address) {
52+
// Skip blocked address on balance migration as some Precompiles
53+
// and Module accounts are prohibited from receiving coins.
54+
ctx.Logger().Info(fmt.Sprintf("skip blocked address - %s, stuck coins: %s", result.address.String(), coins.String()))
55+
continue
56+
}
57+
5158
err := bankKeeper.SendCoinsFromModuleToAccount(ctx, erc20types.ModuleName, result.address, coins)
5259
if err != nil {
5360
return err
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v184
1+
package v185
22

33
import (
44
errorsmod "cosmossdk.io/errors"

flake.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)