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

[wip] core: implement eip-7623: increase calldata cost #29040

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MariusVanDerWijden
Copy link
Member

Draft implementation for discussion

@vbuterin
Copy link
Contributor

The floor implementation looks like it's counting bytes rather than tokens?

dataLen := uint64(len(data))

What I think you want is something like:

TokensPerNonzeroByteFrontier uint64 = 17
TokensPerNonzeroByte uint64 = 4
TxTokenGas uint64 = 4
CostFloorPerToken7623 uint64 = 17

tokensPerNonzeroByte = params.TokensPerNonzeroByteFrontier

if isEIP2028 {
    tokensPerNonzeroByte = params.tokensPerNonzeroByte
}
dataTokens = z + nz * TokensPerNonzeroByte
gasForData = dataTokens * params.TxTokenGas
floor := params.CostFloorPerToken7623 * dataTokens

@MariusVanDerWijden
Copy link
Member Author

MariusVanDerWijden commented Feb 28, 2024

Yep, you're right. We have not had the concept of tokens yet, so I got a bit confused.
It should be okay now

edit: (nvm, the contract creation gas is still in the max, fixing...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants