-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add ability to remove work without slash and ejection #57
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
Conversation
manveerxyz
left a comment
There was a problem hiding this 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!
There was a problem hiding this 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, 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;
No description provided.