Review report

core: PR #35569

2 suggestions

Earlier concerns neither republished nor resolved: 3 minor findings. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · Vector-returning observers constrain future transaction storage

An offset-backed representation could not implement these signatures without materializing vectors or requiring another caller migration.

Location: src/primitives/transaction.h:319 (head).

Details and suggested fix

GetInputs() and GetOutputs() return references to std::vector, and callers rely on that exact type: memory-usage code uses DynamicUsage() and vector iterator types, the fee bumper selects between the outputs and another vector, and RPC code uses .at(). Although the description says observers allow the representation to change and names offsets into shared immutable block state as an option, that storage has no per-transaction vectors to reference. It would need to build or cache vectors, or change the return types and revisit these callers. This concern does not apply to shared immutable state that still stores vectors. If offset-backed storage is a real goal, use a read-only view now, such as std::span when the backing data is contiguous, and adapt the affected callers; std::span lacks .at() and .cbegin(). If vector-backed storage is an accepted constraint, narrow the description's claim to match.


Link

[suggestion] · The observer check has no test fixture

No test input exercises the new check, so changes to its matcher or fix-it could go unnoticed.

Location: contrib/devtools/bitcoin-tidy/CMakeLists.txt:34 (head).

Details and suggested fix

bitcoin-tidy-tests compiles only example_nontrivial-threadlocal.cpp, which has no annotated field. CI runs bitcoin-* over src/, but USE_OBSERVER appears there only in its definition in src/attributes.h, so neither target exercises the check's diagnostic or fix-it. Add a fixture with an annotated field that is accessed directly and an unannotated field that should remain untouched. The existing target only prints diagnostics and does not fail on them, so checking the replacement also requires a small target addition, such as running with -fix or -export-fixes and comparing the output with expected text.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.