-
Notifications
You must be signed in to change notification settings - Fork 28
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
PortalNetwork: Implement UltralightProvider Enhancements for EIP-1193 JSON-RPC Support #699
PortalNetwork: Implement UltralightProvider Enhancements for EIP-1193 JSON-RPC Support #699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great so far. One thing we need to address is that the provider should return JSON-RPC formatted data and not just the raw block/transaction/state data our portalnetwork.ETH
module returns. If you want to do that work as well, let me know and I can provide guidance on next steps or else I can do that in a subsequent PR.
Basically, we need to use these helpers with some slight edits that I can outline.
Please go ahead with the guidance. Would love to handle as well |
To make the provider fully EIP compliant, each of the supported methods needs to return the values formatted to match the Ethereum JSON-RPC specification. So for each method listed in the PR description, you need to verify that the values returned by that method correspond to the JSON-RPC spec. For the methods that return blocks, you can copy the the You'll need to update the For the other methods ( Also, if you can update your test script to make calls to these additional methods, that would be great. For the state related methods, you'll have to pick an account that was present in the Ethereum state in ancient chain history (so maybe before block 10000000) since the state network doesn't fully support current state yet. Let me know if you need help with this part of it. |
Got it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a commit that fixes a configuration thing I forgot about with state network and then cleans up the parameter typing within provider.ts
.
getBlockByNumber
isn't reliably returning a block yet so I need do some additional testing to see why that is since we should generally always be able to retrieve block by number. The state network calls still aren't working right so I need to also research that a bit further since state network stuff has reliably worked for me in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your work on this one!
I found one small bug in one of our portal.ETH
initializers I've fixed here as well as some response formatting on the provider methods. This has been a huge help though so thank you!
Key Enhancements:
EIP-1193 Method Support:
eth_getBlockByHash
eth_getBlockByNumber
eth_getTransactionCount
eth_getCode
eth_getBalance
eth_getStorageAt
eth_call
Error Handling:
4200
for unsupported methods.-32602
for invalid parameters.-32603
for internal errors.Removed unused methods from
provider.spec.ts