Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CNS-single-provider #1689

Merged
merged 67 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
484251e
wip
Sep 11, 2024
a8c1e68
handle rewards
Sep 11, 2024
737e0e4
fix the genesis
Sep 11, 2024
0491c43
Merge branch 'main' into CNS-single-provider
Yaroms Sep 11, 2024
5db8143
add metadata and aftermodify
Sep 11, 2024
67636a4
Merge branch 'CNS-single-provider' of https://github.com/lavanet/lava…
Sep 11, 2024
6e4bba8
done
Sep 11, 2024
0dc711a
works sanity
Sep 11, 2024
373d527
some fixes
Sep 12, 2024
d97f273
remove delegation when zero
Sep 12, 2024
9baca37
added design issues
Sep 16, 2024
f475c1c
fix
Sep 16, 2024
367b3b3
now all entries are self
Sep 16, 2024
a471a57
remove proto break check
Sep 16, 2024
09efb19
added dualstaking migrator
Sep 19, 2024
8fef340
temp comment
Sep 19, 2024
c049481
added migration for metadata
Sep 19, 2024
41d0891
fix migration
Sep 19, 2024
0573afa
added metadata query
Sep 19, 2024
dbf4f36
fix health
Sep 19, 2024
5f9413e
small fixes
Sep 19, 2024
a22a80c
lint
Sep 19, 2024
67baa9d
lint
Sep 19, 2024
07745e6
Merge branch 'main' into CNS-single-provider
Yaroms Sep 19, 2024
391608a
Trigger workflow
Sep 19, 2024
c83629b
use lava slices
Sep 19, 2024
b2865e5
lint
Sep 19, 2024
44686d8
small changes
Sep 19, 2024
28f3d73
fix
Sep 19, 2024
cea2532
Use Go version file for Lint job
luis02lopez Sep 20, 2024
a95ed84
fix
Sep 22, 2024
ea01dab
Merge branch 'CNS-single-provider' of github.com:lavanet/lava into CN…
Sep 22, 2024
4fb89a6
unitest fixes
Sep 22, 2024
a2f6da6
fix tests
Sep 22, 2024
1a2abd5
fix
Sep 22, 2024
ffa8eba
make delegate commission global
Sep 22, 2024
bb2232a
put commision in query
Sep 22, 2024
5e005f7
fix unitests
Sep 22, 2024
32844bf
lint
Sep 22, 2024
450b257
fixes
Sep 22, 2024
4eaba69
add tests
Sep 23, 2024
75e499d
adding tests and fix
Sep 23, 2024
1e1647b
add comments to test
Sep 23, 2024
dae47e1
add move stake command
Sep 29, 2024
5811cdf
Merge branch 'main' into CNS-single-provider
Yaroms Sep 29, 2024
abe33c8
add distribute CLI
Sep 29, 2024
e9ff090
move the description
Sep 29, 2024
469d7cc
Merge branch 'main' into CNS-single-provider
omerlavanet Oct 1, 2024
60a2749
pr changes
Oct 6, 2024
4ea126e
pr changes
Oct 7, 2024
f331f5e
pr fix
Oct 7, 2024
dc9d656
pr change
Oct 8, 2024
2db57e0
Merge branch 'CNS-single-provider' of github.com:lavanet/lava into CN…
Oct 8, 2024
cec8ddc
add test for when provider moves stake
Oct 8, 2024
11bfa5a
pr test
Oct 8, 2024
514071a
added commission and description test
Oct 8, 2024
6564394
move stake using vault
Oct 8, 2024
7348fc2
add migration tests
Oct 9, 2024
b1c10af
add test
Oct 9, 2024
2cbef8d
small fix
Oct 9, 2024
4dcff7b
add test for distributions
Oct 9, 2024
672c0e2
Merge branch 'main' into CNS-single-provider
Oct 9, 2024
878a0d3
lint go version
Oct 9, 2024
fa35e6f
lint
Oct 9, 2024
e1e5ab4
fix test
Oct 9, 2024
82424df
add readme
Oct 10, 2024
d60f802
pr changes
Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.20.5

- name: Checkout code
uses: actions/checkout@v4

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
# with:
# input: "proto"

break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"
# break-check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/[email protected]
# - uses: bufbuild/buf-breaking-action@v1
# with:
# input: "proto"
# against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"

validate-check:
runs-on: ubuntu-latest
Expand Down
36 changes: 0 additions & 36 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,42 +166,6 @@ const (

// Upgrades add here future upgrades (upgrades.Upgrade)
var Upgrades = []upgrades.Upgrade{
upgrades.Upgrade_0_22_0,
upgrades.Upgrade_0_23_0,
upgrades.Upgrade_0_23_2,
upgrades.Upgrade_0_23_4,
upgrades.Upgrade_0_23_5,
upgrades.Upgrade_0_24_0,
upgrades.Upgrade_0_25_0,
upgrades.Upgrade_0_25_1,
upgrades.Upgrade_0_25_2,
upgrades.Upgrade_0_26_0,
upgrades.Upgrade_0_26_1,
upgrades.Upgrade_0_26_2,
upgrades.Upgrade_0_27_0,
upgrades.Upgrade_0_30_0,
upgrades.Upgrade_0_30_1,
upgrades.Upgrade_0_30_2,
upgrades.Upgrade_0_31_0,
upgrades.Upgrade_0_31_1,
upgrades.Upgrade_0_32_0,
upgrades.Upgrade_0_32_3,
upgrades.Upgrade_0_33_0,
upgrades.Upgrade_0_34_0,
upgrades.Upgrade_0_35_0,
upgrades.Upgrade_1_0_0,
upgrades.Upgrade_1_0_1,
upgrades.Upgrade_1_1_0,
upgrades.Upgrade_1_2_0,
upgrades.Upgrade_2_0_0,
upgrades.Upgrade_2_1_0,
upgrades.Upgrade_2_1_1,
upgrades.Upgrade_2_1_3,
upgrades.Upgrade_2_2_0,
upgrades.Upgrade_2_4_0,
upgrades.Upgrade_2_5_0,
upgrades.Upgrade_3_0_0,
upgrades.Upgrade_3_0_1,
upgrades.Upgrade_3_1_0,
}

Expand Down
261 changes: 0 additions & 261 deletions app/upgrades/empty_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,8 @@ import (
store "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
"github.com/cosmos/cosmos-sdk/x/group"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
"github.com/lavanet/lava/v3/app/keepers"
v1 "github.com/lavanet/lava/v3/x/downtime/v1"
dualstakingtypes "github.com/lavanet/lava/v3/x/dualstaking/types"
fixationtypes "github.com/lavanet/lava/v3/x/fixationstore/types"
protocoltypes "github.com/lavanet/lava/v3/x/protocol/types"
rewardstypes "github.com/lavanet/lava/v3/x/rewards/types"
)

func defaultUpgradeHandler(
Expand Down Expand Up @@ -45,256 +34,6 @@ func defaultUpgradeHandler(
// },
// }

var Upgrade_0_22_0 = Upgrade{
UpgradeName: "v0.22.0",
CreateUpgradeHandler: v0_22_0_UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

func v0_22_0_UpgradeHandler(
m *module.Manager,
c module.Configurator,
bapm BaseAppParamManager,
lk *keepers.LavaKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
lk.DowntimeKeeper.SetParams(ctx, v1.DefaultParams())
lk.ProtocolKeeper.SetParams(ctx, protocoltypes.DefaultParams())
return m.RunMigrations(ctx, c, vm)
}
}

var Upgrade_0_23_0 = Upgrade{
UpgradeName: "v0.23.0",
CreateUpgradeHandler: v0_23_0_UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{Added: []string{dualstakingtypes.StoreKey}},
}

func v0_23_0_UpgradeHandler(
m *module.Manager,
c module.Configurator,
bapm BaseAppParamManager,
lk *keepers.LavaKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
lk.PairingKeeper.InitProviderQoS(ctx, *fixationtypes.DefaultGenesis())
return m.RunMigrations(ctx, c, vm)
}
}

var Upgrade_0_23_2 = Upgrade{
UpgradeName: "v0.23.2", // upgrade name
CreateUpgradeHandler: defaultUpgradeHandler, // upgrade handler (default)
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_23_4 = Upgrade{
UpgradeName: "v0.23.4",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_23_5 = Upgrade{
UpgradeName: "v0.23.5",
CreateUpgradeHandler: v0_23_0_UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{Added: []string{dualstakingtypes.StoreKey}},
}

var Upgrade_0_24_0 = Upgrade{
UpgradeName: "v0.24.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_25_0 = Upgrade{
UpgradeName: "v0.25.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_25_1 = Upgrade{
UpgradeName: "v0.25.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_25_2 = Upgrade{
UpgradeName: "v0.25.2",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_26_0 = Upgrade{
UpgradeName: "v0.26.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_26_1 = Upgrade{
UpgradeName: "v0.26.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_26_2 = Upgrade{
UpgradeName: "v0.26.2",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_27_0 = Upgrade{
UpgradeName: "v0.27.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_30_0 = Upgrade{
UpgradeName: "v0.30.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_30_1 = Upgrade{
UpgradeName: "v0.30.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_30_2 = Upgrade{
UpgradeName: "v0.30.2",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_31_0 = Upgrade{
UpgradeName: "v0.31.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_31_1 = Upgrade{
UpgradeName: "v0.31.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_32_0 = Upgrade{
UpgradeName: "v0.32.0",
CreateUpgradeHandler: v0_32_0_UpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{rewardstypes.StoreKey},
Deleted: []string{minttypes.StoreKey},
},
}

var Upgrade_0_32_3 = Upgrade{
UpgradeName: "v0.32.3",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_33_0 = Upgrade{
UpgradeName: "v0.33.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_0_34_0 = Upgrade{
UpgradeName: "v0.34.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{icahosttypes.StoreKey, icacontrollertypes.StoreKey},
},
}

var Upgrade_0_35_0 = Upgrade{
UpgradeName: "v0.35.0",
CreateUpgradeHandler: v_35_0,
StoreUpgrades: store.StoreUpgrades{Added: []string{authzkeeper.StoreKey, group.StoreKey}},
}

var Upgrade_1_0_0 = Upgrade{
UpgradeName: "v1.0.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_1_0_1 = Upgrade{
UpgradeName: "v1.0.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_1_1_0 = Upgrade{
UpgradeName: "v1.1.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_1_2_0 = Upgrade{
UpgradeName: "v1.2.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_0_0 = Upgrade{
UpgradeName: "v2.0.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{packetforwardtypes.StoreKey},
},
}

var Upgrade_2_1_0 = Upgrade{
UpgradeName: "v2.1.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_1_1 = Upgrade{
UpgradeName: "v2.1.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_1_3 = Upgrade{
UpgradeName: "v2.1.3",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_2_0 = Upgrade{
UpgradeName: "v2.2.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{packetforwardtypes.StoreKey},
},
}

var Upgrade_2_4_0 = Upgrade{
UpgradeName: "v2.4.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_2_5_0 = Upgrade{
UpgradeName: "v2.5.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_3_0_0 = Upgrade{
UpgradeName: "v3.0.0",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_3_0_1 = Upgrade{
UpgradeName: "v3.0.1",
CreateUpgradeHandler: defaultUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{},
}

var Upgrade_3_1_0 = Upgrade{
UpgradeName: "v3.1.0",
CreateUpgradeHandler: defaultUpgradeHandler,
Expand Down
Loading
Loading