-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metering to the VM #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Overall this looks really solid. Adding some tests to the test-unit
suite sounds great to keep the feature stable. I wouldn't worry too much about making sure the debug functionality is tested unless you really want to - it's still an untested experimental feature, so you may be breaking new ground there and finding bugs with it. 😅
Add support for metering the virtual machine. The meter can be set when you invoke or resume the VM. In the preamble it will decrease the meter and if it runs out, return an error and save state so that the VM can resume from where it was interrupted.
It currently compiles and the tests pass. Wanted to get a draft pr up to get your initial thoughts. I want to revisit some of the places where we have both debug state and meter state and make sure the interactions between the two are good. I'll also add some tests with metering state with and without debug as well. It's not a trivial interaction between the two so I want to make sure we have it tested.