Skip to content

Prefer fixed invariant sender pool#15366

Open
decofe wants to merge 2 commits into
masterfrom
centaur/fixed-invariant-sender-pool-1782357612
Open

Prefer fixed invariant sender pool#15366
decofe wants to merge 2 commits into
masterfrom
centaur/fixed-invariant-sender-pool-1782357612

Conversation

@decofe

@decofe decofe commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • change invariant fuzzing to prefer a fixed default sender pool modeled after Echidna
  • include Foundry's default deployer/caller in that pool
  • keep a rare random/dictionary sender fallback for broad exploration
  • preserve targetSenders()/excludeSenders() behavior

Prompted by: @0xalpharush

Tests

  • cargo test -p foundry-evm-fuzz default_sender_pool -- --nocapture
  • cargo test -p foundry-evm-fuzz strategies::invariants -- --nocapture

@decofe decofe force-pushed the centaur/fixed-invariant-sender-pool-1782357612 branch from 24c649a to a243d36 Compare June 25, 2026 03:23
@decofe decofe changed the base branch from centaur/add-lightweight-crossover-mutators-1782356515 to master June 25, 2026 03:23
@0xalpharush

Copy link
Copy Markdown
Collaborator

derek bench invariant

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

cc @0xalpharush

bench (invariant) event published. Results will be reported separately. View publisher run

Config: subcommand: invariant, PR SHA: a243d366d0f4, compare-ref: master, timeout: 3600s, workers: default, benchmark-type: property

Comment on lines +28 to +29
const RANDOM_SENDER_WEIGHT: u32 = 1;
const DEFAULT_SENDER_WEIGHT: u32 = 99;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Proposal: split the sender weighting from --invariant-dictionary-weight. After this change, when targetSenders is empty the sender comes 99% from the fixed pool and only 1% from the random/dictionary strategy, so the knob barely affects which address sends the tx anymore.

To check, I counted how many of 400 sender draws were not one of the three new fixed-pool addresses. On master, raising the dictionary weight from 0 to 100 changes that count from 400 down to ~203 — so the knob clearly drives sender selection. On this PR it stays at ~2–3 regardless of the weight.

Maybe we can add a dedicated weight for the fixed-pool-vs-random/dictionary split, and leave dictionary_weight to govern calldata plus the fallback branch. That keeps the new Echidna-style default while still letting users dial sender randomness back up, and avoids making the existing help text (invariant calldata/senders) misleading.

@grandizzy

Copy link
Copy Markdown
Collaborator

derek bench invariant timeout=7200

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

cc @grandizzy

bench (invariant) event published. Results will be reported separately. View publisher run

Config: subcommand: invariant, PR SHA: a4db2aa9aef6, compare-ref: master, timeout: 7200s, workers: default, benchmark-type: property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants