-
Notifications
You must be signed in to change notification settings - Fork 796
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async fn debug_trace_call< | ||
T: Into<TypedTransaction> + Send + Sync, | ||
R: Serialize + DeserializeOwned + Debug + Send, | ||
>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this because this would allow deserializing into any type.
what types are possible here?
perhaps we can add some safety trait restrictions here. For example
introduce a trait that is
trait CallTrace: DeserializeOwned + Debug + Send {}
impl CallTrace for /*All types we can return in `debug_trace_call`*/ {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this because this would allow deserializing into any type.
what types are possible here?
Here are some tricky things with JS tracer. For JS tracer, it could return any type depending on the JS. Look at the example here
ethers-rs/examples/geth_trace_call.rs
Line 60 in 54879a8
"{data: [], fault: function(log) {},step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0));},result: function() { return {\"result\":\"HelloWorld\"};}}".to_string() |
Focus on the result: function() { return {\"result\":\"HelloWorld\"};
here. For this JS tracer, it would return something like
struct Custom{
result: String
}
And you could define some other results like result: function() { return {\"a\":\"HelloWorld\", \"b\": 123};
then the return type would be
struct Custom{
a: String,
b: u64
}
perhaps we can add some safety trait restrictions here.
That's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so adding another trait bound is likely unnecessary.
2064 is merged! |
Closing this since #2064 is adopted |
Motivation
In aa-bundler, we need
debug_traceCall
javascript tracer option. So we add this js tracer config in making the request.And the
CallTracer
return data is not correct which needs to be fixed, too.Solution
Add additional options.
PR Checklist