sui icon indicating copy to clipboard operation
sui copied to clipboard

[CLI] Add module binary version check when publishing and upgrading modules

Open tzakian opened this issue 1 year ago • 4 comments
trafficstars

Description

Adds two small checks to give better error messages if a package with an unsupported binary version number is published to a specific network.

Test plan

Tested locally against enum changes.


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:
  • [X] CLI: Added more descriptive errors if modules are published with an unsupported binary version number for the given network.
  • [ ] Rust SDK:

tzakian avatar May 07 '24 21:05 tzakian

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

vercel[bot] avatar May 07 '24 21:05 vercel[bot]

Thanks @tzakian! Overall, looks pretty good. Is there a reasonable way to test these?

stefan-mysten avatar May 07 '24 22:05 stefan-mysten

Is there a reasonable way to test these?

Not today as there is no easy way of compiling/publishing modules at a different version from the network today. Once we add enums though we can add a test for this since we'll have multiple binary versions that we can play with.

tzakian avatar May 08 '24 00:05 tzakian

Is there a reasonable way to test these?

Not today as there is no easy way of compiling/publishing modules at a different version from the network today. Once we add enums though we can add a test for this since we'll have multiple binary versions that we can play with.

Thanks!

We can use either bail! or SuiError::ModulePublishFailure although I have a preference for the latter since it's already used below in this function for similar types of errors.

Makes sense!

There's a test failing related to the GraphQL Shim Layer for TS SDK, might wanna have a look at that before merging.

stefan-mysten avatar May 08 '24 00:05 stefan-mysten