feat: Remove dependency on machine-id#341
Open
Sukuna0007Abhi wants to merge 1 commit intoveraison:mainfrom
Open
feat: Remove dependency on machine-id#341Sukuna0007Abhi wants to merge 1 commit intoveraison:mainfrom
Sukuna0007Abhi wants to merge 1 commit intoveraison:mainfrom
Conversation
Implements a flexible node ID generation system that: 1. Tries to read from a persistent node ID file 2. Falls back to MAC address from network interface 3. Falls back to machine-id (for systemd systems) 4. Finally generates and persists a random node ID This makes the verification service more portable and removes the hard dependency on systemd's machine-id. Fixes veraison#124 Signed-off-by: Sukuna0007Abhi <appsonly310@gmail.com>
Contributor
Author
|
Pls review in your free time sir @setrofim sir @yogeshbdeshpande sir @thomas-fossati |
setrofim
reviewed
Oct 3, 2025
|
|
||
| // getMACBasedID returns a node ID based on the MAC address of the first | ||
| // available non-loopback interface | ||
| func getMACBasedID() ([]byte, error) { |
Collaborator
There was a problem hiding this comment.
I am hesitant about this.
- The order of inteface may change (e.g. if someone adds a PCI network card to their machine).
- In virtualized environments, MAC cannot be rilied on to be sufficiently unique.
I think might be better to remove this.
|
|
||
| // generateRandomNodeID creates a random node ID | ||
| func generateRandomNodeID() ([]byte, error) { | ||
| id := make([]byte, nodeIDLength) |
Collaborator
There was a problem hiding this comment.
Since we already depend on github.com/google/uuid, instead of doing this, you could just do uuid.New()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: feat: Remove dependency on machine-id
Description:
This PR implements a flexible node ID generation system to remove the hard dependency on systemd's machine-id. The new system provides multiple fallback methods to ensure reliable node identification across different environments.
Implementation details:
Key improvements:
Added new files:
Modified:
This makes the verification service more portable and removes the hard dependency on systemd's machine-id while maintaining backward compatibility.
Fixes #124
Ready for Review sir @thomas-fossati @setrofim @yogeshbdeshpande