Relay client: Detect reverting meta transaction

:computer: Environment

Using Relay for executing meta transactions on contracts implementing EIP 2771 via MinimalForwarder

:memo:Details

I implemented a meta txn relayer using code found in the article docs.openzeppelin.com/defender/guide-metatx. I am using the defender-relay-client for sending the txns via Relay. Everything works good.

But does defender-relay-client have a way to estimate gas or check if the underlying txn actually reverts or not before submitting the txn? Without that check, every txn will go through without failure Or should that be handled by the developer?

Is that supposed to be handled in the Forwarder contract? I was using MinimalForwarder which doesn't seem to revert on failure.

Hi @sebastiantf -

The eth_estimateGas call should indicate whether a transaction will revert but for assessing this prior to sending a Relayer transaction, that is the purview of developers. You could use a DefenderRelayProvider to utilize Defnder's providers and use the ethers estimateGas method for instance.

1 Like