@@ -141,6 +141,7 @@ func TestDAFootprint(gt *testing.T) {
141141
142142 for _ , tc := range cases {
143143 t .Run (tc .name , func (t devtest.T ) {
144+ require := t .Require ()
144145 if tc .setScalar != nil {
145146 rec := env .setDAFootprintGasScalarViaSystemConfig (t , * tc .setScalar )
146147 // Wait for change to propagate to L2
@@ -178,7 +179,7 @@ func TestDAFootprint(gt *testing.T) {
178179 info := sys .L2EL .WaitForUnsafe (func (info eth.BlockInfo ) (bool , error ) {
179180 blockGasUsed := info .GasUsed ()
180181 blobGasUsed := info .BlobGasUsed ()
181- t . Require () .NotNil (blobGasUsed , "blobGasUsed must not be nil for Jovian chains" )
182+ require .NotNil (blobGasUsed , "blobGasUsed must not be nil for Jovian chains" )
182183 blockDAFootprint = * blobGasUsed
183184 if blockDAFootprint <= blockGasUsed {
184185 t .Logf ("Block %s has DA footprint (%d) <= gasUsed (%d), trying next..." ,
@@ -194,18 +195,26 @@ func TestDAFootprint(gt *testing.T) {
194195 })
195196
196197 _ , txs , err := ethClient .InfoAndTxsByHash (t .Ctx (), info .Hash ())
197- t .Require ().NoError (err )
198+ require .NoError (err )
199+ _ , receipts , err := sys .L2EL .Escape ().L2EthExtendedClient ().FetchReceipts (t .Ctx (), info .Hash ())
200+ require .NoError (err )
198201
199202 var totalDAFootprint uint64
200- for _ , tx := range txs {
203+ for i , tx := range txs {
201204 if tx .IsDepositTx () {
202205 continue
203206 }
204- totalDAFootprint += tx .RollupCostData ().EstimatedDASize ().Uint64 () * uint64 (tc .expected )
207+ recScalar := receipts [i ].DAFootprintGasScalar
208+ require .NotNil (recScalar , "nil receipt DA footprint gas scalar" )
209+ require .EqualValues (tc .expected , * recScalar , "DA footprint gas scalar mismatch in receipt" )
210+
211+ txDAFootprint := tx .RollupCostData ().EstimatedDASize ().Uint64 () * uint64 (tc .expected )
212+ require .Equal (txDAFootprint , receipts [i ].BlobGasUsed , "tx DA footprint mismatch with receipt" )
213+ totalDAFootprint += txDAFootprint
205214 }
206215 t .Logf ("Block %s has header/calculated DA footprint %d/%d" ,
207216 eth .ToBlockID (info ), blockDAFootprint , totalDAFootprint )
208- t . Require () .Equal (totalDAFootprint , blockDAFootprint , "Calculated DA footprint doesn't match block header DA footprint" )
217+ require .Equal (totalDAFootprint , blockDAFootprint , "Calculated DA footprint doesn't match block header DA footprint" )
209218
210219 // Check base fee calculation of next block
211220 // Calculate expected base fee as:
@@ -226,7 +235,7 @@ func TestDAFootprint(gt *testing.T) {
226235 t .Logf ("Expected base fee: %s" , baseFee )
227236
228237 next := sys .L2EL .WaitForBlockNumber (info .NumberU64 () + 1 )
229- t . Require () .Equal (baseFee , next .BaseFee (), "Wrong base fee" )
238+ require .Equal (baseFee , next .BaseFee (), "Wrong base fee" )
230239 })
231240 }
232241}
0 commit comments