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

EIP-4844-pectra (collect blob gas fee) #12574

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ type StateTransition struct {
//some pre-allocated intermediate variables
sharedBuyGas *uint256.Int
sharedBuyGasBalance *uint256.Int

isBor bool
}

// Message represents a message sent to a contract.
Expand Down Expand Up @@ -127,7 +125,6 @@ func IntrinsicGas(data []byte, accessList types2.AccessList, isContractCreation

// NewStateTransition initialises and returns a new state transition object.
func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition {
isBor := evm.ChainConfig().Bor != nil
return &StateTransition{
gp: gp,
evm: evm,
Expand All @@ -141,8 +138,6 @@ func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition

sharedBuyGas: uint256.NewInt(0),
sharedBuyGasBalance: uint256.NewInt(0),

isBor: isBor,
somnathb1 marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down Expand Up @@ -481,6 +476,10 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*evmtype
if burntContractAddress != nil {
burnAmount := new(uint256.Int).Mul(new(uint256.Int).SetUint64(st.gasUsed()), st.evm.Context.BaseFee)
st.state.AddBalance(*burntContractAddress, burnAmount, tracing.BalanceChangeUnspecified)
if rules.IsAura && rules.IsPrague {
// https://github.com/gnosischain/specs/blob/master/network-upgrades/pectra.md#eip-4844-pectra
st.state.AddBalance(*burntContractAddress, st.evm.BlobFee, tracing.BalanceChangeUnspecified)
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ type Config struct {
TargetBlobGasPerBlock *uint64 `json:"targetBlobGasPerBlock,omitempty"`
BlobGasPriceUpdateFraction *uint64 `json:"blobGasPriceUpdateFraction,omitempty"`

// (Optional) governance contract where EIP-1559 fees will be sent to that otherwise would be burnt since the London fork
// (Optional) governance contract where EIP-1559 fees will be sent to, which otherwise would be burnt since the London fork.
// A key corresponds to the block number, starting from which the fees are sent to the address (map value).
// Starting from Prague, EIP-4844 fees might be collected as well:
// see https://github.com/gnosischain/specs/blob/master/network-upgrades/pectra.md#eip-4844-pectra.
BurntContract map[string]common.Address `json:"burntContract,omitempty"`

// (Optional) deposit contract of PoS chains
Expand Down
Loading