-
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
String storage issues #569
Comments
String support is also relevant for CSE as discussed today with @PetarMax. |
This is also relevant, from the official documentation. |
I would suggest that the first PR handle only the case in which the length of the string is less than 32 bytes, which is the case that we need currently to work. |
The reason I was thinking, and @PetarMax confirmed, that we should add a constraint using The problem is, given an account cell in the configuration, it is hard to tell which solidity contract it was created from and therefore which compiled definition we can use to get the storage layout metadata from. In the case where we are constructing the account cell ourselves during initialization, such as we do for I thought maybe we could match bytecode, since every solidity compiled definition has |
@jinxinglim @palinatolmach After discussion with @PetarMax I am wondering, is there any reason why we need the |
I have not fully understood the test until now. The function that's being called is a test function, and the storage is being abstracted manually as part of the
Even like this, this would be a bit problematic because:
In any case, this is not something that we should be handling automatically in these scenarios. This should be handled automatically when analysing non-test functions, to construct their initial configuration. |
Hi @PetarMax and @nwatson22. Our ERCx tool does conformance checks for properties stated in the EIP standard. In this case, EIP-4626 stated that Thus, in our ERC4626 test suite from ERCx, we have a Foundry test that checks for callability of the function // name is callable
function test_name_callable() public {
vault.name();
} In the effort to make all tests in our ERC-4626 test suite to be runnable by Kontrol, I have tested each test one at a time to see if it can be run by Kontrol. And it somehow failed at this test, and hence, creating this issue to see if there is a need to make Kontrol able to run this test or any test with regards to string storage. But after reading your points, I agree that it would be too problematic/troublesome just to find a fix for this. I can simply ignore the tests with regards to string storage from the ERC-4626 test suite. @palinatolmach Do you think this is okay? |
@jinxinglim yes, I also think we can skip this test, probably not worth the trouble with getting it formally verified. I think it would actually be beneficial to have structured symbolic storage for tests as well (we've discussed it with @anvacaru a few weeks ago and opened an issue on it), but I agree it's not the goal right now. Since we need it for CSE, I think we can just add these |
Closed as #627 has been merged. |
Version
Kontrol version: 3135126 (v0.1.278) - latest as of 16 May 2024
Issue
I am running some conformance checks via Kontrol for the ERC4626 vault,
src/tokens/ERC4626.sol
.I have added the following test in
test/ERC4626.t.sol
to check if the functionname()
is callable:I ran the test with Kontrol and the proof failed unexpected:
Command:
Output:
I have
kontrol prove
another similar test that check if thedecimals()
function is callable and it passed.After discussion with @palinatolmach, we believe that this is most probably due to the storage for
string
variable as we think the proof got stuck at#lookup ( ?STORAGE:Map , 0 )
. We also know that the storage layout for strings in solidity is different from how anuint
is being stored (see this).Question
Does anyone have experience this and could share how this could be addressed?
Remark
Ideally, this could be addressed at the backend side instead of requiring the user to add more assumption/s in such a simple test as it may deter users from running Kontrol over their existing Foundry tests. I have also created a new branch for anyone reproduce the outputs: https://github.com/runtimeverification/secureum-kontrol/tree/string-storage-issues, although I have added the kontrol outputs as well.
The text was updated successfully, but these errors were encountered: