-
Notifications
You must be signed in to change notification settings - Fork 324
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
[blockdao] Optimize derialization when retrieving receipts #4221
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4221 +/- ##
==========================================
+ Coverage 75.38% 76.73% +1.35%
==========================================
Files 303 340 +37
Lines 25923 29293 +3370
==========================================
+ Hits 19541 22478 +2937
- Misses 5360 5710 +350
- Partials 1022 1105 +83 ☔ View full report in Codecov by Sentry. |
// // verify merkle root can match after deserialize | ||
// if err := blk.VerifyTxRoot(); err != nil { | ||
// return nil, err | ||
// } |
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.
uncomment this?
this is not the bottleneck for now, also it how has a cache for blocks now
@@ -172,21 +171,71 @@ func (fd *fileDAOv2) highestBlockOfStoreTip() uint64 { | |||
return fd.header.Start + fd.blkStore.Size()*fd.header.BlockStoreSize - 1 | |||
} | |||
|
|||
func (fd *fileDAOv2) getBlockStore(height uint64) (*block.Store, error) { | |||
func (fd *fileDAOv2) getBlock(height uint64) (*block.Block, error) { |
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.
adding block/receipt cache is good idea to improve read performance
can keep getBlockStore()
to get even better performance
can you incorporate the changes under /filedao
in f1bc955 into this PR?
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.
check the top commit of origin/v2dao
branch
Quality Gate failedFailed conditions |
Description
getTransactionReceipt
is monitored to consume lots of cpu resources when serving for web3 requests.Block and Receipt are deserialized and cached separtedly to reduce duplicate computing
Fixes #(issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: