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!: port LSM module to SDK v0.50.x #13

Open
wants to merge 40 commits into
base: release/v0.50.x
Choose a base branch
from

Conversation

stana-miric
Copy link
Collaborator

@stana-miric stana-miric commented Feb 29, 2024

Description

Port the LSM module changes from feature/v0.47.x-ics-lsm
Ported PRs:
cosmos#18694
cosmos#19056
cosmos#19076
cosmos#19491
cosmos#19614
cosmos#20444

Backported:
cosmos#17352 and cosmos#18214 and partially cosmos#18737

Except those changes, code is adapted to follow the changes from sdk v0.50 such as the way addresses are parsed from strings and use of LegacyDec values. Also, when reviewing pay attention to the following changes:

x/staking/keeper/msg_server.go
->RedeemTokensForShares()
- GetDelegation used to return bool, and now returns error. If delegation is not found, types.ErrNoDelegation is returned and the code is changed according to it.

x/staking/keeper/liquid_stake.go
->RemoveExpiredTokenizeShareLocks()
- modified signature to return error
->GetTotalLiquidStakedTokens()
- added panic() call if store.Get() fails, because other panic() already existed before
->CheckExceedsGlobalLiquidStakingCap()
- modified signature to return error
->GetTokenizeSharesLock()
- added panic() call if store.Get() fails, because other panic() already existed before
->GetPendingTokenizeShareAuthorizations()
- added panic() call if store.Get() fails, because it makes more sense than returning an error

x/staking/keeper/tokenize_share_record.go
->hasTokenizeShareRecord()
- modified signature to return error
->GetLastTokenizeShareRecordID()
- added panic() call if store.Get() fails, because error should be returned only if the key is nil, which is not the case

x/staking/keeper/params.go
ValidatorBondFactor(), GlobalLiquidStakingCap(), ValidatorLiquidStakingCap()
- modified signature to return error

x/distribution/keeper/keeper.go
->WithdrawSingleShareRecordReward()
- this is only called from staking module hooks in RedeemTokensForShares() and delegation is removed as part of that execution, so it will never exist when called in WithdrawSingleShareRecordReward()
- we made the same change as in RedeemTokensForShares()

proto/cosmos/staking/v1beta1/tx.proto
proto/cosmos/distribution/v1beta1/tx.proto
-> for newly added msgs, ValidateBasic is in the msg server instead in separate ValidateBasic fn (core sdk v0.50 changed this for other msgs, so we addapted newly added lsm msgs according to this)


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

dusan-maksimovic and others added 6 commits February 9, 2024 16:06
Co-authored-by: Dusan Maksimovic <[email protected]>
Co-authored-by: Dusan Maksimovic <[email protected]>
mergify bot and others added 9 commits June 19, 2024 20:39
…osmos#20805)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
…osmos#20836)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
…tGenesis` in simulation test (backport cosmos#18196) (cosmos#20897)

Co-authored-by: Chenqun Lu <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
… for simulation test. (backport cosmos#17911) (cosmos#20909)

Co-authored-by: Chenqun Lu <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
@mpoke
Copy link
Collaborator

mpoke commented Aug 22, 2024

@stana-miric I guess this PR can be closed now, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants