Tracking issue spun out of #208.
Context
Batcher::encode_calldata returns Bytes that are not self-validating. Per CLAUDE.md, every liquidation tx must pass an eth_call simulation gate before broadcast. The single-opportunity path is covered by TxBuilder → Simulator::simulate; the batch path does not yet have an equivalent call site wired up in the CLI pipeline.
The Rustdoc on encode_calldata now documents this contract explicitly and requires callers to run the returned calldata through Simulator::simulate before broadcast.
Scope
- Add a batch-aware simulation helper that takes a
LiquidationBatch + Bytes and dispatches Simulator::simulate against the CharonLiquidator contract.
- Wire it into the CLI pipeline once the batcher graduates from planner-only to a producer of submitted txs.
- Add a fork test that broadcasts a batch after a successful simulate and asserts
BatchExecuted emission, mirroring the existing single-opp test.
Acceptance
- No code path outside tests calls
encode_calldata without passing the result through Simulator::simulate first.
- Fork test covers simulate-then-broadcast for
batchExecute.
- CLAUDE.md safety invariant (eth_call gate on every broadcast) remains unviolated for the batch path.
Refs #208.
Tracking issue spun out of #208.
Context
Batcher::encode_calldatareturnsBytesthat are not self-validating. Per CLAUDE.md, every liquidation tx must pass aneth_callsimulation gate before broadcast. The single-opportunity path is covered byTxBuilder→Simulator::simulate; the batch path does not yet have an equivalent call site wired up in the CLI pipeline.The Rustdoc on
encode_calldatanow documents this contract explicitly and requires callers to run the returned calldata throughSimulator::simulatebefore broadcast.Scope
LiquidationBatch+Bytesand dispatchesSimulator::simulateagainst theCharonLiquidatorcontract.BatchExecutedemission, mirroring the existing single-opp test.Acceptance
encode_calldatawithout passing the result throughSimulator::simulatefirst.batchExecute.Refs #208.