Skip to content

fix: a transport failure while filling a tx is reported as a possible broadcast #2431

Closed

Description

@thiras

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:

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, because eth_estimateGas is where a revert shows up.
  • provider.send_tx_envelope(..): apply send_broadcast_unknown only 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_sendRawTransaction fails in transport: the error is still marked maybe-broadcast.

Activity

  1. added
    kind:bug
    rust
    prio:low
    area:payments
    on Oct 12, 2026
  2. self-assigned this
    on Oct 20, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 20, 2026
  4. moved this from In progress to Done in deCDNon Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:paymentskind:bugprio:lowrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions