Skip to content

Commit

Permalink
Fix TestSequencerFeePaid rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jun 19, 2023
1 parent 257a3e5 commit cec8928
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions system_tests/fees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ func TestSequencerFeePaid(t *testing.T) {

txSize := compressedTxSize(t, tx)
l1GasBought := arbmath.BigDiv(l1Charge, l1Estimate).Uint64()
l1GasActual := txSize * params.TxDataNonZeroGasEIP2028
l1ChargeExpected := arbmath.BigMulByUint(l1Estimate, txSize*params.TxDataNonZeroGasEIP2028)
// L1 gas can only be charged in terms of L2 gas, so subtract off any rounding error from the expected value
l1ChargeExpected.Sub(l1ChargeExpected, new(big.Int).Mod(l1ChargeExpected, l2info.GasPrice))

colors.PrintBlue("bytes ", l1GasBought/params.TxDataNonZeroGasEIP2028, txSize)

if l1GasBought != l1GasActual {
Fatal(t, "the sequencer's future revenue does not match its costs", l1GasBought, l1GasActual)
if !arbmath.BigEquals(l1Charge, l1ChargeExpected) {
Fatal(t, "the sequencer's future revenue does not match its costs", l1Charge, l1ChargeExpected)
}
return networkRevenue, tipPaidToNet
}
Expand Down

0 comments on commit cec8928

Please sign in to comment.