Skip to content

[profit] ProfitInputs and NetProfit missing #[non_exhaustive] attribute #153

@obchain

Description

@obchain

Refs #40

File: crates/charon-core/src/profit.rs

PR branch: feat/15-profit-calc-and-queue

Problem:
Project pattern established in PR #27 and #28 reviews: all public structs in charon-core that represent data with potential future fields carry #[non_exhaustive]. ProfitInputs and NetProfit are public structs in charon-core. Likely future additions: mev_tip_cents (coinbase bribe for private mempool), priority_fee_cents (EIP-1559 tip), execution_risk_discount.

Without #[non_exhaustive], adding any field is a semver-breaking change that forces all struct-literal construction sites to update simultaneously.

Fix: Add #[non_exhaustive] to ProfitInputs and NetProfit. Update unit tests to use constructor functions or struct update syntax (..Default::default()) instead of exhaustive struct literals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions