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

updates to newer jsonrpc dependencies containing swappable transports #180

Merged
merged 2 commits into from Jul 5, 2021

Conversation

ProofOfKeags
Copy link
Contributor

This is similar to #154 but it seems that has stalled. I fixed the "temporary hack" found in #154 as well.

I ran the integration tests against regtest and everything seems to work. Seems like we should get this in so that we can create a tor transport.

My question separately from this PR is where should the work for adding tor transports go? Should it be part of the actual jsonrpc library? Should it be part of this package? or should it be its own package entirely?

@ProofOfKeags
Copy link
Contributor Author

The build only seems to fail on Rust 1.29 Is it necessary/desirable for me to adjust changes to be 1.29 compatible?

@sgeisler
Copy link
Contributor

The build only seems to fail on Rust 1.29 Is it necessary/desirable for me to adjust changes to be 1.29 compatible?

For now, yes. Our MSRV might change later this year,please see rust-bitcoin/rust-bitcoin#510 for more details.

@sgeisler
Copy link
Contributor

Oh, sorry, I didn't even look at the problem and assumed it was just an issue with the code, but it seems the fault of our build system, let me check …

@ProofOfKeags
Copy link
Contributor Author

It looks like theres a bunch of danging dependency pins happening in the contrib script for 1.29. I'm zeroing in on now, but if you know the answer please feel free to update the PR.

@sgeisler
Copy link
Contributor

So, the problem is that some dependencies change their MSRV in minor releases but that's a breaking change for us. So we need to pin these dependencies. Over time more and more did so and e.g. the log dependency exists in two different major versions making pinning even harder because now I need to specify which one I want to pin (that's why I did the weird parsing with sed there). I don't know what exactly failed though, gotta play around with it a bit.

@ProofOfKeags
Copy link
Contributor Author

The newest commit I have seems to have solved the 1.29 issue. I'll let the rest of the build play out and see if I broke anything else in the process.

@ProofOfKeags
Copy link
Contributor Author

OK. I've finally reached a point where the source itself is failing here. It looks like the raw value calls were not in serde_json at the pinned dependency height. The question is, can I update the pinned dependency, or am I gonna have to hack the code to have conditional compilation of the code in question.

@sgeisler
Copy link
Contributor

You can try to increase the version, but the probability for the pinning-reason still existing is quite high. So you might end up with conditional compilation or just bite the bullet and use to_value. Idk how bad the performance penalty would be.

@ProofOfKeags
Copy link
Contributor Author

Is Travis CI down?

@sgeisler sgeisler closed this May 24, 2021
@sgeisler sgeisler reopened this May 24, 2021
@sgeisler
Copy link
Contributor

sgeisler commented May 24, 2021

Maybe they are doing brown-outs to prepare us for them shutting down? Idk, need to investigate, we should probably move to GH actions anyway. Maybe you could try amend+force pushing later.

@ProofOfKeags
Copy link
Contributor Author

OK it looks like I've satisfied the build. Should I squash all my commits down to one?

@ProofOfKeags
Copy link
Contributor Author

Can I get some eyes on this now? @sgeisler

Copy link
Contributor

@sgeisler sgeisler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, but idk if we want to do it like that now or think about the design of jsonrpc again @apoelstra.

Minor nit: please don't mix formatting changes with actual ones, but I think it's still clear enough here.

I'm quite happy to see that apparently we can remove some version pinning without everything breaking 😃

client/src/client.rs Show resolved Hide resolved
client/src/client.rs Show resolved Hide resolved
@ProofOfKeags
Copy link
Contributor Author

I am happy to fix small things about the PR however I'd strongly request that "rethinking the design" doesn't prevent this from getting merged as there are several upstream projects that need to be able to plug into Bitcoin Core nodes that are hosted on .onion addresses. This is the least invasive change required to be able to support those use cases as best I can tell.

@sgeisler
Copy link
Contributor

I agree, that sounds like an important feature, I wasn't aware of that.

Copy link
Contributor

@sgeisler sgeisler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great, not terrible. I'd much rather re-engineer the whole API, but Tor support is important for downstream users, and this PR enables that. So I think it's worth merging and cutting a new release and worrying about overengineering it later. What do you think @stevenroose?

@sgeisler sgeisler requested a review from stevenroose May 28, 2021 18:33
@apoelstra
Copy link
Member

This looks fine to me. The choice between RawValue and Value is far from straightforward. I had a discussion with Steven about this a long time ago and he convinced me that it would usually result in fewer allocations in total.

@ProofOfKeags
Copy link
Contributor Author

Sooooo can we merge it then?

@ProofOfKeags
Copy link
Contributor Author

Bump.

client/Cargo.toml Outdated Show resolved Hide resolved
@apoelstra
Copy link
Member

I think this is good to go, other than the nit abuot serde_json which I don't think is blocking.

@stevenroose @sgeisler can I merge this?

… used due to rust 1.29 compatibility requirements
@sgeisler
Copy link
Contributor

All clear from my side!

@ProofOfKeags
Copy link
Contributor Author

Is @stevenroose required to merge this? It seems he is not going to respond.

@sgeisler
Copy link
Contributor

sgeisler commented Jul 5, 2021

Ideally yes, but he was very absent so I'll just merge it now. At some point we'd also need to cut a release, there we'll need him anyway afaik.

@sgeisler sgeisler merged commit 54a427f into rust-bitcoin:master Jul 5, 2021
@ProofOfKeags
Copy link
Contributor Author

Has anyone heard from him recently? This change holds up bwt's ability to support tor nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants