mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Update to latest substrate (#120)
This commit is contained in:
committed by
Robert Habermeier
parent
82e866be42
commit
36034e79a2
Generated
+556
-467
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
polkadot-primitives = { path = "../primitives" }
|
||||
parking_lot = "0.4"
|
||||
log = "0.3"
|
||||
parity-codec = "2.1"
|
||||
parity-codec = "3.0"
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
kvdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
|
||||
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="616b40150ded71f57f650067fcbc5c99d7c343e6" }
|
||||
|
||||
@@ -7,7 +7,7 @@ description = "Collator node implementation"
|
||||
[dependencies]
|
||||
futures = "0.1.17"
|
||||
substrate-client = { git = "https://github.com/paritytech/substrate" }
|
||||
parity-codec = "2.1"
|
||||
parity-codec = "3.0"
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
polkadot-runtime = { path = "../runtime", version = "0.1" }
|
||||
polkadot-primitives = { path = "../primitives", version = "0.1" }
|
||||
|
||||
@@ -10,7 +10,7 @@ tokio = "0.1.7"
|
||||
error-chain = "0.12"
|
||||
log = "0.3"
|
||||
exit-future = "0.1"
|
||||
parity-codec = "2.1"
|
||||
parity-codec = "3.0"
|
||||
polkadot-availability-store = { path = "../availability-store" }
|
||||
polkadot-parachain = { path = "../parachain" }
|
||||
polkadot-primitives = { path = "../primitives" }
|
||||
|
||||
@@ -83,7 +83,7 @@ use polkadot_primitives::parachain::{
|
||||
AttestedCandidate, ParachainHost, Statement as PrimitiveStatement
|
||||
};
|
||||
use primitives::{Ed25519AuthorityId as AuthorityId, ed25519};
|
||||
use runtime_primitives::traits::ProvideRuntimeApi;
|
||||
use runtime_primitives::{traits::ProvideRuntimeApi, ApplyError};
|
||||
use tokio::runtime::TaskExecutor;
|
||||
use tokio::timer::{Delay, Interval};
|
||||
use transaction_pool::txpool::{Pool, ChainApi as PoolChainApi};
|
||||
@@ -507,7 +507,7 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where
|
||||
type Error = Error;
|
||||
type Create = Either<CreateProposal<C, TxApi>, future::FutureResult<Block, Error>>;
|
||||
|
||||
fn propose(&self, inherent_data: InherentData) -> Self::Create {
|
||||
fn propose(&self, inherent_data: InherentData, max_duration: Duration) -> Self::Create {
|
||||
const ATTEMPT_PROPOSE_EVERY: Duration = Duration::from_millis(100);
|
||||
const SLOT_DURATION_DENOMINATOR: u64 = 3; // wait up to 1/3 of the slot for candidates.
|
||||
|
||||
@@ -558,6 +558,8 @@ impl<C, TxApi> consensus::Proposer<Block> for Proposer<C, TxApi> where
|
||||
believed_minimum_timestamp: believed_timestamp,
|
||||
timing,
|
||||
inherent_data: Some(inherent_data),
|
||||
// leave some time for the proposal finalisation
|
||||
deadline: Instant::now() + max_duration - max_duration / 3,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -626,6 +628,7 @@ pub struct CreateProposal<C: Send + Sync, TxApi: PoolChainApi> {
|
||||
timing: ProposalTiming,
|
||||
believed_minimum_timestamp: u64,
|
||||
inherent_data: Option<InherentData>,
|
||||
deadline: Instant,
|
||||
}
|
||||
|
||||
impl<C, TxApi> CreateProposal<C, TxApi> where
|
||||
@@ -637,8 +640,6 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
|
||||
use client::block_builder::BlockBuilder;
|
||||
use runtime_primitives::traits::{Hash as HashT, BlakeTwo256};
|
||||
|
||||
const MAX_TRANSACTIONS: usize = 40;
|
||||
|
||||
let mut inherent_data = self.inherent_data.take().expect("CreateProposal is not polled after finishing; qed");
|
||||
inherent_data.put_data(polkadot_runtime::PARACHAIN_INHERENT_IDENTIFIER, &candidates).map_err(ErrorKind::InherentError)?;
|
||||
|
||||
@@ -653,18 +654,20 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
|
||||
}
|
||||
|
||||
let mut unqueue_invalid = Vec::new();
|
||||
let mut pending_size = 0;
|
||||
|
||||
let ready_iter = self.transaction_pool.ready();
|
||||
for ready in ready_iter.take(MAX_TRANSACTIONS) {
|
||||
let encoded_size = ready.data.encode().len();
|
||||
if pending_size + encoded_size >= MAX_TRANSACTIONS_SIZE {
|
||||
break
|
||||
for ready in self.transaction_pool.ready() {
|
||||
if Instant::now() > self.deadline {
|
||||
debug!("Consensus deadline reached when pushing block transactions, proceeding with proposing.");
|
||||
break;
|
||||
}
|
||||
|
||||
match block_builder.push(ready.data.clone()) {
|
||||
Ok(()) => {
|
||||
pending_size += encoded_size;
|
||||
debug!("[{:?}] Pushed to the block.", ready.hash);
|
||||
}
|
||||
Err(client::error::Error(client::error::ErrorKind::ApplyExtrinsicFailed(ApplyError::FullBlock), _)) => {
|
||||
debug!("Block is full, proceed with proposing.");
|
||||
break;
|
||||
}
|
||||
Err(e) => {
|
||||
trace!(target: "transaction-pool", "Invalid transaction: {}", e);
|
||||
|
||||
@@ -7,6 +7,6 @@ edition = "2018"
|
||||
[dependencies]
|
||||
polkadot-primitives = { path = "../primitives" }
|
||||
reed-solomon-erasure = { git = "https://github.com/paritytech/reed-solomon-erasure" }
|
||||
parity-codec = "2.1"
|
||||
parity-codec = "3.0"
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-trie = { git = "https://github.com/paritytech/substrate" }
|
||||
|
||||
@@ -10,8 +10,8 @@ parking_lot = "0.4"
|
||||
polkadot-availability-store = { path = "../availability-store" }
|
||||
polkadot-consensus = { path = "../consensus" }
|
||||
polkadot-primitives = { path = "../primitives" }
|
||||
parity-codec = "2.1"
|
||||
parity-codec-derive = "2.1"
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
substrate-network = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
sr-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
|
||||
@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "Types and utilities for creating and working with parachains"
|
||||
|
||||
[dependencies]
|
||||
parity-codec = { version = "2.1", default-features = false }
|
||||
parity-codec-derive = { version = "2.1", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
wasmi = { version = "0.4.3", optional = true }
|
||||
error-chain = { version = "0.12", optional = true }
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
[dependencies]
|
||||
serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "2.1", default-features = false }
|
||||
parity-codec-derive = { version = "2.1", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
substrate-client = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
sr-version = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
|
||||
@@ -11,8 +11,8 @@ serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
polkadot-primitives = { path = "../primitives", default-features = false }
|
||||
parity-codec = { version = "2.2", default-features = false }
|
||||
parity-codec-derive = { version = "2.2", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
substrate-serializer = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
sr-std = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
sr-io = { git = "https://github.com/paritytech/substrate", default-features = false }
|
||||
|
||||
@@ -105,7 +105,7 @@ pub use balances::Call as BalancesCall;
|
||||
pub use parachains::{Call as ParachainsCall, INHERENT_IDENTIFIER as PARACHAIN_INHERENT_IDENTIFIER};
|
||||
pub use sr_primitives::{Permill, Perbill};
|
||||
pub use timestamp::BlockPeriod;
|
||||
pub use srml_support::{StorageValue, RuntimeMetadata};
|
||||
pub use srml_support::StorageValue;
|
||||
|
||||
/// Runtime version.
|
||||
pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
|
||||
Generated
+274
-217
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
Binary file not shown.
@@ -73,6 +73,7 @@ fn run() -> cli::error::Result<()> {
|
||||
executable_name: "polkadot",
|
||||
author: "Parity Team <admin@parity.io>",
|
||||
description: "Polkadot Relay-chain Client Node",
|
||||
support_url: "https://github.com/paritytech/polkadot/issues/new",
|
||||
};
|
||||
cli::run(::std::env::args(), Worker, version)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
parity-codec = "2.1"
|
||||
parity-codec-derive = "2.1"
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
|
||||
polkadot-primitives = { path = "../primitives" }
|
||||
|
||||
@@ -6,6 +6,6 @@ description = "Test parachain which adds to a number as its state transition"
|
||||
|
||||
[dependencies]
|
||||
polkadot-parachain = { path = "../../parachain/", default-features = false }
|
||||
parity-codec = { version = "2.1", default-features = false }
|
||||
parity-codec-derive = { version = "2.1", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
tiny-keccak = "1.4"
|
||||
|
||||
@@ -137,6 +137,7 @@ fn main() {
|
||||
executable_name: "adder-collator",
|
||||
description: "collator for adder parachain",
|
||||
author: "parity technologies",
|
||||
support_url: "https://github.com/paritytech/polkadot/issues/new",
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user