cadence-tools icon indicating copy to clipboard operation
cadence-tools copied to clipboard

[test] Enable storage limit for emulator backend

Open m-Peter opened this issue 2 years ago • 3 comments

Description

This will make the testing environment behave more similar to a development/testnet/mainnet environment.


  • [x] Targeted PR against master branch
  • [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • [x] Code follows the standards mentioned here
  • [x] Updated relevant documentation
  • [x] Re-reviewed Files changed in the Github PR explorer
  • [x] Added appropriate labels

m-Peter avatar Jan 08 '24 10:01 m-Peter

~~Note: I will rework this to be enabled with a pragma, instead of enabling it by default.~~ That is actually requires quite some changes, and I do not see any benefit. I think it is better to have the storage limit always enabled, as users can easily mint/burn flows, to test out scenarios with storage.

m-Peter avatar Jan 08 '24 17:01 m-Peter

The default value is taken from here: https://github.com/onflow/flow-go/blob/47e239c3b505d75b41c3cb92666eba56d541c8a0/fvm/bootstrap.go#L26-L28, when using emulator.WithStorageLimitEnabled(true). We can specify a different value with emulator.WithMinimumStorageReservation(), but this cannot be changed once the emulator is up and running. That's why I went with the default value, to keep parity with the rest of the environments.

m-Peter avatar Jan 15 '24 18:01 m-Peter

@SupunS I have reworked this to use a Cadence pragma directive, instead of enabling it by default. Take a look when you can, and let me know what you think :pray:

m-Peter avatar Jan 22 '24 10:01 m-Peter