nevillegrech / gigahorse-toolchain

A binary lifter and analysis framework for Ethereum smart contracts
Other
290 stars 59 forks source link

Increase the maximum number of private function args and rets to 50 #101

Closed sifislag closed 1 year ago

sifislag commented 1 year ago

Hi, a recent change limited the number of private function arguments and return arguments to 10. It led to a regression we failed to detect because we weren't looking at Analytics_StmtMissingOperand inferences. Increasing the limit to 50 fixes that regression.

I tested this on two datasets. In order to measure the difference more directly the --disable_inline and --disable_scalable_fallback flags were used (also -T 200).

2000 contracts compiled using solc08 with a bytecode size over 5k bytes:

1989 contracts decompiled/analyzed by jun23-large-10 (0 exclusively)
1989 contracts decompiled/analyzed by jun23-large-50 (0 exclusively)

ANALYTIC: decomp_time
jun23-large-10 (common): 8664.066248893738 (+0.6492%)
jun23-large-50 (common): 8608.18263745308

ANALYTIC: Analytics_StmtMissingOperand
jun23-large-10 (common): 1932 (+2872%)
jun23-large-50 (common): 65

Contracts affected: 79

1022 contracts compiled using the viaIR pipeline:

969 contracts decompiled/analyzed by jun23-ir-master (0 exclusively)
969 contracts decompiled/analyzed by jun23-ir-50 (0 exclusively)

ANALYTIC: decomp_time
jun23-ir-master (common): 6248.1557240486145 (+0.2134%)
jun23-ir-50 (common): 6234.852586984634

ANALYTIC: Analytics_StmtMissingOperand
jun23-ir-master (common): 3135 (+1129%)
jun23-ir-50 (common): 255

Contracts affected: 175

Looking for a small test and will merge.

github-actions[bot] commented 1 year ago

Test Results (Souffle 2.4)

43 tests  +1   43 :heavy_check_mark: +1   19m 19s :stopwatch: - 4m 25s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit c0bd1bd4. ± Comparison against base commit c6139750.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 1 year ago

Test Results (Souffle 2.3)

43 tests  +1   43 :heavy_check_mark: +1   24m 22s :stopwatch: + 4m 20s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit c0bd1bd4. ± Comparison against base commit c6139750.

:recycle: This comment has been updated with latest results.