Skip to content

Commit

Permalink
Compare the first versioned hash byte by indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Apr 5, 2024
1 parent 7e68af4 commit fb28fa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eth/vm/forks/cancun/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def validate_transaction(self, transaction: SignedTransactionAPI) -> None:

# all versioned blob hashes must start with VERSIONED_HASH_VERSION_KZG
for h in transaction.blob_versioned_hashes:
if h[0].to_bytes() != VERSIONED_HASH_VERSION_KZG:
if h[:1] != VERSIONED_HASH_VERSION_KZG:
raise ValidationError(
"Blob versioned hash does not start with expected "
f"KZG version: {VERSIONED_HASH_VERSION_KZG!r}"
Expand Down
1 change: 1 addition & 0 deletions newsfragments/2168.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``integer.to_bytes()`` requires size and byteorder below py311 and our fixture tests only use py311. Compare the first byte of versioned hashes by indexing instead.

0 comments on commit fb28fa4

Please sign in to comment.