Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadot v0.9.43 #69

Merged
merged 16 commits into from
Nov 16, 2023
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
3,599 changes: 2,169 additions & 1,430 deletions Cargo.lock

Large diffs are not rendered by default.

382 changes: 377 additions & 5 deletions Cargo.toml

Large diffs are not rendered by default.

136 changes: 73 additions & 63 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ edition = "2021"

[dependencies]
# third-party dependencies
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.2", default-features = false, features = [
"derive",
] }
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive",
] }
futures = "0.3.19"
async-trait = "0.1.52"
parking_lot = "0.12.1"
Expand All @@ -20,83 +24,89 @@ tokio = { version = "1.15", features = ["macros"] }
metered = { package = "prioritized-metered-channel", version = "0.2.0" }

# Local dependencies
fudge-companion = { path = "./src/builder/companion"}
fudge-companion = { path = "./src/builder/companion" }

# Substrate primitives dependencies
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-database = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-database = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }

# Substarte client dependencies
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-service = { git = "https://github.com/paritytech/substrate", features = ["test-helpers"], branch = "polkadot-v0.9.38" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
node-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-service = { git = "https://github.com/paritytech/substrate", features = [
"test-helpers",
], branch = "polkadot-v0.9.43" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
node-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }

# Substrate frame dependencies
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.38" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v0.9.43" }

# Polkadot dependencies
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
## Currently only needed to make cumulus-relay-chain-inprocess-interface compile, not sure why cumulus works though
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }

# Cumulus dependencies
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-relay-chain-inprocess-interface= { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" }

[dev-dependencies]
polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" }

frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
tracing-subscriber = "0.2"
pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
fudge-test-runtime = { path = "./src/tests/test-parachain", default-features = true }
pallet-session = { git = "https://github.com/paritytech/substrate", features = [
"historical",
], branch = "polkadot-v0.9.43" }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }

pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"] , branch = "polkadot-v0.9.38" }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.38" }
pallet-im-online = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.38" }
pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "polkadot-v0.9.38" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" }

tracing-subscriber = "0.2"
fudge-test-runtime = {path = "./src/tests/test-parachain", default-features = true}
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.43" }
pallet-xcm-transactor = { git = "https://github.com/moonbeam-foundation/moonbeam", default-features = false, rev = "7759b616c378b84e920ac56d3977bf9e49bcb1fb" }

[features]
default = []
runtime-benchmarks = [
'frame-benchmarking/runtime-benchmarks'
]
runtime-benchmarks = ['frame-benchmarking/runtime-benchmarks']
46 changes: 18 additions & 28 deletions core/src/builder/companion/src/expand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ pub fn expand(def: CompanionDef) -> SynResult<TokenStream> {
let collator = companion.#parachain_names.collator();

companion.#relay_chain_name.onboard_para(para, Box::new(collator)).map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;

)*

{
__hidden_tracing::enter_span!(sp_tracing::Level::TRACE, std::stringify!(#relay_chain_name - BlockBuilding:));

companion.#relay_chain_name.build_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
companion.#relay_chain_name.import_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
}

Ok(companion)
}

Expand Down Expand Up @@ -197,42 +203,26 @@ pub fn expand(def: CompanionDef) -> SynResult<TokenStream> {
}

pub fn evolve(&mut self) -> Result<(), BuilderError> {
{
__hidden_tracing::enter_span!(sp_tracing::Level::TRACE, std::stringify!(#relay_chain_name - BlockBuilding:));

self.#relay_chain_name.build_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
self.#relay_chain_name.import_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
}

{
#(
__hidden_tracing::enter_span!(sp_tracing::Level::TRACE, std::stringify!(#parachain_names - BlockBuilding:));

self.#parachain_names.build_block().map_err(|e| BuilderError::Parachain(e.into())).map(|_| ())?;
self.#parachain_names.import_block().map_err(|e| BuilderError::Parachain(e.into())).map(|_| ())?;
)*
}
let para_head = self.#parachain_names.head().map_err(|e| BuilderError::Parachain(e.into()))?;

{
__hidden_tracing::enter_span!(sp_tracing::Level::TRACE, std::stringify!(#relay_chain_name - BlockBuilding:));
self.#relay_chain_name.update_para_head(
self.#parachain_names.id(),
para_head,
).map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;

self.#relay_chain_name.build_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
self.#relay_chain_name.import_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
}
self.#relay_chain_name.build_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;

{
#(
__hidden_tracing::enter_span!(sp_tracing::Level::TRACE, std::stringify!(#relay_chain_name - Onboarding(#parachain_names):));

let para = _hidden_FudgeParaChain {
id: _hidden_ParaId::from(#parachain_ids),
head: self.#parachain_names.head().map_err(|e| BuilderError::Parachain(e.into()))?,
code: self.#parachain_names.code().map_err(|e| BuilderError::Parachain(e.into()))?,
};
self.#parachain_names.build_block().map_err(|e| BuilderError::Parachain(e.into())).map(|_| ())?;

let collator = self.#parachain_names.collator();
self.#relay_chain_name.import_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
self.#relay_chain_name.build_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
self.#relay_chain_name.import_block().map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;

self.#relay_chain_name.onboard_para(para, Box::new(collator)).map_err(|e| BuilderError::Relaychain(e.into())).map(|_| ())?;
self.#parachain_names.import_block().map_err(|e| BuilderError::Parachain(e.into())).map(|_| ())?;
)*
}

Expand Down
23 changes: 9 additions & 14 deletions core/src/builder/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,21 +717,16 @@ where
params: BlockImportParams<Block, TransactionFor<B, Block>>,
) -> Result<(), Error<Block>> {
let prev_hash = self.latest_block();
let ret = match futures::executor::block_on(self.client.as_ref().import_block(params))
.map_err(|e| {
tracing::error!(
target = DEFAULT_BUILDER_LOG_TARGET,
error = ?e,
"Could not import block."
);

let ret = match futures::executor::block_on(
self.client
.as_ref()
.import_block(params, Default::default()),
)
.map_err(|e| {
tracing::error!(
target = DEFAULT_BUILDER_LOG_TARGET,
error = ?e,
"Could not import block."
);

Error::BlockImporting(e.into())
})? {
Error::BlockImporting(e.into())
})? {
ImportResult::Imported(_) => Ok(()),
ImportResult::AlreadyInChain => Err(()),
ImportResult::KnownBad => Err(()),
Expand Down
Loading