mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Introduce Fork struct to block_producer
It's a pretty crappy solution, IMO. It shouldn't really belong in "duties" but this gets the job done for now.
This commit is contained in:
@@ -50,6 +50,9 @@ impl<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> BlockProducerServi
|
||||
Ok(BlockProducerPollOutcome::ValidatorIsUnknown(slot)) => {
|
||||
error!(self.log, "The Beacon Node does not recognise the validator"; "slot" => slot)
|
||||
}
|
||||
Ok(BlockProducerPollOutcome::UnableToGetFork(slot)) => {
|
||||
error!(self.log, "Unable to get a `Fork` struct to generate signature domains"; "slot" => slot)
|
||||
}
|
||||
};
|
||||
|
||||
std::thread::sleep(Duration::from_millis(self.poll_interval_millis));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use block_proposer::{DutiesReader, DutiesReaderError};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::RwLock;
|
||||
use types::{Epoch, Slot};
|
||||
use types::{Epoch, Fork, Slot};
|
||||
|
||||
/// The information required for a validator to propose and attest during some epoch.
|
||||
///
|
||||
@@ -75,6 +75,17 @@ impl DutiesReader for EpochDutiesMap {
|
||||
.ok_or_else(|| DutiesReaderError::UnknownEpoch)?;
|
||||
Ok(duties.is_block_production_slot(slot))
|
||||
}
|
||||
|
||||
fn fork(&self) -> Result<Fork, DutiesReaderError> {
|
||||
// TODO: this is garbage data.
|
||||
//
|
||||
// It will almost certainly cause signatures to fail verification.
|
||||
Ok(Fork {
|
||||
previous_version: 0,
|
||||
current_version: 0,
|
||||
epoch: Epoch::new(0),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: add tests.
|
||||
|
||||
Reference in New Issue
Block a user