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

Deneb refactoring and new tests #3340

Merged
merged 6 commits into from
May 9, 2023
Merged

Deneb refactoring and new tests #3340

merged 6 commits into from
May 9, 2023

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Apr 28, 2023

  • Minor spec changes:
    • Add explicit assert (len(opaque_tx) - blob_versioned_hashes_offset) % 32 == 0 check in tx_peek_blob_versioned_hashes for better error detection
      • Otherwise, if we send a tx with incorrect length, the error will be a Remerkleable deserialization error.
    • Modify process_blob_kzg_commitments function signature by removing state
      • It seems no obvious reason to keep it.
  • Add new deneb/sanity/test_blocks.py test cases.

@hwwhww hwwhww added scope:CI/tests/pyspec Deneb was called: eip-4844 labels Apr 28, 2023
@hwwhww hwwhww requested a review from asn-d6 May 1, 2023 14:05
Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

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

nice!

@@ -173,6 +173,8 @@ def tx_peek_blob_versioned_hashes(opaque_tx: Transaction) -> Sequence[VersionedH
message_offset
+ uint32.decode_bytes(opaque_tx[(message_offset + 188):(message_offset + 192)])
)
# `VersionedHash` is a 32-byte object
assert (len(opaque_tx) - blob_versioned_hashes_offset) % 32 == 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a length check instead of a mod check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the total length of blob_versioned_hashes: List[VersionedHash, MAX_VERSIONED_HASHES_LIST_SIZE] so it is multiples of 32.

@@ -248,8 +250,7 @@ def process_execution_payload(state: BeaconState, payload: ExecutionPayload, exe
#### Blob KZG commitments

```python
def process_blob_kzg_commitments(state: BeaconState, body: BeaconBlockBody) -> None:
# pylint: disable=unused-argument
def process_blob_kzg_commitments(body: BeaconBlockBody) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess parallelism to other process_* functions is the argument to keep it. But I do think that argument is weak

@ethereum ethereum deleted a comment from Erkansukgen May 7, 2023
Copy link
Member

@ppopth ppopth left a comment

Choose a reason for hiding this comment

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

This looks good to me !

@hwwhww hwwhww merged commit 1c424d7 into dev May 9, 2023
12 checks passed
@hwwhww hwwhww deleted the deneb-tests branch May 9, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deneb was called: eip-4844 scope:CI/tests/pyspec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants