Conversation
aloknerurkar
reviewed
Feb 6, 2025
Collaborator
aloknerurkar
left a comment
There was a problem hiding this comment.
We should add integration test for this. You can either modify the existing one or create a separate one for this.
| uint64 decayStartTimeStamp, | ||
| uint64 decayEndTimeStamp, | ||
| bytes calldata bidSignature, | ||
| uint256 slashAmt, |
Collaborator
There was a problem hiding this comment.
At some point we should create a struct called CommitmentParams which can hold all these params. Maybe not the index but the bid params.
8cabe16 to
8a45adc
Compare
aloknerurkar
approved these changes
Feb 6, 2025
28e63a4 to
3ed4533
Compare
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.
Describe your changes
This PR introduces a comprehensive update to how bid slashing is handled throughout the system. In particular, it adds an explicit
slashAmtparameter to bids and related commitment processing, ensuring that the amount to be slashed from a provider’s stake is clearly defined and propagated through the entire preconfirmation flow.Major Changes
1. PreconfManager Updates
The bid type hash now includes the
slashAmtfield. For example, the type string was extended from:This ensures that the bid’s slashing amount is an integral part of the signed data.
Bid Hash and Commitment Digest
getBidHash) and commitment digests have been updated to accept and incorporateslashAmtas a parameter. This change propagates the new field through bid verification and commitment creation.Internal Logic Adjustments
_getBidderAddressAndCommitmentDigestwas introduced to avoidstack too deepissue and now forwardslashAmtto the bid verification logic.2. ProviderRegistry Enhancements
Slash Function Overhaul
The
slashfunction now accounts for the explicitslashAmtwhen calculating the amounts to deduct from a provider’s stake. The new logic:slashAmtwhen determining the bidder’s payout and the total amount to slash.3. P2P/API Changes
P2P and API Modifications
slash_amountfield.Checklist before requesting a review