Closed horsefacts closed 1 year ago
Coverage after merging fiveoutofnine/perf-1 into main will be
98.71% |
---|
File | Stmts | Branches | Funcs | Lines | Uncovered Lines |
---|---|---|---|---|---|
src | |||||
Bundler.sol | 100% | 100% | 100% | 100% | |
FnameResolver.sol | 100% | 100% | 100% | 100% | |
IdRegistry.sol | 100% | 100% | 100% | 100% | |
KeyRegistry.sol | 100% | 100% | 100% | 100% | |
StorageRegistry.sol | 100% | 100% | 100% | 100% | |
src/lib | |||||
Signatures.sol | 100% | 100% | 100% | 100% | |
TransferHelper.sol | 0% | 0% | 0% | 0% | 15, 15, 15, 25–26, 26, 26 |
TrustedCaller.sol | 100% | 100% | 100% | 100% |
Motivation
Remove checks for lists to save gas usage because we know the index can't be incremented greater than an array's length.
Change Summary
unchecked
blocks to incrementing loop index in batch functions (register
andtrustedBatchRegister
)users[i]
w/UserData calldata user = users[i]
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewPR-Codex overview
Focus of the PR:
This PR focuses on optimizing gas usage in the
BundleRegistryGasUsageTest
andBundler
contracts.Detailed summary:
BundleRegistryGasUsageTest:testGasTrustedBatchRegister()
function is reduced from 6,742,022 to 6,644,222.IdRegistryGasUsageTest:testGasRegister()
function is reduced from 734,576 to 664,422.IdRegistryGasUsageTest:testGasRegisterForAndRecover()
function is reduced from 1,704,136 to 1,704,136.Bundler.sol
contract, a loop condition is changed fromi < signers.length
toi < signers.length;
, and an unchecked block is added to incrementi
inside the loop.Bundler.sol
contract, a loop condition is changed fromi < users.length
toi < users.length;
, and an unchecked block is added to incrementi
inside the loop.