Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Developer Documentation Needed on Proper Usage of Reference Counters #965

Closed
shawntabrizi opened this issue Apr 8, 2021 · 3 comments · Fixed by #1006
Closed

Developer Documentation Needed on Proper Usage of Reference Counters #965

shawntabrizi opened this issue Apr 8, 2021 · 3 comments · Fixed by #1006
Assignees
Labels
T2-Page Documentation which should live as a detailed external page

Comments

@shawntabrizi
Copy link
Contributor

After a review of: paritytech/substrate#8221

The auditing team said it would be important to document how to correctly use the different reference counters so that third party teams do not make mistakes and get accounts into locked states.

A technical writer can work with me to get a better understanding of reference counters and then work to write up documentation which covers this within the DevHub or even the inline documentation.

@shawntabrizi shawntabrizi added the T2-Page Documentation which should live as a detailed external page label Apr 8, 2021
@jimmychu0807 jimmychu0807 self-assigned this Apr 10, 2021
@jimmychu0807
Copy link
Contributor

let me work on this next week.

@jimmychu0807
Copy link
Contributor

@shawntabrizi I start to work on this. I went over Substrate PR #8221, see the keys are on having { consumers, providers, sufficients } in AccountInfo. I also see the intricate logic when incrementing and decrementing each of them in the dec_{providers, consumers, sufficients}, and inc_{providers, consumers, sufficients} methods. I check and see the test cases.

But I wonder how should this be documented? Current there is almost no use of inc_sufficients, a few uses of inc_providers in the src, and moderate uses of inc_consumers by frame_balances, pallet_recovery. It seems to me this is some kind of internal state tracking variables. I am thinking what is a good approach of writing the doc for these three variables so runtime developers can start using them in their work?

@shawntabrizi
Copy link
Contributor Author

shawntabrizi commented May 5, 2021

image

image

image

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T2-Page Documentation which should live as a detailed external page
Projects
None yet
2 participants