reth_transaction_pool/validate/constants.rs
1/// [`TX_SLOT_BYTE_SIZE`] is used to calculate how many data slots a single transaction
2/// takes up based on its byte size. The slots are used as `DoS` protection, ensuring
3/// that validating a new transaction remains a constant operation (in reality
4/// O(maxslots), where max slots are 4 currently).
5pub const TX_SLOT_BYTE_SIZE: usize = 32 * 1024;
6
7/// [`DEFAULT_MAX_TX_INPUT_BYTES`] is the default maximum size a single transaction can have. This
8/// field has non-trivial consequences: larger transactions are significantly harder and
9/// more expensive to propagate; larger transactions also take more resources
10/// to validate whether they fit into the pool or not. Default is 4 times [`TX_SLOT_BYTE_SIZE`],
11/// which defaults to 32 KiB, so 128 KiB.
12pub const DEFAULT_MAX_TX_INPUT_BYTES: usize = 4 * TX_SLOT_BYTE_SIZE; // 128KB
13
14/// Maximum bytecode to permit for a contract.
15pub const MAX_CODE_BYTE_SIZE: usize = revm_primitives::eip170::MAX_CODE_SIZE;
16
17/// Maximum initcode to permit in a creation transaction and create instructions.
18pub const MAX_INIT_CODE_BYTE_SIZE: usize = revm_primitives::MAX_INITCODE_SIZE;