mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-05 05:44:30 +00:00
@@ -300,7 +300,9 @@ pub enum BlockError<E: EthSpec> {
|
|||||||
/// 1. The block proposer is faulty
|
/// 1. The block proposer is faulty
|
||||||
/// 2. We received the blob over rpc and it is invalid (inconsistent w.r.t the block).
|
/// 2. We received the blob over rpc and it is invalid (inconsistent w.r.t the block).
|
||||||
/// 3. It is an internal error
|
/// 3. It is an internal error
|
||||||
|
///
|
||||||
/// For all these cases, we cannot penalize the peer that gave us the block.
|
/// For all these cases, we cannot penalize the peer that gave us the block.
|
||||||
|
///
|
||||||
/// TODO: We may need to penalize the peer that gave us a potentially invalid rpc blob.
|
/// TODO: We may need to penalize the peer that gave us a potentially invalid rpc blob.
|
||||||
/// https://github.com/sigp/lighthouse/issues/4546
|
/// https://github.com/sigp/lighthouse/issues/4546
|
||||||
AvailabilityCheck(AvailabilityCheckError),
|
AvailabilityCheck(AvailabilityCheckError),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
wasm-bindgen = ["getrandom/js"]
|
wasm-bindgen = ["getrandom/js"]
|
||||||
|
rsa = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-channel = { workspace = true }
|
async-channel = { workspace = true }
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
/// Check if this new lookup extends a bad chain:
|
/// Check if this new lookup extends a bad chain:
|
||||||
/// - Extending `child_block_root_trigger` would exceed the max depth
|
/// - Extending `child_block_root_trigger` would exceed the max depth
|
||||||
/// - `block_root_to_search` is a failed chain
|
/// - `block_root_to_search` is a failed chain
|
||||||
|
///
|
||||||
/// Returns true if the lookup is created or already exists
|
/// Returns true if the lookup is created or already exists
|
||||||
pub fn search_parent_of_child(
|
pub fn search_parent_of_child(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ impl Serialize for AsyncRecord {
|
|||||||
// Convoluted pattern to avoid binding `format_args!` to a temporary.
|
// Convoluted pattern to avoid binding `format_args!` to a temporary.
|
||||||
// See: https://stackoverflow.com/questions/56304313/cannot-use-format-args-due-to-temporary-value-is-freed-at-the-end-of-this-state
|
// See: https://stackoverflow.com/questions/56304313/cannot-use-format-args-due-to-temporary-value-is-freed-at-the-end-of-this-state
|
||||||
let mut f = |msg: std::fmt::Arguments| {
|
let mut f = |msg: std::fmt::Arguments| {
|
||||||
map_serializer.serialize_entry("msg", &msg.to_string())?;
|
map_serializer.serialize_entry("msg", msg.to_string())?;
|
||||||
|
|
||||||
let record = Record::new(&rs, &msg, BorrowedKV(&(*kv)));
|
let record = Record::new(&rs, &msg, BorrowedKV(&(*kv)));
|
||||||
self.logger_values
|
self.logger_values
|
||||||
|
|||||||
@@ -2253,7 +2253,7 @@ fn slasher_broadcast_flag_false() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "lmdb"))]
|
#[cfg(all(feature = "slasher-lmdb"))]
|
||||||
#[test]
|
#[test]
|
||||||
fn slasher_backend_override_to_default() {
|
fn slasher_backend_override_to_default() {
|
||||||
// Hard to test this flag because all but one backend is disabled by default and the backend
|
// Hard to test this flag because all but one backend is disabled by default and the backend
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ impl<E: EthSpec> SlasherDB<E> {
|
|||||||
for target_epoch in (start_epoch..max_target.as_u64()).map(Epoch::new) {
|
for target_epoch in (start_epoch..max_target.as_u64()).map(Epoch::new) {
|
||||||
txn.put(
|
txn.put(
|
||||||
&self.databases.attesters_db,
|
&self.databases.attesters_db,
|
||||||
&AttesterKey::new(validator_index, target_epoch, &self.config),
|
AttesterKey::new(validator_index, target_epoch, &self.config),
|
||||||
CompactAttesterRecord::null().as_bytes(),
|
CompactAttesterRecord::null().as_bytes(),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
@@ -417,8 +417,8 @@ impl<E: EthSpec> SlasherDB<E> {
|
|||||||
|
|
||||||
txn.put(
|
txn.put(
|
||||||
&self.databases.attesters_max_targets_db,
|
&self.databases.attesters_max_targets_db,
|
||||||
&CurrentEpochKey::new(validator_index),
|
CurrentEpochKey::new(validator_index),
|
||||||
&max_target.as_ssz_bytes(),
|
max_target.as_ssz_bytes(),
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -444,8 +444,8 @@ impl<E: EthSpec> SlasherDB<E> {
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
txn.put(
|
txn.put(
|
||||||
&self.databases.current_epochs_db,
|
&self.databases.current_epochs_db,
|
||||||
&CurrentEpochKey::new(validator_index),
|
CurrentEpochKey::new(validator_index),
|
||||||
¤t_epoch.as_ssz_bytes(),
|
current_epoch.as_ssz_bytes(),
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -621,7 +621,7 @@ impl<E: EthSpec> SlasherDB<E> {
|
|||||||
|
|
||||||
txn.put(
|
txn.put(
|
||||||
&self.databases.attesters_db,
|
&self.databases.attesters_db,
|
||||||
&AttesterKey::new(validator_index, target_epoch, &self.config),
|
AttesterKey::new(validator_index, target_epoch, &self.config),
|
||||||
indexed_attestation_id,
|
indexed_attestation_id,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@@ -699,8 +699,8 @@ impl<E: EthSpec> SlasherDB<E> {
|
|||||||
} else {
|
} else {
|
||||||
txn.put(
|
txn.put(
|
||||||
&self.databases.proposers_db,
|
&self.databases.proposers_db,
|
||||||
&ProposerKey::new(proposer_index, slot),
|
ProposerKey::new(proposer_index, slot),
|
||||||
&block_header.as_ssz_bytes(),
|
block_header.as_ssz_bytes(),
|
||||||
)?;
|
)?;
|
||||||
Ok(ProposerSlashingStatus::NotSlashable)
|
Ok(ProposerSlashingStatus::NotSlashable)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user