From 83f32fbaa43190c0d3bcba252b06f1053290cc0a Mon Sep 17 00:00:00 2001 From: jonny rhea <5555162+jrhea@users.noreply.github.com> Date: Wed, 13 May 2026 18:10:22 -0500 Subject: [PATCH] eth/protocols/snap: move maxTrieRequestCount and batchSizeThreshold to sync_v1.go --- eth/protocols/snap/sync.go | 9 --------- eth/protocols/snap/sync_v1.go | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 4a83e2d127..d1d8c968c5 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -61,15 +61,6 @@ const ( // size should be maxRequestSize / 24K. Assuming that most contracts do not // come close to that, requesting 4x should be a good approximation. maxCodeRequestCount = maxRequestSize / (24 * 1024) * 4 - - // maxTrieRequestCount is the maximum number of trie node blobs to request in - // a single query. If this number is too low, we're not filling responses fully - // and waste round trip times. If it's too high, we're capping responses and - // waste bandwidth. - maxTrieRequestCount = maxRequestSize / 512 - - // batchSizeThreshold is the maximum size allowed for gentrie batch. - batchSizeThreshold = 8 * 1024 * 1024 ) var ( diff --git a/eth/protocols/snap/sync_v1.go b/eth/protocols/snap/sync_v1.go index cd88d4194d..083ced453b 100644 --- a/eth/protocols/snap/sync_v1.go +++ b/eth/protocols/snap/sync_v1.go @@ -39,6 +39,15 @@ import ( ) const ( + // maxTrieRequestCount is the maximum number of trie node blobs to request in + // a single query. If this number is too low, we're not filling responses fully + // and waste round trip times. If it's too high, we're capping responses and + // waste bandwidth. + maxTrieRequestCount = maxRequestSize / 512 + + // batchSizeThreshold is the maximum size allowed for gentrie batch. + batchSizeThreshold = 8 * 1024 * 1024 + // trienodeHealRateMeasurementImpact is the impact a single measurement has on // the local node's trienode processing capacity. A value closer to 0 reacts // slower to sudden changes, but it is also more stable against temporary hiccups.