Problem
When a client sends a GET with return_contract_code: false, the node does not cache the contract WASM locally. This means:
- SUBSCRIBE fails with "contract WASM/parameters not cached locally"
- The node cannot validate incoming updates for the contract
- The node cannot host the contract for other peers
Expected Behavior
return_contract_code should only control whether the WASM bytes are included in the response to the client (bandwidth optimization). The node should always fetch and cache the WASM internally so it can:
- Accept and process SUBSCRIBE requests
- Validate contract state updates
- Host the contract state for the network
Current Workaround
Delta sets return_contract_code: true on all GET requests, but this wastes bandwidth sending the WASM to the client (which already has it embedded).
Context
Found while debugging Delta subscription failures. The node log showed:
Cannot cache or subscribe to contract - no contract code in GET response
Rejecting SUBSCRIBE: contract WASM not cached locally
[AI-assisted - Claude]
Problem
When a client sends a GET with
return_contract_code: false, the node does not cache the contract WASM locally. This means:Expected Behavior
return_contract_codeshould only control whether the WASM bytes are included in the response to the client (bandwidth optimization). The node should always fetch and cache the WASM internally so it can:Current Workaround
Delta sets
return_contract_code: trueon all GET requests, but this wastes bandwidth sending the WASM to the client (which already has it embedded).Context
Found while debugging Delta subscription failures. The node log showed:
[AI-assisted - Claude]