Skip to content

Commit dc3740c

Browse files
committed
Restrict data gas prechecks to only txs with data
1 parent 8b14002 commit dc3740c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/state_transition.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ func (st *StateTransition) preCheck() error {
294294
}
295295
}
296296
}
297-
if st.evm.ChainConfig().IsSharding(st.evm.Context.BlockNumber) {
297+
usesDataGas := len(st.msg.DataHashes()) != 0
298+
if usesDataGas && st.evm.ChainConfig().IsSharding(st.evm.Context.BlockNumber) {
298299
dataGasPrice := misc.GetDataGasPrice(st.evm.Context.ExcessDataGas)
299300
if dataGasPrice.Cmp(st.maxFeePerDataGas) > 0 {
300301
return fmt.Errorf("%w: address %v, maxFeePerDataGas: %v dataGasPrice: %v, excessDataGas: %v",

0 commit comments

Comments
 (0)