agave: Turbine panics on v2.2

Problem

We saw reports of a panic in turbine in Discord here:

[2025-03-18T10:40:28.061949060Z ERROR solana_metrics::metrics]
 datapoint: panic program="validator" thread="solSvrfyShred07" one=1i
 message="panicked at turbine/src/cluster_nodes.rs:276:33:  
   no entry found for key" location="turbine/src/cluster_nodes.rs:276:33" version="2.2.3 (src:0b37b8fd; 
 feat:3294202862, client:Agave)" 

This was on devnet with what appears to be an unstaked node. Poking around in devnet and testnet metrics, I see several other instances of this panic. I also see this similar panic in metrics:

"2025-03-18T10:24:36.241Z","BUxL4tfirArVhqZmjyzvQtBgL9DnV4UZBGHJtxXhW8ar",
"turbine/src/cluster_nodes.rs:462:47","panicked at turbine/src/cluster_nodes.rs:462:47:
called `Option::unwrap()` on a `None` value","solRetransmit00","2.2.3 (src:0b37b8fd; feat:3294202862, client:Agave)"

Looking at the source, it would appear that the node does not have itself in .index field in ClusterNodes: https://github.com/anza-xyz/agave/blob/ca5f8e2d95721d69fa6fb76cf070dd10603ec9ad/turbine/src/cluster_nodes.rs#L273-L278

And the other source looks somewhat similar where a node is looking for itself in this structure: https://github.com/anza-xyz/agave/blob/ca5f8e2d95721d69fa6fb76cf070dd10603ec9ad/turbine/src/cluster_nodes.rs#L461-L462

Proposed Solution

Two things at play:

  • We need to figure out why this is panicking in the first place
  • With the above known, I’m inclined to think that this code can be made to recover from the key-not-found case gracefully. The function already returns an error so this shouldn’t be so bad

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27

Most upvoted comments

Yes, I am on it!

Thanks for the tip! Yes you are correct it is better to keep this open until all PRs land.

I guess this is resolved then, thank you @theobolo @steviez and @bw-solana for help on this one.

@alexpyattaev Version is starting correctly + I can switch to staked identity ✅

Got reproduction, key thing was to have --vote-account pointed to a staked identity.

@alexpyattaev I’m restarting the validator with : RUST_BACKTRACE=1

I’ll post the full logs here in a few minutes 😃

I’m currently trying to reproduce the bug. Can you run with RUST_BACKTRACE=1 on your machine and attach the backtrace here?

Which cluster were you trying with @alexpyattaev ? It did occur to me that startup is quicker on testnet and devnet (smaller snapshot / account state to rebuild), so issue may only be showing on these clusters.

Also please let me know the public key of the validator, if it has reported anything to metrics before crash it would help a lot.

Theo’s node was reporting metrics with BUxL4tfirArVhqZmjyzvQtBgL9DnV4UZBGHJtxXhW8ar; this is a junk identity but the node is crashing before hot-swap as noted in Theo’s comment above: “I can confirm that the node is crashing before I have a chance to HotSwap Identities”

Seems like we should make the following changes: …

Yep, this is more or less what I was thinking.

Not clear to me if there is an elegant way of guaranteeing this nodes information is present in cluster info when cluster nodes get created. That would obviously eliminate any sort of race condition and resolve all of the above.

Alex mentioned being aware of some delays. As part of this investigation, I would like to fully understand the race and avoid it if possible like you said.