Skip to content

api: contract results after a quick start at the last stored block - #126

Merged
EnzinoBB merged 2 commits into
masterfrom
fix/api-quickstart-results
Oct 30, 2026
Merged

EnzinoBB merged 2 commits into
masterfrom
fix/api-quickstart-results

Conversation

@EnzinoBB

@EnzinoBB EnzinoBB commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A node that quick-starts from a checkpoint at its last stored block reads no block, so APIHandler::baseLoaded() never runs and isBDLoaded_ stays false for the life of the process. TransactionFlow waits for the result of a contract deploy or call through a signal that updateSmartCachesTransaction sends only if (isBDLoaded_): on such a node every contract call sent through its API answers "Transaction in progress" and never returns its result, although the network executes it. A wallet connected to that node sees token transfers stay pending. A stop that saves qs/0 at the last block (the usual case) is enough.

  • APIHandler::run() (called once the blockchain is ready, i.e. its stored blocks are read) marks them read.
  • isBDLoaded_ is std::atomic<bool> (read by API threads, written by the reading and starting ones).

API only: nothing in consensus reads isBDLoaded_.

Test plan

🤖 Generated with Claude Code

A quick start from a checkpoint at the last stored block reads no block, so baseLoaded()
never ran and isBDLoaded_ stayed false for the life of the node. The new_state of a call
then never signals the TransactionFlow that waits for it: every contract call sent through
that node's API answered "Transaction in progress" without its result, although the
network executed it (seen on the private network: the node of the restart test, after a
stop that saved its checkpoint at its last block).

The stored blocks are read once the node runs: run() marks them so. isBDLoaded_ is atomic,
read by the API threads and written by the reading and starting ones.
@EnzinoBB
EnzinoBB merged commit 5530aa1 into master Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant