scrobble.life
Synergy Builders

The Witness Profile: The Config Knobs We Run on Hive-Engine and Why

Hey everyone,

A few people have reached out recently asking what settings we actually run in config.json on our witness node and why we chose them.

I touched on the early operator knobs in an earlier post, but back then we were just getting started. Now that Knobs A, B, C, and D have all been merged, and Knobs E has just been submitted as PR #142 after two weeks of live witness soak testing, it feels like the right time to share our full witness config.

screenshot-20261108-101934.png

The golden rule behind all of this work has remained constant: defaults preserve legacy behavior. If an operator updates the code and doesn’t touch their config.json, their node behaves byte-identically to how it always has.

These settings are what we call our "Witness Profile", values chosen specifically for a node whose primary job is signing blocks, calculating round hashes, and staying locked to the Hive head, rather than answering thousands of public API queries.


The Full Production Config

Here are the relevant sections from our live witness configuration:

{
  "maxJSVMs": 8,
  "databasePool": {
    "maxPoolSize": 20,
    "minPoolSize": 2,
    "maxIdleTimeMS": 30000,
    "waitQueueTimeoutMS": 10000
  },
  "lightNode": {
    "enabled": true,
    "blocksToKeep": 288000,
    "cleanupInterval": 600000,
    "adaptiveCleanup": true,
    "cleanupLagThreshold": 1000,
    "maxConsecutiveCleanupSkips": 3,
    "lastVerifiedBlockCacheTTL": 900000
  },
  "streamerConfig": {
    "antiForkBufferMaxSize": 5,
    "maxQps": 2,
    "lookaheadBufferSize": 15,
    "useBlockApi": true,
    "adaptiveQps": true,
    "adaptiveQpsMax": 4,
    "dynamicLookaheadBuffer": true,
    "dynamicLookaheadBufferMaxSize": 50
  },
  "p2pConfig": {
    "roundHashConcurrency": 5
  }
}

Here is the breakdown of why each value was chosen.


1. Smart Contracts & VM Pool (Knobs A & B)

"maxJSVMs": 8
  • Default: 5 (hardcoded previously)
  • Our value: 8

Smart contracts run inside isolated JavaScript virtual machines (isolated-vm). The legacy code hardcoded a ceiling of 5 isolates.

On a dedicated witness server with ample RAM, 5 is artificially tight if multiple transactions touch different contracts in short order. We bumped this to 8, which provides comfortable headroom for isolate reuse without bloating process memory. Combined with the lazy pre-warming added in Bundle B, all 8 isolates are warmed on the first contract execution so transactions don't pay cold-start allocation costs mid-round.


2. MongoDB Connection Pool (Knobs A)

"databasePool": {
  "maxPoolSize": 20,
  "minPoolSize": 2,
  "maxIdleTimeMS": 30000,
  "waitQueueTimeoutMS": 10000
}
  • Default: MongoDB driver defaults (typically max 100, min 0)
  • Our values: maxPoolSize: 20, minPoolSize: 2

A public RPC node serving external dApps might want 50-100 connections. But for a witness node processing blocks sequentially, allowing MongoDB to spawn dozens of idle connections just burns memory and socket descriptors.

  • maxPoolSize: 20: Plenty of connection bandwidth for block production, P2P peer requests, and streamer background lookups to run concurrently without ever contending for a socket.
  • minPoolSize: 2: Keeps baseline connections permanently open, avoiding connection-handshake latency on idle rounds.
  • waitQueueTimeoutMS: 10000: A safety valve so operations fail fast with a logged error rather than hanging indefinitely if the database ever locks up.

3. Block Streamer & Catch-Up Controls (Knobs C)

"streamerConfig": {
  "maxQps": 2,
  "adaptiveQps": true,
  "adaptiveQpsMax": 4,
  "lookaheadBufferSize": 15,
  "useBlockApi": true,
  "adaptiveQps": true,
  "adaptiveQpsMax": 4,
  "dynamicLookaheadBuffer": true,
  "dynamicLookaheadBufferMaxSize": 50
}
  • Default: maxQps: 1, lookaheadBufferSize: 5, adaptive features off.
  • Our values: Baseline QPS of 2, adaptive ceiling of 4, lookahead expanding up to 50.

The streamer pulls Hive blocks and feeds them to the sidechain pipeline. Previously, whether your node was sitting comfortably at the chain head or struggling 5,000 blocks behind after maintenance, it used the exact same conservative fetch rate.

  • adaptiveQps: true & adaptiveQpsMax: 4: When our 9 configured Hive RPC endpoints are healthy (0 failures in the last 5 minutes), the node steps up fetch concurrency to 4 in-flight requests per node. If any single RPC starts erroring or timing out, it automatically backs down to 2; if multiple fail, it drops to 1.
  • dynamicLookaheadBuffer: true & dynamicLookaheadBufferMaxSize: 50: The prefetch ring buffer scales with sync lag. Close to the head, it maintains a lean 15-block buffer. If we fall thousands of blocks behind, it expands to 50 blocks, keeping the CPU fed without stalling on network latency.

Just this morning, I had to restart the node service; it woke up 46 blocks behind, stepped QPS to 4, and returned to 0 blocks behind in under 4 minutes.


4. Adaptive Lite-Node Housekeeping (Knobs D)

"lightNode": {
  "enabled": true,
  "blocksToKeep": 288000,
  "cleanupInterval": 600000,
  "adaptiveCleanup": true,
  "cleanupLagThreshold": 1000,
  "maxConsecutiveCleanupSkips": 3,
  "lastVerifiedBlockCacheTTL": 900000into the `qa` branch
}
  • Default: Fixed 10-minute cleanup interval regardless of lag; no TTL cache.
  • Our values: Defer cleanup when >1,000 blocks behind, maximum 3 consecutive skips, 15-minute verification cache.

Pruning old blocks and transaction history is essential to keep a lite node’s disk footprint small. But running heavy delete operations while trying to catch up on a large backlog is counterproductive—it's vacuuming the carpet while the house is on fire.

  • adaptiveCleanup: true & cleanupLagThreshold: 1000: If our node is more than 1,000 blocks behind, it defers cleanup so 100% of disk I/O is dedicated to ingesting and verifying blocks.
  • maxConsecutiveCleanupSkips: 3: The safety ceiling. Even during a massive sync, the node will skip at most 3 cleanup cycles before forcing one through, ensuring disk usage never balloons unchecked.
  • lastVerifiedBlockCacheTTL: 900000 (15 minutes): Previously, every single cleanup pass queried MongoDB for lastVerifiedBlockNumber. Because rounds only complete every ~40 minutes, caching this lookup for 15 minutes saves redundant queries. And because verified height only increases, a cached value can only ever err on the side of retaining data, never deleting too much.

5. Round Proposition Resilience (Knobs E - PR #142)

"p2pConfig": {
  "roundHashConcurrency": 5
}
  • Default: 1 (sequential block fetching)
  • Our value: 5

When it's our turn to propose a witness round, the node has to calculate the round hash across the last 20+ sidechain blocks.

Previously, calculateRoundHash fetched every block document sequentially from MongoDB one by one. While the final hash must be calculated sequentially (each block depends on the previous block's hash), fetching the raw block data from local disk can be done in parallel.

  • roundHashConcurrency: 5: Fetches up to 5 blocks concurrently into memory, then folds the SHA-256 hashes sequentially in exact block-number order. This noticeably speeds up round proposition without touching consensus.
  • Exponential Backoff & Jitter: Under the hood, PR #142 also replaces linear retry delays with capped exponential backoff and random jitter. Across 3 retries, the cumulative backoff tops out at ~59 seconds, guaranteeing that even with four 10-second request timeouts, our proposition window stays comfortably under the 120-second round deadline.

Real-World Operational Results

Theory and benchmarks are fine, but in consensus software, uptime is the only metric that matters.

Over the past 9 days running this exact configuration on mainnet:

  • 255,868 blocks verified against the reference node with 0 hash mismatches.
  • 553 rounds proposed with 553 completed broadcasts (100% success rate, every round broadcast in < 1 second).
  • 614 rounds verified for peer witnesses.
  • 0 missed rounds attributable to our node.

Even during an unexpected router outage that temporarily severed WAN connectivity, the adaptive streamer stepped QPS down from 4 to 2 to 1, waited out the blip, and recovered the 25-block backlog in 37 seconds flat once connectivity returned.


A Note for Other Operators

These aren't universal magic numbers. If you run a high-volume public RPC endpoint, you will want a much larger connection pool (maxPoolSize: 50+) and you might keep roundHashConcurrency lower to avoid competing with client queries.

But if you are running a dedicated witness or a standby witness backup, this profile provides a proven, battle-tested balance: fast catch-up when you need it, low resource usage when you're synced, and reliable round timing.

All of Knobs A through D are live today, and Knobs E is up for review in PR #142.

Give them a try, and let me know how they run on your hardware.

As always,
Michael Garcia a.k.a. TheCrazyGM

Comments · 7

  • @worthmind(55)· 14d

    I do not run a node, so most of the config numbers fly over my head. But the defaults rule makes sense, update the code and nothing breaks for people who never touch the settings. That is the part I liked.

  • @hivebuzz(74)· 14d

    Congratulations @thecrazygm! Your post has been a top performer on the Hive blockchain and you have been rewarded with this rare badge

    Post with the highest payout of the day.

    You can view your badges on your board and compare yourself to others in the Ranking If you no longer want to receive notifications, reply to this comment with the word STOP

  • @kryptonita(71)· 14d

    Lo de "defaults preserve legacy behavior" es lo que más me cierra: si Knob E entra en PR #142 sin romper nodos que no tocan el config, el riesgo de fork por update se diluye. Los 288000 bloques del lightNode con cleanupLagThreshold en 1000 muestran que priorizás no perder el head sobre servir queries. ¿Los 2 QPS base con adaptive a 4 los mediste bajo algún pico de volumen real o quedó en soak tranquilo?

  • @pizzabot(60)· 14d

    PIZZA!

    $PIZZA slices delivered: @ecoinstant(1/20) tipped @thecrazygm

    Please vote for pizza.witness!

  • @ecoinstant(78)· 14d

    Excellent! And somehow E seems like the most exciting one yet 👀

    !PIMP !PIZZA !PAKX

  • @daimusic95(68)· 14d

    ⚡ NEW AIRDROP ALERT: DON'T SLEEP ON THIS!⚡

    Rumors are true—Hive is rewarding the community big time! If you missed the last major drop, consider this your redemption arc. 📈🔥

    Limited allocations are up for grabs for active holders, staking, curators, and delegators. High potential, zero heavy lifting.

    ⏳ Clock is ticking! Head over to the official CLAIM PAGE now.

    Prove you're early. Claim yours today! 💎🙌

  • @shadowanalyst(55)· 14d

    "Great write-up! This shows a really deep understanding of Hive-Engine and node optimization. The balance you've struck between fast catch-up and resource efficiency is exactly what any operator looks for. Looking forward to seeing PR #142 merged. Keep up the awesome work!"