Skip to content

Commit 80f77d8

Browse files
committed
Merge branch 'gloas-containers' into gloas-envelope-processing
2 parents 77e1c67 + fd50ba6 commit 80f77d8

File tree

7 files changed

+37
-26
lines changed

7 files changed

+37
-26
lines changed

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5809,7 +5809,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
58095809
execution_payload_value,
58105810
)
58115811
}
5812-
BeaconState::Gloas(_) => todo!("Gloas block production"),
5812+
BeaconState::Gloas(_) => return Err(BlockProductionError::GloasNotImplemented),
58135813
};
58145814

58155815
let block = SignedBeaconBlock::from_block(

beacon_node/beacon_chain/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ pub enum BlockProductionError {
320320
FailedToBuildBlobSidecars(String),
321321
MissingExecutionRequests,
322322
SszTypesError(ssz_types::Error),
323+
// TODO(gloas): Remove this once Gloas is implemented
324+
GloasNotImplemented,
323325
}
324326

325327
easy_from_to!(BlockProcessingError, BlockProductionError);

consensus/types/src/light_client_bootstrap.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
107107
ForkName::Deneb => Self::Deneb(LightClientBootstrapDeneb::from_ssz_bytes(bytes)?),
108108
ForkName::Electra => Self::Electra(LightClientBootstrapElectra::from_ssz_bytes(bytes)?),
109109
ForkName::Fulu => Self::Fulu(LightClientBootstrapFulu::from_ssz_bytes(bytes)?),
110-
ForkName::Gloas => todo!("Gloas light client not implemented"),
111-
ForkName::Base => {
110+
// TODO(gloas): implement Gloas light client
111+
ForkName::Base | ForkName::Gloas => {
112112
return Err(ssz::DecodeError::BytesInvalid(format!(
113113
"LightClientBootstrap decoding for {fork_name} not implemented"
114114
)));
@@ -129,7 +129,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
129129
ForkName::Deneb => <LightClientBootstrapDeneb<E> as Encode>::ssz_fixed_len(),
130130
ForkName::Electra => <LightClientBootstrapElectra<E> as Encode>::ssz_fixed_len(),
131131
ForkName::Fulu => <LightClientBootstrapFulu<E> as Encode>::ssz_fixed_len(),
132-
ForkName::Gloas => todo!("Gloas light client not implemented"),
132+
// TODO(gloas): implement Gloas light client
133+
ForkName::Gloas => <LightClientBootstrapAltair<E> as Encode>::ssz_fixed_len(),
133134
};
134135
fixed_len + LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
135136
}
@@ -180,7 +181,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
180181
.try_into()
181182
.map_err(Error::SszTypesError)?,
182183
}),
183-
ForkName::Gloas => todo!("Gloas light client not implemented"),
184+
// TODO(gloas): implement Gloas light client
185+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
184186
};
185187

186188
Ok(light_client_bootstrap)
@@ -234,7 +236,8 @@ impl<E: EthSpec> LightClientBootstrap<E> {
234236
.try_into()
235237
.map_err(Error::SszTypesError)?,
236238
}),
237-
ForkName::Gloas => todo!("Gloas light client not implemented"),
239+
// TODO(gloas): implement Gloas light client
240+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
238241
};
239242

240243
Ok(light_client_bootstrap)

consensus/types/src/light_client_finality_update.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
160160
sync_aggregate,
161161
signature_slot,
162162
}),
163-
ForkName::Gloas => todo!("Gloas light client not implemented"),
163+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
164164
ForkName::Base => return Err(Error::AltairForkNotActive),
165165
};
166166

@@ -214,8 +214,8 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
214214
Self::Electra(LightClientFinalityUpdateElectra::from_ssz_bytes(bytes)?)
215215
}
216216
ForkName::Fulu => Self::Fulu(LightClientFinalityUpdateFulu::from_ssz_bytes(bytes)?),
217-
ForkName::Gloas => todo!("Gloas light client not implemented"),
218-
ForkName::Base => {
217+
// TODO(gloas): implement Gloas light client
218+
ForkName::Base | ForkName::Gloas => {
219219
return Err(ssz::DecodeError::BytesInvalid(format!(
220220
"LightClientFinalityUpdate decoding for {fork_name} not implemented"
221221
)));
@@ -236,7 +236,8 @@ impl<E: EthSpec> LightClientFinalityUpdate<E> {
236236
ForkName::Deneb => <LightClientFinalityUpdateDeneb<E> as Encode>::ssz_fixed_len(),
237237
ForkName::Electra => <LightClientFinalityUpdateElectra<E> as Encode>::ssz_fixed_len(),
238238
ForkName::Fulu => <LightClientFinalityUpdateFulu<E> as Encode>::ssz_fixed_len(),
239-
ForkName::Gloas => todo!("Gloas light client not implemented"),
239+
// TODO(gloas): implement Gloas light client
240+
ForkName::Gloas => 0,
240241
};
241242
// `2 *` because there are two headers in the update
242243
fixed_size + 2 * LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)

consensus/types/src/light_client_header.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ impl<E: EthSpec> LightClientHeader<E> {
104104
ForkName::Fulu => {
105105
LightClientHeader::Fulu(LightClientHeaderFulu::block_to_light_client_header(block)?)
106106
}
107-
ForkName::Gloas => todo!("Gloas light client not implemented"),
107+
// TODO(gloas): implement Gloas light client
108+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
108109
};
109110
Ok(header)
110111
}
@@ -126,8 +127,8 @@ impl<E: EthSpec> LightClientHeader<E> {
126127
ForkName::Fulu => {
127128
LightClientHeader::Fulu(LightClientHeaderFulu::from_ssz_bytes(bytes)?)
128129
}
129-
ForkName::Gloas => todo!("Gloas light client not implemented"),
130-
ForkName::Base => {
130+
// TODO(gloas): implement Gloas light client
131+
ForkName::Base | ForkName::Gloas => {
131132
return Err(ssz::DecodeError::BytesInvalid(format!(
132133
"LightClientHeader decoding for {fork_name} not implemented"
133134
)));
@@ -357,7 +358,8 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientHeader<E>
357358
))
358359
};
359360
Ok(match context {
360-
ForkName::Base => {
361+
// TODO(gloas): implement Gloas light client
362+
ForkName::Base | ForkName::Gloas => {
361363
return Err(serde::de::Error::custom(format!(
362364
"LightClientFinalityUpdate failed to deserialize: unsupported fork '{}'",
363365
context
@@ -378,7 +380,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientHeader<E>
378380
ForkName::Fulu => {
379381
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
380382
}
381-
ForkName::Gloas => todo!("Gloas light client not implemented"),
382383
})
383384
}
384385
}

consensus/types/src/light_client_optimistic_update.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
119119
sync_aggregate,
120120
signature_slot,
121121
}),
122-
ForkName::Gloas => todo!("Gloas light client not implemented"),
122+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
123123
ForkName::Base => return Err(Error::AltairForkNotActive),
124124
};
125125

@@ -175,8 +175,8 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
175175
Self::Electra(LightClientOptimisticUpdateElectra::from_ssz_bytes(bytes)?)
176176
}
177177
ForkName::Fulu => Self::Fulu(LightClientOptimisticUpdateFulu::from_ssz_bytes(bytes)?),
178-
ForkName::Gloas => todo!("Gloas light client not implemented"),
179-
ForkName::Base => {
178+
// TODO(gloas): implement Gloas light client
179+
ForkName::Base | ForkName::Gloas => {
180180
return Err(ssz::DecodeError::BytesInvalid(format!(
181181
"LightClientOptimisticUpdate decoding for {fork_name} not implemented"
182182
)));
@@ -197,7 +197,8 @@ impl<E: EthSpec> LightClientOptimisticUpdate<E> {
197197
ForkName::Deneb => <LightClientOptimisticUpdateDeneb<E> as Encode>::ssz_fixed_len(),
198198
ForkName::Electra => <LightClientOptimisticUpdateElectra<E> as Encode>::ssz_fixed_len(),
199199
ForkName::Fulu => <LightClientOptimisticUpdateFulu<E> as Encode>::ssz_fixed_len(),
200-
ForkName::Gloas => todo!("Gloas light client not implemented"),
200+
// TODO(gloas): implement Gloas light client
201+
ForkName::Gloas => 0,
201202
};
202203
fixed_len + LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
203204
}

consensus/types/src/light_client_update.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ pub enum Error {
7070
InvalidFinalizedBlock,
7171
BeaconBlockBodyError,
7272
InconsistentFork,
73+
// TODO(gloas): implement Gloas light client
74+
GloasNotImplemented,
7375
}
7476

7577
impl From<ssz_types::Error> for Error {
@@ -195,7 +197,8 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
195197
serde::de::Error::custom(format!("LightClientUpdate failed to deserialize: {:?}", e))
196198
};
197199
Ok(match context {
198-
ForkName::Base => {
200+
// TODO(gloas): implement Gloas light client
201+
ForkName::Base | ForkName::Gloas => {
199202
return Err(serde::de::Error::custom(format!(
200203
"LightClientUpdate failed to deserialize: unsupported fork '{}'",
201204
context
@@ -216,7 +219,6 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for LightClientUpdate<E>
216219
ForkName::Fulu => {
217220
Self::Fulu(Deserialize::deserialize(deserializer).map_err(convert_err)?)
218221
}
219-
ForkName::Gloas => todo!("Gloas light client not implemented"),
220222
})
221223
}
222224
}
@@ -371,7 +373,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
371373
// To add a new fork, just append the new fork variant on the latest fork. Forks that
372374
// have a distinct execution header will need a new LightClientUpdate variant only
373375
// if you need to test or support lightclient usages
374-
ForkName::Gloas => todo!("Gloas light client not implemented"),
376+
// TODO(gloas): implement Gloas light client
377+
ForkName::Gloas => return Err(Error::GloasNotImplemented),
375378
};
376379

377380
Ok(light_client_update)
@@ -386,9 +389,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
386389
ForkName::Deneb => Self::Deneb(LightClientUpdateDeneb::from_ssz_bytes(bytes)?),
387390
ForkName::Electra => Self::Electra(LightClientUpdateElectra::from_ssz_bytes(bytes)?),
388391
ForkName::Fulu => Self::Fulu(LightClientUpdateFulu::from_ssz_bytes(bytes)?),
389-
ForkName::Gloas => todo!("Gloas light client not implemented"),
390-
391-
ForkName::Base => {
392+
// TODO(gloas): implement Gloas light client
393+
ForkName::Base | ForkName::Gloas => {
392394
return Err(ssz::DecodeError::BytesInvalid(format!(
393395
"LightClientUpdate decoding for {fork_name} not implemented"
394396
)));
@@ -535,7 +537,8 @@ impl<E: EthSpec> LightClientUpdate<E> {
535537
ForkName::Deneb => <LightClientUpdateDeneb<E> as Encode>::ssz_fixed_len(),
536538
ForkName::Electra => <LightClientUpdateElectra<E> as Encode>::ssz_fixed_len(),
537539
ForkName::Fulu => <LightClientUpdateFulu<E> as Encode>::ssz_fixed_len(),
538-
ForkName::Gloas => todo!("Gloas light client not implemented"),
540+
// TODO(gloas): implement Gloas light client
541+
ForkName::Gloas => 0,
539542
};
540543
fixed_len + 2 * LightClientHeader::<E>::ssz_max_var_len_for_fork(fork_name)
541544
}

0 commit comments

Comments
 (0)