rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
133 stars 60 forks source link

[security] Enable gas limit on view function #1675

Open jolestar opened 1 month ago

jolestar commented 1 month ago

https://github.com/rooch-network/rooch/blob/592f4710e64c7e9db9dc1895c8d1767f5cb4f663/moveos/moveos/src/moveos.rs#L412-L420

  1. Use set_metering(true).
  2. Write a test case to ensure the metering worked. Write an example module containing a loop in function, then call the function via rooch move view.