mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Use max request payloads
This commit is contained in:
@@ -530,7 +530,7 @@ impl PayloadEnvelopesByRootRequest {
|
||||
) -> Result<Self, String> {
|
||||
let max_requests_envelopes = fork_context
|
||||
.spec
|
||||
.max_request_blocks(fork_context.current_fork_name());
|
||||
.max_request_payloads(fork_context.current_fork_name());
|
||||
|
||||
let beacon_block_roots =
|
||||
RuntimeVariableList::new(beacon_block_roots, max_requests_envelopes).map_err(|e| {
|
||||
|
||||
@@ -423,6 +423,12 @@ impl SupportedProtocol {
|
||||
ProtocolId::new(SupportedProtocol::DataColumnsByRangeV1, Encoding::SSZSnappy),
|
||||
]);
|
||||
}
|
||||
if fork_context.fork_exists(ForkName::Gloas) {
|
||||
supported.extend_from_slice(&[
|
||||
ProtocolId::new(SupportedProtocol::PayloadEnvelopesByRangeV1, Encoding::SSZSnappy),
|
||||
ProtocolId::new(SupportedProtocol::PayloadEnvelopesByRootV1, Encoding::SSZSnappy),
|
||||
]);
|
||||
}
|
||||
supported
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +295,7 @@ pub struct ChainSpec {
|
||||
/*
|
||||
* Networking Gloas
|
||||
*/
|
||||
pub max_request_payloads: u64,
|
||||
|
||||
/*
|
||||
* Networking Derived
|
||||
@@ -700,6 +701,10 @@ impl ChainSpec {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn max_request_payloads(&self) -> usize {
|
||||
self.max_request_payloads as usize
|
||||
}
|
||||
|
||||
pub fn max_request_blob_sidecars(&self, fork_name: ForkName) -> usize {
|
||||
if fork_name.electra_enabled() {
|
||||
self.max_request_blob_sidecars_electra as usize
|
||||
@@ -1228,6 +1233,7 @@ impl ChainSpec {
|
||||
builder_payment_threshold_numerator: 6,
|
||||
builder_payment_threshold_denominator: 10,
|
||||
min_builder_withdrawability_delay: Epoch::new(4096),
|
||||
max_request_payloads: 128,
|
||||
|
||||
/*
|
||||
* Network specific
|
||||
@@ -1622,7 +1628,8 @@ impl ChainSpec {
|
||||
builder_payment_threshold_numerator: 6,
|
||||
builder_payment_threshold_denominator: 10,
|
||||
min_builder_withdrawability_delay: Epoch::new(4096),
|
||||
|
||||
max_request_payloads: 128,
|
||||
|
||||
/*
|
||||
* Network specific
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user