mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Use same fmt and clippy configs as in Substrate (#7611)
* Use same rustfmt.toml as Substrate Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * format format file Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Format with new config Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add Substrate Clippy config Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Print Clippy version in CI Otherwise its difficult to reproduce locally. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Make fmt happy Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update node/core/pvf/src/error.rs Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io> * Update node/core/pvf/src/error.rs Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
This commit is contained in:
committed by
GitHub
parent
ac435c96cf
commit
342d720573
@@ -67,8 +67,8 @@ const META_PREFIX: &[u8; 4] = b"meta";
|
||||
const UNFINALIZED_PREFIX: &[u8; 11] = b"unfinalized";
|
||||
const PRUNE_BY_TIME_PREFIX: &[u8; 13] = b"prune_by_time";
|
||||
|
||||
// We have some keys we want to map to empty values because existence of the key is enough. We use this because
|
||||
// rocksdb doesn't support empty values.
|
||||
// We have some keys we want to map to empty values because existence of the key is enough. We use
|
||||
// this because rocksdb doesn't support empty values.
|
||||
const TOMBSTONE_VALUE: &[u8] = b" ";
|
||||
|
||||
/// Unavailable blocks are kept for 1 hour.
|
||||
@@ -139,10 +139,11 @@ enum State {
|
||||
/// Candidate data was first observed at the given time but is not available in any block.
|
||||
#[codec(index = 0)]
|
||||
Unavailable(BETimestamp),
|
||||
/// The candidate was first observed at the given time and was included in the given list of unfinalized blocks, which may be
|
||||
/// empty. The timestamp here is not used for pruning. Either one of these blocks will be finalized or the state will regress to
|
||||
/// `State::Unavailable`, in which case the same timestamp will be reused. Blocks are sorted ascending first by block number and
|
||||
/// then hash.
|
||||
/// The candidate was first observed at the given time and was included in the given list of
|
||||
/// unfinalized blocks, which may be empty. The timestamp here is not used for pruning. Either
|
||||
/// one of these blocks will be finalized or the state will regress to `State::Unavailable`, in
|
||||
/// which case the same timestamp will be reused. Blocks are sorted ascending first by block
|
||||
/// number and then hash.
|
||||
#[codec(index = 1)]
|
||||
Unfinalized(BETimestamp, Vec<(BEBlockNumber, Hash)>),
|
||||
/// Candidate data has appeared in a finalized block and did so at the given time.
|
||||
@@ -820,8 +821,8 @@ fn note_block_included(
|
||||
|
||||
match load_meta(db, config, &candidate_hash)? {
|
||||
None => {
|
||||
// This is alarming. We've observed a block being included without ever seeing it backed.
|
||||
// Warn and ignore.
|
||||
// This is alarming. We've observed a block being included without ever seeing it
|
||||
// backed. Warn and ignore.
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
?candidate_hash,
|
||||
@@ -894,9 +895,9 @@ async fn process_block_finalized<Context>(
|
||||
let mut db_transaction = DBTransaction::new();
|
||||
let (start_prefix, end_prefix) = finalized_block_range(finalized_number);
|
||||
|
||||
// We have to do some juggling here of the `iter` to make sure it doesn't cross the `.await` boundary
|
||||
// as it is not `Send`. That is why we create the iterator once within this loop, drop it,
|
||||
// do an asynchronous request, and then instantiate the exact same iterator again.
|
||||
// We have to do some juggling here of the `iter` to make sure it doesn't cross the `.await`
|
||||
// boundary as it is not `Send`. That is why we create the iterator once within this loop,
|
||||
// drop it, do an asynchronous request, and then instantiate the exact same iterator again.
|
||||
let batch_num = {
|
||||
let mut iter = subsystem
|
||||
.db
|
||||
@@ -961,8 +962,9 @@ async fn process_block_finalized<Context>(
|
||||
|
||||
update_blocks_at_finalized_height(&subsystem, &mut db_transaction, batch, batch_num, now)?;
|
||||
|
||||
// We need to write at the end of the loop so the prefix iterator doesn't pick up the same values again
|
||||
// in the next iteration. Another unfortunate effect of having to re-initialize the iterator.
|
||||
// We need to write at the end of the loop so the prefix iterator doesn't pick up the same
|
||||
// values again in the next iteration. Another unfortunate effect of having to re-initialize
|
||||
// the iterator.
|
||||
subsystem.db.write(db_transaction)?;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1217,8 @@ fn process_message(
|
||||
// We do not bubble up internal errors to caller subsystems, instead the
|
||||
// tx channel is dropped and that error is caught by the caller subsystem.
|
||||
//
|
||||
// We bubble up the specific error here so `av-store` logs still tell what happend.
|
||||
// We bubble up the specific error here so `av-store` logs still tell what
|
||||
// happend.
|
||||
return Err(e.into())
|
||||
},
|
||||
}
|
||||
@@ -1298,8 +1301,8 @@ fn store_available_data(
|
||||
.with_candidate(candidate_hash)
|
||||
.with_pov(&available_data.pov);
|
||||
|
||||
// Important note: This check below is critical for consensus and the `backing` subsystem relies on it to
|
||||
// ensure candidate validity.
|
||||
// Important note: This check below is critical for consensus and the `backing` subsystem relies
|
||||
// on it to ensure candidate validity.
|
||||
let chunks = erasure::obtain_chunks_v1(n_validators, &available_data)?;
|
||||
let branches = erasure::branches(chunks.as_ref());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user