-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Labels
auditIssue comes as a result of an external auditIssue comes as a result of an external auditbugSomething isn't workingSomething isn't workingvaultsLido stVaults related changesLido stVaults related changes
Description
Summary
Certora identified a bug in the Solidity 0.4.24 compiler that affects the gas consumption of the Lido contract, with the help of the Certora prover. When creating a memory bytes array new bytes(48) in contracts/0.4.24/lib/SigningKeys.sol, the compiler actually allocates 32 * 48 = 1536 bytes, which is a waste of gas.
core/contracts/0.4.24/lib/SigningKeys.sol
Line 52 in 22cab0f
| bytes memory tmpKey = new bytes(48); |
We believe this affects also other constant size array allocations. We've also confirmed this issue exists in the currently deployed version.
Expected Behavior
Allocate on 48 bytes.
Potential Impact
Waste of gas.
Steps to Reproduce
Any call to SigningKeys.saveKeysSigs will allocate too much memory.
Possible Solutions
No response
Guidelines
- I agree to follow Code of Conduct.
- I have read Lido Contribution Guide.
folkyatina
Metadata
Metadata
Assignees
Labels
auditIssue comes as a result of an external auditIssue comes as a result of an external auditbugSomething isn't workingSomething isn't workingvaultsLido stVaults related changesLido stVaults related changes