Skip to content

[config] fork.toml lowered profit gate has no mainnet-accidental-use guard #254

@obchain

Description

@obchain

Refs #52

File: config/fork.toml

Problem

fork.toml lowers profit threshold for demo (per PR description). If operator accidentally runs charon --config config/fork.toml with mainnet env vars (BNB_WS_URL pointing at mainnet), bot operates on mainnet with lowered profit gate. Unprofitable liquidations attempted.

Fix

Add runtime assertion in main.rs that refuses to start if:

  • config rpc_url ≠ localhost AND config profile_name = 'fork'
  • OR config profile_name contains 'fork' AND chain_id matches mainnet

Add profile_tag = "fork" field to fork.toml. Validate on startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:devopsCI / deploy / infra / telemetrypr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions