-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace inflationary task funding with treasury-funded task creation #1042
Conversation
…e storage changes below fallible calls
…/Analog-Labs/timechain into amar-new-task-funding-mechanisms
WIP and Ready for Review because the implementation is ready for review, but there are remaining TODOs before we merge (listed in PR description). |
@@ -216,6 +216,5 @@ pub struct RewardConfig<Balance, BlockNumber> { | |||
#[derive(Debug, Clone, Decode, Encode, TypeInfo, PartialEq, Eq, PartialOrd, Ord)] | |||
pub enum TaskFunder { | |||
Account(AccountId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE for reviewers that, after the changes in this PR, this variant is only used when create_task
is called
/// Insufficient Treasury Balance to create UnRegisterShard task | ||
InsufficientTreasuryBalanceToUnRegisterShard(ShardId), | ||
/// Insufficient Treasury Balance To Create SendMessage task as an effect of calling `submit_result` | ||
InsufficientTreasuryBalanceToSendMessage(Msg), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registering and unregistering of shards should be funded from the shards' stake.
SendMessage is the execution of a GMP message; its cost should be covered by the chronicle, and oracle will reimburse.
Treasury fund should only be used for root calls required for system working.
…1042) Co-authored-by: Metadata Update Bot <[email protected]> Co-authored-by: Github Actions <41898282+github-actions[bot]@users.noreply.github.com>
…1042) Co-authored-by: Metadata Update Bot <[email protected]> Co-authored-by: Github Actions <41898282+github-actions[bot]@users.noreply.github.com>
WIP Closes #1040
Also closes #760 by removing all task funding via inflation
recv_msg
operation due to submit_result from the Treasurysend_message
from the Treasuryrecv_msg
operation due to register_gateway from the Treasury, propagate error if insufficient balance & move storage changes to after this fallible callNotes for Research
Significantly simplified design by David's suggestion to fund all task creation outside of
create_task
via the Treasury. This handles a lot of edge case handling that was discussed before.The impact is that it adds the requirement that we always keep the Treasury well funded to our list of operational requirements. There are events and errors that will be emitted when/if the Treasury is not well funded, but we should ensure it is via by balancing funds regularly.
create_task
is the only path that funds task creation from the caller. This flow would be effected by #1065 which should probably make all task creation funded by the treasury, which could simplify much of the code by removingTaskFunder
and its usage altogether.