diff --git a/config/everything.mk b/config/everything.mk index 05e9417639..fc3e68d151 100644 --- a/config/everything.mk +++ b/config/everything.mk @@ -267,7 +267,7 @@ make-bin-rust = $(eval $(call _make-exe,$(1),$(2),$(3),rust,bin,$(4))) make-shared = $(eval $(call _make-exe,$(1),$(2),$(3),lib,lib,-shared $(4))) make-unit-test = $(eval $(call _make-exe,$(1),$(2),$(3),unit-test,unit-test,$(4))) run-unit-test = $(eval $(call _run-unit-test,$(1))) -make-integration-test = $(eval $(call _make-exe,$(1),$(2),$(3),integration-test,integration-test)) +make-integration-test = $(eval $(call _make-exe,$(1),$(2),$(3),integration-test,integration-test,$(4))) run-integration-test = $(eval $(call _run-integration-test,$(1))) make-fuzz-test = $(eval $(call _fuzz-test,$(1),$(2),$(3))) diff --git a/src/app/fdctl/Local.mk b/src/app/fdctl/Local.mk index c8074dd862..be74605cfe 100644 --- a/src/app/fdctl/Local.mk +++ b/src/app/fdctl/Local.mk @@ -1,7 +1,6 @@ ifdef FD_HAS_HOSTED ifdef FD_HAS_ALLOCA ifdef FD_HAS_DOUBLE -ifdef FD_HAS_SECP256K1 include src/app/fdctl/with-version.mk $(info Using FIREDANCER_VERSION=$(FIREDANCER_VERSION_MAJOR).$(FIREDANCER_VERSION_MINOR).$(FIREDANCER_VERSION_PATCH)) @@ -41,7 +40,15 @@ $(call add-objs,configure/xdp,fd_fdctl) $(call add-objs,configure/ethtool,fd_fdctl) $(call add-objs,configure/workspace,fd_fdctl) -$(call make-bin-rust,fdctl,main,fd_fdctl fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_ip fd_reedsol fd_ballet fd_waltz fd_tango fd_util solana_validator, $(SECP256K1_LIBS)) +ifdef FD_HAS_NO_SOLANA +ifdef FD_HAS_SECP256K1 +$(call make-lib,external_functions) +$(call add-objs,external_functions,external_functions) +$(call make-bin-rust,fdctl,main,fd_fdctl fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_ip fd_reedsol fd_ballet fd_waltz fd_tango fd_util external_functions, $(SECP256K1_LIBS)) +endif +else +$(call make-bin-rust,fdctl,main,fd_fdctl fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_ip fd_reedsol fd_ballet fd_waltz fd_tango fd_util solana_validator) +endif $(call make-unit-test,test_tiles_verify,run/tiles/test_verify,fd_ballet fd_tango fd_util) $(call run-unit-test,test_tiles_verify) @@ -109,5 +116,3 @@ solana: $(OBJDIR)/bin/solana $(OBJDIR)/bin/solana endif endif endif -endif - diff --git a/src/app/fdctl/external_functions.c b/src/app/fdctl/external_functions.c new file mode 100644 index 0000000000..0b172fc60b --- /dev/null +++ b/src/app/fdctl/external_functions.c @@ -0,0 +1,36 @@ +#include "../../util/fd_util.h" + + +extern void fd_ext_validator_main( const char ** args FD_PARAM_UNUSED ) {} +extern void fd_ext_genesis_main( const char ** args FD_PARAM_UNUSED ) {} + +extern void * fd_ext_bank_pre_balance_info( void const * bank FD_PARAM_UNUSED, void * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED ) { return NULL; } +extern void * fd_ext_bank_load_and_execute_txns( void const * bank FD_PARAM_UNUSED, void * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED, int * out_load_results FD_PARAM_UNUSED, int * out_executing_results FD_PARAM_UNUSED, int * out_executed_results FD_PARAM_UNUSED ) { return NULL; } +extern void fd_ext_bank_acquire( void const * bank FD_PARAM_UNUSED ) {} +extern void fd_ext_bank_release( void const * bank FD_PARAM_UNUSED ) {} +extern void fd_ext_bank_release_thunks( void * load_and_execute_output FD_PARAM_UNUSED ) {} +extern void fd_ext_bank_release_pre_balance_info( void * pre_balance_info FD_PARAM_UNUSED ) {} + +extern void fd_ext_bank_commit_txns( void const * bank FD_PARAM_UNUSED, void const * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED, void * load_and_execute_output FD_PARAM_UNUSED, void * pre_balance_info FD_PARAM_UNUSED ) {} +extern void fd_ext_poh_signal_leader_change( void * sender FD_PARAM_UNUSED ) {} +extern void fd_ext_poh_register_tick( void const * bank FD_PARAM_UNUSED, uchar const * hash FD_PARAM_UNUSED ) {} + +extern int +fd_ext_blockstore_insert_shreds( void const * blockstore FD_PARAM_UNUSED, + ulong shred_cnt FD_PARAM_UNUSED, + uchar const * shred_bytes FD_PARAM_UNUSED, + ulong shred_sz FD_PARAM_UNUSED, + ulong stride FD_PARAM_UNUSED ) { return 0; } + +extern int +fd_ext_bank_sanitized_txn_load_addresess( void const * bank FD_PARAM_UNUSED, + void * address_table_lookups FD_PARAM_UNUSED, + ulong address_table_lookups_cnt FD_PARAM_UNUSED, + void * out_sidecar FD_PARAM_UNUSED ) { return 0; } + +extern void +fd_ext_blockstore_create_block0( char const * ledger_path FD_PARAM_UNUSED, + ulong shred_cnt FD_PARAM_UNUSED, + uchar const * shred_bytes FD_PARAM_UNUSED, + ulong shred_sz FD_PARAM_UNUSED, + ulong stride FD_PARAM_UNUSED ) {} diff --git a/src/app/fddev/Local.mk b/src/app/fddev/Local.mk index c3b7a1b878..dc5e0374a6 100644 --- a/src/app/fddev/Local.mk +++ b/src/app/fddev/Local.mk @@ -2,7 +2,6 @@ ifdef FD_HAS_HOSTED ifdef FD_HAS_ALLOCA ifdef FD_HAS_DOUBLE ifdef FD_HAS_INT128 -ifdef FD_HAS_SECP256K1 include src/app/fdctl/with-version.mk @@ -24,9 +23,11 @@ $(call add-objs,configure/genesis,fd_fddev) $(call add-objs,configure/blockstore,fd_fddev) ifdef FD_HAS_NO_SOLANA -$(call make-bin-rust,fddev,main external_functions,fd_fdctl fd_fddev fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util, $(SECP256K1_LIBS)) +ifdef FD_HAS_SECP256K1 +$(call make-bin-rust,fddev,main,fd_fdctl fd_fddev fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util external_functions, $(SECP256K1_LIBS)) +endif else -$(call make-bin-rust,fddev,main,fd_fdctl fd_fddev fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util solana_validator, $(SECP256K1_LIBS)) +$(call make-bin-rust,fddev,main,fd_fdctl fd_fddev fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util solana_validator) endif ifeq (run,$(firstword $(MAKECMDGOALS))) @@ -54,7 +55,9 @@ monitor: bin $(OBJDIR)/bin/fddev monitor $(MONITOR_ARGS) ifdef FD_HAS_NO_SOLANA -$(call make-integration-test,test_fddev,tests/test_fddev,fd_fdctl fd_fddev fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util external_functions) +ifdef FD_HAS_SECP256K1 +$(call make-integration-test,test_fddev,tests/test_fddev,fd_fdctl fd_fddev fd_choreo fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util external_functions, $(SECP256K1_LIBS)) +endif else $(call make-integration-test,test_fddev,tests/test_fddev,fd_fdctl fd_fddev fd_disco fd_flamenco fd_funk fd_quic fd_tls fd_reedsol fd_ballet fd_waltz fd_tango fd_util solana_validator) endif @@ -64,5 +67,3 @@ endif endif endif endif -endif - diff --git a/src/app/fddev/external_functions.c b/src/app/fddev/external_functions.c deleted file mode 100644 index 2418569d16..0000000000 --- a/src/app/fddev/external_functions.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "../../util/fd_util.h" - - -void fd_ext_validator_main( const char ** args FD_PARAM_UNUSED ) {} -void fd_ext_genesis_main( const char ** args FD_PARAM_UNUSED ) {} - -void * fd_ext_bank_pre_balance_info( void const * bank FD_PARAM_UNUSED, void * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED ) { return NULL; } -void * fd_ext_bank_load_and_execute_txns( void const * bank FD_PARAM_UNUSED, void * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED, int * out_load_results FD_PARAM_UNUSED, int * out_executing_results FD_PARAM_UNUSED, int * out_executed_results FD_PARAM_UNUSED ) { return NULL; } -void fd_ext_bank_acquire( void const * bank FD_PARAM_UNUSED ) {} -void fd_ext_bank_release( void const * bank FD_PARAM_UNUSED ) {} -void fd_ext_bank_release_thunks( void * load_and_execute_output FD_PARAM_UNUSED ) {} -void fd_ext_bank_release_pre_balance_info( void * pre_balance_info FD_PARAM_UNUSED ) {} - -void fd_ext_bank_commit_txns( void const * bank FD_PARAM_UNUSED, void const * txns FD_PARAM_UNUSED, ulong txn_cnt FD_PARAM_UNUSED, void * load_and_execute_output FD_PARAM_UNUSED, void * pre_balance_info FD_PARAM_UNUSED ) {} -void fd_ext_poh_signal_leader_change( void * sender FD_PARAM_UNUSED ) {} -void fd_ext_poh_register_tick( void const * bank FD_PARAM_UNUSED, uchar const * hash FD_PARAM_UNUSED ) {} - -int -fd_ext_blockstore_insert_shreds( void const * blockstore FD_PARAM_UNUSED, - ulong shred_cnt FD_PARAM_UNUSED, - uchar const * shred_bytes FD_PARAM_UNUSED, - ulong shred_sz FD_PARAM_UNUSED, - ulong stride FD_PARAM_UNUSED ) { return 0; } - -int -fd_ext_bank_sanitized_txn_load_addresess( void const * bank FD_PARAM_UNUSED, - void * address_table_lookups FD_PARAM_UNUSED, - ulong address_table_lookups_cnt FD_PARAM_UNUSED, - void * out_sidecar FD_PARAM_UNUSED ) { return 0; } - -void -fd_ext_blockstore_create_block0( char const * ledger_path FD_PARAM_UNUSED, - ulong shred_cnt FD_PARAM_UNUSED, - uchar const * shred_bytes FD_PARAM_UNUSED, - ulong shred_sz FD_PARAM_UNUSED, - ulong stride FD_PARAM_UNUSED ) {} -