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

Introduce a 32 gas minimum base fee equivalent for including an entry in ACL #6

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions EIPS/eip-000.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
eip: 0

Check failure on line 2 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

file name must reflect the preamble header `eip`

error[preamble-file-name]: file name must reflect the preamble header `eip` --> EIPS/eip-000.md:2:5 | 2 | eip: 0 | ^^ this value | = help: this file's name should be `eip-0.md` = help: see https://ethereum.github.io/eipw/preamble-file-name/

Check failure on line 2 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

file name must reflect the preamble header `eip`

error[preamble-file-name]: file name must reflect the preamble header `eip` --> EIPS/eip-000.md:2:5 | 2 | eip: 0 | ^^ this value | = help: this file's name should be `eip-0.md` = help: see https://ethereum.github.io/eipw/preamble-file-name/

Check failure on line 2 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

file name must reflect the preamble header `eip`

error[preamble-file-name]: file name must reflect the preamble header `eip` --> EIPS/eip-000.md:2:5 | 2 | eip: 0 | ^^ this value | = help: this file's name should be `eip-0.md` = help: see https://ethereum.github.io/eipw/preamble-file-name/
title: Global Warming
description: Block-level warming of addresses and slots with access lists
author: Yoav Weiss (@yoavw), Alex Forshtat (@forshtat), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn)
discussions-to:

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` is not a valid URL

error[preamble-discussions-to]: preamble header `discussions-to` is not a valid URL --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | relative URL without a base | = help: see https://ethereum.github.io/eipw/preamble-discussions-to/

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` should point to a thread on ethereum-magicians.org

error[preamble-re-discussions-to]: preamble header `discussions-to` should point to a thread on ethereum-magicians.org --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | required pattern was not matched | = info: the pattern in question: `^https://ethereum-magicians.org/t/[^/]+/[0-9]+$` = help: see https://ethereum.github.io/eipw/preamble-re-discussions-to/

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` is not a valid URL

error[preamble-discussions-to]: preamble header `discussions-to` is not a valid URL --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | relative URL without a base | = help: see https://ethereum.github.io/eipw/preamble-discussions-to/

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` should point to a thread on ethereum-magicians.org

error[preamble-re-discussions-to]: preamble header `discussions-to` should point to a thread on ethereum-magicians.org --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | required pattern was not matched | = info: the pattern in question: `^https://ethereum-magicians.org/t/[^/]+/[0-9]+$` = help: see https://ethereum.github.io/eipw/preamble-re-discussions-to/

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` is not a valid URL

error[preamble-discussions-to]: preamble header `discussions-to` is not a valid URL --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | relative URL without a base | = help: see https://ethereum.github.io/eipw/preamble-discussions-to/

Check failure on line 6 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `discussions-to` should point to a thread on ethereum-magicians.org

error[preamble-re-discussions-to]: preamble header `discussions-to` should point to a thread on ethereum-magicians.org --> EIPS/eip-000.md:6:16 | 6 | discussions-to: | required pattern was not matched | = info: the pattern in question: `^https://ethereum-magicians.org/t/[^/]+/[0-9]+$` = help: see https://ethereum.github.io/eipw/preamble-re-discussions-to/
status: Draft
type: Standards Track
category: Core
Expand Down Expand Up @@ -149,6 +149,16 @@
As all transactions in the same block pay exactly the same `baseFeePerGas`, the single cost of accessing a cold item is
divided evenly among all transactions containing such access and the rest of the burned base fee is refunded.

### Setting an absolute minimal cost of cold state access

If a large number of transactions all access the same addresses or slots, the cost of each cold access may get
way too low which may represent a potential DoS attack vector.

In order to prevent that, the gas cost of including an entity in the access list cannot be lower
than `MIN_ACCESS_LIST_ENTRY_COST`, which is set to `32 gas`.

This value is equivalent to the calldata cost of including two bytes long identifier of entries in `block_access_list`.

### Calculating a refund of the charged priority fee

Each transaction pays an individual `priorityFeePerGas` value and redistributing this part of the cold access cost
Expand Down Expand Up @@ -230,7 +240,8 @@
for (let i = 0; i < sortedAccessDetails.length; i++) {
const accessor = sortedAccessDetails[i]
const refund = refunds.get(accessor.sender) ?? { refundFromBurn: 0n, refundFromCoinbase: 0n }
refund.refundFromBurn += BigInt(Math.floor(parseInt(accessGasCost) * parseInt(baseFeePerGas) * refundPercent))
const adjustedAccessGasCost = Math.max(MIN_ACCESS_LIST_ENTRY_COST, parseInt(accessGasCost) * refundPercent)
refund.refundFromBurn += BigInt(adjustedAccessGasCost * parseInt(baseFeePerGas))
refund.refundFromCoinbase += BigInt(refundsFromCoinbase[i])
refunds.set(accessor.sender, refund)
}
Expand Down Expand Up @@ -263,7 +274,10 @@
const refunds = [Math.floor(totalRefund * topTransactionContribution / totalContributions)]
for (let i = 1; i < sortedAccesses.length; i++) {
const charge = parseInt(sortedAccesses[i].priorityFeePerGas) * parseInt(accessGasCost)
refunds.push(Math.floor(totalRefund * charge / totalContributions))
const calldataCharge = parseInt(sortedAccesses[i].priorityFeePerGas) * MIN_ACCESS_LIST_ENTRY_COST
const refundToCalldata = charge - calldataCharge
const refundToContribution = Math.floor(totalRefund * charge / totalContributions)
refunds.push(Math.min(refundToCalldata, refundToContribution))
}
return refunds
}
Expand Down Expand Up @@ -317,7 +331,7 @@

### Current cold storage gas cost is unfair

As described in the [Motivation](#Motivation) section, the amount of gas that users spend on accessing the contract code does not reflect the actual cost of this access for the block builder or a validator.

Check failure on line 334 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

EIPS/eip-000.md:334:21 MD051/link-fragments Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

Check failure on line 334 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

EIPS/eip-000.md:334:21 MD051/link-fragments Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

Check failure on line 334 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

EIPS/eip-000.md:334:21 MD051/link-fragments Link fragments should be valid [Expected: #motivation; Actual: #Motivation] [Context: "[Motivation](#Motivation)"]

The more popular the contract code or a storage slot is, the more transactions in each block should share the cost. However, the current system multiplies the cost for the users instead of dividing it.

Expand All @@ -341,11 +355,11 @@
This proposal does not introduce a change to any behavior that can be observed by a smart contract during its execution. The only effect this change has is a lower effective gas cost for the transaction senders.


## Test cases

Check failure on line 358 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> EIPS/eip-000.md | 358 | ## Test cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check failure on line 358 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> EIPS/eip-000.md | 358 | ## Test cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check failure on line 358 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> EIPS/eip-000.md | 358 | ## Test cases | = help: see https://ethereum.github.io/eipw/markdown-order-section/

This repository contains all the test cases and related work:

https://github.com/eth-infinitism/global-warming-test-cases

Check failure on line 362 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-000.md | 362 | https://github.com/eth-infinitism/global-warming-test-cases | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

Check failure on line 362 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-000.md | 362 | https://github.com/eth-infinitism/global-warming-test-cases | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

Check failure on line 362 in EIPS/eip-000.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-000.md | 362 | https://github.com/eth-infinitism/global-warming-test-cases | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

## Security Considerations

Expand Down
Loading