Skip to content

Experiment - rollkit adapter multiple blocks submission #78

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 1 commit into from

Conversation

gabriele-0201
Copy link
Contributor

@gabriele-0201 gabriele-0201 commented Nov 30, 2023

Experimental solution for #62
Not even tested, the goal of this PR is just to discuss about the approach

// but each sugondat-blob is a rollkit-batch that could contain multiple rollkit-blobs
for batch in block.blobs {
if batch.namespace == namespace {
let batch_data: Batch = Decode::decode(&mut &batch.data[..]).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

This unwrap can be easily triggered by someone submitting another batch manually on the namespace. The assumption that all blobs with the namespace have been submitted through this API is fragile.

Panics should only happen on critical bugs. (IMO unwrap is a major code smell and expect("argument for impossibility") is a much better approach.

Copy link
Contributor Author

@gabriele-0201 gabriele-0201 Dec 1, 2023

Choose a reason for hiding this comment

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

I agree 100% with you! I put this unwrap just because that's a fast iteration to check a possible approach to solve that problem but it was never intended to be pushed on main 😅

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