Skip to content

Commit

Permalink
GasPriceMinimum backward compatibility fix (#10922)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Javier Cortejoso <[email protected]>
Co-authored-by: soloseng <[email protected]>
Co-authored-by: Martín Volpe <[email protected]>
  • Loading branch information
4 people committed Feb 6, 2024
1 parent 2e27a3d commit 4bf5e92
Show file tree
Hide file tree
Showing 21 changed files with 223 additions and 369 deletions.
96 changes: 0 additions & 96 deletions .github/workflows/container-circleci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-monorepo/blockscout-metadata-crawler
tags: latest
Expand Down
3 changes: 0 additions & 3 deletions dockerfiles/celotool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion dockerfiles/circleci/.dockerignore

This file was deleted.

42 changes: 0 additions & 42 deletions dockerfiles/circleci/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions dockerfiles/circleci/circleci-node18/Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions dockerfiles/circleci/node10-gcloud/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions dockerfiles/metadata-crawler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"typescript": "^5.3.3"
},
"resolutions": {
"ganache": "npm:@soloseng/[email protected]beta.1",
"ganache": "npm:@celo/[email protected]unofficial.0",
"bip39": "https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2",
"blind-threshold-bls": "npm:@celo/[email protected]",
"@types/bn.js": "4.11.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/celotool/src/lib/generate_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions packages/protocol/contracts/common/UsingPrecompiles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
32 changes: 19 additions & 13 deletions packages/protocol/lib/compatibility/ast-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 4bf5e92

Please sign in to comment.