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

OCW additional logs #413

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
40 changes: 28 additions & 12 deletions pallets/ddc-verification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,11 +1220,17 @@ pub mod pallet {
Percent::from_percent(T::MAJORITY),
)?;

let customer_activity_hashes: Vec<ActivityHash> = customers_activity_in_consensus
.clone()
.into_iter()
.map(|c| c.hash::<T>())
.collect();

log::info!(
"🧗‍ Customer Activity for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Customer Activity hashes for ClusterId: {:?} EraId: {:?} is: {:?}",
cluster_id,
era_activity.id,
customers_activity_in_consensus
customer_activity_hashes
);
let customers_activity_batch_roots = Self::convert_to_batch_merkle_roots(
cluster_id,
Expand All @@ -1237,10 +1243,11 @@ pub mod pallet {
customers_activity_batch_roots.clone().into_iter().map(hex::encode).collect();

log::info!(
"🧗‍ Customer Activity_batch_roots for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Customer Activity batches for ClusterId: {:?} EraId: {:?} is: batch 1 with root {:?} for activities {:?}",
aie0 marked this conversation as resolved.
Show resolved Hide resolved
cluster_id,
era_activity.id,
customer_batch_roots_string
customer_batch_roots_string,
customer_activity_hashes
);

let customers_activity_root = Self::create_merkle_root(
Expand All @@ -1251,10 +1258,11 @@ pub mod pallet {
.map_err(|err| vec![err])?;

log::info!(
"🧗‍ Customer Activity _ roots for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Customer Activity batches tree for ClusterId: {:?} EraId: {:?} is: batch 1 with root {:?} for activities {:?}",
cluster_id,
era_activity.id,
hex::encode(customers_activity_root)
hex::encode(customers_activity_root),
customer_batch_roots_string,
);

let nodes_activity_in_consensus = Self::get_consensus_for_activities(
Expand All @@ -1265,12 +1273,16 @@ pub mod pallet {
Percent::from_percent(T::MAJORITY),
)?;

let node_activity_hashes: Vec<ActivityHash> =
nodes_activity_in_consensus.clone().into_iter().map(|c| c.hash::<T>()).collect();

log::info!(
"🧗‍ Node Activity for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Node Activity hashes for ClusterId: {:?} EraId: {:?} is: {:?}",
cluster_id,
era_activity.id,
nodes_activity_in_consensus
node_activity_hashes
);

let nodes_activity_batch_roots = Self::convert_to_batch_merkle_roots(
cluster_id,
era_activity.id,
Expand All @@ -1282,20 +1294,23 @@ pub mod pallet {
nodes_activity_batch_roots.clone().into_iter().map(hex::encode).collect();

log::info!(
"🧗‍ Node Activity_batch_roots for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Node Activity batches for ClusterId: {:?} EraId: {:?} is: batch 1 with root {:?} for activities {:?}",
cluster_id,
era_activity.id,
nodes_activity_batch_roots_string
nodes_activity_batch_roots_string,
node_activity_hashes
);

let nodes_activity_root =
Self::create_merkle_root(cluster_id, era_activity.id, &nodes_activity_batch_roots)
.map_err(|err| vec![err])?;

log::info!(
"🧗‍ Node Activity _ roots for ClusterId: {:?} EraId: {:?} is: {:?}",
"🧗‍ Node Activity batches tree for ClusterId: {:?} EraId: {:?} is: batch 1 with root {:?} for activities {:?}",
cluster_id,
era_activity.id,
hex::encode(nodes_activity_root)
hex::encode(nodes_activity_root),
nodes_activity_batch_roots_string,
);

Self::store_validation_activities(
Expand Down Expand Up @@ -2223,6 +2238,7 @@ pub mod pallet {
let last_validated_era = Self::get_last_validated_era(cluster_id, current_validator)?
.unwrap_or_else(DdcEra::default);

log::info!("🚀 last_validated_era for cluster_id: {:?}", last_validated_era);
let all_ids = Self::fetch_processed_era_for_node(cluster_id, dac_nodes)?;

let ids_greater_than_last_validated_era: Vec<EraActivity> = all_ids
Expand Down
4 changes: 2 additions & 2 deletions runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 54113,
spec_version: 54114,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 19,
Expand Down Expand Up @@ -1408,7 +1408,7 @@ pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

/// Runtime migrations
type Migrations = (pallet_ddc_nodes::migrations::MigrateToV1<Runtime>,);
type Migrations = ();

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
2 changes: 1 addition & 1 deletion runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 54113,
spec_version: 54114,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 19,
Expand Down
Loading