Skip to content

solver: accept a contract state from a peer only in answer to a request - #32

Merged
EnzinoBB merged 1 commit into
masterfrom
fix/state-reply-pending
Oct 13, 2026
Merged

EnzinoBB merged 1 commit into
masterfrom
fix/state-reply-pending

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

getStateReply accepted a contract state from any signed peer, and
net_update_contract_state cached it whenever no new_state with the same ref
was found in the following MaxRoundsCancelContract blocks. A state with a
future ref was cached too, and then every real update looked outdated, so a
single message froze the contract on this node.

Remember the contracts this node asked the confidants about (the round of
the last request, kept for 1000 rounds because several confidants answer)
and ignore states for any other contract, or with a ref later than the
current round. A state whose new_state is not stored yet is still accepted:
that is how a lagging node catches up, and refusing it would leave it
without the state.

Testing

  • Local: nodetests 138/138 with all phase-1 node fixes merged together.
  • Testnet run 38374856915, branch test/phase1-combined (all node fixes) with mixed executors (executor_ref=test/compatible-fixes): 17 of 17 contract calls returned the expected value across the restart test, Counter and Ledger states equal on all 7 nodes, state digests equal up to sequence 1100.

Compatible: no result of a valid contract call changes, so nodes can adopt it one by one.

🤖 Generated with Claude Code

getStateReply accepted a contract state from any signed peer, and
net_update_contract_state cached it whenever no new_state with the same ref
was found in the following MaxRoundsCancelContract blocks. A state with a
future ref was cached too, and then every real update looked outdated, so a
single message froze the contract on this node.

Remember the contracts this node asked the confidants about (the round of
the last request, kept for 1000 rounds because several confidants answer)
and ignore states for any other contract, or with a ref later than the
current round. A state whose new_state is not stored yet is still accepted:
that is how a lagging node catches up, and refusing it would leave it
without the state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EnzinoBB
EnzinoBB merged commit fdddc2c into master Oct 13, 2026
2 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