graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Aurora Hosted Service: contract call returns incorrect value

Open melotik opened this issue 3 years ago • 2 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? The contract calls I am making in our subgraph are returning a different value from what we get from our archival node on Aurora. Currently totalSupply returns 439515974299817635 at block 60937008 in the subgraph.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. I have a subgraph deployed logging this in order to compare the subgraph result with the archival node result. Here: https://okgraph.xyz/?q=dmelotik%2Fbastion-protocol / https://api.thegraph.com/explorer/graphql?query=%7B%0A%20%20subgraphLogs(%0A%20%20%20%20subgraphId%3A%20%22QmZd3V4KtCKNr4PASz7whfCH9EDY9U8cS3YxKCfZfNhGUD%22%0A%20%20%20%20first%3A%20100%0A%20%20%20%20order%3A%20NewestFirst%0A%20%20%20%20filters%3A%20%5B%22error%22%2C%20%22warning%22%5D%0A%20%20%20%20searchText%3A%20%22%22%0A%20%20)%20%7B%0A%20%20%20%20timestamp%0A%20%20%20%20text%0A%20%20%7D%0A%7D

What is the expected behavior? Based on the archival node result the expected result is 25499893792 which seems a lot more realistic in this scenario.

More documentation of the issue here: https://github.com/messari/subgraphs/issues/492#issuecomment-1201765026

melotik avatar Aug 01 '22 23:08 melotik

Hi @dmelotik - thanks, can you share the exact eth_call that you are executing so we can cross-check it on the RPC that we are using?

azf20 avatar Aug 03 '22 12:08 azf20

Hey @azf20 !

Chain: Aurora Contract: 0xe5308dc623101508952948b141fD9eaBd3337D99 Call: totalSupply() Block: 60937008 RPC result: 25499893792 Graph node result: 439515974299817635

melotik avatar Aug 04 '22 11:08 melotik

Hi. I think this is a provider issue, rather than a Graph Node issue. Using this as a reference for the block hash, I see a balance of 24388188895007611, which is neither of the results which you report.. Can you please verify if the eth_call shown below is correct, and if not can you share the call you are using?

{
	"jsonrpc":"2.0",
	"method":"eth_call",
	"params":[{
		"to": "0xe5308dc623101508952948b141fD9eaBd3337D99",
		"data": "0x18160ddd"
	}, {"blockHash": "0x67299d9f14bbbda82412094ee59cc993fa78c4d29393722fc5fa7f0ec5594d32"}],
	"id":1
}

Returns:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0000000000000000000000000000000000000000000000000056a4edb7cd537b"
}

azf20 avatar Aug 17 '22 13:08 azf20

@azf20 that looks correct to me. And when you say "provider issue" are you referring to Aurora's RPC that is used by the hosted service?

I have re indexed this subgraph since opening this issue, and once again it was returning different values.

melotik avatar Aug 18 '22 09:08 melotik

@dmelotik yes that is what I mean by provider issue. Can you please confirm the result you see when making the above RPC call?

azf20 avatar Aug 18 '22 11:08 azf20

@azf20 yes, when I make that call on our infura node I get 25499893792

I am getting this result using web3js, but when I do a manual POST call I get something different again...

0x00000000000000000000000000000000000000000000000000562a8dd9fc3f99 > 24253636733058969

melotik avatar Aug 18 '22 17:08 melotik

I can confirm that I'm also seeing something different:

image

Same query done a day later:

image

this-username-is-taken avatar Aug 24 '22 05:08 this-username-is-taken

Hi, interesting, thanks @this-username-is-taken - that would seem to be a general aurora issue then, rather than being graph node related?

azf20 avatar Aug 24 '22 07:08 azf20

@azf20 I agree, I made a note in their discord and an issue (https://github.com/aurora-is-near/aurora-engine/issues/591)

melotik avatar Aug 24 '22 09:08 melotik

Fixed with the new Aurora RPC

melotik avatar Sep 20 '22 19:09 melotik