https://github.com/vana-com/vana-smart-contracts/pull/7/

DLPRootMetric - New Contract

DLPRootMetrics is a contract that handles performance rating calculations and metrics for DLPs (Decentralized Liquidity Providers) in the system. Key functionalities include:

  1. Managing epoch performance ratings for DLPs
  2. Calculating top-performing DLPs based on both stake and performance metrics
  3. Estimating reward percentages and APY for DLPs
  4. Maintaining a scoring system with configurable weights between stake-based and performance-based ratings

The contract uses a dual rating system where:

  • Stake Rating: Based on the amount staked
  • Performance Rating: Based on DLP's performance metrics

Events

  1. EpochPerformanceRatingsSaved(uint256 indexed epochId, uint256 totalPerformanceRating, bool isFinalized)
  2. DlpEpochPerformanceRatingSaved(uint256 indexed epochId, uint256 indexed dlpId, uint256 performanceRating)
  3. RatingPercentagesUpdated(RatingType ratingType, uint256 percentage)

DataRegistry Changes

Modified Events

  • ProofAdded event updated:
    • Old: event ProofAdded(uint256 indexed fileId, uint256 indexed proofIndex)
    • New: event ProofAdded(uint256 indexed fileId, uint256 indexed proofIndex, uint256 indexed dlpId, uint256 score)

DLPRootSmartContract Changes

Architectural Changes

The main architectural change in this update is the separation of responsibilities between DLPRoot and DLPRootMetrics. A significant portion of the rating and performance calculation logic has been moved from DLPRoot to DLPRootMetrics, making the system more modular.

Previously, DLPRoot handled both stake management and performance calculations. Now:

  • DLPRootMetrics: Responsible for performance ratings and metrics calculations
  • DLPRoot: Focuses on stake management, basic DLP operations, and interfacing with treasury contracts

The reward distribution system has been significantly reworked. DLPRoot now works with separate treasury contracts for rewards and stakes, with reward calculations including both performance-based and stake-based components.

Modified Events

  1. EpochCreated
    • Old: event EpochCreated(uint256 epochId)
    • New: event EpochCreated(uint256 epochId, uint256 startBlock, uint256 endBlock, uint256 rewardAmount)
  2. DlpRewardClaimed
    • Old: event EpochDlpScoreSaved(uint256 indexed epochId, uint256 indexed dlpId, uint256 totalStakesScore);
    • New: event DlpRewardClaimed(uint256 indexed dlpId, uint256 indexed epochId, uint256 rewardAmount, uint256 stakersRewardAmount)

New Events

  1. DlpBecameSubEligible(uint256 indexed dlpId)
  2. DlpBecomeIneligible(uint256 indexed dlpId)
  3. StakeRewardClaimed(uint256 indexed stakeId, uint256 indexed epochId, uint256 amount, bool isFinal)
  4. event EpochOverridden(uint256 epochId, uint256 startBlock, uint256 endBlock, uint256 rewardAmount);
  5. event DlpRewardClaimed(uint256 indexed dlpId, uint256 indexed epochId, uint256 rewardAmount, uint256 stakersRewardAmount);

Note: All performance-related events are now emitted by DLPRootMetrics instead of DLPRoot, reflecting the new separation of concerns in the system architecture.

We've improved our DLP Root Contract, making registering a DLP and staking easier. In order for a DLP to be elegible for DLP rewards, they must be registered on this contract.

As we get closer to mainnet launch, our focus this week was getting our key smart contracts audited. We've partnered up with a trusted blockchain security and audit firm Hashlock.

You can find the report below.

The Satya Network in the Moksha testnet was scaled up this week to keep up with the tremendous proof-of-contribution requests that are being served by the network.

Other notable improvements:

Faucet: Fixed a bug affecting the faucet during heavy use
RPC: Made several security improvements across our RPC nodes on Moksha

📚 Fresh docs are live! Rebuilt from scratch to make building on Vana 10x easier.