Skip to content

Error: Input to Brillig function is in a separate subgraph to output #19

@jialinli98

Description

@jialinli98

When we attempt to convert field element to U256 with u256::from(field). We will get the following error when running
nargo compile --package is_ape_owner --deny-warnings --skip-brillig-constraints-check

bug: Input to Brillig function is in a separate subgraph to output
    ┌─ /Users/jli/nargo/github.com/noir-lang/noir-bignum/v0.8.3/src/fns/constrained_ops.nr:490:18
    │
490 │         unsafe { __validate_gte_with_flags(lhs, rhs) };
    │                  ----------------------------------- There is no path from the output of this Brillig call to either return values or inputs of the circuit, which creates an independent subgraph. This is quite likely a soundness vulnerability
    │

I created a customized field conversion function to avoid this error temporarily.

fn field_to_u256(f: Field) -> U256 {
    let bytes = f.to_be_bytes();
    from(bytes)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions