Skip to content

Commit

Permalink
refactor: natspec + interface changes (#364)
Browse files Browse the repository at this point in the history
* refactor: natspec + interfaces

refactor: natspec + interfaces

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`

refactor: use

refactor: remove todo

refactor: `///` -> `/**`

refactor: improve comment

refactor: rename var

refactor: improve comment

* fix: compiling - tests failing

* refactor: test passing **mostly**

* refactor: add missing gap

* refactor: natspec

* fix: test - state changes moved out of internal

* chore: forge fmt

* refactor: reorganize errors

* refactor: remove override

* refactor: note avsd

* Yash/natspec - address comments (#372)

* feat: natpsec with inheritance

* feat: storage

* chore: format

* chore: fmt

* chore: format

* fix: test

* fix: test

---------

Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Yash Patil <[email protected]>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent 4954139 commit 558613b
Show file tree
Hide file tree
Showing 74 changed files with 3,421 additions and 2,397 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
Empty file.
19 changes: 0 additions & 19 deletions docs/storage-report/ECDSAServiceManagerBase.md
Original file line number Diff line number Diff line change
@@ -1,19 +0,0 @@

╭------------------+-------------+------+--------+-------+-------------------------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+============================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| _owner | address | 51 | 0 | 20 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| __gap | uint256[49] | 52 | 0 | 1568 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| rewardsInitiator | address | 101 | 0 | 20 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
|------------------+-------------+------+--------+-------+-------------------------------------------------------------------|
| __GAP | uint256[49] | 102 | 0 | 1568 | src/unaudited/ECDSAServiceManagerBase.sol:ECDSAServiceManagerBase |
╰------------------+-------------+------+--------+-------+-------------------------------------------------------------------╯

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

╭----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+==========================================================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _owner | address | 51 | 0 | 20 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| __gap | uint256[49] | 52 | 0 | 1568 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _totalOperators | uint256 | 101 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _quorum | struct Quorum | 102 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _minimumWeight | uint256 | 103 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _serviceManager | address | 104 | 0 | 20 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _stakeExpiry | uint256 | 105 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _operatorSigningKeyHistory | mapping(address => struct CheckpointsUpgradeable.History) | 106 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _totalWeightHistory | struct CheckpointsUpgradeable.History | 107 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _thresholdWeightHistory | struct CheckpointsUpgradeable.History | 108 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _operatorWeightHistory | mapping(address => struct CheckpointsUpgradeable.History) | 109 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| _operatorRegistered | mapping(address => bool) | 110 | 0 | 32 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
|----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------|
| __gap | uint256[40] | 111 | 0 | 1280 | src/unaudited/ECDSAStakeRegistry.sol:ECDSAStakeRegistry |
╰----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯

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

╭----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------╮
| Name | Type | Slot | Offset | Bytes | Contract |
+=========================================================================================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _owner | address | 51 | 0 | 20 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| __gap | uint256[49] | 52 | 0 | 1568 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _totalOperators | uint256 | 101 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _quorum | struct Quorum | 102 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _minimumWeight | uint256 | 103 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _serviceManager | address | 104 | 0 | 20 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _stakeExpiry | uint256 | 105 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _operatorSigningKeyHistory | mapping(address => struct CheckpointsUpgradeable.History) | 106 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _totalWeightHistory | struct CheckpointsUpgradeable.History | 107 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _thresholdWeightHistory | struct CheckpointsUpgradeable.History | 108 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _operatorWeightHistory | mapping(address => struct CheckpointsUpgradeable.History) | 109 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| _operatorRegistered | mapping(address => bool) | 110 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| __gap | uint256[40] | 111 | 0 | 1280 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
|----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------|
| allowlistedOperators | mapping(address => bool) | 151 | 0 | 32 | src/unaudited/examples/ECDSAStakeRegistryEqualWeight.sol:ECDSAStakeRegistryEqualWeight |
╰----------------------------+-----------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------------╯

Loading

0 comments on commit 558613b

Please sign in to comment.