hyperledger-firefly / hyperledger-firefly/firefly

Swagger-API/Custom Smart Contract – Issues with return-data (tuples) of GET-(FF = /POST/query-)functions

Open
#1,192 4 comments 0 reactions 1 assignee Claimed by @nguyer View on GitHub
bug
Dominant language
Go
Stars
602
Forks
246
Avg merge
18h 47m
Merged PRs (30d)
6

Description

I'm filing this here, as it's somehow cross-package (Swagger-Api, evm-/ethconnect, firefly-signer). Please relocate as you see fit (probably firefly-signer)...

# FireFly - Issue-/Bug-Report

** FireFly-version ***
(1) "1.1.2" w/ ethconnect
(2) "1.2.0" w/ evmconnect,

** Current behavior: **
The Swagger-Api fails to return tuples of state variables, requested by contract GETter-functions. The RLP-decoding of the data to return fails/is incomplete.

** Expected behavior: **
Return correctly decoded Tuple-data in FF-Swagger Json-Response

** Steps to reproduce: **
1. For (1) -ethconnect: Create a new FF-stack with --blockchain-connector ethconnect
(2) -evmconnect: Create a new FF-stack with --blockchain-connector evmconnect

2. For both: deploy the attached SmaCo "DynStructArraysAndAbiTuples.sol" on FF,
define contract interface/ABI, register API (via Sandbox...). The contracts Constructor
will create some data for it's state-variables
[DynStructArraysAndAbiTuples.sol.txt](https://github.com/hyperledger/firefly/files/10787277/DynStructArraysAndAbiTuples.sol.txt)
...

3. As reference, deploy the said SmaCo with Remix Desktop-IDE (i used v.0.30.1), and connect it
to the geth-node of the respective FF-stack:
Remix-IDE-> "Environment",
-> select 'External HTTP-Provider'-> with
-> "External HTTP Provider Endpoint" =
-> 'http://127.0.0.1:5100'

4. Test the following SmaCo-functions (POST/query-endpoints in the FF-Swagger-Interface)
- getDatingsLength
- getAllDatings
- getAllDatingEfforts
- getDatingByAttempt
- getAliceEffortByValue

5. Do the same tests in the Remix-IDE, for comparison and reference.

6. See the differences/errors, as documented as well in the attached pdf-document
"FF-Tuples-AbiRlp-Decode-Tests.pdf"

[FF-Tuples-AbiRlp-Decode-Tests.pdf](https://github.com/hyperledger/firefly/files/10787358/FF-Tuples-AbiRlp-Decode-Tests.pdf)

** Related code: **
The error-messages 'FF23023'(MsgReturnDataInvalid) from firefly-evmconnect,
'FF22046'(MsgABIArrayCountTooLarge) from firefly-signer

** Other information: **
Reference-tested as well with 'https://github.com/esaulpaugh/headlong-cli' + '~/headlong',
a library aiming to be just 'strict' in RLP-en-/decoding. See it's (correct) results in the
attached pdf-document.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.