axelarnetwork / tofnd

A gRPC server wrapper for the https://github.com/axelarnetwork/tofn library.
Apache License 2.0
25 stars 10 forks source link

Don't log logical errors regarding already reserved mnemonic #250

Closed sdaveas closed 2 years ago

sdaveas commented 2 years ago

In addition to #228, we need to eliminate mnemonic already reserved error logs because they trigger pagerduty alerts. Other than logging these errors, tofnd binary needs not to return a TofndError from main because these results are also captured by datadog. For example, here is the message logged by tofnd, and here is a the same message as the return value of the binary (notice the "Error:" prefix).

However, we can't always return Ok(()) because the auto command relies on the results of -m import and -m create (ie if import succeeds, proceed, else try to create).

One approach is to replace TofndResult with exit codes, (https://docs.rs/exitcode/latest/exitcode/ crate might be useful).

⚠️ Attention

For users that rely on tofnd's returning messages or mnemonic reserve Error errors, this is a breaking change.

ggutoski commented 2 years ago

Could we instead add a -m auto flag to tofnd and do everything inside the executable?

EDIT: posted this before I saw #251

milapsheth commented 2 years ago

Instead of changing tofnd, we decided that the entrypoint script will perform a command based on the state of the kvstore (similar to the launch validator with binaries script) and ask the user to explicitly backup their mnemonics. See #252 and axelarnetwork/axelarate-community#268.