Skip to content

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
("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.

4 participants