#[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
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
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
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:
- A base computation fee (similar to Ethereum’s base fee)
- 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
§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
Trait Implementations§
Source§impl AsRef<str> for TransactionValidation
impl AsRef<str> for TransactionValidation
Source§impl Clone for TransactionValidation
impl Clone for TransactionValidation
Source§fn clone(&self) -> TransactionValidation
fn clone(&self) -> TransactionValidation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more