add new beacon state variant for shanghai

This commit is contained in:
realbigsean
2022-02-20 15:27:22 -07:00
parent 203418ffc9
commit acaa340b41
10 changed files with 105 additions and 36 deletions

View File

@@ -3619,6 +3619,30 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.ok_or(BlockProductionError::MissingExecutionPayload)?,
},
}),
BeaconState::Shanghai(_) => {
let sync_aggregate = get_sync_aggregate()?;
let execution_payload = get_execution_payload(self, &state, proposer_index)?;
//FIXME(sean) get blobs
BeaconBlock::Shanghai(BeaconBlockShanghai {
slot,
proposer_index,
parent_root,
state_root: Hash256::zero(),
body: BeaconBlockBodyShanghai {
randao_reveal,
eth1_data,
graffiti,
proposer_slashings: proposer_slashings.into(),
attester_slashings: attester_slashings.into(),
attestations,
deposits,
voluntary_exits: voluntary_exits.into(),
sync_aggregate,
execution_payload,
blob_kzgs: VariableList::empty(),
},
})
}
};
let block = SignedBeaconBlock::from_block(

View File

@@ -0,0 +1 @@

View File

@@ -5,6 +5,7 @@ mod beacon_chain;
mod beacon_fork_choice_store;
pub mod beacon_proposer_cache;
mod beacon_snapshot;
mod blob_verification;
pub mod block_reward;
mod block_times_cache;
mod block_verification;