Skip to content

Add faucet-seed deterministic reset primitive so integration suites can rewind state #819

Description

@thlpkee20-wq

Description

Integration test suites need a faucet_reset(seed) primitive that deterministically restores the faucet to an initial state, so tests can be re-run without stale state.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/test_faucet_seed.rs, TESTNET_MODE.md
  • Reset must only be callable when testnet_mode is enabled

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/faucet-reset
  • Implement changes
    • Add faucet_reset(seed) gated on testnet_mode
    • Clear per-address cooldowns and metrics
    • Emit faucet_reset event with seed
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Reset called on mainnet must revert
  • Include test output and security notes

Example commit message

feat: add deterministic faucet reset primitive

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    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