-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
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(), | ||
} | ||
}, | ||
) | ||
} |
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.
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(), |
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.
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.
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.
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?
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.
You can verify manually, with the methods from kzgrs
.
Closing the PR as the encoded data preparation will be performed by dispersal protocol. |
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