-
Notifications
You must be signed in to change notification settings - Fork 488
Support the examples from the building-secure-contracts repository #1819
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
Conversation
As I understand it, this is necessary to get the [building secure contracts](https://github.com/crytic/building-secure-contracts) repo passing by default. It's also a frequent first step for real-world EVM analysis, so perhaps it will save some time. The tests are performing suspiciously well locally. I would have expected some changes to be required. Let's see how GH Actions handles them.
Previously, contract creation would ignore the `consts.oog` variable and always check that the caller had the requisite balance. This change checks that we haven't explicitly ignored gas calculations when evaluating whether the transaction has enough balance to proceed.
Evidently we relied on the gas behavior in some of these tests. Though admittedly, the failure of test_integer_overflow_storageinvariant seems backward to me.
```
_____________ EthBenchmark.test_integer_overflow_storageinvariant ______________
[gw1] linux -- Python 3.6.12 /opt/hostedtoolcache/Python/3.6.12/x64/bin/python
self = <tests.ethereum_bench.test_consensys_benchmark.EthBenchmark testMethod=test_integer_overflow_storageinvariant>
def test_integer_overflow_storageinvariant(self):
> self._test("integer_overflow_storageinvariant", set())
tests/ethereum_bench/test_consensys_benchmark.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/ethereum_bench/test_consensys_benchmark.py:57: in _test
self.assertEqual(expected_findings, actual_findings)
E AssertionError: Items in the second set but not the first:
E ('Unsigned integer overflow at ADD instruction', False)
----------------------------- Captured stdout call -----------------
```
| except TerminateState as e: | ||
| result = str(e) | ||
| self.assertEqual(result, "SELFDESTRUCT") | ||
| consts.oog = default_gas |
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 is possible going to fail if the tests get executed concurrently. Config must go with mcore instance and be frozen and etc etc.
Also there this
manticore/manticore/utils/config.py
Lines 73 to 80 in c8e5e25
| Can also be used with a `with-statement context` so it would revert the value, e.g.: | |
| group.var = 100 | |
| with group.temp_vals(): | |
| group.var = 123 | |
| # group.var is 123 for the time of with statement | |
| # group.var is back to 100 | |
feliam
left a comment
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.
We need better configuration nobs all around evm.
And also config need to be able to be frzen and to be attached to each mcore instance
|
The building-secure-contracts repo works with #1820, so we don't need the additional gas and timeout changes present in this PR. |
Previously, contract creation would ignore the
consts.oogvariable and always check that the caller had the requisite balance. This change checks that we haven't explicitly ignored gas calculations when evaluating whether the transaction has enough balance to proceed.