Skip to content

Instantly share code, notes, and snippets.

Bug: EIP-7702 delegation-wrapped transactions show false "likely to fail" warnings due to stale gas limit in periodic re-simulation

Summary

When a dapp submits a transaction via wallet_sendCalls (EIP-5792) on an EIP-7702 smart account, MetaMask's periodic re-simulation (every ~3 seconds) uses a stale gas limit from the initial estimation, ignoring the correct gas limit computed by suggestFees. This causes the simulation to fail with "out of gas" and the UI to permanently display "This transaction is likely to fail" even though the transaction would succeed.

Environment

  • MetaMask Extension (latest)
  • Chain: Base (8453)
const stackErr = ` data: 0x90411a320000000000000000000000002691f337abeb0146f16441ca4f82f363275851d5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8500000000000000000000000042000000000000000000000000000000000000060000000000000000000000002691f337abeb0146f16441ca4f82f363275851d5000000000000000000000000b770b86b1544edf51bbf82dd01e8e867607dba510000000000000000000000000000000000000000000000000000000000989680000000000000000000000000000000000000000000000000000a9c0ba2e15270000000000000000000000000000000000000000000000000000aa9b1a4fc2ed50000000000000000000000000000000000000000000000000000000000000002000000000000000000000000de219fe970acbc88c63c9c4d0705837c6701495f0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000
package main
import (
"context"
"log"
"sync/atomic"
"time"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/paulbellamy/ratecounter"
package main
import (
"context"
"log"
"sync/atomic"
"time"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/paulbellamy/ratecounter"
"0x55922d884f673f4d2505ad8bba157003e097d601"
"0x130430502cccc91854490e596d43b09ccff264c1"
"0xe82153c957dca69e799035be304642347bec5007"
"0xf5906bfd9406c45061dc67f774da440d169b84d0"
"0x5d938b62a0847588ef6b35ee61efc8325351ff16"
"0xd386b3793217d7ecc73b70de0551e9a181069a12"
"0x549e45fece31434931d59d21570da0fbea8a1cb2"
"0x8417a5e665b04b1590725c8bd5215d1e1cce8c0a"
"0x73a6ab5d45ea3f1a9cee2def0d6eb8bccab584b0"
"0xd80aa3d6df4dd9330d2d40fb7746b2b52d12aa53"
library(data.table)
a <- fread("test.csv")
print(a)
#i'm not sure how many tanks there are. You could replace this with c(1,2,3), or whatever tanks exist.
tanks <- unique(a[!is.na(Tank),"Tank",with=FALSE])
finished <- a[, list(Tank = unlist(tanks)),by=as.list(a[,-"Tank",with=FALSE])]
print(finished)