Added cache.blocklogs (FilterLogCacheSize) flag (#1083)

* added cache.blocklogs (FilterLogCacheSize) flag

* updated docs

* minor fix

Co-authored-by: Mael Regnery <mael@mqli.fr>

---------

Co-authored-by: Mael Regnery <mael@mqli.fr>
This commit is contained in:
Pratik Patil 2023-11-20 10:18:11 +05:30 committed by GitHub
parent d345879437
commit 923c192c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 39 additions and 16 deletions

View file

@ -155,6 +155,7 @@ syncmode = "full"
# preimages = false
# txlookuplimit = 2350000
# triesinmemory = 128
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -160,6 +160,7 @@ devfakeauthor = false # Run miner without validator set authorization
preimages = false # Enable recording the SHA3/keccak preimages of trie keys
txlookuplimit = 2350000 # Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)
triesinmemory = 128 # Number of block states (tries) to keep in memory
blocklogs = 32 # Size (in number of blocks) of the log cache for filtering
timeout = "1h0m0s" # Time after which the Merkle Patricia Trie is stored to disc from memory
fdlimit = 0 # Raise the open file descriptor resource limit (default = system fd limit)

View file

@ -104,6 +104,8 @@ The ```bor server``` command runs the Bor client.
- ```cache```: Megabytes of memory allocated to internal caching (default: 1024)
- ```cache.blocklogs```: Size (in number of blocks) of the log cache for filtering (default: 32)
- ```cache.database```: Percentage of cache memory allowance to use for database io (default: 50)
- ```cache.gc```: Percentage of cache memory allowance to use for trie pruning (default: 25)
@ -116,10 +118,6 @@ The ```bor server``` command runs the Bor client.
- ```cache.trie```: Percentage of cache memory allowance to use for trie caching (default: 15)
- ```cache.trie.journal```: Disk journal directory for trie cache to survive node restarts (default: triecache)
- ```cache.trie.rejournal```: Time interval to regenerate the trie cache journal (default: 1h0m0s)
- ```cache.triesinmemory```: Number of block states (tries) to keep in memory (default: 128)
- ```fdlimit```: Raise the open file descriptor resource limit (default = system fd limit) (default: 0)
@ -182,7 +180,7 @@ The ```bor server``` command runs the Bor client.
- ```rpc.gascap```: Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite) (default: 50000000)
- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 5)
- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 1)
- ```ws```: Enable the WS-RPC server (default: false)
@ -234,6 +232,8 @@ The ```bor server``` command runs the Bor client.
- ```txarrivalwait```: Maximum duration to wait for a transaction before explicitly requesting it (default: 500ms)
- ```v4disc```: Enables the V4 discovery mechanism (default: true)
- ```v5disc```: Enables the experimental RLPx V5 (Topic Discovery) mechanism (default: false)
### Sealer Options

View file

@ -540,6 +540,10 @@ type CacheConfig struct {
// Number of block states to keep in memory (default = 128)
TriesInMemory uint64 `hcl:"triesinmemory,optional" toml:"triesinmemory,optional"`
// This is the number of blocks for which logs will be cached in the filter system.
FilterLogCacheSize int `hcl:"blocklogs,optional" toml:"blocklogs,optional"`
// Time after which the Merkle Patricia Trie is stored to disc from memory
TrieTimeout time.Duration `hcl:"-,optional" toml:"-"`
TrieTimeoutRaw string `hcl:"timeout,optional" toml:"timeout,optional"`
@ -734,17 +738,18 @@ func DefaultConfig() *Config {
},
},
Cache: &CacheConfig{
Cache: 1024, // geth's default (suitable for mumbai)
PercDatabase: 50,
PercTrie: 15,
PercGc: 25,
PercSnapshot: 10,
NoPrefetch: false,
Preimages: false,
TxLookupLimit: 2350000,
TriesInMemory: 128,
TrieTimeout: 60 * time.Minute,
FDLimit: 0,
Cache: 1024, // geth's default (suitable for mumbai)
PercDatabase: 50,
PercTrie: 15,
PercGc: 25,
PercSnapshot: 10,
NoPrefetch: false,
Preimages: false,
TxLookupLimit: 2350000,
TriesInMemory: 128,
FilterLogCacheSize: ethconfig.Defaults.FilterLogCacheSize,
TrieTimeout: 60 * time.Minute,
FDLimit: 0,
},
ExtraDB: &ExtraDBConfig{
// These are LevelDB defaults, specifying here for clarity in code and in logging.
@ -1108,6 +1113,7 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
n.TxLookupLimit = c.Cache.TxLookupLimit
n.TrieTimeout = c.Cache.TrieTimeout
n.TriesInMemory = c.Cache.TriesInMemory
n.FilterLogCacheSize = c.Cache.FilterLogCacheSize
}
// LevelDB

View file

@ -424,6 +424,13 @@ func (c *Command) Flags(config *Config) *flagset.Flagset {
Default: c.cliConfig.Cache.TriesInMemory,
Group: "Cache",
})
f.IntFlag(&flagset.IntFlag{
Name: "cache.blocklogs",
Usage: "Size (in number of blocks) of the log cache for filtering",
Value: &c.cliConfig.Cache.FilterLogCacheSize,
Default: c.cliConfig.Cache.FilterLogCacheSize,
Group: "Cache",
})
f.Uint64Flag(&flagset.Uint64Flag{
Name: "txlookuplimit",
Usage: "Number of recent blocks to maintain transactions index for",

View file

@ -148,6 +148,7 @@ gcmode = "archive"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -148,6 +148,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -150,6 +150,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -150,6 +150,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -148,6 +148,7 @@ gcmode = "archive"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -148,6 +148,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -150,6 +150,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0

View file

@ -150,6 +150,7 @@ syncmode = "full"
# noprefetch = false
# preimages = false
# txlookuplimit = 2350000
# blocklogs = 32
# timeout = "1h0m0s"
# fdlimit = 0