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

[Forward-port][Upgrades testing] Add cases for unchanged key type with changed key expression #19947

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

moisesackerman-da
Copy link
Contributor

Ports #19897 to daml 3.x

  • Add test cases for unchanged key type with changed key expression

  • Add test cases for unchanged key type with changed key expression, with fetchByKey

  • Add test cases for unchanged key type with changed key expression, with fetch

  • Mark broken tests, organize test tree

  • Add test cases for exercise{,ByKey}{,Cmd}

  • Use 'subtree'

…expression (#19897)

* Add test cases for unchanged key type with changed key expression

* Add test cases for unchanged key type with changed key expression, with fetchByKey

* Add test cases for unchanged key type with changed key expression, with fetch

* Mark broken tests, organize test tree

* Add test cases for exercise{,ByKey}{,Cmd}

* Use 'subtree'
@moisesackerman-da moisesackerman-da requested a review from a team September 17, 2024 12:33
queryKeyUpgraded : Test
queryKeyUpgraded = test $ do
a <- allocateParty "alice"
cid <- a `submit` createExactCmd (V1.UpgradedKey a 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this crashes with

  com.digitalasset.daml.lf.engine.script.Script$FailedCmd: Command QueryContractKey failed: Expecting 3 field for record 878aa1c458493971ff8df6147966ba741fbec794bb522cd96aebfe988a932c82:UpgradedContractKeys:UpgradedKeyKey, but got 2

Comment on lines +56 to +57
[ broken ("queryContractKey, src=v1 tgt=v2", queryKeyUpgraded)
, broken ("exerciseByKeyCmd, src=v1 tgt=v2", exerciseCmdKeyUpgraded)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these two cases are broken on main even though they work on main-2.x

Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know, I think we should create explicit rows for these if they dont already exist in the spreadsheet, so we can mark this behaviour as broken publically

Copy link
Contributor

Choose a reason for hiding this comment

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

Turns out, this is probably because key upgrading is not ported to 3x, unsure when/if it ever will be given non unique contract keys

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm in that case, should we be concerned that the two cases below (fetchKeyUpgraded and exerciseUpdateKeyUpgraded) do seem to work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, possibly

Copy link
Contributor

Choose a reason for hiding this comment

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

@paulbrauner-da What do you think?

Copy link
Contributor

@paulbrauner-da paulbrauner-da Sep 19, 2024

Choose a reason for hiding this comment

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

I think the commands fail because we haven't ported [https://github.com//pull/19780/files#diff-f1459a53d7980874919e46b017e19dfb5dc47c48f49494bab3422d55e62ac48b](this change), but inside the choice bodies it works because of #19668.

But then I think if we allow this, we will run into the problem that #19792 fixes in 2.x, but this is a hack and we want to solve it properly with value normalization in 3.x.

That said, as long as we forbid it at upload time, that shouldn't be reachable.

@moisesackerman-da moisesackerman-da enabled auto-merge (squash) September 19, 2024 12:24
@moisesackerman-da moisesackerman-da merged commit 7478fda into main Sep 19, 2024
14 checks passed
@moisesackerman-da moisesackerman-da deleted the akrmn/contract-key-expression-change-3.x branch September 19, 2024 12:48
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.

3 participants