Conversation
86fe0f4 to
e1d4da3
Compare
…loses #402) A misconfigured fork or a runtime self-destruct on the deployed CharonLiquidator surfaced as a generic submit_failed (broadcast-stage estimateGas revert), leaving operators unable to distinguish "the liquidation logic reverted" from "no code at the configured address". Mechanism: - New constant drop_reason::LIQUIDATOR_NOT_DEPLOYED. Stable-name pin + typed-helper round-trip extended. - process_opportunity probes eth_getCode at the liquidator address upstream of encode_and_simulate. If empty, label drop liquidator_not_deployed and return early. Why upstream: geth/anvil reply to eth_call against a no-code address with Ok(0x), so a missing contract would otherwise pass the gate and queue. Reviewer caught the unreachable-branch regression in v1. - Cost: one eth_getCode per actionable opportunity (subset of liquidatable bucket). ~10/min on busy mainnet, well within budget. - New Grafana panel "Executor — drops by reason" using the reason metric (charon_opportunities_dropped_total, distinct from the stage-labelled charon_executor_opportunities_dropped_total).
e1d4da3 to
d99d275
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
drop_reason::LIQUIDATOR_NOT_DEPLOYED = "liquidator_not_deployed"plus stable-name pin + typed-helper round trip.process_opportunityprobeseth_getCodeat the liquidator address before the simulation gate. Empty bytecode → drop with the new reason and return early; non-empty → fall through toencode_and_simulate(Err arm now genuinely means logic-revert).eth_callagainst no-code withOk(0x), so a missing contract would otherwise pass the gate, queue, and only surface assubmit_failedat broadcast — generic and indistinguishable from a real revert.charon_opportunities_dropped_total{reason}(distinct metric name from the stage-labelledcharon_executor_opportunities_dropped_total).Test plan
cargo test -p charon-metrics --lib— 5/5 pass (extendedopportunities_drop_reason_names_are_stable+typed_helpers_are_panic_free).cargo build -p charon-cliclean.Closes
#402
Follow-up
File a separate issue for
broadcast_opportunityto re-probeeth_getCodeonsubmit_failedand relabel asliquidator_not_deployedwhen the address has gone empty between gate and broadcast (covers the narrow window where a self-destruct lands between the upstream probe and broadcast).