{"record":{"id":"faf28ee99029790b","repo":"nautechsystems/nautilus_trader","slug":"snapshot-from-rpc-cannot-be-combined-with-from","errorCode":null,"errorMessage":"--snapshot-from-rpc cannot be combined with --from-block","messagePattern":"--snapshot-from-rpc cannot be combined with --from-block","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":406,"sourceCode":"        } else {\n            data_client\n                .bootstrap_pool_profiler_from_rpc_snapshot(pool, checkpoint)\n                .await\n        }\n    } else {\n        data_client\n            .bootstrap_latest_pool_profiler(pool, Some(checkpoint))\n            .await\n    }\n}\n\nfn validate_snapshot_from_rpc_options(\n    from_block: Option<u64>,\n    reset: bool,\n    require_existing_snapshot: bool,\n) -> anyhow::Result<()> {\n    if from_block.is_some() {\n        anyhow::bail!(\"--snapshot-from-rpc cannot be combined with --from-block\");\n    }\n\n    if reset {\n        anyhow::bail!(\"--snapshot-from-rpc cannot be combined with --reset\");\n    }\n\n    if require_existing_snapshot {\n        anyhow::bail!(\"--snapshot-from-rpc cannot be combined with --require-existing-snapshot\");\n    }\n\n    Ok(())\n}\n\n/// Sorts, dedups, and clamps requested checkpoint blocks to `to_block`.\n///\n/// Checkpoints above `to_block` are dropped; they cannot be snapshotted in this pass.\nfn normalize_checkpoints(checkpoint_blocks: &[u64], to_block: u64) -> Vec<u64> {\n    let mut checkpoints: Vec<u64> = checkpoint_blocks","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L388-L424","documentation":"--snapshot-from-rpc builds the pool snapshot from live RPC state, so a historical --from-block replay start is meaningless and contradictory. validate_snapshot_from_rpc_options rejects the combination up front.","triggerScenarios":"Running analyze_pool_with_client with both --snapshot-from-rpc and --from-block set; a scripted invocation that always passes --from-block and was extended with --snapshot-from-rpc.","commonSituations":"Wrappers/shell scripts that hardcode --from-block; users assuming snapshot-from-rpc needs a start block like the replay path does.","solutions":["Remove --from-block when using --snapshot-from-rpc","Remove --snapshot-from-rpc if you intend a replay from a historical block","Update wrapper scripts to pass the two modes conditionally"],"exampleFix":"// before\nnautilus blockchain analyze --pool 0x.. --snapshot-from-rpc --from-block 100000\n// after\nnautilus blockchain analyze --pool 0x.. --snapshot-from-rpc","handlingStrategy":"validation","validationCode":"def check_snapshot_flags(args):\n    if args.snapshot_from_rpc and args.from_block is not None:\n        raise ValueError(\"--snapshot-from-rpc cannot be combined with --from-block\")","typeGuard":null,"tryCatchPattern":"try:\n    run_analyze(args)\nexcept ValueError as e:\n    if \"cannot be combined\" in str(e):\n        fix_flag_conflicts(args)","preventionTips":["Treat --snapshot-from-rpc as an exclusive mode: no --from-block, --reset, or --require-existing-snapshot","Build CLI wrappers that take a mode enum and set flags per mode","Read --help for the analyze subcommand before composing invocations"],"tags":["cli","blockchain","flags","conflict"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}