mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
create unified slashing cache (#5033)
* create unified slashing cache * add observed slashable file * fix broadcast validation tests * revert block seen cache changes * clean up slashable cache test * check header signatures for RPC blobs * don't throw error on RPC signature invalie
This commit is contained in:
@@ -1757,6 +1757,32 @@ where
|
||||
((signed_block, blobs), state)
|
||||
}
|
||||
|
||||
pub async fn make_blob_with_modifier(
|
||||
&self,
|
||||
state: BeaconState<E>,
|
||||
slot: Slot,
|
||||
blob_modifier: impl FnOnce(&mut BlobsList<E>),
|
||||
) -> (SignedBlockContentsTuple<E>, BeaconState<E>) {
|
||||
assert_ne!(slot, 0, "can't produce a block at slot 0");
|
||||
assert!(slot >= state.slot());
|
||||
|
||||
let ((block, mut blobs), state) = self.make_block_return_pre_state(state, slot).await;
|
||||
|
||||
let (block, _) = block.deconstruct();
|
||||
|
||||
blob_modifier(&mut blobs.as_mut().unwrap().1);
|
||||
|
||||
let proposer_index = state.get_beacon_proposer_index(slot, &self.spec).unwrap();
|
||||
|
||||
let signed_block = block.sign(
|
||||
&self.validator_keypairs[proposer_index].sk,
|
||||
&state.fork(),
|
||||
state.genesis_validators_root(),
|
||||
&self.spec,
|
||||
);
|
||||
((signed_block, blobs), state)
|
||||
}
|
||||
|
||||
pub fn make_deposits<'a>(
|
||||
&self,
|
||||
state: &'a mut BeaconState<E>,
|
||||
|
||||
Reference in New Issue
Block a user