Skip to content

Commit b4d4162

Browse files
committed
shadow-testing: query eth_blobBaseFee via cast rpc (cast 1.6+ dropped blob-base-fee); accept Fusaka-era fee floor
1 parent 78bd4e0 commit b4d4162

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

tests/shadow-testing/lib/01-setup-anvil.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,26 @@ fi
125125
wait_for_anvil "$ANVIL_RPC"
126126

127127
# ─── Step 1b: Drain inherited excess blob gas ────────────────────────────────
128-
# Anvil 1.0.0 predates Fusaka: when forking post-Fusaka mainnet state it keeps
128+
# Anvil ≤1.5.x predates Fusaka: when forking post-Fusaka mainnet state it keeps
129129
# the forked excessBlobGas but prices blob gas with the Dencun formula, so the
130130
# blob base fee explodes (~1e18 wei) and every commit tx fails with
131131
# "Insufficient funds". Mine empty blocks until the excess drains away
132-
# (excess decays by ~1/8 per empty block under Dencun rules).
133-
log_info "Draining inherited excess blob gas..."
132+
# (excess decays by ~1/8 per empty block under Dencun rules). On Anvil ≥1.6.0
133+
# (Osaka/Fusaka-aware) the forked fee is already sane and this loop is a no-op.
134+
# Note: `cast blob-base-fee` was removed in cast 1.6+; query eth_blobBaseFee.
135+
log_info "Checking inherited blob base fee..."
134136
for _ in $(seq 1 8); do
135-
blob_fee=$(cast blob-base-fee --rpc-url "$ANVIL_RPC" 2>/dev/null || echo 0)
136-
# Stop once the blob base fee is below 1 gwei (1e9 wei).
137-
if [[ -z "$blob_fee" || "$blob_fee" -lt 1000000000 ]]; then
137+
blob_fee_hex=$(cast rpc eth_blobBaseFee --rpc-url "$ANVIL_RPC" 2>/dev/null | tr -d '"')
138+
blob_fee=$(printf '%d' "$blob_fee_hex" 2>/dev/null || echo 0)
139+
# Stop once the blob base fee is below 1e16 wei. The old bug produced
140+
# ~1e18; a Fusaka-aware fork sits around 1e13 (EIP-7918 floor is
141+
# 2^13 × execution base fee), which the relayer can afford.
142+
if [[ "$blob_fee" -lt 10000000000000000 ]]; then
138143
break
139144
fi
140145
log_info " blob base fee = $blob_fee wei; mining 100 empty blocks..."
141146
cast rpc anvil_mine 100 --rpc-url "$ANVIL_RPC" >/dev/null 2>&1
142147
done
143-
blob_fee=$(cast blob-base-fee --rpc-url "$ANVIL_RPC" 2>/dev/null || echo unknown)
144148
log_ok " blob base fee = $blob_fee wei"
145149

146150
# ─── Step 2: Reset ScrollChain miscData ──────────────────────────────────────

0 commit comments

Comments
 (0)