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

refactor: natspec + interface changes #364

Open
wants to merge 1 commit into
base: feat/slashing-release-branch
Choose a base branch
from

Conversation

0xClandestine
Copy link

No description provided.

@0xClandestine 0xClandestine changed the title docs: RegistryCoordinator natspec docs: natspec improvements Jan 22, 2025
import {IBLSApkRegistry} from "./interfaces/IBLSApkRegistry.sol";
import {IStakeRegistry, IDelegationManager} from "./interfaces/IStakeRegistry.sol";

abstract contract BLSSignatureCheckerStorage is IBLSSignatureChecker {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it made sense to separate this out for consistency.

@0xClandestine 0xClandestine changed the title docs: natspec improvements refactor: natspec + interface changes Jan 24, 2025
refactor: natspec + interfaces

docs: `RegistryCoordinator` natspec

chore: forge fmt

refactor: named mapping params

docs: natspec `BLSApkRegistry`

docs: natspec `BLSApkRegistry`

docs: natspec `BLSApkRegistry`

refactor: interface structure

refactor: separate `BLSSignatureChecker` storage

refactor: rename -> `IECDSAStakeRegistry`

docs: natspec

docs: natspec `ECDSAStakeRegistry`

docs: natspec `EjectionManager` + separate storage

docs: natspec

docs: natspec `IndexRegistry`

refactor: remove `IRegistry`

chore: forge fmt

chore: make storage-report

docs: natspec

refactor: remove `ISocketUpdater`

/**
* @notice This function is called by disperser when it has aggregated all the signatures of the operators
Copy link
Collaborator

@8sunyuan 8sunyuan Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like some of the details here is missing in the natspec in the IBLSSignatureChecker.sol

@@ -73,13 +52,10 @@ contract BLSApkRegistry is BLSApkRegistryStorage {

// Update each quorum's aggregate pubkey
_processQuorumApkUpdate(quorumNumbers, pubkey.negate());
emit OperatorRemovedFromQuorums(operator, getOperatorId(operator), quorumNumbers);
emit OperatorRemovedFromQuorums(operator, operatorToPubkeyHash[operator], quorumNumbers);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer to leave as is using the helper function getOperatorId. Same for registerOperator

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticing right now that there isn't a storage gap in the original implementation and would like to add it but
I'm wondering if anyone has deployed and extended an EjectionManager contract because adding the gap now could potentially break some existing AVSs.

IStakeRegistry
} from "./EjectionManagerStorage.sol";

// TODO: double check order of inheritance since we separated storage from logic...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this TODO: can we compare the forge inspect storage outputs and confirm this?

interface IEjectionManager is IEjectionManagerErrors, IEjectionManagerEvents {
/// STATE

// TODO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

address ejector
) external view returns (bool);

/// @notice Returns the stake ejection at `index` for quorum `quorumNumber`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, can we keep the notice as Keeps track of the total stake ejected for a quorum

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Looks like we removed the underscores in the param names. Can we be consistent and remove them for _owner and _quorumEjectionParams as well? The constructor is fine as is.

Copy link
Contributor

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor first pass comments

event NewPubkeyRegistration(
address indexed operator, BN254.G1Point pubkeyG1, BN254.G2Point pubkeyG2
);

// @notice Emitted when a new operator pubkey is registered for a set of quorums
/// @notice Emitted when `operator`'s pubkey is registered for `quorumNumbers`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flagging that we natspect events a bit differently in core (use the /** syntax)

* 3) `quorumNumbers` is ordered in ascending order
* 4) the operator is not already registered
*/
/// @notice Maps `operator` to their BLS public key hash (`operatorId`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're also natspec-ing functions different, prefer the old way for consistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants