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

Invalid pallet session/pallet staking flow: purge_keys can decrement consumer ref count on wrong controller. #330

Open
gui1117 opened this issue Mar 22, 2021 · 2 comments
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gui1117
Copy link
Contributor

gui1117 commented Mar 22, 2021

if I have 3 account: stash, controller_1 and controller_2.

I bound stash to controller_1,
then call set_keys from this controller_1, controller_1 has one consumer refcount increase.
then call unbond, and later call withdraw_unbonded.
then bond stash to controller_2,
than call purge_keys from this controller_2, the consumer refcount decrement silently fails and logs an error.

While it is not possible to do an attack with this. I think it is still an error to have a dec_consumer which fails silently. And an account with a consumer refcount which is not removable.

Fixing this issue can also fix ppl having issue with unbonded stash and controller still being used by pallet_session #975, but I think it is more a UI issue.
Maybe a solution could be to have a consumer refcount increase on the stash instead of the controller in pallet_session.

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale label Jul 7, 2021
@gui1117
Copy link
Contributor Author

gui1117 commented Jul 8, 2021

the invalid refcount is still sensible to me, it is not harmful, but it shouldn't be possible to trigger this

@stale stale bot removed the A5-stale label Jul 8, 2021
@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed T1-runtime labels Aug 25, 2023
claravanstaden pushed a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
* Don't panic

* Add more comments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 26, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 27, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Backlog
Development

No branches or pull requests

3 participants