Bump ssz_types to v0.12.2 (#8032)

https://github.com/sigp/lighthouse/issues/8012


  Replace all instances of `VariableList::from` and `FixedVector::from` to their `try_from` variants.

While I tried to use proper error handling in most cases, there were certain situations where adding an `expect` for situations where `try_from` can trivially never fail avoided adding a lot of extra complexity.


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Mac L
2025-10-28 08:01:09 +04:00
committed by GitHub
parent 5840004c36
commit f5809aff87
39 changed files with 758 additions and 465 deletions

View File

@@ -707,7 +707,7 @@ async fn invalid_signature_attester_slashing() {
let attester_slashing = if fork_name.electra_enabled() {
let indexed_attestation = IndexedAttestationElectra {
attesting_indices: vec![0].into(),
attesting_indices: vec![0].try_into().unwrap(),
data: AttestationData {
slot: Slot::new(0),
index: 0,
@@ -731,7 +731,7 @@ async fn invalid_signature_attester_slashing() {
AttesterSlashing::Electra(attester_slashing)
} else {
let indexed_attestation = IndexedAttestationBase {
attesting_indices: vec![0].into(),
attesting_indices: vec![0].try_into().unwrap(),
data: AttestationData {
slot: Slot::new(0),
index: 0,
@@ -898,7 +898,9 @@ async fn invalid_signature_deposit() {
let harness = get_invalid_sigs_harness(&chain_segment).await;
let mut snapshots = chain_segment.clone();
let deposit = Deposit {
proof: vec![Hash256::zero(); DEPOSIT_TREE_DEPTH + 1].into(),
proof: vec![Hash256::zero(); DEPOSIT_TREE_DEPTH + 1]
.try_into()
.unwrap(),
data: DepositData {
pubkey: Keypair::random().pk.into(),
withdrawal_credentials: Hash256::zero(),
@@ -1270,7 +1272,9 @@ async fn block_gossip_verification() {
as usize;
if let Ok(kzg_commitments) = block.body_mut().blob_kzg_commitments_mut() {
*kzg_commitments = vec![KzgCommitment::empty_for_testing(); kzg_commitments_len + 1].into();
*kzg_commitments = vec![KzgCommitment::empty_for_testing(); kzg_commitments_len + 1]
.try_into()
.unwrap();
assert!(
matches!(
unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature))).await),

View File

@@ -1415,7 +1415,7 @@ async fn proposer_shuffling_changing_with_lookahead() {
let execution_requests = ExecutionRequests::<E> {
deposits: VariableList::new(vec![deposit_request]).unwrap(),
withdrawals: vec![].into(),
withdrawals: vec![].try_into().unwrap(),
consolidations: VariableList::new(vec![consolidation_request]).unwrap(),
};