-
Notifications
You must be signed in to change notification settings - Fork 33
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
Feat: bls
crate with modular backend
s
#69
base: develop
Are you sure you want to change the base?
Feat: bls
crate with modular backend
s
#69
Conversation
Hi @sauliusgrigaitis I have implemented the necessary traits for the I would proceed to add more backends starting with Thank you! |
You don't need to prefix all the trait names with
We rarely need imported trait names in code. Most of the time importing traits anonymously is better. |
All the old code that was wrapping the When you add a new So my suggestion is to try and move as much as possible code from |
Thanks @shreyas-londhe for PR, but I agree with @povi. I think it's best if you proceed by adding |
Thanks for the suggestions @povi. I'll add the |
Hi @povi I made the changes you requested. Can you please tell me how I can test if my changes didn't break anything? Please let me know of any more suggestions you have :) |
@shreyas-londhe the very first step would be to fix the build. You can run the build locally by executing the commands from the build script https://github.com/grandinetech/grandine/blob/develop/.github/workflows/ci.yml. |
@sauliusgrigaitis I'm getting clippy errors which are not from the code I modified. Can you please check that once? I even tried running the tests locally and they fail at code which I have not modified. Can you please help me out on why the CI might be failing? |
process_block_header, | ||
|_, state, block: Phase0BeaconBlock<_>, _| unphased::process_block_header(state, &block), | ||
"block", | ||
"consensus-spec-tests/tests/mainnet/phase0/operations/block_header/*/*", | ||
"consensus-spec-tests/tests/minimal/phase0/operations/block_header/*/*", | ||
} | ||
"consensus-spec-tests/tests/minimal/phase0/operations/block_header/*/*" |
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 see a TON of changes that are either a space removed, a comma removed or a semicolon added. Neither of these changes are related to this pull request.
What is more, some of these changes you made break macros, like this one. Now it produces error:
error: unexpected end of macro invocation
--> transition_functions/src/phase0/block_processing.rs:494:80
|
432 | macro_rules! processing_tests {
| ----------------------------- when calling this macro
...
494 | "consensus-spec-tests/tests/minimal/phase0/operations/block_header/*/*"
| ^ missing tokens in macro arguments
|
note: while trying to match `,`
--> transition_functions/src/phase0/block_processing.rs:438:34
|
438 | $minimal_glob:literal,
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.
Why did you make these changes?
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.
@povi Looks like these were because of running ‘cargo fmt —all’. Let me remove those.
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.
@povi Thanks for pointing this out, I reverted all the formatting changes which are not related to this PR. How do I invoke the CI workflow on my latest commit? I cannot run the CI on my local because I have limited resources and it's taking a lot of time for me to download the submodules.
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.
@shreyas-londhe you should be able to fork the repo and push the changes to branches in your local repo. This should trigger CI.
The build on |
6e2a257
to
de48d2e
Compare
Hi @povi @sauliusgrigaitis I fixed all the clippy issues and made sure that the CI passes. Can you please review my PR and let me know of any suggestions? |
We want to make this inline with https://github.com/grandinetech/rust-kzg naming. So with the same switch both our Can you also squash to a single commit after the naming is changed? |
I also suggest to to enable |
I just checked and it doesnt compile with |
@sauliusgrigaitis The code compiles when |
@shreyas-londhe you must test your code before you ask for review. It fails b3577bc |
Sorry for the confusion @sauliusgrigaitis, as you requested I changed the feature names to match # in `grandine` root
cd bls
# builds with `blst` backend
cargo build
# builds with `zkcrypto (bls12_281)` backend
cargo build --no-default-features --features bls-zkcrypto |
The switch needs to work on the top level, not in |
81f56f2
to
48c6c34
Compare
Thanks for pointing this out @sauliusgrigaitis. The latest commit on my branch passes the CI tests with both I am also planning to write a consistency check macro for testing the newly added backends with the |
Looks good! There are some minor things though that I'd suggest to change, I'll write them down. |
Did you find any way to use |
@sauliusgrigaitis I'm not sure about this one. I tried using |
No, sorry, I don't have |
@sauliusgrigaitis I have one solution using |
f1efdaf
to
0f1efc7
Compare
0f1efc7
to
fcbb8ec
Compare
Hey @shreyas-londhe, I've faced the same issue in #88, and solved it by specifying From 10a946bb54ab25156bdbbc40a31d72933b098dfa Mon Sep 17 00:00:00 2001
From: sirse <[email protected]>
Date: Thu, 23 Jan 2025 19:36:41 +0200
Subject: [PATCH] Mark blst as default feature
---
grandine/Cargo.toml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/grandine/Cargo.toml b/grandine/Cargo.toml
index 65f9077..d7387f3 100644
--- a/grandine/Cargo.toml
+++ b/grandine/Cargo.toml
@@ -73,6 +73,8 @@ tempfile = { workspace = true }
test-case = { workspace = true }
[features]
+default = ["bls/blst"]
+
logger-always-write-style = []
# `preset-any` and `network-any` should not be passed to Cargo.
--
2.43.0 |
This PR generalizes the use of backends in the
bls
crate. New backends can be added to this crate and can be used by replacing features where the crate is used.Resolves #61