Repository navigation
Description
Problem
decdn_incentive::tx::send_broadcast_unknown (crates/incentive/src/tx.rs) classifies any transport-class failure from CallBuilder::send() as "may have broadcast". On the production provider that is too broad.
build_provider (crates/client/src/provider.rs) uses ProviderBuilder::new() with the recommended fillers, simple nonce management, and a wallet. So send() first reads the chain: eth_getTransactionCount, eth_estimateGas, fee reads, and possibly eth_chainId. Only then does it sign and call eth_sendRawTransaction. A timeout, a reset, an HTTP 5xx, or an unreadable response on one of those reads returns the same ContractError::TransportError as a lost eth_sendRawTransaction. Nothing was signed or sent, but the classifier says the tx may have broadcast.
Effects:
decdn pool close --all/reclaim --allcount the pool asunconfirmed, notfailed(fix: pool batch summary counts a maybe-broadcast tx as failed #2427, fix: count a maybe-broadcast pool tx as unconfirmed in --all sweeps #2430). During an RPC outage, every pool in a sweep can read "may have broadcast".pool close,pool reclaim,approve,tx::send_for_receipt(SendOutcome::MaybeBroadcast),open_pool(OpenUnconfirmed { tx: None }) andtop_up(TopUpUnconfirmed { tx: None }) tell the operator to check for a transaction that does not exist.
The error is on the safe side: a false "may have broadcast" costs a manual check, and a false "nothing sent" can double-submit. So this is low priority. But the dRPC free tier (the testnet RPC) fails reads often, so the false warning is common in practice.
The unit tests do not see this. The mocked providers in pool/tests.rs and buyer_pool tests are filler-free, so the only RPC that send() makes is the send itself.
Fix
Make the failing stage known by structure, not by error kind. Fill the request first, then send the filled envelope:
provider.fill(call.into_transaction_request()): a failure here broadcast nothing. Keep revert detection (as_revert_data) on this leg, becauseeth_estimateGasis where a revert shows up.provider.send_tx_envelope(..): applysend_broadcast_unknownonly to a failure on this leg.
Put the split in one shared helper in decdn-incentive, so that tx::send_for_receipt, the CLI pool sends, and the buyer_pool sends all use it.
Checks
- A mocked provider with the production fillers, whose
eth_estimateGas(or nonce read) fails in transport: the error is not marked maybe-broadcast (TxUnconfirmed,SendOutcome::MaybeBroadcast,OpenUnconfirmed,TopUpUnconfirmed). - The same provider whose
eth_sendRawTransactionfails in transport: the error is still marked maybe-broadcast.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity