solana icon indicating copy to clipboard operation
solana copied to clipboard

`validator-new.version` does not update when the identity is changed

Open diman-io opened this issue 1 year ago • 4 comments

Problem

After updating the validator identity using solana-validator set-identity, the validator-new.version is not sent for the new identity.

Proposed Solution

Send it.

diman-io avatar Dec 10 '23 07:12 diman-io

Hi, I would like to give a try for this issue. First, if I understood correctly, I should send the validator-new.version metric to the be saved in a InfluxDB. Is this correct? I've tried to do this by placing the following line of code:

solana_metrics::datapoint_info!(
           "validator-new",
           ("version", solana_version::version!(), String),
);

here: https://github.com/solana-labs/solana/blob/e858a5a7c08482a836391067afbc843cf6e6b6d4/validator/src/main.rs#L760 However, when I check the logs, this metric does not seem to appear by searching validator-new. The script I did run for testing the change is multinode-demo/bootstrap-validator.sh, and I added the following line: $program --ledger "$ledger_dir" set-identity "$identity"

here, inside the loop: https://github.com/solana-labs/solana/blob/6f0133bd432a3b7945c4805d4344bf4522044dab/multinode-demo/bootstrap-validator.sh#L189 I'm not sure if I'm on the right track and if I'm mistaken something in the configuration of the scripts/code.

gystemd avatar Dec 18 '23 23:12 gystemd

Hi, thank you for diving into this issue!

I've tried to do this by...

Yes, that's correct, but make sure to check how it's sent in Validator::new(). You can find it by searching for "validator-new" in the entire codebase; it's the only instance.

here:

I think it would be better to place it in the AdminRpc implementation rather than in the CLI wrapper. Just follow the code you've tagged downwards, and you'll find the place where the key pair is updated for gossip. I was thinking that we could put our update there, right after the gossip update.

Feel free to ask me if you need further clarification or assistance!

diman-io avatar Dec 19 '23 12:12 diman-io

I think it would be better to place it in the AdminRpc implementation rather than in the CLI wrapper.

Indeed, it makes sense. Putting the datapoint_info! statement inside the AdminRpc implementation now produces the metric: image

but make sure to check how it's sent in Validator::new()

Yes, that's what I've done in the first place. I just copied that statement and left only the "version" attribute as requested by the issue. Thank you for the hints!

gystemd avatar Dec 19 '23 15:12 gystemd

@diman-io I saw your conversation with @steviez in an attached PR, seems the status or description of the issue should be updated.

kubanemil avatar May 14 '24 17:05 kubanemil