Skip to content

twap-monitor retries unknown revert selectors every block forever #75

Description

@jean-neiverth

Context

The twap-monitor polls each watched TWAP order every block via eth_call to getTradeableOrderWithSignature. The contract responds with one of five standard IConditionalOrder revert selectors (PollTryNextBlock, PollTryAtBlock, PollTryAtEpoch, OrderNotValid, PollNever) or returns order data on success.

decode_revert_hex (crates/shepherd-sdk/src/cow/composable.rs) matches against these 5 selectors. Unknown selectors return None, and the strategy (modules/twap-monitor/src/strategy.rs:199-206) defaults to TryNextBlock.

Observed

Two orders stuck in an infinite poll loop for the entire 8-day soak, retrying every ~12s. Revert selectors 0x7a933234 (AFTER_TWAP_FINISHED) and 0x2c7ca6d7 are handler-specific errors not in the IConditionalOrder interface — both are permanent conditions.

This produced ~39,000 failed eth_call requests (97.7% of all eth_call traffic), wasting RPC quota and drowning out all other log activity.

Likely fix

Map unrecognised revert selectors (those with a data field) to DontTryAgain instead of TryNextBlock. An eth_call revert with a structured data payload is a contract-level rejection, not a transient transport error.

Files: crates/shepherd-sdk/src/cow/composable.rs, modules/twap-monitor/src/strategy.rs

Metadata

Metadata

Assignees

Labels

bugSomething isn't working.component/cow-integrationshepherd:cow / cow-api order submissioncomponent/modulesshipped guest modules (twap, ethflow, examples, fixtures)pr-trainPart of the current stacked PR train; lands in sequence, do not merge out of order.waiting-reviewThere's an open PR waiting for review

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions