-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Assaf Morami <[email protected]>
- Loading branch information
Showing
39 changed files
with
4,140 additions
and
1,952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package v25 | ||
|
||
import ( | ||
errorsmod "cosmossdk.io/errors" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
recordskeeper "github.com/Stride-Labs/stride/v24/x/records/keeper" | ||
stakeibckeeper "github.com/Stride-Labs/stride/v24/x/stakeibc/keeper" | ||
stakeibctypes "github.com/Stride-Labs/stride/v24/x/stakeibc/types" | ||
staketiakeeper "github.com/Stride-Labs/stride/v24/x/staketia/keeper" | ||
staketiatypes "github.com/Stride-Labs/stride/v24/x/staketia/types" | ||
) | ||
|
||
const UpgradeName = "v25" | ||
|
||
// CreateUpgradeHandler creates an SDK upgrade handler for v25 | ||
func CreateUpgradeHandler( | ||
mm *module.Manager, | ||
configurator module.Configurator, | ||
bankKeeper bankkeeper.Keeper, | ||
recordsKeeper recordskeeper.Keeper, | ||
stakeibcKeeper stakeibckeeper.Keeper, | ||
staketiaKeeper staketiakeeper.Keeper, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
ctx.Logger().Info("Starting upgrade v25...") | ||
|
||
// Migrate staketia to stakeibc | ||
if err := staketiakeeper.InitiateMigration(ctx, staketiaKeeper, bankKeeper, recordsKeeper, stakeibcKeeper); err != nil { | ||
return vm, errorsmod.Wrapf(err, "unable to migrate staketia to stakeibc") | ||
} | ||
|
||
// Add celestia validators | ||
if err := AddCelestiaValidators(ctx, stakeibcKeeper); err != nil { | ||
return vm, errorsmod.Wrapf(err, "unable to add celestia validators") | ||
} | ||
|
||
ctx.Logger().Info("Running module migrations...") | ||
return mm.RunMigrations(ctx, configurator, vm) | ||
} | ||
} | ||
|
||
// Adds the full celestia validator set, with a 0 delegation for each | ||
func AddCelestiaValidators(ctx sdk.Context, k stakeibckeeper.Keeper) error { | ||
for _, validatorConfig := range Validators { | ||
validator := stakeibctypes.Validator{ | ||
Name: validatorConfig.name, | ||
Address: validatorConfig.address, | ||
Weight: validatorConfig.weight, | ||
} | ||
|
||
if err := k.AddValidatorToHostZone(ctx, staketiatypes.CelestiaChainId, validator, false); err != nil { | ||
return err | ||
} | ||
|
||
// Query and store the validator's sharesToTokens rate | ||
if err := k.QueryValidatorSharesToTokensRate(ctx, staketiatypes.CelestiaChainId, validatorConfig.address); err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v25_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/Stride-Labs/stride/v24/app/apptesting" | ||
) | ||
|
||
type UpgradeTestSuite struct { | ||
apptesting.AppTestHelper | ||
} | ||
|
||
func (s *UpgradeTestSuite) SetupTest() { | ||
s.Setup() | ||
} | ||
|
||
func TestKeeperTestSuite(t *testing.T) { | ||
suite.Run(t, new(UpgradeTestSuite)) | ||
} | ||
|
||
func (s *UpgradeTestSuite) TestUpgrade() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package v25 | ||
|
||
var Validators = []struct { | ||
address string | ||
name string | ||
weight uint64 | ||
}{ | ||
{address: "celestiavaloper1uvytvhunccudw8fzaxvsrumec53nawyj939gj9", name: "go", weight: 954}, | ||
{address: "celestiavaloper1e2p4u5vqwgum7pm9vhp0yjvl58gvhfc6yfatw4", name: "finoaconsensusservices", weight: 935}, | ||
{address: "celestiavaloper15urq2dtp9qce4fyc85m6upwm9xul3049gwdz0x", name: "chorusone", weight: 806}, | ||
{address: "celestiavaloper1r4kqtye4dzacmrwnh6f057p50pdjm8g59tlhhg", name: "p2porg", weight: 643}, | ||
{address: "celestiavaloper1jkuw8rxxrsgn9pq009987kzelkp46cgcaa7lhj", name: "cuck", weight: 519}, | ||
{address: "celestiavaloper1xqc7w3pe38kg4tswjt7mnvks7gy4p38vtsuycj", name: "figment", weight: 344}, | ||
{address: "celestiavaloper1ac4mnwg79gyvd0x5trl2fgjv07lgfas02jf378", name: "p-opsteam", weight: 334}, | ||
{address: "celestiavaloper1uqj5ul7jtpskk9ste9mfv6jvh0y3w34vtpz3gw", name: "cosmostation", weight: 303}, | ||
{address: "celestiavaloper1mhux0vt6qszz8qwv8axggt02jjm7tuvdfhz78j", name: "twinstake", weight: 294}, | ||
{address: "celestiavaloper1uwmf03ke52vld2sa9khs0nslpgzwsm5xs5e4pn", name: "keplr", weight: 253}, | ||
{address: "celestiavaloper1r5xt7twqmh39ky72f4txxjrhlt2z0qwwmdal8c", name: "imperator", weight: 242}, | ||
{address: "celestiavaloper1hm2d8e6nd5ngtlte3hlded03vgj3rer94vmdml", name: "nodesguru", weight: 219}, | ||
{address: "celestiavaloper1v5hrqlv8dqgzvy0pwzqzg0gxy899rm4klzxm07", name: "ai", weight: 207}, | ||
{address: "celestiavaloper1jgqewpzn7dww5tlpnkypm72fm8tjznmw7ll7ls", name: "polkachu", weight: 195}, | ||
{address: "celestiavaloper15kpw453rgqrranltr8pcy9muryf3jjd7esw38j", name: "binarybuilders", weight: 193}, | ||
{address: "celestiavaloper1463wx5xkus5hyugyecvlhv9qpxklz62kyhwcts", name: "galaxydigital", weight: 184}, | ||
{address: "celestiavaloper133t4gpv4vhpqgfn9gr8l4u423zrglg8rkqeupr", name: "upnode|0%fee", weight: 182}, | ||
{address: "celestiavaloper1j2jq259d3rrc24876gwxg0ksp0lhd8gy49k6st", name: "qubelabs", weight: 180}, | ||
{address: "celestiavaloper1wu24jxpn9j0580ehjz344d58cf3t7lzrrgqmnr", name: "stakingfacilities", weight: 170}, | ||
{address: "celestiavaloper1nwu3ugynh8m6r7aphv0uxnca84t7gnruvyye9c", name: "xprv", weight: 166}, | ||
{address: "celestiavaloper1ftmw4wh8dq2ljw0xq3xgg00dl7l20se3lrml7q", name: "hextechnologies", weight: 165}, | ||
{address: "celestiavaloper1murrqgqahxevedty0nzqrn5hj434fvffxufxcl", name: "01node", weight: 165}, | ||
{address: "celestiavaloper1amxp3ah9anq4pmpnsknls7sql3kras9hs8pu0g", name: "iykyk", weight: 162}, | ||
{address: "celestiavaloper187avawwq7qhanrkxf45mayztdqsr49hu8lezdh", name: "zkv", weight: 144}, | ||
{address: "celestiavaloper1zqjpfxtv3yp6kdlgra4hc9zehxgvpaw82hxr5w", name: "nocturnallabs", weight: 138}, | ||
{address: "celestiavaloper1c9ye54e3pzwm3e0zpdlel6pnavrj9qqvjeqh0m", name: "nansen", weight: 105}, | ||
{address: "celestiavaloper1qe8uuf5x69c526h4nzxwv4ltftr73v7q5qhs58", name: "stakecito", weight: 98}, | ||
{address: "celestiavaloper19v94c3z7ckarwsum76kaagma0wqsqhh5nl5zqg", name: "validatus", weight: 98}, | ||
{address: "celestiavaloper1demcj83q7nxt6gtqxlu7qsmwqpt4jspj3alr92", name: "mzonder", weight: 87}, | ||
{address: "celestiavaloper1knn88yl08ctsdrtxvfp39jywt7rph9ptv7532y", name: "blackblocks", weight: 83}, | ||
{address: "celestiavaloper1pmn4cjwf26hkcpvyl322glhpdpcemcel8ca2vl", name: "staked", weight: 67}, | ||
{address: "celestiavaloper1zdrz4w2pwwffdvmpum0626vycel9caay9n3pll", name: "w3hitchhiker", weight: 52}, | ||
{address: "celestiavaloper19f0w9svr905fhefusyx4z8sf83j6et0g57nch8", name: "nodestake", weight: 50}, | ||
{address: "celestiavaloper140l6y2gp3gxvay6qtn70re7z2s0gn57zcvqd22", name: "lavenderfivenodes", weight: 47}, | ||
{address: "celestiavaloper1rcm7tth05klgkqpucdhm5hexnk49dfda3l3hak", name: "allnodes", weight: 47}, | ||
{address: "celestiavaloper1v987evnk7hsqct7smdqpxqprhvlcxgt43kyewc", name: "alphab", weight: 46}, | ||
{address: "celestiavaloper14v4ush42xewyeuuldf6jtdz0a7pxg5fwrlumwf", name: "latamnodes", weight: 43}, | ||
{address: "celestiavaloper1m58punvt32u07ra4p6x7krgxakye3m90rzgm4c", name: "nodeguardians", weight: 41}, | ||
{address: "celestiavaloper107lwx458gy345ag2afx9a7e2kkl7x49y3433gj", name: "enigma", weight: 40}, | ||
{address: "celestiavaloper1pnzrk7yzx0nr9xrcjyswj7ram4qxlrfz28xvn6", name: "nakoturk", weight: 39}, | ||
{address: "celestiavaloper17p8y0sm76zhrtjny98tknevafvlq9860ehykz3", name: "kjnodes", weight: 39}, | ||
{address: "celestiavaloper1un77nfm6axkhkupe8fk4xl6fd4adz3y59fucpu", name: "easy2stake", weight: 35}, | ||
{address: "celestiavaloper1593ns00rftlqp2gyu6wdmrqpgv5frv0hsf4sw2", name: "forbole", weight: 33}, | ||
{address: "celestiavaloper1djqecw6nn5tydxq0shan7srv8j65clsfmnxcfu", name: "kiln", weight: 33}, | ||
{address: "celestiavaloper14ntfv0qkg8522xe0pvrfgqxcmnj5x466v8z3tl", name: "b-harvest", weight: 32}, | ||
{address: "celestiavaloper19y52qzj4hxw0u68krfptkjlm77cvth8dgum7yu", name: "brightlystake", weight: 31}, | ||
{address: "celestiavaloper1dlsl4u42ycahzjfwc6td6upgsup9tt7cz8vqm4", name: "stakin", weight: 30}, | ||
{address: "celestiavaloper1eualhqh07w7p45g45hvrjagkcxsfnflzdw5jzg", name: "everstake", weight: 29}, | ||
{address: "celestiavaloper1ej2es5fjztqjcd4pwa0zyvaevtjd2y5wh8xeg4", name: "frens", weight: 28}, | ||
{address: "celestiavaloper1yknsyf9ws4ugtv3r9g43kwqkne4zmrupcxhlth", name: "stakelyio", weight: 27}, | ||
{address: "celestiavaloper1vje2he3pcq3w5udyvla7zm9qd5yes6hzffsjxj", name: "dsrv", weight: 26}, | ||
{address: "celestiavaloper1auqmdc2pnx5gxvakjdsc9v9zc4y2ga0hcaxg9x", name: "projectblanc", weight: 25}, | ||
{address: "celestiavaloper1ryyzale2qcp3e35k0ze3kc0mpfdtw9jagcss3k", name: "larryengineer", weight: 24}, | ||
{address: "celestiavaloper1lqfqp2w65pjsu6hg3qg4qfp4t2t6da4a3gg8ad", name: "stakelab", weight: 24}, | ||
{address: "celestiavaloper1u4vhh70lwlt2va7hw5evzl6sap92t0m9nqzmud", name: "swissstaking", weight: 22}, | ||
{address: "celestiavaloper17h2x3j7u44qkrq0sk8ul0r2qr440rwgj8g0ng0", name: "freshstaking", weight: 22}, | ||
{address: "celestiavaloper1vdp8q3v72mntewqqak56yk3gzz7h5ukmeym9hk", name: "stakingcabin", weight: 22}, | ||
{address: "celestiavaloper17srrapx2cvqyyy4rg3menq0hn86py8f3klelhl", name: "contributiondao", weight: 21}, | ||
{address: "celestiavaloper1vl3dkus7g0cj4lg0e2jrqk2reukmlht0ee7cr4", name: "bwarelabs", weight: 20}, | ||
{address: "celestiavaloper12t63cy8kn5n7qw77xvjn00ymcr0uuvz2vh8p79", name: "lemniscap", weight: 18}, | ||
{address: "celestiavaloper1njzuxja7aa7w2d69ldg2r8c6qhjzfcd42huq0x", name: "kek", weight: 17}, | ||
{address: "celestiavaloper19kr4f4ndyek6kwa0vt3w4un8he0tkekufa8t2g", name: "staking4all", weight: 17}, | ||
{address: "celestiavaloper1pavac9yrlgwyw6v9yx84sttc96n9ee9zrja2u7", name: "gunter", weight: 17}, | ||
{address: "celestiavaloper1cs37tvmahavw8xcnzcgyz342sh0al37ma4zqat", name: "cumulo", weight: 17}, | ||
{address: "celestiavaloper138jl42zlxue4wpvnugcdqhxjmyd2vpt6qhs5ls", name: "cryptocrewvalidators", weight: 16}, | ||
{address: "celestiavaloper125xazqstxpav7ekrt4w8km7ccdu8ytj40xug70", name: "validatrium", weight: 16}, | ||
{address: "celestiavaloper1slnzmhg3kwhc2c5y9atrt5jtmt3sauzzp4tguj", name: "bitnordic", weight: 16}, | ||
{address: "celestiavaloper1qx43f066sh6728avms4qq09cj2a3mg83dgjh22", name: "unbonding-pleaseredelegate", weight: 16}, | ||
{address: "celestiavaloper1qxeza0sa037u35p3ze8p7ka7emajvydnyjlp07", name: "chainodetech", weight: 15}, | ||
{address: "celestiavaloper1s0lankh33kprer2l22nank5rvsuh9ksa2xcd2y", name: "encapsulate(fkakingsuper)", weight: 15}, | ||
{address: "celestiavaloper1q8teur40emyun60et4wh5z6yj5669stgz8xs59", name: "moonlet", weight: 15}, | ||
{address: "celestiavaloper1yecxnyegvgm5dwsx0r3jsgr74ju6mlxdwkxx8g", name: "meria", weight: 15}, | ||
{address: "celestiavaloper1cmaga4f6f7pttuwzfldn9067ld3090uw0e6zq8", name: "wavefive", weight: 15}, | ||
{address: "celestiavaloper10f8l8m4879h40848rsvxat797t3a5ghgdsjgzl", name: "conqueror", weight: 15}, | ||
{address: "celestiavaloper139mu0a0ucz0gmrkavm5wjar2lpx7yvxq3e25e5", name: "noders", weight: 15}, | ||
{address: "celestiavaloper1l0zmpm02u240crndlj7hkvlj5azuglv4emfczt", name: "stakesquid", weight: 15}, | ||
{address: "celestiavaloper1qdfdh8stxpkj4zz46x2n9ejyyy9h0c86425yjm", name: "stakerspace", weight: 14}, | ||
{address: "celestiavaloper1st4h4ymu52hwtl3s0n298t6adj0vputx8jw8xt", name: "spidey", weight: 14}, | ||
{address: "celestiavaloper1sl97x54v0u3extuj2zrf7h0qrrtpgpslfrjjry", name: "strangelove", weight: 14}, | ||
{address: "celestiavaloper1ax83exaawlmy5p2qn22gcynrchwdntt5xvj0qu", name: "kooltek68", weight: 13}, | ||
{address: "celestiavaloper1vfydl5r98zev8xc7j0mus28r63jcklsu63vuah", name: "counterpoint", weight: 13}, | ||
{address: "celestiavaloper1cqgzxhn3dqd58xexz8yley2wntdvym4emzvpd7", name: "blockscope", weight: 13}, | ||
{address: "celestiavaloper1t345w0vxnyyrf4eh43lpd3jl7z378rtsdn9tz3", name: "activenodes", weight: 12}, | ||
{address: "celestiavaloper1clf3nqp89h97umhl4fmcqr642jz6rszcxegjc6", name: "partnerstaking", weight: 12}, | ||
{address: "celestiavaloper1q2kaajedxm0r5xc0twdqz6atap96502d67yjyj", name: "mhventures", weight: 10}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.