-
Notifications
You must be signed in to change notification settings - Fork 126
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
Split C code into more files #471
Conversation
This looks great! Some thoughts:
Both points above are just personal preference, and I hold no strong opinions. |
Some thoughts after reviewing this PR. As a personal preference, I find oversplitting can sometimes be counterproductive. Having files that hold a single function or type can introduce a mental overhead when trying to locate specific functions, and it can also create a practical overhead in terms of handling numerous files. IMO for c-kzg, file splitting should aim to highlight the responsibilities of each module, and to specify the scope of objects. Some notes on the PR:
|
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.
Awesome work! Thanks a lot!
This PR continues to split the core C code into more manageable files.
Four new directories have been created:
common
-- Contains general code, some of which is shared between eip4844 and eip7594.eip4844
-- As the name implies, contains the implementation for EIP-4844.eip4844.c
) has been mostly left as-as. Don't poke the audited dragon.eip7594
-- As the name implies, contains the implementation for EIP-7594.fk20.c
which handles FK20 proof generation,recovery.c
which implements cell recovery, andfft.c
which provides methods for FFT.setup
-- Contains code pertaining to loading the trusted setup.KZGSettings
, which didn't quite make sense incommon
. This is a bit of a weird situation. We don't want to include it ineip4844
because it's been updated foreip7594
.We needed to include the C source directory in the Rust bindings generator so the updated includes would work.
There are various other small changes, but no changes to the implementation have been made here.
Added
InsertNewlineAtEOF: true
to the clang formatter configuration file. Several of my new files did not contain a newline at the bottom, which showed an ugly crossed out circle on GitHub.