Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw input decode failure when processing trigger #3314

Closed
mmchougule opened this issue Mar 2, 2022 · 3 comments · Fixed by #3326
Closed

Raw input decode failure when processing trigger #3314

mmchougule opened this issue Mar 2, 2022 · 3 comments · Fixed by #3326

Comments

@mmchougule
Copy link
Contributor

mmchougule commented Mar 2, 2022

process_triggers function in graph-node/core/src/subgraph/instance.rs is failing on one specific raw input on block #14277019. It worked on similar input size on a previous block. etherscan wasn't able to decode the data either. It is currently breaking some subgraphs.

failing transaction: https://etherscan.io/tx/0x5f0b0ea26e74c9d796209920bbae08f5ebb4ae053ef8b01c7848bd0a2b85691d

working transaction:
https://etherscan.io/tx/0xe3a320d46603d8b1749e1e95bd309791bd50ee7e17531254e801ba0fec4518bb

Before the mapping is even run, the graph-node fails with this error:

ERRO Subgraph instance failed to run: failed to process trigger: block #14277019 (0x2bae…9554), transaction 5f0b0ea26e74c9d796209920bbae08f5ebb4ae053ef8b01c7848bd0a2b85691d: Generating function inputs for the call Function { name: "atomicMatch_", inputs: [Param { name: "addrs", kind: FixedArray(Address, 14) }, Param { name: "uints", kind: FixedArray(Uint(256), 18) }, Param { name: "feeMethodsSidesKindsHowToCalls", kind: FixedArray(Uint(8), 8) }, Param { name: "calldataBuy", kind: Bytes }, Param { name: "calldataSell", kind: Bytes }, Param { name: "replacementPatternBuy", kind: Bytes }, Param { name: "replacementPatternSell", kind: Bytes }, Param { name: "staticExtradataBuy", kind: Bytes }, Param { name: "staticExtradataSell", kind: Bytes }, Param { name: "vs", kind: FixedArray(Uint(8), 2) }, Param { name: "rssMetadata", kind: FixedArray(FixedBytes(32), 5) }], outputs: [], constant: false, state_mutability: Payable } failed, raw input: ab834bab0000000000000000000000...: Invalid data

There was a similar bug #3194 that was fixed but this issue still exists.
raw_input:
ab834bab0000000000000000000000007f268357a8c2552623316e2562d90e642bb538e500000000000000000000000043ab2a731be043163f15a361aac0b3ff3ffede4c000000000000000000000000de8194fc7b6642b70b7e7c8d6e7a18de2a3abbde0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000baf2127b49fc93cbca6269fade0f7f31df4c88a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f268357a8c2552623316e2562d90e642bb538e5000000000000000000000000de8194fc7b6642b70b7e7c8d6e7a18de2a3abbde00000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b3256965e7c3cf26e11fcaf296dfc8807c01073000000000000000000000000baf2127b49fc93cbca6269fade0f7f31df4c88a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000621926d20000000000000000000000000000000000000000000000000000000000000000038a763ed2d595140fcacca5bb198f0db170c6dc72c0a31c81d7d8249587da320000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062168cd000000000000000000000000000000000000000000000000000000000621fc7a45478430ae159363193537ab0f9b1abf89e50bc86cd94c1056bf1e648de4c6de10000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007c000000000000000000000000000000000000000000000000000000000000008e00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b200000000000000000000000000000000000000000000000000000000000000b60000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b2e8de92a86092f4185e1997772ecae8adde1ea2e79a6d8d3218725fb9c7bdf1f2e921cbc9cc62f60de7f037372f315d613ac91e261f50311c8223d18735b97bd2e8de92a86092f4185e1997772ecae8adde1ea2e79a6d8d3218725fb9c7bdf1f2e921cbc9cc62f60de7f037372f315d613ac91e261f50311c8223d18735b97bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4fb16a595000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043ab2a731be043163f15a361aac0b3ff3ffede4c00000000000000000000000057d819152a8bc86d097fed1dcaa6259b5380a4b10000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4fb16a595000000000000000000000000de8194fc7b6642b70b7e7c8d6e7a18de2a3abbde000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057d819152a8bc86d097fed1dcaa6259b5380a4b10000000000000000000000000000000000000000000000000000000000000084000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e400000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

@mmchougule
Copy link
Contributor Author

It's failing at this block:

                let tokens = function_abi
                    .decode_input(&call.input.0[4..])
                    .with_context(|| {
                        format!(
                            "Generating function inputs for the call {:?} failed, raw input: {}",
                            &function_abi,
                            hex::encode(&call.input.0)
                        )
                    })?;

What's the best way to handle this or able to decode it in graph-node?
Still the same issue on this input from gist posted in #3194 : https://gist.github.com/otaviopace/05a6fc20af6ca267d932cffaf4e0bd98

@azf20
Copy link
Contributor

azf20 commented Mar 3, 2022

hi @mmchougule - are you using the hosted service, the network or a local graph node? cc @otaviopace

@mmchougule
Copy link
Contributor Author

@azf20 I am currently using a local graph-node and the master branch. I assume one of the latest releases is being used on the hosted service and the network.

@otaviopace
I made a quick update so I can skip the transaction that isn't able to be decoded correctly. So it can continue indexing rather than stopping the subgraph completely. Etherscan also fails to decode.

https://github.com/mmchougule/graph-node/blob/b8220b5cbc66874a68a5e3164b48bd44c5acb1aa/chain/ethereum/src/data_source.rs#L605

let tokens = match function_abi
    .decode_input(&call.input.0[4..])
    .with_context(|| {
        format!(
            "Generating function inputs for the call {:?} failed, raw input: {}",
            &function_abi,
            hex::encode(&call.input.0)
        )
    }) {
      Ok(val) => val,
      Err(err) => {
        warn!(logger, "Failed parsing inputs, skipping"; "error" => &err.to_string());
        Vec::new()
      },
    };

if tokens.len() == 0 {
  return Ok(None)
}

Do you think this is the right approach if for whatever reason the input data is not completely valid for the function abi?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants