Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Electra] update containers ssz types based on alpha3 specs #29

Merged
merged 5 commits into from
Jul 1, 2024
Merged
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
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