-
Notifications
You must be signed in to change notification settings - Fork 86
feat: remove caching from getTransactionCount with block tag = latest #4398
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
feat: remove caching from getTransactionCount with block tag = latest #4398
Conversation
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
return await this.getAccountNonceForHistoricBlock(address, blockNumOrTag, requestDetails); | ||
} | ||
|
||
const cacheTtl = |
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.
@natanasow shouldnt we keep the cache for the earliest block and specific block numbers?
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.
They are cached on an upper level here https://github.com/hiero-ledger/hiero-json-rpc-relay/blob/main/packages/relay/src/lib/eth.ts#L928.
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.
great, thanks
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## feat/transaction-pool #4398 +/- ##
=========================================================
- Coverage 96.10% 96.10% -0.01%
=========================================================
Files 121 121
Lines 19940 19920 -20
Branches 1755 1748 -7
=========================================================
- Hits 19164 19144 -20
Misses 751 751
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…#4398) Signed-off-by: nikolay <[email protected]>
Description
Currently, we cache getTransactionCount("latest") with ttl 500ms, however, we may still return an old value that is not relevant, if e.g we cache the getTransactionCount("latest") for 500ms, but after 300ms a new block is mined, the value needs to be updated, but we will still return the older value.
Motivation
Avoid returning an old value on request to
eth_getTransctionCount
with block tag = latestRelated issue(s)
Fixes #4389
Testing Guide
Changes from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist