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

[move][move-compiler][errors] Add error codes to clever errors #21426

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

Conversation

cgswords
Copy link
Contributor

@cgswords cgswords commented Mar 6, 2025

Description

This revises clever errors to include an error code, plus swaps them to packed_struct.

Test plan

Tests versus legacy error codes, updated error code sin transational tests, and additional testing in the sui crate.


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):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@cgswords cgswords requested a review from tzakian March 6, 2025 00:34
@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env March 6, 2025 00:34 — with GitHub Actions Inactive
Copy link

vercel bot commented Mar 6, 2025

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 Mar 21, 2025 11:28pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Mar 21, 2025 11:28pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Mar 21, 2025 11:28pm

Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. The main thing is seeing if we can remove the legacy_error_bitset and if error_bitset can just be used everywhere.

// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

const BITSET_VALUE_UNAVAILABLE: u16 = u16::MAX;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm not grokking, but I'm confused why we need to keep this around, and why we can't just use the new bitset logic in error_bitset.rs?

pub mod files;
pub mod interactive;
pub(crate) mod legacy_error_bitset;
Copy link
Contributor

Choose a reason for hiding this comment

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

If a code for the error is set the behavior can diverge, but otherwise it should be the same between the two no? In which case we should be able to get rid of legacy_error_bitset entirely

Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for doing this!

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