-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: CSStrikes #392
base: develop
Are you sure you want to change the base?
feat: CSStrikes #392
Conversation
src/CSStrikes.sol
Outdated
if (isSameRoot) revert InvalidTreeRoot(); | ||
} | ||
|
||
if (!isSameCid && !isSameRoot) { |
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.
that's a pretty strange condition, don't get it
it allows to ignore setting if any of these are the same, but it seems to be an illegal values, isn't it? in which cases we will receive such values?
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.
We don't want to update values from 0 to 0. But in the same time the new one can be empty when the old one not
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.
If you have the same root, you should have the same CID, right?
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.
If you have the same root, you should have the same CID, right?
Yes
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.
so why do we have this condition here then
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.
I would prefer to keep it as is to be more solid and don't allow setting invalid data
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.
Found one more edge case. Updated
src/interfaces/ICSModule.sol
Outdated
/// See `CSStrikes.processValidatorEjection` to use this method permissionless | ||
/// @param nodeOperatorId ID of the Node Operator | ||
/// @param keyIndex Index of the withdrawn key in the Node Operator's keys storage | ||
/// @param strikesData Strikes of the Node Operator |
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.
it's about node operator keys i believe
it's not clear what are the values supposed to be in this list
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.
TODO added, because we don't know what values will be there yet
src/CSModule.sol
Outdated
uint256[] calldata strikesData | ||
) internal view returns (bool) { | ||
uint256 strikesDataLength = strikesData.length; | ||
if (strikesDataLength != strikesLifetime) revert InvalidStrikesData(); |
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.
what stops me of sending a proof for a stale key, such as:
- these are not the last X strikes but some from the past frames
- key has been withdrawn or exited already
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.
Oracle is in charge of setting the root with actual and valid strikes
src/CSStrikes.sol
Outdated
if (isSameRoot) revert InvalidTreeRoot(); | ||
} | ||
|
||
if (!isSameCid && !isSameRoot) { |
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.
If you have the same root, you should have the same CID, right?
6c46f37
to
263e586
Compare
No description provided.