Skip to content

Commit

Permalink
feat(api): Log info about estimated fee (#1611)
Browse files Browse the repository at this point in the history
## What ❔

Logs some info about estimated fee in API

## Why ❔

To be able to check how some transactions are estimated

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
perekopskiy committed Apr 8, 2024
1 parent 77dad64 commit daed58c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/lib/zksync_core/src/api_server/tx_sender/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,14 @@ impl TxSender {
}
};

tracing::info!(
initiator = ?tx.initiator_account(),
nonce = %tx.nonce().unwrap_or(Nonce(0)),
"fee estimation: gas for pubdata: {}, tx body gas: {tx_body_gas_limit}, overhead gas: {overhead} \
(with params base_fee: {base_fee}, gas_per_pubdata_byte: {gas_per_pubdata_byte})",
(tx_metrics.pubdata_published as u64) * gas_per_pubdata_byte,
);

Ok(Fee {
max_fee_per_gas: base_fee.into(),
max_priority_fee_per_gas: 0u32.into(),
Expand Down

0 comments on commit daed58c

Please sign in to comment.