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

Add a first version of new upgrade docs #4750

Merged
merged 1 commit into from
Mar 2, 2020
Merged

Add a first version of new upgrade docs #4750

merged 1 commit into from
Mar 2, 2020

Conversation

cocreature
Copy link
Contributor

This PR adds a first version of update documentation and removes the
existing docs which were talking about damlc migrate.
So far the docs focus on the high-level approach to upgrades taken in
DAML and give an example of how to structure upgrade contracts.

What is not covered so far (and I’d like to leave that for a separate
PR) is:

  1. Technical details: How are things split up into packages, which
    restrictions apply to data-dependencies, …
  2. Deployment and Running the upgrade via triggers/daml script/…
  3. Common patterns for handling this in UIs (e.g. “locking” old contracts)

changelog_begin
changelog_end

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

This PR adds a first version of update documentation and removes the
existing docs which were talking about `damlc migrate`.
So far the docs focus on the high-level approach to upgrades taken in
DAML and give an example of how to structure upgrade contracts.

What is not covered so far (and I’d like to leave that for a separate
PR) is:

1. Technical details: How are things split up into packages, which
restrictions apply to data-dependencies, …
2. Deployment and Running the upgrade via triggers/daml script/…
3. Common patterns for handling this in UIs (e.g. “locking” old contracts)

changelog_begin
changelog_end
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

@cocreature cocreature merged commit 1b5140e into master Mar 2, 2020
@cocreature cocreature deleted the upgrade-docs branch March 2, 2020 08:54
Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you so much.

signatories of a contract have agreed to one specific version of a
template. Changing the definition of a template, e.g., by extending it
with a new choice without agreement from signatories of contracts of
that template would completely break the authority guarantees provided
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure but that feels better to me:

Suggested change
that template would completely break the authority guarantees provided
that template would completely break the authorization guarantees provided

those here.) We use a different name for the new template here. This
is not required as templates are identified by the triple
``(PackageId, ModuleName, TemplateName)`` but here we omit package ids
and module names for presentational purposes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
and module names for presentational purposes.
and module names for the sake of simplicity.

:start-after: -- COIN_AMOUNT_BEGIN
:end-before: -- COIN_AMOUNT_END

Now, that we defined our new template, we need to provide a way for
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Now, that we defined our new template, we need to provide a way for
Next, we need to provide a way for

:end-before: -- COIN_AMOUNT_END

Now, that we defined our new template, we need to provide a way for
the signatories issuer and owner to agree to a contract being
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the signatories issuer and owner to agree to a contract being
the signatories, issuer and owner, to agree to a contract being

Now, that we defined our new template, we need to provide a way for
the signatories issuer and owner to agree to a contract being
upgraded. It would be possible to structure this such that issuer and
owner have to agree to an upgrade for each *Coin* contract
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
owner have to agree to an upgrade for each *Coin* contract
owner have to agree to an upgrade for each individual *Coin* contract

the signatories issuer and owner to agree to a contract being
upgraded. It would be possible to structure this such that issuer and
owner have to agree to an upgrade for each *Coin* contract
separately. However, since the template definition for those is all
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
separately. However, since the template definition for those is all
separately. However, since the template definition for all of them is

:end-before: -- UPGRADE_PROPOSAL_END

Now we can define the *UpgradeCoinAgreement* template. This template
has one *nonconsuming* choice that accepts a *Coin* contract, archives
Copy link
Contributor

Choose a reason for hiding this comment

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

The word "accept" is a bit overloaded here. We also need to make it clear that we pass the contract by reference not by value.

Suggested change
has one *nonconsuming* choice that accepts a *Coin* contract, archives
has one *nonconsuming* choice that takes the contract ID of a *Coin* contract, archives

Now we can define the *UpgradeCoinAgreement* template. This template
has one *nonconsuming* choice that accepts a *Coin* contract, archives
this *Coin* contract and creates a *CoinWithAmount* contract with
*amount* set to 1.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
*amount* set to 1.
the same issuer and owner and the *amount* set to 1.

cocreature added a commit that referenced this pull request Mar 4, 2020
This PR addresses the comments from @hurryabit on #4750.

changelog_begin
changelog_end
cocreature added a commit that referenced this pull request Mar 4, 2020
This PR addresses the comments from @hurryabit on #4750.

changelog_begin
changelog_end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants