Skip to content

[pipeline] PR #42 enqueues calldata built with empty flash-loan params from unresolved PR #39 bug #169

@obchain

Description

@obchain

Refs #42

PR: feat(cli): wire scanner → router → builder → simulator pipeline (feat/17-cli-e2e-pipeline)
Commit: latest on feat/17-cli-e2e-pipeline
File: crates/charon-executor/src/builder.rs, crates/charon-flashloan/ (build_flashloan_calldata)

PRD / invariant violated: Flash-loan atomicity requires the params slot of flashLoanSimple to carry borrower/vtokens/repay amount so executeOperation can decode them.

Problem:

PR #39 finding 3 (filed, open) identified that build_flashloan_calldata encodes params as empty bytes. CharonLiquidator.executeOperation ABI-decodes params to extract borrower address, vToken addresses, and repay amount. With empty params, ABI decode reverts or decoded values are zero/default, causing liquidateBorrow to be called with address(0) borrower and 0 repay amount.

PR #42 runs the full pipeline through the flash-loan router and builder, then pushes the resulting LiquidationOpportunity (with its calldata) to OpportunityQueue. Every entry in the queue has structurally invalid calldata. The queue gives no indication of this — entries are stored and ranked as if valid.

When PR #44 (broadcast) consumes these entries, every flash-loan submission will revert at the executeOperation decode step, burning gas.

Impact: Every liquidation submitted by the bot will revert on-chain. Gas is lost on each attempt. This is a complete functional failure of the liquidation path.

Fix: Resolve PR #39 finding 3 before merging PR #42: build_flashloan_calldata must accept liquidation_params: &[u8] and forward it into the params argument of flashLoanSimple. Do not merge the pipeline PR while the calldata encoding is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p0-blockerBlocks the critical pathstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions