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

[R4R]-{develop}: fix ignore error in NewStateTransition of l2geth #1295

Merged
merged 5 commits into from
Jul 18, 2023
Merged
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions l2geth/core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,28 @@ func IntrinsicGas(data []byte, contractCreation, isHomestead bool, isEIP2028 boo
func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition {
l1Fee := new(big.Int)
daFee := new(big.Int)
var err error
gasPrice := msg.GasPrice()
if rcfg.UsingBVM {
if msg.GasPrice().Cmp(common.Big0) != 0 {
// Compute the L1 fee before the state transition
// so it only has to be read from state one time.
l1Fee, _ = fees.CalculateL1MsgFee(msg, evm.StateDB, nil)
l1Fee, err = fees.CalculateL1MsgFee(msg, evm.StateDB, nil)
if err != nil {
log.Error("calculate l1 message fee fail", "err", err)
return &StateTransition{}
}
charge := evm.StateDB.GetState(rcfg.L2GasPriceOracleAddress, rcfg.ChargeSlot).Big()
if charge.Cmp(common.Big0) == 0 {
gasPrice = common.Big0
}
daCharge := evm.StateDB.GetState(rcfg.L2GasPriceOracleAddress, rcfg.DaSwitchSlot).Big()
if daCharge.Cmp(common.Big1) == 0 {
daFee, _ = fees.CalculateDAMsgFee(msg, evm.StateDB, nil)
daFee, err = fees.CalculateDAMsgFee(msg, evm.StateDB, nil)
if err != nil {
log.Error("calculate mantle da message fee fail", "err", err)
return &StateTransition{}
}
}
}
}
Expand Down
Loading