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

[BUGFIX][CLI] verify-bytecode-meter returns module ticks #16900

Merged
merged 3 commits into from
Mar 28, 2024
Merged

Commits on Mar 27, 2024

  1. [CLI] Add ability to run verifier on an individual module

    ## Description
    
    Adding a couple of features to the `verify-bytecode-meter` command:
    
    - Specify a `--module` (as bytecode) to verify.
    - Specify a protocol version to verify at.
    
    Also switches the `--package` path from a positional parameter to a
    flag, for symmetry with the new `--module` flag.
    
    ## Test Plan:
    
    ```
    sui-framework/deepbook$ cargo run --bin sui -- \
      client verify-bytecode-meter
    sui-framework/deepbook$ cargo run --bin sui -- \
      client verify-bytecode-meter --package .
    sui-framework/deepbook$ cargo run --bin sui -- \
      move build
    sui-framework/deepbook$ cargo run --bin sui -- \
      client verify-bytecode-meter --module build/DeepBook/bytecode_modules/clob.mv
    sui-framework/deepbook$ cargo run --bin sui -- \ # Errors
      client verify-bytecode-meter --package '.'   \
      --module build/DeepBook/bytecode_modules/clob.mv
    ```
    
    ## Release Notes
    
     - Adds a `--module`/`-m` flag to `sui client bytecode-verify-meter` to
       verify some module bytecode.
     - Replaces the positional, optional package path parameter for this
       command with `--package`/`-p`.
    amnn committed Mar 27, 2024
    Configuration menu
    Copy the full SHA
    9844159 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. fixup: No short flags

    amnn committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    ca47055 View commit details
    Browse the repository at this point in the history
  2. [BUGFIX][CLI] verify-bytecode-meter returns module ticks

    We were returning the ticks used for the last function as the verifier
    ticks, which is not correct.  Returning the ticks used for the last
    function is also not particularly useful, but I will fix that in a
    follow-up PR.
    
    Test Plan:
    
    ```
    sui-framework/deepbook$ cargo run --bin sui -- \
      client verify-bytecode-meter
    Total number of linter warnings suppressed: 3 (filtered categories: 2)
    Running bytecode verifier for 7 modules
    ╭──────────────────────────────────╮
    │ Module will pass metering check! │
    ├────────┬────────────┬────────────┤
    │        │ Module     │ Function   │
    │ Max    │ 16000000   │ 16000000   │
    │ Used   │ 5869980    │ 7040       │
    ╰────────┴────────────┴────────────╯
    ```
    amnn committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    a562268 View commit details
    Browse the repository at this point in the history