RPC server confuses when logs RPC parameters #1426

Open
opened 2025-12-28 17:16:24 +00:00 by sami · 2 comments
Owner

Originally created by @carpawell on GitHub (Nov 20, 2024).

At some point, you start to check logs to find errors and then you see some strange things that lead you to non-existent bugs...

Current Behavior

I saw processing rpc request {"method": "subscribe", "params": "[transaction_executed ]"} but I am sure it worked ok and params (after transaction_executed) were not an empty string.

Expected Behavior

I could see some string representation of the parameters I sent. It must have one, this was a JSON part at some step.

Possible Solution

I don't know.

Steps to Reproduce

Call some test like nspcc-dev/neo-go@57eec71101/pkg/services/rpcsrv/subscription_test.go (L203-L209) and see that it passes but printed logs are confusing.

Context

Debugging subscription problems may lead to some not-needed deep research for nothing.

Regression

I guess no, @AnnaShaleva said it was kinda ok for years.

Your Environment

v0.106.3

Originally created by @carpawell on GitHub (Nov 20, 2024). <!-- Provide a general summary of the issue in the Title above --> At some point, you start to check logs to find errors and then you see some strange things that lead you to non-existent bugs... ## Current Behavior <!-- Tell us what happens instead of the expected behavior --> I saw `processing rpc request {"method": "subscribe", "params": "[transaction_executed ]"}` but I am sure it worked ok and params (after `transaction_executed`) were not an empty string. ## Expected Behavior <!-- Tell us what should happen --> I could see some string representation of the parameters I sent. It must have one, this was a JSON part at some step. ## Possible Solution <!-- Not obligatory, but suggest a fix/reason for the bug --> I don't know. ## Steps to Reproduce <!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. --> Call some test like https://github.com/nspcc-dev/neo-go/blob/57eec71101bad9d6d01bbaeecba0a2105f9dbd6b/pkg/services/rpcsrv/subscription_test.go#L203-L209 and see that it passes but printed logs are confusing. ## Context <!-- How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world --> Debugging subscription problems may lead to some not-needed deep research for nothing. ## Regression <!-- Is this issue a regression? (Yes / No) If Yes, optionally please include version or commit id or PR# that caused this regression, if you have these details --> I guess no, @AnnaShaleva said it was kinda ok for years. ## Your Environment v0.106.3
Author
Owner

@roman-khimov commented on GitHub (Nov 20, 2024):

We can't log all parameters in their full length, but something can be improved here, because Param.String() is not a regular stringer interface, it's used for string extraction from parameters and not everything is a string. I'd say it's a misuse of "String()" name for a different method.

@roman-khimov commented on GitHub (Nov 20, 2024): We can't log all parameters in their full length, but something can be improved here, because `Param.String()` is not a regular stringer interface, it's used for string extraction from parameters and not everything is a string. I'd say it's a misuse of "String()" name for a different method.
Author
Owner

@AnnaShaleva commented on GitHub (Jul 8, 2025):

Long arguments should be cropped to log only first 60 bytes of the argument.

@AnnaShaleva commented on GitHub (Jul 8, 2025): Long arguments should be cropped to log only first 60 bytes of the argument.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1426
No description provided.