Skip to content
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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

feat: CSStrikes #392

wants to merge 2 commits into from

Conversation

vgorkavenko
Copy link
Contributor

No description provided.

@vgorkavenko vgorkavenko changed the title feat: CSStrikes draft [WIP] feat: CSStrikes Feb 3, 2025
src/CSModule.sol Outdated Show resolved Hide resolved
src/CSModule.sol Outdated Show resolved Hide resolved
src/CSModule.sol Outdated Show resolved Hide resolved
src/CSFeeOracle.sol Show resolved Hide resolved
src/CSModule.sol Outdated Show resolved Hide resolved
if (isSameRoot) revert InvalidTreeRoot();
}

if (!isSameCid && !isSameRoot) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

/// 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
Copy link
Contributor

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

Copy link
Contributor Author

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 Show resolved Hide resolved
src/CSModule.sol Outdated
uint256[] calldata strikesData
) internal view returns (bool) {
uint256 strikesDataLength = strikesData.length;
if (strikesDataLength != strikesLifetime) revert InvalidStrikesData();
Copy link
Contributor

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

Copy link
Contributor Author

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/CSModule.sol Outdated Show resolved Hide resolved
src/CSModule.sol Outdated Show resolved Hide resolved
src/CSStrikes.sol Outdated Show resolved Hide resolved
src/CSStrikes.sol Outdated Show resolved Hide resolved
if (isSameRoot) revert InvalidTreeRoot();
}

if (!isSameCid && !isSameRoot) {
Copy link
Contributor

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?

@dgusakov dgusakov added the WIP label Feb 4, 2025
@dgusakov dgusakov changed the title [WIP] feat: CSStrikes feat: CSStrikes Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants