-
Notifications
You must be signed in to change notification settings - Fork 90
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(eof): eofwrap.py to ignore invalid blocks #1028
base: main
Are you sure you want to change the base?
Conversation
It seems the request hash problem affects filling |
This fixes filling of EOF tests for me. |
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.
One comment that is a breaking issue, there must be some other approach to this.
src/ethereum_test_types/types.py
Outdated
self.requests_list.append(requests_list_to_bytes(requests_list)) | ||
for type, requests_list in enumerate(requests_lists): | ||
self.requests_list.append( | ||
Bytes(bytes([type]) + requests_list_to_bytes(requests_list)) |
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 breaks EIP-7685 tests, because of this change in the spec: ethereum/EIPs@5ac0297
I think the requests lists from the blocks that are being parsed and passed to this function might be outdated, so the source might need to be fixed first.
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.
Ha, I thought this change isn't yet implemented. My change is only about parity between the two ifs in this function here, but still in prague-devnet-4 world.
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.
ok, hold on, I think there indeed is another solution - never pass b''
elements in the requests_lists
, and then it works as prague-devnet-5. I think I was wrong about that particular piece, some debugging gone wrong on my part.
I can propose an alternative fix in a second
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.
OK, take a look now pls. I still ended up adjusting this function instead of source (I tried that too, but then it is problematic to work out the type of the request lists entry).
I might still be deeply confused here, I was certain I knew what was going on, but not anymore 😅.
@@ -1248,12 +1248,18 @@ def __init__( | |||
): | |||
""" | |||
Initializes the requests object. | |||
|
|||
If `requests_lists` is given as argument, assumes they are sorted by request type | |||
ascending, starting from 0 and contiguous - including empty entries. |
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 changed with ethereum/EIPs#8989, empty entries should not be present (it could be that for testing purposes an empty entry could be added, but I think that's a separate issue).
for type, requests_list in enumerate(requests_lists): | ||
if requests_list: | ||
self.requests_list.append( | ||
Bytes(bytes([type]) + requests_list_to_bytes(requests_list)) |
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 still breaks our test generation because this is the code path we use to process the list returned by the t8n tool, and the list returned by t8n (correctly) already contains the type byte at the beginning of each request.
I think the interface could definitely be improved, and it could be that we need a different parameter for this use case in this PR, and a different one for the values returned by t8n.
It would also help me to better understand this use case with an example test that causes an issue when wrapped with an EOF container.
🗒️ Description
There is no support for invalid FixtureTransactions to be read from JSON, so we cannot include invalid blocks easily. However as this is not central to the behavior eofwrap tests are intended to test, we can just skip these invalid blocks with the same end effect on the test.
Unfortunately, the fix isn't limited to that. It seems like the fix to requests serialization/hashing (#990) missed a detail when the
requests_lists
is used to construct requests (like from t8n output). Please double check carefully if this fix is fine.Note also that for devnet-5 this would be partially hidden by the fact, that we don't include empty requests in the commitment anymore, meaning that all empty requests will not trigger the problem
🔗 Related Issues
NA
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.