Repository navigation
api: contract results after a quick start at the last stored block - #126
Merged
Merged
Conversation
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.
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A node that quick-starts from a checkpoint at its last stored block reads no block, so
APIHandler::baseLoaded()never runs andisBDLoaded_staysfalsefor the life of the process.TransactionFlowwaits for the result of a contract deploy or call through a signal thatupdateSmartCachesTransactionsends onlyif (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 savesqs/0at 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_isstd::atomic<bool>(read by API threads, written by the reading and starting ones).API only: nothing in consensus reads
isBDLoaded_.Test plan
qs/0at its last block, token deploys and calls sent through n5 (TOKENS=1 TOKENS_VIA=5, from ci: token smart contract tests (executor harness and private testnet) #127): master answersTransaction in progressto the first deploy; this branch passes every call and the same-state checks on all nodes🤖 Generated with Claude Code