Skip to content

Commit b8c8b1b

Browse files
committed
imp: add env specific tracer opt modifiers
1 parent 3f46c38 commit b8c8b1b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cardano-lib/default.nix

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{lib, writeText, runCommand, jq}:
22
let
3-
inherit (builtins) attrNames elem fromJSON readFile toFile toJSON;
3+
inherit (builtins) attrNames elem fromJSON getAttr readFile toFile toJSON;
44
inherit (lib) filterAttrs flip forEach listToAttrs mapAttrs mapAttrsToList optionalAttrs optionalString pipe;
55

66
mkEdgeTopology = {
@@ -130,13 +130,15 @@ let
130130
# Min currently 10.4.0 for `LedgerDB` config support.
131131
minNodeVersion = { MinNodeVersion = "10.4.0"; };
132132

133+
mergeTraceOpts = cfg: traceOpts: cfg // {TraceOptions = getAttr "TraceOptions" cfg // traceOpts;};
134+
133135
environments = mapAttrs (name: env: {
134136
inherit name;
135137
# default derived configs:
136-
nodeConfig = defaultLogConfig // env.networkConfig;
137-
nodeConfigLegacy = defaultLogConfigLegacy // env.networkConfig;
138-
nodeConfigBp = defaultLogConfig // env.networkConfigBp;
139-
nodeConfigBpLegacy = defaultLogConfigLegacy // env.networkConfigBp;
138+
nodeConfig = mergeTraceOpts (defaultLogConfig // env.networkConfig) (env.extraTracerConfig or {});
139+
nodeConfigLegacy = defaultLogConfigLegacy // env.networkConfig // (env.extraTracerConfigLegacy or {});
140+
nodeConfigBp = mergeTraceOpts (defaultLogConfig // env.networkConfigBp) (env.extraTracerConfig or {});
141+
nodeConfigBpLegacy = defaultLogConfigLegacy // env.networkConfigBp // (env.extraTracerConfigLegacy or {});
140142
consensusProtocol = env.networkConfig.Protocol;
141143
submitApiConfig = mkSubmitApiConfig name environments.${name}.nodeConfig;
142144
dbSyncConfig =
@@ -182,6 +184,10 @@ let
182184
extraDbSyncConfig = {
183185
enableFutureGenesis = true;
184186
};
187+
188+
# Once legacy tracing system is removed, tracing mods can be placed back in $ENV-config.nix
189+
extraTracerConfig.Mempool.severity = "Silence";
190+
extraTracerConfigLegacy.TraceMempool = false;
185191
};
186192

187193
preprod = rec {

0 commit comments

Comments
 (0)