-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: events: version the MessageReceipt structure. #9636
Conversation
3954733
to
5be87c0
Compare
This is implemented as an internal version discriminator. An alternative would've been to turn MessageReceipt into an interface with two backing structs for v0 and v1. But that approach would've broken all usage sites. CBOR serde for MessageReceipt is no longer automatically generated. We use custom logic to deal with versioning in both directions. This logic uses the cborgen serde code as a basis.
5be87c0
to
8333b80
Compare
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.
custom cbor looks incorrect and there is the issue of codecs in other languages, rust at minimum.
chain/types/message_receipt_cbor.go
Outdated
return err | ||
} | ||
} else { | ||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-mr.ExitCode-1)); err != nil { |
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.
woah, we need to be able to decode this in other languages too you know...
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 was generated by cborgen -- what is the concrete problem you see?
Cant we do something similar to the state tree? |
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.
lools ok and we have test for the serializer, so green tick it is!
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.
You could avoid the pointer wrapping and make the version specific serde free standing functions, but up to you.
Note test failure. |
Not worth it. I expect that to be optimized away by newtype compiler optimizations anyway. |
This is implemented as an internal version discriminator. An alternative would've been to turn MessageReceipt into an interface with two backing structs for v0 and v1. But that approach would've broken all usage sites.
CBOR serde for MessageReceipt is no longer automatically generated. We use custom logic to deal with versioning in both directions. This logic uses the cborgen serde code as a basis.
Related Issues
Proposed Changes
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