-
Notifications
You must be signed in to change notification settings - Fork 47
[Staking] Validator gating #1121
Copy link
Copy link
Closed
Description
Goals
Introduce the ability to intercept staking, unstaking, and explicit validator membership adjustments (federated membership) to allow or deny the action, according to a user-defined policy.
Proposed solution
- Introduce an
IValidatorGaterstandard interface that can be implemented by any contract. - At subnet creation time, add a new parameter to set the address of the gater contract.
- If a non-zero address, every action to stake, unstake, and set explicit power should call this contract to determine if the action is allowed or denied. (Callback style).
- This should happen at all lifecycle stages of the subnet, whether the subnet is in pre-activation or activated.
- The gater should be allowed to call back to the subnet actor or the gateway, e.g. to query the current power table, or else. So reentrancy for read-only operations is fine.
IValidatorGater interface
interface IValidatorGater {
function interceptStake(SubnetID id, address validator, uint256 amount) returns (bool);
function interceptUnstake(SubnetID id, address validator, uint256 amount) returns (bool);
function interceptSetPower(SubnetID id, address validator, uint256 newPower) returns (bool);
}Implementations
This flexible interface can back any implementation, e.g.:
- An ACL list.
- A policy that checks if a given validator is a Filecoin SP, a token holder, an NFT holder, etc.
- A time-based policy that enables validators to join or leave at specific times.
- etc.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done