-
Notifications
You must be signed in to change notification settings - Fork 80
feat: improves eth_getCode caching #3698
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Simeon Nakov <[email protected]>
Test Results 23 files - 1 271 suites - 59 37m 7s ⏱️ - 10m 15s For more details on these failures, see this check. Results for commit 2a05e8f. ± Comparison against base commit 4fa65dc. This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
// First call with 'latest' should make network calls | ||
await ethImpl.getCode(CONTRACT_ADDRESS_1, 'latest', requestDetails); | ||
const afterFirstGetCount = restMock.history.get.length; | ||
expect(afterFirstGetCount).to.be.greaterThan(initialGetCount); |
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.
@simzzz Can we make this test slightly more specific. e.g instead of checking if its greater than we may expect an exact count, or maybe just check if the cache service is not called at all.
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.
I made an improvement that I think makes it more clear now. You can take a look @konstantinabl
Signed-off-by: Simeon Nakov <[email protected]>
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.
LGTM
Description:
This PR improves the caching for
eth_getCode
by caching even with prohibited opcodes, and removing caching for blockNumber === latestRelated issue(s):
Fixes #3634
Checklist