[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FJ1KEXPT8M8H3J21X2X0JC":3,"skill-same:01M6FJ1KEXPT8M8H3J21X2X0JC":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6FJ1KEXPT8M8H3J21X2X0JC","subsystem-summary-of-util",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fstellar\u002Fstellar-core\u002Fsubsystem-summary-of-util\u002FSKILL.md",[],[18,19],"summary","subsystem summary of util","2026-11-10 10:12:30",false,"# Util Subsystem — Technical Summary\n\nThe `src\u002Futil\u002F` directory provides foundational infrastructure used across all of stellar-core. It covers timing, scheduling, logging, numeric safety, filesystem operations, serialization, data structures, threading, and various small helpers.\n\n---\n\n## 1. Virtual Clock & Timers (`Timer.h`, `Timer.cpp`)\n\n### `VirtualClock`\nCentral timing facility with two modes: `REAL_TIME` (wall clock) and `VIRTUAL_TIME` (simulated, for tests). Owns an `asio::io_context` for IO dispatch and a `Scheduler` for main-thread action scheduling.\n\n- **Key types**: `time_point` (steady clock), `system_time_point` (wall\u002Fcalendar time), `duration`.\n- **`crank(bool block)`**: The main event-loop step. Dispatches pending timers, polls IO (with exponential priority biasing under overload), runs scheduled actions, and transfers items from the thread-safe pending queue to the scheduler. In `VIRTUAL_TIME` mode, advances time to the next event if idle.\n- **`postAction()`**: Thread-safe submission point for deferred work callbacks. Uses a mutex-protected pending queue; wakes the main thread via `asio::post` when enqueueing into an empty queue.\n- **`setCurrentVirtualTime()`**: Advance virtual time forward (monotonic; asserts forward progress).\n- **`sleep_for()`**: Real sleep in `REAL_TIME`, virtual time advance in `VIRTUAL_TIME`.\n- **`shouldYield()`**: In `REAL_TIME`, returns true after 500ms has elapsed (time-slice limit). Always returns true in `VIRTUAL_TIME`.\n- **Time conversion helpers**: `to_time_t`, `from_time_t`, `systemPointToTm`, `tmToSystemPoint`, `isoStringToTm`, `tmToISOString`, `systemPointToISOString`.\n\n### `VirtualTimer`\nTimer coupled to a `VirtualClock` that uses virtual time. Supports `expires_at()`, `expires_from_now()`, `async_wait()`, `cancel()`. Typical usage for all delayed \u002F periodic operations in core.\n\n### `VirtualClockEvent`\nInternal event representation stored in the clock's priority queue. Carries a callback, trigger time, sequence number, and cancelled state.\n\n---\n\n## 2. Scheduler (`Scheduler.h`, `Scheduler.cpp`)\n\nA multi-queue fair scheduler implementing a variant of the LAS (Least Attained Service) \u002F FB (Foreground-Background) algorithm.\n\n### Design\n- Multiple named `ActionQueue`s each track cumulative runtime (`mTotalService`).\n- On each `runOne()`, the queue with the **lowest** accumulated service time runs its next action.\n- A latency window (default 5s) serves three roles: (1) credit cap to prevent bursty monopolization, (2) overload detection threshold, (3) idle queue expiration.\n- Droppable actions are shed under overload (queue time exceeds latency window).\n\n### `ActionQueue` (private inner class)\n- Stores a deque of `Element{Action, enqueueTime}`.\n- Tracks `mTotalService`, `mLastService`, idle list membership.\n- `tryTrim()`: drops droppable actions that exceed the latency window.\n- `runNext()`: runs the front action and updates total service (floored at `minTotalService`).\n\n### `Scheduler` public interface\n- `enqueue(name, action, type)`: Creates or reactivates a queue and appends the action.\n- `runOne()`: Dequeues from the lowest-service queue, trims stale idle queues.\n- `getOverloadedDuration()`: Reports how long any queue has been overloaded.\n- `currentActionType()`: Returns the `ActionType` of the currently executing action.\n- `shutdown()`: Clears all queues.\n\n---\n\n## 3. Logging (`Logging.h`, `Logging.cpp`, `SpdlogTweaks.h`, `LogPartitions.def`)\n\n### `Logging` class\nStatic utility managing spdlog-based logging with partitioned loggers.\n\n- **Partitions**: Defined in `LogPartitions.def` via X-macro (`LOG_PARTITION(name)`), yielding ~15 named partitions (e.g., Bucket, Herder, Ledger, Overlay, Tx, etc.). Each partition has its own spdlog logger with independent log level.\n- **`init()`**: Creates sinks (stderr + optional file), registers all partition loggers, configures flush behavior (every 1s, immediate on error). Also initializes Rust-side logging.\n- **`setLogLevel(level, partition)`**: Per-partition or global level setting.\n- **`setLoggingToFile(filename)`**: Supports `{datetime}`-formatted filenames. Opens in append mode (`O_APPEND`) for durability with external log rotation.\n- **`setFmt(peerID)`**: Sets the log pattern including a peer identifier.\n- **`rotate()`**: Log rotation support.\n\n### Log macros\n- `CLOG_TRACE\u002FDEBUG\u002FINFO\u002FWARNING\u002FERROR\u002FFATAL(partition, fmt, ...)`: Partition-aware logging with compile-time format string checking via `FMT_STRING`.\n- `LOG_TRACE\u002FDEBUG\u002FINFO\u002FWARNING\u002FERROR\u002FFATAL(logger, fmt, ...)`: Logger-handle-based logging.\n- `LOG_CHECK`: Guards log calls with `should_log()` check to avoid formatting overhead.\n\n### `CoutLogger`\nFallback logger when spdlog is not available. Writes to `std::cout`.\n\n### `LogLevel` enum\n`LVL_FATAL(0)` through `LVL_TRACE(5)`.\n\n### `format_as` overloads\nProvides `fmt`-compatible formatting for XDR enum types and `std::filesystem::path`.\n\n---\n\n## 4. Numeric Utilities (`numeric.h`, `numeric.cpp`, `numeric128.h`)\n\nSafe arithmetic for financial calculations where overflow matters.\n\n### 64-bit operations (`numeric.h`)\n- **`bigDivide(result, A, B, C, rounding)`**: Computes `A*B\u002FC` safely when `A*B` would overflow `int64_t`. Returns success\u002Ffailure bool.\n- **`bigDivideOrThrow(A, B, C, rounding)`**: Throwing variant.\n- **`bigDivideUnsigned()`**: Unsigned variant.\n- **`bigSquareRoot(a, b)`**: Integer square root of `a*b`, `ROUND_DOWN` only.\n- **`saturatingMultiply(a, b)`**: Caps at `INT64_MAX` on overflow (non-negative inputs).\n- **`saturatingAdd(a, b)`**: Unsigned, caps at type max.\n- **`isRepresentableAsInt64(double)`**: Checks safe double→int64 conversion.\n- **`doubleToClampedUint32(double)`**: Clamps double to uint32 range.\n- **`Rounding` enum**: `ROUND_DOWN`, `ROUND_UP`.\n\n### 128-bit operations (`numeric128.h`)\n- **`bigMultiply(a, b)` \u002F `bigMultiplyUnsigned(a, b)`**: Returns `uint128_t`.\n- **`bigDivide128()` \u002F `bigDivideUnsigned128()`**: Divide 128-bit by 64-bit.\n- **`hugeDivide(result, a, B, C, rounding)`**: Computes `a*B\u002FC` when `C \u003C INT32_MAX * INT64_MAX`.\n\n---\n\n## 5. Filesystem Utilities (`Fs.h`, `Fs.cpp`, `FileSystemException.h`, `TmpDir.h`)\n\n### `fs` namespace\n- **File locking**: `lockFile()` \u002F `unlockFile()` using `flock` (POSIX) or `CreateFile` (Win32).\n- **Durable I\u002FO**: `flushFileChanges()` (fsync), `durableRename()` (rename + dir fsync), `openFileToWrite()`.\n- **Directory ops**: `exists()`, `deltree()`, `mkdir()`, `mkpath()` (recursive), `findfiles()`.\n- **Path construction**: `hexStr()`, `hexDir()`, `baseName()`, `remoteName()`, `remoteDir()` — used for history archive paths.\n- **Handle counting**: `getMaxHandles()`, `getOpenHandleCount()` — Linux reads `\u002Fproc\u002Fself\u002Ffd`.\n- **`bufsz()`**: Returns 256KB (AWS EBS IOP alignment).\n\n### `FileSystemException`\nExtends `std::runtime_error` with `failWith()` and `failWithErrno()` static helpers that log before throwing.\n\n### `TmpDir` \u002F `TmpDirManager`\nRAII temporary directory management. `TmpDirManager` creates and cleans a root directory; `TmpDir` creates prefixed subdirectories that are deleted on destruction.\n\n---\n\n## 6. XDR Stream I\u002FO (`XDRStream.h`)\n\n### `XDRInputFileStream`\nReads XDR-framed objects from a file one at a time.\n- `readOne(T& out, SHA256* hasher)`: Reads 4-byte big-endian size header, then that many bytes, unmarshals into `out`. Optional hash accumulation.\n- `readPage(T& out, key, pageSize)`: Reads a page-sized chunk and scans for a specific `LedgerKey`. Used for indexed bucket lookups.\n- Supports `seek()`, `pos()`, size limits.\n\n### `OutputFileStream`\nLow-level durable write stream using ASIO buffered writes (POSIX) or `FILE*` (Win32).\n- `writeBytes()`, `flush()`, `close()` with optional fsync on close.\n- Cross-platform via `fs::stream_t` \u002F `fs::native_handle_t`.\n\n### `XDROutputFileStream`\nExtends `OutputFileStream` with XDR framing.\n- `writeOne(T, hasher, bytesPut)`: Encodes 4-byte size header + XDR payload. Optional hash and byte counting.\n- `durableWriteOne()`: `writeOne` + flush + fsync for crash safety.\n\n---\n\n## 7. Data Structures\n\n### `RandomEvictionCache\u003CK, V>` (`RandomEvictionCache.h`)\nFixed-size cache with random-2-choices eviction (not LRU). More robust under pathological access patterns.\n- Stores entries in `unordered_map` with stable pointers in a `vector` for random access.\n- Tracks generation counter for last-access ordering.\n- `put()`, `get()`, `maybeGet()`, `exists()`, `erase_if()`, `clear()`.\n- Maintains hit\u002Fmiss\u002Finsert\u002Fupdate\u002Fevict counters.\n\n### `BitSet` (`BitSet.h`)\nValue-semantic C++ wrapper around a C bitset (`cbitset.h`). Uses inline storage for small sets (≤64 bits) to avoid heap allocation.\n- Full set operations: union (`|`), intersection (`&`), difference (`-`), symmetric difference.\n- Counting variants: `unionCount()`, `intersectionCount()`, etc.\n- Iteration: `nextSet(i)` for scanning set bits.\n- Hash function support via `BitSet::HashFunction`.\n\n### `UnorderedMap\u003CK, V>` \u002F `UnorderedSet\u003CK>` (`UnorderedMap.h`, `UnorderedSet.h`)\nType aliases for `std::unordered_map` \u002F `std::unordered_set` using `RandHasher` to prevent hash-flooding attacks.\n\n### `BinaryFuseFilter\u003CT>` (`BinaryFuseFilter.h`, `BinaryFuseFilter.cpp`)\nProbabilistic membership-test filter (like Bloom filter but more space-efficient). Wraps `binary_fuse_t` library. Supports 8\u002F16\u002F32-bit widths with corresponding false-positive rates (1\u002F256, 1\u002F65536, 1\u002F4B). Serializable via cereal to `SerializedBinaryFuseFilter` XDR type. Used for efficient key-membership checks in bucket indexes.\n\n### `TarjanSCCCalculator` (`TarjanSCCCalculator.h`)\nTarjan's algorithm for computing strongly connected components of a directed graph. Uses `BitSet` for SCC representation. Used in quorum analysis (SCP).\n\n---\n\n## 8. Threading Utilities\n\n### `ThreadAnnotations.h`\nComprehensive Clang thread-safety annotation macros (`GUARDED_BY`, `REQUIRES`, `ACQUIRE`, `RELEASE`, `TRY_ACQUIRE`, etc.). Provides annotated mutex wrappers:\n- **`Mutex`**: Wraps `std::mutex` with annotations.\n- **`SharedMutex`**: Wraps `std::shared_mutex` with `Lock()`\u002F`LockShared()`.\n- **`RecursiveMutex`**: Wraps `std::recursive_mutex`.\n- **`MutexLocker` \u002F `RecursiveMutexLocker` \u002F `SharedLockExclusive` \u002F `SharedLockShared`**: RAII lock guards with annotations.\n\n### `GlobalChecks.h` \u002F `GlobalChecks.cpp`\n- **`threadIsMain()`**: Checks if current thread is the main thread (captured at static init).\n- **`releaseAssert(e)`**: Assert that is NOT compiled out by `NDEBUG`. Prints backtrace and aborts.\n- **`releaseAssertOrThrow(e)`**: Like `releaseAssert` but throws `runtime_error` instead of aborting.\n- **`dbgAssert(e)`**: Debug-only assert.\n- **`LockGuard` \u002F `RecursiveLockGuard`**: Aliases that adapt between Tracy-instrumented and plain lock guards.\n\n### `Thread.h` \u002F `Thread.cpp`\n- `runCurrentThreadWithLowPriority()` \u002F `runCurrentThreadWithMediumPriority()`: OS-level thread priority adjustment.\n- `futureIsReady(std::future|std::shared_future)`: Non-blocking readiness check.\n\n### `JitterInjection.h` \u002F `JitterInjection.cpp`\nTesting framework for probabilistic thread-delay injection (enabled via `BUILD_THREAD_JITTER`).\n- `JitterInjector::injectDelay(probability, minUsec, maxUsec)`: Probabilistically sleeps to expose race conditions.\n- `JITTER_INJECT_DELAY()`, `JITTER_YIELD()` macros: Compile to no-ops in production.\n- Reproducible via seeded RNG tied to test seed.\n\n### `NonCopyable.h`\nBase structs: `NonCopyable`, `NonMovable`, `NonMovableOrCopyable` — disable copy\u002Fmove semantics via deleted special members.\n\n---\n\n## 9. Metrics & Performance Monitoring\n\n### `MetricsRegistry` (`MetricsRegistry.h`, `MetricsRegistry.cpp`)\nExtends `medida::MetricsRegistry` with `SimpleTimer` support. `NewSimpleTimer()` registers lightweight timers. `syncSimpleTimerStats()` syncs max values (called on `\u002Fmetrics` endpoint).\n\n### `SimpleTimer` \u002F `SimpleTimerContext` (`SimpleTimer.h`, `SimpleTimer.cpp`)\nLightweight replacement for `medida::Timer` using counters (sum, count, max). Avoids histogram overhead. Uses `medida::Counter` internally for metric export. `TimeScope()` returns an RAII context for automatic timing.\n\n### `MetricResetter` (`MetricResetter.h`, `MetricResetter.cpp`)\nImplements `medida::MetricProcessor` to reset all metric types (Counter, Meter, Histogram, Timer, Buckets).\n\n### `LogSlowExecution` (`LogSlowExecution.h`, `LogSlowExecution.cpp`)\nRAII guard that logs a warning if a scope takes longer than a threshold (default 1 second). Two modes:\n- `AUTOMATIC_RAII`: Logs on destructor.\n- `MANUAL`: Caller checks `checkElapsedTime()`.\n- `RateLimitedLog`: Subclass with zero threshold for rate-limited logging.\n\n---\n\n## 10. Type Utilities (`types.h`, `types.cpp`)\n\nCore type definitions and helpers for XDR\u002FStellar types.\n- **`Blob`**: `std::vector\u003Cunsigned char>`.\n- **`LedgerKeySet`**: `std::set\u003CLedgerKey, LedgerEntryIdCmp>`.\n- **`LedgerEntryKey(LedgerEntry)`**: Extracts the key from an entry.\n- **Asset helpers**: `assetToString()`, `getIssuer()`, `isIssuer()`, `assetCodeToStr()`, `strToAssetCode()`, `isAssetValid()`, `compareAsset()`.\n- **`getBucketLedgerKey()`**: Extracts `LedgerKey` from `BucketEntry` or `HotArchiveBucketEntry`.\n- **`addBalance(balance, delta, max)`**: Safe balance addition with overflow check.\n- **`isZero(uint256)`**, **`lessThanXored()`**: Hash\u002FXOR comparison helpers.\n- **`unsignedToSigned()`**: Safe conversion with overflow check.\n- **`formatSize()`**: Human-readable size formatting.\n- **`iequals()`**: Case-insensitive string comparison.\n- **Price comparison operators**: `>=`, `>`, `==`.\n- **ASCII helpers**: `isAsciiAlphaNumeric()`, `isAsciiNonControl()`, `toAsciiLower()` — locale-independent.\n- **`roundDown(v, m)`**: Round down to largest multiple of power-of-2.\n\n---\n\n## 11. Resource Tracking (`TxResource.h`, `TxResource.cpp`)\n\n### `Resource`\nMulti-dimensional resource vector for transaction resource accounting (operations, instructions, byte sizes, ledger entries). Supports:\n- 1-element (classic), 2-element (classic with bytes), or 7-element (Soroban) resource tuples.\n- Arithmetic: `+=`, `-=`, `+`, `-`, with overflow-safe `bigDivideOrThrow`.\n- Comparisons: `\u003C=`, `==`, `>`, `anyLessThan()`, `anyGreater()`.\n- `subtractNonNegative()`, `limitTo()`, `saturatedMultiplyByDouble()`.\n- `Resource::Type` enum: `OPERATIONS`, `INSTRUCTIONS`, `TX_BYTE_SIZE`, `DISK_READ_BYTES`, `WRITE_BYTES`, `READ_LEDGER_ENTRIES`, `WRITE_LEDGER_ENTRIES`.\n\n---\n\n## 12. XDR Query Engine (`xdrquery\u002F`)\n\nA mini query language for filtering XDR objects by field values.\n\n### Components\n- **`XDRFieldResolver.h`**: Template-based XDR field traversal using `xdr_traits`. Resolves dotted field paths (e.g., `\"data.account.balance\"`) to values. Handles unions, enums, public keys (string representation), opaque arrays (hex).\n- **`XDRQueryEval.h`**: Expression evaluation engine. `EvalNode` hierarchy: `LiteralNode`, `ColumnNode`, `BoolOpNode` (AND\u002FOR\u002FNOT), `ComparisonOpNode` (==, !=, \u003C, >, \u003C=, >=). `DynamicXDRGetter` interface for runtime field access.\n- **`XDRQuery.h`**: `TypedDynamicXDRGetterResolver\u003CT>` connects XDR types to the query engine. `matchXDRQuery()` function parses and evaluates queries against XDR objects.\n- **`XDRQueryError.h`**: Exception type for query parsing\u002Fevaluation errors.\n\n---\n\n## 13. Serialization Helpers\n\n### `XDRCereal.h` \u002F `XDRCereal.cpp`\nCustom `cereal_override` functions for human-readable JSON serialization of XDR types. Overrides for: public keys (StrKey), assets (code+issuer), enums (string names), opaque data (hex), optional pointers (null handling), SCAddress, MuxedAccount, ConfigUpgradeSetKey.\n- `xdrToCerealString(t, name, compact)`: Serialize any XDR type to JSON string.\n\n### `BufferedAsioCerealOutputArchive.h`\nCustom cereal output archive that writes through `OutputFileStream` (supporting fsync) instead of `std::ofstream`.\n\n### `XDROperators.h`\nImports `xdr::operator==` and `xdr::operator\u003C` into the `stellar` namespace.\n\n---\n\n## 14. Hashing Utilities\n\n### `RandHasher\u003CT>` (`RandHasher.h`)\nHash functor that XORs the output of `std::hash\u003CT>` with a random mixer value (initialized once at startup). Prevents hash-flooding DoS attacks on hash tables.\n\n### `HashOfHash` (`HashOfHash.h`, `HashOfHash.cpp`)\nSpecialization of `std::hash\u003Cstellar::uint256>` for use in hash maps keyed by transaction\u002Fledger hashes.\n\n---\n\n## 15. Protocol Version Utilities (`ProtocolVersion.h`, `ProtocolVersion.cpp`)\n\n### `ProtocolVersion` enum\nEnumerates all protocol versions `V_0` through `V_26`.\n\n### Comparison functions\n- `protocolVersionIsBefore(version, beforeVersion)`: Strictly less than.\n- `protocolVersionStartsFrom(version, fromVersion)`: Greater than or equal.\n- `protocolVersionEquals(version, equalsVersion)`: Exact match.\n\n### Notable constants\n- `SOROBAN_PROTOCOL_VERSION = V_20`\n- `PARALLEL_SOROBAN_PHASE_PROTOCOL_VERSION = V_23`\n- `AUTO_RESTORE_PROTOCOL_VERSION = V_23`\n\n---\n\n## 16. Other Utilities\n\n### `StatusManager` (`StatusManager.h`)\nManages status messages by category (`HISTORY_CATCHUP`, `HISTORY_PUBLISH`, `NTP`, `REQUIRES_UPGRADES`). Used for the `\u002Finfo` JSON endpoint.\n\n### `SecretValue` (`SecretValue.h`)\nWrapper around `std::string` to prevent accidental logging of sensitive values (DB passwords, secret keys).\n\n### `Decoder.h`\nBase32\u002FBase64 encoding and decoding helpers (`encode_b32`, `encode_b64`, `decode_b32`, `decode_b64`).\n\n### `Math.h` \u002F `Math.cpp`\nRandom number utilities: `rand_fraction()`, `rand_flip()`, `rand_uniform()`, `rand_element()`, `k_means()`, `closest_cluster()`, `exponentialBackoff()`. `initializeAllGlobalState()` initializes all PRNG and hash seeds. `reinitializeAllGlobalStateWithSeed()` (test-only) resets for reproducibility.\n\n### `MetaUtils.h` \u002F `MetaUtils.cpp`\n`normalizeMeta()`: Sorts order-agnostic fields in `TransactionMeta` \u002F `LedgerCloseMeta` for deterministic comparison\u002Fhashing.\n\n### `DebugMetaUtils.h` \u002F `DebugMetaUtils.cpp`\nManages debug meta-data files (XDR segments of ledger metadata). Handles file naming, path construction, listing, and cleanup based on configurable segment sizes (256 ledgers).\n\n### `Backtrace.h` \u002F `Backtrace.cpp`\n`printCurrentBacktrace()`: Prints stack trace via the Rust bridge.\n\n### `must_use.h`\n`MUST_USE` macro: Maps to `__attribute__((warn_unused_result))` where supported.\n\n### `Algorithm.h`\n`split()` function template: Splits a vector into a map of vectors keyed by an extractor function.\n\n### `asio.h`\nCorrectly configures and includes ASIO headers with proper preprocessor definitions (`ASIO_SEPARATE_COMPILATION`, `ASIO_STANDALONE`). Must be included before other system headers.\n\n### `TcmallocConfig.cpp`\nTcmalloc configuration (if tcmalloc is the allocator).\n\n---\n\n## Key Data Flows\n\n1. **Main event loop**: `VirtualClock::crank()` → dispatches timers → polls ASIO IO → runs `Scheduler::runOne()` → transfers pending actions from thread-safe queue to scheduler.\n\n2. **Cross-thread work submission**: Any thread → `VirtualClock::postAction()` (mutex-protected queue) → main thread dequeues into `Scheduler` → fair-scheduled execution.\n\n3. **XDR file I\u002FO**: Write path: `XDROutputFileStream::writeOne()` → 4-byte size header + XDR marshal → buffered write → optional fsync. Read path: `XDRInputFileStream::readOne()` → read size header → read payload → XDR unmarshal.\n\n4. **Metrics flow**: Code uses `medida::Timer`\u002F`SimpleTimer` → `MetricsRegistry` collects → `syncSimpleTimerStats()` synchronizes max tracking → exported via `\u002Fmetrics` endpoint.\n\n5. **Resource accounting**: `Resource` vectors created per-transaction → arithmetic operations check against ledger limits → `anyGreater()`\u002F`\u003C=` comparisons for admission control.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fstellar\u002Fstellar-core\u002Fsubsystem-summary-of-util",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill subsystem-summary-of-util",{"tool":39,"command":40},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill subsystem-summary-of-util",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill subsystem-summary-of-util","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fstellar\u002Fstellar-core\u002Fsubsystem-summary-of-util\u002FSKILL.md",true,[],[48,57,66,75,81,87],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":20},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[54,55,56],"model","model hierarchy","model hierarchy skill",{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":20},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[63,64,65],"MCP","zoom","zoom mcp",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":20},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[72,73,74,64],"sdk","zoom apps sdk","apps",{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":20},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[77],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[83],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[89]]