From 799f6663b6edd55c61b206f0bd2d0a752f588ea4 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Wed, 17 Jun 2026 12:04:25 +0200 Subject: [PATCH 1/2] chore(tooling): update write-test skill for automatic tx gas-limit Agents kept adding the now-redundant `gas_limit=fork.transaction_gas_limit_cap()` boilerplate to tests. Document that `gas_limit` auto-fills when omitted (#2969), and is needed only for gas-sensitive tests. --- .claude/commands/write-test.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.claude/commands/write-test.md b/.claude/commands/write-test.md index cbc8db3b601..ef413ef848d 100644 --- a/.claude/commands/write-test.md +++ b/.claude/commands/write-test.md @@ -45,6 +45,11 @@ Conventions and patterns for writing consensus tests. Run this skill before writ - `fork.gas_costs()` returns `GasCosts` dataclass with constants like `G_WARM_SLOAD`, `G_COLD_ACCOUNT_ACCESS`, `G_BASE`, etc. - `fork.transaction_intrinsic_cost_calculator()` for computing tx intrinsic gas +## Transactions + +- Omit `gas_limit` unless the test asserts on an exact gas amount: it auto-fills so the transaction executes in full without running out of gas. Set it explicitly only for gas-sensitive cases (intrinsic-gas boundaries, OOG, code-deposit or metering). +- Anti-pattern: boilerplate `gas_limit=fork.transaction_gas_limit_cap()`, now redundant. + ## Exception Testing - Pass `error=TransactionException.INTRINSIC_GAS_TOO_LOW` to `Transaction` From 453172d07a0f3a58b5278e8503e446ddde17e74b Mon Sep 17 00:00:00 2001 From: danceratopz Date: Wed, 17 Jun 2026 21:19:22 +0200 Subject: [PATCH 2/2] chore(tooling): restructure write-test tx gas-limit guidance Apply review feedback: split the dense `gas_limit` bullet into Rule, Exception, and Anti-pattern bullets for scannability. Co-authored-by: raxhvl <10168946+raxhvl@users.noreply.github.com> --- .claude/commands/write-test.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.claude/commands/write-test.md b/.claude/commands/write-test.md index ef413ef848d..f8ef60cdede 100644 --- a/.claude/commands/write-test.md +++ b/.claude/commands/write-test.md @@ -47,8 +47,9 @@ Conventions and patterns for writing consensus tests. Run this skill before writ ## Transactions -- Omit `gas_limit` unless the test asserts on an exact gas amount: it auto-fills so the transaction executes in full without running out of gas. Set it explicitly only for gas-sensitive cases (intrinsic-gas boundaries, OOG, code-deposit or metering). -- Anti-pattern: boilerplate `gas_limit=fork.transaction_gas_limit_cap()`, now redundant. +- Rule: omit `gas_limit`. It auto-fills so the transaction executes in full without running out of gas. +- Exception: set `gas_limit` explicitly for gas-sensitive tests (intrinsic-gas boundaries, OOG, code-deposit limits, or gas metering). +- Anti-pattern: the `gas_limit=fork.transaction_gas_limit_cap()` boilerplate is now redundant. ## Exception Testing