Skip to content

[ETCM-1066] Add EIP-2929 VM integration tests #1104

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

Merged
merged 2 commits into from
Aug 20, 2021

Conversation

lukasz-golebiewski
Copy link
Contributor

@lukasz-golebiewski lukasz-golebiewski commented Aug 19, 2021

Description

Adds tests for gas changes introduced in EIP-2929 that span across multiple opcodes

Also fixes a bug in which G_cold_account_access was charged incorrectly for storage access instead of G_cold_sload

@lukasz-golebiewski lukasz-golebiewski force-pushed the feature/etcm-1066/vm-integration-tests branch from e1b4500 to 3064cca Compare August 19, 2021 06:50
@@ -203,13 +210,13 @@ class OpCodeGasSpecPostEip2929 extends AnyFunSuite with OpCodeTesting with Match
val table = Table[UInt256, UInt256, Boolean, BigInt, BigInt](
("offset", "value", "alreadyAccessed", "startGas", "expectedGasConsumption"),
(0, 1, true, G_callstipend + 1, G_sload),
(0, 1, false, G_sload + G_cold_account_access, G_sload + G_cold_account_access),
(0, 1, false, G_callstipend + 1, G_sload + G_cold_sload),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why the '+1' here, but the yellow paper answered me: the call will fail if there is less than or EQUALS to G_callstipend gas left.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should start adding such tidbits of knowledge into the codebase.
//YP, page X, "quote"

@lukasz-golebiewski lukasz-golebiewski force-pushed the feature/etcm-1066/vm-integration-tests branch from 3064cca to 21960c6 Compare August 20, 2021 07:48
@lukasz-golebiewski lukasz-golebiewski merged commit 9178c64 into develop Aug 20, 2021
@lukasz-golebiewski lukasz-golebiewski deleted the feature/etcm-1066/vm-integration-tests branch August 20, 2021 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants