-
Notifications
You must be signed in to change notification settings - Fork 204
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
Optimized trie re-creation for VM Queries, adjust some logs #5977
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rc/v1.6.next1 #5977 +/- ##
=================================================
+ Coverage 80.17% 80.21% +0.03%
=================================================
Files 708 708
Lines 94129 94139 +10
=================================================
+ Hits 75469 75511 +42
+ Misses 13313 13281 -32
Partials 5347 5347 ☔ View full report in Codecov by Sentry. |
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.
maybe retarget towards master or a new rc/v1.6.next2 as the .next1 is ready to be shipped.
@@ -179,8 +181,7 @@ func (service *SCQueryService) shouldAllowQueriesExecution() bool { | |||
} | |||
|
|||
func (service *SCQueryService) executeScCall(query *process.SCQuery, gasPrice uint64) (*vmcommon.VMOutput, common.BlockInfo, error) { | |||
log.Trace("executeScCall", "function", query.FuncName, "numQueries", service.numQueries) | |||
service.numQueries++ | |||
logQueryService.Trace("executeScCall", "address", query.ScAddress, "function", query.FuncName, "blockNonce", query.BlockNonce.Value, "blockHash", query.BlockHash) |
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.
Debate-able if L184 and L197 should be at debug level.
…y-service Fixed recreate trie in sc query service
@@ -193,15 +195,14 @@ func (service *SCQueryService) executeScCall(query *process.SCQuery, gasPrice ui | |||
} | |||
|
|||
if len(blockRootHash) > 0 { | |||
logQueryService.Trace("preparing execution for block and root hash", "block", blockHeader.GetNonce(), "rootHash", blockRootHash) |
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.
the check for nil blockHeader from L243 should also be done before this log
also needed for recreateTrie
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.
Fixed (moved log in recreateTrie
, as well). Could not reproduce this scenario using a localnet. VM queries are not available at genesis, though. Thus, added an extra simple unit test.
state/accountsDBApi.go
Outdated
@@ -175,13 +175,21 @@ func (accountsDB *accountsDBApi) RecreateTrieFromEpoch(options common.RootHashHo | |||
accountsDB.mutRecreatedTrieBlockInfo.Lock() | |||
defer accountsDB.mutRecreatedTrieBlockInfo.Unlock() | |||
|
|||
if options == nil { |
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.
if options == nil { | |
if check.IfNil(options) { |
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.
Applied.
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.
Looks good from my side 👍 , won't approve since I've contributed with code on 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.
Normal allin test: v1.6.15-dev-config-eb2e06c06d -> vm-query-logs-f9bcc00f93
--- Specific errors ---
block hash does not match 3516
wrong nonce in block 1183
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 0
Nr. of all WARNS: 219
Nr. of new ERRORS: 0
Nr. of new WARNS: 8
Nr. of PANICS: 0
/------/
--- ERRORS ---
/------/
--- WARNINGS ---
Reasoning behind the pull request
Proposed changes
recreateTrie
orrecreateTrieFromEpoch
- by @iulianpascalau, in Fixed recreate trie in sc query service #5983Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?