-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
⚡ Fix: Add slow call to benchmark tests #1110
⚡ Fix: Add slow call to benchmark tests #1110
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @roninjin10 and the rest of your teammates on Graphite |
Warning Rate Limit Exceeded@roninjin10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 53 minutes and 51 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates introduce a benchmark test and a new function aimed at simulating serverless function usage with significant storage requirements. The benchmark test ( Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- test/bench/src/slowCallRepo/slowCallRepo.bench.ts (1 hunks)
- test/bench/src/slowCallRepo/slowCallRepo.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- test/bench/src/slowCallRepo/slowCallRepo.bench.ts
Additional comments not posted (3)
test/bench/src/slowCallRepo/slowCallRepo.ts (3)
1-2
: Ensure that the imported modules are used appropriately.
6-19
: Review the asynchronous functionslowCallRepo
for best practices in error handling and performance.
4-4
: Validate the usage of therpcUrl
constant to ensure it aligns with the intended environments.Verification successful
The search results indicate that the
rpcUrl
constant and thegetAlchemyUrl
function are used consistently across various files and environments. TherpcUrl
is primarily used to set up clients and forks, and thegetAlchemyUrl
function is imported from@tevm/test-utils
and used to generate URLs for different environments.The usage of
rpcUrl
in the filetest/bench/src/slowCallRepo/slowCallRepo.ts
aligns with the intended environments, as it follows the same pattern observed in other files.
test/bench/src/slowCallRepo/slowCallRepo.ts: const rpcUrl = getAlchemyUrl('optimism-sepolia')
This confirms that the
rpcUrl
is being set correctly for theoptimism-sepolia
environment.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `rpcUrl` across different environments. # Test: Search for the usage of `rpcUrl` in different environments. Expect: Consistent usage across environments. rg --type typescript $'getAlchemyUrl'Length of output: 71
Script:
#!/bin/bash # Description: Verify the usage of `rpcUrl` across different environments. # Test: Search for the usage of `rpcUrl` in different environments. Expect: Consistent usage across environments. rg --type ts 'rpcUrl' # Test: Search for the usage of `getAlchemyUrl` in different environments. Expect: Consistent usage across environments. rg --type ts 'getAlchemyUrl'Length of output: 33097
const forkClient = createMemoryClient({ | ||
fork: { url: rpcUrl }, | ||
}) | ||
|
||
await forkClient.tevmReady() | ||
|
||
const result = await forkClient.tevmCall({ | ||
from: '0xef987cde72bc6a9e351d2460214d75f095b1b862', | ||
data: '0x608060405234801561001057600080fd5b5060405161012938038061012983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60cb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806301339c211460375780638c59507c14603f575b600080fd5b603d6059565b005b604760005481565b60405190815260200160405180910390f35b7f7c84ba1c5769a0155145414f13e03f1d0d6a3a7e5d4f6d45262df4d9d48c32cd600054604051608b91815260200190565b60405180910390a156fea26469706673582212201509e5f7aed59985fb32c8f48b792565644fc6decb12b235b12226ae2855c4f464736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000000a', | ||
skipBalance: true, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling for the asynchronous operations within slowCallRepo
.
- const forkClient = createMemoryClient({
- fork: { url: rpcUrl },
- })
- await forkClient.tevmReady()
- const result = await forkClient.tevmCall({
- from: '0xef987cde72bc6a9e351d2460214d75f095b1b862',
- data: '0x608060405234801561001057600080fd5b5060405161012938038061012983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60cb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806301339c211460375780638c59507c14603f575b600080fd5b603d6059565b005b604760005481565b60405190815260200160405180910390f35b7f7c84ba1c5769a0155145414f13e03f1d0d6a3a7e5d4f6d45262df4d9d48c32cd600054604051608b91815260200190565b60405180910390a156fea26469706673582212201509e5f7aed59985fb32c8f48b792565644fc6decb12b235b12226ae2855c4f464736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000000a',
- skipBalance: true,
- })
+ try {
+ const forkClient = createMemoryClient({
+ fork: { url: rpcUrl },
+ })
+ await forkClient.tevmReady()
+ const result = await forkClient.tevmCall({
+ from: '0xef987cde72bc6a9e351d2460214d75f095b1b862',
+ data: '0x608060405234801561001057600080fd5b5060405161012938038061012983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60cb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806301339c211460375780638c59507c14603f575b600080fd5b603d6059565b005b604760005481565b60405190815260200160405180910390f35b7f7c84ba1c5769a0155145414f13e03f1d0d6a3a7e5d4f6d45262df4d9d48c32cd600054604051608b91815260200190565b60405180910390a156fea26469706673582212201509e5f7aed59985fb32c8f48b792565644fc6decb12b235b12226ae2855c4f464736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000000a',
+ skipBalance: true,
+ })
+ } catch (error) {
+ console.error('Error during TEVM call:', error)
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
const forkClient = createMemoryClient({ | |
fork: { url: rpcUrl }, | |
}) | |
await forkClient.tevmReady() | |
const result = await forkClient.tevmCall({ | |
from: '0xef987cde72bc6a9e351d2460214d75f095b1b862', | |
data: '0x608060405234801561001057600080fd5b5060405161012938038061012983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60cb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806301339c211460375780638c59507c14603f575b600080fd5b603d6059565b005b604760005481565b60405190815260200160405180910390f35b7f7c84ba1c5769a0155145414f13e03f1d0d6a3a7e5d4f6d45262df4d9d48c32cd600054604051608b91815260200190565b60405180910390a156fea26469706673582212201509e5f7aed59985fb32c8f48b792565644fc6decb12b235b12226ae2855c4f464736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000000a', | |
skipBalance: true, | |
}) | |
const forkClient = createMemoryClient({ | |
fork: { url: rpcUrl }, | |
}) | |
try { | |
await forkClient.tevmReady() | |
const result = await forkClient.tevmCall({ | |
from: '0xef987cde72bc6a9e351d2460214d75f095b1b862', | |
data: '0x608060405234801561001057600080fd5b5060405161012938038061012983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60cb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806301339c211460375780638c59507c14603f575b600080fd5b603d6059565b005b604760005481565b60405190815260200160405180910390f35b7f7c84ba1c5769a0155145414f13e03f1d0d6a3a7e5d4f6d45262df4d9d48c32cd600054604051608b91815260200190565b60405180910390a156fea26469706673582212201509e5f7aed59985fb32c8f48b792565644fc6decb12b235b12226ae2855c4f464736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000000a', | |
skipBalance: true, | |
}) | |
} catch (error) { | |
console.error('Error during TEVM call:', error) | |
} |
d4a0bb1
to
b15d76d
Compare
Description
Concise description of proposed changes
Testing
Explain the quality checks that have been done on the code changes
Additional Information
Your ENS/address:
Summary by CodeRabbit