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

Commit bebc24a

Browse files
Merge branch 'rh-async-backing-feature-while-frozen' of https://github.com/paritytech/polkadot into brad-rename-parathread
2 parents 1b2de66 + 89568e3 commit bebc24a

File tree

122 files changed

+2475
-2792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2475
-2792
lines changed

Cargo.lock

Lines changed: 370 additions & 329 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tikv-jemallocator = "0.5.0"
2424

2525
# Crates in our workspace, defined as dependencies so we can pass them feature flags.
2626
polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] }
27-
polkadot-node-core-pvf-worker = { path = "node/core/pvf/worker" }
27+
polkadot-node-core-pvf-prepare-worker = { path = "node/core/pvf/prepare-worker" }
2828
polkadot-overseer = { path = "node/overseer" }
2929

3030
[dev-dependencies]
@@ -82,7 +82,9 @@ members = [
8282
"node/core/prospective-parachains",
8383
"node/core/provisioner",
8484
"node/core/pvf",
85-
"node/core/pvf/worker",
85+
"node/core/pvf/common",
86+
"node/core/pvf/execute-worker",
87+
"node/core/pvf/prepare-worker",
8688
"node/core/pvf-checker",
8789
"node/core/runtime-api",
8890
"node/network/approval-distribution",
@@ -209,7 +211,7 @@ try-runtime = [ "polkadot-cli/try-runtime" ]
209211
fast-runtime = [ "polkadot-cli/fast-runtime" ]
210212
runtime-metrics = [ "polkadot-cli/runtime-metrics" ]
211213
pyroscope = ["polkadot-cli/pyroscope"]
212-
jemalloc-allocator = ["polkadot-node-core-pvf-worker/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"]
214+
jemalloc-allocator = ["polkadot-node-core-pvf-prepare-worker/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"]
213215
network-protocol-staging = ["polkadot-cli/network-protocol-staging"]
214216

215217

cli/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ pyroscope_pprofrs = { version = "0.2", optional = true }
2323

2424
service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }
2525
polkadot-client = { path = "../node/client", optional = true }
26-
polkadot-node-core-pvf-worker = { path = "../node/core/pvf/worker", optional = true }
26+
polkadot-node-core-pvf-execute-worker = { path = "../node/core/pvf/execute-worker", optional = true }
27+
polkadot-node-core-pvf-prepare-worker = { path = "../node/core/pvf/prepare-worker", optional = true }
2728
polkadot-performance-test = { path = "../node/test/performance-test", optional = true }
2829

2930
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -54,7 +55,8 @@ cli = [
5455
"frame-benchmarking-cli",
5556
"try-runtime-cli",
5657
"polkadot-client",
57-
"polkadot-node-core-pvf-worker",
58+
"polkadot-node-core-pvf-execute-worker",
59+
"polkadot-node-core-pvf-prepare-worker",
5860
]
5961
runtime-benchmarks = [
6062
"service/runtime-benchmarks",

cli/src/cli.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ pub struct RunCmd {
114114
#[arg(long = "grandpa-pause", num_args = 2)]
115115
pub grandpa_pause: Vec<u32>,
116116

117-
/// Enable the BEEFY gadget (only on Rococo or Wococo for now).
117+
/// Disable the BEEFY gadget
118+
/// (currently enabled by default on Rococo, Wococo and Versi).
118119
#[arg(long)]
119-
pub beefy: bool,
120+
pub no_beefy: bool,
120121

121122
/// Add the destination address to the jaeger agent.
122123
///

cli/src/command.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,9 @@ where
298298
.map_err(Error::from)?;
299299
let chain_spec = &runner.config().chain_spec;
300300

301-
// Disallow BEEFY on production networks.
302-
if cli.run.beefy &&
303-
(chain_spec.is_polkadot() || chain_spec.is_kusama() || chain_spec.is_westend())
304-
{
305-
return Err(Error::Other("BEEFY disallowed on production networks".to_string()))
306-
}
301+
// By default, enable BEEFY on test networks.
302+
let enable_beefy = (chain_spec.is_rococo() || chain_spec.is_wococo() || chain_spec.is_versi()) &&
303+
!cli.run.no_beefy;
307304

308305
set_default_ss58_version(chain_spec);
309306

@@ -346,7 +343,7 @@ where
346343
config,
347344
service::IsCollator::No,
348345
grandpa_pause,
349-
cli.run.beefy,
346+
enable_beefy,
350347
jaeger_agent,
351348
None,
352349
false,
@@ -495,7 +492,7 @@ pub fn run() -> Result<()> {
495492

496493
#[cfg(not(target_os = "android"))]
497494
{
498-
polkadot_node_core_pvf_worker::prepare_worker_entrypoint(
495+
polkadot_node_core_pvf_prepare_worker::worker_entrypoint(
499496
&cmd.socket_path,
500497
Some(&cmd.node_impl_version),
501498
);
@@ -517,7 +514,7 @@ pub fn run() -> Result<()> {
517514

518515
#[cfg(not(target_os = "android"))]
519516
{
520-
polkadot_node_core_pvf_worker::execute_worker_entrypoint(
517+
polkadot_node_core_pvf_execute_worker::worker_entrypoint(
521518
&cmd.socket_path,
522519
Some(&cmd.node_impl_version),
523520
);

node/core/approval-voting/src/approval_db/v1/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
1616

1717
//! Version 1 of the DB schema.
18+
//!
19+
//! Note that the version here differs from the actual version of the parachains
20+
//! database (check `CURRENT_VERSION` in `node/service/src/parachains_db/upgrade.rs`).
21+
//! The code in this module implements the way approval voting works with
22+
//! its data in the database. Any breaking changes here will still
23+
//! require a db migration (check `node/service/src/parachains_db/upgrade.rs`).
1824
1925
use parity_scale_codec::{Decode, Encode};
2026
use polkadot_node_primitives::approval::{AssignmentCert, DelayTranche};
@@ -154,8 +160,6 @@ pub type Bitfield = BitVec<u8, BitOrderLsb0>;
154160
pub struct Config {
155161
/// The column family in the database where data is stored.
156162
pub col_approval_data: u32,
157-
/// The column of the database where rolling session window data is stored.
158-
pub col_session_data: u32,
159163
}
160164

161165
/// Details pertaining to our assignment on a block.

node/core/approval-voting/src/approval_db/v1/tests.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ use std::{collections::HashMap, sync::Arc};
2828
use ::test_helpers::{dummy_candidate_receipt, dummy_candidate_receipt_bad_sig, dummy_hash};
2929

3030
const DATA_COL: u32 = 0;
31-
const SESSION_DATA_COL: u32 = 1;
3231

33-
const NUM_COLUMNS: u32 = 2;
32+
const NUM_COLUMNS: u32 = 1;
3433

35-
const TEST_CONFIG: Config =
36-
Config { col_approval_data: DATA_COL, col_session_data: SESSION_DATA_COL };
34+
const TEST_CONFIG: Config = Config { col_approval_data: DATA_COL };
3735

3836
fn make_db() -> (DbBackend, Arc<dyn Database>) {
3937
let db = kvdb_memorydb::create(NUM_COLUMNS);

node/core/approval-voting/src/import.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,10 @@ pub(crate) mod tests {
609609
use crate::{approval_db::v1::Config as DatabaseConfig, criteria, BlockEntry};
610610

611611
const DATA_COL: u32 = 0;
612-
const SESSION_DATA_COL: u32 = 1;
613612

614-
const NUM_COLUMNS: u32 = 2;
613+
const NUM_COLUMNS: u32 = 1;
615614

616-
const TEST_CONFIG: DatabaseConfig =
617-
DatabaseConfig { col_approval_data: DATA_COL, col_session_data: SESSION_DATA_COL };
615+
const TEST_CONFIG: DatabaseConfig = DatabaseConfig { col_approval_data: DATA_COL };
618616
#[derive(Default)]
619617
struct MockClock;
620618

node/core/approval-voting/src/lib.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ const LOG_TARGET: &str = "parachain::approval-voting";
116116
pub struct Config {
117117
/// The column family in the DB where approval-voting data is stored.
118118
pub col_approval_data: u32,
119-
/// The of the DB where rolling session info is stored.
120-
pub col_session_data: u32,
121119
/// The slot duration of the consensus algorithm, in milliseconds. Should be evenly
122120
/// divisible by 500.
123121
pub slot_duration_millis: u64,
@@ -357,10 +355,7 @@ impl ApprovalVotingSubsystem {
357355
keystore,
358356
slot_duration_millis: config.slot_duration_millis,
359357
db,
360-
db_config: DatabaseConfig {
361-
col_approval_data: config.col_approval_data,
362-
col_session_data: config.col_session_data,
363-
},
358+
db_config: DatabaseConfig { col_approval_data: config.col_approval_data },
364359
mode: Mode::Syncing(sync_oracle),
365360
metrics,
366361
}
@@ -369,10 +364,8 @@ impl ApprovalVotingSubsystem {
369364
/// Revert to the block corresponding to the specified `hash`.
370365
/// The operation is not allowed for blocks older than the last finalized one.
371366
pub fn revert_to(&self, hash: Hash) -> Result<(), SubsystemError> {
372-
let config = approval_db::v1::Config {
373-
col_approval_data: self.db_config.col_approval_data,
374-
col_session_data: self.db_config.col_session_data,
375-
};
367+
let config =
368+
approval_db::v1::Config { col_approval_data: self.db_config.col_approval_data };
376369
let mut backend = approval_db::v1::DbBackend::new(self.db.clone(), config);
377370
let mut overlay = OverlayedBackend::new(&backend);
378371

node/core/approval-voting/src/tests.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
1616

17-
use crate::tests::test_constants::TEST_CONFIG;
18-
1917
use super::*;
2018
use polkadot_node_primitives::{
2119
approval::{
@@ -115,12 +113,10 @@ fn make_sync_oracle(val: bool) -> (Box<dyn SyncOracle + Send>, TestSyncOracleHan
115113
pub mod test_constants {
116114
use crate::approval_db::v1::Config as DatabaseConfig;
117115
const DATA_COL: u32 = 0;
118-
const SESSION_DATA_COL: u32 = 1;
119116

120-
pub(crate) const NUM_COLUMNS: u32 = 2;
117+
pub(crate) const NUM_COLUMNS: u32 = 1;
121118

122-
pub(crate) const TEST_CONFIG: DatabaseConfig =
123-
DatabaseConfig { col_approval_data: DATA_COL, col_session_data: SESSION_DATA_COL };
119+
pub(crate) const TEST_CONFIG: DatabaseConfig = DatabaseConfig { col_approval_data: DATA_COL };
124120
}
125121

126122
struct MockSupportsParachains;
@@ -493,7 +489,6 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
493489
Config {
494490
col_approval_data: test_constants::TEST_CONFIG.col_approval_data,
495491
slot_duration_millis: SLOT_DURATION_MILLIS,
496-
col_session_data: TEST_CONFIG.col_session_data,
497492
},
498493
Arc::new(db),
499494
Arc::new(keystore),

0 commit comments

Comments
 (0)