-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
865b490
commit be1a846
Showing
27 changed files
with
603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
# Default output directory | ||
OUTPUT_DIR=${1:-docs/storage-report} | ||
|
||
# Function to print messages | ||
log() { | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') [INFO] $1" | ||
} | ||
|
||
# Function to print error messages | ||
error() { | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') [ERROR] $1" >&2 | ||
} | ||
|
||
log "Starting the storage report generation." | ||
|
||
# Create the output directory if it doesn't exist | ||
if ! mkdir -p "$OUTPUT_DIR"; then | ||
error "Failed to create output directory: $OUTPUT_DIR" | ||
exit 1 | ||
fi | ||
|
||
log "Output directory is set to: $OUTPUT_DIR" | ||
|
||
# Loop through Solidity files and generate storage report | ||
# NOTE: Ignores `src/interfaces` & `src/libraries` since they "should" not contain storage logic. | ||
for file in $(find src/ -name "*.sol" ! -path "*/interfaces/*" ! -path "*/libraries/*"); do | ||
contract_name=$(basename "$file" .sol) | ||
|
||
# Check if the file exists and is readable | ||
if [ ! -r "$file" ]; then | ||
error "Cannot read file: $file" | ||
continue | ||
fi | ||
|
||
log "Processing contract: $contract_name" | ||
|
||
# Run forge inspect and capture errors | ||
if ! forge inspect "$contract_name" storage --pretty > "$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" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Storage Layout | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "dev" | ||
|
||
jobs: | ||
check_storage: | ||
name: CI | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: "Generate and prepare the storage reports for current branch" | ||
run: | | ||
bash bin/storage-report.sh pr | ||
- name: Checkout dev | ||
env: | ||
TARGET: ${{ github.event.pull_request.base.sha }} | ||
run: | | ||
git fetch origin $TARGET | ||
git checkout $TARGET | ||
- name: "Generate and prepare the storage reports for target branch" | ||
run: | | ||
bash bin/storage-report.sh target | ||
- name: Compare outputs | ||
run: | | ||
if diff --unified pr target; then | ||
echo "No differences found" | ||
else | ||
echo "::error::Differences found between PR and target branch storage layouts" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
storage-report: | ||
bash ".github/bin/storage-report.sh" "docs/storage-report/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
╭------+------+------+--------+-------+----------╮ | ||
| Name | Type | Slot | Offset | Bytes | Contract | | ||
+================================================+ | ||
╰------+------+------+--------+-------+----------╯ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 | | ||
╰----------------------+------------------------------------------------------+------+--------+-------+---------------------------------------╯ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 | | ||
╰----------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------╯ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/BLSSignatureChecker.sol:BLSSignatureChecker | | ||
|----------------------+-------------+------+--------+-------+-------------------------------------------------| | ||
| __GAP | uint256[49] | 1 | 0 | 1568 | src/BLSSignatureChecker.sol:BLSSignatureChecker | | ||
╰----------------------+-------------+------+--------+-------+-------------------------------------------------╯ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
╭------------------+-------------+------+--------+-------+-------------------------------------------------------------------╮ | ||
| 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 | | ||
╰------------------+-------------+------+--------+-------+-------------------------------------------------------------------╯ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
╭----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ | ||
| 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 | | ||
╰----------------------------+-----------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ | ||
|
Oops, something went wrong.