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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mku-blockid-runtimeapi
Browse files Browse the repository at this point in the history
  • Loading branch information
parity-processbot committed Feb 20, 2023
2 parents 6855b70 + 242c111 commit 8382f29
Show file tree
Hide file tree
Showing 25 changed files with 413 additions and 328 deletions.
572 changes: 296 additions & 276 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <[email protected]>"]
edition = "2021"

[dependencies]
clap = { version = "4.1.4", features = ["derive"] }
clap = { version = "4.1.6", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.3.1"

Expand Down
27 changes: 25 additions & 2 deletions client/collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,34 @@ where
.ok()
.flatten()?;

let upward_messages = collation_info
.upward_messages
.try_into()
.map_err(|e| {
tracing::error!(
target: LOG_TARGET,
error = ?e,
"Number of upward messages should not be greater than `MAX_UPWARD_MESSAGE_NUM`",
)
})
.ok()?;
let horizontal_messages = collation_info
.horizontal_messages
.try_into()
.map_err(|e| {
tracing::error!(
target: LOG_TARGET,
error = ?e,
"Number of horizontal messages should not be greater than `MAX_HORIZONTAL_MESSAGE_NUM`",
)
})
.ok()?;

Some(Collation {
upward_messages: collation_info.upward_messages,
upward_messages,
new_validation_code: collation_info.new_validation_code,
processed_downward_messages: collation_info.processed_downward_messages,
horizontal_messages: collation_info.horizontal_messages,
horizontal_messages,
hrmp_watermark: collation_info.hrmp_watermark,
head_data: collation_info.head_data,
proof_of_validity: MaybeCompressedPoV::Compressed(pov),
Expand Down
4 changes: 2 additions & 2 deletions client/network/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ impl RelayChainInterface for DummyRelayChainInterface {
validation_code_hash: ValidationCodeHash::from(PHash::random()),
},
commitments: CandidateCommitments {
upward_messages: Vec::new(),
horizontal_messages: Vec::new(),
upward_messages: Default::default(),
horizontal_messages: Default::default(),
new_validation_code: None,
head_data: HeadData(Vec::new()),
processed_downward_messages: 0,
Expand Down
12 changes: 8 additions & 4 deletions pallets/parachain-system/src/validate_block/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ use polkadot_parachain::primitives::{
HeadData, RelayChainBlockNumber, ValidationParams, ValidationResult,
};

use codec::{Decode, Encode};
use codec::Encode;

use frame_support::traits::{ExecuteBlock, ExtrinsicCall, Get, IsSubType};
use sp_core::storage::{ChildInfo, StateVersion};
use sp_externalities::{set_and_run_with_externalities, Externalities};
use sp_io::KillStorageResult;
use sp_runtime::traits::{Block as BlockT, Extrinsic, HashFor, Header as HeaderT};
use sp_std::{mem, prelude::*};
use sp_std::prelude::*;
use sp_trie::MemoryDB;

type TrieBackend<B> = sp_state_machine::TrieBackend<MemoryDB<HashFor<B>>, HashFor<B>>;
Expand Down Expand Up @@ -187,9 +187,13 @@ where
E::execute_block(block);

let new_validation_code = crate::NewValidationCode::<PSC>::get();
let upward_messages = crate::UpwardMessages::<PSC>::get();
let upward_messages = crate::UpwardMessages::<PSC>::get().try_into().expect(
"Number of upward messages should not be greater than `MAX_UPWARD_MESSAGE_NUM`",
);
let processed_downward_messages = crate::ProcessedDownwardMessages::<PSC>::get();
let horizontal_messages = crate::HrmpOutboundMessages::<PSC>::get();
let horizontal_messages = crate::HrmpOutboundMessages::<PSC>::get().try_into().expect(
"Number of horizontal messages should not be greater than `MAX_HORIZONTAL_MESSAGE_NUM`",
);
let hrmp_watermark = crate::HrmpWatermark::<PSC>::get();

let head_data =
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
build = "build.rs"

[dependencies]
clap = { version = "4.1.4", features = ["derive"] }
clap = { version = "4.1.6", features = ["derive"] }
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.152", features = ["derive"] }
Expand Down
6 changes: 4 additions & 2 deletions parachains/chain-specs/bridge-hub-kusama.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"/dns/kusama-bridge-hub-connect-ew1-0.polkadot.io/tcp/443/wss/p2p/12D3KooWPQQPivrqQ51kRTDc2R1mtqwKT4GGtk2rapkY4FrwHrEp",
"/dns/kusama-bridge-hub-connect-ew1-1.polkadot.io/tcp/443/wss/p2p/12D3KooWPcF9Yk4gYrMju9CyWCV69hAFXbYsnxCLogwLGu9QFTRn",
"/dns/kusama-bridge-hub-connect-ue4-0.polkadot.io/tcp/443/wss/p2p/12D3KooWMf1sVnJDTkKWtaThqvrgcSPLbfGXttSqbwhM2DJp9BUG",
"/dns/kusama-bridge-hub-connect-ue4-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQaV7wMfNVKy2aMz4Lds3TTxgSDyZAUEnbAZMfD8rW3ow"
"/dns/kusama-bridge-hub-connect-ue4-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQaV7wMfNVKy2aMz4Lds3TTxgSDyZAUEnbAZMfD8rW3ow",
"/dns/boot.stake.plus/tcp/41333/p2p/12D3KooWBzbs2jsXjG5dipktGPKaUm9XWvkmeJFsEAGkVt946Aa7",
"/dns/boot.stake.plus/tcp/41334/wss/p2p/12D3KooWBzbs2jsXjG5dipktGPKaUm9XWvkmeJFsEAGkVt946Aa7"
],
"telemetryEndpoints": null,
"protocolId": null,
Expand Down Expand Up @@ -81,4 +83,4 @@
"childrenDefault": {}
}
}
}
}
6 changes: 4 additions & 2 deletions parachains/chain-specs/collectives-westend.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"/dns/westend-collectives-collator-4.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWCui467sJqUd7GzxB9HWpxrvXQfHWuYGN14KoSQwJQ9Sk",
"/dns/westend-collectives-collator-5.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWLGeRp67Y4LTpDYW15ophkcn8VAbNf4mhw9MXwPUamCss",
"/dns/westend-collectives-collator-6.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWDVdnw4fU8KsvVmXYwC7ifqsXssQgQ5rzPpBNEJPZewEB",
"/dns/westend-collectives-collator-7.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWCYmG2HhYQTSs7PHcrBcsdfte7SJhctW6PeTYLLDyN4Yb"
"/dns/westend-collectives-collator-7.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWCYmG2HhYQTSs7PHcrBcsdfte7SJhctW6PeTYLLDyN4Yb",
"/dns/boot.stake.plus/tcp/38333/p2p/12D3KooWQoVsFCfgu21iu6kdtQsU9T6dPn1wsyLn1U34yPerR6zQ",
"/dns/boot.stake.plus/tcp/38334/wss/p2p/12D3KooWQoVsFCfgu21iu6kdtQsU9T6dPn1wsyLn1U34yPerR6zQ"
],
"telemetryEndpoints": null,
"protocolId": null,
Expand Down Expand Up @@ -101,4 +103,4 @@
"childrenDefault": {}
}
}
}
}
2 changes: 1 addition & 1 deletion polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ path = "src/main.rs"

[dependencies]
async-trait = "0.1.63"
clap = { version = "4.1.4", features = ["derive"] }
clap = { version = "4.1.6", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
futures = "0.3.26"
hex-literal = "0.3.4"
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/changelog/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ gem 'optparse', '~> 0.1.1'

gem 'logger', '~> 1.4'

gem 'changelogerator', '0.10.1'

gem 'test-unit', group: :dev

gem 'rubocop', group: :dev, require: false
5 changes: 5 additions & 0 deletions scripts/ci/changelog/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
changelogerator (0.10.1)
git_diff_parser (~> 3)
octokit (~> 4)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -64,8 +67,10 @@ GEM

PLATFORMS
x86_64-darwin-20
x86_64-darwin-22

DEPENDENCIES
changelogerator (= 0.10.1)
git_diff_parser (~> 3)
logger (~> 1.4)
octokit (~> 4)
Expand Down
13 changes: 10 additions & 3 deletions scripts/ci/changelog/bin/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ logger = Logger.new($stdout)
logger.level = Logger::DEBUG
logger.debug('Starting')

changelogerator_version = `changelogerator --version`
logger.debug(changelogerator_version)

owner = 'paritytech'
repo = 'cumulus'
ref1 = ARGV[0]
Expand All @@ -32,6 +35,9 @@ polkadot_ref2 = gh_cumulus.get_dependency_reference(ref2, 'polkadot-client')
substrate_ref1 = gh_cumulus.get_dependency_reference(ref1, 'sp-io')
substrate_ref2 = gh_cumulus.get_dependency_reference(ref2, 'sp-io')

logger.debug("Cumulus from: #{ref1}")
logger.debug("Cumulus to: #{ref2}")

logger.debug("Polkadot from: #{polkadot_ref1}")
logger.debug("Polkadot to: #{polkadot_ref2}")

Expand Down Expand Up @@ -76,7 +82,7 @@ else
logger.debug("Re-using:#{substrate_data}")
end

POLKADOT_COLLECTIVES_DIGEST = ENV['COLLECTIVES_POLKADOT_DIGEST'] || 'digests/polkadot-collectives-srtool-digest.json'
POLKADOT_COLLECTIVES_DIGEST = ENV['COLLECTIVES_POLKADOT_DIGEST'] || 'digests/collectives-polkadot-srtool-digest.json'
SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json'
WESTMINT_DIGEST = ENV['WESTMINT_DIGEST'] || 'digests/westmint-srtool-digest.json'
STATEMINE_DIGEST = ENV['STATEMINE_DIGEST'] || 'digests/statemine-srtool-digest.json'
Expand All @@ -90,7 +96,7 @@ CANVAS_KUSAMA_DIGEST = ENV['CANVAS_KUSAMA_DIGEST'] || 'digests/contracts-rococo-
logger.debug("Release type: #{ENV['RELEASE_TYPE']}")

if ENV['RELEASE_TYPE'] && ENV['RELEASE_TYPE'] == 'client'
logger.debug("Building changelog without runtimes")
logger.debug('Building changelog without runtimes')
cmd = format('jq \
--slurpfile cumulus %s \
--slurpfile substrate %s \
Expand All @@ -102,7 +108,7 @@ if ENV['RELEASE_TYPE'] && ENV['RELEASE_TYPE'] == 'client'
}\' > context.json', cumulus_data, substrate_data, polkadot_data,
)
else
logger.debug("Building changelog with runtimes")
logger.debug('Building changelog with runtimes')

# Here we compose all the pieces together into one
# single big json file.
Expand All @@ -119,6 +125,7 @@ else
--slurpfile srtool_polkadot_collectives %s \
--slurpfile srtool_bridge_hub_rococo %s \
--slurpfile srtool_bridge_hub_kusama %s \
--slurpfile srtool_bridge_hub_polkadot %s \
-n \'{
cumulus: $cumulus[0],
substrate: $substrate[0],
Expand Down
16 changes: 8 additions & 8 deletions scripts/ci/changelog/templates/change.md.tera
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{# This macro shows ONE change #}
{%- macro change(c, cml="[C]", dot="[P]", sub="[S]") -%}

{%- if c.meta.C and c.meta.C.value >= 5 -%}
{%- if c.meta.C and c.meta.C.agg.max >= 5 -%}
{%- set prio = " ‼️ HIGH" -%}
{%- elif c.meta.C and c.meta.C.value >= 3 -%}
{%- elif c.meta.C and c.meta.C.agg.max >= 3 -%}
{%- set prio = " ❗️ Medium" -%}
{%- elif c.meta.C and c.meta.C.value < 3 -%}
{%- elif c.meta.C and c.meta.C.agg.max < 3 -%}
{%- set prio = " Low" -%}
{%- else -%}
{%- set prio = "" -%}
{%- endif -%}

{%- set audit = "" -%}
{#
{%- if c.meta.D and c.meta.D.value == 1 -%}
{%- if c.meta.D and c.meta.D.D1 -%}
{%- set audit = "✅ audited " -%}
{%- elif c.meta.D and c.meta.D.value == 2 -%}
{%- elif c.meta.D and c.meta.D.D2 -%}
{%- set audit = "✅ trivial " -%}
{%- elif c.meta.D and c.meta.D.value == 3 -%}
{%- elif c.meta.D and c.meta.D.D3 -%}
{%- set audit = "✅ trivial " -%}
{%- elif c.meta.D and c.meta.D.value == 5 -%}
{%- elif c.meta.D and c.meta.D.D5 -%}
{%- set audit = "⏳ pending non-critical audit " -%}
{%- else -%}
{%- set audit = "" -%}
Expand All @@ -35,7 +35,7 @@
{%- set repo = " " -%}
{%- endif -%}
{# #}
{%- if c.meta.T and c.meta.T.value == 6 -%}
{%- if c.meta.T and c.meta.T.T6 -%}
{%- set xcm = " [✉️ XCM]" -%}
{%- else -%}
{%- set xcm = "" -%}
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/changelog/templates/changes.md.tera
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@

{% endif %}

{% include "changes_api.md.tera" %}

{% include "changes_misc.md.tera" %}
19 changes: 19 additions & 0 deletions scripts/ci/changelog/templates/changes_api.md.tera
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{%- import "change.md.tera" as m_c -%}

### API

{#- The changes are sorted by merge date -#}
{% for pr in changes | sort(attribute="merged_at") -%}

{%- if pr.meta.B -%}
{%- if pr.meta.B.B0 -%}
{#- We skip silent ones -#}
{%- else -%}

{%- if pr.meta.B.B1 and pr.meta.T.T2 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- endif -%}
{%- endif -%}

{%- endif -%}
{%- endfor %}
4 changes: 2 additions & 2 deletions scripts/ci/changelog/templates/changes_client.md.tera
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
{%- for pr in changes | sort(attribute="merged_at") %}

{%- if pr.meta.B %}
{%- if pr.meta.B.value == 0 %}
{%- if pr.meta.B.B0 %}
{#- We skip silent ones -#}
{%- else -%}

{%- if pr.meta.B.value == 5 and not pr.title is containing("ompanion") %}
{%- if pr.meta.B.B1 and pr.meta.T and pr.meta.T.T0 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- endif -%}
{% endif -%}
Expand Down
8 changes: 4 additions & 4 deletions scripts/ci/changelog/templates/changes_misc.md.tera
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{#- First pass to count #}
{%- for pr in changes -%}
{%- if pr.meta.B %}
{%- if pr.meta.B.value == 0 -%}
{%- if pr.meta.B.B0 -%}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.B and pr.meta.B.value != 5 or pr.meta.C or not pr.meta.B %}
{%- if pr.meta.T and pr.meta.T.agg.max > 2 %}
{%- set_global misc_count = misc_count + 1 -%}
{%- endif -%}
{% endif -%}
Expand All @@ -24,10 +24,10 @@ There are other misc. changes. You can expand the list below to view them all.
{#- The changes are sorted by merge date #}
{%- for pr in changes | sort(attribute="merged_at") %}
{%- if pr.meta.B and not pr.title is containing("ompanion") %}
{%- if pr.meta.B.value == 0 %}
{%- if pr.meta.B.B0 %}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.B and pr.meta.B.value != 5 or pr.meta.C or not pr.meta.B %}
{%- if pr.meta.T and pr.meta.T.agg.max > 2 %}
- {{ m_c::change(c=pr) }}
{%- endif -%}
{% endif -%}
Expand Down
6 changes: 3 additions & 3 deletions scripts/ci/changelog/templates/changes_runtime.md.tera
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{#- The changes are sorted by merge date -#}
{% for pr in changes | sort(attribute="merged_at") -%}

{%- if pr.meta.B and pr.meta.X -%}
{%- if pr.meta.B.value == 0 -%}
{%- if pr.meta.B -%}
{%- if pr.meta.B.B0 -%}
{#- We skip silent ones -#}
{%- else -%}

{%- if pr.meta.B.value == 1 and pr.meta.X.value == 1 and not pr.title is containing("ompanion") %}
{%- if pr.meta.B.B1 and pr.meta.T.T1 and not pr.title is containing("ompanion") %}
- {{ m_c::change(c=pr) }}
{%- endif -%}
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/changelog/templates/debug.md.tera
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set to_ignore = changes | filter(attribute="meta.B.value", value=0) %}
{%- set to_ignore = changes | filter(attribute="meta.B.B0") %}
<!--
## Debug

Expand Down
11 changes: 5 additions & 6 deletions scripts/ci/changelog/templates/high_priority.md.tera
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

{# We loop first to count the number of host functions but we do not display anything yet #}
{%- for pr in changes -%}
{%- if pr.meta.B and pr.meta.B.value == 0 -%}
{%- if pr.meta.B and pr.meta.B.B0 -%}
{#- We skip silent ones -#}
{%- else -%}
{%- if pr.meta.E and pr.meta.E.value == 4 -%}
{%- if pr.meta.E and pr.meta.E.E4 -%}
{%- set_global host_fn_count = host_fn_count + 1 -%}
{%- endif -%}
{%- endif -%}
Expand All @@ -31,8 +31,7 @@
{%- endif -%}

<!-- detected max prio is: {{p}} -->

{%- if prio -%}
{% if prio -%}
{{prio}}: {{text}}
{%- else -%}
<!-- No relevant Priority label as been detected -->
Expand All @@ -43,9 +42,9 @@
The changes motivating this priority level are:
{% for pr in changes | sort(attribute="merged_at") -%}
{%- if pr.meta.C -%}
{%- if pr.meta.C.value == p %}
{%- if pr.meta.C.agg.max >= p %}
- {{ m_c::change(c=pr) }}
{%- if pr.meta.B and pr.meta.X and pr.meta.B.value == 1 and pr.meta.X.value == 1 %}
{%- if pr.meta.B and pr.meta.B.B1 and pr.meta.T and pr.meta.T.T1 %}
(RUNTIME)
{% endif %}

Expand Down
Loading

0 comments on commit 8382f29

Please sign in to comment.