From a24ff5490362ee4a7f9745cab0d86b9455bc880b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 17:59:42 +0000 Subject: [PATCH 1/3] Initial plan From a102cd43f693959e8ae1331199819ae40ddbd78d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:02:05 +0000 Subject: [PATCH 2/3] Change genesis file naming from cluster-prefix to genesis-hash pattern Co-authored-by: ripatel-fd <113896534+ripatel-fd@users.noreply.github.com> --- src/app/firedancer/config/default.toml | 2 +- src/app/shared/fd_config.c | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) 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..0cf821d1518 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 && strcmp( genesis_hash, "" ) ) ) { + 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 ) ); } From fcf3f150f139e99911708a46a44c482fa20c2745 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:03:22 +0000 Subject: [PATCH 3/3] Fix null pointer check for genesis_hash Co-authored-by: ripatel-fd <113896534+ripatel-fd@users.noreply.github.com> --- src/app/shared/fd_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/fd_config.c b/src/app/shared/fd_config.c index 0cf821d1518..985fef15a93 100644 --- a/src/app/shared/fd_config.c +++ b/src/app/shared/fd_config.c @@ -349,7 +349,7 @@ fd_config_fill( fd_config_t * config, replace( config->paths.genesis, "{name}", config->name ); } else if( FD_LIKELY( config->is_firedancer ) ) { char const * genesis_hash = config->consensus.expected_genesis_hash; - if( FD_LIKELY( genesis_hash && strcmp( 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 ) );