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

Consensus protocol upgrade to get the sending account of an inline action #7028

Closed
arhag opened this issue Mar 29, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@arhag
Copy link
Contributor

commented Mar 29, 2019

Background

A contract may wish to simply notify another contract of some event (but not via require_recipient). Inline actions are a good way of doing this. However, if the sender does not wish to allow the receiver to bill the sender for any RAM, it must keep the authorization vector of the inline action empty. But this creates a spoofing problem. Another contract (or just a signed transaction) can send that action while pretending to be from some other contract.

If a contract could use an intrinsic to get the account that an inline action was sent from, it could know with certainty whether the message was authentic without relying on the authorization system that opens up the issue of RAM billing for the sender.

Consensus protocol upgrade feature

This protocol feature (codename: GET_SENDER) allows contracts to determine which account is the sender of an inline action.

New intrinsic get_sender

A new intrinsic account_name get_sender() should be added to the system_api. The C intrinsic for the WebAssembly side would have a signature such as uint64_t get_sender() where the return type is the uint64_t raw representation of the account name of the sender of the inline action. If the current action is not an inline action (for example the top-level actions of a transaction), then get_sender will return 0.

@arhag arhag added the CONSENSUS label Mar 29, 2019

@taokayan taokayan self-assigned this Apr 11, 2019

@taokayan taokayan referenced this issue Apr 11, 2019

Merged

Implement GET_SENDER protocol feature #7111

1 of 3 tasks complete

arhag added a commit to taokayan/eos that referenced this issue Apr 12, 2019

Added protocol_feature_tests/get_sender_test unit test to test the GE…
…T_SENDER protocol feature. EOSIO#7028

Added a new test contract, get_sender_test, to enable the unit test.

The protocol_feature_tests/get_sender_test replaces 
api_tests/get_sender_test.

@arhag arhag removed the in progress label Apr 12, 2019

@arhag

This comment has been minimized.

Copy link
Contributor Author

commented Apr 12, 2019

Resolved by #7111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.