Skip to main content

Flag rules

  • Conflicts throw AnvilConfigurationError when the second flag is set; swap with unset().
  • Dependencies are checked by validate() / build() / start().
  • OpHardfork needs --optimism; Hardfork conflicts with it.

Generated from the flag registry:

FlagSet byConflicts withRequiresNote
--block-timemining.withBlockTime(), mining.withMixedMining()--no-mining
--dump-statestate.withDumpState()--init, --state
--initstate.withInit()--dump-state, --load-state, --preserve-historical-states, --state
--load-statestate.withLoadState()--init, --state
--mnemonicaccount.withMnemonic()--mnemonic-random, --mnemonic-seed-unsafe
--max-persisted-statesstate.withMaxPersistedStates()--prune-history
--mixed-miningmining.withMixedMining()--block-timeStricter than anvil: anvil's parser skips this requirement when --no-mining is present; mixed mining without a block time is meaningless, so --block-time is always required.
--mnemonic-randomaccount.withRandomMnemonic()--mnemonic, --mnemonic-seed-unsafe
--mnemonic-seed-unsafeaccount.withMnemonicSeedUnsafe()--mnemonic, --mnemonic-random
--no-miningmining.withNoMining()--block-time
--preserve-historical-statesstate.withPreserveHistoricalStates()--initone of --dump-state, --stateStricter than anvil: anvil accepts the flag without a dump target, where it has no effect.
--prune-historystate.withPruneHistory()--max-persisted-states
--state-intervalstate.withStateInterval()one of --dump-state, --stateStricter than anvil: anvil accepts the flag without a dump target, where it has no effect.
--statestate.withState()--dump-state, --init, --load-state
--colorlogs.withColor()--json
--jsonlogs.jsonLogFormat()--color, --md, --quiet
--mdlogs.withMarkdownFormat()--json
--quietlogs.quiet()--json, --verbosity
--verbositylogs.verboseLogs()--quiet
--allow-originserver.withAllowOrigin()--no-cors
--no-corsserver.noCors()--allow-origin
--compute-units-per-secondfork.withComputeUnitsPerSecond()--fork-url
--fork-block-numberfork.withForkBlockNumber(), fork.withForkUrl()--fork-transaction-hash--fork-url
--fork-chain-idfork.withForkChainId()--fork-url; one of --fork-block-number, --fork-transaction-hash
--fork-headerfork.withForkHeader(), fork.withForkHeaders()--fork-url
--fork-retry-backofffork.withForkRetryBackoff()--fork-url
--fork-transaction-hashfork.withForkTransactionHash()--fork-block-number--fork-url
--no-rate-limitfork.noRateLimit()--fork-url
--no-storage-cachingfork.noStorageCaching()--fork-url
--retriesfork.withRetries()--fork-url
--timeoutfork.withTimeout()--fork-url
--code-size-limitevm.withCodeSizeLimit()--disable-code-size-limit
--disable-block-gas-limitevm.disableBlockGasLimit()--gas-limit
--disable-code-size-limitevm.disableCodeSizeLimit()--code-size-limit
--gas-limitevm.withGasLimit()--disable-block-gas-limit
--celonetwork.withCelo()--optimism
--optimismnetwork.withOptimism()--celo

"Stricter than anvil": anvil accepts the combination but ignores it. Every rule is verified against the real binary.

Tasks: Catch misconfiguration in unit tests.