Summary
Calling a correctly-defined, correctly-decorated @gl.public.view method on a separately deployed Intelligent Contract through gl.get_contract_at(address).view().method_name() fails with call to private method Contract.__handle_undefined_method__ / call to private method Contract.__receive__, even though gen_getContractSchema confirms that the target method is registered and visible.
Environment
- StudioNet (
https://studio.genlayer.com/api)
genlayer-test 0.30.0rc2
genlayer-py 0.19.0rc2
Reproduction
Target contract:
from genlayer import *
class ICStoreProbe(gl.Contract):
value: str
def __init__(self, value: str):
self.value = value
@gl.public.view
def read_it(self) -> str:
return self.value
- Deploy the target with
value = "probe-value"; deployment finalizes before the call.
- Query
gen_getContractSchema for the deployed target. It returns:
{
"read_it": {
"params": [],
"kwparams": {},
"readonly": true,
"ret": "string"
}
}
- Deploy a second contract and call:
other = gl.get_contract_at(target_address)
return other.view().read_it()
- The call fails with
gen_call failed (code=-32000): execution failed.
Ruled out
- The target method is decorated correctly and is schema-visible.
- Deployment timing/race: the test harness waits for the deployment receipt before returning the contract handle.
- Dynamic-proxy-only issue: a statically typed
@gl.contract_interface variant also failed.
- Read-context-only issue: a write transaction variant also failed. Example transaction
0x2a9b9962b5fa117bbefee0dea26cd73fc8a9545db8927a41b5851634eccdc041 reached FINALIZED, but its leader/validator execution_result was ERROR.
The detailed GenVM stderr from the dynamic/write attempt was:
ValueError: call to private method `<function Contract.__handle_undefined_method__ ...>`
call to private method `<function Contract.__receive__ ...>`
Conclusion
The target method is correctly defined and schema-visible, yet the calling runtime dispatches to the undefined-method fallback path. This appears to be a dispatch/resolution bug in the IC-to-IC call mechanism rather than a contract-authoring error.
Question
Is gl.get_contract_at(...).view() known to work in the current StudioNet build? Is there a required registration/configuration step beyond correct method decoration, or is this a runtime bug?
Summary
Calling a correctly-defined, correctly-decorated
@gl.public.viewmethod on a separately deployed Intelligent Contract throughgl.get_contract_at(address).view().method_name()fails withcall to private method Contract.__handle_undefined_method__/call to private method Contract.__receive__, even thoughgen_getContractSchemaconfirms that the target method is registered and visible.Environment
https://studio.genlayer.com/api)genlayer-test0.30.0rc2genlayer-py0.19.0rc2Reproduction
Target contract:
value = "probe-value"; deployment finalizes before the call.gen_getContractSchemafor the deployed target. It returns:{ "read_it": { "params": [], "kwparams": {}, "readonly": true, "ret": "string" } }gen_call failed (code=-32000): execution failed.Ruled out
@gl.contract_interfacevariant also failed.0x2a9b9962b5fa117bbefee0dea26cd73fc8a9545db8927a41b5851634eccdc041reachedFINALIZED, but its leader/validatorexecution_resultwasERROR.The detailed GenVM stderr from the dynamic/write attempt was:
Conclusion
The target method is correctly defined and schema-visible, yet the calling runtime dispatches to the undefined-method fallback path. This appears to be a dispatch/resolution bug in the IC-to-IC call mechanism rather than a contract-authoring error.
Question
Is
gl.get_contract_at(...).view()known to work in the current StudioNet build? Is there a required registration/configuration step beyond correct method decoration, or is this a runtime bug?