Skip to content

Commit

Permalink
CR11 fix verification (#10951)
Browse files Browse the repository at this point in the history
* Force AddressSortedLinkedListWithMedian library redeploy for CR11

* CI fix

* PR comments
  • Loading branch information
pahor167 authored Feb 28, 2024
1 parent 7a2d29e commit 901cd42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/protocol/scripts/bash/check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions packages/protocol/scripts/check-backward.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 901cd42

Please sign in to comment.