Skip to content
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

test(deployment): end-to-end test of on-chain contract upgrade #7691

Merged
merged 9 commits into from
May 13, 2023

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented May 11, 2023

closes: #6099

Description

Add packages/agoric-cli/test/upgrade-contract/contract-upgrade-smoketest.sh to test if a contract installation and upgrade can be done on-chain, after bootstrap, with only governance proposals (no ag-solo).

Security Considerations

Increases assurance that contract bugs can be fixed via later governed upgrades.

Scaling Considerations

n/a

Documentation Considerations

n/a

Testing Considerations

Currently needs to be run manually. Could be added to CI integration tests at a later time.

@michaelfig michaelfig added the agoric-cli package: agoric-cli label May 11, 2023
@michaelfig michaelfig self-assigned this May 11, 2023
@dckc
Copy link
Member

dckc commented May 12, 2023

  1. start local chain

  2. fund gov1

  3. smoke test

~/projects/agoric-sdk/packages/inter-protocol
23:45 connolly@bldbox$ ./scripts/start-local-chain.sh
(cd ../cosmic-swingset; make fund-acct ACCT_ADDR=agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce FUNDS=20000000000000uist)

3,

~/projects/agoric-sdk/packages/agoric-cli
23:46 connolly@bldbox$ AGORIC_NET=local ./test/upgrade-contract/contract-upgrade-smoketest.sh 

@dckc
Copy link
Member

dckc commented May 12, 2023

Contract upgrade worked, modulo a problem with promise spaces (IOU an issue):

$ agops inter my make --from gov1
Object [Alleged: BoardRemoteInstanceHandle] { getBoardId: {} }
2023-05-12T05:01:22.527228679Z tx not in block 223 retrying...
2023-05-12T05:01:27.534758221Z tx not in block 224 retrying...
{"height":"224","txhash":"3FEEE9E0B07F4CB4A65790662970013B0733C513DD59D2A1B1DDDE23D9BB3B00"}
{"id":"my-1683867689620","invitationSpec":{"instance":{},"publicInvitationMaker":"makeInvitation","source":"contract"},"numWantsSatisfied":1,"proposal":{"want":{"Tokens":{"brand":{},"value":"32"}}},"result":"Congratulations, Free Tokens!!!"}

@dckc dckc force-pushed the mfig-contract-upgrade-e2e branch from 2e3efb5 to 4ff1ab9 Compare May 12, 2023 13:10
@dckc
Copy link
Member

dckc commented May 12, 2023

cleaned up the git history from last night's WIP WIP commit so we can deal with the pieces separately:

2023-05-12 08:09 4ff1ab9 WIP: possible promise-space fix/tweak
2023-05-12 08:08 97c2992 test: more logging in example contract start, upgrade scripts
2023-05-12 08:07 752e8b2 chore: distinguish output from fixed contract
2023-05-12 08:07 163a3a0 chore(swingset-vat): upgrade logging (WIP)

@dckc dckc force-pushed the mfig-contract-upgrade-e2e branch 2 times, most recently from 2a242bd to f07486a Compare May 12, 2023 16:02
@dckc
Copy link
Member

dckc commented May 12, 2023

This is nearly ready to go, modulo some possible git log message clean-up. Hm... maybe the agops inter my command (6b76847) shouldn't land?

starting from @michaelfig 's last push:
2023-05-11 16:59 8a8dbbf fix(cosmos): avoid scary output for non-tx context of CORE_EVAL

I think these should survive from my attempts to reproduce your results and to use it with the smart wallet:

2023-05-11 22:14 6b76847 feat: play with upgrade contract (WIP)
2023-05-11 22:16 87c6339 feat: publish GoodStuff brand (WIP)
2023-05-12 08:07 bdf982b chore: distinguish output from fixed contract
2023-05-12 08:08 f07486a test: more logging in example contract start, upgrade scripts

It works once as is, but to reliably run it more than once, it relies on the fix in #7710. The way I tested it was with that and the kernel logging improvement (#7711). The exact hashes resulting from cherry-picking are:

2023-05-12 01:36 34d7509 chore: kernel logs vat upgrades, with bundleID and old/new incarnations
2023-05-12 01:07 2a242bd fix(vats): fix promise space reset() misbehavior

My experimental lab notes are in...
#7710 (comment)
#7710 (comment)

with a bit more detail in internal chat

@dckc dckc force-pushed the mfig-contract-upgrade-e2e branch from f07486a to 3c07849 Compare May 12, 2023 21:25
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can imagine some cosmetic improvements, but this is working pretty robustly now. I've seen it go 5 or 6 times.

I did it 3 times:
#7710 (comment)

@michaelfig michaelfig marked this pull request as ready for review May 12, 2023 23:13
Comment on lines +255 to +256
if (untilNumWantsSatisfied && !('numWantsSatisfied' in offerStatus)) {
throw Error('retry (no numWantsSatisfied yet)');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@michaelfig michaelfig enabled auto-merge May 12, 2023 23:14
@michaelfig michaelfig added this pull request to the merge queue May 12, 2023
Merged via the queue into master with commit 7fdeff4 May 13, 2023
@michaelfig michaelfig deleted the mfig-contract-upgrade-e2e branch May 13, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agoric-cli package: agoric-cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verify by end-to-end test a contract on-chain can be upgraded
2 participants