Skip to content

Commit

Permalink
cr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
timwu20 committed Jan 6, 2025
1 parent 819a5c9 commit 6025583
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/client/db/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func (rts *refTrackingState[H, Hasher]) Drop() {
}
}

// Database settings.
type DatabaseSettings struct {
// Database configuration.
type DatabaseConfig struct {
// The maximum trie cache size in bytes.
//
// If nil is given, the cache is disabled.
Expand Down Expand Up @@ -391,15 +391,16 @@ type Backend[

// Create a new instance of database backend.
//
// The pruning window is how old a block must be before the state is pruned.
// dbConfig is of type [DatabaseConfig] and contains both state and block history pruning settings.
// canonicalizationDelay represents the number of blocks it waits to canonicalize the block and initiate pruning based on canonicalization.
func NewBackend[
H runtime.Hash,
N runtime.Number,
E runtime.Extrinsic,
Hasher runtime.Hasher[H],
Header runtime.Header[N, H],
](
dbConfig DatabaseSettings,
dbConfig DatabaseConfig,
canonicalizationDelay uint64,
) (*Backend[H, Hasher, N, E, Header], error) {
var (
Expand Down Expand Up @@ -434,7 +435,7 @@ func newBackendFromDatabase[
](
db database.Database[hash.H256],
canonicalizationDelay uint64,
config DatabaseSettings,
config DatabaseConfig,
shouldInit bool,
) (*Backend[H, Hasher, N, E, Header], error) {
var dbInitTransaction database.Transaction[hash.H256]
Expand Down

0 comments on commit 6025583

Please sign in to comment.