-
Notifications
You must be signed in to change notification settings - Fork 842
refactor: Firewood Config helper #4811
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
Conversation
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.
Pull request overview
This refactoring improves the Firewood configuration helper by renaming fields for better clarity and introducing a DefaultConfig constructor function. The changes simplify configuration setup across test and production code by providing a single function to create default configurations with a specified directory path.
Key changes:
- Renamed configuration fields (
ChainDataDir→DatabasePath,CleanCacheSize→CacheSizeBytes,Revisions→RevisionsInMemory,ReadCacheStrategy→CacheStrategy,ArchiveMode→Archive) - Replaced the
Defaultsvariable with aDefaultConfig(dir string)constructor function - Exported the internal
fwDiskfield asFirewoodto allow read access to the underlying database
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| graft/evm/firewood/triedb.go | Refactored Config struct with clearer field names, added DefaultConfig constructor, and exported Firewood database field |
| graft/subnet-evm/core/blockchain.go | Updated to use renamed Config fields and inline default value for FreeListCacheEntries |
| graft/coreth/core/blockchain.go | Updated to use renamed Config fields and inline default value for FreeListCacheEntries |
| graft/subnet-evm/tests/state_test_util.go | Simplified configuration by using new DefaultConfig constructor |
| graft/coreth/tests/state_test_util.go | Simplified configuration by using new DefaultConfig constructor |
| graft/subnet-evm/core/genesis_test.go | Simplified test configuration by using new DefaultConfig constructor |
| graft/coreth/core/genesis_test.go | Simplified test configuration by using new DefaultConfig constructor |
| graft/evm/firewood/hash_test.go | Simplified test configuration by using new DefaultConfig constructor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why this should be merged
This is a small diff pulled out of #4697 to support state sync test for Firewood.
How this works
Renames some fields for clarity, provides a simpler construction method, and exports the underlying database
How this was tested
Existing UT
Need to be documented in RELEASES.md?
No