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

Replace size_t with uint64_t #478

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

jtraglia
Copy link
Member

@jtraglia jtraglia commented Aug 8, 2024

Opening as a draft. Not entirely sure I want this. I've had some mild concerns with size_t being a dynamic size. I'm not sure if my concerns are justified. This PR replaces all instances of size_t with uint64_t.

@asn-d6
Copy link
Contributor

asn-d6 commented Aug 9, 2024

Can you elaborate on what you think is the issue here? It would be weird if we were accepting size_t as input on a public method, since there could be cross-platform disagreements, but I don't see anything wrong with using the type in internal functions.

@jtraglia
Copy link
Member Author

jtraglia commented Aug 9, 2024

Hmm I don't have a strong opinion on what internal types we should use. I thought it might be good to use uint64_t everywhere for consistency, but that's not a great reason. Maybe I should revert that, and only do uint64_t for the public API functions, like you suggested. This is originally what I had in mind, but I'm on the fence as to what I think is best.

Screenshot of the task list:
image

@jtraglia
Copy link
Member Author

jtraglia commented Aug 9, 2024

I will make these changes sometime next week. Doesn't feel like a high priority right now.

@jtraglia jtraglia force-pushed the replace-size_t-with-uint64_t branch from a94f7ee to add104d Compare August 13, 2024 14:48
@jtraglia jtraglia marked this pull request as ready for review August 13, 2024 21:47
@asn-d6
Copy link
Contributor

asn-d6 commented Aug 16, 2024

This looks good! Thanks!

As a question, is it possible to replace the ulong of the C# bindings to uint64 as well?

private static extern unsafe KzgResult RecoverCellsAndKzgProofs(byte* recovered_cells, byte* recovered_proofs,
ulong* cell_indices, byte* cells, ulong num_cells, IntPtr ts);

@asn-d6 asn-d6 merged commit 344188f into ethereum:main Aug 16, 2024
38 checks passed
@jtraglia jtraglia deleted the replace-size_t-with-uint64_t branch August 16, 2024 13:44
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