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

Implement RAM_RESTRICTIONS protocol feature #7131

Merged
merged 9 commits into from
Apr 18, 2019
Merged

Conversation

arhag
Copy link
Contributor

@arhag arhag commented Apr 16, 2019

Change Description

Resolves #6105.

This PR adds support for the RAM_RESTRICTIONS protocol feature which, when activated makes the following changes to the rules regarding RAM billing within an action:

  • For an unprivileged contract responding to a notification:

    • Not allowed to schedule a deferred transaction in which the RAM costs are paid by an account other than receiver.
    • Allowed to execute database operations that increase RAM usage of an arbitrary account other than receiver as long as the action's net effect on RAM usage for that account is to not increase it.
  • For an unprivileged contract executing an action (but not as a response to a notification):

    • Not allowed to schedule a deferred transaction in which the RAM costs are paid by an account other than receiver unless that account authorized the action.
    • Allowed to execute database operations that increase RAM usage of an arbitrary account other than receiver as long as either that account authorized the action or the action's net effect on RAM usage for that account is to not increase it.

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

Consensus Changes

  • Consensus Changes

Makes the RAM_RESTRICTIONS protocol feature available. See above description and #6105 for details.

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

arhag and others added 5 commits April 15, 2019 18:00
…TIONS; fix api_tests/deferred_transaction_tests to catch the right exception given RAM_RESTRICTIONS activation #6105
…tion preventing RAM billing in notification contexts #6105
@arhag arhag marked this pull request as ready for review April 18, 2019 21:34
@arhag arhag requested a review from johndebord April 18, 2019 21:34
Copy link
Contributor

@johndebord johndebord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

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