Enum GasEstimationError

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§pubdata_published: u32
§pubdata_limit: u32
§

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.

Fields

§overhead: U64
§gas_for_pubdata: U64
§estimated_body_cost: U64
§

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.

Fields

§inner: Box<Halt>
§

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.

Fields

§inner: Box<Revert>
§data: Vec<u8>
§

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.

Fields

§inner: Box<Halt>
§

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.

Fields

§inner: Box<Revert>
§data: Vec<u8>
§

GenericError

Fields

§message: String

Trait Implementations§

Source§

impl AsRef<str> for GasEstimation

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for GasEstimation

Source§

fn clone(&self) -> GasEstimation

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CustomErrorMessage for GasEstimation

Source§

impl Debug for GasEstimation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GasEstimation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for GasEstimation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Documented for GasEstimation

Source§

type Documentation = &'static ErrorDocumentation

Source§

fn get_documentation( &self, ) -> Result<Option<Self::Documentation>, DocumentationError>

Source§

impl Error for GasEstimation

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<'_enum> From<&'_enum GasEstimation> for GasEstimationCode

Source§

fn from(val: &'_enum GasEstimation) -> GasEstimationCode

Converts to this type from the input type.
Source§

impl From<Error> for GasEstimation

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.
Source§

impl From<GasEstimation> for AnvilZksync

Source§

fn from(val: GasEstimation) -> Self

Converts to this type from the input type.
Source§

impl From<GasEstimation> for GasEstimationCode

Source§

fn from(val: GasEstimation) -> GasEstimationCode

Converts to this type from the input type.
Source§

impl From<GasEstimation> for PackedError<ZksyncError>

Source§

fn from(value: GasEstimation) -> Self

Converts to this type from the input type.
Source§

impl From<GasEstimation> for SerializedError

Source§

fn from(value: GasEstimation) -> Self

Converts to this type from the input type.
Source§

impl From<GasEstimation> for ZksyncError

Source§

fn from(val: GasEstimation) -> Self

Converts to this type from the input type.
Source§

impl ICustomError<ZksyncError, ZksyncError> for GasEstimation

Source§

impl NamedError for GasEstimation

Source§

impl PartialEq for GasEstimation

Source§

fn eq(&self, other: &GasEstimation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GasEstimation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for GasEstimation

Source§

impl StructuralPartialEq for GasEstimation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,