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

Implement GET_SENDER protocol feature #7111

Merged
merged 5 commits into from
Apr 12, 2019

Conversation

taokayan
Copy link
Contributor

@taokayan taokayan commented Apr 11, 2019

Change Description

Resolves #7028.

This PR adds support for the GET_SENDER protocol feature which allows contracts to determine which account is the sender of an inline action.

This PR introduces a new unit test protocol_feature_tests/get_sender_test to test the behavior of this new protocol feature. The get_sender_test test contract was added to meet the needs of the new unit test.

Consensus Changes

  • Consensus Changes

Makes the GET_SENDER protocol feature available. See above description and #7028 for details.

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@tbfleming
Copy link
Contributor

After this change, there will be 2 event systems:

  • require_recipient
  • inline action, with receiver verifying the sender using get_sender

This brings up a question: how should they interact?

  • Imagine an inline action with no args that's a simple ack.
  • Intended behavior: if contract A sends an ack to contract B, contract B can verify authenticity by only looking at get_sender
  • Setup:
    • A sends an ack to contract C
    • C uses require_recipient to send it to B
    • B uses get_sender
  • Options:
    • get_sender returns A: B incorrectly assumes the ack was for it
    • get_sender returns 0: B doesn't fall for the attack
    • get_sender returns C: B doesn't fall for the attack

taokayan and others added 4 commits April 12, 2019 11:51
…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 changed the title feature get_sender 7028 Implement GET_SENDER protocol feature Apr 12, 2019
@arhag
Copy link
Contributor

arhag commented Apr 12, 2019

  • Setup:

    • A sends an ack to contract C
    • C uses require_recipient to send it to B
    • B uses get_sender
  • Options:

    • get_sender returns A: B incorrectly assumes the ack was for it
    • get_sender returns 0: B doesn't fall for the attack
    • get_sender returns C: B doesn't fall for the attack

This PR goes with the third option where it would return C in the situation described above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants