Open mgild opened 2 years ago
@mgild I couldn't really reproduce this issue! I used the exact same instruction name and it works without a glitch
@mgild I also could reproduce with the same instruction name. Could you provide more details/code?
Further exploration notes: This error, 101
, only seems to come back from https://github.com/project-serum/anchor/blob/master/lang/syn/src/codegen/program/dispatch.rs#L117 and so is likely the result of a of the sighash
not matching at https://github.com/project-serum/anchor/blob/master/lang/syn/src/codegen/program/dispatch.rs#L171
Not sure what's happening, but somewhere along the line it would imply a mismatch either on the Solana Hasher
side, or on the client side where it takes in the RPC name, snake cases
it and hashes the <namespace>::<snake_case_name>
. I can't find anywhere in either of those places where a longer string would be an issue (or a 29 character string). I did try some extremely long strings as a sanity check and found no issues.
However, I was able to cause this error by using the name "oracle_queue_vrfconfig", which through a CamelCase to snake_case conversion will drop the trailing underscore, throwing off the 8 byte hash id and thereby causing the Error: 101: Fallback functions are not supported
. Which I don't think is your issue, but demonstrates that it is possible to generate an IDL with RPC names that won't hash to their proper counterparts and cause this error.
More code would be helpful to debug this.
Hm, the namespace name is switchboard_v2
but the rpc was empty at the time of testing this:
anchor-cli 0.19.0
solana-program = "=1.9.6"
anchor-lang = "0.19.0"
Upon calling an RPC of the name:
oracle_queue_set_vrf_settings
I receive:
Shortening the rpc name to
oracle_queue_vrf_config
resolves the issue.