mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Support base fee vault (#13)
This commit is contained in:
parent
621aabde9e
commit
a1b6b2229a
2 changed files with 9 additions and 1 deletions
|
|
@ -506,6 +506,12 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
|
||||||
st.state.AddBalance(st.evm.Context.Coinbase, fee)
|
st.state.AddBalance(st.evm.Context.Coinbase, fee)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <specular modification>
|
||||||
|
if (st.evm.ChainConfig().L2BaseFeeRecipient != common.Address{}) {
|
||||||
|
st.state.AddBalance(st.evm.ChainConfig().L2BaseFeeRecipient, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.evm.Context.BaseFee))
|
||||||
|
}
|
||||||
|
// </specular modification>
|
||||||
|
|
||||||
return &ExecutionResult{
|
return &ExecutionResult{
|
||||||
UsedGas: st.gasUsed(),
|
UsedGas: st.gasUsed(),
|
||||||
Err: vmerr,
|
Err: vmerr,
|
||||||
|
|
|
||||||
|
|
@ -336,6 +336,7 @@ type ChainConfig struct {
|
||||||
|
|
||||||
// <specular modification>
|
// <specular modification>
|
||||||
EnableL2EngineApi bool `json:"enableL2EngineApi,omitempty"`
|
EnableL2EngineApi bool `json:"enableL2EngineApi,omitempty"`
|
||||||
|
L2BaseFeeRecipient common.Address `json:"l2BaseFeeRecipient,omitempty"`
|
||||||
// <specular modification/>
|
// <specular modification/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -372,6 +373,7 @@ func (c *ChainConfig) Description() string {
|
||||||
// <specular modification>
|
// <specular modification>
|
||||||
case c.EnableL2EngineApi:
|
case c.EnableL2EngineApi:
|
||||||
banner += "Consensus: L2 gas limit API enabled\n"
|
banner += "Consensus: L2 gas limit API enabled\n"
|
||||||
|
banner += fmt.Sprintf(" - L2 Base fee recipient: %s\n", c.L2BaseFeeRecipient)
|
||||||
// <specular modification/>
|
// <specular modification/>
|
||||||
case c.Ethash != nil:
|
case c.Ethash != nil:
|
||||||
if c.TerminalTotalDifficulty == nil {
|
if c.TerminalTotalDifficulty == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue