Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/relay/src/api/proposer/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },

Expand Down Expand Up @@ -134,6 +137,7 @@ impl IntoResponse for ProposerApiError {
ProposerApiError::InvalidFork |
ProposerApiError::SerdeDecodeError(_) |
ProposerApiError::ProposerNotRegistered |
ProposerApiError::UnknownValidatorsRegistration |
ProposerApiError::TimestampTooEarly { .. } |
ProposerApiError::TimestampTooFarInTheFuture { .. } |
ProposerApiError::RequestWrongSlot { .. } |
Expand Down
4 changes: 4 additions & 0 deletions crates/relay/src/api/proposer/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ impl<A: Api> ProposerApi<A> {
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);
}
Expand Down