-
Notifications
You must be signed in to change notification settings - Fork 168
Upgrade bitcoin to the upcoming 0.32.0-rc.0 release
#874
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
base: master
Are you sure you want to change the base?
Conversation
FYI claude left the repo with a broken build. I fixed the build as a
separate patch for reasons listed below.
First I got claude to create a CLAUDE.md file. Then I pointed it at:
- A local `rust-bitcoin` directory on the release tracking branch
rust-bitcoin/rust-bitcoin#5169
- The docs online for `bitcoin v0.32.7`
- The `rust-miniscript` repo
And asked it to do the upgrade. It took me three goes over the weekend
to do this, hitting session limits twice.
I am pushing the raw changes Claude made so:
- I can review them in public
- We can learn how good/bad Claude is for doing upgrades
|
cc @LLFourn because he got me started on Claude. |
|
Whew. I wonder if we can update |
|
ooo, that's a nice idea. I'm keen for Saturday morning |
c14c19b to
b43197b
Compare
|
I didn't end up exploring the upgrade-secp-first-route. I started but stopped, now I think more I'd like to try:
This would mean this PR becomes void, I personally do not want to run claude again to do the upgrade because it took me 5 days and was boring as hell. Still looking for another way to progress. FTR I spent a fair bit of time reviewing this and still didn't get all the way through but here is what I found: # Notes for upgrading to bitcoin 0.33.0-beta.0
The non-trivial things are:
- script tagging
- secp context removal
Kind of trivial things:
- input/output -> inputs/outputs
- secp Into<Message> thing, causes addition/removal of `*` and `&`
- from_ apis have changed to more idiomatic names
- Default removed
- txout.value -> txout.amount
Things now disallowed on purpose:
- The hashes wrapper types cannot hash arbitrary data so there is a
bunch of casting required.
## Thing to improve the CLAUDE.md file with
- Only fix build errors not warnings (eg don't fix warnings about
deprecated function calls).
- Use `Amount::from_sat_u32` instead of `Amount::from_sat().unwrap()`
## Things claude did well
- using `_` to rename secp context function paramater instead of removing it
- Worked out which associated consts to use instead of `default`
### Script tagging questions
- Do we want to favour one script type over the others in test code?
- Basically anything that does not have a local varibale name of
function name that hints at the type needs checking by Andrew (or
Tobin needs to upgrade his bitcoin script knowledge - or both).
- Is script code a `ScriptPubKey` some other type?
## Bitcoin API questions
- Does the `XOnlyPublicKey` API have holes in it?
- Are we happy with users having to reach into `bitcoin::script` to
get the new script types.
## Things I did not look too closely at - assuming they are correct
- error type changes
# TMP
Reviewed upto interpreter/mod.rs
|
This is an experimental PR, not a merge candidate.
The aim is to see if Claude can do the upgrade without too much intervention, or what intervention is likely required. If we can work this out other downstream projects can do the same - WIN.
Two patches, the first does the upgrade but leaves tests failing. The second fixes the tests. Both are raw, ie no changes from me. And I have yet to review closely [0] because I want to do so in public (also the script tagging changes are at my knowledge boundary at best).
Process used
bitcoin 0.33.0-rc.0rust-bitcoin#5169 checkout out. I prompted it to make a CLAUDE.md file (committed), props to @tnull for the idea.jj.(I thing, IIRC, at some stage I told it not to bother with rustdocs fixes.)
Lessons
As usual, in my experience, this was painful still but not as painful as doing it manually (which I and @mpbagot have both tried a few times). I maxed by session limit 3 times [1]. On top of that I it took me 5 days in total to do this because the bot kept stopping and asking if I wanted it to fix the remaining errors / tests even when I repeatedly said variations of 'fix all the errors" (yes by the end there were a bunch of f and c words in there too).
Questions
Next steps
corepcusing the CLAUDE.md file we come up withI'm not exactly sure how to continue with CI fails. I definitely don't want to start from scratch because Claude is so slow at the task.
[0] I'm not sure when I'll get to it since 5 days of this has already bored me of the task
[1] I'm on the $20 a month plan.