Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built a zero-dependency CLI to pause deploys when L2 gas spikes

说明与用途

l2gas CLI 在 L2 gas 价格超过阈值时阻止部署,避免高额费用。

问题

CI pipelines deployed to Base mainnet during a gas spike, incurring high fees ($200) that went unnoticed until billing.

结果

Deployments are now gated by real‑time gas prices, preventing accidental high‑fee deployments during L2 gas spikes.

工作流

  • Run npx @psicossz/l2gas to fetch real‑time gas prices for selected chains
  • Configure a GitHub Actions step with --threshold to exit with code 1 if any chain exceeds the limit
  • Use the exit code to conditionally skip the deploy step
  • Optionally use the reusable workflow for cleaner setup
  • Integrate l2gas as a library in scripts for programmatic access
  • Use --json for scripting and --watch for continuous monitoring

证据

Teams without a gas gate in CI deployed contracts and paid hundreds in unnecessary fees.

来源

The --threshold flag exits with code 1 if any chain exceeds the Gwei limit, which natively blocks a CI step.

来源

All 7 chains queried in parallel in under 2 seconds, directly from public RPC endpoints — no API key, no rate limits, no third‑party service.

来源

  • 记录日期: 2026-10-02T08:10:44.784Z