MCPcopy Create free account
hub / github.com/base/base / validate_sequencer_key

Method validate_sequencer_key

crates/consensus/cli/src/node.rs:372–391  ·  view source on GitHub ↗

Validates the signing-key requirements for the configured sequencer mode.

(&self)

Source from the content-addressed store, hash-verified

370
371 /// Validates the signing-key requirements for the configured sequencer mode.
372 pub fn validate_sequencer_key(&self) -> eyre::Result<()> {
373 if self.config.node_mode.is_sequencer() {
374 let signer = &self.config.p2p_flags.signer;
375 let has_signing_key = signer.sequencer_key.is_some()
376 || signer.sequencer_key_path.is_some()
377 || signer.endpoint.is_some();
378 let operating_mode = self.operating_mode()?;
379 if operating_mode.is_isolated() && has_signing_key {
380 eyre::bail!("isolated sequencer must not configure a signing key");
381 }
382 if matches!(operating_mode, NodeOperatingMode::Sequencer) && !has_signing_key {
383 eyre::bail!(
384 "sequencer mode requires a signing key; \
385 provide --p2p.sequencer.key, --p2p.sequencer.key.path, \
386 or --p2p.signer.endpoint"
387 );
388 }
389 }
390 Ok(())
391 }
392
393 fn operating_mode(&self) -> eyre::Result<NodeOperatingMode> {
394 let flags = &self.config.sequencer_flags;

Calls 4

is_sequencerMethod · 0.80
is_someMethod · 0.80
operating_modeMethod · 0.80
is_isolatedMethod · 0.80

Tested by

no test coverage detected