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

Ensure authorities don't disappear after block 50 #132

Merged
merged 6 commits into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
polkadot/runtime/wasm/target/
substrate/executor/wasm/target/
substrate/test-runtime/wasm/target/
substrate/pwasm-alloc/target/
substrate/pwasm-libc/target/
substrate/pwasm-alloc/Cargo.lock
substrate/pwasm-libc/Cargo.lock
demo/runtime/wasm/target/
**/._*
2 changes: 1 addition & 1 deletion polkadot/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn local_testnet_config() -> ChainConfig {
}),
staking: Some(StakingConfig {
current_era: 0,
intentions: vec![],
intentions: initial_authorities.clone(),
transaction_fee: 1,
balances: endowed_accounts.iter().map(|&k|(k, 1u64 << 60)).collect(),
validator_count: 2,
Expand Down
3 changes: 3 additions & 0 deletions polkadot/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,16 @@ impl<'a, T: 'a + PolkadotApi> Ready<'a, T> {
impl<'a, T: 'a + PolkadotApi> transaction_pool::Ready<VerifiedTransaction> for Ready<'a, T> {
fn is_ready(&mut self, xt: &VerifiedTransaction) -> Readiness {
let sender = xt.inner.signed;
trace!(target: "transaction-pool", "Checking readiness of {} (from {})", xt.hash, TransactionHash::from(sender));

// TODO: find a way to handle index error properly -- will need changes to
// transaction-pool trait.
let (api_handle, at_block) = (&self.api_handle, &self.at_block);
let next_index = self.known_indices.entry(sender)
.or_insert_with(|| api_handle.index(at_block, sender).ok().unwrap_or_else(u64::max_value));

trace!(target: "transaction-pool", "Next index for sender is {}; xt index is {}", next_index, xt.inner.index);

match xt.inner.index.cmp(&next_index) {
Ordering::Greater => Readiness::Future,
Ordering::Equal => Readiness::Ready,
Expand Down