Improve 1346 to make it more efficient
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/crytic/slither/pull/1346 is a nice addition, which gives us fundamental features to do structure packing optimisations.
However it has a couple of drawback. For example packing storage variables might lead to more costly execution because of the additional opcode cost.
We could improve the detector to add a couple of heuristics. One example that comes to mind is to use https://eips.ethereum.org/EIPS/eip-2929#sstore-changes, and to pack together variables that are read within the same transaction.
We could make it a tool instead of a detector, and propose different scenario as a result, ie:
- To optimize the run of `contract.function1` pack together ..
- To optimize the run of `contract.function2` pack together ..
Having a tool would allow us additional fine tuning and flags.
Contributor guide
Research direction
Start by reviewing pull request 1346 and the EIP-2929 SSTORE changes referenced in the issue. Examine the existing storage-packing detector and decide whether the work should remain a detector or become a tool. Done means the analysis accounts for transaction-local reads and can report packing scenarios for contract functions, with suitable flags or heuristics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100