Skip to content

Commit

Permalink
Merge pull request #29 from hangleang/electra-alpha3-containers
Browse files Browse the repository at this point in the history
[Electra] update containers ssz types based on alpha3 specs
  • Loading branch information
Tumas authored Jul 1, 2024
2 parents 9a91a28 + 9560096 commit d27ea35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions transition_functions/src/electra/block_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ fn process_withdrawal_request<P: Preset>(
.as_bytes()
.index(H256::len_bytes() - ExecutionAddress::len_bytes()..)
.pipe(ExecutionAddress::from_slice);

let is_correct_source_address = source_address == withdrawal_request.source_address;

if !(has_correct_credential && is_correct_source_address) {
Expand Down Expand Up @@ -1031,6 +1032,7 @@ fn process_deposit_request<P: Preset>(
Ok(())
}


#[allow(clippy::too_many_lines)]
pub fn process_consolidation_request<P: Preset>(
config: &Config,
Expand Down Expand Up @@ -1074,6 +1076,7 @@ pub fn process_consolidation_request<P: Preset>(
let prefix_len = H256::len_bytes() - ExecutionAddress::len_bytes();
let computed_source_address =
ExecutionAddress::from_slice(&source_validator.withdrawal_credentials[prefix_len..]);

if !(has_correct_credential && computed_source_address == source_address) {
return Ok(());
}
Expand Down
2 changes: 1 addition & 1 deletion transition_functions/src/electra/epoch_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use types::{
phase0::consts::FAR_FUTURE_EPOCH,
preset::Preset,
traits::{BeaconState as _, PostElectraBeaconState},
phase0::consts::FAR_FUTURE_EPOCH,
};

use super::epoch_intermediates;
Expand Down Expand Up @@ -227,7 +228,6 @@ fn process_pending_balance_deposits<P: Preset>(
}
} else {
// > Validator is not exiting, attempt to process deposit

// > Deposit does not fit in the churn, no more deposit processing in this epoch.
if processed_amount + deposit.amount > available_for_processing {
break;
Expand Down

0 comments on commit d27ea35

Please sign in to comment.