-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.A task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.A task for a first time contributor to become familiar with the Polkadot-SDK.D1-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.I4-refactorCode needs refactoring.Code needs refactoring.T2-palletsThis PR/Issue is related to a particular pallet.This PR/Issue is related to a particular pallet.
Description
Issues identified so far:
- Any set parameter / update config call with multiple arguments should have each argument to be an
Optionfield. Please put this to some best practice document. This allows new update config call does not need to duplicate the fields that does not need to update. It also makes concurrent votes of update call possible, otherwise there will be race condition. It also helps with review such proposal otherwise reviewers need to check the other fields should remain the same. - Right now the fellowshipCore pallet and the salary pallet are tightly coupled in an unexpected way. On each cycle, the salary pallet will ask the fellowshipCore pallet about how much amount to pay and such amount is configured in the fellowshipCore pallet. When setting the parameters, we need to know the cycle length, which is configured in the salary pallet. And then if we adjust the cycle length, we also have to adjust the fellowshipCore params. This is just not a good thing.
- Two possible solutions:
- Move the payout cycle related config to the fellowshipCore pallet so they are next to the payout amount code and then we can more easier to figure out they are tightly coupled code
- New config in the fellowshipCore pallet to specify the meaning of the parameters. i.e. payout amount per duration. And then the salary can use the duration from fellowshipCore and its own payout cycle to calculate the payout amount per cycle.
- Two possible solutions:
- It assumes block number is 12s, which is not async backing friendly. This may or may not be tracked elsewhere.
Good thing identified:
- The budget feature is a helpful guard to cap the max damage to bad config.
### Tasks
- [ ] New extrinsic to allow update each individual parameter
- [ ] Refactor payout cycle realted code so it is harder to make mistake
- [ ] Make it async backing friendly
- [ ] Document best practice about set parameter calls
chungquantin, Doordashcon and xeodus
Metadata
Metadata
Assignees
Labels
C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.A task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.A task for a first time contributor to become familiar with the Polkadot-SDK.D1-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.I4-refactorCode needs refactoring.Code needs refactoring.T2-palletsThis PR/Issue is related to a particular pallet.This PR/Issue is related to a particular pallet.