Merge branch 'gloas-containers' into gloas-envelope-processing

This commit is contained in:
Mark Mackey
2025-11-28 12:44:15 -06:00
7 changed files with 37 additions and 26 deletions

View File

@@ -107,8 +107,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
ForkName::Deneb => Self::Deneb(LightClientBootstrapDeneb::from_ssz_bytes(bytes)?),
ForkName::Electra => Self::Electra(LightClientBootstrapElectra::from_ssz_bytes(bytes)?),
ForkName::Fulu => Self::Fulu(LightClientBootstrapFulu::from_ssz_bytes(bytes)?),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(ssz::DecodeError::BytesInvalid(format!(
"LightClientBootstrap decoding for {fork_name} not implemented"
)));
@@ -129,7 +129,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
ForkName::Deneb => <LightClientBootstrapDeneb<E> as Encode>::ssz_fixed_len(),
ForkName::Electra => <LightClientBootstrapElectra<E> as Encode>::ssz_fixed_len(),
ForkName::Fulu => <LightClientBootstrapFulu<E> as Encode>::ssz_fixed_len(),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => <LightClientBootstrapAltair<E> as Encode>::ssz_fixed_len(),
};
fixed_len + LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
}
@@ -180,7 +181,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
.try_into()
.map_err(Error::SszTypesError)?,
}),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => return Err(Error::GloasNotImplemented),
};
Ok(light_client_bootstrap)
@@ -234,7 +236,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
.try_into()
.map_err(Error::SszTypesError)?,
}),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => return Err(Error::GloasNotImplemented),
};
Ok(light_client_bootstrap)

View File

@@ -160,7 +160,7 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
sync_aggregate,
signature_slot,
}),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Gloas => return Err(Error::GloasNotImplemented),
ForkName::Base => return Err(Error::AltairForkNotActive),
};
@@ -214,8 +214,8 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
Self::Electra(LightClientFinalityUpdateElectra::from_ssz_bytes(bytes)?)
}
ForkName::Fulu => Self::Fulu(LightClientFinalityUpdateFulu::from_ssz_bytes(bytes)?),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(ssz::DecodeError::BytesInvalid(format!(
"LightClientFinalityUpdate decoding for {fork_name} not implemented"
)));
@@ -236,7 +236,8 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
ForkName::Deneb => <LightClientFinalityUpdateDeneb<E> as Encode>::ssz_fixed_len(),
ForkName::Electra => <LightClientFinalityUpdateElectra<E> as Encode>::ssz_fixed_len(),
ForkName::Fulu => <LightClientFinalityUpdateFulu<E> as Encode>::ssz_fixed_len(),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => 0,
};
// `2 *` because there are two headers in the update
fixed_size + 2 * LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)

View File

@@ -104,7 +104,8 @@ impl<E: EthSpec> LightClientHeader<E> {
ForkName::Fulu => {
LightClientHeader::Fulu(LightClientHeaderFulu::block_to_light_client_header(block)?)
}
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => return Err(Error::GloasNotImplemented),
};
Ok(header)
}
@@ -126,8 +127,8 @@ impl<E: EthSpec> LightClientHeader<E> {
ForkName::Fulu => {
LightClientHeader::Fulu(LightClientHeaderFulu::from_ssz_bytes(bytes)?)
}
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(ssz::DecodeError::BytesInvalid(format!(
"LightClientHeader decoding for {fork_name} not implemented"
)));
@@ -357,7 +358,8 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientHeader<E>
))
};
Ok(match context {
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(serde::de::Error::custom(format!(
"LightClientFinalityUpdate failed to deserialize: unsupported fork '{}'",
context
@@ -378,7 +380,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientHeader<E>
ForkName::Fulu => {
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
}
ForkName::Gloas => todo!("Gloas light client not implemented"),
})
}
}

View File

@@ -119,7 +119,7 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
sync_aggregate,
signature_slot,
}),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Gloas => return Err(Error::GloasNotImplemented),
ForkName::Base => return Err(Error::AltairForkNotActive),
};
@@ -175,8 +175,8 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
Self::Electra(LightClientOptimisticUpdateElectra::from_ssz_bytes(bytes)?)
}
ForkName::Fulu => Self::Fulu(LightClientOptimisticUpdateFulu::from_ssz_bytes(bytes)?),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(ssz::DecodeError::BytesInvalid(format!(
"LightClientOptimisticUpdate decoding for {fork_name} not implemented"
)));
@@ -197,7 +197,8 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
ForkName::Deneb => <LightClientOptimisticUpdateDeneb<E> as Encode>::ssz_fixed_len(),
ForkName::Electra => <LightClientOptimisticUpdateElectra<E> as Encode>::ssz_fixed_len(),
ForkName::Fulu => <LightClientOptimisticUpdateFulu<E> as Encode>::ssz_fixed_len(),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => 0,
};
fixed_len + LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
}

View File

@@ -70,6 +70,8 @@ pub enum Error {
InvalidFinalizedBlock,
BeaconBlockBodyError,
InconsistentFork,
// TODO(gloas): implement Gloas light client
GloasNotImplemented,
}
impl From<ssz_types::Error> for Error {
@@ -195,7 +197,8 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
serde::de::Error::custom(format!("LightClientUpdate failed to deserialize: {:?}", e))
};
Ok(match context {
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(serde::de::Error::custom(format!(
"LightClientUpdate failed to deserialize: unsupported fork '{}'",
context
@@ -216,7 +219,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
ForkName::Fulu => {
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
}
ForkName::Gloas => todo!("Gloas light client not implemented"),
})
}
}
@@ -371,7 +373,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
// To add a new fork, just append the new fork variant on the latest fork. Forks that
// have a distinct execution header will need a new LightClientUpdate variant only
// if you need to test or support lightclient usages
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => return Err(Error::GloasNotImplemented),
};
Ok(light_client_update)
@@ -386,9 +389,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
ForkName::Deneb => Self::Deneb(LightClientUpdateDeneb::from_ssz_bytes(bytes)?),
ForkName::Electra => Self::Electra(LightClientUpdateElectra::from_ssz_bytes(bytes)?),
ForkName::Fulu => Self::Fulu(LightClientUpdateFulu::from_ssz_bytes(bytes)?),
ForkName::Gloas => todo!("Gloas light client not implemented"),
ForkName::Base => {
// TODO(gloas): implement Gloas light client
ForkName::Base | ForkName::Gloas => {
return Err(ssz::DecodeError::BytesInvalid(format!(
"LightClientUpdate decoding for {fork_name} not implemented"
)));
@@ -535,7 +537,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
ForkName::Deneb => <LightClientUpdateDeneb<E> as Encode>::ssz_fixed_len(),
ForkName::Electra => <LightClientUpdateElectra<E> as Encode>::ssz_fixed_len(),
ForkName::Fulu => <LightClientUpdateFulu<E> as Encode>::ssz_fixed_len(),
ForkName::Gloas => todo!("Gloas light client not implemented"),
// TODO(gloas): implement Gloas light client
ForkName::Gloas => 0,
};
fixed_len + 2 * LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
}