Simplify payload traits and reduce cloning (#3976)

* Simplify payload traits and reduce cloning

* Fix self limiter
This commit is contained in:
Michael Sproul
2023-02-15 14:17:56 +11:00
committed by GitHub
parent 10d32ee04c
commit 918b688f72
9 changed files with 108 additions and 101 deletions

View File

@@ -60,6 +60,7 @@ impl<Id: ReqId, TSpec: EthSpec> SelfRateLimiter<Id, TSpec> {
goodbye_quota,
blocks_by_range_quota,
blocks_by_root_quota,
blobs_by_range_quota,
} = config;
let limiter = RateLimiter::builder()
@@ -69,6 +70,7 @@ impl<Id: ReqId, TSpec: EthSpec> SelfRateLimiter<Id, TSpec> {
.set_quota(Protocol::Goodbye, goodbye_quota)
.set_quota(Protocol::BlocksByRange, blocks_by_range_quota)
.set_quota(Protocol::BlocksByRoot, blocks_by_root_quota)
.set_quota(Protocol::BlobsByRange, blobs_by_range_quota)
// Manually set the LightClientBootstrap quota, since we use the same rate limiter for
// inbound and outbound requests, and the LightClientBootstrap is an only inbound
// protocol.