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

Add async decode to bao #754

Closed
ramfox opened this issue Jan 20, 2023 · 6 comments
Closed

Add async decode to bao #754

ramfox opened this issue Jan 20, 2023 · 6 comments
Assignees

Comments

@ramfox
Copy link
Contributor

ramfox commented Jan 20, 2023

PR: oconnor663/bao#44

@rklaehn
Copy link
Contributor

rklaehn commented Jan 20, 2023

We are going to do this first for ourselves, and then try to get it merged once it works.

The thing that is most urgent to implement async is the SliceDecoder .

So we are going to have some async way to do the job of a SliceDecoder in our code base, and then PR that to bao.

@rklaehn rklaehn self-assigned this Jan 20, 2023
@dignifiedquire
Copy link
Contributor

We currently don't need the SliceDecoder, just Decoder with outboard data and Encoder, so I don't quite understand why you want to start with the SliceDecoder

@rklaehn
Copy link
Contributor

rklaehn commented Jan 23, 2023

I think the recommended way to send around verified data is the following:

    1. create an encoded file, either outboard or inline
    1. use the SliceExtractor to produce a stream of a slice.
    • If you want to send the whole file, just give 0..len as range.
    • the encoding of the slice 0..len is exactly the same as the inline encoding of the entire file
    1. then on the receiving end use the SliceDecoder to receive and incrementally verify the file

If you want to identify one of the three steps where 1. async is easiest to add and 2. the lack of async is most annoying, it is the decoder.

See the comment in oconnor663/bao#44 (comment)

If you save the "outboard" encoded file, to avoid the space overhead of an entire copy of the original input, then you can use bao slice together with the original and the outboard encoding to reproduce the "combined" encoding. That does work in streaming-friendly way, and it doesn't require seek support in the output.

@rklaehn
Copy link
Contributor

rklaehn commented Jan 25, 2023

I have written a completely independent slice decoder here: https://github.com/rklaehn/bao-experiment/blob/slice-decoder-2/src/lib.rs

Getting that or something with equivalent functionality based on the bao code itself added to bao will be a longer term thing.

@rklaehn
Copy link
Contributor

rklaehn commented Jan 30, 2023

The absolute minimum async support we are going to need is implemented in oconnor663/bao#46

There are a number of additional async things (seek support, encode support) that are nice to have but not strictly necessary. Those are in https://github.com/n0-computer/bao/ but don't need to go in for sendme 1.0

@dignifiedquire dignifiedquire transferred this issue from n0-computer/sendme-legacy Feb 20, 2023
@rklaehn
Copy link
Contributor

rklaehn commented Mar 29, 2023

Not sure how to proceed with this. We now got our own crate bao-tree that supports all the things. Also we got abao which has an async decoder.

@rklaehn rklaehn closed this as completed Mar 29, 2023
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

3 participants