Enum TransactionValidationError

Source
#[non_exhaustive]
#[repr(u32)]
pub enum TransactionValidationError { InvalidGasLimit { tx_gas_limit: Box<U256>, max_gas: Box<U256>, }, GasPerPubdataLimit { tx_gas_per_pubdata_limit: Box<U256>, max_gas: Box<U256>, }, MaxFeePerGasTooLow { max_fee_per_gas: Box<U256>, l2_gas_price: Box<U256>, }, MaxPriorityFeeGreaterThanMaxFee { max_fee_per_gas: Box<U256>, max_priority_fee_per_gas: Box<U256>, }, 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.
§

InvalidGasLimit

§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

Fields

§tx_gas_limit: Box<U256>
§max_gas: Box<U256>
§

GasPerPubdataLimit

§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

Fields

§tx_gas_per_pubdata_limit: Box<U256>
§max_gas: Box<U256>
§

MaxFeePerGasTooLow

§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

Fields

§max_fee_per_gas: Box<U256>
§l2_gas_price: Box<U256>
§

MaxPriorityFeeGreaterThanMaxFee

§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.

Fields

§max_fee_per_gas: Box<U256>
§max_priority_fee_per_gas: Box<U256>
§

GenericError

Fields

§message: String

Trait Implementations§

Source§

impl AsRef<str> for TransactionValidation

Source§

fn as_ref(&self) -> &str

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

impl Clone for TransactionValidation

Source§

fn clone(&self) -> TransactionValidation

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 TransactionValidation

Source§

impl Debug for TransactionValidation

Source§

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

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

impl<'de> Deserialize<'de> for TransactionValidation

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 TransactionValidation

Source§

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

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

impl Documented for TransactionValidation

Source§

type Documentation = &'static ErrorDocumentation

Source§

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

Source§

impl Error for TransactionValidation

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 TransactionValidation> for TransactionValidationCode

Source§

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

Converts to this type from the input type.
Source§

impl From<Error> for TransactionValidation

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.
Source§

impl From<TransactionValidation> for AnvilZksync

Source§

fn from(val: TransactionValidation) -> Self

Converts to this type from the input type.
Source§

impl From<TransactionValidation> for PackedError<ZksyncError>

Source§

fn from(value: TransactionValidation) -> Self

Converts to this type from the input type.
Source§

impl From<TransactionValidation> for SerializedError

Source§

fn from(value: TransactionValidation) -> Self

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 From<TransactionValidation> for ZksyncError

Source§

fn from(val: TransactionValidation) -> Self

Converts to this type from the input type.
Source§

impl ICustomError<ZksyncError, ZksyncError> for TransactionValidation

Source§

impl NamedError for TransactionValidation

Source§

impl PartialEq for TransactionValidation

Source§

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

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 TransactionValidation

Source§

impl StructuralPartialEq for TransactionValidation

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

§

impl<T> MaybeSendSync for T