-
Notifications
You must be signed in to change notification settings - Fork 31
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
API: Add call-local #201
API: Add call-local #201
Conversation
Can we extend this interface to supported all the parameters specified in the Ethereum JSON-RPC? Link: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call? |
@@ -64,6 +64,9 @@ public long getGasForData(byte[] data) { | |||
AccountState as = semuxTrack.getAccountState(); | |||
DelegateState ds = semuxTrack.getDelegateState(); | |||
byte[] from = context.getCaller(); | |||
if (from == null) { |
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'd rather we provide an empty from
address for local invocation, rather than allowing null pointer passed to the vm. Essentially, the local is similar to a transaction and the only differences are:
- No signing required;
- State changes will be discarded.
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.
Yea. I can make it include all the eth params. I didn't know about "gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions." And the like.
It does mean we'll need a separate fix for precompiled contracts calling local
@@ -2434,6 +2434,56 @@ | |||
] | |||
} | |||
}, | |||
"/transaction/call-local": { |
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.
Suggest using /call
as the endpoint to distinguish message calls from transactions.
Also, suggest removing the local
parameter from the /transaction/call
.
Still need to add unit tests.
Definitely open to renaming if another name fits better. Naming is hard.
Fixes #196