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

Missing Block Fields #145

Closed
Tracked by #126
jribbink opened this issue Mar 7, 2024 · 9 comments
Closed
Tracked by #126

Missing Block Fields #145

jribbink opened this issue Mar 7, 2024 · 9 comments
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@jribbink
Copy link
Contributor

jribbink commented Mar 7, 2024

Problem

I apologize in advance if this issue is already on the radar/tracked somewhere, but I couldn't find it.

This is tangential to the issue submitted yesterday #137. The fields returned from the eth_getBlockByHash & eth_getBlockByNumber responses are somewhat limited & are not satisfactory for some clients.

There are a number of fields missing from the spec, but in particular, ethers will fail unless the following fields are added to the response:

  • timestamp
  • difficulty
  • gasLimit
  • gasUsed
  • extraData

I think this is probably because these values are parsed by ethers, so undefined throws off the library (and others missing fields are not parsed, so they don't cause any immediate issues when making this query). The availability of these fields would fix ethers.getBlock calls, but I am unsure if any other incorrect/missing fields I didn't mention will still cause issues with other parts of the ethers API.

In general, I think it would be ideal if the Block model were at least populated with empty values (if it is not easy/possible to provide a value for these missing fields) so that clients can still parse this data without throwing errors.

Steps to Reproduce

const { ethers } = require('ethers')
const provider = new ethers.JsonRpcProvider('https://previewnet.evm.nodes.onflow.org')
provider.getBlock("latest").then(console.log)

(note: you will have to be using the current flow-evm-gateway, not the live, deployed one because you will end up seeing #137 instead)

Acceptance Criteria

Minimum, these fields listed exist in some capacity. But it is probably ideal to at least provided empty values for other fields, as mentioned, to protect against future issues.

Context

Blocking integration with clients/writing docs.

@jribbink jribbink added the Bug Something isn't working label Mar 7, 2024
@m-Peter m-Peter self-assigned this Mar 7, 2024
@m-Peter m-Peter added this to the Flow-EVM-M2 milestone Mar 7, 2024
@m-Peter m-Peter mentioned this issue Mar 21, 2024
6 tasks
@devbugging
Copy link
Contributor

@jribbink great call out

@ianthpun
Copy link

ianthpun commented Apr 8, 2024

@sideninja I noticed this was merged 4 days ago, are we able to deploy this? There seems to be a bug related to hardhats ignition deployer that this might solve 👍 thanks!

@devbugging
Copy link
Contributor

@ianthpun yes we did deploy today. Sorry was busy with some other stuff.

@devbugging
Copy link
Contributor

@ianthpun let me know if it fixes it. cc @m-Peter

@nvdtf
Copy link
Member

nvdtf commented Apr 10, 2024

Can confirm this fixed forge create for me to deploy contracts to Previewnet

@devbugging
Copy link
Contributor

Will close, feel free to reopen if something new is discovered

@ianthpun
Copy link

damn, wish I could say the same

image

let me get to the bottom of what the error is before i reopen this

@devbugging devbugging reopened this Apr 11, 2024
@devbugging
Copy link
Contributor

I will loop @m-Peter into this. Report back when you find anything @ianthpun

@m-Peter
Copy link
Collaborator

m-Peter commented May 17, 2024

@sideninja I have got this working, see comment. This is not related to any missing block fields, but a condition on confirmations that hardhat ignition performs. So I am going to close this.

@m-Peter m-Peter closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

5 participants