Skip to content

Commit 1d7396d

Browse files
authored
Merge branch 'master' into OPF
2 parents 1b4a10e + 38d2fa8 commit 1d7396d

File tree

22 files changed

+146
-88
lines changed

22 files changed

+146
-88
lines changed

.github/workflows/checks-quick.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV
203203
204204
- name: Install Rust
205-
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
205+
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
206206
with:
207207
cache: false
208208
toolchain: ${{ env.RUST_VERSION }}

.github/workflows/misc-sync-templates.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ jobs:
259259
timeout-minutes: 90
260260
- name: Create PR on failure
261261
if: failure() && steps.check-compilation.outcome == 'failure'
262-
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v5
262+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v5
263263
with:
264264
path: "${{ env.template-path }}"
265265
token: ${{ steps.app_token.outputs.token }}
@@ -269,7 +269,7 @@ jobs:
269269
body: "The template has NOT been successfully built and needs to be inspected."
270270
branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
271271
- name: Create PR on success
272-
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v5
272+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v5
273273
with:
274274
path: "${{ env.template-path }}"
275275
token: ${{ steps.app_token.outputs.token }}

.github/workflows/release-50_publish-docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ jobs:
278278
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
279279

280280
- name: Set up Docker Buildx
281-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
281+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
282282

283283
- name: Cache Docker layers
284284
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2

.github/workflows/release-reusable-rc-buid.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }}
105105
106106
- name: Generate artifact attestation
107-
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
107+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
108108
with:
109109
subject-path: /artifacts/${{ matrix.binaries }}/${{ matrix.binaries }}
110110

@@ -173,7 +173,7 @@ jobs:
173173
run: echo "/opt/homebrew/bin" >> $GITHUB_PATH
174174

175175
- name: Install rust ${{ env.RUST_VERSION }}
176-
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
176+
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
177177
with:
178178
cache: false
179179
toolchain: ${{ env.RUST_VERSION }}
@@ -219,7 +219,7 @@ jobs:
219219
./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }}
220220
221221
- name: Generate artifact attestation
222-
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
222+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
223223
with:
224224
subject-path: ${{ env.ARTIFACTS_PATH }}/${{ matrix.binaries }}
225225

@@ -292,7 +292,7 @@ jobs:
292292
. "${GITHUB_WORKSPACE}"/.github/scripts/release/build-deb.sh ${{ inputs.package }} ${VERSION}
293293
294294
- name: Generate artifact attestation
295-
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
295+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
296296
with:
297297
subject-path: target/production/*.deb
298298

.github/workflows/release-srtool.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
8888
8989
- name: Generate artifact attestation
90-
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
90+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
9191
with:
9292
subject-path: ${{ steps.srtool_build.outputs.wasm }}
9393

.github/workflows/reusable-preflight.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ jobs:
7878
preflight:
7979
runs-on: ubuntu-latest
8080
outputs:
81-
changes_rust: ${{ steps.set_changes.outputs.rust_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
82-
changes_currentWorkflow: ${{ steps.set_changes.outputs.currentWorkflow_any_changed }}
81+
changes_rust: true
82+
changes_currentWorkflow: true
8383

8484
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
8585

@@ -112,19 +112,20 @@ jobs:
112112
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
113113
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
114114
115-
- name: Set changes
116-
id: set_changes
117-
uses: tj-actions/changed-files@v45
118-
with:
119-
files_yaml: |
120-
rust:
121-
- '**/*'
122-
- '!.github/**/*'
123-
- '!prdoc/**/*'
124-
- '!docs/**/*'
125-
currentWorkflow:
126-
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
127-
- '.github/workflows/reusable-preflight.yml'
115+
# removed due to https://news.ycombinator.com/item?id=43368870
116+
#- name: Set changes
117+
# id: set_changes
118+
# uses: tj-actions/changed-files@v45
119+
# with:
120+
# files_yaml: |
121+
# rust:
122+
# - '**/*'
123+
# - '!.github/**/*'
124+
# - '!prdoc/**/*'
125+
# - '!docs/**/*'
126+
# currentWorkflow:
127+
# - '${{ steps.current_file.outputs.currentWorkflowFile }}'
128+
# - '.github/workflows/reusable-preflight.yml'
128129

129130
#
130131
# Set image
@@ -180,7 +181,6 @@ jobs:
180181
shell: bash
181182
run: |
182183
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
183-
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
184184
185185
#
186186
#

.github/workflows/tests-misc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ jobs:
359359
- name: Set up Homebrew
360360
uses: Homebrew/actions/setup-homebrew@1ccc07ccd54b6048295516a3eb89b192c35057dc # master from 12.09.2024
361361
- name: Install rust ${{ env.RUST_VERSION }}
362-
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
362+
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
363363
with:
364364
cache: false
365365
toolchain: ${{ env.RUST_VERSION }}

.github/workflows/zombienet-reusable-preflight.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ jobs:
102102
preflight:
103103
runs-on: ubuntu-latest
104104
outputs:
105-
changes_substrate: ${{ steps.set_changes.outputs.substrate_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
106-
changes_cumulus: ${{ steps.set_changes.outputs.cumulus_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
107-
changes_polkadot: ${{ steps.set_changes.outputs.polkadot_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
108-
changes_bridges: ${{ steps.set_changes.outputs.bridges_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
109-
changes_templates: ${{ steps.set_changes.outputs.templates_any_changed || steps.set_changes.outputs.currentWorkflow_any_changed }}
105+
changes_substrate: true
106+
changes_cumulus: true
107+
changes_polkadot: true
108+
changes_bridges: true
109+
changes_templates: true
110110

111111
ZOMBIENET_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_IMAGE }}
112112
ZOMBIENET_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_RUNNER }}
@@ -139,25 +139,26 @@ jobs:
139139
echo "currentWorkflowFile=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT
140140
echo "currentActionDir=$(echo ${{ github.action_path }} | sed -nE "s/.*(\.github\/actions\/[a-zA-Z0-9_-]*)/\1/p")" >> $GITHUB_OUTPUT
141141
142-
- name: Set changes
143-
id: set_changes
144-
uses: tj-actions/changed-files@v45
145-
with:
146-
files_yaml: |
147-
substrate:
148-
- 'substrate/**/*'
149-
cumulus:
150-
- 'cumulus/**/*'
151-
polkadot:
152-
- 'polkadot/**/*'
153-
bridges:
154-
- 'bridges/**/*'
155-
templates:
156-
- 'templates/**/*'
157-
currentWorkflow:
158-
- '${{ steps.current_file.outputs.currentWorkflowFile }}'
159-
- '.github/workflows/zombienet-reusable-preflight.yml'
160-
- '.github/zombienet-env'
142+
# removed due to https://news.ycombinator.com/item?id=43368870
143+
#- name: Set changes
144+
# id: set_changes
145+
# uses: tj-actions/changed-files@v45
146+
# with:
147+
# files_yaml: |
148+
# substrate:
149+
# - 'substrate/**/*'
150+
# cumulus:
151+
# - 'cumulus/**/*'
152+
# polkadot:
153+
# - 'polkadot/**/*'
154+
# bridges:
155+
# - 'bridges/**/*'
156+
# templates:
157+
# - 'templates/**/*'
158+
# currentWorkflow:
159+
# - '${{ steps.current_file.outputs.currentWorkflowFile }}'
160+
# - '.github/workflows/zombienet-reusable-preflight.yml'
161+
# - '.github/zombienet-env'
161162

162163
#
163164
# Set environment vars (including runner/image)
@@ -187,7 +188,6 @@ jobs:
187188
shell: bash
188189
run: |
189190
echo "workflow file: ${{ steps.current_file.outputs.currentWorkflowFile }}"
190-
echo "Modified: ${{ steps.set_changes.outputs.modified_keys }}"
191191
echo "ZOMBIENET_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_IMAGE }}"
192192
193193
#

cumulus/bin/pov-validator/src/main.rs

+8-15
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use clap::Parser;
2020
use codec::{Decode, Encode};
2121
use polkadot_node_primitives::{BlockData, PoV, POV_BOMB_LIMIT};
2222
use polkadot_parachain_primitives::primitives::ValidationParams;
23-
use polkadot_primitives::{BlockNumber as RBlockNumber, Hash as RHash, HeadData};
23+
use polkadot_primitives::PersistedValidationData;
2424
use sc_executor::WasmExecutor;
2525
use sp_core::traits::{CallContext, CodeExecutor, RuntimeCode, WrappedRuntimeCode};
2626
use std::{fs, path::PathBuf, time::Instant};
@@ -104,17 +104,10 @@ fn main() -> anyhow::Result<()> {
104104
tracing::error!(%error, "Failed to decode `PoV`");
105105
anyhow::anyhow!("Failed to decode `PoV`")
106106
})?;
107-
let head_data = HeadData::decode(pov_file_ptr).map_err(|error| {
108-
tracing::error!(%error, "Failed to `HeadData`");
109-
anyhow::anyhow!("Failed to decode `HeadData`")
110-
})?;
111-
let relay_parent_storage_root = RHash::decode(pov_file_ptr).map_err(|error| {
112-
tracing::error!(%error, "Failed to relay storage root");
113-
anyhow::anyhow!("Failed to decode relay storage root")
114-
})?;
115-
let relay_parent_number = RBlockNumber::decode(pov_file_ptr).map_err(|error| {
116-
tracing::error!(%error, "Failed to relay block number");
117-
anyhow::anyhow!("Failed to decode relay block number")
107+
108+
let pvd = PersistedValidationData::decode(pov_file_ptr).map_err(|error| {
109+
tracing::error!(%error, "Failed to `PersistedValidationData`");
110+
anyhow::anyhow!("Failed to decode `PersistedValidationData`")
118111
})?;
119112

120113
let pov = sp_maybe_compressed_blob::decompress(&pov.block_data.0, POV_BOMB_LIMIT).map_err(
@@ -125,9 +118,9 @@ fn main() -> anyhow::Result<()> {
125118
)?;
126119

127120
let validation_params = ValidationParams {
128-
relay_parent_number,
129-
relay_parent_storage_root,
130-
parent_head: head_data,
121+
relay_parent_number: pvd.relay_parent_number,
122+
relay_parent_storage_root: pvd.relay_parent_storage_root,
123+
parent_head: pvd.parent_head,
131124
block_data: BlockData(pov.into()),
132125
};
133126

cumulus/client/consensus/aura/src/collators/lookahead.rs

+1
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ where
409409
parent_header.clone(),
410410
*relay_parent_header.state_root(),
411411
*relay_parent_header.number(),
412+
validation_data.max_pov_size,
412413
);
413414
}
414415

cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs

+1
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ where
375375
parachain_candidate: candidate,
376376
validation_code_hash,
377377
core_index: *core_index,
378+
max_pov_size: validation_data.max_pov_size,
378379
}) {
379380
tracing::error!(target: crate::LOG_TARGET, ?err, "Unable to send block to collation task.");
380381
return

cumulus/client/consensus/aura/src/collators/slot_based/collation_task.rs

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ async fn handle_collation_message<Block: BlockT, RClient: RelayChainInterface +
126126
validation_code_hash,
127127
relay_parent,
128128
core_index,
129+
max_pov_size,
129130
} = message;
130131

131132
let hash = parachain_candidate.block.header().hash();
@@ -160,6 +161,7 @@ async fn handle_collation_message<Block: BlockT, RClient: RelayChainInterface +
160161
parent_header.clone(),
161162
relay_parent_header.state_root,
162163
relay_parent_header.number,
164+
max_pov_size,
163165
);
164166
} else {
165167
tracing::error!(target: LOG_TARGET, "Failed to get relay parent header from hash: {relay_parent:?}");

cumulus/client/consensus/aura/src/collators/slot_based/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ struct CollatorMessage<Block: BlockT> {
255255
pub validation_code_hash: ValidationCodeHash,
256256
/// Core index that this block should be submitted on
257257
pub core_index: CoreIndex,
258+
/// Maximum pov size. Currently needed only for exporting PoV.
259+
pub max_pov_size: u32,
258260
}
259261

260262
/// Fetch the `CoreSelector` and `ClaimQueueOffset` for `parent_hash`.

cumulus/client/consensus/aura/src/lib.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ pub(crate) fn export_pov_to_path<Block: BlockT>(
273273
parent_header: Block::Header,
274274
relay_parent_storage_root: RHash,
275275
relay_parent_number: RBlockNumber,
276+
max_pov_size: u32,
276277
) {
277278
if let Err(error) = fs::create_dir_all(&path) {
278279
tracing::error!(target: LOG_TARGET, %error, path = %path.display(), "Failed to create PoV export directory");
@@ -288,7 +289,11 @@ pub(crate) fn export_pov_to_path<Block: BlockT>(
288289
};
289290

290291
pov.encode_to(&mut file);
291-
HeadData(parent_header.encode()).encode_to(&mut file);
292-
relay_parent_storage_root.encode_to(&mut file);
293-
relay_parent_number.encode_to(&mut file);
292+
PersistedValidationData {
293+
parent_head: HeadData(parent_header.encode()),
294+
relay_parent_number,
295+
relay_parent_storage_root,
296+
max_pov_size,
297+
}
298+
.encode_to(&mut file);
294299
}

prdoc/pr_7918.prdoc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
2+
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
3+
4+
title: "Add an extra_constant to pallet-treasury"
5+
6+
doc:
7+
- audience: Runtime Dev
8+
description: |
9+
- Allows to query pallet-treasury's pot account via extra constant.
10+
11+
crates:
12+
- name: pallet-treasury
13+
bump: minor

prdoc/pr_7924.prdoc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: 'sp-api: Support `mut` in `impl_runtime_apis!`'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
This brings support for declaring variables in parameters as `mut` inside of `impl_runtime_apis!`.
6+
crates:
7+
- name: sp-api-proc-macro
8+
bump: patch

prdoc/pr_7928.prdoc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: Fix pallet-revive-fixtures build.rs
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
Fix pallet-revive-uapi resolution when building pallet-revive-fixtures
6+
contracts
7+
crates:
8+
- name: pallet-revive-fixtures
9+
bump: patch

substrate/frame/revive/fixtures/build.rs

+20-9
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,30 @@ fn create_cargo_toml<'a>(
8585
let mut cargo_toml: toml::Value = toml::from_str(include_str!("./build/_Cargo.toml"))?;
8686
let uapi_dep = cargo_toml["dependencies"]["uapi"].as_table_mut().unwrap();
8787

88-
let metadata = MetadataCommand::new()
89-
.manifest_path(fixtures_dir.join("Cargo.toml"))
90-
.exec()
91-
.expect("Failed to fetch cargo metadata");
88+
let manifest_path = fixtures_dir.join("Cargo.toml");
89+
let metadata = MetadataCommand::new().manifest_path(&manifest_path).exec().unwrap();
90+
let dependency_graph = metadata.resolve.unwrap();
9291

93-
let mut uapi_pkgs: Vec<_> = metadata
92+
// Resolve the pallet-revive-fixtures package id
93+
let fixtures_pkg_id = metadata
9494
.packages
9595
.iter()
96-
.filter(|pkg| pkg.name == "pallet-revive-uapi")
97-
.collect();
96+
.find(|pkg| pkg.manifest_path.as_std_path() == manifest_path)
97+
.map(|pkg| pkg.id.clone())
98+
.unwrap();
99+
let fixtures_pkg_node =
100+
dependency_graph.nodes.iter().find(|node| node.id == fixtures_pkg_id).unwrap();
101+
102+
// Get the pallet-revive-uapi package id
103+
let uapi_pkg_id = fixtures_pkg_node
104+
.deps
105+
.iter()
106+
.find(|dep| dep.name == "pallet_revive_uapi")
107+
.map(|dep| dep.pkg.clone())
108+
.expect("pallet-revive-uapi is a build dependency of pallet-revive-fixtures; qed");
98109

99-
uapi_pkgs.sort_by(|a, b| b.version.cmp(&a.version));
100-
let uapi_pkg = uapi_pkgs.first().unwrap();
110+
// Get pallet-revive-uapi package
111+
let uapi_pkg = metadata.packages.iter().find(|pkg| pkg.id == uapi_pkg_id).unwrap();
101112

102113
if uapi_pkg.source.is_none() {
103114
uapi_dep.insert(

0 commit comments

Comments
 (0)