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

Extend the BLSCache to add in a rust Pybinding for validate_clvm_and_signature for use in the mempool #637

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cargo fmt
matt-o-how committed Aug 6, 2024
commit 4e1cd225278eaa0a6cebf692591400db9211b0bd
2 changes: 1 addition & 1 deletion crates/chia-bls/benches/cache.rs
Original file line number Diff line number Diff line change
@@ -108,4 +108,4 @@ fn cache_benchmark(c: &mut Criterion) {
}

criterion_group!(cache, cache_benchmark);
criterion_main!(cache);
criterion_main!(cache);
2 changes: 1 addition & 1 deletion crates/chia-bls/src/bls_cache.rs
Original file line number Diff line number Diff line change
@@ -279,4 +279,4 @@ pub mod tests {

assert!(bls_cache.aggregate_verify(pks_msgs, &Signature::default()));
}
}
}
2 changes: 1 addition & 1 deletion crates/chia-consensus/src/gen/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod coin_id;
mod condition_sanitizers;
pub mod conditions;
pub mod condition_tools;
pub mod conditions;
pub mod flags;
pub mod get_puzzle_and_solution;
pub mod messages;
9 changes: 8 additions & 1 deletion crates/chia-consensus/src/spendbundle_validation.rs
Original file line number Diff line number Diff line change
@@ -23,7 +23,14 @@ pub fn validate_clvm_and_signature(
constants: &ConsensusConstants,
height: u32,
cache: &Arc<Mutex<BlsCache>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should pass in the cache here

) -> Result<(OwnedSpendBundleConditions, Vec<([u8; 32], Vec<u8>)>, Duration), ErrorCode> {
) -> Result<
(
OwnedSpendBundleConditions,
Vec<([u8; 32], Vec<u8>)>,
Duration,
),
ErrorCode,
> {
let start_time = Instant::now();
let npcresult = get_conditions_from_spendbundle(spend_bundle, max_cost, height, constants)
.map_err(|e| e.1)?;
4 changes: 3 additions & 1 deletion wheel/src/api.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,9 @@ use chia_consensus::gen::solution_generator::solution_generator_backrefs as nati
use chia_consensus::merkle_set::compute_merkle_set_root as compute_merkle_root_impl;
use chia_consensus::merkle_tree::{validate_merkle_proof, MerkleSet};
use chia_consensus::spendbundle_conditions::get_conditions_from_spendbundle;
use chia_consensus::spendbundle_validation::{get_flags_for_height_and_constants, validate_clvm_and_signature};
use chia_consensus::spendbundle_validation::{
get_flags_for_height_and_constants, validate_clvm_and_signature,
};
use chia_protocol::{
BlockRecord, Bytes32, ChallengeBlockInfo, ChallengeChainSubSlot, ClassgroupElement, Coin,
CoinSpend, CoinState, CoinStateFilters, CoinStateUpdate, EndOfSubSlotBundle, Foliage,