3 minor findings · 3 suggestions
Earlier concerns neither republished nor resolved: 3 suggestions. See the Run archive for their assessments.
Findings
[minor] · Release notes reverse the meaning of zero for several limits
The new release notes describe zero as “disabled” or “unlimited,” although existing -maxtipage, -mempoolexpiry, and -dbbatchsize behavior instead applies the strictest thresholds.
Location: doc/release-notes-36861.md:30 (head).
Details and suggested fix
With -maxtipage=0, IsTipRecent requires a tip timestamp at least as recent as the current time. With -mempoolexpiry=0, the limiting pass expires entries older than the current second, and LoadMempool skips persisted entries timestamped at or before it. With -dbbatchsize=0, BatchWrite flushes a partial batch whenever it contains data. An operator trying to disable these limits would therefore get the opposite behavior. Describe zero as retaining its existing, option-specific meaning, explain these three cases, and change the negation paragraph to say that -nofoo selected zero rather than turning the limit off.
[minor] · Large accepted -mempoolexpiry values reach overflowing reload arithmetic
Source inspection predicts a new MSVC reload overflow for huge accepted -mempoolexpiry values; the analogous failure on libstdc++ is pre-existing.
Location: src/node/mempool_args.cpp:108 (head).
Details and suggested fix
With persistence enabled and a valid, nonempty mempool.dat, -mempoolexpiry=8589934593 previously narrowed through MSVC's 32-bit std::chrono::hours to one hour. The new assignment preserves the full duration, which fits the seconds-based bound. However, LoadMempool evaluates now - pool.m_opts.expiry with now from NodeClock::now(). Converting that seconds duration to MSVC's native 100-nanosecond ticks overflows signed arithmetic before TicksSinceEpoch converts the result back to seconds, leaving the reload cutoff undefined.
Compute the reload cutoff in seconds, for example using Now<NodeSeconds>() - pool.m_opts.expiry, and add a persisted-mempool reload test with a large accepted expiry. The ordinary limiting path already subtracts in seconds.
[minor] · The uint32_t ceiling removes the tested INT64_MAX tip age unnecessarily
The uint32_t ceiling rejects previously accepted, regression-tested -maxtipage=9223372036854775807 configurations, although the debug option's seconds-based destination and consumer can handle that value.
Location: src/node/chainstatemanager_args.cpp:63 (head).
Details and suggested fix
max_tip_age remains a std::chrono::seconds, and IsTipRecent subtracts it from Now<NodeSeconds>(). That arithmetic handles INT64_MAX at non-negative current times. The base functional test explicitly exercises this value and expects the node to leave IBD; this patch replaces it with 2**32 - 1. The static_assert establishes that UINT32_MAX fits, but does not justify rejecting larger representable ages. Parse strictly into std::chrono::seconds::rep, reject negative values, and retain the old maximum test. If the narrower ceiling is intentional policy, explain the requirement and explicitly document that the formerly tested maximum now fails startup. Affected configurations can use 4294967295 as a workaround.
Optional improvements
[suggestion] · Mempool argument tests discard the values they configure
The new mempool_args_validation test checks parser success but discards the options, so dropping or mis-scaling the changed assignments would leave its assertions passing.
Location: src/test/mempool_tests.cpp:557 (head).
Details and suggested fix
There is no positive -mempoolexpiry case, so neither the hours-to-seconds conversion nor preservation beyond a 32-bit hours representation is checked. Return the populated MemPoolOptions on success, as the adjacent chainstate helper does, and assert that -mempoolexpiry=1 stores 3600 seconds and -mempoolexpiry=2147483648 stores 7730941132800 seconds. Also check that -limitclustersize=1 stores 1000 vbytes, a nondefault cluster count is preserved, and -datacarriersize=0 produces a zero budget while -datacarrier=0 produces std::nullopt. Keep the existing rejection assertions; these checks require no additional node starts.
[suggestion] · Parser tests miss trailing text and the uint64_t batch-size boundary
The parser tests do not distinguish strict parsing from a truncating getter with range checks for three options, nor verify that -dbbatchsize preserves its advertised uint64_t maximum.
Location: src/test/validation_chainstatemanager_tests.cpp:1026 (head).
Details and suggested fix
For -dbbatchsize, -dbcrashratio, and -limitclustercount, replacing ToIntegral with GetIntArg plus range checks would satisfy every added assertion while accepting trailing text. The existing -maxtipage=notanumber case already catches that complete reversion for -maxtipage. Add suffix cases such as -maxtipage=1h, -dbbatchsize=1000junk, -dbcrashratio=8x, and -limitclustercount=1x. Also assert that -dbbatchsize=18446744073709551615 is stored exactly and that 18446744073709551616 is rejected. Those boundary checks would detect accidentally routing this option through a saturating int64_t getter.
[suggestion] · Compatibility decisions are buried among numeric wrap fixes
Separating representation fixes from compatibility policies would make removal of the tested INT64_MAX boundary easier to assess independently, without changing the final tree.
Location: test/functional/feature_maxtipage.py:61 at 0b33a8cca381 (commit) (commit).
Details and suggested fix
Commit 0b33a8cca3815c7592277abb6acd6c7ea5ef85a0 replaces the -maxtipage=9223372036854775807 functional case with 2**32 - 1 alongside unrelated width checks, negation restrictions, wallet changes, and help placeholders. Split it into: help-only edits; wrap and narrowing fixes; zero-value rejections; DISALLOW_NEGATION changes; the -maxtipage ceiling with its functional test; and the -txconfirmtarget bounds with wallet_fallbackfee.py. Keep matching assertions and release-note text with each change, and keep the ReadCoinsViewArgs signature, caller, and simulate_crash_ratio type changes together. This exposes the compatibility choices separately while still delivering all stricter validation together in one PR.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Clearly excessive confirmation targets fail only at wallet load (earlier report)
- [suggestion]: Ancestor and descendant limits still narrow silently in the wallet interface (earlier report)
- [suggestion]: The bytes-per-sigop ceiling ignores downstream int32 size fields (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Numeric options were not intended to lose negation merely because they accept integers. In #19827, Russell Yanofsky explicitly defended historical -novalue → -value=0 behavior as a possible convenience and distinguished it from option-specific negation meanings such as clearing a list, disabling a feature, or eliminating a limit.
The new DISALLOW_NEGATION registrations change a historically recognized configuration convention, separately from rejecting malformed or unrepresentable numbers. The relevant historical constraint is option-specific meaning and compatibility, not a blanket rule that numeric settings cannot be negated. This supports treating the retained -nobytespersigop behavior and the newly forbidden negations as distinct semantic decisions.
Earlier argument-validation work deliberately separated validation infrastructure from changes to existing configurations. #22766 preserved behavior while making negation restrictions explicit; #16545 stated that type checking would likely be easier to apply to new options than existing ones. In #19827, Yanofsky requested that stricter validation happen together and be documented in release notes.
This history makes newly rejected configurations a compatibility-policy change rather than merely a parsing refactor. It supplies precedent for distinguishing representation checks, changed zero semantics, and removed negation forms, and for explaining the resulting startup failures. It does not establish that previously accepted configurations must remain accepted indefinitely.
Source 1 · Source 2 · Source 3
The original -maxtipage option served a deliberate isolated-testing use case: running testnet-in-a-box despite an old tip. Wladimir van der Laan moved the behavior out of testnet chain parameters because ordinary testnet should exercise the software as-is; exceptional environments should opt into the debug setting.
Large tip ages are an intentional way to relax the tip-recency requirement, not inherently erroneous numeric input. The pinned base accepts an int64-derived seconds value, while the head limits input to UINT32_MAX. The historical motivation concerns a local synchronization/testing control, not a consensus-mandated uint32 range.
INT64_MAX -maxtipage support was explicitly defended and regression-tested. #26477 described a crash when specifying the 'maximum allowable' value after a chrono refactor, and an inspected comment argued that restoring previously working usages should take priority. The pinned base still tests 9223372036854775807 and expects the node to leave IBD.
The proposed UINT32_MAX ceiling removes a deliberately exercised compatibility boundary, rather than only rejecting values outside the previous destination's range. The inspected history establishes preservation of this boundary against a regression, but does not identify an application requiring that exact magnitude or promise that the boundary can never change.
Fallback fees were introduced to permit fee calculation when estimation has insufficient data, while continuing to respect required fees. Later static-fee deprecation work explicitly emphasized the economic risks of persistent fixed rates: overpayment in quiet conditions and underpayment during congestion.
These sources explain fallback availability and caution around silently selecting a fixed fee. They do not document oversized confirmation targets as an intended selector. The pinned fee path uses fallback whenever estimation yields a zero fee rate, then applies mempool and required-fee floors; the new load-time ceiling changes configuration acceptance, not those fee-selection rules.
Ralph's inferences
Acceptance of zero and zero meaning 'unlimited' must be kept separate. For -maxtipage, zero imposes the strictest recency threshold: the tip must be at least as recent as the current time. A very large positive age relaxes that threshold instead.
This distinction is central to interpreting -nomaxtipage compatibility. The base recency expression gives zero a concrete meaning, but not 'disable the age check.' Preserving explicit zero while rejecting negation therefore preserves one input form and removes another historically equivalent form; it does not preserve the entire previous configuration surface.
The inspected evidence supports distinguishing an intentional fallback mechanism from an undocumented way of reaching it. A shared failure-to-estimate path explains how oversized targets could select fallback without establishing that this was a designed configuration interface.
The historical record does not justify describing oversized targets either as a promised fallback selector or as necessarily accidental. What is established is that the new wallet-load rejection removes previously accepted configurations, whereas fallback itself was designed for unavailable estimates.
The no-estimator exception reflects a capability distinction: an absent estimator has no usable target ceiling, rather than a ceiling of zero blocks. The inspected chain interface returns zero for the maximum and an estimation error when no estimator manager exists.
The head's max_target != 0 guard preserves wallet loading in that capability-absent state while retaining the positive unsigned target bound. This is consistent with fallback handling for unavailable estimates. It does not establish that an active estimator with insufficient data is equivalent to having no estimator, nor does it supply historical intent for oversized targets.