Skip to content

[executor] Transaction builder: EIP-1559 gas + eth_call simulation gate + nonce management #15

@obchain

Description

@obchain

Context

The last stop before submission. Encodes the call, prices the gas, dry-runs it via eth_call, and hands off to the signer. BSC uses EIP-1559 (since the Paris hard fork). The simulation gate catches ~99% of races pre-submit so we don't burn gas on losing bids.

Scope

  • New crates/charon-executor/ crate
  • TxBuilder::build(opportunity) -> SignedTransaction
  • Encodes CharonLiquidator.executeLiquidation(...) calldata from LiquidationOpportunity
  • EIP-1559 gas pricing: max_fee_per_gas = base_fee × 1.2, max_priority_fee from config
  • eth_call simulation: if the call reverts, abort with the revert reason (no tx sent)
  • NonceManager: monotonic nonce tracking so concurrent liquidations don't collide
  • Skip-submission flag for now (signing comes with wallet setup)

Acceptance criteria

  • charon-executor crate compiles
  • TxBuilder::build returns a fully-encoded, simulatable tx
  • Simulation reverts produce structured error logs with the revert reason
  • NonceManager returns monotonically-increasing nonces concurrently
  • EIP-1559 fields (maxFeePerGas, maxPriorityFeePerGas) populated correctly

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)priority:p0-blockerBlocks the critical pathstatus:readyScoped and ready to pick uptype:featureNew capability or deliverable

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions