fix: look up real user_id instead of hardcoding anonymous for --node-id path#2097
Open
amathxbt wants to merge 1 commit into
Open
fix: look up real user_id instead of hardcoding anonymous for --node-id path#2097amathxbt wants to merge 1 commit into
amathxbt wants to merge 1 commit into
Conversation
…e-id path When --node-id is supplied, Config::resolve creates a Config struct with user_id hardcoded to "anonymous". Every analytics event, cloud-function reward report, and orchestrator call for this session then identifies the node as "anonymous", corrupting per-user telemetry and potentially causing reward attribution to fail for nodes that use the --node-id shortcut. Fetch the real user_id via orchestrator.get_user(&wallet_address). The lookup is non-fatal: a failure falls back to an empty string rather than blocking node startup.
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.
Problem
When a user starts the node with
--node-id <id>,Config::resolvecreates a config with:Every analytics event, reward report (via
set_wallet_address_for_reporting→report_proving_if_needed), and orchestrator call for the entire session then identifies the user as"anonymous". This:--node-idnodes are bucketed under a single fake identity."anonymous"value could cause silent rejections.Any user who runs
nexus-cli start --node-id <id>(rather than the full register + start flow) is affected.Fix
After resolving
wallet_addressviaorchestrator.get_node(), make a second call toorchestrator.get_user(&wallet_address)to obtain the realuser_id. A lookup failure is treated as non-fatal (falls back to an empty string) so node startup is never blocked.