Skip to content

Commit 57f70ba

Browse files
8sunyuanypatil12
andauthored
refactor: slashing registry coordinator (#361)
* refactor: slashing registry coordinator refactor: registry coordinator refactor: remove sm calls fix: tests wip * fix: integration tests * refactor: internal functions * fix: remove unused block * fix: comment out test for now * build: fmt check run only on src contracts * fix: call SM only based on m2 quorums (#369) * feat: update enableOperatorSets flow (#367) * feat: update enableOperatorSets flow * fix: dereg op check * chore: renamed m2 quorums * fix: msg.sender -> operator * chore: forge fmt * fix: tests --------- Co-authored-by: Yash Patil <[email protected]>
1 parent 7e8aeff commit 57f70ba

File tree

63 files changed

+4526
-2460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4526
-2460
lines changed

.github/workflows/forge-fmt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ jobs:
2626
version: nightly
2727
- name: Run forge fmt
2828
run: |
29-
forge fmt --check
29+
forge fmt --check src
3030
id: fmt

docs/storage-report/BLSApkRegistry.md

-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
2-
╭----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+=============================================================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
6-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistry.sol:BLSApkRegistry |
8-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
9-
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
10-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
11-
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
12-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
13-
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
14-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
15-
| apkHistory | mapping(uint8 => struct IBLSApkRegistry.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
16-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
17-
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistry.sol:BLSApkRegistry |
18-
|----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------|
19-
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistry.sol:BLSApkRegistry |
20-
╰----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------╯
21-
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
2-
╭----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+===========================================================================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
6-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
8-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
9-
| operatorToPubkeyHash | mapping(address => bytes32) | 1 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
10-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
11-
| pubkeyHashToOperator | mapping(bytes32 => address) | 2 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
12-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
13-
| operatorToPubkey | mapping(address => struct BN254.G1Point) | 3 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
14-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
15-
| apkHistory | mapping(uint8 => struct IBLSApkRegistry.ApkUpdate[]) | 4 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
16-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
17-
| currentApk | mapping(uint8 => struct BN254.G1Point) | 5 | 0 | 32 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
18-
|----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------|
19-
| __GAP | uint256[45] | 6 | 0 | 1440 | src/BLSApkRegistryStorage.sol:BLSApkRegistryStorage |
20-
╰----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------╯
21-
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
2-
╭----------------------+-------------+------+--------+-------+-------------------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+==============================================================================================================+
5-
| staleStakesForbidden | bool | 0 | 0 | 1 | src/BLSSignatureChecker.sol:BLSSignatureChecker |
6-
|----------------------+-------------+------+--------+-------+-------------------------------------------------|
7-
| __GAP | uint256[49] | 1 | 0 | 1568 | src/BLSSignatureChecker.sol:BLSSignatureChecker |
8-
╰----------------------+-------------+------+--------+-------+-------------------------------------------------╯
9-
-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
2-
╭-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+==========================================================================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/EjectionManager.sol:EjectionManager |
6-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/EjectionManager.sol:EjectionManager |
8-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
9-
| __gap | uint256[50] | 1 | 0 | 1600 | src/EjectionManager.sol:EjectionManager |
10-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
11-
| _owner | address | 51 | 0 | 20 | src/EjectionManager.sol:EjectionManager |
12-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
13-
| __gap | uint256[49] | 52 | 0 | 1568 | src/EjectionManager.sol:EjectionManager |
14-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
15-
| isEjector | mapping(address => bool) | 101 | 0 | 32 | src/EjectionManager.sol:EjectionManager |
16-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
17-
| stakeEjectedForQuorum | mapping(uint8 => struct IEjectionManager.StakeEjection[]) | 102 | 0 | 32 | src/EjectionManager.sol:EjectionManager |
18-
|-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------|
19-
| quorumEjectionParams | mapping(uint8 => struct IEjectionManager.QuorumEjectionParams) | 103 | 0 | 32 | src/EjectionManager.sol:EjectionManager |
20-
╰-----------------------+----------------------------------------------------------------+------+--------+-------+-----------------------------------------╯
21-

docs/storage-report/IndexRegistry.md

-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
2-
╭-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+===================================================================================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/IndexRegistry.sol:IndexRegistry |
6-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/IndexRegistry.sol:IndexRegistry |
8-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
9-
| currentOperatorIndex | mapping(uint8 => mapping(bytes32 => uint32)) | 1 | 0 | 32 | src/IndexRegistry.sol:IndexRegistry |
10-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
11-
| _operatorIndexHistory | mapping(uint8 => mapping(uint32 => struct IIndexRegistry.OperatorUpdate[])) | 2 | 0 | 32 | src/IndexRegistry.sol:IndexRegistry |
12-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
13-
| _operatorCountHistory | mapping(uint8 => struct IIndexRegistry.QuorumUpdate[]) | 3 | 0 | 32 | src/IndexRegistry.sol:IndexRegistry |
14-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------|
15-
| __GAP | uint256[47] | 4 | 0 | 1504 | src/IndexRegistry.sol:IndexRegistry |
16-
╰-----------------------+-----------------------------------------------------------------------------+------+--------+-------+-------------------------------------╯
17-
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
2-
╭-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+=================================================================================================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
6-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
8-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
9-
| currentOperatorIndex | mapping(uint8 => mapping(bytes32 => uint32)) | 1 | 0 | 32 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
10-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
11-
| _operatorIndexHistory | mapping(uint8 => mapping(uint32 => struct IIndexRegistry.OperatorUpdate[])) | 2 | 0 | 32 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
12-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
13-
| _operatorCountHistory | mapping(uint8 => struct IIndexRegistry.QuorumUpdate[]) | 3 | 0 | 32 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
14-
|-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------|
15-
| __GAP | uint256[47] | 4 | 0 | 1504 | src/IndexRegistryStorage.sol:IndexRegistryStorage |
16-
╰-----------------------+-----------------------------------------------------------------------------+------+--------+-------+---------------------------------------------------╯
17-

docs/storage-report/InstantSlasher.md

-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
2-
╭---------------+-------------+------+--------+-------+------------------------------------------------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+======================================================================================================+
5-
| _initialized | uint8 | 0 | 0 | 1 | src/slashers/InstantSlasher.sol:InstantSlasher |
6-
|---------------+-------------+------+--------+-------+------------------------------------------------|
7-
| _initializing | bool | 0 | 1 | 1 | src/slashers/InstantSlasher.sol:InstantSlasher |
8-
|---------------+-------------+------+--------+-------+------------------------------------------------|
9-
| slasher | address | 0 | 2 | 20 | src/slashers/InstantSlasher.sol:InstantSlasher |
10-
|---------------+-------------+------+--------+-------+------------------------------------------------|
11-
| nextRequestId | uint256 | 1 | 0 | 32 | src/slashers/InstantSlasher.sol:InstantSlasher |
12-
|---------------+-------------+------+--------+-------+------------------------------------------------|
13-
| __gap | uint256[48] | 2 | 0 | 1536 | src/slashers/InstantSlasher.sol:InstantSlasher |
14-
╰---------------+-------------+------+--------+-------+------------------------------------------------╯
15-
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
2-
╭------+------+------+--------+-------+----------╮
3-
| Name | Type | Slot | Offset | Bytes | Contract |
4-
+================================================+
5-
╰------+------+------+--------+-------+----------╯
6-

0 commit comments

Comments
 (0)