Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/firedancer/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) );
Expand Down
2 changes: 2 additions & 0 deletions src/disco/topo/fd_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 12 additions & 2 deletions src/discof/replay/fd_replay_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 ) ));
}
}

Expand Down Expand Up @@ -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;
Expand Down
Loading