-
Notifications
You must be signed in to change notification settings - Fork 10
feat: migrate from bls-signatures to blsful library #82
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
Merged
PastaPastaPasta
merged 1 commit into
dashpay:v0.40-dev
from
DCG-Claude:feat/migrate-to-agora-blsful
Jul 8, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@coderabbitai is this the proper way to include this? especially the header "[patch.crates-io]"
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.
🧩 Analysis chain
@PastaPastaPasta Yes, this is the proper way to include the patch! The
[patch.crates-io]header is correct. Here's what's happening:Correct syntax: The
[patch.crates-io]section is the standard way to override crates that would normally come from crates.io with alternative sources (like Git repositories).Multiple patch sections: You can have multiple patch sections in your Cargo.toml:
[patch.crates-io.dashcore_hashes]- This is shorthand for patching a specific crate[patch.crates-io]- This is the general section where you can patch multiple cratesAlternative approach: You could consolidate both patches into a single
[patch.crates-io]section like this:Both approaches are valid, but the consolidated version is more commonly used. The current structure with separate sections works perfectly fine and is also valid Cargo syntax.
The patch ensures that whenever any crate in your workspace depends on
blsful, it will use your specified Git revision instead of the version from crates.io.ʕ•ᴥ•ʔ
🌐 Web query:
💡 Result:
In Cargo.toml, you can use the
[patch.crates-io]section to override specific crates from crates.io with your own version (usually a local path or a git repository). However, there is a specific way to do this properly:[patch.crates-io]section is allowed per Cargo.toml.Example of multiple patches in one section:
If you have multiple patches, you must put them all inside the same
[patch.crates-io]block. Having multiple[patch.crates-io]blocks in a single Cargo.toml is not valid.If you want to patch crates for different registries, you would use different
[patch.<registry>]sections—but for crates.io patches, only one[patch.crates-io]section.So the proper way to have multiple patches is:
But remember the
patchfeature only overrides dependencies from crates.io by default, unless you specify otherwise with registries.Would you like a sample Cargo.toml showcasing multiple patches?
@PastaPastaPasta I need to correct my previous response. Based on the Cargo documentation, the current setup is not the proper way to do this.
The Issue: You can only have one
[patch.crates-io]section per Cargo.toml file. Having both[patch.crates-io.dashcore_hashes]and[patch.crates-io]sections is invalid.The Correct Approach: You should consolidate both patches into a single
[patch.crates-io]section:Why this matters:
[patch.crates-io]section per fileRecommended fix: Replace the current patch sections with the consolidated version above.
Sorry for the confusion in my initial response - the web search confirmed that only one patch section is allowed for each registry.
ʕ•︵•ʔ
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.
Are you sure? this currently compiles. Why would we want to combine them?
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.
🧩 Analysis chain
@PastaPastaPasta You're absolutely right, and I apologize for the confusion. Let me provide the correct information:
The current setup is valid! Here's what's actually happening:
[patch.crates-io.dashcore_hashes]- This is shorthand syntax for patching a specific crate. It's equivalent to havingdashcore_hashes = { path = "hashes" }inside a[patch.crates-io]section.[patch.crates-io]- This is the general section where you can patch multiple crates.Both syntaxes are valid and can coexist in the same Cargo.toml file. The fact that it compiles confirms this is correct syntax.
Why you might want to combine them:
Why the current approach is fine:
[patch.crates-io.dashcore_hashes]makes it immediately clear this is a workspace-internal patchYour current setup is perfectly valid and there's no need to change it unless you prefer the consolidated approach for organizational reasons. Thank you for the correction!
🌐 Web query:
💡 Result:
Yes, the
[patch]section inCargo.tomlallows multiple sub-sections, each targeting a specific source to override dependencies. This feature enables you to patch different registries or sources independently within the same project.For example, you can override dependencies from the default
crates.ioregistry and from a specific Git repository as follows:In this configuration:
[patch.crates-io]section overrides thefooandbarcrates from thecrates.ioregistry.[patch.'https://github.com/example/baz']section overrides thebazcrate from the specified Git repository.Each
[patch]sub-section targets a specific source, allowing for precise control over which dependencies are patched and how. This approach is particularly useful when you need to apply different patches to various sources within the same project.For more detailed information, refer to the official Cargo documentation on overriding dependencies. (doc.rust-lang.org)
Citations:
🌐 Web query:
💡 Result:
According to the official Cargo documentation, the correct syntax for the
[patch]section inCargo.tomlis as follows:[patch.]is the source being patched—commonlycrates-iofor the main registry, but it can also be a URL or custom registry name for other sources[1][4].You do not specify the crate name in the table header; instead, you list all crate overrides for that source within the same table:
The
[patch.crates-io]section can be placed only in the rootCargo.tomlof the workspace (not in individual crate manifests), and it applies to the entire workspace[1][7].Package renaming: If you are patching with a crate that has a different name, use the
packagekey. For example:This tells Cargo to use the code from the
my-forkcrate whenever a dependency specifiesoriginal[2][5].Summary Table:
[patch.crates-io]foo = { path = "../foo" }[patch.crates-io.foo]Consult the Overriding Dependencies section of The Cargo Book for more details and official examples[1].
Citations:
@PastaPastaPasta Based on the official Cargo documentation I just retrieved, I need to clarify the situation:
The documentation states that
[patch.crates-io.specific_crate]syntax is NOT supported. According to the official docs:Correct syntax:
Incorrect syntax (according to docs):
The discrepancy: You're right that it compiles, which suggests Cargo might be lenient and accept this undocumented syntax. However, relying on undocumented behavior could be risky for future Cargo versions.
My recommendation: Since the official documentation explicitly shows this syntax as incorrect, I'd suggest consolidating to the documented format to ensure long-term compatibility and follow Rust ecosystem standards.
The fact that it currently works doesn't necessarily mean it's the proper way according to the specification. Would you prefer to stick with the current working setup or migrate to the documented format for better standards compliance?