Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ impl PublicKernelTeardownCircuitPrivateInputs {
let transaction_fee = self.public_call.call_stack_item.public_inputs.transaction_fee;
// Note that teardown_gas is already included in end.gas_used as it was injected by the private kernel
let total_gas_used = self.previous_kernel.public_inputs.end.gas_used.add(self.previous_kernel.public_inputs.end_non_revertible.gas_used);
// TODO(palla/gas): Load gas fees from a PublicConstantData struct that's currently missing
let block_gas_fees = GasFees::default();
let block_gas_fees = self.previous_kernel.public_inputs.constants.historical_header.global_variables.gas_fees;
let inclusion_fee = self.previous_kernel.public_inputs.constants.tx_context.gas_settings.inclusion_fee;
let computed_transaction_fee = total_gas_used.compute_fee(block_gas_fees) + inclusion_fee;

Expand Down
1 change: 1 addition & 0 deletions yarn-project/simulator/src/public/public_processor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ describe('public_processor', () => {
);

const header = Header.empty();
header.globalVariables.gasFees = GasFees.default();
const stateReference = new StateReference(
header.state.l1ToL2MessageTree,
new PartialStateReference(header.state.partial.noteHashTree, header.state.partial.nullifierTree, snap),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class TeardownPhaseManager extends AbstractPhaseManager {

protected override getTransactionFee(tx: Tx, previousPublicKernelOutput: PublicKernelCircuitPublicInputs): Fr {
const gasSettings = tx.data.constants.txContext.gasSettings;
const gasFees = this.globalVariables.gasFees;
const gasFees = this.historicalHeader.globalVariables.gasFees;
// No need to add teardown limits since they are already included in end.gasUsed
const gasUsed = previousPublicKernelOutput.end.gasUsed.add(previousPublicKernelOutput.endNonRevertibleData.gasUsed);
const txFee = gasSettings.inclusionFee.add(gasUsed.computeFee(gasFees));
Expand Down