Skip to content
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

Merged
merged 3 commits into from
Jul 7, 2019
Merged

API: Add call-local #201

merged 3 commits into from
Jul 7, 2019

Conversation

orogvany
Copy link
Collaborator

@orogvany orogvany commented Jul 5, 2019

Still need to add unit tests.

Definitely open to renaming if another name fits better. Naming is hard.

Fixes #196

@orogvany orogvany added the WIP Indicates the team is working on it label Jul 5, 2019
@orogvany orogvany changed the base branch from master to develop July 5, 2019 01:41
@semuxgo
Copy link
Contributor

semuxgo commented Jul 5, 2019

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) {
Copy link
Contributor

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.

Copy link
Collaborator Author

@orogvany orogvany Jul 5, 2019

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": {
Copy link
Contributor

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.

@semuxgo semuxgo mentioned this pull request Jul 7, 2019
@semuxgo semuxgo merged commit da70051 into semuxproject:develop Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Indicates the team is working on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants