oasis-core
oasis-core copied to clipboard
Improve log messages
SUMMARY
Some log messages have an incorrect level, unclear message, or missing. Due to the huge amount of logs, we should keep in mind that many node operators have logging level set to warn or even error.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
runtimeworker/registration
ADDITIONAL INFORMATION
- If anything is wrong with the runtime/enclave, it should be an have
"level":"error". Currently:
{"component":"ronl","level":"warn","module":"runtime","msg":"runtime execution failed: Enclave panicked.","runtime_id":"...","runtime_name":"...","ts":"2025-04-19T17:11:02.417243335Z"}
- Failed node registrations should be logged with
"level":"error". Currently we only log when registration is scheduled and when it succeeds, but not when it fails:
{"caller":"worker.go:373","epoch_height":26221881,"level":"info","module":"worker/registration","msg":"per-epoch re-registration scheduled","target_height":26221896,"ts":"2025-04-19T17:10:57.260326573Z"}
{"caller":"worker.go:835","epoch":43656,"level":"info","module":"worker/registration","msg":"performing node (re-)registration","node_id":"...","ts":"2025-04-18T11:11:12.356493166Z"}
{"caller":"worker.go:951","level":"info","module":"worker/registration","msg":"node registered with the registry","ts":"2025-04-18T11:09:51.232704473Z"}
- It is unclear as what the node registered as on success. Which mode/role (
validator/compute/observer), for which runtime, and for which entity? Maybe even what it failed to register as?
{"caller":"worker.go:951","level":"info","module":"worker/registration","msg":"node registered with the registry","ts":"2025-04-18T11:09:51.232704473Z"}
- The registration process is full of unclear log messages (for a typical node operator). It mentions
"nil hook"and"not registering"as if something is wrong, but then either logs a successful registration (or quietly retries in case of a failed node registration).
{"caller":"worker.go:1127","level":"info","module":"worker/registration","msg":"starting node registration service","ts":"2025-04-18T11:19:46.767946795Z"}
{"caller":"worker.go:230","level":"debug","module":"worker/registration","msg":"waiting for consensus sync","ts":"2025-04-18T11:19:46.767967779Z"}
{"caller":"worker.go:951","level":"info","module":"worker/registration","msg":"node registered with the registry","ts":"2025-04-18T11:19:57.851673391Z"}
{"caller":"worker.go:408","level":"debug","module":"worker/registration","msg":"enumerating role provider hooks","ts":"2025-04-18T11:21:10.739051727Z"}
{"caller":"worker.go:426","level":"debug","module":"worker/registration","msg":"nil hook for role","role":"compute","ts":"2025-04-18T11:21:10.739148041Z","ver":3}
{"caller":"worker.go:443","level":"debug","module":"worker/registration","msg":"not registering, no role provider hooks","ts":"2025-04-18T11:21:10.739172249Z"}
{"caller":"worker.go:408","level":"debug","module":"worker/registration","msg":"enumerating role provider hooks","ts":"2025-04-18T11:21:18.206749094Z"}
{"caller":"worker.go:426","level":"debug","module":"worker/registration","msg":"nil hook for role","role":"compute","ts":"2025-04-18T11:21:18.206771224Z","ver":4}
{"caller":"worker.go:443","level":"debug","module":"worker/registration","msg":"not registering, no role provider hooks","ts":"2025-04-18T11:21:18.206776875Z"}
{"caller":"worker.go:408","level":"debug","module":"worker/registration","msg":"enumerating role provider hooks","ts":"2025-04-18T11:21:18.207684376Z"}
{"caller":"worker.go:835","epoch":43656,"level":"info","module":"worker/registration","msg":"performing node (re-)registration","node_id":"...","ts":"2025-04-18T11:21:18.207833678Z"}