Skip to content

Commit

Permalink
Merge branch 'master' into pkhry/silent-deprecation-attr
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhry authored Nov 4, 2024
2 parents eb8077c + 657b550 commit 74c7b9f
Show file tree
Hide file tree
Showing 67 changed files with 5,510 additions and 5,637 deletions.
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ workflows:
]
# The umbrella crate uses more features, so we to check those too:
check_umbrella:
- [ $check.0, '--features=serde,experimental,riscv,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
# Same as `check_*`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
Expand Down
26 changes: 13 additions & 13 deletions .github/scripts/cmd/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--flag1 --flag2"
},
{
Expand Down Expand Up @@ -67,7 +67,7 @@ def setUp(self):
self.patcher6 = patch('importlib.util.spec_from_file_location', return_value=MagicMock())
self.patcher7 = patch('importlib.util.module_from_spec', return_value=MagicMock())
self.patcher8 = patch('cmd.generate_prdoc.main', return_value=0)

self.mock_open = self.patcher1.start()
self.mock_json_load = self.patcher2.start()
self.mock_parse_args = self.patcher3.start()
Expand Down Expand Up @@ -101,27 +101,27 @@ def test_bench_command_normal_execution_all_runtimes(self):
clean=False,
image=None
), [])

self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for dev runtime
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
"pallet_staking\npallet_something\n", # Output for rococo runtime - no pallet here
"pallet_balances\npallet_staking\npallet_something\n", # Output for asset-hub-westend runtime
"./substrate/frame/balances/Cargo.toml\n", # Mock manifest path for dev -> pallet_balances
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
mock_exit.assert_not_called()

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),

call(get_mock_bench_output(
runtime='kitchensink',
pallets='pallet_balances',
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_bench_command_normal_execution(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -171,7 +171,7 @@ def test_bench_command_normal_execution(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_bench_command_normal_execution_xcm(self):
self.mock_popen.return_value.read.side_effect = [
"pallet_balances\npallet_staking\npallet_something\npallet_xcm_benchmarks::generic\n", # Output for westend runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand All @@ -214,7 +214,7 @@ def test_bench_command_normal_execution_xcm(self):
expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
runtime='westend',
Expand All @@ -241,7 +241,7 @@ def test_bench_command_two_runtimes_two_pallets(self):
"pallet_staking\npallet_balances\n", # Output for westend runtime
"pallet_staking\npallet_balances\n", # Output for rococo runtime
]

with patch('sys.exit') as mock_exit:
import cmd
cmd.main()
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_bench_command_one_dev_runtime(self):

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks"),
# Westend runtime calls
call(get_mock_bench_output(
runtime='kitchensink',
Expand Down Expand Up @@ -429,4 +429,4 @@ def test_prdoc_command(self, mock_system, mock_parse_args):
self.mock_generate_prdoc_main.assert_called_with(mock_parse_args.return_value[0])

if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"path": "substrate/frame",
"header": "substrate/HEADER-APACHE2",
"template": "substrate/.maintain/frame-weight-template.hbs",
"bench_features": "runtime-benchmarks,riscv",
"bench_features": "runtime-benchmarks",
"bench_flags": "--genesis-builder-policy=none --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage",
"uri": null,
"is_relay": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
--no-report --release
--workspace
--locked --no-fail-fast
--features try-runtime,ci-only-tests,experimental,riscv
--features try-runtime,ci-only-tests,experimental
--filter-expr "
!test(/.*benchmark.*/)
- test(/recovers_from_only_chunks_if_pov_large::case_1/)
Expand Down Expand Up @@ -120,4 +120,4 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: GHA-coverage
labels: GHA-coverage
4 changes: 2 additions & 2 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features try-runtime,experimental,riscv,ci-only-tests \
--features try-runtime,experimental,ci-only-tests \
--partition count:${{ matrix.partition }}
# run runtime-api tests with `enable-staging-api` feature on the 1st node
- name: runtime-api tests
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
--release \
--no-fail-fast \
--cargo-quiet \
--features experimental,riscv,ci-only-tests \
--features experimental,ci-only-tests \
--filter-expr " !test(/all_security_features_work/) - test(/nonexistent_cache_dir/)" \
--partition count:${{ matrix.partition }} \
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westmint"),
impl_name: create_runtime_str!("westmint"),
authoring_version: 1,
spec_version: 1_016_002,
spec_version: 1_016_004,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 16,
Expand Down Expand Up @@ -968,6 +968,7 @@ impl pallet_revive::Config for Runtime {
type Debug = ();
type Xcm = pallet_xcm::Pallet<Self>;
type ChainId = ConstU64<420_420_421>;
type NativeToEthRatio = ConstU32<1_000_000>; // 10^(18 - 12) Eth is 10^18, Native is 10^12.
}

impl TryFrom<RuntimeCall> for pallet_revive::Call<Runtime> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,5 @@ impl pallet_treasury::Config<FellowshipTreasuryInstance> for Runtime {
sp_core::ConstU8<1>,
ConstU32<1000>,
>;
type BlockNumberProvider = crate::System;
}
1 change: 1 addition & 0 deletions polkadot/node/collation-generation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sp-core = { workspace = true, default-features = true }
sp-maybe-compressed-blob = { workspace = true, default-features = true }
thiserror = { workspace = true }
codec = { features = ["bit-vec", "derive"], workspace = true }
schnellru = { workspace = true }

[dev-dependencies]
polkadot-node-subsystem-test-helpers = { workspace = true }
Expand Down
9 changes: 7 additions & 2 deletions polkadot/node/collation-generation/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use polkadot_primitives::vstaging::CandidateReceiptError;
use thiserror::Error;

#[derive(Debug, Error)]
Expand All @@ -30,8 +31,12 @@ pub enum Error {
UtilRuntime(#[from] polkadot_node_subsystem_util::runtime::Error),
#[error(transparent)]
Erasure(#[from] polkadot_erasure_coding::Error),
#[error("Parachain backing state not available in runtime.")]
MissingParaBackingState,
#[error("Collation submitted before initialization")]
SubmittedBeforeInit,
#[error("V2 core index check failed: {0}")]
CandidateReceiptCheck(CandidateReceiptError),
#[error("PoV size {0} exceeded maximum size of {1}")]
POVSizeExceeded(usize, usize),
}

pub type Result<T> = std::result::Result<T, Error>;
Loading

0 comments on commit 74c7b9f

Please sign in to comment.