Update gloas api routes to match updated spec (#9418)

tldr the routes got pluralized
https://github.com/ethereum/beacon-APIs/pull/613


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Eitan Seri-Levi
2026-06-05 13:16:06 -07:00
committed by GitHub
parent e78e1d38ba
commit 42e678189c
9 changed files with 88 additions and 88 deletions

View File

@@ -14,8 +14,8 @@ use tracing::{debug, warn};
use types::SignedExecutionPayloadBid;
use warp::{Filter, Rejection, Reply, hyper::Body, hyper::Response};
// POST /eth/v1/beacon/execution_payload_bid (SSZ)
pub(crate) fn post_beacon_execution_payload_bid_ssz<T: BeaconChainTypes>(
// POST /eth/v1/beacon/execution_payload_bids (SSZ)
pub(crate) fn post_beacon_execution_payload_bids_ssz<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
task_spawner_filter: TaskSpawnerFilter<T>,
chain_filter: ChainFilter<T>,
@@ -23,7 +23,7 @@ pub(crate) fn post_beacon_execution_payload_bid_ssz<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("beacon"))
.and(warp::path("execution_payload_bid"))
.and(warp::path("execution_payload_bids"))
.and(warp::path::end())
.and(warp::body::bytes())
.and(task_spawner_filter)
@@ -46,8 +46,8 @@ pub(crate) fn post_beacon_execution_payload_bid_ssz<T: BeaconChainTypes>(
.boxed()
}
// POST /eth/v1/beacon/execution_payload_bid
pub(crate) fn post_beacon_execution_payload_bid<T: BeaconChainTypes>(
// POST /eth/v1/beacon/execution_payload_bids
pub(crate) fn post_beacon_execution_payload_bids<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
task_spawner_filter: TaskSpawnerFilter<T>,
chain_filter: ChainFilter<T>,
@@ -55,7 +55,7 @@ pub(crate) fn post_beacon_execution_payload_bid<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("beacon"))
.and(warp::path("execution_payload_bid"))
.and(warp::path("execution_payload_bids"))
.and(warp::path::end())
.and(warp::body::json())
.and(task_spawner_filter)

View File

@@ -24,8 +24,8 @@ use warp::{
hyper::{Body, Response},
};
// POST beacon/execution_payload_envelope (SSZ)
pub(crate) fn post_beacon_execution_payload_envelope_ssz<T: BeaconChainTypes>(
// POST beacon/execution_payload_envelopes (SSZ)
pub(crate) fn post_beacon_execution_payload_envelopes_ssz<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
task_spawner_filter: TaskSpawnerFilter<T>,
chain_filter: ChainFilter<T>,
@@ -33,7 +33,7 @@ pub(crate) fn post_beacon_execution_payload_envelope_ssz<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("beacon"))
.and(warp::path("execution_payload_envelope"))
.and(warp::path("execution_payload_envelopes"))
.and(warp::path::end())
.and(warp::body::bytes())
.and(task_spawner_filter)
@@ -57,8 +57,8 @@ pub(crate) fn post_beacon_execution_payload_envelope_ssz<T: BeaconChainTypes>(
.boxed()
}
// POST beacon/execution_payload_envelope
pub(crate) fn post_beacon_execution_payload_envelope<T: BeaconChainTypes>(
// POST beacon/execution_payload_envelopes
pub(crate) fn post_beacon_execution_payload_envelopes<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
task_spawner_filter: TaskSpawnerFilter<T>,
chain_filter: ChainFilter<T>,
@@ -66,7 +66,7 @@ pub(crate) fn post_beacon_execution_payload_envelope<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("beacon"))
.and(warp::path("execution_payload_envelope"))
.and(warp::path("execution_payload_envelopes"))
.and(warp::path::end())
.and(warp::body::json())
.and(task_spawner_filter.clone())
@@ -85,7 +85,7 @@ pub(crate) fn post_beacon_execution_payload_envelope<T: BeaconChainTypes>(
.boxed()
}
/// Publishes a signed execution payload envelope to the network. Implements
/// `POST /eth/v1/beacon/execution_payload_envelope` per the in-flight beacon-APIs PR
/// `POST /eth/v1/beacon/execution_payload_envelopes` per the in-flight beacon-APIs PR
/// <https://github.com/ethereum/beacon-APIs/pull/580>.
pub async fn publish_execution_payload_envelope<T: BeaconChainTypes>(
envelope: SignedExecutionPayloadEnvelope<T::EthSpec>,
@@ -292,8 +292,8 @@ fn build_gloas_data_columns<T: BeaconChainTypes>(
}
// TODO(gloas): add tests for this endpoint once we support importing payloads into the db
// GET beacon/execution_payload_envelope/{block_id}
pub(crate) fn get_beacon_execution_payload_envelope<T: BeaconChainTypes>(
// GET beacon/execution_payload_envelopes/{block_id}
pub(crate) fn get_beacon_execution_payload_envelopes<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
block_id_or_err: impl Filter<Extract = (BlockId,), Error = Rejection>
+ Clone
@@ -305,7 +305,7 @@ pub(crate) fn get_beacon_execution_payload_envelope<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("beacon"))
.and(warp::path("execution_payload_envelope"))
.and(warp::path("execution_payload_envelopes"))
.and(block_id_or_err)
.and(warp::path::end())
.and(task_spawner_filter)

View File

@@ -1,4 +1,4 @@
pub mod execution_payload_bid;
pub mod execution_payload_envelope;
pub mod execution_payload_bids;
pub mod execution_payload_envelopes;
pub mod pool;
pub mod states;

View File

@@ -36,12 +36,12 @@ mod validator_inclusion;
mod validators;
mod version;
use crate::beacon::execution_payload_bid::{
post_beacon_execution_payload_bid, post_beacon_execution_payload_bid_ssz,
use crate::beacon::execution_payload_bids::{
post_beacon_execution_payload_bids, post_beacon_execution_payload_bids_ssz,
};
use crate::beacon::execution_payload_envelope::{
get_beacon_execution_payload_envelope, post_beacon_execution_payload_envelope,
post_beacon_execution_payload_envelope_ssz,
use crate::beacon::execution_payload_envelopes::{
get_beacon_execution_payload_envelopes, post_beacon_execution_payload_envelopes,
post_beacon_execution_payload_envelopes_ssz,
};
use crate::beacon::pool::*;
use crate::caches::DEFAULT_HISTORICAL_COMMITTEE_CACHE_SIZE;
@@ -101,7 +101,7 @@ use types::{
BeaconStateError, Checkpoint, ConfigAndPreset, Epoch, EthSpec, ForkName, Hash256,
SignedBlindedBeaconBlock,
};
use validator::execution_payload_envelope::get_validator_execution_payload_envelope;
use validator::execution_payload_envelopes::get_validator_execution_payload_envelopes;
use version::{
ResponseIncludesVersion, V1, V2, add_consensus_version_header, add_ssz_content_type_header,
execution_optimistic_finalized_beacon_response, inconsistent_fork_rejection,
@@ -1542,40 +1542,40 @@ pub fn serve<T: BeaconChainTypes>(
network_tx_filter.clone(),
);
// POST beacon/execution_payload_envelope
let post_beacon_execution_payload_envelope = post_beacon_execution_payload_envelope(
// POST beacon/execution_payload_envelopes
let post_beacon_execution_payload_envelopes = post_beacon_execution_payload_envelopes(
eth_v1.clone(),
task_spawner_filter.clone(),
chain_filter.clone(),
network_tx_filter.clone(),
);
// POST beacon/execution_payload_envelope (SSZ)
let post_beacon_execution_payload_envelope_ssz = post_beacon_execution_payload_envelope_ssz(
// POST beacon/execution_payload_envelopes (SSZ)
let post_beacon_execution_payload_envelopes_ssz = post_beacon_execution_payload_envelopes_ssz(
eth_v1.clone(),
task_spawner_filter.clone(),
chain_filter.clone(),
network_tx_filter.clone(),
);
// POST beacon/execution_payload_bid
let post_beacon_execution_payload_bid = post_beacon_execution_payload_bid(
// POST beacon/execution_payload_bids
let post_beacon_execution_payload_bids = post_beacon_execution_payload_bids(
eth_v1.clone(),
task_spawner_filter.clone(),
chain_filter.clone(),
network_tx_filter.clone(),
);
// POST beacon/execution_payload_bid (SSZ)
let post_beacon_execution_payload_bid_ssz = post_beacon_execution_payload_bid_ssz(
// POST beacon/execution_payload_bids (SSZ)
let post_beacon_execution_payload_bids_ssz = post_beacon_execution_payload_bids_ssz(
eth_v1.clone(),
task_spawner_filter.clone(),
chain_filter.clone(),
network_tx_filter.clone(),
);
// GET beacon/execution_payload_envelope/{block_id}
let get_beacon_execution_payload_envelope = get_beacon_execution_payload_envelope(
// GET beacon/execution_payload_envelopes/{block_id}
let get_beacon_execution_payload_envelopes = get_beacon_execution_payload_envelopes(
eth_v1.clone(),
block_id_or_err,
task_spawner_filter.clone(),
@@ -2584,8 +2584,8 @@ pub fn serve<T: BeaconChainTypes>(
task_spawner_filter.clone(),
);
// GET validator/execution_payload_envelope/{slot}/{builder_index}
let get_validator_execution_payload_envelope = get_validator_execution_payload_envelope(
// GET validator/execution_payload_envelopes/{slot}/{builder_index}
let get_validator_execution_payload_envelopes = get_validator_execution_payload_envelopes(
eth_v1.clone(),
chain_filter.clone(),
not_while_syncing_filter.clone(),
@@ -3401,7 +3401,7 @@ pub fn serve<T: BeaconChainTypes>(
.uor(get_beacon_block_root)
.uor(get_blob_sidecars)
.uor(get_blobs)
.uor(get_beacon_execution_payload_envelope)
.uor(get_beacon_execution_payload_envelopes)
.uor(get_beacon_pool_attestations)
.uor(get_beacon_pool_attester_slashings)
.uor(get_beacon_pool_proposer_slashings)
@@ -3425,7 +3425,7 @@ pub fn serve<T: BeaconChainTypes>(
.uor(get_validator_duties_proposer)
.uor(get_validator_blocks)
.uor(get_validator_blinded_blocks)
.uor(get_validator_execution_payload_envelope)
.uor(get_validator_execution_payload_envelopes)
.uor(get_validator_attestation_data)
.uor(get_validator_payload_attestation_data)
.uor(get_validator_aggregate_attestation)
@@ -3463,8 +3463,8 @@ pub fn serve<T: BeaconChainTypes>(
.uor(post_beacon_blocks_v2_ssz)
.uor(post_beacon_blinded_blocks_ssz)
.uor(post_beacon_blinded_blocks_v2_ssz)
.uor(post_beacon_execution_payload_envelope_ssz)
.uor(post_beacon_execution_payload_bid_ssz)
.uor(post_beacon_execution_payload_envelopes_ssz)
.uor(post_beacon_execution_payload_bids_ssz)
.uor(post_beacon_pool_payload_attestations_ssz)
.uor(post_validator_proposer_preferences_ssz),
)
@@ -3480,8 +3480,8 @@ pub fn serve<T: BeaconChainTypes>(
.uor(post_beacon_pool_payload_attestations)
.uor(post_beacon_pool_bls_to_execution_changes)
.uor(post_validator_proposer_preferences)
.uor(post_beacon_execution_payload_envelope)
.uor(post_beacon_execution_payload_bid)
.uor(post_beacon_execution_payload_envelopes)
.uor(post_beacon_execution_payload_bids)
.uor(post_beacon_state_validators)
.uor(post_beacon_state_validator_balances)
.uor(post_beacon_state_validator_identities)

View File

@@ -12,8 +12,8 @@ use types::Slot;
use warp::http::Response;
use warp::{Filter, Rejection};
// GET validator/execution_payload_envelope/{slot}
pub fn get_validator_execution_payload_envelope<T: BeaconChainTypes>(
// GET validator/execution_payload_envelopes/{slot}
pub fn get_validator_execution_payload_envelopes<T: BeaconChainTypes>(
eth_v1: EthV1Filter,
chain_filter: ChainFilter<T>,
not_while_syncing_filter: NotWhileSyncingFilter,
@@ -21,7 +21,7 @@ pub fn get_validator_execution_payload_envelope<T: BeaconChainTypes>(
) -> ResponseFilter {
eth_v1
.and(warp::path("validator"))
.and(warp::path("execution_payload_envelope"))
.and(warp::path("execution_payload_envelopes"))
.and(warp::path::param::<Slot>().or_else(|_| async {
Err(warp_utils::reject::custom_bad_request(
"Invalid slot".to_string(),

View File

@@ -36,7 +36,7 @@ use types::{
use warp::{Filter, Rejection, Reply};
use warp_utils::reject::convert_rejection;
pub mod execution_payload_envelope;
pub mod execution_payload_envelopes;
/// Uses the `chain.validator_pubkey_cache` to resolve a pubkey to a validator
/// index and then ensures that the validator exists in the given `state`.