You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we add MaxSpanBatchElementCount to the chain spec, we can test the sad-path span batch decoding code better with black-box tests. Where we consume the spec, we would consume an interface of the value getters that we need to set low limits during tests.
// we are sure that totalBlockTxCount will overflow on uint64
varbuf bytes.Buffer
err:=rawSpanBatch.encodeBlockTxCounts(&buf)
require.NoError(t, err)
result:=buf.Bytes()
r:=bytes.NewReader(result)
varsbRawSpanBatch
sb.blockTxCounts=rawSpanBatch.blockTxCounts
err=sb.decodeTxs(r)
require.ErrorIs(t, err, ErrTooBigSpanBatchSize)
}
make them more black-box, by creating span batches with a mocked spec that allows higher number of elements, then lower the limits and test all paths that should return ErrTooBigSpanBatchSize
If we add
MaxSpanBatchElementCount
to the chain spec, we can test the sad-path span batch decoding code better with black-box tests. Where we consume the spec, we would consume an interface of the value getters that we need to set low limits during tests.Following tests should be improved:
optimism/op-node/rollup/derive/span_batch_txs_test.go
Lines 507 to 533 in a8e5714
optimism/op-node/rollup/derive/span_batch_test.go
Lines 522 to 604 in a8e5714
ErrTooBigSpanBatchSize
Source comment @sebastianst in #10357 (comment)
The text was updated successfully, but these errors were encountered: