Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mechanism for benchmarking EVM queries #1530

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Add mechanism for benchmarking EVM queries #1530

merged 2 commits into from
Apr 11, 2024

Conversation

codchen
Copy link
Collaborator

@codchen codchen commented Apr 10, 2024

Describe your changes and provide context

Add a new loadtest config post_tx_evm_queries to specify what EVM queries should be benchmarked after the normal EVM transactions are loadtested (since we need load first in order to query), and the number of concurrent queries to send. Right now we support two query types but more can be added:

  • block header & transactions
  • transaction receipt

Testing performed to validate your change

load test cluster

Comment on lines +787 to +794
go func() {
defer func() { wg.Done() }()
height := int64(BlockHeightsWithTxs[i%len(BlockHeightsWithTxs)])
_, err := ethClients[i%len(ethClients)].BlockByNumber(context.Background(), big.NewInt(height))
if err != nil {
fmt.Printf("Failed to get full block of height %d due to %s\n", height, err)
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
Comment on lines +804 to +811
go func() {
defer func() { wg.Done() }()
hash := EvmTxHashes[i%len(EvmTxHashes)]
_, err := ethClients[i%len(ethClients)].TransactionReceipt(context.Background(), hash)
if err != nil {
fmt.Printf("Failed to get receipt of tx %s due to %s\n", hash.Hex(), err)
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.47%. Comparing base (e2440de) to head (5a186f9).
Report is 1 commits behind head on seiv2.

❗ Current head 5a186f9 differs from pull request most recent head a4bd81c. Consider uploading reports for the commit a4bd81c to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            seiv2    #1530      +/-   ##
==========================================
+ Coverage   60.21%   60.47%   +0.26%     
==========================================
  Files         363      365       +2     
  Lines       25797    25836      +39     
==========================================
+ Hits        15533    15624      +91     
+ Misses       9277     9222      -55     
- Partials      987      990       +3     

see 11 files with indirect coverage changes

@codchen codchen force-pushed the query-loadtest branch 3 times, most recently from 2921a04 to 5a186f9 Compare April 10, 2024 13:28
@codchen codchen merged commit e504a25 into seiv2 Apr 11, 2024
44 checks passed
@codchen codchen deleted the query-loadtest branch April 11, 2024 03:24
udpatil pushed a commit that referenced this pull request Apr 17, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
udpatil pushed a commit that referenced this pull request Apr 17, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
udpatil pushed a commit that referenced this pull request Apr 17, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
udpatil pushed a commit that referenced this pull request Apr 18, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
udpatil pushed a commit that referenced this pull request Apr 19, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
udpatil pushed a commit that referenced this pull request Apr 19, 2024
* Add mechanism for benchmarking EVM queries

* allow ticks to be specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants