runtimeverification / runtimeverification/kontrol

Out of bounds test id

Open
#805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
122
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Contract methods that use function arguments with complex structures could result in a test ID that is longer than the file system limit of 255 characters.

OSError: [Errno 36] File name too long: 'out/proofs/src%ThisIsAContractExample.thisIsAMethod((uint256,address,bytes32),(uint8,(((uint8,uint256)[]),bytes32),(bytes32,bytes32),(((uint8,uint256)[]),bytes32),(((uint8,uint256),bytes32,uint32,uint32)[],bytes32),(bytes32,bytes32),bytes32,uint32,uint32,uint32,bytes32,bytes32),(bytes32,(uint64,uint64,bytes32),bytes32,bytes32,bytes32,uint32),(uint16,uint256),bytes):0/proof.json'

As a workaround, I've modified the FoundryTest.name property to hash the arguments used in the method signature, but we must find a permanent solution for this corner case.
Output:

out/proofs/src%ThisIsAContractExample.thisIsAMethod(bcb029f448):0/proof.json

Code changed:

    @property
    def name(self) -> str:
        n = f'{self.contract.name_with_path}.{self.method.signature}'
        if len(n) > 250:
            h = hashlib.sha256(self.method.signature.encode('utf-8')).hexdigest()[:10]
            n = f'{self.contract.name_with_path}.{self.method.name}({h})'
        return n

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the FoundryTest.name property and reproduce the long-signature case described in the issue. Check that the resulting proof path stays within the filesystem limit while preserving enough identity to distinguish methods, then verify the generated path no longer raises the filename-too-long error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.