Skip to content

Conversation

@alarso16
Copy link
Contributor

@alarso16 alarso16 commented Jan 6, 2026

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

@alarso16 alarso16 self-assigned this Jan 6, 2026
@alarso16 alarso16 added cleanup Code quality improvement evm Related to EVM functionality coreth Related to the former coreth standalone repository subnet-evm Related to the former subnet-evm standalone repository labels Jan 6, 2026
@alarso16 alarso16 marked this pull request as ready for review January 6, 2026 16:01
@alarso16 alarso16 requested a review from a team as a code owner January 6, 2026 16:01
Copilot AI review requested due to automatic review settings January 6, 2026 16:01
Copy link
Contributor

Copilot AI left a 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 (ChainDataDirDatabasePath, CleanCacheSizeCacheSizeBytes, RevisionsRevisionsInMemory, ReadCacheStrategyCacheStrategy, ArchiveModeArchive)
  • Replaced the Defaults variable with a DefaultConfig(dir string) constructor function
  • Exported the internal fwDisk field as Firewood to 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.

@alarso16 alarso16 changed the title refactor: Config helper refactor: Firewood Config helper Jan 6, 2026
@alarso16 alarso16 requested a review from maru-ava January 6, 2026 20:46
@maru-ava maru-ava added this pull request to the merge queue Jan 6, 2026
Merged via the queue into master with commit 5c851e8 Jan 6, 2026
56 checks passed
@maru-ava maru-ava deleted the alarso16/firewood-init branch January 6, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code quality improvement coreth Related to the former coreth standalone repository evm Related to EVM functionality subnet-evm Related to the former subnet-evm standalone repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants