PowerPool
  • powerpool overview
    • PowerPool
      • PowerPool DAO Story
      • Value Proposition
      • Use Cases
      • CVP Token
      • Vision 2027
    • Blockchain Automation
      • Glossary
    • PowerAgent Stats
    • How to contribute
    • Contracts and Links
  • Power Agent
    • đŸŽ¯PowerAgent features
    • đŸ›ī¸Architecture
      • â„šī¸Agent
      • â„šī¸Keeper
      • â„šī¸Job
        • Full Specification
    • 📜User Guides and Instructions
      • ❓I Want to Automate my Tasks
        • Job Registration Guide
      • ❓I Want to Become a Keeper
    • â„šī¸Scenarios
    • ⌛Old Pages
      • Installation Guide (Old)
        • Prerequisites
        • DAppNode Installation
        • Registering in PowerAgent
        • Installing PowerAgent Package on DAppNode
        • Standalone Installation
        • Chain-specific configs
      • Keeper (Old)
        • Keeper Registration and Update
        • Keeper staking, withdrawal, and deactivation
          • Keeper activation and deactivation in PPAgentV2RANDAO
        • Keeper assignment and release in RanDAO realisation
      • Job (Old)
        • Job Registration & Update
        • Job funds deposition and withdrawal
      • Agent (old)
        • Page
        • Execution
      • Technical Implementation (Old)
        • Hooks and helper functions
        • Errors
        • Modifiers
          • Flags
      • Job Registration Guide (Old)
      • 📑Testnet Rules
      • Slashing
        • Copy of Slashing
      • Task Reward and Gas Compensation
        • Fees and income sources
        • Copy of Task Reward and Gas Compensation
  • PowerPool Incentives
    • PowerPool Points Program
  • Security
    • Bug Bounty
    • Security Audits
  • Research
    • Automation Networks Research
      • Approaches on Keeper Selection
      • On-chain Random Number Generation
      • Keeper Weighing
      • 🌊PowerPool & PowerAgent Automation Network
      • Value Proposition-PowerPool
    • PowerAgent v2.1
      • Keeper Selection
      • Hooks
  • Resources
    • Website
    • Twitter
    • Medium
    • Discord
    • Github
    • Telegram
    • Governance Voting
    • Governance Forum
  • Legacy & Deprecated
    • Index Products
      • $YLA: Yearn Lazy Ape
        • Invest (ZAP) in YLA with low fees
        • Instant YLA mint via USDC
        • $CVP Boost Program
        • Redeem YLA
        • YLA Onsen Liquidity Mining [deprecated]
      • $BSCDEFI: BSC DeFi Pool/Index
        • Guide: Mint $BSCDEFI with $BNB
        • Guide: Multi-Asset $BSCDEFI Mint
        • Guide: PancakeSwap LM Farming
        • Add $BSCDEFI to MetaMask.
        • Redeem $BSCDEFI
      • $ASSY: Aave, SushiSwap, Synthetix, and Yearn Index
        • $CVP Boost Program
        • Underlying Token Staking
      • $PIPT: PowerIndex Pool
      • $YETI: Yearn Ecosystem Index
      • Market Price vs Fair Value
      • About ZAP
    • CVP reward program
      • How to create a DCA flow in Partitura
Powered by GitBook
On this page
  • Deactivating the keeper
  • Arguments
  • Assertions
  • Keeper disabling event
  • Activating the keeper
  • Initialising
  • Finalising

Was this helpful?

  1. Power Agent
  2. Old Pages
  3. Keeper (Old)
  4. Keeper staking, withdrawal, and deactivation

Keeper activation and deactivation in PPAgentV2RANDAO

Removal of keepers is performed by their elimination from the active (i.e. eligible for execution) keeper pool.

Deactivating the keeper

When a keeper admin desires to disable his keeper, he invokes the function disableKeeper(uint256 keeperId_).

Arguments

  1. uint256 keeperId_: the id of the keeper to disable

Assertions

  1. _assertOnlyKeeperAdmin ensures that only the keeper admin can disable a keeper

  2. _ensureCanReleaseKeeper asserts that the keeper to be disabled is not currently assigned to any pending job

  3. It is also asserted that the keeper to be disabled is not already inactive.

After the checks are performed, the keeperId is removed from the EnumerableSet.UintSet internal activeKeepers where all active keepers are stored, and the keeper (stored in the mapping mapping(uint256 => Keeper) internal keepers at the index of keeperId) has its activation status set to False.

Keeper disabling event

Having disabled the specified keeper, the function emits the event DisableKeeper(keeperId_)

Activating the keeper

Keeper activation is done with a delay, much like the CVP token withdrawal. This is done to curb the possibility of the active keeper pool oscillating violently.

Initialising

When the admin of an inactive keeper deems it fit to reactivate the keeper once again, he invokes the function initiateKeeperActivation(uint256 keeperId_).

Arguments

  1. uint256 keeperId_: the id of the keeper to activate

Assertions

  1. _assertOnlyKeeperAdmin ensures that only the keeper admin may invoke this function

  2. An additional assertion is made, checking that the keeper with this ID is not active already.

When all assertions have been satisfied, the finalisation time uint256 canBeFinalizedAt is calculated by adding to the current block timestamp the keeper activation finalisation delay in hours uint8 keeperActivationTimeoutHours. This variable is a parameter of the instance of PPAgentV2RANDAO and is set by the agent owner. It can never exceed 255 hours due to the datatype employed. The calculated finalisation time is stored in the mapping mapping(uint256 => uint256) public keeperActivationCanBeFinalizedAt, with the key being the keeperId.

Activation initialisation event

Having computed and stored the activation time, the function emits the event InitiateKeeperActivation(keeperId_, canBeFinalizedAt).

Finalising

When the admin of an inactive keeper, having initialised the activation process before, desires to finalise it, he invokes the function finalizeKeeperActivation(uint256 keeperId_).

Arguments

  1. uint256 keeperId_: the id of the keeper to activate

Assertions

  1. _assertOnlyKeeperAdmin ensures that only the keeper admin may invoke this function

  2. An additional assertion is made, checking that the current block timestamp is not exceeded by the finalisation permission time, stored beforehand at activation initialisation in the mapping mapping(uint256 => uint256) public keeperActivationCanBeFinalizedAt, with the key being the keeperId.

When all assertions have been satisfied, the keeperId is added back to the active keeper set EnumerableSet.UintSet internal activeKeepers whence it was removed at deactivation, the finalisation time stored in the mapping mapping(uint256 => uint256) public keeperActivationCanBeFinalizedAt, with the key being the keeperId, is zeroed, and the keeper stored in the mapping mapping(uint256 => Keeper) internal keepers at the index of keeperId) has its activation status set to True.

Activation finalisation event

Having reactivated the keeper, the function emits the event FinalizeKeeperActivation(keeperId_).

PreviousKeeper staking, withdrawal, and deactivationNextKeeper assignment and release in RanDAO realisation

Last updated 2 years ago

Was this helpful?

⌛