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

Upgrade errors for additive and deponly policies #20695

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jordanjennings-mysten
Copy link
Contributor

Description

support additive and deponly policies for upgrade errors

Test plan

snapshot testing


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 8:39pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2024 8:39pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2024 8:39pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2024 8:39pm

Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Some small questions here and there, but otherwise good to go!

4 │ module upgrades::upgrades {
│ ^^^^^^^^ New unexpected struct 'NewStruct'.
= Structs are part of a module's public interface and cannot be changed during an upgrade.
Copy link
Member

Choose a reason for hiding this comment

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

Should this be "removed or changed" to line up with the new wording you're using elsewhere?

@@ -90,7 +90,7 @@ error[Compatibility E01005]: type parameter mismatch
46 │ public fun add_type_param<T, U>(a: T): T { return a }
│ ^^^^^^^^^^^^^^ Expected 1 type parameter, found 2
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed this here (there may be other places).

Suggested change
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.

errors: Vec<UpgradeCompatibilityModeError>,
}

impl Default for CliInclusionCheckMode {
Copy link
Member

Choose a reason for hiding this comment

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

You can derive this Default (clippy may even complain to you to do that).

impl InclusionCheckMode for CliInclusionCheckMode {
type Error = Vec<UpgradeCompatibilityModeError>;

fn module_name_mismatch(&mut self, _old_address: &Identifier, _new_address: &Identifier) {}
Copy link
Member

Choose a reason for hiding this comment

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

Is a module name mismatch even possible? I thought we performed this check by first lining up modules by their name. Should this case be removed from the interface?

diags.extend(module_diags);
}
None => {
// TODO USE
Copy link
Member

Choose a reason for hiding this comment

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

Is this TODO still relevant?

@@ -920,6 +1224,14 @@ fn function_signature_mismatch_diag(

let def_loc = func_sourcemap.definition_location;

let reason = if public_visibility_related_error {
"Functions are part of a module's public interface \
and cannot be removed or changed during an 'compatible' upgrade."
Copy link
Member

Choose a reason for hiding this comment

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

Ah, here it is.

Suggested change
and cannot be removed or changed during an 'compatible' upgrade."
and cannot be removed or changed during a 'compatible' upgrade."

Comment on lines +1794 to +1795
and cannot be changed during a 'compatible' upgrade."
.to_string()
Copy link
Member

Choose a reason for hiding this comment

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

nit: strange indentation/line-breaks.

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