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:
Paul Hauner
2021-11-30 09:32:53 +11:00
parent 82a81524e3
commit 1b56ebf85e
22 changed files with 57 additions and 114 deletions

View File

@@ -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`.

View File

@@ -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()
}

View File

@@ -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[..])
}
}

View File

@@ -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[..])
}
}