Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHECKLIST] Slashing, rewards, services #903

Open
13 tasks
drewstone opened this issue Jan 30, 2025 · 0 comments · May be fixed by #886
Open
13 tasks

[CHECKLIST] Slashing, rewards, services #903

drewstone opened this issue Jan 30, 2025 · 0 comments · May be fixed by #886
Assignees

Comments

@drewstone
Copy link
Contributor

Slashing & Rewards Management Checklist

1. Slashing Functionality

  • Process Unapplied Slashes
    • Add logic to handle unapplied slashes.
    • Tests: Verify unapplied slashes are processed correctly.
  • Implement Slashing Queue
    • Add a queue to manage slashing events.
    • Tests: Ensure slashes are queued and processed in the correct order.
  • Check for Applicable Slashes
    • Add slashing checks in on_idle and on_block to detect applicable slashes.
    • Tests: Validate slashes are detected and applied during idle/block events.
  • Remove Slashes on Dispute
    • Add logic to remove slashes from the queue when a dispute is resolved.
    • Tests: Confirm slashes are removed upon successful dispute resolution.

2. Operator Management

  • Join/Remove Services as Operator
    • Add functionality for operators to join or remove services.
    • Tests: Verify operators can join/remove services and state updates correctly.
  • Update tnt-core
    • Review and merge existing PR/branch for tnt-core.
    • Tests: Add missing tests for tnt-core updates.

3. SlashManager Integration

  • Hook Up SlashManager
    • Integrate SlashManager from service slash to slash operators.
    • Tests: Ensure slashing events are correctly passed to operators.

4. Payment & Rewards Management

  • Break Down Large Implementations
    • Refactor payment/rewards logic into smaller, reusable functions in <function>.rs.
    • Tests: Validate refactored functions maintain expected behavior.
  • Pricing Security Function
    • Add a function stub for pricing security with a sensible default (e.g., exponential function).
    • Tests: Verify the pricing function computes security scores correctly.
  • Score Distribution
    • Implement score computation:
      • 1 * NATIVE_SCORE_MULTIPLIER for 1 TNT exposed.
      • 1 score for $1 exposed from non-TNT assets.
    • Tests: Validate score distribution logic.
  • Payment Split & Execution
    • Add logic to split and execute payments based on computed scores.
    • Tests: Ensure payments are split and executed accurately.

5. Native Restaking & Slashing Handling

  • Add Native Restaking Support
    • Implement native restaking functionality.
    • Tests: Verify restaking works as expected.
  • Handle Validator & Operator Slashing
    • Add proper handling for validator and operator slashing events.
    • Tests: Confirm slashing events are handled correctly for both validators and operators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants