-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
core/types: improve error for too short transaction / receipt encoding #24256
Conversation
I think this issue is being extremely picky. The only case where this error will happen is when trying to decode the transaction from a single byte, i.e. input |
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.
LGTM
Needs this fix diff --git a/cmd/evm/testdata/15/exp3.json b/cmd/evm/testdata/15/exp3.json
index 6c46d267cf..b5a6c3324d 100644
--- a/cmd/evm/testdata/15/exp3.json
+++ b/cmd/evm/testdata/15/exp3.json
@@ -21,19 +21,19 @@
"error": "transaction type not supported"
},
{
- "error": "rlp: expected List"
+ "error": "transaction type not supported"
},
{
- "error": "rlp: expected List"
+ "error": "EOF"
},
{
- "error": "rlp: expected List"
+ "error": "EOF"
},
{
- "error": "rlp: expected List"
+ "error": "EOF"
},
{
- "error": "rlp: expected List"
+ "error": "transaction type not supported"
},
{
"error": "rlp: expected input list for types.AccessListTx"
|
I don't want to merge this as-is because returning |
Actually, this uncovered that |
ethereum#24256) Co-authored-by: Felix Lange <fjl@twurst.com>
ethereum#24256) Co-authored-by: Felix Lange <fjl@twurst.com>
ethereum#24256) Co-authored-by: Felix Lange <fjl@twurst.com>
Because the switch statement checks for EIP-2718 (String and Bytes) and legacy (List) transactions, the default should throw an error expecting the newer String and Bytes rather than the List. Changed
return rlp.ErrExpectedList
toreturn rlp.ErrExpectedString
in the default cases.closes #24227