-
Notifications
You must be signed in to change notification settings - Fork 29
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
contracts: fix CBOR unsigned int decoding in Subcall.sol #325
Conversation
✅ Deploy Preview for oasisprotocol-sapphire-paratime ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Ok, minor last thing. I need to make the subcall stuff not error out if it encounters and unknown key. |
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.
FYI this section https://www.rfc-editor.org/rfc/rfc8949.html#name-tag-validity mentions that the 128- and 256-bit integers are encoded as 0x40 (byte arrays).
Having the _cborParseUInt() split into 64-bit and smaller uints and 128-bit and greater uints codepaths opens potential gas attacks? Should we use gas padding to mitigate this? |
I'd prefer if the caller of the receipt parser does the gas padding if it's deemed necessary rather than building it into the parser itself. But yes, I'll add a note in the code about it. |
4410fad
to
8580d00
Compare
303cfe7
to
0bb6993
Compare
Co-authored-by: Matevž Jekovec <[email protected]>
Co-authored-by: Matevž Jekovec <[email protected]>
0bb6993
to
fbca43d
Compare
…edarMist/subcall-cbor-uint-fix contracts: fix CBOR unsigned int decoding in Subcall.sol 198dfa8
@@ -170,6 +176,11 @@ library Subcall { | |||
(uint64, bytes) | |||
); | |||
|
|||
// 0xf6 = null, returns null in case receiptId not found |
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.
Also returns null(0xf6
) in case epoch is not reached yet.
fixes #323