Skip to content

add tx_hash ordering strategy for deterministic numerical block ordering#22

Merged
vbuilder69420 merged 1 commit into
developfrom
agent/issue-20-numerical-ordering-strategy
Feb 21, 2026
Merged

add tx_hash ordering strategy for deterministic numerical block ordering#22
vbuilder69420 merged 1 commit into
developfrom
agent/issue-20-numerical-ordering-strategy

Conversation

@vbuilder69420

Copy link
Copy Markdown
Collaborator

Closes #20

Description

Adds a new TxHash ordering strategy (sorting = "tx_hash" in config) that sorts SimulatedOrders numerically by their identifier's fixed_bytes() (B256):

  • Mempool txs → sorted by transaction hash
  • Bundles → sorted by bundle UUID bytes zero-padded to 32 bytes

This produces a fully deterministic, profit-agnostic block ordering, useful for the cases described in the issue.

Changes

File Change
building/block_orders/order_priority.rs Add OrderTxHashCmp + OrderTxHashPriority via macro + unit test
building/mod.rs Add TxHash variant to Sorting enum with constant, FromStr, Display
live_builder/config.rs Import + wire up Sorting::TxHash in both match blocks

Usage

[[builders]]
name = "numerical"
sorting = "tx_hash"

Test Results

  • cargo check
  • cargo clippy --workspace --features="" -- -D warnings
  • New unit test: order_priority::test::tx_hash_ordering — verifies lower hash ID sorts before higher hash ID

Safety

No safety-critical paths touched. Pure ordering strategy addition.

@vbuilder69420 vbuilder69420 added the agent PR created by autonomous agent label Feb 21, 2026
@vbuilder69420 vbuilder69420 merged commit 48976d7 into develop Feb 21, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent PR created by autonomous agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New ordering strategy: numerical

1 participant