EIP-5081 Expirable transactions (Expirable Transaction)

No call decision · Fees & gas · EIP status Stagnant · created 2022-05-06

Introduces a new transaction type that sets an expiration point based on block number (expire_by), so the transaction is not executed once that block has passed.

Why it is needed

If a user sets a low gas fee and sends a transaction (tx0), it won't settle during network congestion and remains pending indefinitely. This tx0 can settle at any time until another transaction using the same nonce is executed, creating a risk that it executes unexpectedly even after the user has already achieved the same goal through another means. A transaction sent with a much higher gas fee than usual during an urgent situation gets executed all the more easily once gas fees return to normal levels. The only way to cancel it is to preempt it by sending a new transaction with the same nonce and a higher gas fee, but if a high gas fee was already used, the preemption cost is very high and the outcome is uncertain. For trades that are meaningless unless settled within a certain time, such as AMM swaps, there is currently no way to express that time condition within the transaction itself.

What changes

Today

After EIP-5081

Who is affected

In depth

Transaction payload structure

After FORK_BLOCK_NUMBER, a new EIP-2718 transaction with TransactionType = TX_TYPE (TBD) is introduced. The TransactionPayload takes the form rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s]). All fields except expire_by carry the same meaning as in EIP-1559.

Meaning of expire_by

expire_by is the latest block number at which this transaction can be executed. No block with block_num > expire_by MUST execute this transaction.

Intrinsic gas cost calculation

The intrinsic gas cost for this transaction reuses the formula from EIP-2930 as is: 21000 + 16 * number of nonzero calldata bytes + 4 * number of zero calldata bytes + 1900 * number of access list storage keys + 2400 * number of access list addresses.

Signature scheme

signature_y_parity, signature_r, and signature_s are a secp256k1 signature over keccak256(0x02 || rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list])).

Receipt payload

The EIP-2718 ReceiptPayload for this transaction is rlp([status, cumulative_transaction_gas_used, logs_bloom, logs]).

Dropping expired transactions and halting propagation

A client that knows current_block_num MUST drop and stop propagating any transaction where transaction_type == TX_TYPE and current_block_num > expire_by. It is also recommended that current_block_num itself be made available to clients, with the goal of mitigating denial-of-service attacks by ensuring nodes that spend mining effort on already-expired transactions needlessly suffer a loss.

Safeguard via gossip_ttl

Clients are recommended to maintain a gossip_ttl (in block-number units) and propagate a transaction only when current_block_num + gossip_ttl <= expire_by. Existing nodes that don't support current_block_num or gossip_ttl treat this value as 0. Propagating clients are recommended to reduce gossip_ttl appropriately to fit the network environment.

What remains undecided

This EIP's status is Stagnant. The values FORK_BLKNUM, CHAIN_ID, and TX_TYPE are all TBD, and the Rationale and Backwards Compatibility sections are also empty, marked TODO, so concrete rationale and compatibility analysis have not yet been filled in. No call records regarding fork inclusion have been found either.

Original EIP · ← EIPs