Skip to content

Commit

Permalink
Relax validator checks in Executor
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 27, 2023
1 parent ae14d09 commit 783bc30
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions node/actors/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,27 @@ impl<S: WriteBlockStore + 'static> Executor<S> {
*public == key.public(),
"config.consensus.key = {public:?} doesn't match the secret key {key:?}"
);
anyhow::ensure!(
self.executor_config
.validators
.iter()
.any(|validator_key| validator_key == public),
"Key {public:?} is not a validator per validator set {:?}",
self.executor_config.validators
);
self.validator = Some(ValidatorExecutor {
config,
key,
replica_state_store,
blocks_sender,
});

// TODO: this logic must be refactored once dynamic validator sets are implemented
let is_validator = self
.executor_config
.validators
.iter()
.any(|validator_key| validator_key == public);
if is_validator {
self.validator = Some(ValidatorExecutor {
config,
key,
replica_state_store,
blocks_sender,
});
} else {
tracing::info!(
"Key {public:?} is not a validator per validator set {:?}; the executor will not \
run consensus",
self.executor_config.validators
);
}
Ok(())
}

Expand Down

0 comments on commit 783bc30

Please sign in to comment.