fix: metrics validator label to use address instead of pk struct formatting#1201
fix: metrics validator label to use address instead of pk struct formatting#1201
Conversation
There was a problem hiding this comment.
It's unfortunate we have to do this conversion. Two things:
- We should make
record_metrics()fallible by returning aResult<()>. Then we can avoid having panicking code, and the higher level component would log errors in the error event type. @karlem could you drop a link to an example where we use that event type? - Would add a TODO so we try to propagate the FVM address in the validator context.
|
@LePremierHomme nit: the "closing" keyword is not supported by GitHub to link the issue, but "closes", "close", "closed" are. https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword |
Not sure I understand the purpose of having it fallible. To propagate encoding errors?
The public key is what's used as the validator key for comparisons. I guess it would be better to just derive |
In general, I agree—failing to record a metric should not cause a panic that shuts down the whole node. Here's an example of how to emit a tracing error: ipc/fendermint/vm/interpreter/src/fvm/exec.rs Line 200 in 409c138 However, given point 2:
I would suggest we include this change in the current PR. It’s a simple modification—see here: ipc/fendermint/app/src/cmd/run.rs Line 128 in 409c138 By including the address in the event directly, we can skip the conversion altogether and eliminate the need to make record_metrics() fallible. At least for now! |
|
@LePremierHomme , the address is already being converted in run.rs. I suggest including it in the ValidatorContext and then using it directly in the event. |
|
SGTM! |
|
Thank you, @karlem! 🙏 |
karlem
left a comment
There was a problem hiding this comment.
@LePremierHomme I think it's fine like this now. Since we do not cause panic in the record_metrics.
Closes #1190
I used address instead of the public key hex encoding. Can change that if wanted.