-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
core: implement blobfee opcode #28098
Conversation
core/evm.go
Outdated
@@ -64,6 +69,7 @@ func NewEVMBlockContext(header *types.Header, chain ChainContext, author *common | |||
Time: header.Time, | |||
Difficulty: new(big.Int).Set(header.Difficulty), | |||
BaseFee: baseFee, | |||
BlobFee: blobFee, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that most of these cases are in tests where we only set one or two of the fields. We can't really update them to use the constructor since that will need a header to populate the fields. We could theoretically create a constructor that will set every field, but that will result in a lot of NewBlockContext(nil, nil, .-.. nil)
. Also we pass the struct by value very often so most of the initializatios are actually BlockCOntext{}
3df5c8a
to
7d8ad92
Compare
7d8ad92
to
a09c7f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the ExcessBlobGas from the vm context, its redundant with the fee
if vmContext.ExcessBlobGas != nil { | ||
execRs.CurrentExcessBlobGas = (*math.HexOrDecimal64)(vmContext.ExcessBlobGas) | ||
if vmContext.BlobBaseFee != nil { | ||
// TODO (MariusVanDerWijden): I have no idea why we have this field at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea here is that if you provide parentExcessBlobGas
and parentBlobGasUsed
t8n will automatically calculate that block's excessBlobGas
. In these instances you would probably want the calculated value output so that you can pipe it in for the next transition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, sry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't think that this is really needed
@@ -138,7 +137,7 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta | |||
|
|||
if tx.Type() == types.BlobTxType { | |||
receipt.BlobGasUsed = uint64(len(tx.BlobHashes()) * params.BlobTxBlobGasPerBlob) | |||
receipt.BlobGasPrice = eip4844.CalcBlobFee(*evm.Context.ExcessBlobGas) | |||
receipt.BlobGasPrice = evm.Context.BlobBaseFee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come that the "gasprice" is calculated as the basefee? I mean, the base is only one part of the price, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no blob priority fee yet, so it's just base fee!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was ExcessBlobGas
exactly before?
And the concept of ExcessBlobGas
no longer exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Implements "EIP-7516: BLOBBASEFEE opcode" for cancun, as per spec: https://eips.ethereum.org/EIPS/eip-7516
Implements "EIP-7516: BLOBBASEFEE opcode" for cancun, as per spec: https://eips.ethereum.org/EIPS/eip-7516
Implements "EIP-7516: BLOBBASEFEE opcode" for cancun, as per spec: https://eips.ethereum.org/EIPS/eip-7516
Implements "EIP-7516: BLOBBASEFEE opcode" for cancun, as per spec: https://eips.ethereum.org/EIPS/eip-7516
This reverts commit 5585e79.
This reverts commit 5585e79.
implement BLOBBASEFEE opcode (0x4a) (ethereum#28098) Conflicts: core/evm.go core/vm/evm.go Both nitro and upstream added fields to BlockContextx. Using both. Additions: accounts/abi/bind/base.go eth/tracers/js/goja.go common.Address no longer has the Hash() function that we sometimes used. It now, however, has a Big() function. Previous calls to Address.Hash().Big() were converted to .Big()
Implements the https://eips.ethereum.org/EIPS/eip-7516 opcode for cancun