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

Support eth_subscribe with "logs" param #27283

Closed
bbondy opened this issue Dec 9, 2022 · 3 comments · Fixed by brave/brave-core#16633
Closed

Support eth_subscribe with "logs" param #27283

bbondy opened this issue Dec 9, 2022 · 3 comments · Fixed by brave/brave-core#16633
Assignees
Labels
feature/web3/wallet/core feature/web3/wallet Integrating Ethereum+ wallet support OS/Android Fixes related to Android browser functionality OS/Desktop OS/iOS Fixes related to iOS browser functionality priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass - Android Tab QA Pass-Win64 QA/Yes release-notes/include

Comments

@bbondy
Copy link
Member

bbondy commented Dec 9, 2022

Expand on the support added here for newHeads #21350
The new support should support the "logs" param.

To support "logs" we need to periodically call JsonRpcService::EthGetLogs as needed instead of using the BlockTracker.
Check metamask as the reference.

Heres some sample code to use in a JS console of any HTTPS page:

window.ethereum.on('message', (x, y, z) => console.log('message event: ', x, y, z))
window.ethereum.send({ id:1, method: 'eth_subscribe', params:['logs', {"address":  "0xD9C2ec046dBbDe5e670D27250cf3385300062C5d",  "topics":  ["0x2edcb8328dc82dc24d7a2b50a94f19db11146048d396320228feb7c79c3301e1"]}]}, console.log)
@bbondy bbondy added this to Web3 Dec 9, 2022
@bbondy bbondy moved this to Backlog in Web3 Dec 9, 2022
@bbondy bbondy added feature/web3/wallet Integrating Ethereum+ wallet support priority/P3 The next thing for us to work on. It'll ride the trains. labels Dec 9, 2022
@bbondy bbondy changed the title Support eth_subscribe with logs option Support eth_subscribe with "logs" param Dec 9, 2022
@vadimstruts vadimstruts linked a pull request Jan 12, 2023 that will close this issue
25 tasks
@SergeyZhukovsky SergeyZhukovsky moved this from Backlog to In Progress in Web3 Jan 12, 2023
@brave-builds brave-builds added this to the 1.49.x - Nightly milestone Jan 16, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Web3 Jan 16, 2023
@vadimstruts vadimstruts added the OS/Android Fixes related to Android browser functionality label Jan 16, 2023
@vadimstruts
Copy link
Collaborator

Created issue: 27842 that is follow up the current one

@srirambv
Copy link
Contributor

srirambv commented Mar 1, 2023

Verification passed on

Brave 1.49.108 Chromium: 110.0.5481.104 (Official Build) beta (64-bit)
Revision 46de4a7f41979e829b430bc1ee30ef483aa227ac-refs/branch-heads/5481_77@{#19}
OS Windows 11 Version 22H2 (Build 22621.755)
  • Verified steps from brave/brave-core#16633
  • Verified eth_subscribe listens to logs and shows output every 20 secons
  • Verified eth_unsubscribe stops logging
27283.mp4

@srirambv
Copy link
Contributor

srirambv commented Mar 8, 2023

Verification passed on Lenovo Tab with Android 12 running 1.49.118 x64 build

  • Verified steps from brave/brave-core#16633
  • Verified eth_subscribe listens to logs and shows output every 20 secons
  • Verified eth_unsubscribe stops logging
27283.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/web3/wallet/core feature/web3/wallet Integrating Ethereum+ wallet support OS/Android Fixes related to Android browser functionality OS/Desktop OS/iOS Fixes related to iOS browser functionality priority/P3 The next thing for us to work on. It'll ride the trains. QA Pass - Android Tab QA Pass-Win64 QA/Yes release-notes/include
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants