Enum ErrorCode

Source
#[repr(u32)]
pub enum ErrorCode { ExceedsLimitForPublishedPubdata = 1, ExceedsBlockGasLimit = 2, TransactionHalt = 10, TransactionRevert = 11, TransactionAlwaysHalts = 20, TransactionAlwaysReverts = 21, GenericError = 0, }
Expand description

Auto-generated discriminant enum variants

Variants§

§

ExceedsLimitForPublishedPubdata = 1

§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 = 2

§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 = 10

§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 = 11

§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 = 20

§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 = 21

§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 = 0

Implementations§

Source§

impl GasEstimationCode

Source

pub const fn from_repr(discriminant: u32) -> Option<GasEstimationCode>

Try to create Self from the raw representation

Trait Implementations§

Source§

impl AsRef<str> for GasEstimationCode

Source§

fn as_ref(&self) -> &str

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

impl Clone for GasEstimationCode

Source§

fn clone(&self) -> GasEstimationCode

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 Debug for GasEstimationCode

Source§

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

Formats the value using the given formatter. 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<GasEstimation> for GasEstimationCode

Source§

fn from(val: GasEstimation) -> GasEstimationCode

Converts to this type from the input type.
Source§

impl NamedError for GasEstimationCode

Source§

impl PartialEq for GasEstimationCode

Source§

fn eq(&self, other: &GasEstimationCode) -> 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 Copy for GasEstimationCode

Source§

impl Eq for GasEstimationCode

Source§

impl StructuralPartialEq for GasEstimationCode

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, 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

§

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