Use Uint256 for base_fee_per_gas

This commit is contained in:
Paul Hauner
2021-09-29 14:36:10 +10:00
parent 3a73cdeeb0
commit 6c88f19ac4
4 changed files with 6 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ pub fn initialize_beacon_state_from_eth1<T: EthSpec>(
timestamp: eth1_timestamp,
random: eth1_block_hash,
gas_limit: GENESIS_GAS_LIMIT,
base_fee_per_gas: GENESIS_BASE_FEE_PER_GAS,
base_fee_per_gas: Uint256::from_little_endian(&GENESIS_BASE_FEE_PER_GAS),
..ExecutionPayloadHeader::default()
};
}

View File

@@ -21,11 +21,10 @@ pub mod altair {
}
pub mod merge_testing {
use ethereum_types::H256;
pub const GENESIS_GAS_LIMIT: u64 = 30_000_000;
pub const GENESIS_BASE_FEE_PER_GAS: H256 = H256([
pub const GENESIS_BASE_FEE_PER_GAS: [u8; 32] = [
0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
]);
];
}

View File

@@ -59,7 +59,7 @@ pub struct ExecutionPayload<T: EthSpec> {
pub timestamp: u64,
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
pub extra_data: VariableList<u8, T::MaxExtraDataBytes>,
pub base_fee_per_gas: Hash256,
pub base_fee_per_gas: Uint256,
pub block_hash: Hash256,
#[test_random(default)]
pub transactions: VariableList<Transaction<T>, T::MaxTransactionsPerPayload>,
@@ -80,7 +80,7 @@ impl<T: EthSpec> ExecutionPayload<T> {
gas_used: 0,
timestamp: 0,
extra_data: VariableList::empty(),
base_fee_per_gas: Hash256::zero(),
base_fee_per_gas: Uint256::zero(),
block_hash: Hash256::zero(),
transactions: VariableList::empty(),
}

View File

@@ -26,7 +26,7 @@ pub struct ExecutionPayloadHeader<T: EthSpec> {
pub timestamp: u64,
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
pub extra_data: VariableList<u8, T::MaxExtraDataBytes>,
pub base_fee_per_gas: Hash256,
pub base_fee_per_gas: Uint256,
pub block_hash: Hash256,
pub transactions_root: Hash256,
}