diff --git a/src/flamenco/runtime/program/fd_zk_elgamal_proof_program.c b/src/flamenco/runtime/program/fd_zk_elgamal_proof_program.c index 8adb65aebf..6a559e1661 100644 --- a/src/flamenco/runtime/program/fd_zk_elgamal_proof_program.c +++ b/src/flamenco/runtime/program/fd_zk_elgamal_proof_program.c @@ -9,6 +9,11 @@ int fd_executor_zk_elgamal_proof_program_execute( fd_exec_instr_ctx_t * ctx ) { + /* Feature-gate program activation */ + if( FD_UNLIKELY( !FD_FEATURE_ACTIVE( ctx->slot_ctx, zk_elgamal_proof_program_enabled ) ) ) { + return FD_EXECUTOR_INSTR_ERR_UNSUPPORTED_PROGRAM_ID; + } + uchar const * instr_data = ctx->instr->data; ulong instr_data_sz = ctx->instr->data_sz; diff --git a/src/flamenco/runtime/program/zksdk/fd_zksdk.c b/src/flamenco/runtime/program/zksdk/fd_zksdk.c index 0e9088b63a..de58a4a756 100644 --- a/src/flamenco/runtime/program/zksdk/fd_zksdk.c +++ b/src/flamenco/runtime/program/zksdk/fd_zksdk.c @@ -161,6 +161,11 @@ fd_zksdk_process_verify_proof( fd_exec_instr_ctx_t * ctx ) { if( ctx->instr->data_sz == 5UL ) { /* Case 1. Proof data from account data. */ + /* https://github.com/anza-xyz/agave/blob/v2.1.7/programs/zk-token-proof/src/lib.rs#L54-L59 */ + if( FD_UNLIKELY( !FD_FEATURE_ACTIVE( ctx->slot_ctx, enable_zk_proof_from_account ) ) ) { + return FD_EXECUTOR_INSTR_ERR_INVALID_INSTR_DATA; + } + /* https://github.com/anza-xyz/agave/blob/v2.0.1/programs/zk-elgamal-proof/src/lib.rs#L46-L47 */ FD_BORROWED_ACCOUNT_DECL( proof_data_acc ); FD_BORROWED_ACCOUNT_TRY_BORROW_IDX( ctx, 0UL, proof_data_acc ) {