Skip to content

Proto: allow to pay to increase the contract storage

Jules Viennot requested to merge JViennot/BumpContractStorage into master

Context

This MR fix the issue #1460 (closed) by adding the increase_paid_storage operation. It takes an amount of bytes and a smart contract as arguments and it enables the payer of the operation to increase the paid storage of the smart contract by the amount in bytes.

This is an easy first approach to add more reliability for increasing the paid storage by the right amount when doing an operation on a smart contract. For example, several operations on the same contract could fail when they were added at the same level because the storage limit given was lower than the real paid_storage_size_diff.

According to us, it appears clearer for all users to add a new operation rather than a new entrypoint to contracts. Adding a new operation is also easier and safer. That's why we chose this implementation. Indeed, an specific action being represented by an operation dedicated to it is easier to understand and to use rather than one being represented by a transaction with a special entrypoint.

Manually testing the MR

The operation can be tested with this command : dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe -- test "^paid storage increase$"

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Jules Viennot

Merge request reports