Crate op_alloy_flz

Crate op_alloy_flz 

Source
Expand description

§op-alloy-flz

Tiny crate containing FastLZ compression length utilities.

Constants§

L1_COST_FASTLZ_COEF
https://github.com/ethereum-optimism/op-geth/blob/647c346e2bef36219cc7b47d76b1cb87e7ca29e4/core/types/rollup_cost.go#L79
L1_COST_INTERCEPT
https://github.com/ethereum-optimism/op-geth/blob/647c346e2bef36219cc7b47d76b1cb87e7ca29e4/core/types/rollup_cost.go#L78 Inverted to be used with saturating_sub.
MIN_TX_SIZE_SCALED
https://github.com/ethereum-optimism/op-geth/blob/647c346e2bef36219cc7b47d76b1cb87e7ca29e4/core/types/rollup_cost.go#82
NON_ZERO_BYTE_COST
Cost per non-zero byte.
ZERO_BYTE_COST
Cost per zero byte.

Functions§

data_gas_fjord
Calculate the data gas for posting the transaction on L1.
flz_compress_len
Returns the length of the data after compression through FastLZ.
tx_estimated_size_fjord
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)
tx_estimated_size_fjord_bytes
Calculate the estimated compressed transaction size in bytes. This value is computed based on the following formula: max(minTransactionSize, intercept + fastlzCoef*fastlzSize) / 1e6