Skip to content

Commit

Permalink
update core/state_processor.go
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Dec 29, 2023
1 parent bc880b6 commit 314605a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rollup/fees"
)

// StateProcessor is a basic Processor, which takes care of transitioning
Expand Down Expand Up @@ -109,8 +110,13 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
txContext := NewEVMTxContext(msg)
evm.Reset(txContext, statedb)

l1DataFee, err := fees.CalculateL1DataFee(tx, statedb)
if err != nil {
return nil, err
}

// Apply the transaction to the current state (included in the env).
result, err := ApplyMessage(evm, msg, gp)
result, err := ApplyMessage(evm, msg, gp, l1DataFee)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -151,6 +157,7 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
receipt.BlockHash = blockHash
receipt.BlockNumber = blockNumber
receipt.TransactionIndex = uint(statedb.TxIndex())
receipt.L1Fee = result.L1DataFee
return receipt, err
}

Expand Down

0 comments on commit 314605a

Please sign in to comment.