Skip to content
Open
Show file tree
Hide file tree
Changes from 15 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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cumulus/client/relay-chain-inprocess-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ fn build_polkadot_full_node(
keep_finalized_for: None,
invulnerable_ah_collators: HashSet::new(),
collator_protocol_hold_off: None,
speculative_availability: false,
};

let (relay_chain_full_node, paranode_req_receiver) = match config.network.network_backend {
Expand Down
4 changes: 4 additions & 0 deletions polkadot/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ pub struct RunCmd {
/// **Dangerous!** Do not touch unless explicitly advised to.
#[arg(long, hide = true)]
pub collator_protocol_hold_off: Option<u64>,

/// Enable speculative availability requests via Prospective Parachains. Defaults to disabled.
#[arg(long = "speculative-availability")]
pub speculative_availability: bool,
}

#[allow(missing_docs)]
Expand Down
1 change: 1 addition & 0 deletions polkadot/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ where
keep_finalized_for: cli.run.keep_finalized_for,
invulnerable_ah_collators,
collator_protocol_hold_off,
speculative_availability: cli.run.speculative_availability,
},
)
.map(|full| full.task_manager)?;
Expand Down
51 changes: 51 additions & 0 deletions polkadot/node/core/av-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,30 @@ fn process_message(
},
}
},
AvailabilityStoreMessage::NoteBackableCandidates {
candidate_hashes,
num_validators,
tx,
} => {
for candidate_hash in candidate_hashes {
let res = note_backable_candidate(
&subsystem.db,
&subsystem.config,
candidate_hash,
num_validators,
subsystem,
);

match res {
Ok(_) => {},
Err(e) => {
let _ = tx.send(Err(()));
return Err(e)
},
}
}
let _ = tx.send(Ok(()));
},
}

Ok(())
Expand Down Expand Up @@ -1405,3 +1429,30 @@ fn prune_all(db: &Arc<dyn Database>, config: &Config, now: Duration) -> Result<(
db.write(tx)?;
Ok(())
}

fn note_backable_candidate(
db: &Arc<dyn Database>,
config: &Config,
candidate_hash: CandidateHash,
num_validators: usize,
subsystem: &AvailabilityStoreSubsystem,
) -> Result<(), Error> {
let mut tx = DBTransaction::new();

if load_meta(db, config, &candidate_hash)?.is_none() {
let now = subsystem.clock.now()?;
let meta = CandidateMeta {
state: State::Unavailable(now.into()),
data_available: false,
chunks_stored: bitvec::bitvec![u8, BitOrderLsb0; 0; num_validators],
};

let prune_at = now + KEEP_UNAVAILABLE_FOR;

write_pruning_key(&mut tx, config, prune_at, &candidate_hash);
write_meta(&mut tx, config, &candidate_hash, &meta);
}

db.write(tx)?;
Ok(())
}
1 change: 0 additions & 1 deletion polkadot/node/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ repository.workspace = true
workspace = true

[dependencies]
bitvec = { features = ["alloc"], workspace = true }
fatality = { workspace = true }
futures = { workspace = true }
futures-timer = { workspace = true }
Expand Down
Loading