diff --git a/src/app/firedancer/topology.c b/src/app/firedancer/topology.c index 374cf67acd..91e0dbac2c 100644 --- a/src/app/firedancer/topology.c +++ b/src/app/firedancer/topology.c @@ -1167,6 +1167,8 @@ fd_topo_configure_tile( fd_topo_tile_t * tile, tile->replay.larger_max_cost_per_block = config->development.bench.larger_max_cost_per_block; + strncpy( tile->replay.genesis_path, config->paths.genesis, sizeof(tile->replay.genesis_path) ); + /* not specified by [tiles.replay] */ strncpy( tile->replay.identity_key_path, config->paths.identity_key, sizeof(tile->replay.identity_key_path) ); diff --git a/src/disco/topo/fd_topo.h b/src/disco/topo/fd_topo.h index 4d1f6bce05..8fbed79c70 100644 --- a/src/disco/topo/fd_topo.h +++ b/src/disco/topo/fd_topo.h @@ -387,6 +387,8 @@ struct fd_topo_tile { ulong enable_features_cnt; char enable_features[ 16 ][ FD_BASE58_ENCODED_32_SZ ]; + char genesis_path[ PATH_MAX ]; + int larger_max_cost_per_block; ulong capture_start_slot; diff --git a/src/discof/replay/fd_replay_tile.c b/src/discof/replay/fd_replay_tile.c index 7979232f04..6f9bc5ae4a 100644 --- a/src/discof/replay/fd_replay_tile.c +++ b/src/discof/replay/fd_replay_tile.c @@ -165,6 +165,7 @@ struct fd_replay_tile { fd_vote_tracker_t * vote_tracker; int has_genesis_hash; + char genesis_path[ PATH_MAX ]; uchar genesis_hash[ 32UL ]; ulong cluster_type; @@ -1338,8 +1339,16 @@ maybe_verify_cluster_type( fd_replay_tile_t * ctx ) { cluster = FD_CLUSTER_UNKNOWN; } - if( cluster!=ctx->cluster_type ) { - FD_LOG_ERR(( "cluster type mismatch: (genesis) %s != (snapshot) %s", fd_genesis_cluster_name( cluster ), fd_genesis_cluster_name( ctx->cluster_type ) )); + if( FD_UNLIKELY( cluster!=ctx->cluster_type ) ) { + FD_LOG_ERR(( "Your genesis.bin file at `%s` has a genesis hash of `%s` which means the cluster is %s " + "but the snapshot you loaded is for a different cluster %s. If you are trying to join the " + "%s cluster, you can delete the genesis.bin file and restart the node to download the correct " + "genesis file automatically.", + ctx->genesis_path, + hash_cstr, + fd_genesis_cluster_name( cluster ), + fd_genesis_cluster_name( ctx->cluster_type ), + fd_genesis_cluster_name( cluster ) )); } } @@ -2331,6 +2340,7 @@ unprivileged_init( fd_topo_t * topo, ctx->expected_shred_version = tile->replay.expected_shred_version; ctx->ipecho_shred_version = 0; + fd_memcpy( ctx->genesis_path, tile->replay.genesis_path, sizeof(ctx->genesis_path) ); ctx->has_genesis_hash = 0; ctx->cluster_type = FD_CLUSTER_UNKNOWN; ctx->hard_forks_cnt = ULONG_MAX;