-
Notifications
You must be signed in to change notification settings - Fork 75
[ETCM-912] Magneto gas changes for BALANCE and *CALL codes #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9bcbb6e
to
aa23ecf
Compare
@@ -191,7 +191,8 @@ class CallOpFixture(val config: EvmConfig, val startState: MockWorldState) { | |||
inOffset: UInt256 = UInt256.Zero, | |||
inSize: UInt256 = inputData.size, | |||
outOffset: UInt256 = inputData.size, | |||
outSize: UInt256 = inputData.size / 2 | |||
outSize: UInt256 = inputData.size / 2, | |||
toAccessed: Boolean = false |
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.
Actually, I had to look into the code to understand what this field was about.
I would have prefered something more descriptive like addAddressToAccessList
or keepTrackOfAccessAddresses
, but I tend to belong to the long-name-team.
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.
WDYT about toAlreadyAccessed
?
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.
it seems clearer for me.
|
||
import Fixtures.blockchainConfig | ||
|
||
class MagnetoCallOpFixture(config: EvmConfig) |
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.
Most of the tests seem to have be taken directly from CallOpcodesSpec
.
It could be nice to keep unmodified tests in one place only, and have specific gas ones separated.
It seems to be possible to have something like that:
CallOpCodesCommonBehaviour
: with the common testsCallOpCodesSpec
: with the pre eip2929 gas testsCallOpCodesSpecPostEip2929
: with post eip 2929 gas tests
This kind of separation seems to be possible: https://www.scalatest.org/user_guide/sharing_tests
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.
I reduced as much duplication as possible, moved common assertions to a trait
postWarmGasFn: FeeSchedule => BigInt | ||
): BigInt = { | ||
val currentBlockNumber = state.env.blockHeader.number | ||
val etcFork = state.config.blockchainConfig.etcForkForBlockNumber(currentBlockNumber) |
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.
do you mind adding a note that ETH needs to be also handled?
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.
LGTM
aa23ecf
to
3740dbd
Compare
3740dbd
to
1a3ca6a
Compare
000dc2d
to
e487da7
Compare
No description provided.