Skip to content

Conversation

@jaoleal
Copy link
Collaborator

@jaoleal jaoleal commented Jan 17, 2026

Description and Notes

#682 introduced changes that brought getblock rpc method closer to bitcoin core behavior. The changes presented here make the internal method signature to match the specification.

@jaoleal jaoleal changed the title Assert getblock corecompatible test: Assert getblock corecompatible Jan 17, 2026
@Davidson-Souza Davidson-Souza added the RPC Changes something with our JSON-RPC interface label Jan 17, 2026
@Davidson-Souza Davidson-Souza changed the title test: Assert getblock corecompatible test: Assert getblock core compatible Jan 17, 2026
@Davidson-Souza Davidson-Souza marked this pull request as draft January 17, 2026 18:22
@Davidson-Souza
Copy link
Member

Marking as draft since it depends on #682

@jaoleal jaoleal force-pushed the assert_getblock_corecompatible branch 6 times, most recently from 4467f93 to 0f0dd5f Compare January 21, 2026 14:16
@jaoleal jaoleal marked this pull request as ready for review January 21, 2026 14:17
@jaoleal
Copy link
Collaborator Author

jaoleal commented Jan 21, 2026

Marking as ready to review

cc @Davidson-Souza @moisesPompilio

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.

What 781efaf achieves that tests/floresta-cli/getblock.py don't?


use crate::rpc_types::GetBlockRes;

pub fn getblock_data(verbose: bool) -> GetBlockRes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

verbose is not a bool but a numeric type, I think we need to fix this here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just a internal helper to return the data, It does not need to be fallible yet neither needs to be api compatible. The bool can express both verbosity we support rn

use crate::test_data::getblock_data;

struct Florestad {
pub struct Florestad {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any reason to make this public?

@jaoleal jaoleal force-pushed the assert_getblock_corecompatible branch from 0f0dd5f to 17161d2 Compare January 21, 2026 16:21
@jaoleal
Copy link
Collaborator Author

jaoleal commented Jan 21, 2026

Applied suggestions on 17161d2

@jaoleal
Copy link
Collaborator Author

jaoleal commented Jan 21, 2026

What 781efaf achieves that tests/floresta-cli/getblock.py don't?

Its easy to run

@Davidson-Souza
Copy link
Member

Its easy to run

That's not a reason to have two modules doing the same thing. Specially given that this doesn't test things like chain work and mtp calculation.

I like 17161d2, but NACK c733bbf

@jaoleal
Copy link
Collaborator Author

jaoleal commented Jan 22, 2026

Really ? Honestly i see value in this, the idea is not to compete or to replace the python tests, as you said and I briefly tried to imply is that the python tests indeed deliver more assertion value but in the cost of having a lot more dependencies, including the environment setup needed.

The value i see in this lives in the case where we want to assert that we are not breaking any field and any other test, the older getblock test was doing this and my plan was just to expand it make a direct comparison with a bitcoin core output.

Im the "vitcim" of one of these cases, the floresta-nix packaging have these tests blacklisted exactly because its trying to get instances up and running... I cant do much in the nix part, thats how they achieved packaging determinism, but hear this propose.

Even with this i cant run the test, i had the idea to include this and to move it to be a functional test in the server without instantiating a florestad, we can make something similar as done here in extensions.rs... As you said, theres no reason to have two modules doing the same thing and we are investing a lot of time to make the python tests better, and i see these tests in floresta-rpc and indeed trying to compete against our python tests, specially because is a integration test between client and server.

If youre willing to accept #787 we wont need to check if we are parsing the arguments correctly because im literally just getting the args from FlorestaRpc and passing to rust-bitcoin`s jsonrpc... And they already tested their client

@Davidson-Souza
Copy link
Member

Im the "vitcim" of one of these cases, the floresta-nix packaging have these tests blacklisted exactly because its trying to get instances up and running... I cant do much in the nix part, thats how they achieved packaging determinism, but hear this propose.

That could as well be in the PR description. I did not understand what you were doing here because it just says

It asserts that #682 is indeed working

so does getblock.py. Since the goal here is to make it a simple functional test like the others we already have (and have a use-case for it), things are different. Not a big fan of this json approach, tho. All other tests leave the values inside the test itself.

@jaoleal
Copy link
Collaborator Author

jaoleal commented Jan 22, 2026

I did not understand what you were doing here because it just says

Im well aware of that, Im really focusing on being clear following your suggestion. Sincerely, I was frustrated to be spending more time writing and reviewing my writing than actually coding and contributing, as the time goes im improving that to be more efficient. Thanks for the patience.

so does getblock.py. Since the goal here is to make it a simple functional test like the others we already have (and have a use-case for it), things are different. Not a big fan of this json approach, tho. All other tests leave the values inside the test itself.

Well, I might change that, we can hardcode these same values directly in types(maybe implementing default ?), I used the raw json because its literally a copy-paste from what i got from bitcoin core... regarding having simple and lightweight functional tests server side, are there any cons ?

Also, I want to bring up the point that we are doing a lightweight node with the objective to run on constrained devices, I think its important to have tests that people can actually run without much trouble, and that, getblock.py does not achieve... And its fairly easy to have the tests that Im proposing

@jaoleal jaoleal force-pushed the assert_getblock_corecompatible branch from 17161d2 to 6a7bcd4 Compare February 3, 2026 11:51
@jaoleal
Copy link
Collaborator Author

jaoleal commented Feb 3, 2026

Okay, dropped the commit that was actually extending the tests.

Ill present the same changes with different approach later

@Davidson-Souza
Copy link
Member

Ill present the same changes with different approach later

Are you planning to do this on this PR or another one? If you want to do it here, please mark it as draft

For new approach, I recommend just following the same approach taken by other tests in this file.

@jaoleal
Copy link
Collaborator Author

jaoleal commented Feb 3, 2026

Yes, another PR

@jaoleal
Copy link
Collaborator Author

jaoleal commented Feb 3, 2026

For new approach, I recommend just following the same approach taken by other tests in this file.

Im not sure if i got this correctly. What you mean by "the same approach" ?

@jaoleal jaoleal force-pushed the assert_getblock_corecompatible branch from 6a7bcd4 to 1aa4c6a Compare February 4, 2026 15:13
@jaoleal jaoleal force-pushed the assert_getblock_corecompatible branch from 1aa4c6a to d36a64d Compare February 4, 2026 15:19
Davidson-Souza
Davidson-Souza previously approved these changes Feb 4, 2026
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 d36a64d

@moisesPompilio
Copy link
Collaborator

ACK b37772d

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 b37772d

@Davidson-Souza
Copy link
Member

@jaoleal can you update the PR description, please?

@jaoleal
Copy link
Collaborator Author

jaoleal commented Feb 9, 2026

Changed the pr description but im still unable to alter the name of the PR.

Maybe chore(rpcserver): Match signature of getblock to its rpc, same as the pr commit message, would be good.

@Davidson-Souza Davidson-Souza changed the title test: Assert getblock core compatible chore(rpcserver): Match signature of getblock to its rpc Feb 9, 2026
@Davidson-Souza Davidson-Souza merged commit a323d74 into getfloresta:master Feb 9, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC Changes something with our JSON-RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants