Implement EIP1380 (call-to-self) in aleth-interpreter#5753
Implement EIP1380 (call-to-self) in aleth-interpreter#5753halfalicious merged 4 commits intomasterfrom
Conversation
|
Still need to create tests |
Codecov Report
@@ Coverage Diff @@
## master #5753 +/- ##
=========================================
Coverage ? 64.03%
=========================================
Files ? 359
Lines ? 30774
Branches ? 3416
=========================================
Hits ? 19706
Misses ? 9844
Partials ? 1224 |
62cc8ef to
b7d86d5
Compare
|
Rebased |
b7d86d5 to
e73b50a
Compare
libaleth-interpreter/VMCalls.cpp
Outdated
| evmc_address const destination = toEvmC(asAddress(m_SP[1])); | ||
|
|
||
| // Check for call-to-self (eip1380) and adjust gas accordingly | ||
| if (fromEvmC(m_message->destination) == fromEvmC(destination) && m_rev >= EVMC_BERLIN) |
There was a problem hiding this comment.
You need to have the cheap m_rev >= EVMC_BERLIN check first.
There was a problem hiding this comment.
@chfast Ah good point, comparing addresses is expensive since you're comparing 32 byte boost multiprecision values which are also first converted from big endian, instead of an EVMC_REVISION which is an enum (4 bytes).
e73b50a to
906f7f2
Compare
906f7f2 to
d843b9b
Compare
|
@chfast I also removed the aleth/libaleth-interpreter/VMCalls.cpp Lines 197 to 198 in d843b9b I think that's okay since these are both |
|
@halfalicious I removed the assignment to |
@gumb0 Ah I see, it’s done here: aleth/libaleth-interpreter/VM.cpp Line 220 in 06dad45 Thanks for the heads up! |
No tests since @gumb0 mentioned that there's no way to measure gas cost in tests which use aleth-interpreter.