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

JSON API Upgrades: ETX-500 require fully qualified template ids #19149

Merged

Conversation

raphael-speyer-da
Copy link
Collaborator

@raphael-speyer-da raphael-speyer-da commented May 3, 2024

  • update all instances of ContractTypeId.OptionalPkg to ContractTypeId.RequiredPkg
  • removed ContractTypeId.OptionalPkg and ContractTypeId.NoPkg type aliases entirely
  • update tests to use fully qualified template ids, i.e. including a package reference
  • update integration tests which do json-api queries to include a package reference in template ids

We still need to distinguish package name vs package id at the point where we resolve contract type ids, so we keep the logic that we used on missing package id, and do the same thing in the case of a package name. This logic deals with the fact that new packages can get uploaded in the background, and so we need to be able to treat a package name as a dynamically late-bound mapping to specific package.

@raphael-speyer-da raphael-speyer-da marked this pull request as draft May 3, 2024 07:09
@raphael-speyer-da raphael-speyer-da force-pushed the rls/etx-500-require-fully-qualified-template-ids branch 3 times, most recently from e112a7d to c4bd32e Compare May 6, 2024 01:56
@raphael-speyer-da raphael-speyer-da marked this pull request as ready for review May 6, 2024 02:01
@raphael-speyer-da raphael-speyer-da force-pushed the rls/etx-500-require-fully-qualified-template-ids branch 2 times, most recently from 529b27c to 69f7fb5 Compare May 6, 2024 05:14
@@ -66,6 +66,9 @@ object HttpServiceTestFixture extends LazyLogging with Assertions with Inside {

private val doNotReloadPackages = FiniteDuration(100, DAYS)

// This may need to be updated if the Account.daml is updated.
val staticPkgIdAccount = "b3c9564bb7334bfd0f82099893eba518afc3b68a4d5c66cb2835498252db93e9"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code does not currently depend on the integration-tests-lib, which reads current package ids of each package. The package ids are not expected to be updated often, but we help ensure this value is kept up-to-date with this assertion
https://github.com/digital-asset/daml/pull/19149/files?diff=split&w=1#diff-f3396356d430497a19c0ec5e05f9a95cb546414b908043c6037c70eb1d869eb3R76

)
finalResult <- {
val packageId = (x: C.RequiredPkg).packageId
if (packageId.startsWith("#")) { // Used package name, not package id
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The presence of a package name now has the same resolution logic that the absence of a package id had previously. The package ids that share this name may be updated on the ledger in the background, so we may need to dial back into the ledger to find out about the current set of package ids.

Copy link
Collaborator

@erwin-ramirez-da erwin-ramirez-da left a comment

Choose a reason for hiding this comment

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

LGTM

@raphael-speyer-da raphael-speyer-da force-pushed the rls/etx-500-require-fully-qualified-template-ids branch from 69f7fb5 to 4162716 Compare May 9, 2024 04:11
@raphael-speyer-da raphael-speyer-da merged commit 581021a into main-2.x May 10, 2024
18 checks passed
@raphael-speyer-da raphael-speyer-da deleted the rls/etx-500-require-fully-qualified-template-ids branch May 10, 2024 00:05
garyverhaegen-da added a commit that referenced this pull request May 15, 2024
Releases were broken by [#19149] because package IDs include the SDK
version in what they hash.

[#19149]: #19149
garyverhaegen-da added a commit that referenced this pull request May 16, 2024
Releases were broken by [#19149] because package IDs include the SDK
version in what they hash.

[#19149]: #19149
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.

None yet

2 participants