Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add Websocket support #14

Closed
wants to merge 12 commits into from
Closed

Conversation

ewingrj
Copy link
Contributor

@ewingrj ewingrj commented Sep 14, 2017

#11

I didn't add tests for subscriptions as that would require upgrading to web3 1.0, and there are many changes to be made. I can write tests and update to 1.0 if needed.

@onbjerg onbjerg mentioned this pull request Sep 14, 2017
@onbjerg
Copy link

onbjerg commented Sep 14, 2017

Cool! I would advise against updating to Web3 1.0.0 in this PR, that should be a seperate PR, since synchronous calls would need to be implemented as well (see #15).

@ewingrj
Copy link
Contributor Author

ewingrj commented Nov 28, 2017

@benjamincburns any idea when/if this will get merged?

@benjamincburns
Copy link
Contributor

@perissology I've got a separate branch with similar changes plus the test maintenance. I'm embarrassed to say that I forgot this PR existed when I did that work. My own branch w/ the test maintenance is blocked by web3/web3.js#1191 being merged, as it fixes web3/web3.js#1188.

Since my implementation doesn't yet have subscription support, I'll likely take your implementation and merge in just my tests. I can't do that however until that bug I mentioned is fixed, and I can't accept your changes until I have test coverage from them.

So that's a lot of words to say:

  1. Thanks for submitting this.
  2. I'm a doofus for duplicating your effort.
  3. I'm taking active steps to make this mergeable today.
  4. Unfortunately there's nothing left for you to do but wait. Hopefully it won't be long until @frozeman gets a chance to review my last round of changes.

@benjamincburns
Copy link
Contributor

Update on this: I've just submitted what I believe will be the final change necessary to get this effort unblocked. I won't be able to publish until the web3 fix is released properly, but barring bugs or other nasty surprises, I'm hoping to be able to get this into the develop branch by the end of the week

@onbjerg
Copy link

onbjerg commented Dec 19, 2017

That's a fine Christmas present, thank you @benjamincburns and @perissology 🎅

@benjamincburns
Copy link
Contributor

@onbjerg & @perissology it seems the fix for web3 was released on the 21st. I didn't realize this, so I just now committed the update and pushed it to the websockets branch. This isn't a complete fix for all the test maintenance issues I was having, but it has me unblocked, nonetheless.

It's Christmas day here in New Zealand, so I'll get back to this first thing tomorrow. Specifically I'll review my own changes against @perissology's and take the best from both. Thanks for your patience and help on this, everyone!

@chentschel
Copy link

Guys, this is an awesome work. When do you think you'll merge it into the main branch?

@benjamincburns
Copy link
Contributor

@perissology I reached out to you on Gitter, but I'll give a quick update here since @chentschel requested a progress update.

Yesterday I pulled down this branch, rebased it on current develop, and did a git checkout websockets test/, and I've been pulling in other changes from my websockets branch as needed. Provided that I have access to do so (I think I do?) I'll go ahead and push my WIP changes into this PR shortly. @perissology due to the rebase (was necessary for test maintenance), this will involve a git push -f, so you'll need to handle that w/ your local copy accordingly.

The big stumbling block I'm hitting is subscriptions. I'm hitting a few problems there:

  1. With this PR, all of the subscription management logic was tightly coupled to the websockets server, meaning that I can't call eth_subscribe when using the embedded ganache provider.
  2. Also in the coupling/cohesion camp, the subscription management really needs to be split into a subprovider, with the routing of notifications by ID handled by the server's ConnectionManager component.
  3. Web3 1.0 doesn't seem to fall back to eth_newFilter and friends when subscribing to events using an HTTP provider. There's nothing I can do about this apart from raising an issue and perhaps submitting a PR. I'll raise the issue shortly, but I likely won't consider submitting the PR a super high priority.
  4. The subscription subprovider I mentioned in (2) really should go into metamask/provider-engine. They already have an open issue for this, so I've reached out to them there.

I've got WIP on the above, which I'll add to this PR shortly.

I'm going to be traveling for four days starting tomorrow (be back on the 31st New Zealand time, 30th USA time). I think realistically I'll likely have the big chunks of this done today, but it will be the middle of next week until this PR is likely going to be ready to merge.

I'd be all kinds of happy to host a group review session on this work sometime on the 3rd or later next week via video chat. I've invited @perissology to schedule a time which suits him or her best via my Calendly. If other people are interested in participating, please speak up here and I'll post the scheduling and video conferencing details for others to join.

@benjamincburns
Copy link
Contributor

Going to move status update conversation back over to #257. For those looking for info on when this will be done, please check over there.

@benjamincburns
Copy link
Contributor

Closing this PR in favor of #49 which is based on these changes. Thanks once again for your contributions, @perissology!

@benjamincburns benjamincburns removed their assignment Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants