Skip to content

fix: handle unspecified node reward type in registry command#1964

Merged
severin-amrein merged 1 commit intomainfrom
sev/fix-missing-node-type
Apr 2, 2026
Merged

fix: handle unspecified node reward type in registry command#1964
severin-amrein merged 1 commit intomainfrom
sev/fix-missing-node-type

Conversation

@severin-amrein
Copy link
Copy Markdown
Contributor

Summary

  • The dre registry command panicked when a node had no node_reward_type set, because NodeRewardType::Unspecified panics on .to_string() in the upstream ic-protobuf crate
  • Handle this case explicitly by printing "unspecified" instead of calling .to_string() on the enum variant

Test plan

  • Ran dre registry against mainnet and verified nodes with missing node type now show "unspecified" instead of panicking:
{
  "node_id": "csr6y-hwdmg-7nzv5-bdqdv-m4pwd-zptyz-dr2yv-tehnb-llgci-jx4sl-aqe",
  "node_reward_type": "unspecified",
  ...
}

The registry command panicked when a node had no node_reward_type set,
because NodeRewardType::Unspecified panics on .to_string() in the
upstream ic-protobuf crate. Handle this case explicitly by printing
"unspecified" instead.
@severin-amrein severin-amrein marked this pull request as ready for review April 2, 2026 09:43
@severin-amrein severin-amrein requested a review from a team as a code owner April 2, 2026 09:43
@severin-amrein severin-amrein merged commit 26b37dc into main Apr 2, 2026
8 checks passed
@severin-amrein severin-amrein deleted the sev/fix-missing-node-type branch April 2, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants