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

dApp Staking v3 - Incorrect Loyalty Status Fix #1136

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

Dinonard
Copy link
Member

Pull Request Summary

Fixes an issue when loyalty status would persist even though staker fully unstaked during the Voting subperiod.

@Dinonard Dinonard changed the base branch from master to feat/cycle-alignment-handler January 16, 2024 10:27
@Dinonard Dinonard added the runtime This PR/Issue is related to the topic “runtime”. label Jan 16, 2024
Copy link

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/xvm/src 0% 0%
pallets/dapp-staking-v3/src/test 0% 0%
precompiles/dapp-staking-v3/src 90% 0%
pallets/xc-asset-config/src 53% 0%
primitives/src 58% 0%
precompiles/xcm/src 72% 0%
pallets/inflation/src 69% 0%
precompiles/xvm/src 74% 0%
primitives/src/xcm 66% 0%
pallets/dapp-staking-v3/src 76% 0%
pallets/dapps-staking/src 81% 0%
pallets/static-price-provider/src 58% 0%
pallets/block-rewards-hybrid/src 87% 0%
precompiles/unified-accounts/src 100% 0%
precompiles/substrate-ecdsa/src 74% 0%
chain-extensions/types/assets/src 0% 0%
pallets/ethereum-checked/src 48% 0%
pallets/astar-xcm-benchmarks/src 0% 0%
pallets/dapp-staking-migration/src 39% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/dapps-staking/src/pallet 85% 0%
pallets/astar-xcm-benchmarks/src/fungible 0% 0%
pallets/dapp-staking-v3/src/benchmarking 0% 0%
pallets/unified-accounts/src 84% 0%
pallets/xvm/src 40% 0%
chain-extensions/types/unified-accounts/src 0% 0%
pallets/collator-selection/src 69% 0%
precompiles/sr25519/src 64% 0%
pallets/astar-xcm-benchmarks/src/generic 0% 0%
chain-extensions/types/xvm/src 0% 0%
pallets/dynamic-evm-base-fee/src 81% 0%
precompiles/assets-erc20/src 81% 0%
precompiles/dapp-staking-v3/src/test 0% 0%
chain-extensions/pallet-assets/src 56% 0%
pallets/dapp-staking-v3/rpc/runtime-api/src 0% 0%
precompiles/dapps-staking/src 94% 0%
Summary 70% (3261 / 4688) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Member

@ashutoshvarma ashutoshvarma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Do we need a separate (negative) test for loyal stakers just to make sure it doesn't popup in future?

@Dinonard
Copy link
Member Author

LGTM! Do we need a separate (negative) test for loyal stakers just to make sure it doesn't popup in future?

The worst thing is that I wrote a test for this and set incorrect expectations, even added an incorrect comment. 🤦‍♂️
Current test covers partial & full-unstake during Voting, with appropriate checks.

@Dinonard Dinonard merged commit 0f8580b into feat/cycle-alignment-handler Jan 17, 2024
8 of 10 checks passed
@Dinonard Dinonard deleted the fix/loyalty-status branch January 17, 2024 06:34
Dinonard added a commit that referenced this pull request Jan 17, 2024
* Fix for incorrect add stake

* Minor adjustments

* Adjustments

* Typo & renaming

* More review adjustments

* Cycle Alignment

* dApp staking modificiations

* Fix tests

* Migration logic

* integration tests

* Changes,updated weights

* Minor changes

* Format

* Fixes

* Fix failing UTs

* Fix for incorrect loyalty flag setting (#1136)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime This PR/Issue is related to the topic “runtime”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants