File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ func calculateEncodedRollupFeeFeeFeynman(
206206 // tx size (RLP-encoded)
207207 txSize := big .NewInt (int64 (len (data )))
208208
209- // compression_ratio(tx) = 1 (placeholder)
210- compressionRatio := big .NewInt (1 )
209+ // compression_ratio(tx) = 1 (placeholder, scaled to match scalars precision )
210+ compressionRatio := big .NewInt (rcfg . Precision . Int64 () )
211211
212212 // compute gas components
213213 execGas := new (big.Int ).Mul (execScalar , l1BaseFee )
@@ -216,11 +216,13 @@ func calculateEncodedRollupFeeFeeFeynman(
216216 // fee per byte = execGas + blobGas
217217 feePerByte := new (big.Int ).Add (execGas , blobGas )
218218
219- // fee = compression_ratio * tx_size * (execGas + blobGas)
219+ // rollupFee = compression_ratio * tx_size * feePerByte
220220 rollupFee := new (big.Int ).Mul (compressionRatio , txSize )
221221 rollupFee .Mul (rollupFee , feePerByte )
222222
223- rollupFee = new (big.Int ).Quo (rollupFee , rcfg .Precision )
223+ // Divide by rcfg.Precision (once for ratio, once for scalar)
224+ rollupFee .Div (rollupFee , rcfg .Precision )
225+ rollupFee .Div (rollupFee , rcfg .Precision )
224226
225227 return rollupFee
226228}
You can’t perform that action at this time.
0 commit comments