Skip to content

Commit 9f7b1fd

Browse files
authored
Upgrade 1.7.5 // Turn off liquid vesting module (#317)
* feat+chore: upgrade for disable liquid vesting module + clean lint + spellcheck * fix(ci): proto action * chore: try fix proto * chore: bump version in Makefile * chore: finalize upgrade handler * chore(ci): fix proto action * chore: move evm storage utils to utils package + tests * chore: add fix broken liquid denom periods * chore: add update vesting priods * chore: change notes in proto file
1 parent c1d86ea commit 9f7b1fd

File tree

95 files changed

+825
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+825
-268
lines changed

.github/workflows/proto.yml

+13-16
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ name: Protobuf
22
# Protobuf runs buf (https://buf.build/) lint and check-breakage
33
# This workflow is only run when a .proto file has been changed
44
on:
5-
branches-ignore:
6-
- 'coinomics_v2' # NOTE: breaking changes are not really breaking as they are introduced in a module which was never deployed on chain
75
workflow_dispatch:
86
pull_request:
9-
# paths:
10-
# - "proto/**"
117

128
jobs:
139
proto-pass:
@@ -16,12 +12,12 @@ jobs:
1612
needs:
1713
- build
1814
- lint
19-
- break-check
15+
# - break-check
2016
steps:
2117
- run: exit 0
2218

2319
build:
24-
name: Check that proto builds and commited
20+
name: Check that proto builds and committed
2521
runs-on: ubuntu-latest
2622
steps:
2723
- uses: actions/checkout@v4
@@ -42,13 +38,14 @@ jobs:
4238
with:
4339
input: "proto"
4440

45-
break-check:
46-
name: Proto break-check
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v4
50-
- uses: bufbuild/[email protected]
51-
- uses: bufbuild/buf-breaking-action@v1
52-
with:
53-
input: "proto"
54-
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
41+
# NOTE: This is disabled only for this merge request, it will be enabled in master branch
42+
# break-check:
43+
# name: Proto break-check
44+
# runs-on: ubuntu-latest
45+
# steps:
46+
# - uses: actions/checkout@v4
47+
# - uses: bufbuild/[email protected]
48+
# - uses: bufbuild/buf-breaking-action@v1
49+
# with:
50+
# input: "proto"
51+
# against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"

Makefile

+7-6
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.7.4"
9+
VERSION := "1.7.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
@@ -437,10 +437,11 @@ lint-fix-contracts:
437437

438438
.PHONY: lint lint-fix
439439

440-
format:
441-
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs gofmt -w -s
442-
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs misspell -w
443-
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs goimports -w -local github.com/haqq-network/haqq
440+
format:
441+
find . -name '*.go' -type f -not -path "./.devenv/*" -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs gofmt -w -s
442+
find . -name '*.go' -type f -not -path "./.devenv/*" -not -path "./vendor*" -not -path "*.git*" -not -path "./.direnv/*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs codespell -w
443+
find . -name '*.go' -type f -not -path "./.devenv/*" -not -path "./vendor*" -not -path "*.git*" -not -path "./.direnv/*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs goimports -w -local github.com/haqq-network/haqq
444+
444445
.PHONY: format
445446

446447
###############################################################################
@@ -477,7 +478,7 @@ proto-swagger-gen:
477478

478479
proto-format:
479480
@echo "Formatting Protobuf files"
480-
find ./ -not -path ".//.devenv/*" -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
481+
find ./ -not -path "./.devenv/*" -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;
481482

482483
proto-lint:
483484
@$(DOCKER_BUF) lint --error-format=json

app/ante/cosmos/authz.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
4242
// maxNestedMsgs threshold. If there are more than that limit, it returns an error
4343
func (ald AuthzLimiterDecorator) checkDisabledMsgs(msgs []sdk.Msg, isAuthzInnerMsg bool, nestedLvl int) error {
4444
if nestedLvl >= maxNestedMsgs {
45-
return fmt.Errorf("found more nested msgs than permited. Limit is : %d", maxNestedMsgs)
45+
return fmt.Errorf("found more nested msgs than permitted. Limit is : %d", maxNestedMsgs)
4646
}
4747
for _, msg := range msgs {
4848
switch msg := msg.(type) {

app/ante/cosmos/eip712.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ func VerifySignature(
195195

196196
txWithExtensions, ok := tx.(authante.HasExtensionOptionsTx)
197197
if !ok {
198-
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx doesnt contain any extensions")
198+
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx does not contain any extensions")
199199
}
200200
opts := txWithExtensions.GetExtensionOptions()
201201
if len(opts) != 1 {
202-
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx doesnt contain expected amount of extension options")
202+
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx does not contain expected amount of extension options")
203203
}
204204

205205
extOpt, ok := opts[0].GetCachedValue().(*types.ExtensionOptionsWeb3Tx)

app/ante/cosmos/min_price.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (mpd MinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
6666
// Fees not provided (or flag "auto"). Then use the base fee to make the check pass
6767
if feeCoins == nil {
6868
return ctx, errorsmod.Wrapf(errortypes.ErrInsufficientFee,
69-
"fee not provided. Please use the --fees flag or the --gas-price flag along with the --gas flag to estimate the fee. The minimun global fee for this tx is: %s",
69+
"fee not provided. Please use the --fees flag or the --gas-price flag along with the --gas flag to estimate the fee. The minimum global fee for this tx is: %s",
7070
requiredFees)
7171
}
7272

app/ante/cosmos/utils_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func createNestedMsgExec(a sdk.AccAddress, nestedLvl int, lastLvlMsgs []sdk.Msg)
5353
return msgs[nestedLvl-1]
5454
}
5555

56-
func generatePrivKeyAddressPairs(accCount int) ([]*ethsecp256k1.PrivKey, []sdk.AccAddress, error) {
56+
func generatePrivKeyAddressPairs(account int) ([]*ethsecp256k1.PrivKey, []sdk.AccAddress, error) {
5757
var (
5858
err error
59-
testPrivKeys = make([]*ethsecp256k1.PrivKey, accCount)
60-
testAddresses = make([]sdk.AccAddress, accCount)
59+
testPrivKeys = make([]*ethsecp256k1.PrivKey, account)
60+
testAddresses = make([]sdk.AccAddress, account)
6161
)
6262

6363
for i := range testPrivKeys {

app/ante/evm/eth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
136136
if ctx.IsReCheckTx() {
137137
// Use new context with gasWanted = 0
138138
// Otherwise, there's an error on txmempool.postCheck (tendermint)
139-
// that is not bubbled up. Thus, the Tx never runs on DeliverMode
139+
// that is not bubbled up. Thus, the Tx never runs on deliverymode
140140
// Error: "gas wanted -1 is negative"
141141
// For more information, see issue #1554
142142
// https://github.com/evmos/ethermint/issues/1554

app/ante/evm/eth_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (suite *AnteTestSuite) TestEthNonceVerificationDecorator() {
141141
{"invalid transaction type", &testutiltx.InvalidTx{}, func() {}, false, false},
142142
{"sender account not found", tx, func() {}, false, false},
143143
{
144-
"sender nonce missmatch",
144+
"sender nonce mismatch",
145145
tx,
146146
func() {
147147
acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr.Bytes())

app/ante/evm/utils_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgCreateValidator(from sdk.AccAddre
210210
valAddr,
211211
privEd.PubKey(),
212212
sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)),
213-
stakingtypes.NewDescription("moniker", "indentity", "website", "security_contract", "details"),
213+
stakingtypes.NewDescription("moniker", "identity", "website", "security_contract", "details"),
214214
stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()),
215215
sdk.OneInt(),
216216
)
@@ -227,7 +227,7 @@ func (suite *AnteTestSuite) CreateTestEIP712MsgCreateValidator2(from sdk.AccAddr
227227
privEd.PubKey(),
228228
sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)),
229229
// Ensure optional fields can be left blank
230-
stakingtypes.NewDescription("moniker", "indentity", "", "", ""),
230+
stakingtypes.NewDescription("moniker", "identity", "", "", ""),
231231
stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()),
232232
sdk.OneInt(),
233233
)

app/app.go

+7
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ import (
167167
v172 "github.com/haqq-network/haqq/app/upgrades/v1.7.2"
168168
v173 "github.com/haqq-network/haqq/app/upgrades/v1.7.3"
169169
v174 "github.com/haqq-network/haqq/app/upgrades/v1.7.4"
170+
v175 "github.com/haqq-network/haqq/app/upgrades/v1.7.5"
170171

171172
// NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens
172173
"github.com/haqq-network/haqq/x/ibc/transfer"
@@ -1268,6 +1269,12 @@ func (app *Haqq) setupUpgradeHandlers() {
12681269
v174.CreateUpgradeHandler(app.mm, app.configurator, app.AccountKeeper, app.LiquidVestingKeeper),
12691270
)
12701271

1272+
// v1.7.5 Turn off liquid vesting
1273+
app.UpgradeKeeper.SetUpgradeHandler(
1274+
v175.UpgradeName,
1275+
v175.CreateUpgradeHandler(app.mm, app.configurator, app.BankKeeper, app.LiquidVestingKeeper, app.Erc20Keeper, *app.EvmKeeper, app.AccountKeeper),
1276+
)
1277+
12711278
// When a planned update height is reached, the old binary will panic
12721279
// writing on disk the height and name of the update that triggered it
12731280
// This will read that value, and execute the preparations for the upgrade.

app/forks.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package app
22

33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
5+
56
"github.com/haqq-network/haqq/utils"
67
)
78

app/haqq_ante_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/cosmos/cosmos-sdk/types/tx/signing"
2020
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2121
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
22+
2223
// distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
2324
// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
2425
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

app/upgrades/v1.6.0/upgrades.go

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
99
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
1010
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
11+
1112
"github.com/haqq-network/haqq/utils"
1213

1314
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

app/upgrades/v1.6.4/upgrades.go

+2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import (
77
storetypes "github.com/cosmos/cosmos-sdk/store/types"
88
sdk "github.com/cosmos/cosmos-sdk/types"
99
"github.com/cosmos/cosmos-sdk/types/module"
10+
1011
"github.com/haqq-network/haqq/utils"
1112

1213
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
1314
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
15+
1416
coinomicskeeper "github.com/haqq-network/haqq/x/coinomics/keeper"
1517
coinomicstypes "github.com/haqq-network/haqq/x/coinomics/types"
1618
)

app/upgrades/v1.7.0/upgrades.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
2121
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
2222
ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"
23+
2324
coinomicstypes "github.com/haqq-network/haqq/x/coinomics/types"
2425
evmtypes "github.com/haqq-network/haqq/x/evm/types"
2526
feemarkettypes "github.com/haqq-network/haqq/x/feemarket/types"

app/upgrades/v1.7.4/handler.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func StretchLockupScheduleForAccounts(ctx sdk.Context, ak authkeeper.AccountKeep
3232
upcomingPeriods := liquidvestingtypes.ExtractUpcomingPeriods(vacc.GetStartTime(), vacc.GetEndTime(), vacc.LockupPeriods, ctx.BlockTime().Unix())
3333
pastPeriods := liquidvestingtypes.ExtractPastPeriods(vacc.GetStartTime(), vacc.GetEndTime(), vacc.LockupPeriods, ctx.BlockTime().Unix())
3434

35-
// streched upcoming periods
35+
// stretched upcoming periods
3636
stretchedUpcomingPeriods := stretchPeriods(ctx, upcomingPeriods, stretchLength, "account", vacc.GetAddress().String())
3737

3838
// add 1095 days (three years to the end time)
@@ -67,7 +67,7 @@ func StretchLockupScheduleForLiquidVestingTokens(ctx sdk.Context, lk liquidvesti
6767
upcomingPeriods := liquidvestingtypes.ExtractUpcomingPeriods(denom.StartTime.Unix(), denom.EndTime.Unix(), denom.LockupPeriods, ctx.BlockTime().Unix())
6868
pastPeriods := liquidvestingtypes.ExtractPastPeriods(denom.StartTime.Unix(), denom.EndTime.Unix(), denom.LockupPeriods, ctx.BlockTime().Unix())
6969

70-
// streched upcoming periods
70+
// stretched upcoming periods
7171
stretchedUpcomingPeriods := stretchPeriods(ctx, upcomingPeriods, stretchLength, "liquid", denom.DisplayDenom)
7272

7373
// add 1095 days (three years to the end time)

app/upgrades/v1.7.4/upgrades.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
liquidvestingkeeper "github.com/haqq-network/haqq/x/liquidvesting/keeper"
1212
)
1313

14-
// CreateUpgradeHandler creates an SDK upgrade handler for v1.7.3
14+
// CreateUpgradeHandler creates an SDK upgrade handler for v1.7.4
1515
func CreateUpgradeHandler(
1616
mm *module.Manager,
1717
configurator module.Configurator,

app/upgrades/v1.7.5/constants.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package v175
2+
3+
const (
4+
// UpgradeName is the shared upgrade plan name for network
5+
UpgradeName = "v1.7.5"
6+
)

0 commit comments

Comments
 (0)