diff --git a/src/app/firedancer/config/default.toml b/src/app/firedancer/config/default.toml index 2cd47060f93..125a3d90e10 100644 --- a/src/app/firedancer/config/default.toml +++ b/src/app/firedancer/config/default.toml @@ -72,7 +72,7 @@ telemetry = true # /home/fire/.firedancer/fd1 # +-- identity.json # +-- vote-account.json - # +-- mainnet-genesis.bin (or testnet-, devnet-, local-) + # +-- genesis-[hash].bin # +-- snapshots # +-- snapshot-368327930-E5ZsnTCNX7WToyrP4ZQYJj7pPii6Ssa7UnNcV7HZ3iAf.tar.zst # +-- incremental-snapshot-368327930-368400391-8ybYYVq7Ecui9TLj13SvzXjTX7JiGP65f4KrtNRCPajW.tar.zst diff --git a/src/app/shared/fd_config.c b/src/app/shared/fd_config.c index 62ebe9f2638..985fef15a93 100644 --- a/src/app/shared/fd_config.c +++ b/src/app/shared/fd_config.c @@ -348,15 +348,12 @@ fd_config_fill( fd_config_t * config, replace( config->paths.genesis, "{user}", config->user ); replace( config->paths.genesis, "{name}", config->name ); } else if( FD_LIKELY( config->is_firedancer ) ) { - ulong genesis_cluster = fd_genesis_cluster_identify( config->consensus.expected_genesis_hash ); - char const * prefix; - switch( genesis_cluster ) { - case FD_CLUSTER_MAINNET_BETA: prefix = "mainnet"; break; - case FD_CLUSTER_TESTNET: prefix = "testnet"; break; - case FD_CLUSTER_DEVNET: prefix = "devnet"; break; - default: prefix = "local"; break; + char const * genesis_hash = config->consensus.expected_genesis_hash; + if( FD_LIKELY( genesis_hash && genesis_hash[0] != '\0' ) ) { + FD_TEST( fd_cstr_printf_check( config->paths.genesis, sizeof(config->paths.genesis), NULL, "%s/genesis-%s.bin", config->paths.base, genesis_hash ) ); + } else { + FD_TEST( fd_cstr_printf_check( config->paths.genesis, sizeof(config->paths.genesis), NULL, "%s/genesis-local.bin", config->paths.base ) ); } - FD_TEST( fd_cstr_printf_check( config->paths.genesis, sizeof(config->paths.genesis), NULL, "%s/%s-genesis.bin", config->paths.base, prefix ) ); } else { FD_TEST( fd_cstr_printf_check( config->paths.genesis, sizeof(config->paths.genesis), NULL, "%s/genesis.bin", config->paths.base ) ); }