feat: add ability to remove work without slash and ejection#57
Merged
feat: add ability to remove work without slash and ejection#57
Conversation
manveerxyz
reviewed
Jun 14, 2025
Member
manveerxyz
left a comment
There was a problem hiding this comment.
just one comment - otherwise looks good!
manveerxyz
reviewed
Jun 14, 2025
There was a problem hiding this comment.
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, andIRewardsDistributorwith soft-invalidation/remove APIs - Implement
softInvalidateWorkin the validator and wire throughComputePool,PrimeNetwork, and the ring-bufferRewardsDistributorWorkSubmission - Add comprehensive tests for
removeWorkacross 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
WorkRemovedmay be confused with the hard invalidation case; consider renaming it toWorkSoftInvalidatedor 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
removeWorkto keep the interface documentation up to date.
function removeWork(address node, uint256 workUnits) external;
manveerxyz
approved these changes
Jun 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.