Validation Service Manager

Overview

The ValidationServiceManager is a contract designed to coordinate and manage a decentralized network of operators, tokens, and vaults. It operates on an epoch-based system, enabling dynamic interactions while maintaining a high degree of security and accountability. This contract ensures proper registration, staking, and task execution in a modular and scalable manner.

At its core, the contract aims to create a seamless environment for managing decentralized validation services, providing mechanisms for operators, tokens, and vaults to participate in a structured network.


Key Concepts

  1. Epochs Time is divided into discrete intervals called epochs. Each epoch serves as a logical unit for calculating staking, task execution, and operator activity.

  2. Operators Operators are key participants in the network, responsible for tasks such as validation. They must meet certain criteria, such as opting into the network and maintaining a minimum stake.

  3. Tokens Tokens represent assets that can be staked by operators. They are registered with the network and require owner approval to be added or removed.

  4. Vaults Vaults are associated with tokens and represent collateral-backed mechanisms in the system. They ensure that only valid assets are included in the staking and task-execution processes.

  5. Tasks

    Tasks are the operational units in the system. They are created, assigned, and executed by operators, ensuring the network functions smoothly. In the task creation process, the leader tx_orderer takes the initiative by submitting a block commitment to the contract. This submission creates a new task. Once the task is created, follower tx_orderers monitor the contract for the emitted event indicating the new task. Upon detecting the event, they calculate their own block commitment based on the data they have and respond to the task accordingly. The leader's role is critical in initiating the task, while the followers' responses validate and strengthen the integrity of the system. The ValidationServiceManager contract plays a key role in facilitating this interaction, emitting relevant events and ensuring that all task-related activities are tracked and verified within the network. This seamless interaction between the leader and follower tx_orderers is a cornerstone of the contract’s operational design, ensuring the network operates efficiently and securely.


Process Overview

System Initialization

The contract is initialized by defining the network, registry, and opt-in service parameters. Additionally, the epoch duration is set, dividing time into manageable intervals for operations.

Epoch Management

Epochs are used to organize and track network activity. The start time of the system is recorded, and the current epoch is determined based on the duration elapsed since initialization. Epoch-specific calculations, such as staking or operator activity, are performed relative to these intervals.

Operator Management

Operators are the backbone of the network, and their management involves several steps:

  • Registration: An operator can join the network after opting in and providing an operational address. This registration is approved by the contract owner.

  • Pausing and Resuming: Operators can be paused to temporarily disable their activity, ensuring the network remains secure.

  • Unregistration: Operators can be removed if they are inactive for a specified grace period. This process also clears their operational data.

Operators are required to maintain a minimum stake in approved tokens to participate in tasks or other network activities.

Token Management

Tokens are added to the system by the contract owner and represent the assets that can be staked. The management process includes:

  • Registration: New tokens can be registered and enabled for use.

  • Pausing and Unpausing: Tokens can be temporarily disabled if necessary.

  • Unregistration: Tokens can be removed if they are no longer active in the system.

Each token is subject to a minimum staking requirement, which is defined by the owner. Operators must meet this threshold to remain active.

Vault Management

Vaults are associated with collateral and are linked to the tokens in the network. They provide the infrastructure for staking. The vault management process involves:

  • Registration: Vaults are added after verifying they are valid entities in the registry.

  • Pausing and Resuming: Vaults can be disabled temporarily, similar to tokens.

  • Unregistration: Vaults can be removed after ensuring they have completed their activity gracefully.

Staking Management

Staking ensures that operators remain accountable within the network. The system calculates and caches stake information for tokens and operators during each epoch. This includes:

  • Total Staked Amounts: The total stake for each token is tracked and updated.

  • Operator Stakes: Individual operator stakes are calculated and compared against the minimum staking threshold.

  • Caching and Validation: Stake information is cached to optimize network performance and validated periodically to ensure accuracy.

Task Management

Tasks are critical for network operations, providing a mechanism for operators to contribute. The task process includes:

  • Creation: Tasks are created with specific parameters, such as the block number and commitment hash. Only eligible operators can create tasks.

  • Responses: Operators can respond to tasks, and their participation is recorded. Each operator can only respond once to a specific task.

  • Validation: Responses are validated to ensure operators meet all requirements and are actively participating in the network.

Querying Information

The contract provides comprehensive tools for querying the state of the network. Users can retrieve:

  • The list of active operators, tokens, or vaults for the current epoch.

  • Detailed information about specific operators, including their stakes and operational status.

  • Cached stake data for tokens and operators, optimized for quick access.


Security and Integrity

  1. Ownership Control All critical actions, such as registering operators, tokens, and vaults, require approval from the contract owner. This ensures that only authorized entities can modify the system.

  2. Opt-In Mechanism Operators must explicitly opt into the network before registration, ensuring that they acknowledge and comply with the network's rules.

  3. Grace Periods Both tokens and operators have a defined grace period before they can be removed.

  4. Stake Requirements Minimum staking amounts are enforced to ensure operators have sufficient collateral to back their participation.

  5. Epoch-Based Activity The use of epochs ensures that all operations are time-bound, reducing ambiguity and improving coordination across the network.


Last updated