From c887e59de526b612a616ac56f5843da30d70ecb1 Mon Sep 17 00:00:00 2001 From: Roberto Bayardo Date: Tue, 9 Jan 2024 09:26:03 -0800 Subject: [PATCH] Update core/types/rollup_cost.go Co-authored-by: protolambda --- core/types/rollup_cost.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/types/rollup_cost.go b/core/types/rollup_cost.go index b1d4ccd0a6..9718560b76 100644 --- a/core/types/rollup_cost.go +++ b/core/types/rollup_cost.go @@ -194,14 +194,14 @@ func newL1CostFuncEcotone(l1Basefee, l1BlobBasefee, l1BasefeeScalar, l1BlobBasef // Ecotone L1 cost function: // - // (gas/16)*(l1Basefee*16*l1BasefeeScalar + l1BlobBasefee*l1BlobBasefeeScalar)/1e6 + // (calldataGas/16)*(l1Basefee*16*l1BasefeeScalar + l1BlobBasefee*l1BlobBasefeeScalar)/1e6 // - // We divide "gas" by 16 to change from units of calldata gas to "estimated # of bytes when - // compressed". + // We divide "calldataGas" by 16 to change from units of calldata gas to "estimated # of bytes when + // compressed". Known as "compressedTxSize" in the spec. // // Function is actually computed as follows for better precision under integer arithmetic: // - // gas*(l1Basefee*16*l1BasefeeScalar + l1BlobBasefee*l1BlobBasefeeScalar)/16e6 + // calldataGas*(l1Basefee*16*l1BasefeeScalar + l1BlobBasefee*l1BlobBasefeeScalar)/16e6 calldataCostPerByte := new(big.Int).Set(l1Basefee) calldataCostPerByte = calldataCostPerByte.Mul(calldataCostPerByte, sixteen)