documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Job Spec leads to node error for Fulfilling Requests doc

Open MStreet3 opened this issue 3 years ago • 2 comments

setup

node Chainlink Node 1.1.0 at commit e8b04f763e970f1e12a600b1bd60a7447abf2c3f
consumer contract https://rinkeby.etherscan.io/address/0x3d6E5fC1dBF0F529D0272342a8a966BeF457Aa66
oracle contract https://rinkeby.etherscan.io/address/0xc3BC560FBeDaA7E9a9A5D4F23aaf843C9E254aD5

problem

I believe the job specification associated with the walk-through here is faulty. Using the listed job spec on a node leads to failures in the encode_data task.

image

failing job spec

type = "directrequest"
schemaVersion = 1
name = "Get > Bytes32"
externalJobID = "1f67608c-df7b-4eb9-b4b1-0ed55868e856"
maxTaskDuration = "0s"
contractAddress = "0xc3BC560FBeDaA7E9a9A5D4F23aaf843C9E254aD5"
minIncomingConfirmations = 0
observationSource = """
    decode_log   [type="ethabidecodelog"
                  abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
                  data="$(jobRun.logData)"
                  topics="$(jobRun.logTopics)"]

    decode_cbor  [type="cborparse" data="$(decode_log.data)"]
    fetch        [type="http" method=GET url="$(decode_cbor.get)"]
    parse        [type="jsonparse" path="$(decode_cbor.path)" data="$(fetch)"]
    encode_data  [type="ethabiencode" abi="(bytes32 value)" data="{ \\"value\\": $(parse) }"]
    encode_tx    [type="ethabiencode"
                  abi="fulfillOracleRequest(bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes32 data)"
                  data="{\\"requestId\\": $(decode_log.requestId), \\"payment\\": $(decode_log.payment), \\"callbackAddress\\": $(decode_log.callbackAddr), \\"callbackFunctionId\\": $(decode_log.callbackFunctionId), \\"expiration\\": $(decode_log.cancelExpiration), \\"data\\": $(encode_data)}"
                 ]
    submit_tx    [type="ethtx" to="0xc3BC560FBeDaA7E9a9A5D4F23aaf843C9E254aD5" data="$(encode_tx)"]

    decode_log -> decode_cbor -> fetch -> parse -> encode_data -> encode_tx -> submit_tx
"""

MStreet3 avatar Jan 21 '22 13:01 MStreet3

Hi @MStreet3 ,

thanks for opening this issue and extremely sorry for the delay. I've opened an issue for the engineering team https://github.com/smartcontractkit/chainlink/issues/6499 as I'm not able to write GET > bytes32 using the v2 jobs. Will fix the docs as soon as I get a feedback

thanks!

aelmanaa avatar May 12 '22 12:05 aelmanaa

see https://github.com/smartcontractkit/chainlink/issues/6499 : This example needs to be updated to return a "string" rather than "bytes32"

aelmanaa avatar Jul 20 '22 14:07 aelmanaa