From 4bf5e92609788e4b6969333ad078c72c987e097e Mon Sep 17 00:00:00 2001 From: pahor167 <47992132+pahor167@users.noreply.github.com> Date: Tue, 6 Feb 2024 15:20:19 +0100 Subject: [PATCH] GasPriceMinimum backward compatibility fix (#10922) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Dockerfiles (#10915) * Remove references to packages deleted * Remove circleci dockerfiles and workflow * Delete reference to patches folder * Update workload-id-provider in metadata-crawler-build job (#10916) Use `master` workload-id-provider pool * fix ganache dependency resolution (#10917) * fix & cleanup * fixed resolved field in lock file * test * Tooling fix * lint fix * revert of gas price minimum * Update packages/protocol/lib/compatibility/ast-code.ts Co-authored-by: Martín Volpe --------- Co-authored-by: Javier Cortejoso Co-authored-by: soloseng <102702451+soloseng@users.noreply.github.com> Co-authored-by: Martín Volpe --- .github/workflows/container-circleci.yml | 96 ---------- .github/workflows/containers.yaml | 2 +- dockerfiles/celotool/Dockerfile | 3 - dockerfiles/circleci/.dockerignore | 1 - dockerfiles/circleci/Dockerfile | 42 ----- .../circleci/circleci-node18/Dockerfile | 25 --- dockerfiles/circleci/node10-gcloud/Dockerfile | 19 -- dockerfiles/metadata-crawler/Dockerfile | 2 - package.json | 2 +- packages/celotool/src/lib/generate_utils.ts | 2 +- .../contracts/common/UsingPrecompiles.sol | 2 - .../protocol/lib/compatibility/ast-code.ts | 32 ++-- .../protocol/lib/compatibility/ast-layout.ts | 61 +++---- .../protocol/lib/compatibility/ast-version.ts | 18 +- packages/protocol/lib/compatibility/utils.ts | 4 +- .../scripts/bash/contract-exclusion-regex.sh | 7 - packages/protocol/scripts/check-backward.ts | 6 +- .../protocol/test/compatibility/ast-code.ts | 27 +-- .../protocol/test/compatibility/ast-layout.ts | 164 ++++++++++-------- .../test/compatibility/library-linking.ts | 7 +- yarn.lock | 70 +++++--- 21 files changed, 223 insertions(+), 369 deletions(-) delete mode 100644 .github/workflows/container-circleci.yml delete mode 100644 dockerfiles/circleci/.dockerignore delete mode 100644 dockerfiles/circleci/Dockerfile delete mode 100644 dockerfiles/circleci/circleci-node18/Dockerfile delete mode 100644 dockerfiles/circleci/node10-gcloud/Dockerfile diff --git a/.github/workflows/container-circleci.yml b/.github/workflows/container-circleci.yml deleted file mode 100644 index 63afcbec128..00000000000 --- a/.github/workflows/container-circleci.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -name: Build CircleCI related containers - -on: - push: - paths: - - 'dockerfiles/circleci/**' - branches: - - master - pull_request: - paths: - - 'dockerfiles/circleci/**' - workflow_dispatch: - -jobs: - changes: - runs-on: ubuntu-latest - outputs: - geth: ${{ steps.changes.outputs.geth }} - node12: ${{ steps.changes.outputs.node12 }} - gcloud: ${{ steps.changes.outputs.gcloud }} - steps: - - uses: actions/checkout@v4 - - name: Check for changes - uses: dorny/paths-filter@v2 - id: changes - with: - filters: | - geth: - - dockerfiles/circleci/Dockerfile - - dockerfiles/circleci/.dockerignore - node12: - - dockerfiles/circleci/circleci-node12/Dockerfile - gcloud: - - dockerfiles/circleci/node10-gcloud/Dockerfile - - geth-build-dev: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.8 - name: Build us-west1-docker.pkg.dev/devopsre/dev-images/circleci-geth:testing - needs: changes - if: | - needs.changes.outputs.geth == 'true' && - github.ref != 'refs/heads/master' - with: - workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos - service-account: 'celo-monorepo-dev@devopsre.iam.gserviceaccount.com' - artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/circleci-geth - tag: testing - context: dockerfiles/circleci - trivy: true - - geth-build: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.8 - name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/circleci-geth:latest - needs: changes - if: | - needs.changes.outputs.geth == 'true' && - github.ref == 'refs/heads/master' - with: - workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos - service-account: 'celo-monorepo@devopsre.iam.gserviceaccount.com' - artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/circleci-geth - tag: latest - context: dockerfiles/circleci - trivy: true - - node12-build-dev: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.8 - name: Build us-west1-docker.pkg.dev/devopsre/dev-images/circleci-node12:testing - needs: changes - if: | - needs.changes.outputs.node12 == 'true' && - github.ref != 'refs/heads/master' - with: - workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos - service-account: 'celo-monorepo-dev@devopsre.iam.gserviceaccount.com' - artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/circleci-node12 - tag: testing - context: dockerfiles/circleci - trivy: true - - node12-build: - uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.8 - name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/circleci-node12:latest - needs: changes - if: | - needs.changes.outputs.node12 == 'true' && - github.ref == 'refs/heads/master' - with: - workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos - service-account: 'celo-monorepo@devopsre.iam.gserviceaccount.com' - artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/circleci-node12 - tag: latest - context: dockerfiles/circleci - trivy: true - diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 6f7a331aee3..3ee7d94c3b1 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -118,7 +118,7 @@ jobs: github.ref == 'refs/heads/master' && contains(needs.changed-files.outputs.all_modified_files, ',dockerfiles/metadata-crawler') with: - workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo/providers/github-by-repos + workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-monorepo-master/providers/github-by-repos service-account: 'celo-monorepo@devopsre.iam.gserviceaccount.com' artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/blockscout-metadata-crawler tags: latest diff --git a/dockerfiles/celotool/Dockerfile b/dockerfiles/celotool/Dockerfile index 683fc8703db..4cc563608df 100644 --- a/dockerfiles/celotool/Dockerfile +++ b/dockerfiles/celotool/Dockerfile @@ -24,8 +24,6 @@ COPY packages/celotool/package.json packages/celotool/ COPY packages/dev-utils/package.json packages/dev-utils/ COPY packages/env-tests/package.json packages/env-tests/package.json COPY packages/protocol/package.json packages/protocol/ -COPY packages/typescript/package.json packages/typescript/ -COPY patches/ patches/ COPY scripts/ scripts/ # Makes build fail if it doesn't copy git, will be removed after build COPY .git .git @@ -38,7 +36,6 @@ COPY packages/dev-utils packages/dev-utils/ COPY packages/env-tests packages/env-tests COPY packages/helm-charts packages/helm-charts COPY packages/protocol packages/protocol/ -COPY packages/typescript packages/typescript/ RUN yarn build diff --git a/dockerfiles/circleci/.dockerignore b/dockerfiles/circleci/.dockerignore deleted file mode 100644 index 1d085cacc9f..00000000000 --- a/dockerfiles/circleci/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -** diff --git a/dockerfiles/circleci/Dockerfile b/dockerfiles/circleci/Dockerfile deleted file mode 100644 index 38f47647793..00000000000 --- a/dockerfiles/circleci/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM cimg/node:12.13 -LABEL org.opencontainers.image.authors="devops@clabs.co" - -RUN sudo apt-get update -y && \ - sudo apt-get install -y lsb-release libudev-dev libusb-dev libusb-1.0-0 - -# Install Kubernetes, as per https://kubernetes.io/docs/tasks/tools/install-kubectl/ -RUN sudo apt-get install -y apt-transport-https && \ - curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ - echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list && \ - sudo apt-get update && \ - sudo apt-get install -y kubectl - -RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 467B942D3A79BD29 && \ - sudo apt-get update && \ - sudo apt-get install -y apt-transport-https ca-certificates curl gnupg && \ - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \ - sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ - sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ - sudo apt-get update -y && \ - sudo apt-get install google-cloud-cli -y - -RUN sudo wget https://dl.google.com/go/go1.16.15.linux-amd64.tar.gz && \ - sudo tar xf go1.16.15.linux-amd64.tar.gz -C /usr/local && \ - sudo rm go1.16.15.linux-amd64.tar.gz - -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y - -ENV PATH="/usr/local/go/bin:/home/circleci/.cargo/bin:${PATH}" - -RUN go version - -RUN rustup install 1.41.0 && \ - rustup default 1.41.0 - -RUN sudo apt-get clean -y && \ - sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - -CMD ["/bin/sh"] diff --git a/dockerfiles/circleci/circleci-node18/Dockerfile b/dockerfiles/circleci/circleci-node18/Dockerfile deleted file mode 100644 index c8ee052186e..00000000000 --- a/dockerfiles/circleci/circleci-node18/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM cimg/node:18.14.2 - -RUN sudo apt-get update -y -RUN sudo apt-get install lsb-release libudev-dev libusb-dev libusb-1.0-0 rsync -y - -# Install python3 and python2 -RUN sudo apt-get update -y && \ - sudo apt-get install -y python3 python2 && \ - # Set python3 as default - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \ - sudo apt-get clean -y && \ - sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Install Kubernetes, as per https://kubernetes.io/docs/tasks/tools/install-kubectl/ -RUN sudo apt-get install -y apt-transport-https && \ - curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ - echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list && \ - sudo apt-get update && \ - sudo apt-get install -y kubectl - -RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \ - sudo apt-get update && sudo apt-get install google-cloud-cli - -CMD ["/bin/sh"] diff --git a/dockerfiles/circleci/node10-gcloud/Dockerfile b/dockerfiles/circleci/node10-gcloud/Dockerfile deleted file mode 100644 index cab2e5c1c0d..00000000000 --- a/dockerfiles/circleci/node10-gcloud/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM circleci/node:10 -MAINTAINER Gaston Ponti - -RUN sudo apt-get update -y -RUN sudo apt-get install lsb-release libudev-dev libusb-dev libusb-1.0-0 rsync -y - -# Install Kubernetes, as per https://kubernetes.io/docs/tasks/tools/install-kubectl/ -RUN sudo apt-get install -y apt-transport-https && \ - curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ - echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list && \ - sudo apt-get update && \ - sudo apt-get install -y kubectl - -RUN export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \ - echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ - sudo apt-get update -y && sudo apt-get install google-cloud-sdk -y - -CMD ["/bin/sh"] \ No newline at end of file diff --git a/dockerfiles/metadata-crawler/Dockerfile b/dockerfiles/metadata-crawler/Dockerfile index 3af71f4e853..abeb5cd14ee 100644 --- a/dockerfiles/metadata-crawler/Dockerfile +++ b/dockerfiles/metadata-crawler/Dockerfile @@ -15,8 +15,6 @@ RUN npm install -g typescript npm COPY lerna.json package.json yarn.lock ./ COPY scripts scripts/ -COPY packages/typescript packages/typescript/ -COPY packages/sdk packages/sdk/ COPY packages/dev-utils packages/dev-utils/ COPY packages/metadata-crawler packages/metadata-crawler/ diff --git a/package.json b/package.json index c13b06db38a..6e9c79054d7 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "typescript": "^5.3.3" }, "resolutions": { - "ganache": "npm:@soloseng/ganache@7.8.0-beta.1", + "ganache": "npm:@celo/ganache@7.8.0-unofficial.0", "bip39": "https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2", "blind-threshold-bls": "npm:@celo/blind-threshold-bls@1.0.0-beta", "@types/bn.js": "4.11.6", diff --git a/packages/celotool/src/lib/generate_utils.ts b/packages/celotool/src/lib/generate_utils.ts index 172b1fd6230..312e35b9283 100644 --- a/packages/celotool/src/lib/generate_utils.ts +++ b/packages/celotool/src/lib/generate_utils.ts @@ -8,7 +8,7 @@ import fs from 'fs' import { merge, range, repeat } from 'lodash' import { tmpdir } from 'os' import path from 'path' -import * as rlp from 'rlp' // TODO(soloseng): update? +import * as rlp from 'rlp' import { MyceloGenesisConfig } from 'src/lib/interfaces/mycelo-genesis-config' import { CurrencyPair } from 'src/lib/k8s-oracle/base' import * as ecc from 'tiny-secp256k1' diff --git a/packages/protocol/contracts/common/UsingPrecompiles.sol b/packages/protocol/contracts/common/UsingPrecompiles.sol index 596bb94ccb2..3ed14b4720b 100644 --- a/packages/protocol/contracts/common/UsingPrecompiles.sol +++ b/packages/protocol/contracts/common/UsingPrecompiles.sol @@ -104,7 +104,6 @@ contract UsingPrecompiles { * @param index Index of requested validator in the validator set. * @return Address of validator at the requested index. */ - // TODO: (soloseng) add to precompiles function validatorSignerAddressFromCurrentSet(uint256 index) public view returns (address) { bytes memory out; bool success; @@ -135,7 +134,6 @@ contract UsingPrecompiles { * @notice Gets the size of the current elected validator set. * @return Size of the current elected validator set. */ - // TODO:(soloseng) add to precompiles. function numberValidatorsInCurrentSet() public view returns (uint256) { bytes memory out; bool success; diff --git a/packages/protocol/lib/compatibility/ast-code.ts b/packages/protocol/lib/compatibility/ast-code.ts index 7c6bef1bf90..9c97633965b 100644 --- a/packages/protocol/lib/compatibility/ast-code.ts +++ b/packages/protocol/lib/compatibility/ast-code.ts @@ -45,7 +45,7 @@ const OUT_VOID_PARAMETER_STRING = 'void' * contract folders. */ export class ASTCodeCompatibilityReport { - constructor(private readonly changes: Change[]) {} + constructor(private readonly changes: Change[]) { } push(...changes: Change[]) { this.changes.push(...changes) } @@ -101,7 +101,7 @@ function createMethodIndex(methods: Method[]): MethodIndex { return Object.assign({}, ...asPairs) } -function mergeReports(reports: ASTCodeCompatibilityReport[]): ASTCodeCompatibilityReport{ +function mergeReports(reports: ASTCodeCompatibilityReport[]): ASTCodeCompatibilityReport { const report = new ASTCodeCompatibilityReport([]) reports.forEach((r: ASTCodeCompatibilityReport): void => { report.include(r) @@ -246,25 +246,31 @@ function generateASTCompatibilityReport(oldContract: ZContract, oldArtifacts: Bu /** * Runs an ast code comparison and returns the spotted changes from the built artifacts given. * - * @param oldArtifacts - * @param newArtifacts + * @param oldArtifactsSet + * @param newArtifactsSets */ export function reportASTIncompatibilities( // oldArtifacts also needs to be a set // https://github.com/celo-org/celo-monorepo/issues/10567 - oldArtifacts: BuildArtifacts, + oldArtifactsSet: BuildArtifacts[], newArtifactsSets: BuildArtifacts[]): ASTCodeCompatibilityReport { - + let out: ASTCodeCompatibilityReport[] = [] for (const newArtifacts of newArtifactsSets) { const reports = newArtifacts.listArtifacts() - .map((newArtifact) => { - const oldArtifact = oldArtifacts.getArtifactByName(newArtifact.contractName) - const oldZContract = oldArtifact ? makeZContract(oldArtifact) : null - return generateASTCompatibilityReport(oldZContract, oldArtifacts, makeZContract(newArtifact), newArtifacts) - }) - out = [...out, ...reports] - + .map((newArtifact) => { + + for (const oldArtifacts of oldArtifactsSet) { + const oldArtifact = oldArtifacts.getArtifactByName(newArtifact.contractName) + if (oldArtifact) { + return generateASTCompatibilityReport(makeZContract(oldArtifact), oldArtifacts, makeZContract(newArtifact), newArtifacts) + } + } + + return generateASTCompatibilityReport(null, oldArtifactsSet[0], makeZContract(newArtifact), newArtifacts) + }) + out = [...out, ...reports] + } return mergeReports(out) diff --git a/packages/protocol/lib/compatibility/ast-layout.ts b/packages/protocol/lib/compatibility/ast-layout.ts index 28cc3dee8d6..c9c79205945 100644 --- a/packages/protocol/lib/compatibility/ast-layout.ts +++ b/packages/protocol/lib/compatibility/ast-layout.ts @@ -8,7 +8,7 @@ import { compareStorageLayouts, getStorageLayout } from '@openzeppelin/upgrades'; -const Web3 = require('web3') +const Web3 = require('web3') const web3 = new Web3(null) @@ -42,7 +42,7 @@ export const getLayout = (artifact: Artifact, artifacts: BuildArtifacts) => { const selectIncompatibleOperations = (diff: Operation[]) => diff.filter(operation => operation.action !== 'append' - && !(operation.action === 'rename' && (`deprecated_${operation.original.label}` === operation.updated.label && operation.original.type === operation.updated.type))) + && !(operation.action === 'rename' && (`deprecated_${operation.original.label}` === operation.updated.label && operation.original.type === operation.updated.type))) export interface ASTStorageCompatibilityReport { contract: string @@ -117,7 +117,7 @@ const compareStructDefinitions = (oldType: TypeInfo, newType: TypeInfo, structEx if (oldMember.label !== newMember.label && `deprecated_${oldMember.label}` !== newMember.label) { return `struct ${newType.label} had ${oldMember.label} in slot ${i}, now has ${newMember.label}` } - + if (oldMember.type !== newMember.type) { return `struct ${newType.label}'s member ${newMember.label} changed type from ${oldMember.type} to ${newMember.type}` } @@ -164,7 +164,7 @@ const isStructExpandable = (oldType: TypeInfo, oldLayout: StorageLayoutInfo) => return !oldLayout.storage.some(storage => storage.type === structString) } -const generateStructsCompatibilityReport = (oldLayout: StorageLayoutInfo, newLayout: StorageLayoutInfo): {compatible: boolean, errors: any[], expanded?: boolean} => { +const generateStructsCompatibilityReport = (oldLayout: StorageLayoutInfo, newLayout: StorageLayoutInfo): { compatible: boolean, errors: any[], expanded?: boolean } => { let compatible = true let errors = [] let expanded: boolean @@ -191,40 +191,43 @@ const generateStructsCompatibilityReport = (oldLayout: StorageLayoutInfo, newLay } } -export const generateCompatibilityReport = (oldArtifact: Artifact, oldArtifacts: BuildArtifacts, - newArtifact: Artifact, newArtifacts: BuildArtifacts) - : {contract: string, compatible: boolean, errors: any[], expanded?: boolean } => { - const oldLayout = getLayout(oldArtifact, oldArtifacts) - const newLayout = getLayout(newArtifact, newArtifacts) - const layoutReport = generateLayoutCompatibilityReport(oldLayout, newLayout) - const structsReport = generateStructsCompatibilityReport(oldLayout, newLayout) +export const generateCompatibilityReport = (oldArtifact: Artifact, oldArtifacts: BuildArtifacts, + newArtifact: Artifact, newArtifacts: BuildArtifacts) + : { contract: string, compatible: boolean, errors: any[], expanded?: boolean } => { + const oldLayout = getLayout(oldArtifact, oldArtifacts) + const newLayout = getLayout(newArtifact, newArtifacts) + const layoutReport = generateLayoutCompatibilityReport(oldLayout, newLayout) + const structsReport = generateStructsCompatibilityReport(oldLayout, newLayout) - return { - contract: newArtifact.contractName, - compatible: layoutReport.compatible && structsReport.compatible, - errors: layoutReport.errors.concat(structsReport.errors), - expanded: structsReport.expanded - } + return { + contract: newArtifact.contractName, + compatible: layoutReport.compatible && structsReport.compatible, + errors: layoutReport.errors.concat(structsReport.errors), + expanded: structsReport.expanded + } } -export const reportLayoutIncompatibilities = (oldArtifacts: BuildArtifacts, newArtifactsSets: BuildArtifacts[]): ASTStorageCompatibilityReport[] => { +export const reportLayoutIncompatibilities = (oldArtifactsSet: BuildArtifacts[], newArtifactsSets: BuildArtifacts[]): ASTStorageCompatibilityReport[] => { let out: ASTStorageCompatibilityReport[] = [] for (const newArtifacts of newArtifactsSets) { const reports = newArtifacts.listArtifacts().map((newArtifact) => { - const oldArtifact = oldArtifacts.getArtifactByName(newArtifact.contractName) - if (oldArtifact !== undefined) { - return generateCompatibilityReport(oldArtifact, oldArtifacts, newArtifact, newArtifacts) - } else { - // Generate an empty report for new contracts, which are, by definition, backwards - // compatible. - return { - contract: newArtifact.contractName, - compatible: true, - errors: [] + + for (const oldArtifacts of oldArtifactsSet) { + const oldArtifact = oldArtifacts.getArtifactByName(newArtifact.contractName) + if (oldArtifact !== undefined) { + return generateCompatibilityReport(oldArtifact, oldArtifacts, newArtifact, newArtifacts) } } + + // Generate an empty report for new contracts, which are, by definition, backwards + // compatible. + return { + contract: newArtifact.contractName, + compatible: true, + errors: [] + } }) - + out = [...out, ...reports] } return out diff --git a/packages/protocol/lib/compatibility/ast-version.ts b/packages/protocol/lib/compatibility/ast-version.ts index 6adfb4c8055..30b77d51fbc 100644 --- a/packages/protocol/lib/compatibility/ast-version.ts +++ b/packages/protocol/lib/compatibility/ast-version.ts @@ -11,10 +11,10 @@ const abi = require('ethereumjs-abi') * A mapping {contract name => {@link ContractVersion}}. */ export class ASTContractVersions { - static fromArtifacts = async (artifactsSet: BuildArtifacts[]): Promise=> { + static fromArtifacts = async (artifactsSet: BuildArtifacts[]): Promise => { const contracts = {} - for (const artifacts of artifactsSet){ + for (const artifacts of artifactsSet) { await Promise.all(artifacts.listArtifacts().filter(c => !isLibrary(c.contractName, [artifacts])).map(async (artifact) => { contracts[artifact.contractName] = await getContractVersion(artifact) })) @@ -23,7 +23,7 @@ export class ASTContractVersions { return new ASTContractVersions(contracts) } - constructor(public readonly contracts: ContractVersionIndex) {} + constructor(public readonly contracts: ContractVersionIndex) { } } /** @@ -40,7 +40,7 @@ export async function getContractVersion(artifact: Artifact): Promise => { - const oldVersions = await ASTContractVersions.fromArtifacts([oldArtifacts]) + static create = async (oldArtifactsSet: BuildArtifacts[], newArtifactsSet: BuildArtifacts[], expectedVersionDeltas: ContractVersionDeltaIndex): Promise => { + const oldVersions = await ASTContractVersions.fromArtifacts(oldArtifactsSet) const newVersions = await ASTContractVersions.fromArtifacts(newArtifactsSet) const contracts = {} - Object.keys(newVersions.contracts).map((contract:string) => { + Object.keys(newVersions.contracts).map((contract: string) => { const versionDelta = expectedVersionDeltas[contract] === undefined ? ContractVersionDelta.fromChanges(false, false, false, false) : expectedVersionDeltas[contract] const oldVersion = oldVersions.contracts[contract] === undefined ? null : oldVersions.contracts[contract] contracts[contract] = new ContractVersionChecker(oldVersion, newVersions.contracts[contract], versionDelta) @@ -69,7 +69,7 @@ export class ASTContractVersionsChecker { return new ASTContractVersionsChecker(contracts) } - constructor(public readonly contracts: ContractVersionCheckerIndex) {} + constructor(public readonly contracts: ContractVersionCheckerIndex) { } /** * @return a new {@link ASTContractVersionsChecker} with the same contracts @@ -90,7 +90,7 @@ export class ASTContractVersionsChecker { } - public mismatches = () : ASTContractVersionsChecker => { + public mismatches = (): ASTContractVersionsChecker => { const mismatches = {} Object.keys(this.contracts).map((contract: string) => { if (!this.contracts[contract].matches()) { diff --git a/packages/protocol/lib/compatibility/utils.ts b/packages/protocol/lib/compatibility/utils.ts index 5482a3117eb..e051619c25f 100644 --- a/packages/protocol/lib/compatibility/utils.ts +++ b/packages/protocol/lib/compatibility/utils.ts @@ -18,7 +18,7 @@ export class ASTBackwardReport { static create = ( oldArtifactsFolder: string, newArtifactsFolders: string[], - oldArtifacts: BuildArtifacts, + oldArtifacts: BuildArtifacts[], newArtifacts: BuildArtifacts[], exclude: RegExp, categorizer: Categorizer, @@ -55,7 +55,7 @@ export class ASTBackwardReport { public readonly newArtifactsFolder: string[], public readonly exclude: string, public readonly report: ASTDetailedVersionedReport - ) {} + ) { } } function ensureValidArtifacts(artifactsPaths: string[]): void { diff --git a/packages/protocol/scripts/bash/contract-exclusion-regex.sh b/packages/protocol/scripts/bash/contract-exclusion-regex.sh index 27a44b06aed..e2bde3ec07c 100644 --- a/packages/protocol/scripts/bash/contract-exclusion-regex.sh +++ b/packages/protocol/scripts/bash/contract-exclusion-regex.sh @@ -25,10 +25,3 @@ if [ $VERSION_NUMBER -gt 9 ] then CONTRACT_EXCLUSION_REGEX="$CONTRACT_EXCLUSION_REGEX|SortedOracles" fi - -# TODO remove this after merge by fixing the report creation scipt to include GasPriceMinimum (0.8 contracts) -# https://github.com/celo-org/celo-monorepo/issues/10567 -if [ $VERSION_NUMBER -gt 9 ] - then - CONTRACT_EXCLUSION_REGEX="$CONTRACT_EXCLUSION_REGEX|GasPriceMinimum" -fi diff --git a/packages/protocol/scripts/check-backward.ts b/packages/protocol/scripts/check-backward.ts index 311377fa978..078533ff33b 100644 --- a/packages/protocol/scripts/check-backward.ts +++ b/packages/protocol/scripts/check-backward.ts @@ -51,6 +51,7 @@ const argv = yargs // old artifacts folder needs to be generalized https://github.com/celo-org/celo-monorepo/issues/10567 const oldArtifactsFolder = path.relative(process.cwd(), argv.old_contracts) +const oldArtifactsFolder08 = path.relative(process.cwd(), argv.old_contracts + '-0.8') const newArtifactsFolder = path.relative(process.cwd(), argv.new_contracts) const newArtifactsFolder08 = path.relative(process.cwd(), argv.new_contracts + '-0.8') const newArtifactsFolders = [newArtifactsFolder, newArtifactsFolder08] @@ -65,6 +66,7 @@ const outFile = argv.output_file ? argv.output_file : tmp.tmpNameSync({}) const exclude: RegExp = argv.exclude ? new RegExp(argv.exclude) : null // old artifacts needs to be generalized https://github.com/celo-org/celo-monorepo/issues/10567 const oldArtifacts = instantiateArtifacts(oldArtifactsFolder) +const oldArtifacts08 = instantiateArtifacts(oldArtifactsFolder08) const newArtifacts = instantiateArtifacts(newArtifactsFolder) const newArtifacts08 = instantiateArtifacts(newArtifactsFolder08) @@ -72,7 +74,7 @@ try { const backward = ASTBackwardReport.create( oldArtifactsFolder, newArtifactsFolders, - oldArtifacts, + [oldArtifacts, oldArtifacts08], [newArtifacts, newArtifacts08], exclude, new DefaultCategorizer(), @@ -88,7 +90,7 @@ try { } else if (argv._.includes(COMMAND_SEM_CHECK)) { const doVersionCheck = async () => { const versionChecker = await ASTContractVersionsChecker.create( - oldArtifacts, + [oldArtifacts, oldArtifacts08], [newArtifacts, newArtifacts08], backward.report.versionDeltas() ) diff --git a/packages/protocol/test/compatibility/ast-code.ts b/packages/protocol/test/compatibility/ast-code.ts index 12d61960267..300177786d1 100644 --- a/packages/protocol/test/compatibility/ast-code.ts +++ b/packages/protocol/test/compatibility/ast-code.ts @@ -35,21 +35,21 @@ const comp = (c1: Change, c2: Change): number => { describe('#reportASTIncompatibilities()', () => { describe('when the contracts are the same', () => { it('reports no changes', () => { - const report = reportASTIncompatibilities(testCases.original, [testCases.original_copy]) + const report = reportASTIncompatibilities([testCases.original], [testCases.original_copy]) assert.isEmpty(report.getChanges()) }) }) describe('when only metadata has changed', () => { it('reports no changes', () => { - const report = reportASTIncompatibilities(testCases.original, [testCases.metadata_changed]) + const report = reportASTIncompatibilities([testCases.original], [testCases.metadata_changed]) assert.isEmpty(report.getChanges()) }) }) describe('when a contract storage is changed', () => { it('reports only bytecode changes', () => { - const report = reportASTIncompatibilities(testCases.original, [testCases.inserted_constant]) + const report = reportASTIncompatibilities([testCases.original], [testCases.inserted_constant]) const expected = [new DeployedBytecodeChange('TestContract')] assert.deepEqual(report.getChanges(), expected) }) @@ -57,9 +57,10 @@ describe('#reportASTIncompatibilities()', () => { describe('when a contract and methods are added', () => { it('reports proper changes', () => { - const report = reportASTIncompatibilities(testCases.original, [ - testCases.added_methods_and_contracts, - ]) + const report = reportASTIncompatibilities( + [testCases.original], + [testCases.added_methods_and_contracts] + ) const expected = [ new NewContractChange('TestContractNew'), new DeployedBytecodeChange('TestContract'), @@ -74,9 +75,10 @@ describe('#reportASTIncompatibilities()', () => { describe('when methods are removed', () => { it('reports proper changes', () => { - const report = reportASTIncompatibilities(testCases.added_methods_and_contracts, [ - testCases.original, - ]) + const report = reportASTIncompatibilities( + [testCases.added_methods_and_contracts], + [testCases.original] + ) const expected = [ new DeployedBytecodeChange('TestContract'), new MethodRemovedChange('TestContract', 'newMethod1(uint256)'), @@ -90,9 +92,10 @@ describe('#reportASTIncompatibilities()', () => { describe('when many changes are made', () => { it('reports proper changes', () => { - const report = reportASTIncompatibilities(testCases.big_original, [ - testCases.big_original_modified, - ]) + const report = reportASTIncompatibilities( + [testCases.big_original], + [testCases.big_original_modified] + ) const expected = [ new NewContractChange('NewContract'), new DeployedBytecodeChange('ImplementationChangeContract'), diff --git a/packages/protocol/test/compatibility/ast-layout.ts b/packages/protocol/test/compatibility/ast-layout.ts index 4c4520b2bca..9f4f0c0a126 100644 --- a/packages/protocol/test/compatibility/ast-layout.ts +++ b/packages/protocol/test/compatibility/ast-layout.ts @@ -68,30 +68,31 @@ const assertContractErrorsMatch = (report, contractName: string, expectedMatches describe('#reportLayoutIncompatibilities()', () => { describe('when the contracts are the same', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original, [testCases.original]) + const report = reportLayoutIncompatibilities([testCases.original], [testCases.original]) assertCompatible(report) }) }) describe('when a constant is inserted in a contract', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.inserted_constant, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.inserted_constant] + ) assertCompatible(report) }) }) describe('when a variable is appended in a contract', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original, [testCases.appended]) + const report = reportLayoutIncompatibilities([testCases.original], [testCases.appended]) assertCompatible(report) }) }) describe('when a variable is inserted in a contract', () => { it('reports an inserted variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [testCases.inserted]) + const report = reportLayoutIncompatibilities([testCases.original], [testCases.inserted]) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/inserted/]) }) @@ -99,9 +100,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a variable is appended in a parent contract', () => { it('reports an inserted variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.appended_in_parent, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.appended_in_parent] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/inserted/]) }) @@ -109,7 +111,7 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a variable is removed in a contract', () => { it('reports a removed variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [testCases.removed]) + const report = reportLayoutIncompatibilities([testCases.original], [testCases.removed]) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/removed/]) }) @@ -117,9 +119,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a variable is removed in a parent contract', () => { it('reports a removed variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.removed_from_parent, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.removed_from_parent] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/removed/]) }) @@ -127,7 +130,7 @@ describe('#reportLayoutIncompatibilities()', () => { describe(`when a variable's type changes in a contract`, () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [testCases.typechange]) + const report = reportLayoutIncompatibilities([testCases.original], [testCases.typechange]) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -135,9 +138,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe(`when a variable's type changes in a parent contract`, () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.typechange_in_parent, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.typechange_in_parent] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -145,54 +149,60 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field is added to a struct in mapping', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original_struct_in_mapping, [ - testCases.inserted_in_struct_mapping, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_struct_in_mapping], + [testCases.inserted_in_struct_mapping] + ) assertCompatible(report) }) }) describe('when a field is added to a library struct in mapping', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original_struct_in_mapping, [ - testCases.inserted_in_library_struct_mapping, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_struct_in_mapping], + [testCases.inserted_in_library_struct_mapping] + ) assertCompatible(report) }) }) describe('when a field is prefixed with deprecated to a library struct in mapping', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original_struct_in_mapping, [ - testCases.deprecated_prefixed_in_library_struct_mapping, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_struct_in_mapping], + [testCases.deprecated_prefixed_in_library_struct_mapping] + ) assertCompatible(report) }) }) describe('when a field is prefixed with deprecated to struct variable', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.deprecated_prefixed_in_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.deprecated_prefixed_in_struct] + ) assertCompatible(report) }) }) describe('when a variable is prefixed with deprecated', () => { it('reports no incompatibilities', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.deprecated_prefixed_variable, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.deprecated_prefixed_variable] + ) assertCompatible(report) }) }) describe('when a field is added to a struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.inserted_in_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.inserted_in_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -200,9 +210,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field changes type in a struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.typechange_in_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.typechange_in_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -210,9 +221,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field changes type in a library struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.typechange_in_library_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.typechange_in_library_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -220,9 +232,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field is removed from a struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.removed_from_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.removed_from_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -230,9 +243,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field is removed from a library struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.removed_from_library_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.removed_from_library_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -240,9 +254,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a field is inserted in a library struct', () => { it('reports a struct change', () => { - const report = reportLayoutIncompatibilities(testCases.original, [ - testCases.inserted_in_library_struct, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original], + [testCases.inserted_in_library_struct] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/struct.*changed/]) }) @@ -250,9 +265,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a fixed array has length increased', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.longer_fixed_array, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.longer_fixed_array] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -260,9 +276,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a fixed array has length decreased', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.shorter_fixed_array, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.shorter_fixed_array] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -270,9 +287,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a fixed array becomes dynamic', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.fixed_to_dynamic_array, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.fixed_to_dynamic_array] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -280,9 +298,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when a dynamic array becomes fixed', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.dynamic_to_fixed_array, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.dynamic_to_fixed_array] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -294,9 +313,10 @@ describe('#reportLayoutIncompatibilities()', () => { // incompatibility. describe.skip('when the source of a mapping changes', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.mapping_source_changed, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.mapping_source_changed] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -304,9 +324,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe.skip('when the source of a nested mapping changes', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.internal_mapping_source_changed, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.internal_mapping_source_changed] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) @@ -314,9 +335,10 @@ describe('#reportLayoutIncompatibilities()', () => { describe('when the target of a mapping changes', () => { it('reports a typechanged variable', () => { - const report = reportLayoutIncompatibilities(testCases.original_complex, [ - testCases.mapping_target_changed, - ]) + const report = reportLayoutIncompatibilities( + [testCases.original_complex], + [testCases.mapping_target_changed] + ) assertNotCompatible(report) assertContractErrorsMatch(report, 'TestContract', [/had type/]) }) diff --git a/packages/protocol/test/compatibility/library-linking.ts b/packages/protocol/test/compatibility/library-linking.ts index 3e5f5b4ec8e..b3c446bac69 100644 --- a/packages/protocol/test/compatibility/library-linking.ts +++ b/packages/protocol/test/compatibility/library-linking.ts @@ -11,9 +11,10 @@ const testCases = { describe('reportLibraryLinkingIncompatibilities', () => { it('detects when a linked library has changed', () => { - const codeReport = reportASTIncompatibilities(testCases.linked_libraries, [ - testCases.linked_libraries_upgraded_lib, - ]) + const codeReport = reportASTIncompatibilities( + [testCases.linked_libraries], + [testCases.linked_libraries_upgraded_lib] + ) const libraryLinksReport = reportLibraryLinkingIncompatibilities( { LinkedLibrary1: ['TestContract'], diff --git a/yarn.lock b/yarn.lock index 3cf705a6f0c..6b5ddf4aa2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4529,7 +4529,7 @@ dependencies: "@trufflesuite/spinnies" "^0.1.1" -"@trufflesuite/bigint-buffer@1.1.10": +"@trufflesuite/bigint-buffer@*": version "1.1.10" resolved "https://registry.yarnpkg.com/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.10.tgz#a1d9ca22d3cad1a138b78baaf15543637a3e1692" integrity sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw== @@ -10878,10 +10878,10 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -ganache@7.8.0, ganache@^7.4.0, "ganache@npm:@celo/ganache@7.8.0-unofficial.0", "ganache@npm:@soloseng/ganache@7.8.0-beta.1": - version "7.8.0-beta.1" - resolved "https://registry.yarnpkg.com/@soloseng/ganache/-/ganache-7.8.0-beta.1.tgz#168d3c2f1ea05c350e972f227872d4a4b15e5f9e" - integrity sha512-ptjs631aKpxG7xexDDyxh5NevKQaUcSfm3/Aeh0smJ/3xQgNrJ+st6CVYVbVbhGkgNcq9NIvCCaIgt0L64GOCA== +ganache@7.8.0, ganache@^7.4.0, "ganache@npm:@celo/ganache@7.8.0-unofficial.0": + version "7.8.0-unofficial.0" + resolved "https://registry.yarnpkg.com/@celo/ganache/-/ganache-7.8.0-unofficial.0.tgz#7930a68ea8df36c7862425a164b44e3e89cb3d0f" + integrity sha512-csobquRjvgG/0mzw6NRB4ga+idPq7yQKLISNbxn2JSS/nCkGCTKn4yvTJqhmZ1dzwL2U3qHmGer2qXlxFQgbdg== dependencies: "@trufflesuite/bigint-buffer" "1.1.10" "@trufflesuite/uws-js-unofficial" "20.10.0-unofficial.2" @@ -13706,22 +13706,22 @@ jws@^4.0.0: jwa "^2.0.0" safe-buffer "^5.0.1" -keccak@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" - integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== +keccak@*: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== dependencies: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" + readable-stream "^3.6.0" -keccak@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== +keccak@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" + integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== dependencies: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" - readable-stream "^3.6.0" keccak@^1.0.2: version "1.4.0" @@ -14045,6 +14045,15 @@ level@^8.0.0: browser-level "^1.0.1" classic-level "^1.2.0" +leveldown@*: + version "6.1.1" + resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-6.1.1.tgz#0f0e480fa88fd807abf94c33cb7e40966ea4b5ce" + integrity sha512-88c+E+Eizn4CkQOBHwqlCJaTNEjGpaEIikn1S+cINc5E9HEvJ77bqY4JY/HxT5u0caWqsc3P3DcFIKBI1vHt+A== + dependencies: + abstract-leveldown "^7.2.0" + napi-macros "~2.0.0" + node-gyp-build "^4.3.0" + leveldown@5.6.0, leveldown@^5.4.0: version "5.6.0" resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-5.6.0.tgz#16ba937bb2991c6094e13ac5a6898ee66d3eee98" @@ -14054,15 +14063,6 @@ leveldown@5.6.0, leveldown@^5.4.0: napi-macros "~2.0.0" node-gyp-build "~4.1.0" -leveldown@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-6.1.0.tgz#7ab1297706f70c657d1a72b31b40323aa612b9ee" - integrity sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w== - dependencies: - abstract-leveldown "^7.2.0" - napi-macros "~2.0.0" - node-gyp-build "^4.3.0" - levelup@4.4.0, levelup@^4.3.2: version "4.4.0" resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" @@ -15459,6 +15459,11 @@ node-addon-api@^4.2.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-domexception@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" @@ -18285,13 +18290,13 @@ scryptsy@^2.1.0: resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== -secp256k1@4.0.3, secp256k1@^4.0.0, secp256k1@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" - integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== +secp256k1@*: + version "5.0.0" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.0.tgz#be6f0c8c7722e2481e9773336d351de8cddd12f7" + integrity sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA== dependencies: elliptic "^6.5.4" - node-addon-api "^2.0.0" + node-addon-api "^5.0.0" node-gyp-build "^4.2.0" secp256k1@^3.0.1: @@ -18308,6 +18313,15 @@ secp256k1@^3.0.1: nan "^2.14.0" safe-buffer "^5.1.2" +secp256k1@^4.0.0, secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + seed-random@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54"