Start typing to search this publication.
BlazePhoenix logo BlazePhoenix
Open menu
BlazePhoenix logo

Subscribe to BlazePhoenix

Get new posts delivered straight to your inbox.

Bounding gas before a route runs: computable gas bounds in BlazePhoenix V2

How a pre-launch router derives a worst-case gas estimate for every leg, and why the check is free to run.

BlazePhoenix avatar BlazePhoenix
2 min read

A route that touches attacker-influenced code can be made to burn gas. A hostile hook or a pathological pool can turn a cheap swap into a failed, expensive transaction, and for the person who pays the gas that is a cost even when the swap does not succeed.

This post describes how BlazePhoenix V2 approaches the problem. It is the specified design of a pre-launch protocol, not a report on deployed behaviour.

Bound first, execute second

The primitive is called computable gas bounds. Before a route runs, the router simulates the plan on chain and attaches a derived worst-case gas estimate to every leg. If the bound for a plan exceeds what the user authorised, the router refuses the plan or reprices it. The point of deriving the bound, rather than guessing it, is that it should hold even for pools the router has never seen.

Why the simulation is the cheap part

The design relies on an asymmetry. Probing a plan costs nothing: previewPlan is an eth_call, so the bound is computed and checked before anyone pays for anything. Pushing a route past its bound, on the other hand, requires the attacker to send a state-changing transaction of their own.

A gas bomb that has to announce its size in a free simulation before it can go off is just a plan the router declines. That is the claim the article makes: predictable costs, and gas exhaustion as a denial-of-service tool that is no longer free.

What you can try

The article's suggested check is simple: call previewPlan and read the gas estimate it returns. A plan whose real cost exceeds its stated bound is exactly what the primitive is designed to reject. Since the V2 contracts are not deployed yet, this is something to test once they are, and the design can be read now in the whitepaper.

Context

Gas bounds sit next to a few other V2 ideas from the same series: EIP-1153 transient storage for route context that cannot outlive the transaction, and a single dispatcher that quotes every curve family. They are covered in the original articles.

BlazePhoenix is pre-launch and not yet audited by an external firm; an independent external audit is scheduled. Quotes are meant to be readable with no API key, through the SDK (npm i @blazephoenix/sdk), the MCP server (https://blazephoenix.xyz/mcp) or a plain eth_call on your own RPC.

Original article: https://blazephoenix.xyz/learn/computable-gas-bounds/

Whitepaper: https://blazephoenix.xyz/docs/BlazePhoenix_Whitepaper.pdf

Subscribe to BlazePhoenix