mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-17 15:50:57 +00:00
1452e7b1c0
* Update config for Ledger and CoreDb why: Prepare for tracer which depends on the API jump table (as well as the profiler.) The API jump table is now enabled in unit/integration test mode piggybacking on the `unittest2DisableParamFiltering` compiler flag or on an extra compiler flag `dbjapi_enabled`. * No deed for error field in `NodeRef` why: Was opnly needed by proof nodes pre-loader which will be re-implemented * Cosmetics
49 lines
1.5 KiB
Nim
49 lines
1.5 KiB
Nim
# Nimbus
|
|
# Copyright (c) 2023-2024 Status Research & Development GmbH
|
|
# Licensed under either of
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
|
|
# http://www.apache.org/licenses/LICENSE-2.0)
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
|
|
# http://opensource.org/licenses/MIT)
|
|
# at your option. This file may not be copied, modified, or distributed
|
|
# except according to those terms.
|
|
|
|
{.push raises: [].}
|
|
|
|
import
|
|
../../core_db/base/base_config
|
|
|
|
# Configuration section
|
|
const
|
|
EnableApiTracking = false
|
|
## When enabled, API functions are logged. Tracking is enabled by setting
|
|
## the `trackApi` flag to `true`. This setting is typically inherited from
|
|
## the `CoreDb` descriptor flag `trackLedgerApi` (which is only available
|
|
## if the flag `CoreDbEnableApiTracking` is set `true`.
|
|
|
|
EnableApiProfiling = false
|
|
## Enable API functions profiling. This setting is only effective if the
|
|
## flag `CoreDbEnableApiJumpTable` is set `true`.
|
|
|
|
# Exportable constants (leave alone this section)
|
|
const
|
|
LedgerEnableApiTracking* = EnableApiTracking and CoreDbEnableApiTracking
|
|
LedgerEnableApiProfiling* = EnableApiProfiling and CoreDbEnableApiJumpTable
|
|
|
|
|
|
# Support warning about extra compile time options. For production, non of
|
|
# the above features should be enabled.
|
|
import strutils
|
|
const ledgerBaseConfigExtras* = block:
|
|
var s: seq[string]
|
|
when LedgerEnableApiTracking:
|
|
s.add "logging"
|
|
when LedgerEnableApiProfiling:
|
|
s.add "profiling"
|
|
if s.len == 0:
|
|
""
|
|
else:
|
|
"Ledger(" & s.join(", ") & ")"
|
|
|
|
# End
|