-
Notifications
You must be signed in to change notification settings - Fork 12
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
[IMPROVEMENT] Reworked Node Operator fee change mechanism #246
Conversation
Hi, Current state - new value for operator fee becomes active after second transaction which emits staking_operator_fee_change_finished. Proposed new state - new value for operator fee becomes active after datetime=[timestamp] from staking_operator_fee_change_started event emitted by first transaction. No second transaction needs to be issued. Also i'm not sure i'm clear here
Active fee - 1%, no pending fee. |
Hi,
Regarding scenario you described, it's not possible to update fee when there is a pending change. I think I should add it as a con of the solution |
I see, so in this case fee can be updated at most once in 28 days, right? I agree that issuing 2 txs to change operator fee is worse then 1 tx. But I'm not sure this 1 tx difference makes up for all the Cons. From node operator point of view I pick 2 txs solution (with ability to change my mind every day) over 1 tx solution (i can change my mind only every 28 days). Operator also can make mistakes, like fat-finger 100% fee. So 1 tx solution makes it very hard to fix these mistakes. From othub indexer 1 tx solution adds complexity, with no obvious benefit. |
Well, this is not a 1 tx vs 2 txs problem, main purpose of this rework is to remove possibility to change operator fee for commits that are already locked |
@botnumberseven I think this problem can be resolved with the following mechanism SS - staking storage
|
I see From othub point of view that would require be a fair amount of changes in staging/stats tables as operator fee becomes a property of node-asset-epoch-?time?, rather then just node-time (like Ask). So the fee value need to be determined for every proof. Could you help me with an example of how to calculate it based on tx and events data? |
@botnumberseven I'll help you with that when final implementation is confirmed |
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.
Communicated feedback in person, looks fine
Node Operator Fee Update Mechanism
The system manages operator fees using two storage areas: StakingStorage for the currently active fee, and NodeOperatorFeeChangesStorage for pending fee updates.
High-Level Sequence Diagram
Initial State
At the start, the operator's fee is recorded only in StakingStorage. This fee is used for all calculations until any update occurs.
Updating the Fee
1. Initiating an Update: When a node operator decides to update their fee, they submit the new fee along with an "activation timestamp" to NodeOperatorFeeChangesStorage. This activation timestamp is set to 28 days from the update submission, marking a delay period before the new fee takes effect.
2. Transitioning Fees: If there's already a pending fee update in NodeOperatorFeeChangesStorage, this pending fee is moved to StakingStorage to become the current active fee. The new update then waits in NodeOperatorFeeChangesStorage until its activation timestamp.
Reward Collection Check
This process ensures that fee updates are transparently managed, maintaining fairness in fee application across commits/proofs.
Pros:
Cons: