Skip to content

Conversation

@jaoleal
Copy link
Collaborator

@jaoleal jaoleal commented May 5, 2025

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

Description

Fix #378

This commit present some changes for gettxoutproof, adding the optional blockhash
input which will make the method interns differ, searching for the transactions
inside the specified block, otherwise, the previous default behavior of getting it
from the wallet cache remains. The method now receives an array of txids instead of
just one.

Also, now named gettxoutproof, was gettxproof.

A unused #[allow(unused)] was also removed from merkle.rs

Notes to the reviewers

While trying to fork and just complete #379 to accomplish one of 0.8.0 milestones i noticed some opportunities to optimize some decisions and add two new fixes to the #378 issue. (1. and 2.)

Still validating if the changes are effective and are working.

Author Checklist

  • I've followed the contribution guidelines
  • I've verified one of the following:
    • Ran just pcc (recommended but slower)
    • Ran just lint-features '-- -D warnings' && cargo test --release
    • Confirmed CI passed on my fork
  • I've linked any related issue(s) in the sections above

Finally, you are encouraged to sign all your commits (it proves authorship and guards against tampering—see How (and why) to sign Git commits and GitHub's guide to signing commits).

@Davidson-Souza Davidson-Souza added bug Something isn't working RPC Changes something with our JSON-RPC interface labels May 5, 2025
@Davidson-Souza Davidson-Souza mentioned this pull request May 6, 2025
5 tasks
@jaoleal jaoleal marked this pull request as ready for review May 6, 2025 18:27
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 3 times, most recently from 9ff7536 to 9a8bed0 Compare May 7, 2025 16:39
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 7, 2025

Applied @Davidson-Souza requests and rewrote the commit message, now appears to better explain whats being done here.

Refer to the PR description to read the last commit message

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from 9a8bed0 to a336c21 Compare May 7, 2025 18:11
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 7, 2025

Applied @Davidson-Souza s suggestions. (#472 (comment))

@jaoleal jaoleal marked this pull request as draft May 8, 2025 19:04
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 6 times, most recently from bfd35e8 to 32699d5 Compare May 14, 2025 16:05
@jaoleal jaoleal marked this pull request as ready for review May 14, 2025 18:40
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 4 times, most recently from 127f778 to 248ceef Compare May 14, 2025 19:21
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from 248ceef to 19d5ff7 Compare May 14, 2025 19:42
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 15, 2025

332e69d, made the command succeed exactly with cores api, you can check this by yourself.

floresta-cli gettxoutproof '["5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2"]' 000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6

"01000000ba8b9cda965dd8e536670f9ddec10e53aab14b20bacad27b9137190000000000190760b278fe7b8565fda3b968b918d5fd997f993b23674c0af3b6fde300b38f33a5914ce6ed5b1b01e32f570200000002252bf9d75c4f481ebb6278d708257d1f12beb6dd30301d26c623f789b2ba6fc0e2d32adb5f8ca820731dff234a84e78ec30bce4ec69dbd562d0b2b8266bf4e5a0105"

and this is from a bitcoin core node (Im using a gambiarra with jq and a public node)

[nix-shell:~]$ btc-rpc gettxoutproof '["5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2"]' 000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6

{
  "jsonrpc": "2.0",
  "id": "curl",
  "result": "01000000ba8b9cda965dd8e536670f9ddec10e53aab14b20bacad27b9137190000000000190760b278fe7b8565fda3b968b918d5fd997f993b23674c0af3b6fde300b38f33a5914ce6ed5b1b01e32f570200000002252bf9d75c4f481ebb6278d708257d1f12beb6dd30301d26c623f789b2ba6fc0e2d32adb5f8ca820731dff234a84e78ec30bce4ec69dbd562d0b2b8266bf4e5a0105"
}

cc @Davidson-Souza

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from 19d5ff7 to 332e69d Compare May 15, 2025 18:10
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

I've tested it and it seems to work fine. Cross checked with core and it seems right.

Some comments about the code

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from 082929c to adeface Compare May 19, 2025 15:10
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 4 times, most recently from d3e0c53 to f50525d Compare May 19, 2025 15:21
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 19, 2025

Added @Davidson-Souza Suggestions on f50525d

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from f50525d to 64b0536 Compare May 19, 2025 15:39
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 19, 2025

Added @Davidson-Souza Suggestions on 64b0536

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 2 times, most recently from 39a78fb to ae109bd Compare May 19, 2025 19:33
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 19, 2025

signed and retriggered the buggy CI

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from ae109bd to 8cf8de4 Compare May 20, 2025 00:50
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 20, 2025

Noooow its done, forgot to exclude floresta-cli from cargo.toml. thanks @Davidson-Souza

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from 8cf8de4 to a7047df Compare May 20, 2025 00:54
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 2 times, most recently from 4101b88 to 0dcba9c Compare May 20, 2025 19:22
@jaoleal jaoleal requested a review from Davidson-Souza May 20, 2025 19:52
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

I think something got messed up in some rebase, because you're still changing the florestad Cargo.toml.

Everything else looks fine

@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch 2 times, most recently from a7d7a60 to e60d583 Compare May 22, 2025 15:00
@jaoleal
Copy link
Collaborator Author

jaoleal commented May 22, 2025

I think something got messed up in some rebase, because you're still changing the florestad Cargo.toml.

Everything else looks fine

Yes, strange... The change now is being triggered by lint, not by me.

Applied @Davidson-Souza suggestions in e60d583

This commit present some changes for gettxoutproof, adding the optional blockhash
input which will make the method interns differ, searching for the transactions
inside the specified block, otherwise, the previous default behavior of getting it
from the wallet cache remains. The method now receives an array of txids instead of
just one.

A unused #[allow(unused)] was also removed from merkle.rs

Also, now named gettxoutproof, was gettxproof.
@jaoleal jaoleal force-pushed the rpcsaga_addblockhashtogettxoutproof branch from e60d583 to aebb3ac Compare May 22, 2025 15:46
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ACK aebb3ac

@Davidson-Souza Davidson-Souza merged commit 23e1dc9 into vinteumorg:master May 22, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working RPC Changes something with our JSON-RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Floresta-CLI gettxproof command don't work with blockhashs argument passed

3 participants