-
Notifications
You must be signed in to change notification settings - Fork 156
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
Versioned CBOR #3063
Versioned CBOR #3063
Conversation
958efc5
to
44908aa
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.
Aside from Twiddle, all this looks familiar, and in good shape.
Just a few comments need to be added, and a few mispelling typos to be fixed.
libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Decoder.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-binary/test-lib/Test/Cardano/Ledger/Binary/RoundTrip.hs
Outdated
Show resolved
Hide resolved
libs/cardano-ledger-binary/test-lib/Test/Cardano/Ledger/Binary/Twiddle.hs
Show resolved
Hide resolved
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.
d5aa3b2
to
6091cb2
Compare
This package introduces new `Encoding` and `Decoder` wrappers that can change their behavior depending on a version, which corresponds to major protocol version. This package introduces new conceptws and consolidates all the old ones that were spread around different packages: * Introduced `Version` in its own module and make it safe to construct * Switch from `ReaderT` to manual Version passing to recover representational role * All decoders and encoders as well as `FromCBOR`/`ToCBOR` classes from `cardano-binary` package * Re-exports `Annotator` functionality from `cardano-binary` package, with plans to migrate it completely in the future * Moved dropper from `cardano-binary` * Test suites from `cardano-binary` and `cardano-data` as vintage test suites * `FromSharedCBOR` from `cardano-data` package * `Data.Coders` module from `cardano-data` package * `Data.Twiddler` module from `cardano-data` package into a `test-lib` * Improved Roundtripping tests and sophisticated way to display CBOR encoded blobs that was transferred from `ouroboros-consensus` repo. * Custom decoders/encoders from `Cardano.Ledger.Serialization` module from `cardano-ledger-core` package * Implement round trip test for all To/FromCBOR instances. Discovered major bug with `SlicedByteArray` and fix it in `cborg` package: well-typed/cborg#301
79d945f
to
59f7c13
Compare
Yes, it does, except only the first half of it. This PR only implements the library that is capable of versioned CBOR. A subsequent PR will be submitted that actually applies this new interface throughout ledger. |
Started new package
cardano-ledger-binary
:This package introduces new
Encoding
andDecoder
wrappers that can change their behavior depending on a version, which corresponds to major protocol version. This package introduces new conceptws and consolidates all the old ones that were spread around different packages:Version
in its own module and make it safe to constructReaderT
to manual Version passing to recover representational roleFromCBOR
/ToCBOR
classes fromcardano-binary
packageAnnotator
functionality fromcardano-binary
package, with plans to migrate it completely in the futurecardano-binary
cardano-binary
andcardano-data
as vintage test suitesFromSharedCBOR
fromcardano-data
packageData.Coders
module fromcardano-data
packageData.Twiddler
module fromcardano-data
package into atest-lib
ouroboros-consensus
repo.Cardano.Ledger.Serialization
module fromcardano-ledger-core
packageSlicedByteArray
and fix it incborg
package: Fix SlicedByteArray well-typed/cborg#301