From 901cd42d9b788fd881399a176b35fc1ef4ea5eb6 Mon Sep 17 00:00:00 2001 From: pahor167 <47992132+pahor167@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:11:01 +0100 Subject: [PATCH] CR11 fix verification (#10951) * Force AddressSortedLinkedListWithMedian library redeploy for CR11 * CI fix * PR comments --- .../protocol/scripts/bash/check-versions.sh | 1 + packages/protocol/scripts/check-backward.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/protocol/scripts/bash/check-versions.sh b/packages/protocol/scripts/bash/check-versions.sh index e001a50045c..789c77af8f3 100755 --- a/packages/protocol/scripts/bash/check-versions.sh +++ b/packages/protocol/scripts/bash/check-versions.sh @@ -52,6 +52,7 @@ yarn ts-node scripts/check-backward.ts sem_check \ --old_contracts $BRANCH_BUILD_DIR/contracts \ --new_contracts $NEW_BRANCH_BUILD_DIR/contracts \ --exclude $CONTRACT_EXCLUSION_REGEX \ + --new_branch $NEW_BRANCH \ $REPORT_FLAG git checkout $CURRENT_HASH -- migrationsConfig.js diff --git a/packages/protocol/scripts/check-backward.ts b/packages/protocol/scripts/check-backward.ts index 078533ff33b..1c77ca098ed 100644 --- a/packages/protocol/scripts/check-backward.ts +++ b/packages/protocol/scripts/check-backward.ts @@ -1,5 +1,7 @@ import { ASTContractVersionsChecker } from '@celo/protocol/lib/compatibility/ast-version' import { DefaultCategorizer } from '@celo/protocol/lib/compatibility/categorizer' +import { getReleaseVersion } from '@celo/protocol/lib/compatibility/ignored-contracts-v9' +import { CategorizedChanges } from '@celo/protocol/lib/compatibility/report' import { ASTBackwardReport, instantiateArtifacts } from '@celo/protocol/lib/compatibility/utils' import { writeJsonSync } from 'fs-extra' import path from 'path' @@ -43,6 +45,11 @@ const argv = yargs default: false, type: 'boolean', }) + .option('new_branch', { + alias: 'b', + description: 'Branch name (for versioning)', + type: 'string', + }) .help() .alias('help', 'h') .showHelpOnFail(true) @@ -81,6 +88,17 @@ try { out ) + try { + const version = getReleaseVersion(argv.new_branch) + if (version === 11) { + // force redeploy of AddressSortedLinkedListWithMedian for CR11 + // since it was deployed by Mento team with different settings and bytecode + backward.report.libraries.AddressSortedLinkedListWithMedian = {} as CategorizedChanges + } + } catch (error) { + out(`Error parsing branch name: ${argv.new_branch}\n`) + } + out(`Writing compatibility report to ${outFile} ...`) writeJsonSync(outFile, backward, { spaces: 2 }) out('Done\n')