Skip to main content

TX_MEMORY_BUDGET_MULTIPLIER

Constant TX_MEMORY_BUDGET_MULTIPLIER 

pub const TX_MEMORY_BUDGET_MULTIPLIER: usize = 2; // 2usize
Expand description

Multiplier applied to max_message_size to derive the in-memory budget for decoding Transactions and PooledTransactions messages.

Decoded transactions expand relative to their RLP encoding due to struct overhead and heap allocations. With many peers in flight this can cause significant memory pressure, so we stop decoding once the cumulative in-memory size of decoded transactions exceeds max_message_size * TX_MEMORY_BUDGET_MULTIPLIER. Remaining transactions are silently dropped.