Skip to content

Commit

Permalink
Revert non functional modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Oct 31, 2024
1 parent 5e4e7fe commit c1e88d5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 28 deletions.
2 changes: 1 addition & 1 deletion crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ where
warn!(target: "consensus::engine", invalid_hash=?bad_block.hash(), invalid_number=?bad_block.number, "Bad block detected in unwind");
// update the `invalid_headers` cache with the new invalid header
self.invalid_headers.insert(*bad_block);
return Ok(());
return Ok(())
}

let sync_target_state = match self.forkchoice_state_tracker.sync_target_state() {
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ impl TransportRpcModules {
/// Returns [Ok(false)] if no ws transport is configured.
pub fn merge_ws(&mut self, other: impl Into<Methods>) -> Result<bool, RegisterMethodError> {
if let Some(ref mut ws) = self.ws {
return ws.merge(other.into()).map(|_| true);
return ws.merge(other.into()).map(|_| true)
}
Ok(false)
}
Expand Down
27 changes: 12 additions & 15 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ where
) -> EngineApiResult<ExecutionPayloadBodiesV1> {
let len = hashes.len() as u64;
if len > MAX_PAYLOAD_BODIES_LIMIT {
return Err(EngineApiError::PayloadRequestTooLarge { len });
return Err(EngineApiError::PayloadRequestTooLarge { len })
}

let mut result = Vec::with_capacity(hashes.len());
Expand Down Expand Up @@ -483,7 +483,7 @@ where
return Err(EngineApiError::TerminalTD {
execution: merge_terminal_td,
consensus: terminal_total_difficulty,
});
})
}

self.inner.beacon_consensus.transition_configuration_exchanged().await;
Expand All @@ -493,7 +493,7 @@ where
return Ok(TransitionConfiguration {
terminal_total_difficulty: merge_terminal_td,
..Default::default()
});
})
}

// Attempt to look up terminal block hash
Expand Down Expand Up @@ -561,9 +561,9 @@ where
// TODO: decide if we want this branch - the FCU INVALID response might be more
// useful than the payload attributes INVALID response
if fcu_res.is_invalid() {
return Ok(fcu_res);
return Ok(fcu_res)
}
return Err(err.into());
return Err(err.into())
}
}

Expand Down Expand Up @@ -593,10 +593,7 @@ where

/// Handler for `engine_newPayloadV2`
/// See also <https://github.com/ethereum/execution-apis/blob/584905270d8ad665718058060267061ecfd79ca5/src/engine/shanghai.md#engine_newpayloadv2>
async fn new_payload_v2(
&self,
payload: TaikoExecutionPayloadInputV2,
) -> RpcResult<PayloadStatus> {
async fn new_payload_v2(&self, payload: TaikoExecutionPayloadInputV2) -> RpcResult<PayloadStatus> {
trace!(target: "rpc::engine", "Serving engine_newPayloadV2");
let start = Instant::now();
let gas_used = payload.execution_payload.execution_payload.gas_used;
Expand Down Expand Up @@ -1002,8 +999,8 @@ mod tests {
blocks
.iter()
.filter(|b| {
!first_missing_range.contains(&b.number)
&& !second_missing_range.contains(&b.number)
!first_missing_range.contains(&b.number) &&
!second_missing_range.contains(&b.number)
})
.map(|b| (b.hash(), b.clone().unseal())),
);
Expand Down Expand Up @@ -1032,8 +1029,8 @@ mod tests {
// ensure we still return trailing `None`s here because by-hash will not be aware
// of the missing block's number, and cannot compare it to the current best block
.map(|b| {
if first_missing_range.contains(&b.number)
|| second_missing_range.contains(&b.number)
if first_missing_range.contains(&b.number) ||
second_missing_range.contains(&b.number)
{
None
} else {
Expand All @@ -1059,8 +1056,8 @@ mod tests {
let (handle, api) = setup_engine_api();

let transition_config = TransitionConfiguration {
terminal_total_difficulty: handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap()
+ U256::from(1),
terminal_total_difficulty: handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap() +
U256::from(1),
..Default::default()
};

Expand Down
4 changes: 1 addition & 3 deletions crates/rpc/rpc-types-compat/src/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Compatibility functions for rpc `Transaction` type.

use alloy_rpc_types::request::{TransactionInput, TransactionRequest};
use reth_primitives::{
Address, BlockNumber, TransactionSigned, TransactionSignedEcRecovered, TxKind, TxType, B256,
};
use reth_primitives::{Address, BlockNumber, TransactionSigned, TransactionSignedEcRecovered, TxKind, TxType, B256};
use reth_rpc_types::Transaction;
use signature::from_primitive_signature;
pub use typed::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc/src/eth/api/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ where
/// Handler for: `eth_blobBaseFee`
async fn blob_base_fee(&self) -> Result<U256> {
trace!(target: "rpc::eth", "Serving eth_blobBaseFee");
return Ok(Self::blob_base_fee(self).await?);
return Ok(Self::blob_base_fee(self).await?)
}

// FeeHistory is calculated based on lazy evaluation of fees for historical blocks, and further
Expand Down
10 changes: 4 additions & 6 deletions crates/rpc/rpc/src/eth/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use tokio::sync::{
oneshot, Semaphore,
};
use tokio_stream::wrappers::UnboundedReceiverStream;
use tracing::debug;

mod config;
pub use config::*;
Expand Down Expand Up @@ -362,7 +361,6 @@ where
}

fn on_reorg_block(&mut self, block_hash: B256, res: ProviderResult<Option<BlockWithSenders>>) {
debug!(target:"rpc::cache", "reorg block: {:?}", block_hash);
if let Some(queued) = self.full_block_cache.remove(&block_hash) {
// send the response to queued senders
for tx in queued {
Expand Down Expand Up @@ -422,7 +420,7 @@ where
CacheAction::GetBlockWithSenders { block_hash, response_tx } => {
if let Some(block) = this.full_block_cache.get(&block_hash).cloned() {
let _ = response_tx.send(Ok(Some(block)));
continue;
continue
}

// block is not in the cache, request it if this is the first consumer
Expand Down Expand Up @@ -450,7 +448,7 @@ where
// check if block is cached
if let Some(block) = this.full_block_cache.get(&block_hash) {
let _ = response_tx.send(Ok(Some(block.body.clone())));
continue;
continue
}

// block is not in the cache, request it if this is the first consumer
Expand Down Expand Up @@ -478,7 +476,7 @@ where
// check if block is cached
if let Some(receipts) = this.receipts_cache.get(&block_hash).cloned() {
let _ = response_tx.send(Ok(Some(receipts)));
continue;
continue
}

// block is not in the cache, request it if this is the first consumer
Expand All @@ -502,7 +500,7 @@ where
// check if env data is cached
if let Some(env) = this.evm_env_cache.get(&block_hash).cloned() {
let _ = response_tx.send(Ok(env));
continue;
continue
}

// env data is not in the cache, request it if this is the first
Expand Down
2 changes: 1 addition & 1 deletion crates/stages/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ where
input: ExecInput,
) -> Result<ExecOutput, StageError> {
if input.target_reached() {
return Ok(ExecOutput::done(input.checkpoint()));
return Ok(ExecOutput::done(input.checkpoint()))
}

let start_block = input.next_block();
Expand Down

0 comments on commit c1e88d5

Please sign in to comment.