8000 DA Encoded Data to Blobs by bacv · Pull Request #649 · logos-co/nomos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DA Encoded Data to Blobs #649

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

Closed
wants to merge 2 commits into from
Closed

DA Encoded Data to Blobs #649

wants to merge 2 commits into from

Conversation

bacv
Copy link
Member
@bacv bacv commented May 21, 2024

A method to transform encoded data to blobs for dispersal, rust representation of a _prepare_data in nomos-spec:
https://github.com/logos-co/nomos-specs/blob/9390d481ba332923e6406bc9edcb008b814867aa/da/dispersal.py#L27-L46

@bacv bacv added the da label May 21, 2024
@bacv bacv requested a review from danielSanchezQ May 21, 2024 10:03
@bacv bacv self-assigned this May 21, 2024
@bacv bacv changed the base branch from master to da-protocol-v1 May 21, 2024 10:03
@bacv bacv changed the title Da encoded to blobs DA Encoded Data to Blobs May 21, 2024
Comment on lines 40 to 60
pub fn prepare_data(&self) -> impl Iterator<Item = DaBlob> + '_ {
let row_proofs_iter = self.rows_proofs.iter().map(|rp| rp.iter());

self.extended_data
.columns()
.zip(&self.column_commitments)
.zip(row_proofs_iter)
.zip(&self.aggregated_column_proofs)
.map(
move |(((column, column_commitment), row_proofs), aggregated_column_proof)| {
DaBlob {
column,
column_commitment: *column_commitment,
aggregated_column_commitment: self.aggregated_column_commitment,
aggregated_column_proof: *aggregated_column_proof,
rows_commitments: self.row_commitments.clone(),
rows_proofs: row_proofs.cloned().collect(),
}
},
)
}
Copy link
Collaborator
@danielSanchezQ danielSanchezQ May 21, 2024

Choose a reason for hiding this comment

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

When will generators get stabilized? 😿 Actually an iterator is more than fine here :)

aggregated_column_commitment: self.aggregated_column_commitment,
aggregated_column_proof: *aggregated_column_proof,
rows_commitments: self.row_commitments.clone(),
rows_proofs: row_proofs.cloned().collect(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this is doing what it should. We want all proofs for column 1..n meaning that you should iterate the row_proofs_iter and call next for each row to get them in order. Probably you would need to collect the row_proofs_iter so you can iterate over it many times.
If this is not clear I can give it a try.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I was puzzled about this line in python, I didn't come up with a simple test without creating a verifier instance, maybe you have idea for one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can verify manually, with the methods from kzgrs.

8000

@bacv
Copy link
Member Author
bacv commented May 21, 2024

Closing the PR as the encoded data preparation will be performed by dispersal protocol.

@bacv bacv closed this May 21, 2024
@bacv bacv deleted the da-encoded-to-blob branch May 21, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0