-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: minor improvements to Ethereum delegated siggys #10084
Conversation
} | ||
} | ||
|
||
if paramsReader.Len() != 0 { | ||
return EthTxArgs{}, xerrors.Errorf("extra data found in params") | ||
} | ||
|
||
if len(params) == 0 && msg.Method != builtintypes.MethodSend { |
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.
@Stebalien I think we need this to cover a case where the EthTx calls the EAM's CreateExternal method with the CBOR-encoding of the empty byte array, which would fail to roundtrip.
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.
Feels cleaner regardless.
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.
Yes, but isn't that case already covered? I.e., we should fail to read a bytes array from the params in that case. But either way works.
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.
@Stebalien So that's what I was unsure about it, but I think this case wasn't covered? You could have successfully read (the serialization of) the empty byte array -- [MajByteString, 0]
, I think, which would still lead to params having a length of 0. And that wouldn't roundtrip because we assert non-empty bytes for CreateExternal calls when going Eth -> Fil.
} | ||
} | ||
|
||
if paramsReader.Len() != 0 { | ||
return EthTxArgs{}, xerrors.Errorf("extra data found in params") | ||
} | ||
|
||
if len(params) == 0 && msg.Method != builtintypes.MethodSend { |
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.
Yes, but isn't that case already covered? I.e., we should fail to read a bytes array from the params in that case. But either way works.
Related Issues
Minor improvements noticed while writing this logic into FIP-0055.
Proposed Changes
ReadByteArray
/WriteByteArray
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps