Skip to content
Closed
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: 0 additions & 2 deletions src/app/firedancer/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,6 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
tile->replay.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX ); FD_TEST( tile->replay.funk_obj_id !=ULONG_MAX );
tile->replay.progcache_obj_id = fd_pod_query_ulong( config->topo.props, "progcache", ULONG_MAX ); FD_TEST( tile->replay.progcache_obj_id!=ULONG_MAX );

strncpy( tile->replay.cluster_version, config->tiles.replay.cluster_version, sizeof(tile->replay.cluster_version) );

tile->replay.max_live_slots = config->firedancer.runtime.max_live_slots;

tile->replay.expected_shred_version = config->consensus.expected_shred_version;
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/fd_config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ fd_config_extract_pod( uchar * pod,
CFG_POP ( bool, capture.dump_txn_to_pb );
CFG_POP ( bool, capture.dump_block_to_pb );

CFG_POP ( cstr, tiles.replay.cluster_version );
CFG_POP_ARRAY( cstr, tiles.replay.enable_features );

CFG_POP ( cstr, tiles.store_int.slots_pending );
Expand Down
7 changes: 1 addition & 6 deletions src/app/shared_dev/commands/configure/genesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,7 @@ create_genesis( config_t const * config,

fd_features_t features[1];
fd_features_disable_all( features );
fd_cluster_version_t cluster_version = {
.major = FD_DEFAULT_AGAVE_CLUSTER_VERSION_MAJOR,
.minor = FD_DEFAULT_AGAVE_CLUSTER_VERSION_MINOR,
.patch = FD_DEFAULT_AGAVE_CLUSTER_VERSION_PATCH
};
fd_features_enable_cleaned_up( features, &cluster_version );
fd_features_enable_cleaned_up( features );
default_enable_features( features );

options->features = features;
Expand Down
1 change: 0 additions & 1 deletion src/disco/topo/fd_topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ struct fd_topo_tile {
ulong progcache_obj_id;

char shred_cap[ PATH_MAX ];
char cluster_version[ 32 ];

char identity_key_path[ PATH_MAX ];
uint ip_addr;
Expand Down
7 changes: 1 addition & 6 deletions src/discof/replay/fd_replay_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2490,13 +2490,8 @@ unprivileged_init( fd_topo_t * topo,

/* Set some initial values for the bank: hardcoded features and the
cluster version. */
fd_cluster_version_t * cluster_version = fd_bank_cluster_version_modify( bank );
if( FD_UNLIKELY( sscanf( tile->replay.cluster_version, "%u.%u.%u", &cluster_version->major, &cluster_version->minor, &cluster_version->patch )!=3 ) ) {
FD_LOG_ERR(( "failed to decode cluster version, configured as \"%s\"", tile->replay.cluster_version ));
}

fd_features_t * features = fd_bank_features_modify( bank );
fd_features_enable_cleaned_up( features, cluster_version );
fd_features_enable_cleaned_up( features );

char const * one_off_features[ 16UL ];
FD_TEST( tile->replay.enable_features_cnt<=sizeof(one_off_features)/sizeof(one_off_features[0]) );
Expand Down
14 changes: 2 additions & 12 deletions src/flamenco/features/fd_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,8 @@ fd_features_disable_all( fd_features_t * f ) {
}

void
fd_features_enable_cleaned_up( fd_features_t * f, fd_cluster_version_t const * cluster_version ) {
for( fd_feature_id_t const * id = fd_feature_iter_init();
!fd_feature_iter_done( id );
id = fd_feature_iter_next( id ) ) {
if( ( id->cleaned_up[0]<cluster_version->major ) ||
( id->cleaned_up[0]==cluster_version->major && id->cleaned_up[1]<cluster_version->minor ) ||
( id->cleaned_up[0]==cluster_version->major && id->cleaned_up[1]==cluster_version->minor && id->cleaned_up[2]<=cluster_version->patch ) ) {
fd_features_set( f, id, 0UL );
} else {
fd_features_set( f, id, FD_FEATURE_DISABLED );
}
}
fd_features_enable_cleaned_up( fd_features_t * f ) {
(void)f;
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/flamenco/features/fd_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fd_features_enable_all( fd_features_t * );
of the Firedancer software and can't be disabled. */

void
fd_features_enable_cleaned_up( fd_features_t *, fd_cluster_version_t const * );
fd_features_enable_cleaned_up( fd_features_t * );

/* fd_features_enable_one_offs enables all manually passed in features. */

Expand Down
1 change: 0 additions & 1 deletion src/flamenco/runtime/fd_bank.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ FD_PROTOTYPES_BEGIN
X(ulong, signature_count, sizeof(ulong), alignof(ulong), 0, 0, 0 ) /* Signature count */ \
X(fd_hash_t, poh, sizeof(fd_hash_t), alignof(fd_hash_t), 0, 0, 0 ) /* PoH */ \
X(fd_sol_sysvar_last_restart_slot_t, last_restart_slot, sizeof(fd_sol_sysvar_last_restart_slot_t), alignof(fd_sol_sysvar_last_restart_slot_t), 0, 0, 0 ) /* Last restart slot */ \
X(fd_cluster_version_t, cluster_version, sizeof(fd_cluster_version_t), alignof(fd_cluster_version_t), 0, 0, 0 ) /* Cluster version */ \
X(fd_hash_t, bank_hash, sizeof(fd_hash_t), alignof(fd_hash_t), 0, 0, 0 ) /* Bank hash */ \
X(fd_hash_t, prev_bank_hash, sizeof(fd_hash_t), alignof(fd_hash_t), 0, 0, 0 ) /* Previous bank hash */ \
X(fd_hash_t, genesis_hash, sizeof(fd_hash_t), alignof(fd_hash_t), 0, 0, 0 ) /* Genesis hash */ \
Expand Down
16 changes: 4 additions & 12 deletions src/flamenco/runtime/program/fd_builtin_programs.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,10 @@ fd_builtin_programs_init( fd_bank_t * bank,
}
}

/* Precompiles have empty account data */
if( fd_bank_cluster_version_get( bank ).major == 1 ) {
char data[1] = {1};
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_keccak_secp_256k_program_id, data, 1 );
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_ed25519_sig_verify_program_id, data, 1 );
if( FD_FEATURE_ACTIVE_BANK( bank, enable_secp256r1_precompile ) )
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_secp256r1_program_id, data, 1 );
} else {
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_keccak_secp_256k_program_id, "", 0 );
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_ed25519_sig_verify_program_id, "", 0 );
if( FD_FEATURE_ACTIVE_BANK( bank, enable_secp256r1_precompile ) )
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_secp256r1_program_id, "", 0 );
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_keccak_secp_256k_program_id, "", 0 );
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_ed25519_sig_verify_program_id, "", 0 );
if( FD_FEATURE_ACTIVE_BANK( bank, enable_secp256r1_precompile ) ) {
fd_write_builtin_account( bank, accdb, xid, capture_ctx, fd_solana_secp256r1_program_id, "", 0 );
}

/* Inline SPL token mint program ("inlined to avoid an external dependency on the spl-token crate") */
Expand Down
10 changes: 0 additions & 10 deletions src/flamenco/types/fd_fuzz_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,16 +929,6 @@ void *fd_cluster_type_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
return mem;
}

void *fd_cluster_version_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
fd_cluster_version_t *self = (fd_cluster_version_t *) mem;
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_cluster_version_t);
fd_cluster_version_new(mem);
self->major = fd_rng_uint( rng );
self->minor = fd_rng_uint( rng );
self->patch = fd_rng_uint( rng );
return mem;
}

void *fd_stake_reward_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
fd_stake_reward_t *self = (fd_stake_reward_t *) mem;
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_reward_t);
Expand Down
37 changes: 0 additions & 37 deletions src/flamenco/types/fd_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -5520,43 +5520,6 @@ int fd_cluster_type_encode( fd_cluster_type_t const * self, fd_bincode_encode_ct
return err;
}

int fd_cluster_version_encode( fd_cluster_version_t const * self, fd_bincode_encode_ctx_t * ctx ) {
int err;
err = fd_bincode_uint32_encode( self->major, ctx );
if( FD_UNLIKELY( err ) ) return err;
err = fd_bincode_uint32_encode( self->minor, ctx );
if( FD_UNLIKELY( err ) ) return err;
err = fd_bincode_uint32_encode( self->patch, ctx );
if( FD_UNLIKELY( err ) ) return err;
return FD_BINCODE_SUCCESS;
}
static inline int fd_cluster_version_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
ctx->data = (void *)( (ulong)ctx->data + 12UL );
return 0;
}
static void fd_cluster_version_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
fd_cluster_version_t * self = (fd_cluster_version_t *)struct_mem;
fd_bincode_uint32_decode_unsafe( &self->major, ctx );
fd_bincode_uint32_decode_unsafe( &self->minor, ctx );
fd_bincode_uint32_decode_unsafe( &self->patch, ctx );
}
void * fd_cluster_version_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
fd_cluster_version_t * self = (fd_cluster_version_t *)mem;
fd_cluster_version_new( self );
void * alloc_region = (uchar *)mem + sizeof(fd_cluster_version_t);
void * * alloc_mem = &alloc_region;
fd_cluster_version_decode_inner( mem, alloc_mem, ctx );
return self;
}
void fd_cluster_version_walk( void * w, fd_cluster_version_t const * self, fd_types_walk_fn_t fun, const char *name, uint level, uint varint ) {
(void) varint;
fun( w, self, name, FD_FLAMENCO_TYPE_MAP, "fd_cluster_version", level++, 0 );
fun( w, &self->major, "major", FD_FLAMENCO_TYPE_UINT, "uint", level, 0 );
fun( w, &self->minor, "minor", FD_FLAMENCO_TYPE_UINT, "uint", level, 0 );
fun( w, &self->patch, "patch", FD_FLAMENCO_TYPE_UINT, "uint", level, 0 );
fun( w, self, name, FD_FLAMENCO_TYPE_MAP_END, "fd_cluster_version", level--, 0 );
}
int fd_stake_reward_encode( fd_stake_reward_t const * self, fd_bincode_encode_ctx_t * ctx ) {
int err;
err = fd_pubkey_encode( &self->stake_pubkey, ctx );
Expand Down
21 changes: 0 additions & 21 deletions src/flamenco/types/fd_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,6 @@ struct fd_cluster_type {
typedef struct fd_cluster_type fd_cluster_type_t;
#define FD_CLUSTER_TYPE_ALIGN alignof(fd_cluster_type_t)

/* Encoded Size: Fixed (12 bytes) */
struct fd_cluster_version {
uint major;
uint minor;
uint patch;
};
typedef struct fd_cluster_version fd_cluster_version_t;
#define FD_CLUSTER_VERSION_ALIGN alignof(fd_cluster_version_t)

/* Encoded Size: Fixed (49 bytes) */
struct fd_stake_reward {
ulong prev;
Expand Down Expand Up @@ -2575,18 +2566,6 @@ fd_cluster_type_enum_MainnetBeta = 1,
fd_cluster_type_enum_Devnet = 2,
fd_cluster_type_enum_Development = 3,
};
static inline void fd_cluster_version_new( fd_cluster_version_t * self ) { fd_memset( self, 0, sizeof(fd_cluster_version_t) ); }
int fd_cluster_version_encode( fd_cluster_version_t const * self, fd_bincode_encode_ctx_t * ctx );
void fd_cluster_version_walk( void * w, fd_cluster_version_t const * self, fd_types_walk_fn_t fun, const char *name, uint level, uint varint );
static inline ulong fd_cluster_version_size( fd_cluster_version_t const * self ) { (void)self; return 12UL; }
static inline ulong fd_cluster_version_align( void ) { return FD_CLUSTER_VERSION_ALIGN; }
static inline int fd_cluster_version_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
*total_sz += sizeof(fd_cluster_version_t);
if( (ulong)ctx->data + 12UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
return 0;
}
void * fd_cluster_version_decode( void * mem, fd_bincode_decode_ctx_t * ctx );

static inline void fd_stake_reward_new( fd_stake_reward_t * self ) { fd_memset( self, 0, sizeof(fd_stake_reward_t) ); }
int fd_stake_reward_encode( fd_stake_reward_t const * self, fd_bincode_encode_ctx_t * ctx );
void fd_stake_reward_walk( void * w, fd_stake_reward_t const * self, fd_types_walk_fn_t fun, const char *name, uint level, uint varint );
Expand Down
10 changes: 0 additions & 10 deletions src/flamenco/types/fd_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,16 +678,6 @@
{ "name": "Development" }
]
},
{
"name": "cluster_version",
"type": "struct",
"global": true,
"fields": [
{ "name": "major", "type": "uint" },
{ "name": "minor", "type": "uint" },
{ "name": "patch", "type": "uint" }
]
},
{
"name": "stake_reward",
"type": "struct",
Expand Down
3 changes: 1 addition & 2 deletions src/flamenco/types/fd_types_reflect_generated.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading