mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-29 07:17:17 +00:00
Fix bug with attestation production
It was being produced with the wrong source root. I will raise an issue on the spec as it's a tricky one.
This commit is contained in:
parent
397e104f9b
commit
7b3f317abf
@ -475,11 +475,7 @@ where
|
|||||||
/// Produce an `AttestationData` that is valid for the present `slot` and given `shard`.
|
/// Produce an `AttestationData` that is valid for the present `slot` and given `shard`.
|
||||||
pub fn produce_attestation_data(&self, shard: u64) -> Result<AttestationData, Error> {
|
pub fn produce_attestation_data(&self, shard: u64) -> Result<AttestationData, Error> {
|
||||||
trace!("BeaconChain::produce_attestation: shard: {}", shard);
|
trace!("BeaconChain::produce_attestation: shard: {}", shard);
|
||||||
let source_epoch = self.state.read().current_justified_epoch;
|
let state = self.state.read();
|
||||||
let source_root = *self.state.read().get_block_root(
|
|
||||||
source_epoch.start_slot(self.spec.slots_per_epoch),
|
|
||||||
&self.spec,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let target_root = *self.state.read().get_block_root(
|
let target_root = *self.state.read().get_block_root(
|
||||||
self.state
|
self.state
|
||||||
@ -500,8 +496,8 @@ where
|
|||||||
epoch: self.state.read().slot.epoch(self.spec.slots_per_epoch),
|
epoch: self.state.read().slot.epoch(self.spec.slots_per_epoch),
|
||||||
crosslink_data_root: Hash256::zero(),
|
crosslink_data_root: Hash256::zero(),
|
||||||
},
|
},
|
||||||
source_epoch,
|
source_epoch: state.current_justified_epoch,
|
||||||
source_root,
|
source_root: state.current_justified_root,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user