babylonchain / finality-provider

A peripheral program run by the finality providers
Other
16 stars 27 forks source link

avoid using `zap.NewNop()` logger #449

Open bap2pecs opened 3 months ago

bap2pecs commented 3 months ago

non-op logger is extremely hard to debug issue. it caused us a few hours to find out why our op e2e test failed with no error

we are now changing it to

    loggerConfig := zap.NewDevelopmentConfig()
    loggerConfig.Level = zap.NewAtomicLevelAt(zap.ErrorLevel)
    logger, err := loggerConfig.Build()

and now able to see the error

2024-06-29T18:05:59.836743Z fatal   terminating the finality-provider instance due to critical error    {"pk": "97276691ab7632441c0d1134d50757387384e382bb2e6e136ec0cfa434e903b7", "error": "reached max failed cycles with err: failed to get inclusion proof of public randomness: public randomness proof not found"}
FAIL    github.com/babylonchain/finality-provider/itest/opstackl2   58.770s
FAIL
make: *** [test-e2e-op] Error 1

we fixed it in our test but by quickly searching the codebase, we found many other places are using it.

bap2pecs commented 2 months ago

feel free to close it once you added it in your test @gusin13