Skip to content

Conversation

@anishnaik
Copy link
Collaborator

@anishnaik anishnaik commented Oct 23, 2025

• Overview

  • Corrals corpus replay into the worker pool so invariant failures surface during warmup instead of after a second pass, while
    keeping coverage heuristics intact.
  • Preserves the existing corpus format; warmup now just stages sequences for workers and reuses the current test hooks and
    coverage bookkeeping.

Key Changes

  • fuzzing/fuzzer.go:936-952 replaces corpus replay during startup with a warmup queue: after chain setup we seed coverage
    maps, enqueue all persisted sequences, and log warmup totals.
  • fuzzing/corpus/corpus.go:494-612 introduces PrepareForWarmup and MarkSequenceValidated, resets coverage via a lightweight
    chain clone, and blocks pruning until the chooser is ready; CheckSequenceCoverageAndUpdate now returns a bool so callers can
    react to coverage deltas.
  • fuzzing/fuzzer_worker_sequence_generator.go:16-248 tracks whether the current sequence came from warmup so workers can treat
    it specially while preserving the existing mutation strategies.
  • fuzzing/fuzzer_worker.go:262-387 binds corpus sequences to deployed contracts, executes them through the regular test
    pipeline, and re-registers successful sequences in the mutation chooser without duplicating runtime metadata.

@anishnaik anishnaik requested a review from Xenomega as a code owner October 23, 2025 19:53
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anishnaik
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anishnaik
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anishnaik
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anishnaik
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anishnaik
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 389 to +399
// Execute our call sequence.
_, err = calls.ExecuteCallSequenceIteratively(fw.chain, fetchElementFunc, executionCheckFunc)
var executedSequence calls.CallSequence
executedSequence, err = calls.ExecuteCallSequenceIteratively(fw.chain, fetchElementFunc, executionCheckFunc)

// If we encountered an error, report it.
if err != nil {
// If a corpus element fails to execute, log it (in debug mode) and exit the function early
if !isNewSequence {
fw.fuzzer.logger.Debug("[Worker ", fw.workerIndex, "] corpus element has been disabled due to an error:", err)
return nil, nil
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ensure worker reverts chain after failed warmup sequences

When a corpus sequence fails to execute, the error is swallowed and the function returns nil, nil, but the local err variable is left non‑nil. The deferred rollback only runs when err == nil, so the worker never calls RevertToBlockIndex in this path. A warmup failure therefore leaves the worker’s chain in a partially executed state, which can corrupt subsequent sequences and cause spurious coverage or test results. Set err = nil before returning or explicitly revert the chain before exiting so that every code path resets the chain state.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex this is incorrect because the defer function in testNextCallSequence will reset the chain state.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anishnaik anishnaik merged commit 77597e3 into master Oct 28, 2025
16 checks passed
@anishnaik anishnaik deleted the dev/run-corpus-across-workers branch October 28, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants