-
Notifications
You must be signed in to change notification settings - Fork 100
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
Remove sender from invoke* RPCs #351
Comments
Agreed. neo-project/neo#1752 fixed the sender to the first signer. |
I think it's clear enough. neo-modules/src/RpcServer/RpcServer.Wallet.cs Line 168 in fed3f7a
|
I don't understand your comment? The discussion is about removing the mandatory neo-modules/src/RpcServer/RpcServer.SmartContract.cs Lines 120 to 121 in fed3f7a
|
You are right, we should remove it. Plz see #368 |
Why |
No sender is fixed. See #351 (comment)
… Why Signers[0] should be the sender? Signers[1], Signers[2] could also be sender, that's why we have to confirm the sender in params
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks for remind. But it doesn't effect the behaviour of invokefunction. Let me show you an example:
You see in neo-cli, I could still make the second address as sender.
I think |
I doubt it's useful, you can use the same convention here and always get the sender for the first signer.
But even if you find it useful, you can hide it completely in the client ( |
Please have a look at my test result. I think the meaning of sender is to show who makes the transaction. And signer is who pays for the transaction. Like we buy something online, we could make this order and ask our friend or families to pay for it. if you'd like to make it as who paid it, then he is the sender, it's OK. But we should pay attention to the consistency of input params and result when invoking RPC. |
sender is who pay the fee, signers is who sign that this transaction it's ok. because sender must be a signer, we decided to use the first entry for it. |
I guess the server just shouldn't do that. In you example you only specify one signer for
Which to me means that he also is a sender, so the fact that you get this in returned transaction:
is a bug to me. Instead it should be:
Or no transaction returned at all as it's not possible to create a valid transaction for a given sender. This logic for automatically choosing the sender is actually a bit dangerous and can lead to unexpected results when you have multiple mixed zero-balance and non-zero-balance accounts in a wallet. |
Yes, that's the point. We should return |
Summary or problem description
#309 had introduced a
sender
parameter forinvokescript
andinvokefunction
RPCs, supposedly to solve the problem ofnull
here:But it's not really needed as the sender is the first signer and
signers
are perfectly ordered to rely on this. At the moment having both an explicitsender
andsigners
creates some duplication along with additional error modes that we need to check for. I don't see anything we couldn't do without an explicitsender
(just withsigners
).Do you have any solution you want to propose?
Something like this should solve the problem:
And allow to simplify the RPC API (returning to the parameter set we had for preview3).
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: