You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a JSON payload that contains parameters to FireFly (e.g. to deploy a contract that has constructor parameters) evmconnect returns FF22062: Negative numeric value is invalid for component %!!(MISSING)s(uint16=256)%!!(MISSING)(EXTRA string=[0]) if the numeric parameter exceeds the maximum size of a float64.
This appears to be because Golang deserialises large JSON numbers to float64 when deserialising to an interface{}, and silently loses any precision caused by the JSON number exceeding the maximum representable value of a float64.
The text was updated successfully, but these errors were encountered:
matthew1001
changed the title
FF give
FF returns FF22062: Negative numeric value... for large numeric input parameters
Sep 2, 2024
I've done most of the work to fix this under hyperledger/firefly-common#147 and hyperledger/firefly-signer#76. PRs for other repos such as firefly-evmconnect and firefly-transaction-manager will be needed to pull in the updated firefly-common and firefly-signer packages.
Thanks for the work and context on this one @matthew1001!
This fix is important for all consumers of FireFly and I think warrants a new patch release to v1.3.2.
Things that I would love to be figure out as part of this work for v1.3.2
Verify that the generate OpenAPI contract interface enforces/recommends strings for all integers on /invoke and /query calls
Upgrade FireFly core to the latest firefly-common and verify in all the places where this fix might apply
The first place I would look at would be the /contract/invoke api flow
Verify that this fix also works for contract listeners, so emitting an event with
This issue has look quiet closely at the EVM path, but we also have Fabric and Tezos (fyi @denisandreenko ) to look at
Look at the Javascript based tools in FireFly that might have the same issue
The node sdk when invoking APIs...
The Sandbox UI
DataExchange... try sending a message with a large number in the data payload...
FireFly CLI has a deploy command where you can specify constructor parameters this might have the same problem and will need updating to the latest FireFly Common as well
Documentation to explain to users that the safest way to pass large numbers into the system is to keep them as strings
When passing a JSON payload that contains parameters to FireFly (e.g. to deploy a contract that has constructor parameters) evmconnect returns
FF22062: Negative numeric value is invalid for component %!!(MISSING)s(uint16=256)%!!(MISSING)(EXTRA string=[0])
if the numeric parameter exceeds the maximum size of afloat64
.This appears to be because Golang deserialises large JSON numbers to
float64
when deserialising to aninterface{}
, and silently loses any precision caused by the JSON number exceeding the maximum representable value of afloat64
.The text was updated successfully, but these errors were encountered: