mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 22:04:44 +00:00
Kintsugi review comments (#2831)
* Fix makefile * Return on invalid finalized block * Fix todo in gossip scoring * Require --merge for --fee-recipient * Bump eth2_serde_utils * Change schema versions * Swap hash/uint256 test_random impls * Use default for ExecutionPayload::empty * Check for DBs before removing * Remove kintsugi docker image * Fix CLI default value
This commit is contained in:
@@ -40,24 +40,8 @@ pub struct ExecutionPayload<T: EthSpec> {
|
||||
}
|
||||
|
||||
impl<T: EthSpec> ExecutionPayload<T> {
|
||||
// TODO: check this whole thing later
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
parent_hash: Hash256::zero(),
|
||||
coinbase: Address::default(),
|
||||
state_root: Hash256::zero(),
|
||||
receipt_root: Hash256::zero(),
|
||||
logs_bloom: FixedVector::default(),
|
||||
random: Hash256::zero(),
|
||||
block_number: 0,
|
||||
gas_limit: 0,
|
||||
gas_used: 0,
|
||||
timestamp: 0,
|
||||
extra_data: VariableList::empty(),
|
||||
base_fee_per_gas: Uint256::zero(),
|
||||
block_hash: Hash256::zero(),
|
||||
transactions: VariableList::empty(),
|
||||
}
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Returns the ssz size of `self`.
|
||||
|
||||
@@ -33,7 +33,6 @@ pub struct ExecutionPayloadHeader<T: EthSpec> {
|
||||
}
|
||||
|
||||
impl<T: EthSpec> ExecutionPayloadHeader<T> {
|
||||
// TODO: check this whole thing later
|
||||
pub fn empty() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use super::*;
|
||||
use crate::Uint256;
|
||||
use crate::Hash256;
|
||||
|
||||
impl TestRandom for Uint256 {
|
||||
impl TestRandom for Hash256 {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let mut key_bytes = [0; 32];
|
||||
let mut key_bytes = vec![0; 32];
|
||||
rng.fill_bytes(&mut key_bytes);
|
||||
Self::from_little_endian(&key_bytes[..])
|
||||
Hash256::from_slice(&key_bytes[..])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use super::*;
|
||||
use crate::Hash256;
|
||||
use crate::Uint256;
|
||||
|
||||
impl TestRandom for Hash256 {
|
||||
impl TestRandom for Uint256 {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let mut key_bytes = vec![0; 32];
|
||||
let mut key_bytes = [0; 32];
|
||||
rng.fill_bytes(&mut key_bytes);
|
||||
Hash256::from_slice(&key_bytes[..])
|
||||
Self::from_little_endian(&key_bytes[..])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user