-
Notifications
You must be signed in to change notification settings - Fork 87
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
Bugfixes found during chatting with Auditors on July 7th #504
Conversation
…s` structure. Check that the contract in inputs for `CROO` and `CSIZ`. Fixed the bug with `total_code_size`. Fixed the bug with incorrect gas charging per unit.
fuel-vm/src/interpreter.rs
Outdated
@@ -461,3 +461,27 @@ impl CheckedMetadata for CreateCheckedMetadata { | |||
self.gas_used_by_predicates = gas_used; | |||
} | |||
} | |||
|
|||
pub(crate) struct TouchedContracts<'vm, I> { |
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.
I think the idea of centralizing the location where we check the list of input contracts is a good abstraction. However, I think touch
is a bit of a misleading name. In the context of software, touch
usually means to create a file/modify its timestamp (see https://www.geeksforgeeks.org/touch-command-in-linux-with-examples/). Here, you're using touch
to panic if the contract doesn't exist. From a naming perspective, that is almost the opposite of what I would expect it to do.
What about calling the struct something like InputContracts<..>
and changing touch
to something like check
?
Unified the check that the
ContractId
in inputs byTouchedContracts
structure.Check that the contract is in inputs for
CROO
andCSIZ
.Fixed the bug with
total_code_size
.Fixed the bug with incorrect gas charging per unit.