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

UP-18: ledger API split of upgrade errors (Scala changes only) #20350

Open
wants to merge 22 commits into
base: main-2.x
Choose a base branch
from

Conversation

carlpulley-da
Copy link
Contributor

@carlpulley-da carlpulley-da commented Nov 22, 2024

@carlpulley-da carlpulley-da linked an issue Nov 22, 2024 that may be closed by this pull request
@carlpulley-da carlpulley-da marked this pull request as ready for review November 22, 2024 17:10
dstTemplateId: Identifier,
signatories: String,
observers: String,
optKey: Option[(String, String)],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

msg is not captured here as this causes truncation errors

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're reaching the limit of grpc error message sizes, I believe theres a way to bump it, perhaps @tudor-da knows?

Copy link
Contributor

@samuel-williams-da samuel-williams-da left a comment

Choose a reason for hiding this comment

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

Thanks Carl!


@Explanation("An optional contract field with a value of Some may not be dropped during downgrading")
@Resolution(
"Ensure optional contract fields with a value of Some are not dropped"
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to revisit these errors strings, but we'll leave the canton people to give suggestions here

loggingContext: ContextualizedErrorLogger
) extends DamlErrorWithDefiniteAnswer(
cause = cause
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we don't give any info for this message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. With my original thinking, both fields would involve converting Value to a string. My current understanding is that this could lead to grpc error headers being truncated, hence why I'd avoided doing this.

Looking again at the contents of Error.Upgrade.DowngradeDropDefinedField, I've realised that the first field has type Ast.Type which might be a reasonable value to serialise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in changes to capture expectedType

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it not possible to simply include the field name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this is currently possible? The current data structure we have to work with is DowngradeDropDefinedField(expectedType: Ast.Type, actualValue: Value) and there's an associated TODO (#17647) that likely is work that would enable doing something like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's worth doing, just extending the error type if its easy.
idm if its this Pr or another

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I plan to do this as part of the work under UP-20 (in addition to handling the lookup errors).

dstTemplateId: Identifier,
signatories: String,
observers: String,
optKey: Option[(String, String)],
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're reaching the limit of grpc error message sizes, I believe theres a way to bump it, perhaps @tudor-da knows?

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.

UP-18 Upgrades error piping
2 participants