Skip to content

Conversation

@grumbach
Copy link
Member

@grumbach grumbach commented Sep 3, 2025

    let mut stream = stream_encrypt(data_size, data_iter)?;

    // Collect all chunks
    for chunk_result in stream.chunks() {
        let (xorname, chunk) = chunk_result?;
        // process chunks
    }

    // Get the datamap
    let datamap = stream.datamap()?;

Copy link
Member

@maqi maqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this PR is on top of the PR 421, the capability of out-of-order content push got removed (and the correspondent test as well.)

The stream_encrypt_from_file shall utilised the newly StreamEncrypt (or EncryptionStream) struct as well (like the PR 421 does).
So that we can avoid having too many different workflow path, which results in headache for future maintaince, like what we had in ant_cli/autonomi_client .

Regarding the stream_encrypt , I'd suggest to make it as a one-off help function as well (similar to stream_encrypt_from_file ):

fn stream_encrypt(data_size: usize, bytes_iterator: I, chunk_store: S) -> Result<DataMap>;

which we then can use it like this:

let datamap = stream_encrypt.datamap(data_size, bytes_iterator, chunk_store)?;

Copy link
Member

@maqi maqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in the HO,
it is decided that:

  • out-of-order content push is not mandatory for streaming_encrypt
  • simpler API is preferred, unless there is critial user requirement to be asked for

Hence, got this PR approved to replace the PR 421

@maqi maqi merged commit 42ec004 into maidsafe:master Sep 3, 2025
18 checks passed
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

Successfully merging this pull request may close these issues.

2 participants