Skip to content

Conversation

@AlanRuno
Copy link
Owner

Summary

Fixes garbled/corrupted Node ID display in the rapid stake table UI. The node_id field in mxd_node_stake_t is a char[64] meant for hex string representation, but mxd_apply_membership_deltas was incorrectly copying 20 bytes of binary address data directly into it using memcpy. This caused the UI to display garbage characters like "!djE=h§4L" instead of proper hex addresses.

The fix converts the binary address to a 40-character hex string using snprintf and also populates the node_address field with the binary data for direct comparisons.

Review & Testing Checklist for Human

  • Search for similar bugs: Run grep -n "memcpy.*node_id" src/ to check if other code paths incorrectly copy binary data into node_id
  • Verify node_address usage: Confirm that setting node_address here doesn't conflict with existing code that may have expected it to be unset or set elsewhere
  • Test in multi-node environment: Deploy to test nodes and verify the rapid stake table displays proper 40-character hex Node IDs
  • Check strcmp comparisons: Verify that any strcmp(node_id, ...) comparisons still work correctly with the hex string format

Notes

Bug was reported by user with screenshot showing corrupted Node IDs in the rapid stake table display. The existing code at line 1134 already uses memcmp on node_address for comparisons, so setting that field here is consistent with the existing lookup logic.

Link to Devin run: https://app.devin.ai/sessions/f0a6357d898e440ea3745d77dfb91d8d
Requested by: Runo (runonetworks@gmail.com) / @AlanRuno

…n node_id

The node_id field in mxd_node_stake_t is a char[64] meant for hex string
representation of the node address. The mxd_apply_membership_deltas function
was incorrectly copying 20 bytes of binary address data directly into node_id
using memcpy, causing garbled/corrupted display in the rapid stake table UI.

Fixed by:
1. Converting the binary address to a 40-character hex string using snprintf
2. Properly null-terminating the string
3. Also copying the binary address to node_address field for direct comparisons
@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@AlanRuno AlanRuno merged commit 92decfb into main Jan 13, 2026
7 of 9 checks passed
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