Skip to content

Commit

Permalink
feat(upgrades): network upgrade v0.30.0 (#1906)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <troian.ap@gmail.com>
  • Loading branch information
troian authored Nov 21, 2023
1 parent 4cf3770 commit 36b9884
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/akash-network/node
go 1.21

require (
github.com/akash-network/akash-api v0.0.33
github.com/akash-network/akash-api v0.0.35
github.com/blang/semver/v4 v4.0.0
github.com/boz/go-lifecycle v0.1.1
github.com/cosmos/cosmos-sdk v0.45.16
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/akash-network/akash-api v0.0.33 h1:SvOht1F3BDz3el8XKC7lbRzc6D++kERs5wFRisMWzCY=
github.com/akash-network/akash-api v0.0.33/go.mod h1:pW5NnJNhxynCOUGEcgxa338GSU2qzMkpn3MMYcAY6O4=
github.com/akash-network/akash-api v0.0.35 h1:NrWtuvUlg4N+tNegPE7oNnNGaO3TRXIqm0Z5mSQEfI4=
github.com/akash-network/akash-api v0.0.35/go.mod h1:pW5NnJNhxynCOUGEcgxa338GSU2qzMkpn3MMYcAY6O4=
github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0=
github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw=
github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo=
Expand Down
5 changes: 5 additions & 0 deletions meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"skipped": false,
"from_binary": "v0.26.2",
"from_version": "v0.26.0"
},
"v0.30.0": {
"skipped": false,
"from_binary": "v0.28.2",
"from_version": "v0.28.0"
}
}
}
2 changes: 2 additions & 0 deletions tests/upgrade/upgrade-v0.30.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
4 changes: 4 additions & 0 deletions upgrades/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Goal of the upgrade here
Add new upgrades after this line based on the template above
-----

##### v0.30.0

1. fix `MatchGSpec` which used during Bid validation. Previous upgrade **v0.28.0** brought up resources offer.Existing implementation of `MatchGSpec` improperly validates offer against group spec, which rejects bids on multi-service deployments with unequal amount of replicas.

##### v0.28.0

1. Add resource offer for the bid, allowing providers to show details on the resources they offer, when order has wildcard resources, for example GPU.
Expand Down
7 changes: 0 additions & 7 deletions upgrades/software/v0.28.0/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/authz"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

apptypes "github.com/akash-network/node/app/types"
Expand Down Expand Up @@ -46,9 +45,3 @@ func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler {
return up.MM.RunMigrations(ctx, up.Configurator, fromVM)
}
}

type grantBackup struct {
granter sdk.AccAddress
grantee sdk.AccAddress
grant authz.Grant
}
11 changes: 11 additions & 0 deletions upgrades/software/v0.30.0/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Package v0_30_0
// nolint revive
package v0_30_0

import (
utypes "github.com/akash-network/node/upgrades/types"
)

func init() {
utypes.RegisterUpgrade(UpgradeName, initUpgrade)
}
47 changes: 47 additions & 0 deletions upgrades/software/v0.30.0/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Package v0_30_0
// nolint revive
package v0_30_0

import (
"fmt"

"github.com/tendermint/tendermint/libs/log"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

apptypes "github.com/akash-network/node/app/types"
utypes "github.com/akash-network/node/upgrades/types"
)

const (
UpgradeName = "v0.30.0"
)

type upgrade struct {
*apptypes.App
log log.Logger
}

var _ utypes.IUpgrade = (*upgrade)(nil)

func initUpgrade(log log.Logger, app *apptypes.App) (utypes.IUpgrade, error) {
up := &upgrade{
App: app,
log: log.With("module", fmt.Sprintf("upgrade/%s", UpgradeName)),
}

return up, nil
}

func (up *upgrade) StoreLoader() *storetypes.StoreUpgrades {
return &storetypes.StoreUpgrades{}
}

func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return up.MM.RunMigrations(ctx, up.Configurator, fromVM)
}
}
2 changes: 2 additions & 0 deletions upgrades/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package upgrades

import (
// nolint: revive
_ "github.com/akash-network/node/upgrades/software/v0.30.0"
// nolint: revive
_ "github.com/akash-network/node/upgrades/software/v0.28.0"
// nolint: revive
Expand Down

0 comments on commit 36b9884

Please sign in to comment.