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

Import jsonrpc crate #19

Merged
merged 3 commits into from
Aug 30, 2024
Merged

Import jsonrpc crate #19

merged 3 commits into from
Aug 30, 2024

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented Aug 22, 2024

Import the rust-jsonrpc crate from
https://github.com/apoelstra/rust-jsonrpc using current tip of master

59646e6 Merge apoelstra/rust-jsonrpc#119: Use rust-bitcoin-maintainer-tools and re-write CI

Full commit hash: 59646e6e6ac95f07998133b1709e4a1fa2dbc7bd

Do so using the following commands:

mkdir jsonrpc
mkdir jsonrpc/contrib
rsync -avz ../../rust-jsonrpc/master/README.md jsonrpc rsync -avz ../../rust-jsonrpc/master/src jsonrpc
rsync -avz ../../rust-jsonrpc/master/contrib/test_vars.sh jsonrpc/contrib

Then:

  • Update contrib/crates.sh to include jsonrpc.
  • Remove workspaces from jsonrpc/Cargo.toml.
  • Add jsonrpc to repository workspace.

Finally import fuzzing, and fix up to mimic current rust-bitcoin setup.

@tcharding
Copy link
Member Author

tcharding commented Aug 22, 2024

Is this an acceptable way to do this? Still todo

  • Bring over the fuzzing.
  • Look at the integration tests.
  • Patch the manifest so we use the local jsonrpc in builds.

@tcharding
Copy link
Member Author

cc @apoelstra

@apoelstra
Copy link
Member

As a strategy for moving jsonrpc that works for me.

Did we agree though to move jsonrpc? I'd have to think a bit about whether that's what we want to do. In theory it's a general-purpose jsonrpc crate, though in practice we've pretty-much ignored bug reports that come from non-bitcoind users. (Although those reports are just "this doesn't support SSL" 95% of the time, and we did fix that.)

@tcharding
Copy link
Member Author

Did we agree though to move jsonrpc?

Yeah I believe we did, remember it was the idea put together all the stuff that we feel "obligated by honour" to provide and maintain.

@apoelstra
Copy link
Member

Ah, yeah, that makes sense. I remember that conversation but I guess it didn't occur to me that it'd mean moving jsonrpc into this repo.

Let's do it!

@tcharding
Copy link
Member Author

tcharding commented Aug 23, 2024

We can move this repo to rust-bitcoin org first if you'd prefer it to not transition through my user account. That might look better, really.

@apoelstra
Copy link
Member

Sure -- ACked in the discussion you opened about it. But you need to do the transfer since it's coming from your org.

@tcharding tcharding force-pushed the 08-22-import-jsonrpc branch 2 times, most recently from 07dddfd to 5877e80 Compare August 23, 2024 22:27
@tcharding
Copy link
Member Author

Hey @apoelstra I'm not sure what to do about fuzzing jsonrpc, the fuzz tests test that rubbish read back from a socket doesn't cause us to crash, which seems like a good test but I don't think we need to run it or an hour like we do in the rust-bitcoin cron job. Do you have a suggestion for how we should go about running it here?

@apoelstra
Copy link
Member

Is there any harm in running it for an hour? If we're running it on a GA runner that's probably more like 5-10 minutes on a normal computer.

But if you want to change it we could add a variable to our fuzz runner to make this configurable.

@tcharding
Copy link
Member Author

Lets run it for an hour then.

Import the `rust-jsonrpc` crate from
https://github.com/apoelstra/rust-jsonrpc using current tip of master

`59646e6 Merge apoelstra/rust-jsonrpc#119: Use rust-bitcoin-maintainer-tools and re-write CI`

Full commit hash: 59646e6e6ac95f07998133b1709e4a1fa2dbc7bd

Do so using the following commands:

mkdir jsonrpc
mkdir jsonrpc/contrib
rsync -avz ../../rust-jsonrpc/master/README.md jsonrpc
rsync -avz ../../rust-jsonrpc/master/src jsonrpc
rsync -avz ../../rust-jsonrpc/master/contrib/test_vars.sh jsonrpc/contrib

Then:

- Update `contrib/crates.sh` to include `jsonrpc`.
- Remove workspaces from `jsonrpc/Cargo.toml`.
- Add `jsonrpc` to repository workspace (and add patch section).

Note, this PR does not bring over the `fuzz` directory, that will be
done separately. Also we do not copy the integration testing because
we get sufficient coverage from the current integration tests.
@tcharding tcharding force-pushed the 08-22-import-jsonrpc branch from 5877e80 to 53812e6 Compare August 29, 2024 02:36
@tcharding tcharding marked this pull request as ready for review August 29, 2024 02:36
fuzz/README.md Outdated

Currently we only fuzz `jsonrpc`, the fuzz code was imported along
with the `jsonrpc` import from `github.com/apoelstra/rust-jsonrpc`
commit hash: `59646e6e6ac95f07998133b1709e4a1fa2dbc7bd` which is
Copy link
Member

Choose a reason for hiding this comment

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

In 53812e6:

Trailing whitespace, and run-on sentence.

But I don't think any part of this README is necessary other than maybe the "Note to devs". People reading the code don't care what archived repo it came from, don't know who "I" is, and would probably like to know how to run the fuzzer (this information is not in the README as written).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair, will re-spin.

Import the fuzzing from `jsonrpc`

source: https://github.com/apoelstra/rust-jsonrpc
commit hash: `59646e6e6ac95f07998133b1709e4a1fa2dbc7bd`
commit: `59646e6 Merge apoelstra/rust-jsonrpc#119: Use rust-bitcoin-maintainer-tools and re-write CI`

Then I update the `generate-files.sh` script to mimic a recent one from
`rust-bitcoin`.

Add a README explaining how we got to the current state.
@tcharding tcharding force-pushed the 08-22-import-jsonrpc branch from 53812e6 to 7238857 Compare August 29, 2024 20:22
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 7238857 successfully ran local tests

@apoelstra apoelstra merged commit 79a7390 into master Aug 30, 2024
27 checks passed
@apoelstra apoelstra deleted the 08-22-import-jsonrpc branch August 30, 2024 13:50
@tcharding tcharding mentioned this pull request Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants