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

[VID TECH DEBT] - vid_scheme should take u32 instead of usize #3298

Open
ggutoski opened this issue Jun 10, 2024 · 0 comments
Open

[VID TECH DEBT] - vid_scheme should take u32 instead of usize #3298

ggutoski opened this issue Jun 10, 2024 · 0 comments
Assignees

Comments

@ggutoski
Copy link
Contributor

What is this task and why do we need to work on it?

Currently vid_scheme starts like this:

pub fn vid_scheme_for_test(num_storage_nodes: usize) -> VidSchemeType {
let recovery_threshold = 1 << num_storage_nodes.ilog2();
#[allow(clippy::panic)]
let num_storage_nodes = u32::try_from(num_storage_nodes).unwrap_or_else(|err| {
panic!("num_storage_nodes {num_storage_nodes} should fit into u32; error: {err}")
});

The arg num_storage_nodes should be of type u32 instead. That would eliminate the error handling cruft. It would also make life easier for downstream users, who need to convert a u32 to usize anyway:
https://github.com/EspressoSystems/espresso-sequencer/blob/26a6b299ce260a210e6fa3253bbd50fb57f3023d/sequencer/src/block/full_payload/ns_proof.rs#L47-L51

What work will need to be done to complete this task?

Dead easy.

Are there any other details to include?

No response

What are the acceptance criteria to close this issue?

vid_scheme takes a u32 instead of usize

Branch work will be merged to (if not the default branch)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants