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

evm: add blobgasfee eip 7516 #3035

Merged
merged 8 commits into from
Sep 19, 2023
Merged

evm: add blobgasfee eip 7516 #3035

merged 8 commits into from
Sep 19, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Sep 18, 2023

for devnet 9 (included in cancun) - ethereum/pm#857

EIP https://eips.ethereum.org/EIPS/eip-7516

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #3035 (f8e3152) into master (bd70544) will increase coverage by 0.33%.
The diff coverage is 90.69%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.73% <ø> (ø)
blockchain 92.58% <ø> (ø)
client 87.57% <ø> (+0.03%) ⬆️
common 98.19% <100.00%> (+<0.01%) ⬆️
ethash ∅ <ø> (∅)
evm 71.74% <85.71%> (+0.04%) ⬆️
rlp ∅ <ø> (?)
statemanager 89.91% <ø> (ø)
trie 90.56% <ø> (-0.04%) ⬇️
tx 96.35% <ø> (ø)
util 86.78% <ø> (ø)
vm ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

I'm assuming there may be more to come here but left a couple of cleanup notes related to code comments and casing.

minimumHardfork: Hardfork.London,
requiredEIPs: [4844],
gasPrices: {
blobbasefee: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
blobbasefee: {
blobBaseFee: {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually the opcode gas fee lookup in evm is:

      const baseFee = Number(common.param('gasPrices', opcodeBuilder[key].name.toLowerCase()))

so it has to be all lowercase i think

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right. I loked across the eips.ts file and there's no consistency here. Just a silly thought but maybe a follow-up PR is to just make all of the gasPrices fields in common/src/eips lowercase so we can drop that toLowerCase call here. That's certainly a small performance gain for every single time we get the base fee.

Copy link
Member

Choose a reason for hiding this comment

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

@acolytec3 Note that the line which @g11tech references to is in codes.ts of EVM (the opcode builder). The opcode builder expects all to be opcode names in common to be lowercase. Note: this method is only called if we get new opcodes (at EVM startup + fork transition) so this is not called each time for all opcodes if one is called.

Copy link
Member

Choose a reason for hiding this comment

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

Won't die on this hill but in most cases we do have the camel case and I do somewhat like it for readability, but it is also true that this is a lot more inconsistent than I anticipated when looking through Common naming. Atm we can't update anyhow since this would be a breaking change.

So for here I guess we can keep both ways.

packages/evm/src/interpreter.ts Outdated Show resolved Hide resolved
@g11tech
Copy link
Contributor Author

g11tech commented Sep 18, 2023

I'm assuming there may be more to come here but left a couple of cleanup notes related to code comments and casing.

thanks for the code comments, updated

check casing response. should be good for review/merge now

g11tech and others added 2 commits September 18, 2023 21:19
Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
comment: 'BLOBBASEFEE opcode',
url: 'https://eips.ethereum.org/EIPS/eip-7516',
status: Status.Draft,
minimumHardfork: Hardfork.London,
Copy link
Member

Choose a reason for hiding this comment

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

London is too low, should be Shanghai

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated min hf to Cancun as blobs will be coming Cancun onwards

Copy link
Member

Choose a reason for hiding this comment

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

Ah, no, that's always the same discussion: the definition of this is "the minimum HF where this EIP (+ eventually other EIPs which are necessary for this one, so this would be 4844, but this part is covered by the EIP dependency setting) can be run in isolation". So this would be Shanghai.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to Paris post discussion to confirm with 4844 settings 👍

acolytec3 and others added 2 commits September 18, 2023 16:00
Co-authored-by: Scorbajio <indigophi@protonmail.com>
throw new Error('Block has no Blob Base Fee')
}
return blobBaseFee
}
Copy link
Member

Choose a reason for hiding this comment

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

Not so deep in the blob pricing topic: so is "blobBaseFee === blobGasPrice" here?

If so: I think we then should consider still renaming all blobGasPrice related naming in Block to blobBaseFee? (we can still do since all 4844 functionality is still non-final)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the confusion is real- here is an actual discussion happening on it lol:

https://discord.com/channels/595666850260713488/745077610685661265/1153600913932554270

Copy link
Member

Choose a reason for hiding this comment

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

Guess we might want to wait with merging here until this is settled? 🤔 Since this is the very last question on ACD channel and still un-answered?

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerd77 holgerd77 merged commit b6eb329 into master Sep 19, 2023
42 checks passed
@holgerd77 holgerd77 deleted the opcode-blobgasfee branch September 19, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants