Repository navigation
api: contract getters on pruned nodes take the deploy the smart contracts keep - #74
Merged
Merged
Conversation
…acts keep
A pruned node answered every getter (TransactionFlow with forgetNewState) for a contract whose
deploy block it had pruned with status 0 and no result: smartTransactionFlow loaded the deploy
transaction from the block storage, got none, ran nothing and reported success (robustness
contracts-pruned-join and contracts-pruned-term-kill). The smart contracts already keep each
deploy in memory and in every checkpoint and snapshot (known_contracts, smartcontracts.dat), and
SmartContractGet / SmartContractDataGet use it.
- smartTransactionFlow: the deploy from SmartContracts::get_contract_deploy, the storage as fallback
- a getter with no byte code to run fails ("contract byte code is not available on this node")
- Executor::executeByteCode: no byte code, or no executor connection, is an error, not a success
without a result (as executeByteCodeMultiple already reports)
- SmartContractsListGet(deployer): a deploy no longer in the storage comes from the same copy
Only API answers change; consensus execution already uses the kept deploy. Contract-to-contract
calls (APIEXEC SmartContractGet) are left for a separate change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnzinoBB
added a commit
that referenced
this pull request
Oct 22, 2026
#74) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f an empty success Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/CHANGES.md
EnzinoBB
added a commit
that referenced
this pull request
Oct 22, 2026
…ter #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
A pruned node answered every getter (
TransactionFlowwithforgetNewState) for a contract whose deploy block it had already pruned withstatus 0 "Success: "and no result. Found in robustnesscontracts-pruned-joinandcontracts-pruned-term-kill(n6, after pruning blocks before 1,700). This affects every Docker or pruned-package node, for every contract older than about one checkpoint.Cause (Fable):
smartTransactionFlowloads the deploy transaction from the block storage. On a pruned node it gets nothing, soexecuteByteCodewith empty code runs nothing and the call is reported as a success. Yet the smart contracts already keep every deploy, in memory and in each checkpoint and snapshot (known_contracts,smartcontracts.dat), andSmartContractGetandSmartContractDataGetalready use that copy.Changes
smartTransactionFlownow takes the deploy fromSmartContracts::get_contract_deploy, with the block storage as fallback.Executor::executeByteCode: missing byte code, or no executor connection, is now an error instead of a success without a result, asexecuteByteCodeMultiplealready reports.SmartContractsListGet(deployer): a deploy no longer in the storage comes from the same in-memory copy.Only API answers change. Consensus execution already uses the kept deploy: n6 executed contract calls as a trusted node after pruning, with matching states.
Contract-to-contract calls (
APIEXECHandler::SmartContractGet, used while executing contracts) have the same storage lookup. They are left to a separate PR because that path is part of contract execution in consensus.Validation
contracts-pruned-joinandcontracts-pruned-term-killon a branch wherecontracts.pyreads from the pruned nodes too: n6 must answer the expected values.contracts=1.🤖 Generated with Claude Code