chore: block gas limit constant (#3224)

This commit is contained in:
Roman Krasiuk
2023-06-19 15:54:30 +03:00
committed by GitHub
parent 1049202f0f
commit b9c19e82b2
5 changed files with 22 additions and 13 deletions

View File

@ -17,8 +17,8 @@ use reth_payload_builder::{
use reth_primitives::{
bytes::{Bytes, BytesMut},
constants::{
BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS, EMPTY_WITHDRAWALS, RETH_CLIENT_VERSION,
SLOT_DURATION,
BEACON_NONCE, EMPTY_RECEIPTS, EMPTY_TRANSACTIONS, EMPTY_WITHDRAWALS,
ETHEREUM_BLOCK_GAS_LIMIT, RETH_CLIENT_VERSION, SLOT_DURATION,
},
proofs, Block, BlockNumberOrTag, ChainSpec, Header, IntoRecoveredTransaction, Receipt,
SealedBlock, Withdrawal, EMPTY_OMMER_ROOT, H256, U256,
@ -173,7 +173,7 @@ impl PayloadTaskGuard {
pub struct BasicPayloadJobGeneratorConfig {
/// Data to include in the block's extra data field.
extradata: Bytes,
/// Target gas ceiling for built blocks, defaults to 30_000_000 gas.
/// Target gas ceiling for built blocks, defaults to [ETHEREUM_BLOCK_GAS_LIMIT] gas.
max_gas_limit: u64,
/// The interval at which the job should build a new payload after the last.
interval: Duration,
@ -219,7 +219,7 @@ impl BasicPayloadJobGeneratorConfig {
/// Sets the target gas ceiling for mined blocks.
///
/// Defaults to 30_000_000 gas.
/// Defaults to [ETHEREUM_BLOCK_GAS_LIMIT] gas.
pub fn max_gas_limit(mut self, max_gas_limit: u64) -> Self {
self.max_gas_limit = max_gas_limit;
self
@ -232,7 +232,7 @@ impl Default for BasicPayloadJobGeneratorConfig {
RETH_CLIENT_VERSION.as_bytes().encode(&mut extradata);
Self {
extradata: extradata.freeze(),
max_gas_limit: 30_000_000,
max_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
interval: Duration::from_secs(1),
// 12s slot time
deadline: SLOT_DURATION,