nevillegrech / gigahorse-toolchain

A binary lifter and analysis framework for Ethereum smart contracts
Other
302 stars 63 forks source link

Context Sensitivity Refactor, Early Block cloning feature, and more #31

Closed sifislag closed 2 years ago

sifislag commented 2 years ago

This PR introduces various refactors and a new feature:

  1. A refactor of the context sensitivity code to maximize code reuse, and require context implementations to provide simpler rules. This includes a set of abstract context superclasses: AbstractContextSensitivity, VariableDepthContextSensitivity, PrivateOnlyContextSensitivity, and PublicComponentContextSensitivity. Current implementations extend the last two superclasses and only provide additional rules for MergeContext.
  2. Global analysis stage now turned into a component. Decompilation can include more than one global analysis steps. Currently two global analysis implementations exist: GlobalAnalysis, and OptimizedGlobalAnalysis (see comments for more).
  3. An experimental feature for the early cloning of certain blocks that can result in imprecise decompilation output can be enabled using the --early_cloning flag. This feature requires a second global analysis in order to ensure not breaking the input contract semantics. Due to this, decompilation takes 2x as much time, on average.
  4. In addition it includes various bugfixes, including ones from the oopsla_artifact branch.