Skip to content

Comments

performance: track large tx execution cost#3077

Merged
zzzckck merged 2 commits intobnb-chain:developfrom
zzzckck:track_large_tx_perf
May 12, 2025
Merged

performance: track large tx execution cost#3077
zzzckck merged 2 commits intobnb-chain:developfrom
zzzckck:track_large_tx_perf

Conversation

@zzzckck
Copy link
Collaborator

@zzzckck zzzckck commented May 9, 2025

Description

Large tx could be one of the performance bottleneck, add log to track txs with GasUsed > 10M
log will be like:

t=2025-05-12T00:50:47+0000 lvl=info msg="LargeTX execution time" block=49511908 tx=0x47561786e7e5799af82bce56ac49ce6448fe7e24fdc7b185b6ebe3d5f3a11a12 gasUsed=10823496 elapsed=38.719084ms
t=2025-05-12T00:51:17+0000 lvl=info msg="LargeTX execution time" block=49511928 tx=0xa59a28c7be3198184308fc7001f7d0704899be81554fea01b3094b16bbac83b3 gasUsed=11245831 elapsed=45.162283ms
t=2025-05-12T01:00:06+0000 lvl=info msg="LargeTX execution time" block=49512281 tx=0xdabb2a40304787bfce1b61c4235b95734996c25d5d0a1e9a473a09a749e05310 gasUsed=16727624 elapsed=140.572166ms
t=2025-05-12T01:04:35+0000 lvl=info msg="LargeTX execution time" block=49512460 tx=0x8aa1a0a6cd0c785d06871fdba41080112d0563646472f74b579e6bb484ed94f3 gasUsed=11245819 elapsed=34.621168ms
t=2025-05-12T01:18:48+0000 lvl=info msg="LargeTX execution time" block=49513029 tx=0x5de6e8bfb1c3b8016c65a252f38a9eb4e85f7b78dc11e77c84a91d43ba2e456d gasUsed=11245819 elapsed=51.465352ms
t=2025-05-12T01:38:27+0000 lvl=info msg="LargeTX execution time" block=49513814 tx=0xf14d8caea138b9a5ecb1025c74f468e273c92946401820266d8b1cd5d2e72112 gasUsed=10753873 elapsed=1.53180642s

Rationale

NA

Example

NA

Changes

NA

zlacfzy
zlacfzy previously approved these changes May 12, 2025
@zzzckck zzzckck requested a review from Copilot May 12, 2025 03:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds performance tracking for large transactions by logging execution time when gas usage exceeds a 10M threshold.

  • Introduces a timing measurement in ApplyTransactionWithEVM for transactions with high gas.
  • Adds new imports ("time" and "log") required by the logging feature.

@zzzckck zzzckck merged commit 24bfb45 into bnb-chain:develop May 12, 2025
7 checks passed
@zzzckck zzzckck deleted the track_large_tx_perf branch May 14, 2025 06:10
galaio pushed a commit to galaio/bsc that referenced this pull request May 29, 2025
galaio pushed a commit to galaio/bsc that referenced this pull request May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants