Skip to content
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

Merged
merged 3 commits into from
Mar 8, 2022

Conversation

ceyonur
Copy link
Contributor

@ceyonur ceyonur commented Feb 22, 2022

This PR does following:
1- Adds HasCode and replace it with ReadCode wherever possible.
2- Changes ReadTrieNode functions with HasTrieNode, in main and pruner packages.

The reference commit:
893502e

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 {
Copy link
Member

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.

Copy link
Contributor Author

@ceyonur ceyonur Feb 23, 2022

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.

Copy link
Member

@rjl493456442 rjl493456442 left a 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!

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ceyonur
Copy link
Contributor Author

ceyonur commented Feb 24, 2022

I believe the failing test is unrelated to those changes. Run the failing test (TestTransactionPoolUnderpricingDynamicFee) on my local and saw no issue.

@fjl fjl added this to the 1.10.17 milestone Mar 8, 2022
@fjl fjl changed the title Use hastrienode core/rawdb: add HasCode, HashTrieNode and use them where possible Mar 8, 2022
@fjl fjl merged commit 8401e42 into ethereum:master Mar 8, 2022
@fjl fjl changed the title core/rawdb: add HasCode, HashTrieNode and use them where possible core/rawdb: add HasCode, HasTrieNode and use them where possible Mar 8, 2022
@fjl
Copy link
Contributor

fjl commented Mar 8, 2022

Damn, typo in commit message.

sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Mar 9, 2022
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
@ceyonur ceyonur deleted the use-hastrienode branch August 2, 2022 16:05
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Sep 30, 2022
cp-wjhan pushed a commit to cp-yoonjin/go-wemix that referenced this pull request Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants