formatting

This commit is contained in:
E M 2026-02-02 15:19:24 +11:00
parent 27da7200a6
commit 1cd2ff3d38
No known key found for this signature in database
5 changed files with 23 additions and 9 deletions

View File

@ -47,14 +47,16 @@ logScope:
topics = "storage blockexcengine"
declareCounter(
storage_block_exchange_want_have_lists_sent, "storage blockexchange wantHave lists sent"
storage_block_exchange_want_have_lists_sent,
"storage blockexchange wantHave lists sent",
)
declareCounter(
storage_block_exchange_want_have_lists_received,
"storage blockexchange wantHave lists received",
)
declareCounter(
storage_block_exchange_want_block_lists_sent, "storage blockexchange wantBlock lists sent"
storage_block_exchange_want_block_lists_sent,
"storage blockexchange wantBlock lists sent",
)
declareCounter(
storage_block_exchange_want_block_lists_received,

View File

@ -29,7 +29,8 @@ declareGauge(
"storage blockexchange pending block requests",
)
declareGauge(
storage_block_exchange_retrieval_time_us, "storage blockexchange block retrieval time us"
storage_block_exchange_retrieval_time_us,
"storage blockexchange block retrieval time us",
)
const

View File

@ -1,2 +1,5 @@
const ContentIdsExts =
[multiCodec("storage-root"), multiCodec("storage-manifest"), multiCodec("storage-block")]
const ContentIdsExts = [
multiCodec("storage-root"),
multiCodec("storage-manifest"),
multiCodec("storage-block"),
]

View File

@ -208,7 +208,9 @@ template multinodesuite*(suiteName: string, body: untyped) =
# create a log file even when using an absolute path
when defaultChroniclesStream.outputs is (FileOutput,) and StorageLogsDir.len > 0:
let logFile =
StorageLogsDir / sanitize(getAppFilename().extractFilename & ".chronicles.log")
StorageLogsDir / sanitize(
getAppFilename().extractFilename & ".chronicles.log"
)
let success = defaultChroniclesStream.outputs[0].open(logFile, fmAppend)
doAssert success, "Failed to open log file: " & logFile

View File

@ -26,7 +26,9 @@ type
StorageConfigError* = object of CatchableError
proc cliArgs*(config: StorageConfig): seq[string] {.gcsafe, raises: [StorageConfigError].}
proc cliArgs*(
config: StorageConfig
): seq[string] {.gcsafe, raises: [StorageConfigError].}
proc raiseStorageConfigError(msg: string) {.raises: [StorageConfigError].} =
raise newException(StorageConfigError, msg)
@ -87,7 +89,9 @@ proc addCliOption*(
) {.raises: [StorageConfigError].} =
config.addCliOption(StartUpCmd.noCmd, CliOption(key: key, value: value))
proc cliArgs*(config: StorageConfig): seq[string] {.gcsafe, raises: [StorageConfigError].} =
proc cliArgs*(
config: StorageConfig
): seq[string] {.gcsafe, raises: [StorageConfigError].} =
## converts StorageConfig cli options and command groups in a sequence of args
## and filters out cli options by node index if provided in the CliOption
var args: seq[string] = @[]
@ -138,7 +142,9 @@ proc withLogFile*(
startConfig.configs[idx].addCliOption("--log-file", "<updated_in_test>")
return startConfig
proc withLogFile*(self: StorageConfigs): StorageConfigs {.raises: [StorageConfigError].} =
proc withLogFile*(
self: StorageConfigs
): StorageConfigs {.raises: [StorageConfigError].} =
## typically called from test, sets config such that a log file should be
## created
var startConfig = self