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-2219 Fix a plot ID calculation typo in test_unfinished_block_with_replaced_generator #19139

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

Conversation

AmineKhaldi
Copy link
Contributor

@AmineKhaldi AmineKhaldi commented Jan 14, 2025

calculate_plot_id_pk takes a G1Element pool_public_key and calculate_plot_id_ph takes a bytes32 pool_contract_puzzle_hash.

It doesn't make sense to use the public key when it's None, and this typo went unnoticed because the runtime outcome for this input would end up being the same because of both functions' implementations:

def calculate_plot_id_pk(
pool_public_key: G1Element,
plot_public_key: G1Element,
) -> bytes32:
return std_hash(bytes(pool_public_key) + bytes(plot_public_key))
def calculate_plot_id_ph(
pool_contract_puzzle_hash: bytes32,
plot_public_key: G1Element,
) -> bytes32:
return std_hash(bytes(pool_contract_puzzle_hash) + bytes(plot_public_key))

@AmineKhaldi AmineKhaldi added Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Cleanup Code cleanup labels Jan 14, 2025
@AmineKhaldi AmineKhaldi self-assigned this Jan 14, 2025
@AmineKhaldi AmineKhaldi force-pushed the plot_id_test_unfinished_block_with_replaced_generator branch from 531e872 to 3a4f82c Compare January 15, 2025 15:39
@AmineKhaldi AmineKhaldi force-pushed the plot_id_test_unfinished_block_with_replaced_generator branch from 3a4f82c to 8801fcd Compare January 22, 2025 10:31
Copy link

Pull Request Test Coverage Report for Build 12906288903

Details

  • 1 of 3 (33.33%) changed or added relevant lines in 1 file are covered.
  • 22 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.02%) to 91.532%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/_tests/core/full_node/test_full_node.py 1 3 33.33%
Files with Coverage Reduction New Missed Lines %
chia/wallet/util/wallet_sync_utils.py 1 86.14%
chia/server/node_discovery.py 2 81.5%
chia/wallet/wallet_node.py 8 87.74%
chia/timelord/timelord.py 11 78.52%
Totals Coverage Status
Change from base Build 12894248841: 0.02%
Covered Lines: 105339
Relevant Lines: 114909

💛 - Coveralls

@AmineKhaldi AmineKhaldi marked this pull request as ready for review January 22, 2025 13:27
@AmineKhaldi AmineKhaldi requested a review from a team as a code owner January 22, 2025 13:27
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.

1 participant