Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant committed Feb 4, 2025
1 parent e1e99c4 commit fd5e009
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ void AvmTraceBuilder::pay_fee()
FF current_balance = read_hint.leaf_preimage.value;

const auto updated_balance = current_balance - tx_fee;
if (current_balance < tx_fee) {
// Comparison on Field gives inverted results, so we cast to uint128, which should be enough for fees.
if (static_cast<uint128_t>(current_balance) < static_cast<uint128_t>(tx_fee)) {
info("Not enough balance for fee payer to pay for transaction (got ", current_balance, " needs ", tx_fee);
throw std::runtime_error("Not enough balance for fee payer to pay for transaction");
}
Expand Down

0 comments on commit fd5e009

Please sign in to comment.