Skip to content

Commit

Permalink
Use Uint256 for base_fee_per_gas
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 29, 2021
1 parent 3a73cde commit 6c88f19
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion consensus/state_processing/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
}
Expand Down
5 changes: 2 additions & 3 deletions consensus/types/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
];
}
4 changes: 2 additions & 2 deletions consensus/types/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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(),
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/src/execution_payload_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit 6c88f19

Please sign in to comment.