-
Notifications
You must be signed in to change notification settings - Fork 9
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
Contract storage fields in CSE #571
Conversation
src/tests/integration/test-data/show/AddConst.applyOp(uint256).cse.expected
Outdated
Show resolved
Hide resolved
There is a problem with |
┃ │ (464 steps) | ||
┃ └─ 12 (vacuous, leaf) | ||
┃ k: #execute ~> #return 128 0 ~> #pc [ CALL ] ~> #execute ~> CONTINUATION:K | ||
┃ │ (979 steps) |
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.
This increase is due to a problem with the specification of setConst
.
│ (1123 steps) | ||
├─ 13 (terminal) | ||
│ (1417 steps) |
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.
This increase is due to a problem with the specification of setConst
.
We have a problem. By setting the storage in this way, we cannot use the generated specifications when a slot has not been explicitly initialised---this, for example, is the case for the
but when the
implicitly having all slots set to zero and using I have two solutions in mind, first more favourable than the second, I think:
@anvacaru, @ehildenb, @palinatolmach, let's discuss this a bit, please. Other ideas welcome. |
Closing this since we won't merge it. |
def type_constraint(data_type: str, symbolic_var: KVariable) -> KApply: | ||
# TODO: fill with rest of the cases | ||
data_type = data_type.lower() | ||
if data_type.startswith('uint'): | ||
return mlEqualsTrue(KEVM.range_uint(int(data_type[4:]), symbolic_var)) | ||
|
||
match data_type: | ||
case 'address': | ||
return mlEqualsTrue(KEVM.range_address(symbolic_var)) | ||
case 'bool': | ||
return mlEqualsTrue(KEVM.range_bool(symbolic_var)) | ||
case _: | ||
raise ValueError(f'Unimplemented: {data_type}') |
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.
Note: This will be useful for future.
def type_constraint(data_type: str, symbolic_var: KVariable) -> KApply: | ||
# TODO: fill with rest of the cases | ||
data_type = data_type.lower() | ||
if data_type.startswith('uint'): | ||
return mlEqualsTrue(KEVM.range_uint(int(data_type[4:]), symbolic_var)) | ||
|
||
match data_type: | ||
case 'address': | ||
return mlEqualsTrue(KEVM.range_address(symbolic_var)) | ||
case 'bool': | ||
return mlEqualsTrue(KEVM.range_bool(symbolic_var)) | ||
case _: | ||
raise ValueError(f'Unimplemented: {data_type}') |
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.
Note: this will be useful in future.
Blocked on : #570 to bring in the changes from runtimeverification/evm-semantics#2433 to clean some of the code first.First PR for #362:
StorageField
class to store thenumberOfBytes
property_create_initial_storage
in prove.py that creates the KAst representation of the storage layout for a given set of storage fields.This representation is used to populate the storage of
CONTRACT_ID
symbolic account in CSE only.For now supporting just
uint*
,address
andbool