-
Notifications
You must be signed in to change notification settings - Fork 39
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
contract upgrade #968
contract upgrade #968
Conversation
Deploying with Cloudflare Pages
|
17f858a
to
3417f5a
Compare
3417f5a
to
dfb6c44
Compare
cbd9f3b
to
515631d
Compare
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.
Does the new rooms example work for you?
Yep. I like.
main/guides/zoe/contract-upgrade.md
Outdated
|
||
::: details What happens if we don't use baggage? | ||
|
||
When the contract instance is restarted, it gets a fresh [heap](../js-programming/#vats-the-unit-of-synchrony), so [ordinary heap state](./contract-basics.html#state) does not survive upgrade. This implementation does not persist the effect of `E(publicFacet).set(2)` from the first incarnation: |
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.
I think this should be converted to a rooms
example. Similarly in the following paragraph.
main/guides/zoe/contract-upgrade.md
Outdated
- Once the state is defined by the `init` function (3rd arg), properties cannot be added or removed. | ||
- Values of state properties must be serializable. | ||
- Values of state properties are hardened on assignment. | ||
- You can replace the value of a state property (e.g. `state.zot = [...state.zot, 'last']`), and you can update stores (`state.players.set(1, player1)`), but you cannot do things like `state.zot.push('last')` nor `state.jot = { x: 1 }; state.jot.x = 2`. |
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.
It's unfortunate that state.jot = { x: 1 }; state.jot.x = 2
broke across a line for me. What do you think of making it a multiline expression to make it more apparent?
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.
added a line-break
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.
With one suggested change, this looks good to me.
f0d8424
to
a594490
Compare
- set off governance for upgrade - cite other relevant docs publicFacet was a poor example of baggage key chore: simplify number|string to just number in state example chore: durable state snippet w/interface guard - regions for snippets - more concise style: avoid arrowParens build: add @agoric/zone for durability/upgrade snippets chore: use rooms in heap state example to match durable chore: include contract-upgrade in LHS TOC Co-authored-by: Chris Hibbert <[email protected]>
a594490
to
dad0201
Compare
goal:
fixes #750
rendered:
Audience is dapp/contract devs, so the emphasis is on how to achieve it, not the theory of how the infrastructure works. @LuqiPan , @kbennett2000 I'm particularly interested to know if this brief account covers the subject well enough for you to get a working knowledge of it.
It lacks detail on interface guards. I propose to merge this as is and add those later. Opinions?
I started trying to make sure all the code snippets are really tested, but
makeZoeKitForTest
doesn't support upgrade, and it's not clear to me how to do bootstrap tests withmakeSwingsetTestKit
from outside agoric-sdk; I have already spent probably too much time on tooling in #965.Testing considerations
Examples are not well tested due to the difficulty of landing...