#[non_exhaustive]#[repr(u32)]pub enum GasEstimationError {
ExceedsLimitForPublishedPubdata {
pubdata_published: u32,
pubdata_limit: u32,
},
ExceedsBlockGasLimit {
overhead: U64,
gas_for_pubdata: U64,
estimated_body_cost: U64,
},
TransactionHalt {
inner: Box<Halt>,
},
TransactionRevert {
inner: Box<Revert>,
data: Vec<u8>,
},
TransactionAlwaysHalts {
inner: Box<Halt>,
},
TransactionAlwaysReverts {
inner: Box<Revert>,
data: Vec<u8>,
},
GenericError {
message: String,
},
}
Expand description
Domain: AnvilZKsync
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ExceedsLimitForPublishedPubdata
§Summary
Transaction exceeds the limit for published pubdata.
§Description
This error occurs when a transaction attempts to publish more pubdata than is allowed in a batch. Each transaction has a limit on how much pubdata it can publish to maintain network efficiency and prevent abuse.
ExceedsBlockGasLimit
§Summary
Transaction gas estimation exceeds the block gas limit.
§Description
This error occurs when the total gas required for a transaction exceeds the maximum allowed for a block. The total gas is calculated by summing three components: the gas needed for publishing pubdata, the fixed overhead costs, and the estimated gas for the transaction body itself. When this sum overflows or exceeds the block limit, this error is thrown.
TransactionHalt
§Summary
Transaction execution reverts and burns all gas while estimating required gas in anvil-zksync.
§Description
This error occurs when anvil-zksync is trying to estimate gas required to run this transaction but the estimation fails because the transaction reverts and burns all gas.
Before estimating gas, anvil-zksync first runs the transaction with maximum gas possible.
If the first run was successful, anvil-zksync proceeds with the estimation
The estimation algorithm looks for a minimum gas value that makes the transaction succeed.
This works if the transaction fails for all lower gas values and succeeds for all higher gas values.
Some valid, but exotic transactions, resist estimation.
Typically they depend on specific gas values, for example, they fail if gasleft()
returned a value in a specific range.
TransactionRevert
§Summary
Transaction execution reverted while estimating required gas in anvil-zksync.
§Description
This error occurs when anvil-zksync is trying to estimate gas required to run this transaction but the estimation fails because the transaction is reverted.
Before estimating gas, anvil-zksync first runs the transaction with maximum gas possible.
If the first run was successful, anvil-zksync proceeds with the estimation
The estimation algorithm looks for a minimum gas value that makes the transaction succeed.
This works if the transaction fails for all lower gas values and succeeds for all higher gas values.
Some valid, but exotic transactions, resist estimation.
Typically they depend on specific gas values, for example, they revert if gasleft()
returned a value in a specific range.
TransactionAlwaysHalts
§Summary
An attempt to run the transaction with maximum gas resulted in reverting the transaction and burning all gas.
§Description
Before estimating gas, anvil-zksync first runs the transaction with maximum gas possible. This error occurs when this initial run results in a revert and burns all gas, suggesting that no amount of gas will make this transaction executable.
There might be valid, but exotic transactions that fail when run with maximum gas provided, but these are rare. Typically they depend on specific gas values. Usually, this error indicates either an unconditional revert or excessive gas consumption.
TransactionAlwaysReverts
§Summary
An attempt to run the transaction with maximum gas resulted in reverting the transaction and returning unspent gas.
§Description
Before estimating gas, anvil-zksync first runs the transaction with maximum gas possible. This error occurs when this initial run results in a revert and returns unspent gas, suggesting that no amount of gas will make this transaction executable.
There might be valid, but exotic transactions that fail when run with maximum gas provided, but these are rare. Typically they depend on specific gas values. Usually, this error indicates either an unconditional revert or excessive gas consumption.
GenericError
Trait Implementations§
Source§impl AsRef<str> for GasEstimation
impl AsRef<str> for GasEstimation
Source§impl Clone for GasEstimation
impl Clone for GasEstimation
Source§fn clone(&self) -> GasEstimation
fn clone(&self) -> GasEstimation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more