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

block numbers in arbitrum deployment appear bugged #249

Open
mentheosis opened this issue Sep 22, 2023 · 5 comments
Open

block numbers in arbitrum deployment appear bugged #249

mentheosis opened this issue Sep 22, 2023 · 5 comments

Comments

@mentheosis
Copy link

when querying allocations from https://thegraph.com/hosted-service/subgraph/graphprotocol/graph-network-arbitrum - the fields createdAtBlockNumber and closedAtBlockNumber appear to return invalid values - e.g. this result:

"allocations": [
{
"id": "0x0001b044ebd481afef0545f431fe275980e69e09",
"createdAtBlockNumber": 18176693,
"createdAt": 1695207989
},

that timestamp is for today, but that blocknumber was in 2022 on arbitrum
Can anyone from the foundation plz advise? I believe this is a bug in the subgraph

@juanmardefago
Copy link
Collaborator

That's not actually a bug, but an intended feature.
The contracts in Arbitrum use the L1 block number internally, so the subgraph has to also do that as well, so what you are actually seeing is the L1 block number for that moment in time, rather than the L2 block number (which is what I'm assuming you were thinking it was)

@mentheosis
Copy link
Author

mentheosis commented Oct 26, 2023

On the mainnet deployment, its possible to query allocations, take the closedAtBlockNumber, and then query something like delegatedStaked where block=closedAtBlockNumber. This is not possible for arbitrum allocations with the feature as youve described., because the block number in the where clause is the arbitrumBlockNumber not the L1 block.

Would you consider including the arbitrumBlockNumber as an additional valuable field in this schema? Or can you recommend a way to look up arbitrum block number by timestamp or something? (also note that arbitrum block number is distinct from L2 block number per these docs: https://docs.arbitrum.io/for-devs/concepts/differences-between-arbitrum-ethereum/block-numbers-and-time)

@juanmardefago
Copy link
Collaborator

If you are trying to use the block number (L1 block number) to run time-travel queries, then yeah, it's not gonna work as you expect it.
We could add the L2 block number that would allow you to run that query though, as you mentioned.

BTW, when we talk about L1 block number, we are talking about the L1 block number that's currently accesible in L2 (what the docs you linked call L2 block.number) and when we talk about L2 block number, we talk about the native L2 block (what the docs you linked call arbitrum block number)

@juanmardefago
Copy link
Collaborator

Not sure when we could release this though, as we are quite busy trying to ship other features.
Hopefully soon though!

@mentheosis
Copy link
Author

ok, I will eagerly await whenever its able to be prioritized, thanks!

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

No branches or pull requests

2 participants