pub fn verify_config_transition(old: &GlobalConfig, new: &GlobalConfig) -> anyhow::Result<()> {
    anyhow::ensure!(
        old.genesis.chain_id == new.genesis.chain_id,
        "changing chain_id is not allowed: old = {:?}, new = {:?}",
        old.genesis.chain_id,
        new.genesis.chain_id,
    );
    // Note that it may happen that the fork number didn't change,
    // in case the binary was updated to support more fields in genesis struct.
    // In such a case, the old binary was not able to connect to the consensus network,
    // because of the genesis hash mismatch.
    // TODO: Perhaps it would be better to deny unknown fields in the genesis instead.
    // It would require embedding the genesis either as a json string or protobuf bytes within
    // the global config, so that the global config can be parsed with
    // `deny_unknown_fields:false` while genesis would be parsed with
    // `deny_unknown_fields:true`.
    anyhow::ensure!(
        old.genesis.fork_number <= new.genesis.fork_number,
        "transition to a past fork is not allowed: old = {:?}, new = {:?}",
        old.genesis.fork_number,
        new.genesis.fork_number,
    );

    // This is a temporary hack until the `consensus_genesis()` RPC is disabled.
    if new
        == (&GlobalConfig {
            genesis: old.genesis.clone(),
            registry_address: None,
            seed_peers: [].into(),
        })
    {
        anyhow::bail!("new config is equal to truncated old config, which means that it was sourced from the wrong endpoint");
    }

    Ok(())
}
Verifies that the transition from `old` to `new` is admissible.
core/lib/dal/src/consensus_dal/mod.rs