Skip to content

Conversation

@JannikSt
Copy link
Member

No description provided.

@JannikSt JannikSt requested a review from Copilot June 13, 2025 14:39

This comment was marked as outdated.

Copy link
Member

@manveerxyz manveerxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one comment - otherwise looks good!

@JannikSt JannikSt requested a review from Copilot June 14, 2025 12:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds soft-slash functionality to remove work units without full ejection, updating interfaces, implementations, and tests to support a new removeWork API.

  • Extend IWorkValidation, IComputePool, and IRewardsDistributor with soft-invalidation/remove APIs
  • Implement softInvalidateWork in the validator and wire through ComputePool, PrimeNetwork, and the ring-buffer RewardsDistributorWorkSubmission
  • Add comprehensive tests for removeWork across single/multiple buckets, zero/excess removal, and multi-node scenarios

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/RewardsDistributorWorkSubmission.t.sol Added new tests for removeWork edge cases and multi-node behavior
src/interfaces/IWorkValidation.sol Added softInvalidateWork signature
src/interfaces/IComputePool.sol Exposed softInvalidateWork in pool interface
src/interfaces/IRewardsDistributor.sol Introduced removeWork API for soft-slash
src/SyntheticDataWorkValidator.sol Implemented softInvalidateWork and WorkRemoved event
src/ComputePool.sol Delegates softInvalidateWork to validator and calls removeWork
src/PrimeNetwork.sol Added passthrough softInvalidateWork
src/RewardsDistributorWorkSubmission.sol Added removeWork implementation in ring-buffer distributor
src/RewardsDistributorFixed.sol Stubbed removeWork (no-op) in fixed distributor
src/RewardsDistributor.sol Stubbed removeWork (no-op) in base distributor
Comments suppressed due to low confidence (2)

src/SyntheticDataWorkValidator.sol:11

  • [nitpick] The event name WorkRemoved may be confused with the hard invalidation case; consider renaming it to WorkSoftInvalidated or similar for clarity.
event WorkRemoved(uint256 poolId, address provider, address nodeId, bytes32 workKey, uint256 workUnits);

src/interfaces/IRewardsDistributor.sol:24

  • Add NatSpec comments describing the behavior, permission requirements, and effects of removeWork to keep the interface documentation up to date.
function removeWork(address node, uint256 workUnits) external;

@JannikSt JannikSt merged commit cff4497 into main Jun 16, 2025
1 check passed
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 this pull request may close these issues.

3 participants