Skip to content

Order::Bundle vs Order::BundleV2 not disambiguated by untagged JSON deserialization #486

Description

@0w3n-d

Status

Three tests are currently broken on develop (discovered while re-enabling CI's unit-test job): block_merging::tests::order_json_round_trip_bundle_v2, block_merging::tests::order_json_untagged_disambiguates_bundle_from_bundle_v2, block_merging::tests::block_merging_data_json_round_trip_mixed_orders (all in crates/types/src/block_merging.rs).

Why

Order is a #[serde(untagged)] enum with variants Tx, Bundle, BundleV2. BundleOrder and BundleOrderV2 have overlapping/compatible field shapes (BundleOrderV2 added latest_only as a required field where BundleOrder has it as #[serde(default)]), so untagged deserialization doesn't reliably distinguish them — a BundleV2 payload can deserialize back as a plain Bundle, silently losing which variant was intended.

Affected surface

  • crates/types/src/block_merging.rsOrder, BundleOrder, BundleOrderV2, and the 3 tests, currently marked #[ignore] pointing here

Steps

  • Decide the disambiguation strategy (e.g. an explicit tag field, or a distinguishing required field on BundleOrderV2 that BundleOrder structurally cannot satisfy)
  • Fix and un-ignore the 3 tests

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