#[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:
- 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 = 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§
Trait Implementations§
Source§impl AsRef<str> for TransactionValidationCode
impl AsRef<str> for TransactionValidationCode
Source§impl Clone for TransactionValidationCode
impl Clone for TransactionValidationCode
Source§fn clone(&self) -> TransactionValidationCode
fn clone(&self) -> TransactionValidationCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more