Page MenuHomePhabricator

Call `SyncWithValidationInterfaceQueue` after RPCs
ClosedPublic

Authored by tobias_ruck on Apr 12 2023, 16:00.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC4bc869b13e96: Call `SyncWithValidationInterfaceQueue` after RPCs
Summary

RPCs that update the chain state now wait for the (async) CValidationInterface queue to finish.

The following RPCs will call SyncWithValidationInterfaceQueue before returning:

  • preciousblock
  • invalidateblock
  • parkblock
  • reconsiderblock
  • unparkblock
  • generatetodescriptor
  • generatetoaddress
  • generateblock
  • submitblock
  • sendrawtransaction

This is more in line with the expected behavior, after a user e.g. called sendrawtransaction, it's reasonable to expect the wallet/indexers to always have this tx indexed after the call returned.

While users could use syncwithvalidationinterfacequeue, to enforce this, it requires discipline, because usually after the call returned, the indexers caught up already, so only occasionally a call to syncwithvalidationinterfacequeue is actually necessary. This would make software using the node more brittle.

This diff makes it so that users of these RPCs don't have to wait for the queue to clear manually.

Test Plan
  1. ninja check-functional
  2. All the build-* builds
  3. D13626, which relies on this diff

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable