Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31

doc/roots-v31-port-review.md

Before: doc/roots-v31-port-review.md · After: doc/roots-v31-port-review.md

File metadata
index 0a0a6ca759a62ab091751e6a6246df35262dbef1..778324d7aa8c24174b1626fce8da5d44ee8f97b6 100644

Download original patch · Release notes

Diff rows 1–99 of 99. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

doc/roots-v31-port-review.md CHANGED
@@ -724,3 +724,99 @@ and synthetic regtest fee-estimator limitations. Linux/Xvfb evidence does not
724
724
  establish Windows/macOS rendering, physical-DPI scaling, complete secret erasure
725
725
  or exhaustive races. The full applicable L11 acceptance sweep remains the next
726
726
  root-directed gate. Credits remain Jaromil, devjoinedthechat, Core and Knots.
727
+
728
+
729
+ ## L12.1 operator schemas and configuration integration
730
+
731
+ The accepted effective-policy object and help are retained, with immutable
732
+ `MemPoolOptions::weight_per_data_byte` and `reject_spk_reuse` replacing source
733
+ process globals. Reporting stays within `MempoolInfoToJSON`'s existing mempool
734
+ lock; live dust publication and admission use the same authoritative rate.
735
+ No further snapshot refactor is justified: L4 supplied no refactor, and v31's
736
+ existing standardness snapshot already provides the required lifetime boundary.
737
+ Native `limitclustercount`, `limitclustersize` and `optimal` fields are preserved.
738
+
739
+ `uptime` is adopted upstream: v31 initializes its steady-clock source at startup
740
+ and returns integer elapsed seconds. `rpc_uptime.py` retains upstream's
741
+ wall-clock-jump coverage. Statistics model, schema, options declarations and unit
742
+ coverage are retained dormant; production registration, sampling and startup
743
+ option setup remain absent. A functional assertion requires `getmempoolstats`
744
+ to remain unavailable. Historical sample spacing, relative seconds, periodic
745
+ cleanup and memory target semantics are preserved, with no interpolation.
746
+
747
+ Roots read/write text config is restored before settings initialization, using
748
+ network-datadir `bitcoin_rw.conf` or the selected `confrw` path. Forced settings,
749
+ CLI, read/write config, JSON, network section and default section retain their
750
+ established order; scalar CLI selects its last value and text config its first
751
+ after negation. Source text config's flat key interpretation is retained even
752
+ when the file contains section headers. Config diagnostics redact sensitive
753
+ values through the existing argument logger. Numeric JSON Boolean getters
754
+ retain the source conversion behavior (zero false, nonzero true), with existing
755
+ scalar getter regression cases adapted accordingly. Writes use v31's native filesystem
756
+ path bridge; input-read and output open/close failures cannot replace the old
757
+ file or publish changed settings, and failed
758
+ reset removal is diagnosed correctly. These bounded adaptations avoid carrying
759
+ source's unchecked stream failure and inverted removal check into new code.
760
+ Read/write config is cleared on reread, and prune-state access takes the args lock.
761
+
762
+ Integrated `confrw` precedence gates previously owned by L7 and L11 are now
763
+ covered by `feature_policy_args.py`, `rpc_effective_policy.py` and
764
+ `wallet_sweepprivkeys.py`: effective strict parsing, JSON/config/CLI selection,
765
+ reported relay fee and sweep required-fee checks. Sweep retains source
766
+ `relayMinFee` semantics for its output dust guard; the runtime port does not
767
+ change that wallet contract. Ordinary config tests and
768
+ source stream-format tests remain applicable. Runtime-resource safeguards and
769
+ platform evidence are described in L12.2 below.
770
+
771
+
772
+ L12.1 review correction distinguishes valid EOF from `badbit` and non-EOF
773
+ failure in the newline-preserving reader, including partial final lines and
774
+ the invalid-line rewind/comment-copy path. Valid EOF state is cleared before
775
+ rewinding a final invalid line without a newline. Ordinary configuration parsing
776
+ also rejects failed reads before publishing parsed values; an existing unreadable
777
+ read/write file fails initialization. Deterministic failing-stream regressions
778
+ cover initial, partial-line and post-rewind failures; file-boundary coverage
779
+ preserves an unreadable input directory and its in-memory setting, removing only
780
+ the temporary output. Empty inputs and ordinary final lines without a newline
781
+ remain accepted. Dormant statistics are unchanged by this correction.
782
+
783
+
784
+ ### L12.2 runtime-resource adaptation
785
+
786
+ The source runtime commit `85257a0986d841cb2f6a8db1eb4902e92cfa94f5`
787
+ provides the active allocation, file-descriptor and GiB safeguards. Allocation
788
+ preserves existing bytes across repeated fallback chunks and repositions update
789
+ streams between reads and writes. Requests inside an existing file do not
790
+ truncate it. The Windows branch checks existing length before extension; the
791
+ source's disabled Apple-specific truncate path is replaced by the common
792
+ preserving fallback. FD results saturate at `INT_MAX`, including infinite limits,
793
+ and GiB conversion uses checked shifts and a `size_t` bound.
794
+
795
+ `GetTotalRAM` has identical supported-platform detection and unknown-result
796
+ semantics in source and v31. Explicit `dbcache` conversion, its 32-bit 1 GiB cap,
797
+ 4 MiB minimum, warning thresholds (450 MiB below 2 GiB RAM, otherwise 75%) and
798
+ failure fallback remain native. v31's upstream default is deliberately retained:
799
+ 1 GiB on 64-bit hosts reporting at least 4 GiB RAM; 450 MiB otherwise, including
800
+ unknown RAM. This differs from source's fixed 450 MiB default. Retaining the native default
801
+ is an accepted compatibility decision, not evidence of exact default equivalence.
802
+
803
+ Source `mempressure`, I/O-priority, sequential-advice and close/uncache helpers
804
+ have no production callers. Its low-memory threshold has no setter and remains
805
+ zero. Omitting these unused helpers is an accepted compatibility decision; no collection,
806
+ pressure response, I/O scheduling or cache eviction service is activated.
807
+ The active allocation helper remains advisory; failures may leave allocation
808
+ incomplete, but reads must not clobber existing bytes.
809
+
810
+ Reporting returns owned JSON under the existing mempool lock; live dust updates
811
+ and standardness snapshots use that same recursive lock. Startup policy values
812
+ remain immutable after RPC warmup. The bounded publication regression also reads
813
+ the JSON policy while dust updates run, then joins its reader before destroying
814
+ the pool. Dormant statistics retain their source model and lifetime, without
815
+ production singleton calls, signals or concurrent consumers. No new runtime
816
+ mutex, singleton initialization or snapshot refactor is required.
817
+
818
+ Linux GCC builds and Clang checks are the locally supported evidence. Windows,
819
+ macOS, BSD and 32-bit execution are not proved by these runs; their conditional
820
+ branches are retained from the source/native APIs, with the Windows file-size
821
+ comparison expressed through `LARGE_INTEGER::QuadPart`. Whole-L12 acceptance
822
+ and broader platform/runtime matrices remain separate gates.