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 type params, enable upgrade errors #20321

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

Conversation

jordanjennings-mysten
Copy link
Contributor

@jordanjennings-mysten jordanjennings-mysten commented Nov 19, 2024

Description

  • enables upgrades errors on cli
  • Add type param errors to upgrades
  • list missing modules
  • fix bug with source map indexing
  • lost public on function error should have separate message

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 Nov 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 Nov 22, 2024 9:49pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2024 9:49pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2024 9:49pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2024 9:49pm

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.

This is shaping up very nicely, thanks @jordanjennings-mysten. Two main groups of comments:

  • About formatting/wording -- here @tnowacki / @tzakian / @cgswords will probably have more insights because they are more familiar with how the compiler outputs error messages, but the main thing I wanted to flag is that the last diagnostic (the one that explains how to fix the issue) could really benefit from including a full example of what the compatibility check expected (i.e. not the delta, but here's the thing you should put back into the package). In some cases (like type and function parameters) this is not possible because we don't have parameter names from the bytecode version, but everywhere else, it should be.
  • About enabling this forever -- some comments about making that more robust and giving people a way out.
  • Testing -- we should add some tests for positional structs and enums, and structs/enums without any fields, because they will end up with generated fields and field names that we want to detect and eliminate from the output where possible.

crates/sui/src/client_commands.rs Outdated Show resolved Hide resolved
│ ^^^^^^^^^^^^^^^^^^^^^^^^ Unexpected abilities 'copy'
= Structs are part of a module's public interface and cannot be changed during an upgrade.
= Restore the original struct's abilities for struct 'StructAbilityMismatchAdd'.
Copy link
Member

Choose a reason for hiding this comment

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

This message would be more useful if it mentioned what the abilities should be (i.e. not as a delta, but the original list of abilities).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

= Restore the original struct's abilities [have original list somehow (move snippet?)] for struct 'StructAbilityMismatchAdd'.

crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
@jordanjennings-mysten
Copy link
Contributor Author

About enabling this forever -- some comments about making that more robust and giving people a way out.

I'll pull this out into a separate PR so we can independently decide on it. I have a bit of Additive and DepsOnly policy handling done but it feels like it might need another PR to hone in on the specific diagnostics so each individual issue is well documented.
#20342

@@ -15,6 +15,7 @@ pub mod key_identity;
pub mod keytool;
pub mod shell;
pub mod sui_commands;
mod upgrade_compatibility;
Copy link
Contributor Author

@jordanjennings-mysten jordanjennings-mysten Nov 20, 2024

Choose a reason for hiding this comment

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

TODO remove before merge

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