New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripts for verifying bytecodes #5111
Changes from 78 commits
b6ae41f
a798bbb
bdc401d
827fe47
3568686
6673ac3
fadeeb5
3dc1f5b
5db2d97
2378b6c
d7739e9
1264332
d5ca2bc
b0c5c4a
fb1d449
6dd5589
dc1abfb
ae8ac94
4f28ed7
9806368
8826f37
0810249
297ccb0
268491b
a2458f8
3d3c92d
2e6c8da
1d81b76
572a11c
b3939b9
e6f3b1a
bae1c71
31f50a4
c0ef4a3
8e96be0
4f46769
7b9028a
2eeb20f
123b253
db44368
cb2a732
4300300
fd646d3
7d56970
515f636
79e54ee
e66e792
8298483
1c22db6
4cd6a59
b275e38
b32b67c
e263326
0e42bc8
e5ad600
1f5d83d
ea3c882
1d956d8
ae82ed0
d1c7a44
e8ca6f8
a598575
b7945dc
9056cb0
c47a560
685b6eb
dd2f624
973c462
9b8479d
180d5d8
cc3c1b3
6ec5343
0d322e8
8241a48
c733041
24ea9fb
f3a4db5
f09dd79
225a0a8
477d4d7
43b6762
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -491,6 +491,56 @@ jobs: | |
name: Unit tests | ||
command: yarn --cwd packages/protocol test common/ | ||
|
||
protocol-verify-bytecodes: | ||
<<: *defaults | ||
resource_class: large | ||
steps: | ||
- attach_workspace: | ||
at: ~/app | ||
- run: | ||
name: Check if the test should run | ||
command: | | ||
./scripts/ci_check_if_test_should_run_v2.sh @celo/protocol | ||
- run: | ||
name: Verify bytecodes between RC1 and current branch | ||
command: | | ||
cd packages/protocol | ||
|
||
# deploy RC1 contracts to ganache devchain | ||
# We fetch via HTTPS instead of SSH to avoid the interactive "do you | ||
# trust the RSA key fingerprint" prompt. | ||
git remote add origin-https https://github.com/celo-org/celo-monorepo.git | ||
git fetch origin-https rc1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point, this is incorrect, as I believe there are only 3 options:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. went with option 3 |
||
git checkout rc1 | ||
rm -rf build/contracts | ||
yarn devchain generate-tar devchain.tar.gz --migration_override <(echo '{"downtimeSlasher": { "slashableDowntime": 60 } }') | ||
# store build artifacts in build/rc1 | ||
mv build/contracts build/rc1 | ||
|
||
# build current contracts (artifacts in build/contracts) | ||
git checkout ${CIRCLE_BRANCH} | ||
rm -rf build/contracts | ||
yarn build | ||
|
||
# run ganache, wait for it to start | ||
yarn devchain run-tar devchain.tar.gz & | ||
GANACHE_PID=$! | ||
echo "Waiting for ganache to start" | ||
sleep 30 | ||
|
||
# verify bytecodes of RC1 deployment | ||
yarn truffle exec --network development ./scripts/truffle/verify-bytecode.js --build_artifacts build/rc1 --before_release_1 | ||
# generate report between RC1 and current branch | ||
yarn ts-node scripts/check-backward.ts report --exclude ".*Test|Mock.*|I[A-Z].*|.*Proxy|LinkedList|SortedLinkedList|SortedLinkedListWithMedian|MultiSig.*|ReleaseGold" -o build/rc1 -n build/contracts --output_file report.json | ||
# deploy new contracts and generate Governance proposal for upgrade | ||
# TODO: remove --truffle_override once gas limit is increased | ||
yarn truffle exec --network development ./scripts/truffle/make-release.js --build_directory build/ --report report.json --proposal proposal.json --initialize_data example-initialize-data.json --truffle_override '{"gasLimit": 12500000, "gas": 12500000 }' | ||
# verify bytecode of upgrade deployment | ||
yarn truffle exec --network development ./scripts/truffle/verify-bytecode.js --build_artifacts build/contracts --proposal ../../proposal.json | ||
|
||
# stop ganache | ||
kill $GANACHE_PID | ||
|
||
protocol-test-compatibility: | ||
<<: *defaults | ||
resource_class: large | ||
|
@@ -987,6 +1037,9 @@ workflows: | |
- protocol-test-common: | ||
requires: | ||
- lint-checks | ||
- protocol-verify-bytecodes: | ||
requires: | ||
- lint-checks | ||
- protocol-test-compatibility: | ||
requires: | ||
- lint-checks | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.