Enum ErrorCode

Source
#[repr(u32)]
pub enum ErrorCode { InvalidGasLimit = 1, GasPerPubdataLimit = 2, MaxFeePerGasTooLow = 3, MaxPriorityFeeGreaterThanMaxFee = 4, GenericError = 0, }
Expand description

Auto-generated discriminant enum variants

Variants§

§

InvalidGasLimit = 1

§Summary

Transaction validation failed due to excessive gas limit – did you provide invalid gas limit?

§Description

This error occurs when a transaction’s gas limit exceeds the maximum allowed gas allowed by ZKsync protocol. As of protocol version 27, the gas is limited to 2^50 Note: When anvil-zksync is in forking mode, it lock-in and uses gas price at the forked block

§

GasPerPubdataLimit = 2

§Summary

Transaction validation failed due to excessive gas per pubdata limit.

§Description

This error occurs when a transaction’s gas per pubdata limit exceeds the maximum allowed gas allowed by ZKsync protocol. As of protocol version 27, the gas is limited to 2^50 Note: When anvil-zksync is in forking mode, it lock-in and uses gas price at the forked block

§

MaxFeePerGasTooLow = 3

§Summary

Transaction’s maxFeePerGas is lower than the current gas price in anvil-zksync.

§Description

This error occurs when the maximum fee per gas specified in the transaction is lower than the current gas price set in the anvil-zksync node. To be considered valid, transactions must specify a maxFeePerGas that is greater or equal to the current gas price

In anvil-zksync, the gas price can be configured when starting the node using --l1-gas-price argument or can be modified dynamically. By default, the node simulates a gas price model similar to the real ZKSync network, including:

  1. A base computation fee (similar to Ethereum’s base fee)
  2. A simulated pubdata posting fee

Even though anvil-zksync is a testing environment, it enforces these gas price validations to ensure that your tests accurately reflect how transactions would behave on the actual ZKSync network. Note: When anvil-zksync is in forking mode, it lock-in and uses gas price at the forked block

§

MaxPriorityFeeGreaterThanMaxFee = 4

§Summary

Transaction’s maxPriorityFeePerGas exceeds maxFeePerGas.

§Description

This error occurs when a transaction’s maximum priority fee per gas is greater than its maximum fee per gas in anvil-zksync. In ZKSync, the field maxPriorityFeePerGas is ignored, as ZKsync doesn’t have a concept of priority fees. Instead, maxFeePerGas is utilized and includes the base fees. However, certain transaction types like EIP-1559 or EIP-712 may contain field maxPriorityFeePerGas, which should be less or equal to the field maxFeePerGas.

§

GenericError = 0

Implementations§

Source§

impl TransactionValidationCode

Source

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

Try to create Self from the raw representation

Trait Implementations§

Source§

impl AsRef<str> for TransactionValidationCode

Source§

fn as_ref(&self) -> &str

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

impl Clone for TransactionValidationCode

Source§

fn clone(&self) -> TransactionValidationCode

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 TransactionValidationCode

Source§

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

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

impl<'_enum> From<&'_enum TransactionValidation> for TransactionValidationCode

Source§

fn from(val: &'_enum TransactionValidation) -> TransactionValidationCode

Converts to this type from the input type.
Source§

impl From<TransactionValidation> for TransactionValidationCode

Source§

fn from(val: TransactionValidation) -> TransactionValidationCode

Converts to this type from the input type.
Source§

impl NamedError for TransactionValidationCode

Source§

impl PartialEq for TransactionValidationCode

Source§

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

Source§

impl Eq for TransactionValidationCode

Source§

impl StructuralPartialEq for TransactionValidationCode

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

impl<T> MaybeSendSync for T