mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 03:31:03 +00:00
Document more TODOs as tickets (#1418)
Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
This commit is contained in:
committed by
GitHub
parent
d2cfd7b9dc
commit
15ae7cfef6
@@ -392,7 +392,7 @@ enum CheckedHeader<H> {
|
||||
/// check a header has been signed by the right key. If the slot is too far in the future, an error will be returned.
|
||||
/// if it's successful, returns the pre-header, the slot number, and the signat.
|
||||
//
|
||||
// FIXME: needs misbehavior types - https://github.com/paritytech/substrate/issues/1018
|
||||
// FIXME #1018 needs misbehavior types
|
||||
fn check_header<B: Block>(slot_now: u64, mut header: B::Header, hash: B::Hash, authorities: &[Ed25519AuthorityId])
|
||||
-> Result<CheckedHeader<B::Header>, String>
|
||||
where DigestItemFor<B>: CompatibleDigestItem
|
||||
@@ -537,8 +537,7 @@ impl<B: Block, C, E> Verifier<B> for AuraVerifier<C, E> where
|
||||
);
|
||||
|
||||
// we add one to allow for some small drift.
|
||||
// FIXME: in the future, alter this queue to allow deferring of headers
|
||||
// https://github.com/paritytech/substrate/issues/1019
|
||||
// FIXME #1019 in the future, alter this queue to allow deferring of headers
|
||||
let checked_header = check_header::<B>(slot_now + 1, header, hash, &authorities[..])?;
|
||||
match checked_header {
|
||||
CheckedHeader::Checked(pre_header, slot_num, sig) => {
|
||||
@@ -577,7 +576,7 @@ impl<B: Block, C, E> Verifier<B> for AuraVerifier<C, E> where
|
||||
fork_choice: ForkChoiceStrategy::LongestChain,
|
||||
};
|
||||
|
||||
// FIXME: extract authorities - https://github.com/paritytech/substrate/issues/1019
|
||||
// FIXME #1019 extract authorities
|
||||
Ok((import_block, None))
|
||||
}
|
||||
CheckedHeader::Deferred(a, b) => {
|
||||
|
||||
@@ -401,7 +401,7 @@ pub fn import_single_block<B: BlockT, V: Verifier<B>>(
|
||||
} else {
|
||||
debug!(target: "sync", "Header {} was not provided ", block.hash);
|
||||
}
|
||||
return Err(BlockImportError::IncompleteHeader(peer)) //TODO: use persistent ID
|
||||
return Err(BlockImportError::IncompleteHeader(peer))
|
||||
},
|
||||
};
|
||||
|
||||
@@ -441,7 +441,7 @@ pub fn import_single_block<B: BlockT, V: Verifier<B>>(
|
||||
},
|
||||
Ok(ImportResult::KnownBad) => {
|
||||
debug!(target: "sync", "Peer gave us a bad block {}: {:?}", number, hash);
|
||||
Err(BlockImportError::BadBlock(peer)) //TODO: use persistent ID
|
||||
Err(BlockImportError::BadBlock(peer))
|
||||
},
|
||||
Err(e) => {
|
||||
debug!(target: "sync", "Error importing block {}: {:?}: {:?}", number, hash, e);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
//! set for this block height.
|
||||
|
||||
#![cfg(feature="rhd")]
|
||||
// FIXME: doesn't compile - https://github.com/paritytech/substrate/issues/1020
|
||||
// FIXME #1020 doesn't compile
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
@@ -432,7 +432,6 @@ impl<B, P, I, InStream, OutSink> Drop for BftFuture<B, P, I, InStream, OutSink>
|
||||
OutSink: Sink<SinkItem=Communication<B>, SinkError=Error>,
|
||||
{
|
||||
fn drop(&mut self) {
|
||||
// TODO: have a trait member to pass misbehavior reports into.
|
||||
let misbehavior = self.inner.drain_misbehavior().collect::<Vec<_>>();
|
||||
self.inner.context().proposer.import_misbehavior(misbehavior);
|
||||
}
|
||||
@@ -466,7 +465,7 @@ pub struct BftService<B: Block, P, I> {
|
||||
live_agreement: Mutex<Option<(B::Header, AgreementHandle)>>,
|
||||
round_cache: Arc<Mutex<RoundCache<B::Hash>>>,
|
||||
round_timeout_multiplier: u64,
|
||||
key: Arc<ed25519::Pair>, // TODO: key changing over time.
|
||||
key: Arc<ed25519::Pair>,
|
||||
factory: P,
|
||||
}
|
||||
|
||||
@@ -488,14 +487,13 @@ impl<B, P, I> BftService<B, P, I>
|
||||
start_round: 0,
|
||||
})),
|
||||
round_timeout_multiplier: 10,
|
||||
key: key, // TODO: key changing over time.
|
||||
key: key,
|
||||
factory,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the local Authority ID.
|
||||
pub fn local_id(&self) -> AuthorityId {
|
||||
// TODO: based on a header and some keystore.
|
||||
self.key.public().into()
|
||||
}
|
||||
|
||||
@@ -1084,7 +1082,6 @@ impl<C, A> BaseProposer<<C as AuthoringApi>::Block> for Proposer<C, A> where
|
||||
self.transaction_pool.ready(|pending_iterator| {
|
||||
let mut pending_size = 0;
|
||||
for pending in pending_iterator {
|
||||
// TODO [ToDr] Probably get rid of it, and validate in runtime.
|
||||
let encoded_size = pending.data.encode().len();
|
||||
if pending_size + encoded_size >= MAX_TRANSACTIONS_SIZE { break }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user