Skip to content

waitForTransactionReceipt when using MEV Blocker does not wait #4012

@frontier159

Description

@frontier159

Check existing issues

Viem Version

2.38.0

Current Behavior

I'm using https://rpc.mevblocker.io (see MEV Blocker) on mainnet in order to get some MeV protection.

Within this:

const txHash = await wclient.writeContract(req);
const receipt = await wclient.waitForTransactionReceipt({
  hash: txHash,
});

As soon as the transaction is signed receipt resolves immediately (too early) and all fields on the receipt are undefined.

I tried retrying with confirmations=2 (if the first attempt is undefined), but this never resolves.

If I manually sleep for 15 seconds and then use:

receipt = await wclient.getTransactionReceipt({
  hash: txHash,
});

Then the receipt is populated ok - but obviously this isn't too useful as the tx may not have mined in that time.

If i update the RPC to be a non-mev protected RPC then it works ok...

Any ideas?

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions