Skip to content

[Bug] Deployment can fail depending on sampled values #2801

@mikebenfield

Description

@mikebenfield

🐛 Bug Report

When I try to deploy this program:

program test.aleo;

function address_cast:
    input r0 as address.private;
    cast r0 into r1 as scalar;
    output r1 as scalar.private;

Deployment fails with this message

Failed to eject scalar value: The scalar is greater than or equal to the modulus.

because synthesize_key has sampled an address that cannot be cast to a scalar.

For a demo of this failure, see this repo, and run with RUST_BACKTRACE=full cargo run --release. (It's set up to use snarkvm 3.8.0 but it fails on staging also.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions