Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Optimize SELFDESTRUCT opcode in aleth-interpreter #5806

Merged
merged 2 commits into from
Nov 5, 2019

Conversation

halfalicious
Copy link
Contributor

Fix #5767

Optimization avoids state accesses if tx doesn't include enough gas to
cover base selfdestruct fee. Verified that all EVMOne tests pass.

@halfalicious halfalicious requested review from chfast and gumb0 November 4, 2019 01:14
@codecov-io
Copy link

codecov-io commented Nov 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@0a311f1). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5806   +/-   ##
=========================================
  Coverage          ?   64.08%           
=========================================
  Files             ?      359           
  Lines             ?    30783           
  Branches          ?     3418           
=========================================
  Hits              ?    19726           
  Misses            ?     9827           
  Partials          ?     1230

@halfalicious halfalicious changed the title Check gas at beginning of selfdestruct Check gas at beginning of selfdestruct in aleth-interpreter Nov 4, 2019
@halfalicious
Copy link
Contributor Author

halfalicious commented Nov 4, 2019

Here's the same optimization in LegacyVM: #5807

@halfalicious halfalicious changed the title Check gas at beginning of selfdestruct in aleth-interpreter Optimize SELFDESTRUCT opcode in aleth-interpreter Nov 4, 2019
@halfalicious halfalicious force-pushed the selfdestruct-optimizations-01 branch from 492f636 to e7cb213 Compare November 4, 2019 04:42
libaleth-interpreter/VM.cpp Outdated Show resolved Hide resolved
@halfalicious halfalicious force-pushed the selfdestruct-optimizations-01 branch from e7cb213 to d5789d2 Compare November 5, 2019 04:13
Nils-Erik Frantzell added 2 commits November 5, 2019 09:07
Optimization avoids state accesses if tx doesn't include enough gas to
cover base selfdestruct fee
@halfalicious halfalicious force-pushed the selfdestruct-optimizations-01 branch from a1913d9 to 39b6f21 Compare November 5, 2019 17:09
@halfalicious
Copy link
Contributor Author

Rebased + squashed commits

@halfalicious halfalicious merged commit 99b069c into master Nov 5, 2019
@halfalicious halfalicious deleted the selfdestruct-optimizations-01 branch November 5, 2019 17:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

evm_state.selfdestruct_with_balance test fails for aleth-interpreter
3 participants