Feature: Taskmaster

Description

Taskmaster is a new module of Paloma, responsible for executing hard coded, recurring logic and synching the outcome on KV stores on the chain.

Business Case

Creating the ability to execute arbitrary logic on a recurring basis will serve as the foundation of setting up a pricing oracle within Paloma. In order to accelerate production speed, we’re opting to keep logic definition hard coded for the moment, but this can be expanded in the future, allowing users to setup their own oracles directly on the chain.

Requirements

Terminology

With the concept of recurring jobs being established for cross chain arbitrary logic execution, it’s important we stay consistent in our terminology in order to avoid any confusion when communication about either feature. Therefore, we establish the term task for the execution of arbitrary on-chain logic.

Technical architecture breakdown

  1. Create a new module with a KV Store keeper implementation
  2. Create an abstract task definition
    1. Definition
    2. Schedule
    3. OnFinish, OnFail hooks
    4. Persistence layer: Tasks need a way to sync their outcome in their own KV store
    5. Migration layer: Tasks might need to create new stores during migrations
  3. Create an implementation of the task definition to setup a task which
    1. check if the node is staking (only participating validators will be running the data retrieval task)
    2. will be executed every n blocks, or after n seconds
    3. query prices from coingecko using the validator’s API key
    4. on fail: ???
    5. on finish: write results to KV storage
  4. Create the scheduling logic executing the new task
  5. Create the rescheduling logic
  6. Create a KV store migration
  7. Create the task monitoring

Limitations

Currently the only task implementation is hardcoded, doing a data curl against coin gecko and storing the results.

In the future, we could expand the module with Lua or Python callbacks to allow users to propose and store any arbitrary on chain logic as a task.

Open Questions

  • Coingecko Oracle: How do we approach a failed task execution? Should validators who consistently fail to execute be jailed in order to incentivise?

Additional Notes

Include any additional information or notes that are relevant to this feature request.

1 Like