Skip to content

op-core: replace the FastLZ and Fjord L1-cost fuzzers with pinned fixtures #24125

Closed

Description

@sebastianst

The FastLZ and Fjord L1-cost fuzzers have not run in CI since #21639, not even their seeds. Proposal: replace them with fixtures that run in the normal Go test job, so every branch of the two functions is covered on each PR.

Current state

The fuzzers compare op-core/fees with the Solidity and C implementations:

  • FuzzFjordCostFunction: L1CostFjord against the GasPriceOracle predeploy
  • FuzzFastLzSolidity: FlzCompressLen against Solady's LibZip
  • FuzzFastLzCgo: FlzCompressLen against the C FastLZ library

All are in op-core/fees/fuzz/fuzz_test.go since #23864, behind the cgo_test build tag.

#21639 retired the Go fuzz jobs because the seed cases "run in the normal unit-test jobs". That does not hold here: the Go test jobs build with -tags="ci", so nothing compiles a cgo_test file. Today the fuzzers run only through a manual just fuzz-op-core-fees.

Their seeds are also weak. All are real Base transactions between roughly 100 bytes and 1.2 KB, and a coverage run shows they never reach:

  • the 100-byte floor of the Fjord size estimate (fees.go)
  • inputs under 13 bytes, including the empty input (fastlz.go)
  • a hash-table hit further back than 8191 bytes, which must not count as a match (fastlz.go); no seed is long enough

What already runs in CI

Neither FlzCompressLen table has a fixture for a far hash-table hit, and the Go table has none for a non-empty input under 13 bytes.

Proposal

  1. Add fixtures for the uncovered branches to TestFlzCompressLen:
    • a few inputs under 13 bytes
    • an incompressible block longer than 32 bytes (literal-run encoding)
    • a match longer than 262 bytes with a remainder on each side of the 2-byte/3-byte boundary
    • a sequence that repeats more than 8191 bytes apart
    • a hash collision that is not a match
  2. Take the expected values from the references once: add the fixtures as fuzz seeds, run the three targets locally, then pin the results.
  3. Assert the same new vectors in op-revm's test_flz_compress_len, as the cross-implementation parity rule asks.
  4. Add an end-to-end Fjord fee vector from transaction bytes to fee, below and above the floor.
  5. Keep the vendored C FastLZ as an oracle: turn FuzzFastLzCgo into a table test that compares FlzCompressLen with the C library over the same fixtures, without the cgo_test tag, so the normal Go test job runs it. C FastLZ is the original implementation; LibZip and the Go and Rust code are ports of it. Confirm first that the CI Go test jobs build with cgo enabled.
  6. Delete the two Solidity fuzzers, the cgo_test tag and the just fuzz-op-core-fees recipe.

Both functions are small and frozen, so exploration adds little once each branch has a pinned vector, and the question of a scheduled fuzz job goes away.

🤖 Co-created with Claude Fable 5.2

Activity

  1. changed the title [-]ci: run the FastLZ and Fjord L1-cost fuzzers again[/-] [+]op-core: replace the FastLZ and Fjord L1-cost fuzzers with pinned fixtures[/+] on Nov 13, 2026
  2. self-assigned this
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions