Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion - Independence for Slot-based algorithms from timestamp #1617

Merged
merged 4 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion client/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ where

let info = SlotInfo::new(
inherent_data_providers.slot(),
inherent_data_providers.timestamp(),
inherent_data,
self.slot_duration.as_duration(),
parent.clone(),
Expand Down
12 changes: 6 additions & 6 deletions parachain-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,15 @@ pub fn parachain_build_import_queue(
block_import: client.clone(),
client: client.clone(),
create_inherent_data_providers: move |_, _| async move {
let time = sp_timestamp::InherentDataProvider::from_system_time();
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*time,
*timestamp,
slot_duration,
);

Ok((time, slot))
Ok((slot, timestamp))
},
registry: config.prometheus_registry(),
can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
Expand Down Expand Up @@ -497,11 +497,11 @@ pub async fn start_parachain_node(
&validation_data,
id,
).await;
let time = sp_timestamp::InherentDataProvider::from_system_time();
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*time,
*timestamp,
slot_duration,
);

Expand All @@ -510,7 +510,7 @@ pub async fn start_parachain_node(
"Failed to create parachain inherent",
)
})?;
Ok((time, slot, parachain_inherent))
Ok((slot, timestamp, parachain_inherent))
}
},
block_import: client.clone(),
Expand Down
12 changes: 6 additions & 6 deletions polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ pub fn rococo_parachain_build_import_queue(
slot_duration,
);

Ok((timestamp, slot))
Ok((slot, timestamp))
},
registry: config.prometheus_registry(),
can_author_with: sp_consensus::AlwaysCanAuthor,
Expand Down Expand Up @@ -799,7 +799,7 @@ pub async fn start_rococo_parachain_node(
)
})?;

Ok((timestamp, slot, parachain_inherent))
Ok((slot, timestamp, parachain_inherent))
}
},
block_import: client.clone(),
Expand Down Expand Up @@ -1099,7 +1099,7 @@ where
slot_duration,
);

Ok((timestamp, slot))
Ok((slot, timestamp))
},
can_author_with: sp_consensus::AlwaysCanAuthor,
telemetry: telemetry_handle,
Expand Down Expand Up @@ -1228,7 +1228,7 @@ where
)
})?;

Ok((timestamp, slot, parachain_inherent))
Ok((slot, timestamp, parachain_inherent))
}
},
block_import: client2.clone(),
Expand Down Expand Up @@ -1543,7 +1543,7 @@ pub fn contracts_rococo_build_import_queue(
slot_duration,
);

Ok((timestamp, slot))
Ok((slot, timestamp))
},
registry: config.prometheus_registry(),
can_author_with: sp_consensus::AlwaysCanAuthor,
Expand Down Expand Up @@ -1618,7 +1618,7 @@ pub async fn start_contracts_rococo_node(
)
})?;

Ok((timestamp, slot, parachain_inherent))
Ok((slot, timestamp, parachain_inherent))
}
},
block_import: client.clone(),
Expand Down