diff --git a/crates/relay/src/api/proposer/error.rs b/crates/relay/src/api/proposer/error.rs index 37533f34e..f775e7c79 100644 --- a/crates/relay/src/api/proposer/error.rs +++ b/crates/relay/src/api/proposer/error.rs @@ -41,6 +41,9 @@ pub enum ProposerApiError { #[error("proposer not registered")] ProposerNotRegistered, + #[error("unknown validators registration found")] + UnknownValidatorsRegistration, + #[error("timestamp too early. {timestamp} < {min_timestamp}")] TimestampTooEarly { timestamp: u64, min_timestamp: u64 }, @@ -134,6 +137,7 @@ impl IntoResponse for ProposerApiError { ProposerApiError::InvalidFork | ProposerApiError::SerdeDecodeError(_) | ProposerApiError::ProposerNotRegistered | + ProposerApiError::UnknownValidatorsRegistration | ProposerApiError::TimestampTooEarly { .. } | ProposerApiError::TimestampTooFarInTheFuture { .. } | ProposerApiError::RequestWrongSlot { .. } | diff --git a/crates/relay/src/api/proposer/register.rs b/crates/relay/src/api/proposer/register.rs index 4e1cedb5f..db4adc4ef 100644 --- a/crates/relay/src/api/proposer/register.rs +++ b/crates/relay/src/api/proposer/register.rs @@ -144,6 +144,10 @@ impl ProposerApi { REGISTRATIONS_UNKNOWN.inc_by(unknown_registrations); REGISTRATIONS_SKIPPED.inc_by(skipped_registrations); + if unknown_registrations > 0 { + return Err(ProposerApiError::UnknownValidatorsRegistration); + } + if registrations_to_check.is_empty() { return Ok(StatusCode::OK); }