smartcontractkit / smartcontractkit/chainlink

[DEVEL] Multi-variable-response doesn't work with external adapters

Open
#4,938 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

investigating
Dominant language
Go
Stars
8.2k
Forks
2k
Avg merge
1d 23h
Merged PRs (30d)
202

Description

Description
Running through the multi-variable response example from the Chainlink docs (including creating a new multi-spec job) gives a successful result. However if you try to replicate this job, but use external adapter instead of a HTTPGet adapter, an error is given "insertEthTx failed while constructing EthTx data: number of collectors 2 != number of types in ABI encoding 4"

The issue seems to be the chainlink_result_collection array, it seems that any previously collected results collected from a resultsCollect task are not passed through to the next task if it's an external adapter task, but they are passed through if the next task is a normal HTTPGet adapter. This seems to imply that multi-variable response isn't compatible with external adapters

You can test this theory by creating a new job that uses a combination of EAs and HTTP Gets. See attached job spec for an example. This job first does an EA request, then the second one is a normal HTTPGet, then the final one is another EA request. Then all 3 results are sent back on-chain. Running through this example you can observe the following output (also attached):

  • First request (EA) successfully adds a result to the chainlink_result_collection array via the first resultsCollect task
  • The second request (HTTPGet) contains the chainlink_result_collection array, ie it is successfully passed through from the previous task (resultsCollect). This means that by the time the second resultsCollect task has completed, the array contains 2 values
  • The third request (EA) executes, and we can see that the chainlink_result_collection array that had 2 values in the previous task (resultsCollect), is NOT passed through to the EA task. This means that by the time the third and final resultsCollect task is executed, the final chainlink_result_collection array only contains the contents of the third requests (EA)

Comparing this behaviour to JSON output from a successful run) that only uses HTTPGet requests, we can see that in the successful runs, the chainlink_result_collection array is always passed through from the resultsCollect to the HTTPGet task

Your Environment
Nework: Kovan
Node version: 0.10.11

Steps to Reproduce

  • Create an external adapter that does a request (HTTP GET, POST etc)
  • Add EA to node via bridge
  • Create a JSON multi-variable-response on node that uses the EA as per the example spec uploaded here
  • Execute job and observe JSON output

json job-spec-multi-word.txt
json job output fail.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached multi-word job spec and failed job output, then trace how resultsCollect passes chainlink_result_collection into external adapter and HTTPGet tasks. Compare the two task paths and verify completion by rerunning the mixed EA/HTTPGet job with all three results preserved for on-chain submission.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.