Documentation

JarJar Scheduler: Decentralized Task Scheduling on SUI Blockchain

Overview

JarJar Scheduler is a decentralized, blockchain-based task scheduling system implemented on the SUI blockchain. It allows users to schedule smart contract function executions at specific future timestamps, leveraging the decentralized nature of blockchain technology to ensure reliable and timely execution.

Key Features

  • Decentralized execution

  • Customizable task parameters

  • Incentivized validator participation

  • Flexible reward system

Technical Specification

Task Creation

Tasks are created by submitting an immutable Params object to the JarJar Scheduler smart contract. This object must include:

  1. execution_time: A u64 value representing the target execution timestamp in milliseconds.

  2. execution_path: A string specifying the smart contract function to be executed.

  3. Additional custom fields as required by the target function.

Params Object

The Params object is a flexible, immutable data structure that encapsulates all necessary information for task execution. It must adhere to the following structure:

Task Execution Process

  1. Task Submission: Users submit tasks by calling the appropriate function in the JarJar Scheduler smart contract, providing the Params object.

  2. Event Emission: Upon task submission, an event is emitted on the SUI blockchain.

  3. Validator Monitoring: Decentralized validators continuously monitor the blockchain for new task events.

  4. Execution Race: When the execution_time is reached, validators compete to execute the task first.

  5. Dry Run: Before execution, validators perform a dryRunTransaction to determine the potential reward.

  6. Execution: The winning validator executes the specified function, passing the Params object as an argument.

  7. Reward Distribution: The successful validator receives the associated reward.

Reward System

To ensure task execution, users must include a sufficient reward within their task submission. The reward should be attractive enough to incentivize validator participation.

Considerations for setting rewards:

  • Gas costs on the SUI blockchain

  • Computational complexity of the task

  • Desired execution priority

Validator Participation

The JarJar Scheduler network is fully decentralized, allowing anyone to participate as a validator. To become a validator:

  1. Clone the JarJar Scheduler repository

  2. Follow the setup instructions to configure a validator node

  3. Run the validator software to start participating in task execution

Best Practices

  1. Adequate Rewards: Ensure that tasks include sufficient rewards to guarantee execution.

  2. Realistic Timing: Set execution_time with a buffer to account for blockchain confirmation times.

  3. Error Handling: Implement robust error handling in scheduled functions to manage potential failures.

  4. Gas Optimization: Optimize scheduled functions to minimize gas costs and increase attractiveness to validators.

Security Considerations

  1. Immutable Params: Once submitted, task parameters can be altered only by the module it was created in, ensuring execution integrity.

  2. Decentralized Execution: Multiple validators compete for execution, reducing single points of failure.

  3. Transparent Reward System: Rewards are visible and predetermined, preventing manipulation.

Limitations and Future Work

  • Scalability optimizations for high-volume scheduling

  • Enhanced privacy features for sensitive task data

  • Integration with cross-chain bridges for multi-blockchain scheduling

Conclusion

JarJar Scheduler represents a significant advancement in decentralized task scheduling, leveraging the SUI blockchain's capabilities to provide a robust, flexible, and incentivized system for executing time-sensitive smart contract functions.

Last updated