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 length check between kzg commitments and exist #14581

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

terencechain
Copy link
Member

The exists array is always returned as [6]bool, with a fixed length of 6. Until this is made dynamically sized, we cannot assume it will always match the count of KZG commitments in the block body.

The key requirement is ensuring that the block body's KZG length doesn’t exceed the bounds of exists, meeting this constraint:

for i, commitment := range kzgCommitments {
	if !exists[i] {
		kzgHashes = append(kzgHashes, primitives.ConvertKzgCommitmentToVersionedHash(commitment))
	}
}

This PR modifies the check from an equality check to a greater-than check, so the body’s KZG count cannot be greater than the exists count.

@terencechain terencechain requested a review from a team as a code owner October 25, 2024 16:56
@terencechain terencechain added this pull request to the merge queue Oct 25, 2024
Merged via the queue into develop with commit 53f1f11 Oct 25, 2024
18 checks passed
@terencechain terencechain deleted the fix-kzg-exist-check branch October 25, 2024 18:08
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