Skip to content

Commit

Permalink
refactor: natspec + interfaces
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
0xClandestine committed Jan 24, 2025
1 parent d2bfd57 commit 7cb4449
Show file tree
Hide file tree
Showing 64 changed files with 2,789 additions and 2,286 deletions.
2 changes: 1 addition & 1 deletion .github/bin/storage-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for file in $(find src/ -name "*.sol" ! -path "*/interfaces/*" ! -path "*/librar
log "Processing contract: $contract_name"

# Run forge inspect and capture errors
if ! forge inspect "$contract_name" storage --pretty > "$OUTPUT_DIR/$contract_name.md"; then
if ! forge inspect "$contract_name" storage > "$OUTPUT_DIR/$contract_name.md"; then
error "Failed to generate storage report for contract: $contract_name"
else
log "Storage report generated for contract: $contract_name"
Expand Down
2 changes: 1 addition & 1 deletion bin/storage-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for file in $(find src/ -name "*.sol" ! -path "*/interfaces/*" ! -path "*/librar
log "Processing contract: $contract_name"

# Run forge inspect and capture errors
if ! forge inspect "$contract_name" storage --pretty > "$OUTPUT_DIR/$contract_name.md"; then
if ! forge inspect "$contract_name" storage > "$OUTPUT_DIR/$contract_name.md"; then
error "Failed to generate storage report for contract: $contract_name"
else
log "Storage report generated for contract: $contract_name"
Expand Down
6 changes: 3 additions & 3 deletions docs/RegistryCoordinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ These methods allow operators to register for/deregister from one or more quorum
function registerOperator(
bytes calldata quorumNumbers,
string calldata socket,
IBLSApkRegistry.PubkeyRegistrationParams calldata params,
IBLSApkRegistryTypes.PubkeyRegistrationParams calldata params,
SignatureWithSaltAndExpiry memory operatorSignature
)
external
Expand Down Expand Up @@ -88,7 +88,7 @@ If the Operator was not currently registered for any quorums, this method will r
function registerOperatorWithChurn(
bytes calldata quorumNumbers,
string calldata socket,
IBLSApkRegistry.PubkeyRegistrationParams calldata params,
IBLSApkRegistryTypes.PubkeyRegistrationParams calldata params,
OperatorKickParam[] calldata operatorKickParams,
SignatureWithSaltAndExpiry memory churnApproverSignature,
SignatureWithSaltAndExpiry memory operatorSignature
Expand Down Expand Up @@ -256,7 +256,7 @@ These methods are used by the Owner to configure the `RegistryCoordinator`:
function createQuorum(
OperatorSetParam memory operatorSetParams,
uint96 minimumStake,
IStakeRegistry.StrategyParams[] memory strategyParams
IStakeRegistryTypes.StrategyParams[] memory strategyParams
)
external
virtual
Expand Down
38 changes: 19 additions & 19 deletions docs/storage-report/BLSApkRegistry.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

╭----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+=============================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| apkHistory | mapping(uint8 => struct IBLSApkRegistry.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistry.sol:BLSApkRegistry |
╰----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------╯
╭----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+==================================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| apkHistory | mapping(uint8 => struct IBLSApkRegistryTypes.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
|----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------|
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistry.sol:BLSApkRegistry |
╰----------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------╯

38 changes: 19 additions & 19 deletions docs/storage-report/BLSApkRegistryStorage.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

╭----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+===========================================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| apkHistory | mapping(uint8 => struct IBLSApkRegistry.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
╰----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------╯
╭----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+================================================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| apkHistory | mapping(uint8 => struct IBLSApkRegistryTypes.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
|----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
╰----------------------+-----------------------------------------------------------+------+--------+-------+-----------------------------------------------------╯

9 changes: 9 additions & 0 deletions docs/storage-report/BLSSignatureCheckerStorage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

╭----------------------+-------------+------+--------+-------+---------------------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+============================================================================================================================+
| staleStakesForbidden | bool | 0 | 0 | 1 | src/BLSSignatureCheckerStorage.sol:BLSSignatureCheckerStorage |
|----------------------+-------------+------+--------+-------+---------------------------------------------------------------|
| __GAP | uint256[49] | 1 | 0 | 1568 | src/BLSSignatureCheckerStorage.sol:BLSSignatureCheckerStorage |
╰----------------------+-------------+------+--------+-------+---------------------------------------------------------------╯

2 changes: 1 addition & 1 deletion docs/storage-report/ECDSAStakeRegistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _totalOperators | uint256 | 101 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _quorum | struct Quorum | 102 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
| _quorum | struct IECDSAStakeRegistryTypes.Quorum | 102 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _minimumWeight | uint256 | 103 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/storage-report/ECDSAStakeRegistryEqualWeight.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _totalOperators | uint256 | 101 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _quorum | struct Quorum | 102 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
| _quorum | struct IECDSAStakeRegistryTypes.Quorum | 102 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _minimumWeight | uint256 | 103 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/storage-report/ECDSAStakeRegistryPermissioned.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|----------------------------+-----------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------------|
| _totalOperators | uint256 | 101 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryPermissioned.sol:ECDSAStakeRegistryPermissioned |
|----------------------------+-----------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------------|
| _quorum | struct Quorum | 102 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryPermissioned.sol:ECDSAStakeRegistryPermissioned |
| _quorum | struct IECDSAStakeRegistryTypes.Quorum | 102 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryPermissioned.sol:ECDSAStakeRegistryPermissioned |
|----------------------------+-----------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------------|
| _minimumWeight | uint256 | 103 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryPermissioned.sol:ECDSAStakeRegistryPermissioned |
|----------------------------+-----------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------------|
Expand Down
Loading

0 comments on commit 7cb4449

Please sign in to comment.