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

CHIA-1862 Fix FullNodeAPI's request_block_headers returned filter #18923

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AmineKhaldi
Copy link
Contributor

@AmineKhaldi AmineKhaldi commented Nov 22, 2024

Purpose:

This fixes a bug where request_block_headers is not accounting for removals and additions when computing the transactions filter.

Current Behavior:

request_block_headers doesn't account for removals and additions in transactions filter computation.

New Behavior:

request_block_headers takes them properly into account.

@AmineKhaldi AmineKhaldi added Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Cleanup Code cleanup labels Nov 22, 2024
@AmineKhaldi AmineKhaldi self-assigned this Nov 22, 2024
@AmineKhaldi AmineKhaldi force-pushed the fix_simplify_request_block_headers branch from 4c3c008 to 2c8e2fc Compare November 22, 2024 15:27
@AmineKhaldi AmineKhaldi marked this pull request as ready for review November 22, 2024 16:23
@AmineKhaldi AmineKhaldi requested a review from a team as a code owner November 22, 2024 16:23
Copy link

coveralls-official bot commented Nov 22, 2024

Pull Request Test Coverage Report for Build 12032420319

Details

  • 47 of 49 (95.92%) changed or added relevant lines in 2 files are covered.
  • 58 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.02%) to 91.152%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/full_node/full_node_api.py 4 6 66.67%
Files with Coverage Reduction New Missed Lines %
chia/daemon/keychain_proxy.py 1 73.16%
chia/full_node/pending_tx_cache.py 1 96.55%
chia/farmer/farmer.py 1 72.52%
chia/wallet/util/wallet_sync_utils.py 1 86.07%
chia/daemon/server.py 1 83.22%
chia/full_node/full_node.py 1 85.86%
chia/daemon/client.py 2 74.01%
chia/timelord/timelord_launcher.py 2 89.29%
chia/_tests/core/test_farmer_harvester_rpc.py 2 97.95%
chia/rpc/rpc_server.py 4 88.2%
Totals Coverage Status
Change from base Build 12022852082: -0.02%
Covered Lines: 103467
Relevant Lines: 113313

💛 - Coveralls

chia/_tests/wallet/sync/test_wallet_sync.py Outdated Show resolved Hide resolved
chia/_tests/wallet/sync/test_wallet_sync.py Show resolved Hide resolved
chia/full_node/full_node_api.py Outdated Show resolved Hide resolved
chia/full_node/full_node_api.py Show resolved Hide resolved
@AmineKhaldi AmineKhaldi force-pushed the fix_simplify_request_block_headers branch 2 times, most recently from 032dd93 to 9195013 Compare November 26, 2024 14:12
@arvidn
Copy link
Contributor

arvidn commented Nov 27, 2024

your benchmark doesn't show that it's safe to remove the serialization optimization.

@AmineKhaldi AmineKhaldi force-pushed the fix_simplify_request_block_headers branch from 9195013 to 41f24e2 Compare November 27, 2024 22:20
@AmineKhaldi AmineKhaldi changed the title CHIA-1862 Fix FullNodeAPI's request_block_headers returned filter and simplify this method CHIA-1862 Fix FullNodeAPI's request_block_headers returned filter Nov 27, 2024
# We're at the transactions_info optional.
# If it's not None, consider this a transaction block.
is_tx_block = buf[0] != 0
return height, is_tx_block
Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I can tell, this function is only tested by your new test, in which case the block is a transaction block. I think it would be good to have a thorough test of this function as well. I think there is a test already you could just add this function to

@arvidn
Copy link
Contributor

arvidn commented Dec 6, 2024

looks good! It would be good to have proper test coverage of the new parsing function too

@AmineKhaldi AmineKhaldi force-pushed the fix_simplify_request_block_headers branch from 41f24e2 to 6b2db3a Compare December 11, 2024 14:31
@AmineKhaldi
Copy link
Contributor Author

looks good! It would be good to have proper test coverage of the new parsing function too

Done. Please note that while the test in question is skipped in main, enabling it and running it (with this extra coverage added to it) passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Cleanup Code cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants