Skip to content

Bound channel parameters in generators #224

Description

@morehouse

Current funding-related generators choose channel parameter values uniformly randomly. For several parameters this strategy is extremely unlikely to choose valid parameters that the target will accept.

Example: funding_satoshis

Generators currently choose funding_satoshis uniformly randomly from [0, U64_MAX], but only values in the range [0, 16M] (wumbo limit) are guaranteed to be considered valid by all targets. Thus the odds of randomly selecting a universally valid value is ~1/1,000,000,000,000.

For targets that allow funding_satoshis up to the 21M bitcoin supply, our odds are better (but still low) at ~1/10,000, and even then we can rarely actually fund the channels in that range, which further limits deeper fuzzing.

Suggested fix

Have generators choose expected-valid values for the channel parameters. Rely on mutators to test the invalid cases.

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