Summary
When RELAYX_STUB_MODE is enabled, stub_mode_enabled() short-circuits RPC calls and returns synthetic data (src/utils/misc.rs, src/provider/tx.rs, fee_data.rs, etc.).
Risk
A single mis-set environment variable in production causes fake hashes, skipped balance checks, and non-authoritative fee data, which is dangerous for funds and incident response.
Suggested mitigations
- Log a highly visible warning at startup when stub mode is on.
- Optionally refuse to start unless
RELAYX_ALLOW_STUB_IN_PRODUCTION=true is also set.
References
src/utils/misc.rs (stub_mode_enabled)
Summary
When
RELAYX_STUB_MODEis enabled,stub_mode_enabled()short-circuits RPC calls and returns synthetic data (src/utils/misc.rs,src/provider/tx.rs,fee_data.rs, etc.).Risk
A single mis-set environment variable in production causes fake hashes, skipped balance checks, and non-authoritative fee data, which is dangerous for funds and incident response.
Suggested mitigations
RELAYX_ALLOW_STUB_IN_PRODUCTION=trueis also set.References
src/utils/misc.rs(stub_mode_enabled)