-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging native rust functions #17098
Comments
Another problem I have is that whenever I call this move function from the CLI, I get this error:
|
Hi @yuvalelmo, you should be able to set a breakpoint in a native function, but it's possible that the issue you're facing comes from the fact that there are multiple copies of the native functions (one for each execution version) and you may have set the breakpoint in a version that is not currently being used? If you are running the network locally, then you will almost certainly be using this copy of But note that there is a |
Ok, thanks. I'll try this. Maybe you have any input regarding this?
Also, In the explorer, I cannot find any of these transactions 82uaGcNzmaivR1ND2yBb5J1i6S47JbB1VdQ5KihDd4Wm nor 4NxigJB9hyJnvhDXmckro5DsScmPACC1q4LFTMg7tNd2 |
Hey, I just noticed this error now on the node logs. it happens whenever I run this function from another address.
The only serialization I do to the arguments I send to the function is from object to bcs bytes, then to SuiJsonValue like this: fn serialize_argument<T: serde::Serialize>(object: &T) -> Result<SuiJsonValue, Error> {
let serialized_numbers = bcs::to_bytes(object)?
.iter()
.map(|v| Value::Number(Number::from (*v)))
.collect();
let object_as_sui_json = SuiJsonValue::new(Value::Array(serialized_numbers))?;
Ok(object_as_sui_json)
} |
Hi @yuvalelmo, the error that you've shared above looks like it's garbled and incomplete. Can you share the full message, with the stacktrace for the panic, and the steps you took to reproduce it? This includes changes to the validator codebase, e.g. to introduce the native function. It sounds like the problem you are facing is not related to the native function, but some other change, because you are not reaching the point at which the native function would have been called. |
Hi,
I am trying to debug some CLI Commands, which will ultimately call a move function, that in it's turn is calling a native rust function.
The way I'm debugging the code now is using the IDE's debugger, with the sub commands provided in the debugging configuration arguments.
It allows me to debug the code on the part of the
client_commands.rs
file, but I cannot manage to debug the native function that is called from the move code, which is implemented insidesui-move-natives
.I tried to put some breakpoints in there, but unfortunately this won't do the trick.
Is it possible to debug this kind of functions? If so, then how do I do this?
Thanks!
The text was updated successfully, but these errors were encountered: