mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
t5 applog RPC difference C# vs neo-go #1505
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1505
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ixje on GitHub (Apr 7, 2025).
Current Behavior
a
stackwith invalid stack items is returned in the applicationlog for tx0x0819175f7cd906f2eee8fbc825496acd11f0f0afcfcaec32bfbb71a7a52b6f48Expected Behavior
like neo-cli, a
stackwith valid stack itemsPossible Solution
return a
stackwith valid stack items e.g. the NullStackitem like C# is doing.Steps to Reproduce
Context
our indexer has a little loop as follows that now breaks because
stackitem.ToJSONWithTypesfails on this output.Your Environment
SaveInvocationsturned on.@roman-khimov commented on GitHub (Apr 7, 2025):
Needs to be checked.
Nullstack item shouldn't be a problem, maybe it's something different in which case this behavior can be valid, some items can't be serialized and an error should be returned in this case (in general it can be returned in exactly this way).@ixje commented on GitHub (Apr 7, 2025):
That sounds problematic to me. From the top of my head all stack items returned are JSON objects that have at least a
typekey. Withiteratorandnullbeing to exceptions to not having avaluekey as well. Thisdoesn't even return JSON objects, just strings. At least neo-mamba and neon-js will error on this and it wouldn't surprise me if other SDKs consuming this data make the same assumption that
stackis a list/array/slice ofStackItems with the aforementioned keys.@roman-khimov commented on GitHub (Apr 7, 2025):
There is NeoGo specifics there, C# also can produce this output in some cases or at least this was the case some time ago. The problem is that when the item is invalid substituting it with a valid placeholder item can lead to incorrect result interpretation since you can't differentiate error case from real item.
@roman-khimov commented on GitHub (Oct 20, 2025):
Relevant links:
neo-project/neo@272af62a1d/src/Plugins/RpcServer/RpcServer.SmartContract.cs (L99-L108)neo-project/neo@272af62a1d/src/RpcClient/Models/RpcInvokeResult.cs (L49-L57)neo-project/neo@272af62a1d/src/Plugins/ApplicationLogs/LogReader.cs (L453-L460)Also
neo-project/neo@272af62a1d/src/Plugins/ApplicationLogs/LogReader.cs (L469-L482)Unfortunately, different choices are made in different places even though it's all about the same problem of stack JSON.