diff --git a/crates/optimism/node/src/txpool.rs b/crates/optimism/node/src/txpool.rs index 90e0b33c22..62ee3a820f 100644 --- a/crates/optimism/node/src/txpool.rs +++ b/crates/optimism/node/src/txpool.rs @@ -61,22 +61,12 @@ impl OpPooledTransaction { /// This value is computed based on the following formula: /// `max(minTransactionSize, intercept + fastlzCoef*fastlzSize)` pub fn estimated_compressed_size(&self) -> u64 { - *self - .estimated_tx_compressed_size - .get_or_init(|| tx_estimated_size_fjord(&self.inner.transaction().encoded_2718())) + *self.estimated_tx_compressed_size.get_or_init(|| { + op_alloy_flz::tx_estimated_size_fjord(&self.inner.transaction().encoded_2718()) + }) } } -/// Calculate the estimated compressed transaction size in bytes, scaled by 1e6. -/// This value is computed based on the following formula: -/// max(minTransactionSize, intercept + fastlzCoef*fastlzSize) -// TODO(mattsse): replace with library fn from revm or maili once available -fn tx_estimated_size_fjord(input: &[u8]) -> u64 { - let fastlz_size = op_alloy_flz::flz_compress_len(input) as u64; - - fastlz_size.saturating_mul(836_500).saturating_sub(42_585_600).max(100_000_000) -} - impl From> for OpPooledTransaction { fn from(tx: Recovered) -> Self { let encoded_len = tx.encode_2718_len();