fix: added batch call + delete useless on-chain call#75
Merged
hzhu merged 3 commits into0xProject:mainfrom Mar 21, 2025
Merged
Conversation
hzhu
requested changes
Feb 11, 2025
Member
hzhu
left a comment
There was a problem hiding this comment.
PR looks good! Just a couple of tweaks before merging:
- This seems more suited for a patch release rather than a minor. Could you update the commit message to
fix: added batch call + delete unused on-chain call? - Also, could you remove
.idea?
46376a7 to
83a57c0
Compare
Member
|
@lucaspluchon I noticed that some tests are failing:
I'll look into these when I have time, but do you know why they’re failing? I should add testing instructions to the README, but for now, you can add an Alchemy API key (with debug_trace support) and run npm test. If you’re unable to, I can do it when I have time. Thanks again for the PR! |
Member
|
This PR is good. It's failing for a different reason: #81 |
hzhu
approved these changes
Mar 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve efficiency and reliability 🏎️
Replaced
await publicClient.getChainId()with direct access topublicClient.chain.idfor a synchronous, faster retrieval of the current chain ID.Batched network requests for
traceCall,getTransaction, andgetTransactionReceiptusingPromise.allto reduce latency and improve performance. This avoids an unnecessary async call to fetch chain ID when the value is already available. Running all RPC calls in parallel speeds upparseSwap, especially under high-load or latency-sensitive conditions.