Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
garwah committed Sep 22, 2024
1 parent b4ad28d commit afac7e0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
1 change: 0 additions & 1 deletion bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
best_block.hash(),
payload_attrs,
)?,
provider_factory.chain_spec(),
);

let args = BuildArguments::new(
Expand Down
5 changes: 3 additions & 2 deletions crates/ethereum/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ where
let state = StateProviderDatabase::new(state_provider);
let mut db =
State::builder().with_database_ref(cached_reads.as_db(state)).with_bundle_update().build();
let PayloadConfig { parent_block, extra_data, attributes, chain_spec } = config;
let PayloadConfig { parent_block, extra_data, attributes } = config;

debug!(target: "payload_builder", id=%attributes.id, parent_hash = ?parent_block.hash(), parent_number = parent_block.number, "building new payload");
let mut cumulative_gas_used = 0;
let mut sum_blob_gas_used = 0;
let block_gas_limit: u64 =
initialized_block_env.gas_limit.try_into().unwrap_or(chain_spec.max_gas_limit);
initialized_block_env.gas_limit.to::<u64>();
let base_fee = initialized_block_env.basefee.to::<u64>();

let mut executed_txs = Vec::new();
Expand Down Expand Up @@ -314,6 +314,7 @@ where
}

// calculate the requests and the requests root
// TODO (garwah): Figure out how to replace this check now that chain spec has been removed.
let (requests, requests_root) = if chain_spec
.is_prague_active_at_timestamp(attributes.timestamp)
{
Expand Down
1 change: 0 additions & 1 deletion crates/evm/src/system_calls/eip4788.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, B256};
pub fn pre_block_beacon_root_contract_call<EvmConfig, DB>(
db: &mut DB,
evm_config: &EvmConfig,
chain_spec: &ChainSpec,
initialized_cfg: &CfgEnvWithHandlerCfg,
initialized_block_env: &BlockEnv,
parent_beacon_block_root: Option<B256>,
Expand Down
8 changes: 2 additions & 6 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ where
let config = PayloadConfig::new(
Arc::new(parent_block),
self.config.extradata.clone(),
attributes,
Arc::clone(&self.chain_spec),
attributes
);

let until = self.job_deadline(config.attributes.timestamp());
Expand Down Expand Up @@ -676,8 +675,6 @@ pub struct PayloadConfig<Attributes> {
pub extra_data: Bytes,
/// Requested attributes for the payload.
pub attributes: Attributes,
/// The chain spec.
pub chain_spec: Arc<ChainSpec>,
}

impl<Attributes> PayloadConfig<Attributes> {
Expand All @@ -696,9 +693,8 @@ where
parent_block: Arc<SealedBlock>,
extra_data: Bytes,
attributes: Attributes,
chain_spec: Arc<ChainSpec>,
) -> Self {
Self { parent_block, extra_data, attributes, chain_spec }
Self { parent_block, extra_data, attributes }
}

/// Returns the payload id.
Expand Down
5 changes: 3 additions & 2 deletions examples/custom-engine-types/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ where
client: &Client,
config: PayloadConfig<Self::Attributes>,
) -> Result<Self::BuiltPayload, PayloadBuilderError> {
let PayloadConfig { parent_block, extra_data, attributes, chain_spec } = config;
let PayloadConfig { parent_block, extra_data, attributes} = config;
// TODO (garwah): How do we instantiate EthEvmConfig as it requires chain spec
<reth_ethereum_payload_builder::EthereumPayloadBuilder as PayloadBuilder<Pool, Client>>::build_empty_payload(&reth_ethereum_payload_builder::EthereumPayloadBuilder::new(EthEvmConfig::new(chain_spec.clone())),client,
PayloadConfig { parent_block, extra_data, attributes: attributes.0, chain_spec })
PayloadConfig { parent_block, extra_data, attributes: attributes.0})
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/custom-payload-builder/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ where
Arc::new(parent_block),
Bytes::default(),
attributes,
Arc::clone(&self.chain_spec),
);
Ok(EmptyBlockPayloadJob {
client: self.client.clone(),
Expand Down

0 comments on commit afac7e0

Please sign in to comment.