-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this 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 !
assert (len(opaque_tx) - blob_versioned_hashes_offset) % 32 == 0
check intx_peek_blob_versioned_hashes
for better error detectionprocess_blob_kzg_commitments
function signature by removingstate
deneb/sanity/test_blocks.py
test cases.