Skip to content
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

TouchCodeHash warm cost charging #512

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented Oct 17, 2024

No description provided.

Signed-off-by: Ignacio Hagopian <[email protected]>
@jsign jsign changed the title extra fix TouchCodeHash warm cost charging Oct 17, 2024
func (aw *AccessWitness) TouchCodeHash(addr []byte, isWrite bool, useGasFn UseGasFn) bool {
func (aw *AccessWitness) TouchCodeHash(addr []byte, isWrite bool, useGasFn UseGasFn, warmCostCharging bool) bool {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The previous version always charged WARM cost. For the case we were fixing yesterday, where we include CODEHASH as intrinsic cost, this meant we were still charging 100 of gas (WARM).

With this change we allow this function to be signaled if we want (or not) to charge warm costs. There're two usages of this method: the one we were discussing yesterday, and EXTCODEHASH. For the former, warm cost is disabled. For the latter, it's enabled.

@jsign jsign requested a review from gballet October 17, 2024 10:25
@jsign jsign marked this pull request as ready for review October 17, 2024 10:25
Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM

@gballet gballet merged commit 8057173 into jsign-witness-fix Oct 17, 2024
3 of 6 checks passed
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.

2 participants