From ebd524d816ed2df85eae8021dbd4dcf214057e2d Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Fri, 2 Jan 2026 16:51:44 -0600 Subject: [PATCH] Linting --- .../tests/inclusion_list_verification.rs | 2 +- .../http_api/src/inclusion_list_duties.rs | 4 ++-- beacon_node/http_api/src/lib.rs | 16 ++++++++-------- .../http_api/src/publish_inclusion_lists.rs | 5 +---- beacon_node/http_api/tests/tests.rs | 5 ++--- .../network_beacon_processor/gossip_methods.rs | 5 +++-- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/beacon_node/beacon_chain/tests/inclusion_list_verification.rs b/beacon_node/beacon_chain/tests/inclusion_list_verification.rs index ef2708624d..9084f031e7 100644 --- a/beacon_node/beacon_chain/tests/inclusion_list_verification.rs +++ b/beacon_node/beacon_chain/tests/inclusion_list_verification.rs @@ -5,7 +5,7 @@ use beacon_chain::{ inclusion_list_verification::GossipInclusionListError, test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType}, }; -use bls::{PublicKeyBytes, SecretKey, Keypair, generics::GenericSignature}; +use bls::{Keypair, PublicKeyBytes, SecretKey, generics::GenericSignature}; use types::{ ChainSpec, Domain, Epoch, EthSpec, Fork, Hash256, InclusionList, MainnetEthSpec, SignedInclusionList, SignedRoot, Slot, diff --git a/beacon_node/http_api/src/inclusion_list_duties.rs b/beacon_node/http_api/src/inclusion_list_duties.rs index 11f66e90c7..da885206f6 100644 --- a/beacon_node/http_api/src/inclusion_list_duties.rs +++ b/beacon_node/http_api/src/inclusion_list_duties.rs @@ -1,8 +1,8 @@ use beacon_chain::{BeaconChain, BeaconChainTypes}; +use bls::PublicKeyBytes; use eth2::types::{self as api_types}; use slot_clock::SlotClock; -use types::{Epoch, EthSpec, Hash256, InclusionListDuty, PublicKeyBytes}; - +use types::{Epoch, EthSpec, Hash256, InclusionListDuty}; /// The struct that is returned to the requesting HTTP client. type ApiDuties = api_types::DutiesResponse>; diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 59835c7b36..c38ae4bc18 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -45,8 +45,6 @@ use crate::validator::post_validator_liveness_epoch; use crate::validator::*; use crate::version::beacon_response; use beacon::states; - -use warp_utils::reject::convert_rejection; use beacon_chain::{BeaconChain, BeaconChainError, BeaconChainTypes, WhenSlotSkipped}; use beacon_processor::BeaconProcessorSend; pub use block_id::BlockId; @@ -91,10 +89,10 @@ use tokio_stream::{ StreamExt, wrappers::{BroadcastStream, errors::BroadcastStreamRecvError}, }; -use tracing::{debug, info, warn}; +use tracing::{debug, error, info, warn}; use types::{ BeaconStateError, Checkpoint, ConfigAndPreset, Epoch, EthSpec, ForkName, Hash256, - SignedBlindedBeaconBlock, Slot, + SignedBlindedBeaconBlock, SignedInclusionList, Slot, }; use version::{ ResponseIncludesVersion, V1, V2, add_consensus_version_header, add_ssz_content_type_header, @@ -105,6 +103,7 @@ use warp::Reply; use warp::hyper::Body; use warp::sse::Event; use warp::{Filter, Rejection, http::Response}; +use warp_utils::reject::convert_rejection; use warp_utils::{query::multi_key_query, uor::UnifyingOrFilter}; const API_PREFIX: &str = "eth"; @@ -1477,19 +1476,16 @@ pub fn serve( .and(warp::path::end()) .and(warp_utils::json::json()) .and(network_tx_filter.clone()) - .and(reprocess_send_filter.clone()) .then( |task_spawner: TaskSpawner, chain: Arc>, inclusion_lists: Vec>, - network_tx: UnboundedSender>, - reprocess_tx: Option>| async move { + network_tx: UnboundedSender>| async move { let result = crate::publish_inclusion_lists::publish_inclusion_lists( task_spawner, chain, inclusion_lists, network_tx, - reprocess_tx, ) .await .map(|()| warp::reply::json(&())); @@ -2513,8 +2509,10 @@ pub fn serve( task_spawner_filter.clone(), ); + // TODO(eip7805) update endpoint def // POST validator/duties/inclusion_list/{epoch} let post_validator_duties_inclusion_list = eth_v1 + .clone() .and(warp::path("validator")) .and(warp::path("duties")) .and(warp::path("inclusion_list")) @@ -2549,8 +2547,10 @@ pub fn serve( task_spawner_filter.clone(), ); + // TODO(EIP7805) update endpoint definition format // GET validator/inclusion_list?slot let get_validator_inclusion_list = eth_v1 + .clone() .and(warp::path("validator")) .and(warp::path("inclusion_list")) .and(warp::path::end()) diff --git a/beacon_node/http_api/src/publish_inclusion_lists.rs b/beacon_node/http_api/src/publish_inclusion_lists.rs index 38011ab979..bcaf2050a8 100644 --- a/beacon_node/http_api/src/publish_inclusion_lists.rs +++ b/beacon_node/http_api/src/publish_inclusion_lists.rs @@ -5,10 +5,7 @@ use beacon_chain::{BeaconChain, BeaconChainTypes, validator_monitor::timestamp_n use eth2::types::Failure; use lighthouse_network::PubsubMessage; use network::NetworkMessage; -use tokio::sync::{ - mpsc::{Sender, UnboundedSender}, - oneshot, -}; +use tokio::sync::{mpsc::UnboundedSender, oneshot}; use tracing::{debug, error, info}; use types::SignedInclusionList; diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index c4d4e588ec..defaae5d83 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -3189,12 +3189,10 @@ impl ApiTester { pub async fn test_post_validator_duties_inclusion_list(self) -> Self { let current_epoch = self.chain.epoch().unwrap(); - let state = self.harness.get_current_state(); let slot = self.chain.slot().unwrap(); self.harness.extend_to_slot(slot).await; for validator_indices in self.interesting_validator_indices() { - let res = self - .client + self.client .post_validator_duties_inclusion_list(current_epoch, &validator_indices) .await .unwrap(); @@ -8194,6 +8192,7 @@ async fn test_post_validator_duties_inclusion_list() { .await; } +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_validator_blocks_v3_http_api_path() { ApiTester::new() .await diff --git a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs index 51940ce68a..83931f221e 100644 --- a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs @@ -42,8 +42,9 @@ use types::{ Attestation, AttestationData, AttestationRef, AttesterSlashing, BlobSidecar, DataColumnSidecar, DataColumnSubnetId, EthSpec, Hash256, IndexedAttestation, LightClientFinalityUpdate, LightClientOptimisticUpdate, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, - SignedBlsToExecutionChange, SignedContributionAndProof, SignedVoluntaryExit, SingleAttestation, - Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId, beacon_block::BlockImportSource, SignedInclusionList + SignedBlsToExecutionChange, SignedContributionAndProof, SignedInclusionList, + SignedVoluntaryExit, SingleAttestation, Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId, + beacon_block::BlockImportSource, }; use beacon_processor::work_reprocessing_queue::QueuedColumnReconstruction;