Skip to content
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

Unexpected cbor code 0xa1 when decoding banyan::index::Index<trees::axtrees::AxTrees>. #112

Open
rkuhn opened this issue Dec 7, 2021 · 2 comments

Comments

@rkuhn
Copy link
Member

rkuhn commented Dec 7, 2021

This error basically says “I don’t want to read this dictionary of length 1”, which is the “kinded” representation of Index (DagCbor doesn’t like definite-length encoding, IIRC). I encountered this while developing event dump/restore functionality in Actyx. The restore part feeds events to BanyanStore::append0 (to preserve timestamps) and does not mess with the internals, so I don’t see how my code could influence the encoding of a Banyan index block.

How much work would it be to replace all DagCbor with cbor-data? I trust that implementation much more, it is very thoroughly tested to actually accept all valid CBOR.

/cc @rklaehn

@rkuhn
Copy link
Member Author

rkuhn commented Dec 7, 2021

Looking closer: 0xa1 is actually the hallmark of keyed encoding, while Index declares kinded … how could this possibly be mixed up?

@rkuhn
Copy link
Member Author

rkuhn commented Dec 7, 2021

I looked at the store in question (attached) with banyan-cli, added some debug printlns and found that the very first Index that is to be deserialized actually contains payload data.
db.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant