From 25132c62bdbde0a3e13172402a7f550aa794df71 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Fri, 11 Aug 2023 15:44:00 -0700 Subject: [PATCH 1/2] Revert "feat(ctb): Consolidate lock files into a single directory" This reverts commit e7c69f35272f6cd038560aa075c7e32265ca2198. --- .circleci/config.yml | 18 +++++++++--------- .../{locks/gas-lock => .gas-snapshot} | 0 .../{locks/storage-lock => .storage-layout} | 0 packages/contracts-bedrock/package.json | 4 ++-- .../{storage-lock.sh => storage-snapshot.sh} | 16 ++++++++-------- .../{locks => }/semver-lock.json | 0 6 files changed, 19 insertions(+), 19 deletions(-) rename packages/contracts-bedrock/{locks/gas-lock => .gas-snapshot} (100%) rename packages/contracts-bedrock/{locks/storage-lock => .storage-layout} (100%) rename packages/contracts-bedrock/scripts/{storage-lock.sh => storage-snapshot.sh} (72%) rename packages/contracts-bedrock/{locks => }/semver-lock.json (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb77cf692f86..2ec5032f715c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -382,10 +382,10 @@ jobs: pnpm lint:check || echo "export LINT_STATUS=1" >> "$BASH_ENV" working_directory: packages/contracts-bedrock - run: - name: gas lock + name: gas snapshot command: | forge --version - pnpm gas-lock --check || echo "export GAS_LOCK_STATUS=1" >> "$BASH_ENV" + pnpm gas-snapshot --check || echo "export GAS_SNAPSHOT_STATUS=1" >> "$BASH_ENV" environment: FOUNDRY_PROFILE: ci working_directory: packages/contracts-bedrock @@ -398,10 +398,10 @@ jobs: FOUNDRY_PROFILE: ci working_directory: packages/contracts-bedrock - run: - name: storage lock + name: storage snapshot command: | - pnpm storage-lock - git diff --exit-code locks/storage-lock || echo "export STORAGE_LOCK_STATUS=1" >> "$BASH_ENV" + pnpm storage-snapshot + git diff --exit-code .storage-layout || echo "export STORAGE_SNAPSHOT_STATUS=1" >> "$BASH_ENV" working_directory: packages/contracts-bedrock - run: name: semver lock @@ -422,16 +422,16 @@ jobs: FAILED=1 echo "Linting failed, see job output for details." fi - if [[ "$GAS_LOCK_STATUS" -ne 0 ]]; then + if [[ "$GAS_SNAPSHOT_STATUS" -ne 0 ]]; then FAILED=1 - echo "Gas lock failed, see job output for details." + echo "Gas snapshot failed, see job output for details." fi if [[ "$DEPLOY_CONFIG_STATUS" -ne 0 ]]; then FAILED=1 echo "Deploy configs invalid, see job output for details." fi - if [[ "$STORAGE_LOCK_STATUS" -ne 0 ]]; then - echo "Storage lock failed, see job output for details." + if [[ "$STORAGE_SNAPSHOT_STATUS" -ne 0 ]]; then + echo "Storage snapshot failed, see job output for details." FAILED=1 fi if [[ "$INVARIANT_DOCS_STATUS" -ne 0 ]]; then diff --git a/packages/contracts-bedrock/locks/gas-lock b/packages/contracts-bedrock/.gas-snapshot similarity index 100% rename from packages/contracts-bedrock/locks/gas-lock rename to packages/contracts-bedrock/.gas-snapshot diff --git a/packages/contracts-bedrock/locks/storage-lock b/packages/contracts-bedrock/.storage-layout similarity index 100% rename from packages/contracts-bedrock/locks/storage-lock rename to packages/contracts-bedrock/.storage-layout diff --git a/packages/contracts-bedrock/package.json b/packages/contracts-bedrock/package.json index 0500a172d957..df7006d3d3e6 100644 --- a/packages/contracts-bedrock/package.json +++ b/packages/contracts-bedrock/package.json @@ -20,8 +20,8 @@ "test": "pnpm build:differential && pnpm build:fuzz && forge test", "coverage": "pnpm build:differential && pnpm build:fuzz && forge coverage", "coverage:lcov": "pnpm build:differential && pnpm build:fuzz && forge coverage --report lcov", - "gas-lock": "pnpm build:differential && pnpm build:fuzz && forge snapshot --snap locks/gas-lock --no-match-test 'testDiff|testFuzz|invariant|generateArtifact'", - "storage-lock": "./scripts/storage-lock.sh", + "gas-snapshot": "pnpm build:differential && pnpm build:fuzz && forge snapshot --no-match-test 'testDiff|testFuzz|invariant|generateArtifact'", + "storage-snapshot": "./scripts/storage-snapshot.sh", "semver-lock": "forge script scripts/SemverLock.s.sol", "validate-deploy-configs": "./scripts/validate-deploy-configs.sh", "validate-spacers": "pnpm build && npx ts-node scripts/validate-spacers.ts", diff --git a/packages/contracts-bedrock/scripts/storage-lock.sh b/packages/contracts-bedrock/scripts/storage-snapshot.sh similarity index 72% rename from packages/contracts-bedrock/scripts/storage-lock.sh rename to packages/contracts-bedrock/scripts/storage-snapshot.sh index f78b71f4bdc8..ad63c96d0034 100755 --- a/packages/contracts-bedrock/scripts/storage-lock.sh +++ b/packages/contracts-bedrock/scripts/storage-snapshot.sh @@ -38,15 +38,15 @@ dir=$(dirname "$0") echo "Creating storage layout diagrams.." -echo "=======================" > $dir/../locks/storage-lock -echo "👁👁 STORAGE LAYOUT LOCK 👁👁" >> $dir/../locks/storage-lock -echo "=======================" >> $dir/../locks/storage-lock +echo "=======================" > $dir/../.storage-layout +echo "👁👁 STORAGE LAYOUT snapshot 👁👁" >> $dir/../.storage-layout +echo "=======================" >> $dir/../.storage-layout for contract in ${contracts[@]} do - echo -e "\n=======================" >> $dir/../locks/storage-lock - echo "➡ $contract">> $dir/../locks/storage-lock - echo -e "=======================\n" >> $dir/../locks/storage-lock - forge inspect --pretty $contract storageLayout >> $dir/../locks/storage-lock + echo -e "\n=======================" >> $dir/../.storage-layout + echo "➡ $contract">> $dir/../.storage-layout + echo -e "=======================\n" >> $dir/../.storage-layout + forge inspect --pretty $contract storage-layout >> $dir/../.storage-layout done -echo "Storage layout lock stored at $dir/../locks/storage-lock" +echo "Storage layout snapshot stored at $dir/../.storage-layout" diff --git a/packages/contracts-bedrock/locks/semver-lock.json b/packages/contracts-bedrock/semver-lock.json similarity index 100% rename from packages/contracts-bedrock/locks/semver-lock.json rename to packages/contracts-bedrock/semver-lock.json From 613e493be935564cb3bbefd69bc4be1942d4118f Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Fri, 11 Aug 2023 15:56:32 -0700 Subject: [PATCH 2/2] contracts-bedrock: fix storage-layout diff --- packages/contracts-bedrock/.storage-layout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts-bedrock/.storage-layout b/packages/contracts-bedrock/.storage-layout index 2ec91d22cb64..dc766e6da467 100644 --- a/packages/contracts-bedrock/.storage-layout +++ b/packages/contracts-bedrock/.storage-layout @@ -1,5 +1,5 @@ ======================= -👁👁 STORAGE LAYOUT LOCK 👁👁 +👁👁 STORAGE LAYOUT snapshot 👁👁 ======================= =======================