Skip to content

Commit

Permalink
fix: Do not use kernel constants for computing tx fee (#6635)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spalladino authored and AztecBot committed May 24, 2024
1 parent 0d2a0b8 commit 2f4cff3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions aztec/src/context/private_context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2f4cff3

Please sign in to comment.