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

fix: correct block hash validation in get_payloads function #510

Closed
wants to merge 1 commit into from

Conversation

avorylli
Copy link

@avorylli avorylli commented Feb 9, 2025

The get_payloads function was comparing block_hash() with prev_parent_hash, which is incorrect for validating block chain consistency. Changed to compare parent_hash() with prev_parent_hash to ensure proper block linking.

Impact:

  • Fixes potential block synchronization issues
  • Ensures correct block chain validation
  • Prevents false-positive chain breaks

@ncitron
Copy link
Collaborator

ncitron commented Feb 10, 2025

This function is correct as is. The parent hash of block n must be equal to the block hash of block n-1. This change would cause all calls to get_payloads to fail since it would check that the parent hash of block n is equal to the parent hash of block n-1, which it will never be.

@ncitron ncitron closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants