Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Closed
arhag opened this issue Mar 29, 2019 · 1 comment
Closed
Assignees
Labels
CONSENSUS Introduces a change that may modify consensus protocol rules on an existing blockchain.

Comments

@arhag
Copy link
Contributor

arhag 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 Introduces a change that may modify consensus protocol rules on an existing blockchain. label Mar 29, 2019
@taokayan taokayan self-assigned this Apr 11, 2019
arhag added a commit to taokayan/eos that referenced this issue Apr 12, 2019
…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
Copy link
Contributor Author

arhag commented Apr 12, 2019

Resolved by #7111.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CONSENSUS Introduces a change that may modify consensus protocol rules on an existing blockchain.
Projects
None yet
Development

No branches or pull requests

2 participants