-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
core/rawdb: add HasCode, HasTrieNode and use them where possible #24454
Conversation
return data | ||
} | ||
|
||
// HasCode checks if the contract code corresponding to the | ||
// provided code hash is present in the db. | ||
func HasCode(db ethdb.KeyValueReader, hash common.Hash) bool { |
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.
Can you move this function after ReadCodeWithPrefix
?
We have this order for db APIs read, has, write, delete
. Would be nice to keep this order.
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.
done! also reordered other functions.
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.
One nitpick, otherwise LGTM!
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
I believe the failing test is unrelated to those changes. Run the failing test ( |
Damn, typo in commit message. |
This PR does following:
1- Adds
HasCode
and replace it withReadCode
wherever possible.2- Changes
ReadTrieNode
functions withHasTrieNode
, in main and pruner packages.The reference commit:
893502e