Skip to content

Commit f8e31f6

Browse files
authored
Increase rpc rate limits (#6626)
* Increase rate limits for byrange requests * Merge branch 'unstable' into reduce-blob-limits * Update limits
1 parent 1c8161f commit f8e31f6

File tree

1 file changed

+7
-8
lines changed
  • beacon_node/lighthouse_network/src/rpc

1 file changed

+7
-8
lines changed

beacon_node/lighthouse_network/src/rpc/config.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,14 @@ impl RateLimiterConfig {
104104
pub const DEFAULT_META_DATA_QUOTA: Quota = Quota::n_every(2, 5);
105105
pub const DEFAULT_STATUS_QUOTA: Quota = Quota::n_every(5, 15);
106106
pub const DEFAULT_GOODBYE_QUOTA: Quota = Quota::one_every(10);
107-
pub const DEFAULT_BLOCKS_BY_RANGE_QUOTA: Quota = Quota::n_every(1024, 10);
107+
// The number is chosen to balance between upload bandwidth required to serve
108+
// blocks and a decent syncing rate for honest nodes. Malicious nodes would need to
109+
// spread out their requests over the time window to max out bandwidth on the server.
110+
pub const DEFAULT_BLOCKS_BY_RANGE_QUOTA: Quota = Quota::n_every(128, 10);
108111
pub const DEFAULT_BLOCKS_BY_ROOT_QUOTA: Quota = Quota::n_every(128, 10);
109-
// `BlocksByRange` and `BlobsByRange` are sent together during range sync.
110-
// It makes sense for blocks and blobs quotas to be equivalent in terms of the number of blocks:
111-
// 1024 blocks * 6 max blobs per block.
112-
// This doesn't necessarily mean that we are sending this many blobs, because the quotas are
113-
// measured against the maximum request size.
114-
pub const DEFAULT_BLOBS_BY_RANGE_QUOTA: Quota = Quota::n_every(6144, 10);
115-
pub const DEFAULT_BLOBS_BY_ROOT_QUOTA: Quota = Quota::n_every(768, 10);
112+
// `DEFAULT_BLOCKS_BY_RANGE_QUOTA` * (target + 1) to account for high usage
113+
pub const DEFAULT_BLOBS_BY_RANGE_QUOTA: Quota = Quota::n_every(512, 10);
114+
pub const DEFAULT_BLOBS_BY_ROOT_QUOTA: Quota = Quota::n_every(512, 10);
116115
// 320 blocks worth of columns for regular node, or 40 blocks for supernode.
117116
// Range sync load balances when requesting blocks, and each batch is 32 blocks.
118117
pub const DEFAULT_DATA_COLUMNS_BY_RANGE_QUOTA: Quota = Quota::n_every(5120, 10);

0 commit comments

Comments
 (0)