@ethereumjs/evm
Version:
JavaScript Ethereum Virtual Machine (EVM) implementation
46 lines • 1.91 kB
TypeScript
import type { Common } from '@ethereumjs/common';
/**
* EIP-8037 cost-per-state-byte. Under the v7 fixtures the value is a flat
* constant (sourced from the `costPerStateByte` common parameter) rather than
* the earlier draft's block-gas-limit-derived value. The helper is kept so
* callers do not need to know whether the value is constant or derived; a
* future spec revision could re-introduce a derivation here.
*
* @remarks Experimental (Amsterdam): may change on patch releases.
*/
export declare function activeCostPerStateByte(common: Common, _blockGasLimit?: bigint): bigint;
/**
* Minimal shape of a tx needed to split intrinsic gas into the EIP-8037
* regular/state dimensions. Avoids a `@ethereumjs/tx` import cycle here.
*/
interface IntrinsicDimensionsTx {
type: number;
common: Common;
getIntrinsicGas(): bigint;
toCreationAddress(): boolean;
authorizationList?: unknown[];
}
/**
* EIP-8037 intrinsic-gas decomposition.
*
* Returns `{ intrinsicRegular, intrinsicState }` such that
* `intrinsicRegular + intrinsicState` equals the tx's total intrinsic
* charge under EIP-8037. Callers may then use the split for the per-tx
* block-gas pre-execution checks:
*
* regular check: min(TX_MAX, tx.gas - intrinsicState) > regular_available → reject
* state check: (tx.gas - intrinsicRegular) > state_available → reject
*
* and for sizing the EIP-8037 state-gas reservoir.
*
* When EIP-8037 is not active, returns `{ intrinsicRegular: tx.getIntrinsicGas(),
* intrinsicState: 0n }` so callers can use a single code path.
*
* @remarks Experimental (Amsterdam): may change on patch releases.
*/
export declare function computeIntrinsicGasDimensions8037(common: Common, tx: IntrinsicDimensionsTx, blockGasLimit?: bigint): {
intrinsicRegular: bigint;
intrinsicState: bigint;
};
export {};
//# sourceMappingURL=eip8037.d.ts.map