Skip to content

[scanner] OracleUpdate and PreSignedLiquidation missing #[non_exhaustive] #232

@obchain

Description

@obchain

Refs #46

PR: feat/21-mempool-monitor
File: crates/charon-scanner/src/mempool.rs

Problem

The following public types have public fields and are missing #[non_exhaustive]:

  • OracleUpdate (4 public fields)
  • PreSignedLiquidation (5 public fields)

Absent #[non_exhaustive], adding a field (e.g. block_seen: u64 to OracleUpdate or gas_estimate_at_sign: u128 to PreSignedLiquidation) is a semver-breaking change for any caller constructing these types with struct literal syntax.

The project pattern requires #[non_exhaustive] on all public types with public fields in library crates. This has been enforced since PR #27 and is a recurring finding in PRs #27 and #28.

Required fix

Add #[non_exhaustive] to OracleUpdate and PreSignedLiquidation. Downstream construction must use a constructor or builder — direct struct literal construction by external callers is intentionally prevented so the types can evolve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)priority:p2-polishNice-to-have / polish

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions