Skip to content

Conversation

@holiman
Copy link
Contributor

@holiman holiman commented Mar 21, 2019

This PR is a more advanced form of the dirty-to-clean cacher (#18995), where we reuse previous database write batches as datasets to uncache, saving a dirty-trie-iteration and a dirty-trie-rlp-reencoding per block.

@holiman holiman requested a review from karalabe as a code owner March 21, 2019 09:18
@karalabe karalabe changed the title Poc core, ethdb, trie: mode dirty data to clean cache on flush Mar 25, 2019
@karalabe karalabe added this to the 1.9.0 milestone Mar 25, 2019
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

trie/database.go Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is a cluster-f*ck. That said, the trie database write access is serialized by the blockchain importer, since we can't import two blocks concurrently. The only thing this code needs to ensure is that API CALL operations, sync state retrievals, etc don't mess up. The blockchain guarantees that no write will intervene here.

@holiman holiman requested a review from zsfelfoldi as a code owner March 25, 2019 12:02
Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

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

As per our long discussion on Discord, please remove read locking from Commit and Cap. Please also document that Commit and Cap are not safe for concurrent use.

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.

3 participants