diff --git a/Makefile b/Makefile index c35ec4a9..f7cfe0b6 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ APPNAME = "Solana" # Application version APPVERSION_M = 1 APPVERSION_N = 5 -APPVERSION_P = 2 +APPVERSION_P = 3 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" # Application source files diff --git a/libsol/compute_budget_instruction.c b/libsol/compute_budget_instruction.c index 64695ad0..95eb4f5e 100644 --- a/libsol/compute_budget_instruction.c +++ b/libsol/compute_budget_instruction.c @@ -57,7 +57,8 @@ static uint32_t calculate_max_fee(const ComputeBudgetFeeInfo* info) { max_compute = MIN(info->instructions_count * MAX_CU_PER_INSTRUCTION, MAX_CU_PER_TRANSACTION); } - return max_fee + (info->change_unit_price->units * max_compute); + return max_fee + + ((info->change_unit_price->units * max_compute) / MICRO_LAMPORT_MULTIPLIER); } return max_fee; } diff --git a/libsol/compute_budget_instruction.h b/libsol/compute_budget_instruction.h index c68f3e67..0eadaa68 100644 --- a/libsol/compute_budget_instruction.h +++ b/libsol/compute_budget_instruction.h @@ -9,6 +9,7 @@ #define MAX_CU_PER_INSTRUCTION 200000 #define MAX_CU_PER_TRANSACTION 1400000 #define FEE_LAMPORTS_PER_SIGNATURE 5000 +#define MICRO_LAMPORT_MULTIPLIER 1000000 extern const Pubkey compute_budget_program_id;