From 2f4cff320f706c45a9afc3977ea68fc69c8e5069 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 23 May 2024 15:05:37 -0300 Subject: [PATCH] fix: Do not use kernel constants for computing tx fee (#6635) We were using the `CombinedConstantData` from the kernel public inputs for getting the block fees and computing the txFee. However, the `globals.gasFees` in the `CombinedConstantData` that come from a `PrivateKernelTail` are empty, so we were always computing a zero fee for txs without a public component. This PR changes it so we always have to inject the block gas fees to compute the actual tx fee. --- This hints at another problem we may have: we have fields in our circuits structs that are sometimes safe to use, and sometimes not. Should we rethink our structs so we don't accidentally run into this situation again? Another example that comes to mind is the `transaction_fee` field which is only set during teardown. --- aztec/src/context/private_context.nr | 1 + 1 file changed, 1 insertion(+) diff --git a/aztec/src/context/private_context.nr b/aztec/src/context/private_context.nr index 0d4eda18..44951143 100644 --- a/aztec/src/context/private_context.nr +++ b/aztec/src/context/private_context.nr @@ -186,6 +186,7 @@ impl PrivateContext { } pub fn set_as_fee_payer(&mut self) { + dep::protocol_types::debug_log::debug_log_format("Setting {0} as fee payer", [self.this_address().to_field()]); self.is_fee_payer = true; }