Fix various spelling errors (#4940)

* meaningfull -> meaningful

* initialise -> initialize

* tokans -> tokens

* incentivise -> incentivize

* lenght -> length

* incentivisation -> incentivization

* doesnt't -> doesn't

* overwriten -> overwritten

* lifecycle -> life cycle

* lifecycle -> life cycle

* usefull -> useful

* noone -> no one

* spaming -> spamming

* defered -> deferred

* hieght -> height

* sumation -> summation

* ingore -> ignore

* registed -> registered

* Auxialary -> Auxiliary

* loggin -> logging

* independance -> independence

* trailling -> trailing

* responsability -> responsibility

* trunkated -> truncated

* Weither -> Whether

* informations -> information

* Runtume -> Runtime

* choosen -> chosen

* delcataion -> declaration

* Unchekced -> Unchecked

* defintion -> definition

* scrach -> scratch

* imput -> input

* transfered -> transferred

* endownment -> endowment

* Determinator -> Determiner

* relevent -> relevant

* emited -> emitted

* acocunt -> account

* proprotional -> proportional

* instantiaion -> instantiation

* commited -> committed

* tombstonedead -> tombstone

* uwnrap -> unwrap

* acount -> account

* specialised -> specialized

* existant -> existent

* requried -> required

* Anull -> Annul

* AUTHORITES -> AUTHORITIES

* underyling -> underlying

* recognisable -> recognizable

* Capitalise -> Capitalize

* reportfor -> report for

* hearbeat -> heartbeat

* onlineness -> being online

* creater -> creator

* Bytearray -> Byte array

* Despoit -> Deposit

* substratced -> subtracted

* Curent -> Current

* imbalanes -> imbalances

* countfown -> countdown

* inexisting -> inexistent

* additionaly -> additionally

* substracted -> subtracted

* auxilary -> auxiliary

* parital -> partial

* in't -> isn't

* compatability -> compatibility

* infomation -> information

* etected -> detected

* extrinsiscs -> extrinsics

* reprensentation -> representation

* coonfiguration -> configuration

* primtives -> primitives

* miscelanious -> miscellaneous

* VERISON -> VERSION

* endcoded -> encoded

* Genrates -> Generates

* miliseconds -> milliseconds

* occured -> occurred

* trully -> truely

* truely -> truly

* conjuction -> conjunction

* encouters -> encounters

* customised -> customized

* deterministicly -> deterministically

* finalisation -> finalization

* pluggable -> plugable

* wakeup -> wake-up

* interemdiate -> intermediate

* intepreting -> interpreting

* finalzied -> finalized

* throgh -> through

* extinsic -> extrinsic

* convient -> convenient

* allocater -> allocator

* propagateable -> propagatable

* succesfuly -> successfully

* finalising -> finalizing

* publically -> publicly

* phrasee -> phrase

* substration -> substractions

* substractions -> subtractions

* neccessarily -> necessarily

* Inlucde -> Include

* unefficient -> inefficient

* thay -> they

* funtion -> function

* datastructures -> data structures

* infromation -> information

* propagatable -> propagable

* ecountered -> encountered

* recognise -> recognize

* intergration -> integration

* lastet -> latest

* datatypes -> data types

* datatype -> data type

* Strongarming -> Strong Arming

* avaible -> available

* Commiting -> Committing

* Retreiving -> Retrieving

* shoud -> should

* canonicaliziation -> canonicalization

* comitted -> committed

* clonable -> cloneable

* Uknown -> Unknown

* reponse -> response

* arbitary -> arbitrary

* Capapbilities -> Capabilities

* responsbile -> responsible

* initialisation -> initialization

* cames -> came

* intemediate -> intermediate

* reqeust -> request

* intance -> instance

* explcitly -> explicitly

* neighor -> neighbor

* reolving -> resolving

* untill -> until

* Validte -> Validate

* deserailize -> deserialize

* literaly -> literally

* preceeding -> preceding

* abpve -> above

* chcecked -> checked

* numbet -> number

* Unknow -> Unknown

* halfs -> halves

* gossup -> gossip

* givent -> given

* immediatelly -> immediately

* slicable -> sliceable

* conensus -> consensus

* Mimicks -> Mimics

* acccept -> accept

* serialise -> serialize

* exstrinsics -> extrinsics

* panicks -> panics

* maintaince -> maintenance

* repeatidely -> repeatedly

* anecstor -> ancestor

* becasue -> because

* processer -> processor

* Prunning -> Pruning

* insterested -> interested

* unuseful -> not useful

* yeided -> yielded

* descendfing -> descending

* corresponts -> corresponds

* survivew -> survive

* keps -> keeps

* ligh -> light

* prerequisities -> prerequisites

* positiion -> position

* depedency -> dependency

* extrinisic -> extrinsic

* atomicaly -> atomically

* staticly -> statically

* resul -> result

* timestamb -> timestamp

* Utilites -> Utilities

* ammount -> amount

* pocess -> process

* exteral -> external

* Update client/finality-grandpa/src/tests.rs

* Update primitives/io/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update primitives/blockchain/src/lib.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/support/src/weights.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update bin/node/cli/tests/common.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/cli/src/params.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/executor/common/src/sandbox.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/finality-grandpa/src/communication/mod.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/state-db/src/pruning.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update frame/contracts/src/tests.rs

Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update client/api/src/execution_extensions.rs

* bump impl

* timestamb -> timestamp

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-02-17 15:07:24 +01:00
committed by GitHub
parent 86ab0cb4d9
commit c7a14db792
169 changed files with 281 additions and 282 deletions
@@ -64,7 +64,7 @@ impl Default for ExecutionStrategies {
/// Generate the starting set of ExternalitiesExtensions based upon the given capabilities
pub trait ExtensionsFactory: Send + Sync {
/// Make `Extensions` for given Capapbilities
/// Make `Extensions` for given `Capabilities`.
fn extensions_for(&self, capabilities: offchain::Capabilities) -> Extensions;
}
@@ -77,7 +77,7 @@ impl ExtensionsFactory for () {
/// A producer of execution extensions for offchain calls.
///
/// This crate aggregates extensions available for the offchain calls
/// and is responsbile to produce a right `Extensions` object
/// and is responsible for producing a correct `Extensions` object.
/// for each call, based on required `Capabilities`.
pub struct ExecutionExtensions<Block: traits::Block> {
strategies: ExecutionStrategies,
@@ -125,7 +125,7 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
/// To break retain cycle between `Client` and `TransactionPool` we require this
/// extension to be a `Weak` reference.
/// That's also the reason why it's being registered lazily instead of
/// during initialisation.
/// during initialization.
pub fn register_transaction_pool(&self, pool: Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>) {
*self.transaction_pool.write() = Some(pool);
}
@@ -108,7 +108,7 @@ pub fn derive(
let err = || {
let err = Error::new(
Span::call_site(),
"ChainSpecGroup is only avaible for structs with named fields."
"ChainSpecGroup is only available for structs with named fields."
).to_compile_error();
quote!( #err ).into()
};
@@ -336,7 +336,7 @@ mod tests {
type TestSpec = ChainSpec<Genesis>;
#[test]
fn should_deserailize_example_chain_spec() {
fn should_deserialize_example_chain_spec() {
let spec1 = TestSpec::from_json_bytes(Cow::Owned(
include_bytes!("../res/chain_spec.json").to_vec()
)).unwrap();
+2 -3
View File
@@ -718,7 +718,7 @@ pub struct BuildSpecCmd {
pub node_key_params: NodeKeyParams,
}
/// Wrapper type of `String` which holds an arbitary sized unsigned integer formatted as decimal.
/// Wrapper type of `String` that holds an unsigned integer of arbitrary size, formatted as a decimal.
#[derive(Debug, Clone)]
pub struct BlockNumber(String);
@@ -908,7 +908,7 @@ pub enum Subcommand {
/// Import blocks from file.
ImportBlocks(ImportBlocksCmd),
/// Validte a single block.
/// Validate a single block.
CheckBlock(CheckBlockCmd),
/// Revert chain to the previous state.
@@ -1266,4 +1266,3 @@ impl BenchmarkCmd {
Ok(())
}
}
+2 -2
View File
@@ -316,12 +316,12 @@ impl TestNetFactory for BabeTestNet {
}
fn peer(&mut self, i: usize) -> &mut Peer<Self::PeerData, DummySpecialization> {
trace!(target: "babe", "Retreiving a peer");
trace!(target: "babe", "Retrieving a peer");
&mut self.peers[i]
}
fn peers(&self) -> &Vec<Peer<Self::PeerData, DummySpecialization>> {
trace!(target: "babe", "Retreiving peers");
trace!(target: "babe", "Retrieving peers");
&self.peers
}
+1 -1
View File
@@ -141,7 +141,7 @@ impl<Epoch> ViableEpoch<Epoch> where
}
}
/// The datatype encoded on disk.
/// The data type encoded on disk.
#[derive(Clone, Encode, Decode)]
pub enum PersistedEpoch<Epoch> {
/// Genesis persisted epoch data. epoch_0, epoch_1.
+1 -1
View File
@@ -357,7 +357,7 @@ impl<Block: BlockT, T: CacheItemT, S: Storage<Block, T>> ListCache<Block, T, S>
// it is possible that we're inserting extra (but still required) fork here
let new_storage_entry = StorageEntry {
prev_valid_from: Some(prev_valid_from),
value: value.expect("chcecked abpve that !value.is_none(); qed"),
value: value.expect("checked above that !value.is_none(); qed"),
};
tx.insert_storage_entry(&block, &new_storage_entry);
+1 -1
View File
@@ -69,7 +69,7 @@ impl<Block: BlockT, T: CacheItemT> Entry<Block, T> {
.map(|(entry, next)| (entry.valid_from, next)))
}
/// Searches the list, ending with THIS entry for the best entry preceeding (or at)
/// Searches the list, ending with THIS entry for the best entry preceding (or at)
/// given block number.
/// If the entry is found, result is the entry and the block id of next entry (if exists).
/// NOTE that this function does not check that the passed block is actually linked to
@@ -48,7 +48,7 @@ pub fn extract_new_configuration<Header: HeaderT>(header: &Header) -> Option<&Op
/// Opaque configuration cache transaction. During its lifetime, no-one should modify cache. This is currently
/// guaranteed because import lock is held during block import/finalization.
pub struct DbChangesTrieStorageTransaction<Block: BlockT> {
/// Cache operations that must be performed after db transaction is comitted.
/// Cache operations that must be performed after db transaction is committed.
cache_ops: DbCacheTransactionOps<Block>,
/// New configuration (if changed at current block).
new_config: Option<Option<ChangesTrieConfiguration>>,
+2 -2
View File
@@ -100,7 +100,7 @@ mod tests {
children2.push(1_6);
write_children(&mut tx, 0, PREFIX, 1_2, children2);
db.write(tx.clone()).expect("(2) Commiting transaction failed");
db.write(tx.clone()).expect("(2) Committing transaction failed");
let r1: Vec<u32> = read_children(&db, 0, PREFIX, 1_1).expect("(1) Getting r1 failed");
let r2: Vec<u32> = read_children(&db, 0, PREFIX, 1_2).expect("(1) Getting r2 failed");
@@ -109,7 +109,7 @@ mod tests {
assert_eq!(r2, vec![1_4, 1_6]);
remove_children(&mut tx, 0, PREFIX, 1_2);
db.write(tx).expect("(2) Commiting transaction failed");
db.write(tx).expect("(2) Committing transaction failed");
let r1: Vec<u32> = read_children(&db, 0, PREFIX, 1_1).expect("(2) Getting r1 failed");
let r2: Vec<u32> = read_children(&db, 0, PREFIX, 1_2).expect("(2) Getting r2 failed");
+3 -3
View File
@@ -741,7 +741,7 @@ impl<T: Clone> FrozenForDuration<T> {
/// Disk backend.
///
/// Disk backend keps data in a key-value store. In archive mode, trie nodes are kept from all blocks.
/// Disk backend keeps data in a key-value store. In archive mode, trie nodes are kept from all blocks.
/// Otherwise, trie nodes are kept only from some recent blocks.
pub struct Backend<Block: BlockT> {
storage: Arc<StorageDb<Block>>,
@@ -878,7 +878,7 @@ impl<Block: BlockT> Backend<Block> {
inmem
}
/// Returns total numbet of blocks (headers) in the block DB.
/// Returns total number of blocks (headers) in the block DB.
#[cfg(feature = "test-helpers")]
pub fn blocks_count(&self) -> u64 {
self.blockchain.db.iter(columns::HEADER).count() as u64
@@ -1000,7 +1000,7 @@ impl<Block: BlockT> Backend<Block> {
Ok((*hash, number, false, true))
}
// performs forced canonicaliziation with a delay after importing a non-finalized block.
// performs forced canonicalization with a delay after importing a non-finalized block.
fn force_delayed_canonicalize(
&self,
transaction: &mut DBTransaction,
+1 -1
View File
@@ -815,7 +815,7 @@ pub(crate) mod tests {
}
#[test]
fn get_cht_fails_for_non_existant_cht() {
fn get_cht_fails_for_non_existent_cht() {
let cht_size: u64 = cht::size();
assert!(LightStorage::<Block>::new_test().header_cht_root(cht_size, cht_size / 2).unwrap().is_none());
}
+2 -2
View File
@@ -338,7 +338,7 @@ impl<B: BlockT> CacheChanges<B> {
is_best,
);
let cache = &mut *cache;
// Filter out commiting block if any.
// Filter out committing block if any.
let enacted: Vec<_> = enacted
.iter()
.filter(|h| commit_hash.as_ref().map_or(true, |p| *h != p))
@@ -1453,7 +1453,7 @@ mod qc {
self.head_state(
self.canon.last()
.expect("wasn't forking to emptiness so there shoud be one!")
.expect("wasn't forking to emptiness so there should be one!")
.hash
)
},
+1 -1
View File
@@ -118,7 +118,7 @@ fn current_version(path: &Path) -> sp_blockchain::Result<u32> {
}
}
/// Opens database of givent type with given number of columns.
/// Opens database of given type with given number of columns.
fn open_database(db_path: &Path, db_type: DatabaseType, db_columns: u32) -> sp_blockchain::Result<Database> {
let db_path = db_path.to_str()
.ok_or_else(|| sp_blockchain::Error::Backend("Invalid database path".into()))?;
@@ -27,7 +27,7 @@ pub type Result<T> = std::result::Result<T, Error>;
pub enum Error {
/// Unserializable Data
InvalidData(sp_serializer::Error),
/// Trap occured during execution
/// Trap occurred during execution
Trap(wasmi::Trap),
/// Wasmi loading/instantiating error
Wasmi(wasmi::Error),
@@ -498,7 +498,7 @@ pub fn instantiate<'a, FE: SandboxCapabilities>(
///
/// This is generic over a supervisor function reference type.
pub struct Store<FR> {
// Memories and instances are `Some` untill torndown.
// Memories and instances are `Some` until torn down.
instances: Vec<Option<Rc<SandboxInstance<FR>>>>,
memories: Vec<Option<MemoryRef>>,
}
+1 -1
View File
@@ -276,7 +276,7 @@ struct Resolver<'a> {
/// Will be used as initial and maximum size of the imported memory.
heap_pages: usize,
/// By default, runtimes should import memory and this is `Some(_)` after
/// reolving. However, to be backwards compatible, we also support memory
/// resolving. However, to be backwards compatible, we also support memory
/// exported by the WASM blob (this will be `None` after resolving).
import_memory: RefCell<Option<MemoryRef>>,
}
@@ -32,7 +32,7 @@ use wasmtime::{Instance, Module, Memory, Table, Val};
/// routines.
pub struct InstanceWrapper {
instance: Instance,
// The memory instance of the `intance`.
// The memory instance of the `instance`.
//
// It is important to make sure that we don't make any copies of this to make it easier to proof
// See `memory_as_slice` and `memory_as_slice_mut`.
@@ -142,7 +142,7 @@ impl InstanceWrapper {
Val::I64(val) => Ok(Some(Value::I64(val))),
Val::F32(val) => Ok(Some(Value::F32(val))),
Val::F64(val) => Ok(Some(Value::F64(val))),
_ => Err("Unknow value type".into()),
_ => Err("Unknown value type".into()),
}
}
}
@@ -74,7 +74,7 @@ mod cost {
pub(super) const MALFORMED_CATCH_UP: Rep = Rep::new(-1000, "Grandpa: Malformed cath-up");
pub(super) const MALFORMED_COMMIT: Rep = Rep::new(-1000, "Grandpa: Malformed commit");
pub(super) const FUTURE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Future message");
pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Uknown voter");
pub(super) const UNKNOWN_VOTER: Rep = Rep::new(-150, "Grandpa: Unknown voter");
pub(super) const INVALID_VIEW_CHANGE: Rep = Rep::new(-500, "Grandpa: Invalid view change");
pub(super) const PER_UNDECODABLE_BYTE: i32 = -5;
@@ -83,7 +83,7 @@ mod cost {
pub(super) const INVALID_CATCH_UP: Rep = Rep::new(-5000, "Grandpa: Invalid catch-up");
pub(super) const INVALID_COMMIT: Rep = Rep::new(-5000, "Grandpa: Invalid commit");
pub(super) const OUT_OF_SCOPE_MESSAGE: Rep = Rep::new(-500, "Grandpa: Out-of-scope message");
pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up reqeust timeout");
pub(super) const CATCH_UP_REQUEST_TIMEOUT: Rep = Rep::new(-200, "Grandpa: Catch-up request timeout");
// cost of answering a catch up request
pub(super) const CATCH_UP_REPLY: Rep = Rep::new(-200, "Grandpa: Catch-up reply");
@@ -153,14 +153,14 @@ pub(crate) struct NetworkBridge<B: BlockT, N: Network<B>> {
/// `NeighborPacketWorker` processing packets sent through the `NeighborPacketSender`.
//
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children,
// thus one has to wrap neighor_packet_worker with an `Arc` `Mutex`.
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children,
// thus one has to wrap `neighbor_packet_worker` with an `Arc` `Mutex`.
neighbor_packet_worker: Arc<Mutex<periodic::NeighborPacketWorker<B>>>,
/// Receiver side of the peer report stream populated by the gossip validator, forwarded to the
/// gossip engine.
//
// `NetworkBridge` is required to be clonable, thus one needs to be able to clone its children,
// `NetworkBridge` is required to be cloneable, thus one needs to be able to clone its children,
// thus one has to wrap gossip_validator_report_stream with an `Arc` `Mutex`. Given that it is
// just an `UnboundedReceiver`, one could also switch to a multi-producer-*multi*-consumer
// channel implementation.
@@ -920,7 +920,7 @@ pub(crate) mod tests {
}
#[test]
fn finality_proof_check_fails_when_intemediate_fragment_has_unknown_headers() {
fn finality_proof_check_fails_when_intermediate_fragment_has_unknown_headers() {
let blockchain = test_blockchain();
// when intermediate (#0) fragment has non-empty unknown headers
@@ -945,7 +945,7 @@ pub(crate) mod tests {
}
#[test]
fn finality_proof_check_fails_when_intemediate_fragment_has_no_authorities_proof() {
fn finality_proof_check_fails_when_intermediate_fragment_has_no_authorities_proof() {
let blockchain = test_blockchain();
// when intermediate (#0) fragment has empty authorities proof
@@ -1004,7 +1004,7 @@ pub(crate) mod tests {
#[test]
fn finality_proof_is_none_if_first_justification_is_generated_by_unknown_set() {
// this is the case for forced change: set_id has been forcibly increased on full node
// and ligh node missed that
// and light node missed that
// => justification verification will fail on light node anyways, so we do not return
// finality proof at all
let blockchain = test_blockchain();
@@ -147,7 +147,7 @@ impl TestNetFactory for GrandpaTestNet {
use crate::light_import::tests::light_block_import_without_justifications;
let authorities_provider = Arc::new(self.test_config.clone());
// forbid direct finalization using justification that cames with the block
// forbid direct finalization using justification that came with the block
// => light clients will try to fetch finality proofs
let import = light_block_import_without_justifications(
client.clone(),
@@ -982,7 +982,7 @@ fn force_change_to_new_set() {
// it will only finalize if the forced transition happens.
// we add_blocks after the voters are spawned because otherwise
// the link-halfs have the wrong AuthoritySet
// the link-halves have the wrong AuthoritySet
run_to_completion(&mut runtime, 25, net, peers_a);
}
+1 -1
View File
@@ -260,7 +260,7 @@ impl Store {
/// Get public keys of all stored keys that match the key type.
///
/// This will just use the type of the public key (a list of which to be returned) in order
/// to determine the key type. Unless you use a specialised application-type public key, then
/// to determine the key type. Unless you use a specialized application-type public key, then
/// this only give you keys registered under generic cryptography, and will not return keys
/// registered under the application type.
pub fn public_keys<Public: AppPublic>(&self) -> Result<Vec<Public>> {
@@ -45,7 +45,7 @@ mod rep {
pub const DUPLICATE_GOSSIP: Rep = Rep::new(-(1 << 2), "Duplicate gossip");
/// Reputation change when a peer sends us a gossip message for an unknown engine, whatever that
/// means.
pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossup message engine id");
pub const UNKNOWN_GOSSIP: Rep = Rep::new(-(1 << 6), "Unknown gossip message engine id");
/// Reputation change when a peer sends a message from a topic it isn't registered on.
pub const UNREGISTERED_TOPIC: Rep = Rep::new(-(1 << 10), "Unregistered gossip message topic");
}
+1 -1
View File
@@ -192,7 +192,7 @@ pub enum DiscoveryOut {
/// e.g. obtained through the `identify` protocol.
UnroutablePeer(PeerId),
/// The DHT yeided results for the record request, grouped in (key, value) pairs.
/// The DHT yielded results for the record request, grouped in (key, value) pairs.
ValueFound(Vec<(record::Key, Vec<u8>)>),
/// The record requested was not found in the DHT.
+3 -3
View File
@@ -81,7 +81,7 @@ pub use light_client_handler::LightClientHandler;
const REQUEST_TIMEOUT_SEC: u64 = 40;
/// Interval at which we perform time based maintenance
const TICK_TIMEOUT: time::Duration = time::Duration::from_millis(1100);
/// Interval at which we propagate exstrinsics;
/// Interval at which we propagate extrinsics;
const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(2900);
/// Maximim number of known block hashes to keep for a peer.
@@ -97,7 +97,7 @@ pub(crate) const MIN_VERSION: u32 = 3;
// Maximum allowed entries in `BlockResponse`
const MAX_BLOCK_DATA_RESPONSE: u32 = 128;
/// When light node connects to the full node and the full node is behind light node
/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it unuseful
/// for at least `LIGHT_MAXIMAL_BLOCKS_DIFFERENCE` blocks, we consider it not useful
/// and disconnect to free connection slot.
const LIGHT_MAXIMAL_BLOCKS_DIFFERENCE: u64 = 8192;
@@ -183,7 +183,7 @@ struct Peer<B: BlockT, H: ExHashT> {
info: PeerInfo<B>,
/// Current block request, if any.
block_request: Option<(Instant, message::BlockRequest<B>)>,
/// Requests we are no longer insterested in.
/// Requests we are no longer interested in.
obsolete_requests: HashMap<message::RequestId, Instant>,
/// Holds a set of transactions known to this peer.
known_extrinsics: LruHashSet<H>,
@@ -36,7 +36,7 @@ pub enum DhtEvent {
/// The record has been successfully inserted into the DHT.
ValuePut(Key),
/// An error has occured while putting a record into the DHT.
/// An error has occurred while putting a record into the DHT.
ValuePutFailed(Key),
}
@@ -836,10 +836,10 @@ where
};
if let Some(peer) = available_peer {
let id = self.next_request_id();
let rq = serialise_request(id, &request.request);
let rq = serialize_request(id, &request.request);
let mut buf = Vec::with_capacity(rq.encoded_len());
if let Err(e) = rq.encode(&mut buf) {
log::debug!("failed to serialise request {}: {}", id, e);
log::debug!("failed to serialize request {}: {}", id, e);
send_reply(Err(ClientError::RemoteFetchFailed), request.request)
} else {
log::trace!("sending request {} to peer {}", id, peer);
@@ -917,7 +917,7 @@ fn retries<B: Block>(request: &Request<B>) -> usize {
rc.unwrap_or(0)
}
fn serialise_request<B: Block>(id: u64, request: &Request<B>) -> api::v1::light::Request {
fn serialize_request<B: Block>(id: u64, request: &Request<B>) -> api::v1::light::Request {
let request = match request {
Request::Header { request, .. } => {
let r = api::v1::light::RemoteHeaderRequest { block: request.block.encode() };
@@ -1051,7 +1051,7 @@ where
/// Sends a request to remote and awaits the response.
#[derive(Debug, Clone)]
pub struct OutboundProtocol {
/// The serialised protobuf request.
/// The serialized protobuf request.
request: Vec<u8>,
/// The max. request length in bytes.
max_data_size: usize,
@@ -227,7 +227,7 @@ impl<Block: BlockT> FetchChecker<Block> for AlwaysBadChecker {
impl<B: BlockT> LightDispatch<B> where
B::Header: HeaderT,
{
/// Creates new light client requests processer.
/// Creates new light client requests processor.
pub fn new(checker: Arc<dyn FetchChecker<B>>) -> Self {
LightDispatch {
checker,
@@ -567,7 +567,7 @@ impl<B: BlockT> LightDispatch<B> where
// return peer to the back of the queue
self.idle_peers.push_back(peer.clone());
// we have enumerated all peers and noone can handle request
// we have enumerated all peers and no one can handle request
if Some(peer) == last_peer {
let request = self.pending_requests.pop_front().expect("checked in loop condition; qed");
unhandled_requests.push_back(request);
@@ -209,13 +209,13 @@ pub mod generic {
RemoteHeaderResponse(RemoteHeaderResponse<Header>),
/// Remote changes request.
RemoteChangesRequest(RemoteChangesRequest<Hash>),
/// Remote changes reponse.
/// Remote changes response.
RemoteChangesResponse(RemoteChangesResponse<Number, Hash>),
/// Remote child storage read request.
RemoteReadChildRequest(RemoteReadChildRequest<Hash>),
/// Finality proof request.
FinalityProofRequest(FinalityProofRequest<Hash>),
/// Finality proof reponse.
/// Finality proof response.
FinalityProofResponse(FinalityProofResponse<Hash>),
/// Batch of consensus protocol messages.
ConsensusBatch(Vec<ConsensusMessage>),
@@ -8,7 +8,7 @@ package api.v1;
enum Direction {
// Enumerate in ascending order (from child to parent).
Ascending = 0;
// Enumerate in descendfing order (from parent to canonical child).
// Enumerate in descending order (from parent to canonical child).
Descending = 1;
}
@@ -751,7 +751,7 @@ impl<B: BlockT> ChainSync<B> {
| PeerSyncState::DownloadingFinalityProof(..) => Vec::new()
}
} else {
// When request.is_none() just acccept blocks
// When request.is_none() just accept blocks
blocks.into_iter().map(|b| {
IncomingBlock {
hash: b.hash,
@@ -955,7 +955,7 @@ impl<B: BlockT> ChainSync<B> {
},
Err(BlockImportError::MissingState) => {
// This may happen if the chain we were requesting upon has been discarded
// in the meantime becasue other chain has been finalized.
// in the meantime because other chain has been finalized.
// Don't mark it as bad as it still may be synced if explicitly requested.
trace!(target: "sync", "Obsolete block");
},
@@ -469,7 +469,7 @@ mod tests {
}
#[test]
fn anecstor_roots_are_finalized_when_finality_notification_is_missed() {
fn ancestor_roots_are_finalized_when_finality_notification_is_missed() {
let mut finality_proofs = ExtraRequests::<Block>::new("test");
let hash4 = [4; 32].into();
+1 -1
View File
@@ -367,7 +367,7 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> NetworkWorker
/// Get network state.
///
/// **Note**: Use this only for debugging. This API is unstable. There are warnings literaly
/// **Note**: Use this only for debugging. This API is unstable. There are warnings literally
/// everywhere about this. Please don't use this function to retrieve actual information.
pub fn network_state(&mut self) -> NetworkState {
let swarm = &mut self.network_service;
+1 -1
View File
@@ -766,7 +766,7 @@ pub trait TestNetFactory: Sized {
/// Blocks the current thread until we are sync'ed.
///
/// Calls `poll_until_sync` repeatidely with the runtime passed as parameter.
/// Calls `poll_until_sync` repeatedly with the runtime passed as parameter.
fn block_until_sync(&mut self, runtime: &mut tokio::runtime::current_thread::Runtime) {
runtime.block_on(futures::future::poll_fn::<(), (), _>(|| Ok(self.poll_until_sync()))).unwrap();
}
+8 -8
View File
@@ -18,7 +18,7 @@
//! function returns a pair of [`HttpApi`] and [`HttpWorker`] that share some state.
//!
//! The [`HttpApi`] is (indirectly) passed to the runtime when calling an offchain worker, while
//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimicks the API of the
//! the [`HttpWorker`] must be processed in the background. The [`HttpApi`] mimics the API of the
//! HTTP-related methods available to offchain workers.
//!
//! The reason for this design is driven by the fact that HTTP requests should continue running
@@ -110,7 +110,7 @@ struct HttpApiRequestRp {
}
impl HttpApi {
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_start(
&mut self,
method: &str,
@@ -138,7 +138,7 @@ impl HttpApi {
Ok(new_id)
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_add_header(
&mut self,
request_id: HttpRequestId,
@@ -158,7 +158,7 @@ impl HttpApi {
Ok(())
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_write_body(
&mut self,
request_id: HttpRequestId,
@@ -266,7 +266,7 @@ impl HttpApi {
}
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_wait(
&mut self,
ids: &[HttpRequestId],
@@ -392,7 +392,7 @@ impl HttpApi {
}
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_headers(
&mut self,
request_id: HttpRequestId
@@ -411,7 +411,7 @@ impl HttpApi {
.collect()
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_read_body(
&mut self,
request_id: HttpRequestId,
@@ -947,7 +947,7 @@ mod tests {
#[test]
fn fuzzing() {
// Uses the API in random ways to try to trigger panicks.
// Uses the API in random ways to try to trigger panics.
// Doesn't test some paths, such as waiting for multiple requests. Also doesn't test what
// happens if the server force-closes our socket.
@@ -33,7 +33,7 @@ pub struct HttpApi;
pub struct HttpWorker;
impl HttpApi {
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_start(
&mut self,
_: &str,
@@ -43,7 +43,7 @@ impl HttpApi {
Err(())
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_add_header(
&mut self,
_: HttpRequestId,
@@ -54,7 +54,7 @@ impl HttpApi {
never be called; qed")
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn request_write_body(
&mut self,
_: HttpRequestId,
@@ -65,7 +65,7 @@ impl HttpApi {
never be called; qed")
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_wait(
&mut self,
requests: &[HttpRequestId],
@@ -79,7 +79,7 @@ impl HttpApi {
}
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_headers(
&mut self,
_: HttpRequestId
@@ -88,7 +88,7 @@ impl HttpApi {
never be called; qed")
}
/// Mimicks the corresponding method in the offchain API.
/// Mimics the corresponding method in the offchain API.
pub fn response_read_body(
&mut self,
_: HttpRequestId,
+1 -1
View File
@@ -217,6 +217,6 @@ mod tests {
// then
assert_eq!(pool.0.status().ready, 1);
assert_eq!(pool.0.ready().next().unwrap().is_propagateable(), false);
assert_eq!(pool.0.ready().next().unwrap().is_propagable(), false);
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ pub trait AuthorApi<Hash, BlockHash> {
/// Submit an extrinsic to watch.
///
/// See [`TransactionStatus`](sp_transaction_pool::TransactionStatus) for details on transaction
/// lifecycle.
/// life cycle.
#[pubsub(
subscription = "author_extrinsicUpdate",
subscribe,
+1 -1
View File
@@ -20,7 +20,7 @@ pub fn internal<E: ::std::fmt::Debug>(e: E) -> jsonrpc_core::Error {
warn!("Unknown error: {:?}", e);
jsonrpc_core::Error {
code: jsonrpc_core::ErrorCode::InternalError,
message: "Unknown error occured".into(),
message: "Unknown error occurred".into(),
data: Some(format!("{:?}", e).into()),
}
}
@@ -71,7 +71,7 @@ impl Subscriptions {
/// Borrows the internal task executor.
///
/// This can be used to spawn additional tasks on the underyling event loop.
/// This can be used to spawn additional tasks on the underlying event loop.
pub fn executor(&self) -> &TaskExecutor {
&self.executor
}
+1 -1
View File
@@ -625,7 +625,7 @@ where
E: IntoPoolError + From<sp_transaction_pool::error::Error>,
{
pool.ready()
.filter(|t| t.is_propagateable())
.filter(|t| t.is_propagable())
.map(|t| {
let hash = t.hash().clone();
let ex: B::Extrinsic = t.data().clone();
+1 -1
View File
@@ -498,7 +498,7 @@ pub fn consensus<G, E, Fb, F, Lb, L>(
const NUM_FULL_NODES: usize = 10;
const NUM_LIGHT_NODES: usize = 10;
const NUM_BLOCKS: usize = 10; // 10 * 2 sec block production time = ~20 seconds
let temp = tempdir_with_prefix("substrate-conensus-test");
let temp = tempdir_with_prefix("substrate-consensus-test");
let mut network = TestNet::new(
&temp,
spec.clone(),
+2 -2
View File
@@ -1192,7 +1192,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
// NOTE: we're setting the finalized block as best block, this might
// be slightly inaccurate since we might have a "better" block
// further along this chain, but since best chain selection logic is
// pluggable we cannot make a better choice here. usages that need
// plugable we cannot make a better choice here. usages that need
// an accurate "best" block need to go through `SelectChain`
// instead.
operation.op.mark_head(BlockId::Hash(block))?;
@@ -3041,7 +3041,7 @@ pub(crate) mod tests {
.unwrap().build().unwrap().block;
// we will finalize A2 which should make it impossible to import a new
// B3 at the same height but that doesnt't include it
// B3 at the same height but that doesn't include it
ClientExt::finalize_block(&client, BlockId::Hash(a2.hash()), None).unwrap();
let import_err = client.import(BlockOrigin::Own, b3).err().unwrap();
+1 -1
View File
@@ -102,7 +102,7 @@ impl<E: fmt::Debug> fmt::Debug for Error<E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Db(e) => e.fmt(f),
Error::Decoding(e) => write!(f, "Error decoding slicable value: {}", e.what()),
Error::Decoding(e) => write!(f, "Error decoding sliceable value: {}", e.what()),
Error::InvalidBlock => write!(f, "Trying to canonicalize invalid block"),
Error::InvalidBlockNumber => write!(f, "Trying to insert block with invalid number"),
Error::InvalidParent => write!(f, "Trying to insert block with unknown parent"),
@@ -106,7 +106,7 @@ fn discard_descendants<BlockHash: Hash, Key: Hash>(
// save to be discarded later.
pinned_insertions.insert(overlay.hash.clone(), overlay.inserted);
} else {
// discard immediatelly.
// discard immediately.
parents.remove(&overlay.hash);
discard_values(&mut values, overlay.inserted);
}
+2 -2
View File
@@ -36,7 +36,7 @@ pub struct RefWindow<BlockHash: Hash, Key: Hash> {
death_rows: VecDeque<DeathRow<BlockHash, Key>>,
/// An index that maps each key from `death_rows` to block number.
death_index: HashMap<Key, u64>,
/// Block number that corresponts to the front of `death_rows`
/// Block number that corresponds to the front of `death_rows`.
pending_number: u64,
/// Number of call of `note_canonical` after
/// last call `apply_pending` or `revert_pending`
@@ -348,7 +348,7 @@ mod tests {
}
#[test]
fn reinserted_survivew_pending() {
fn reinserted_survive_pending() {
let mut db = make_db(&[1, 2, 3]);
let mut pruning: RefWindow<H256, H256> = RefWindow::new(&db).unwrap();
let mut commit = make_commit(&[], &[2]);
+2 -2
View File
@@ -126,7 +126,7 @@ pub struct Telemetry {
/// Behind the `Mutex` in `Telemetry`.
///
/// Note that ideally we wouldn't have to make the `Telemetry` clonable, as that would remove the
/// Note that ideally we wouldn't have to make the `Telemetry` cloneable, as that would remove the
/// need for a `Mutex`. However there is currently a weird hack in place in `sc-service`
/// where we extract the telemetry registration so that it continues running during the shutdown
/// process.
@@ -195,7 +195,7 @@ impl Stream for Telemetry {
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let before = Instant::now();
// Because the `Telemetry` is clonable, we need to put the actual fields behind a `Mutex`.
// Because the `Telemetry` is cloneable, we need to put the actual fields behind a `Mutex`.
// However, the user is only ever supposed to poll from one instance of `Telemetry`, while
// the other instances are used only for RAII purposes.
// We assume that the user is following this advice and therefore that the `Mutex` is only
@@ -138,7 +138,7 @@ impl<Hash, Extrinsic> InPoolTransaction for Transaction<Hash, Extrinsic> {
&self.provides
}
fn is_propagateable(&self) -> bool {
fn is_propagable(&self) -> bool {
self.propagate
}
}
@@ -1058,7 +1058,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
requires: vec![vec![3], vec![2]],
provides: vec![vec![4]],
propagate: true,
}.is_propagateable(), true);
}.is_propagable(), true);
assert_eq!(Transaction {
data: vec![4u8],
@@ -1069,7 +1069,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
requires: vec![vec![3], vec![2]],
provides: vec![vec![4]],
propagate: false,
}.is_propagateable(), false);
}.is_propagable(), false);
}
#[test]
@@ -1126,7 +1126,7 @@ requires: [03,02], provides: [04], data: [4]}".to_owned()
}
#[test]
fn should_accept_future_transactions_when_explcitly_asked_to() {
fn should_accept_future_transactions_when_explicitly_asked_to() {
// given
let mut pool = pool();
pool.reject_future_transactions = true;
@@ -58,7 +58,7 @@ impl<H: hash::Hash + traits::Member + Serialize, C: ChainApi> Listener<H, C> {
/// Creates a new watcher for given verified extrinsic.
///
/// The watcher can be used to subscribe to lifecycle events of that extrinsic.
/// The watcher can be used to subscribe to life-cycle events of that extrinsic.
pub fn create_watcher(&mut self, hash: H) -> watcher::Watcher<H, BlockHash<C>> {
let sender = self.watchers.entry(hash.clone()).or_insert_with(watcher::Sender::default);
sender.new_watcher(hash)
@@ -308,7 +308,7 @@ impl<B: ChainApi> Pool<B> {
let reverified_transactions = self.verify(at, pruned_transactions, false).await?;
log::trace!(target: "txpool", "Prunning at {:?}. Resubmitting transactions.", at);
log::trace!(target: "txpool", "Pruning at {:?}. Resubmitting transactions.", at);
// And finally - submit reverified transactions back to the pool
self.validated_pool.resubmit_pruned(
@@ -222,7 +222,7 @@ fn should_revalidate_during_maintenance() {
}
#[test]
fn should_resubmit_from_retracted_during_maintaince() {
fn should_resubmit_from_retracted_during_maintenance() {
let xt = uxt(Alice, 209);
let retracted_hash = Hash::random();