-
Notifications
You must be signed in to change notification settings - Fork 563
Problem: state transition code is duplicated #674
Conversation
ea35bc4
to
d7bd298
Compare
Codecov Report
@@ Coverage Diff @@
## main #674 +/- ##
==========================================
+ Coverage 57.20% 57.36% +0.16%
==========================================
Files 63 63
Lines 5545 5505 -40
==========================================
- Hits 3172 3158 -14
+ Misses 2209 2180 -29
- Partials 164 167 +3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor changes look good, although I believe that there are changes that are not related to the duplicated code. Please undo those and open new issues/PRs to review them individually
x/evm/keeper/state_transition.go
Outdated
@@ -314,72 +338,40 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo | |||
ret, leftoverGas, vmErr = evm.Call(sender, *msg.To(), msg.Data(), leftoverGas, msg.Value()) | |||
} | |||
|
|||
refundQuotient := params.RefundQuotient | |||
refundQuotient := ethparams.RefundQuotient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module name is in conflict with the variable name, thus the rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I think you can undo this with the latest change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
5881c0e
to
388e413
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, minor comments. Pending changelog entry
x/evm/keeper/state_transition.go
Outdated
@@ -314,72 +338,40 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo | |||
ret, leftoverGas, vmErr = evm.Call(sender, *msg.To(), msg.Data(), leftoverGas, msg.Value()) | |||
} | |||
|
|||
refundQuotient := params.RefundQuotient | |||
refundQuotient := ethparams.RefundQuotient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, I think you can undo this with the latest change
fixed, changelog added. |
The test-solidity test case failure seems to also happens on the main branch, I've opened an issue for that: #690 |
@yihuang there seems to be a significant performance regression, can you check that? |
Closes: evmos#672 Solution: - move gas refund out from ApplyMessage - move check into ApplyMessage - move evm construction into ApplyMessage - ensure context stack is clean after ApplyMessage return fix unit tests undo rename add underflow check
- don't duplicate params loading - passing EVMConfig around as pointer
it seems fixed. |
* Problem: state transition code is duplicated Closes: evmos#672 Solution: - move gas refund out from ApplyMessage - move check into ApplyMessage - move evm construction into ApplyMessage - ensure context stack is clean after ApplyMessage return fix unit tests undo rename add underflow check * improve performance - don't duplicate params loading - passing EVMConfig around as pointer
Closes: #672
Description
The refactor is separated into three commits:
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)