Skip to content

Commit ee34de0

Browse files
authored
Merge pull request #2501 from subspace/require-force-authoring-for-genesis-farmer
Require force authoring for genesis farmer
2 parents 1f3336a + 8b58dc8 commit ee34de0

File tree

4 files changed

+60
-9
lines changed

4 files changed

+60
-9
lines changed

.github/workflows/rust.yml

+26-6
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,23 @@ jobs:
6666
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0
6767

6868
# On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
69+
# TODO: on macOS, the consensus/domain runtime build is not compatible with LLVM 15.0.7 and
70+
# LLVM 15.0.{3, 4, 5, 6} is not released for macOS thus install LLVM 15.0.2 explicitly as a
71+
# temporary workaround, and remove once incompatible is fixed.
6972
- name: Install LLVM and Clang for macOS
70-
uses: KyleMayes/install-llvm-action@be40c5af3a4adc3e4a03199995ab73aa37536712 # v1.9.0
73+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
7174
with:
72-
# TODO: Switch to LLVM 17 on arm64 runners once https://github.com/KyleMayes/install-llvm-action/issues/61 is resolved
73-
version: 15.0.7
75+
version: "15.0.2"
7476
if: runner.os == 'macOS'
7577

78+
# TODO: on Linux and Windows, the consensus/domain runtime build is not compatible with LLVM 16,
79+
# thus install LLVM 15 explicitly as a temporary workaround, and remove once incompatible is fixed.
80+
- name: Install LLVM and Clang for Linux and Windows
81+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
82+
with:
83+
version: "15.0"
84+
if: runner.os != 'macOS'
85+
7686
- name: Install Protoc
7787
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
7888
with:
@@ -142,13 +152,23 @@ jobs:
142152
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0
143153

144154
# On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
155+
# TODO: on macOS, the consensus/domain runtime build is not compatible with LLVM 15.0.7 and
156+
# LLVM 15.0.{3, 4, 5, 6} is not released for macOS thus install LLVM 15.0.2 explicitly as a
157+
# temporary workaround, and remove once incompatible is fixed.
145158
- name: Install LLVM and Clang for macOS
146-
uses: KyleMayes/install-llvm-action@be40c5af3a4adc3e4a03199995ab73aa37536712 # v1.9.0
159+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
147160
with:
148-
# TODO: Switch to LLVM 17 on arm64 runners once https://github.com/KyleMayes/install-llvm-action/issues/61 is resolved
149-
version: 15.0.7
161+
version: "15.0.2"
150162
if: runner.os == 'macOS'
151163

164+
# TODO: on Linux and Windows, the consensus/domain runtime build is not compatible with LLVM 16,
165+
# thus install LLVM 15 explicitly as a temporary workaround, and remove once incompatible is fixed.
166+
- name: Install LLVM and Clang for Linux and Windows
167+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
168+
with:
169+
version: "15.0"
170+
if: runner.os != 'macOS'
171+
152172
- name: Install Protoc
153173
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
154174
with:

.github/workflows/rustdoc.yml

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
- name: Checkout repository
2323
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0
2424

25+
# TODO: on Linux and Windows, LLVM 16 is not compatible with the consensus/domain runtime build
26+
# thus install LLVM 15 explicitly as a temporary workaround, and remove once it is fixed.
27+
- name: Install LLVM and Clang
28+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
29+
with:
30+
version: "15.0"
31+
2532
- name: Install Protoc
2633
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
2734
with:

.github/workflows/snapshot-build.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,23 @@ jobs:
135135
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0
136136

137137
# On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
138+
# TODO: on macOS, the consensus/domain runtime build is not compatible with LLVM 15.0.7 and
139+
# LLVM 15.0.{3, 4, 5, 6} is not released for macOS thus install LLVM 15.0.2 explicitly as a
140+
# temporary workaround, and remove once incompatible is fixed.
138141
- name: Install LLVM and Clang for macOS
139-
uses: KyleMayes/install-llvm-action@be40c5af3a4adc3e4a03199995ab73aa37536712 # v1.9.0
142+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
140143
with:
141-
# TODO: Switch to LLVM 17 on arm64 runners once https://github.com/KyleMayes/install-llvm-action/issues/61 is resolved
142-
version: 15.0.7
144+
version: "15.0.2"
143145
if: runner.os == 'macOS'
144146

147+
# TODO: on Linux and Windows, the consensus/domain runtime build is not compatible with LLVM 16,
148+
# thus install LLVM 15 explicitly as a temporary workaround, and remove once incompatible is fixed.
149+
- name: Install LLVM and Clang for Linux and Windows
150+
uses: KyleMayes/install-llvm-action@c135b3937686fd69c2651507aabc9925a8f9eee8 # v1.8.3
151+
with:
152+
version: "15.0"
153+
if: runner.os != 'macOS'
154+
145155
- name: Install Protoc
146156
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
147157
with:

crates/sc-consensus-subspace/src/slot_worker.rs

+14
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,20 @@ where
257257
return;
258258
}
259259

260+
let maybe_root_plot_public_key = self
261+
.client
262+
.runtime_api()
263+
.root_plot_public_key(self.client.info().best_hash)
264+
.ok()
265+
.flatten();
266+
if maybe_root_plot_public_key.is_some() && !self.force_authoring {
267+
debug!(
268+
"Skipping farming slot {slot} due to root public key present and force authoring \
269+
not enabled"
270+
);
271+
return;
272+
}
273+
260274
let proof_of_time = checkpoints.output();
261275
let global_randomness = proof_of_time.derive_global_randomness();
262276

0 commit comments

Comments
 (0)