|
|
|
@ -17,6 +17,7 @@ |
|
|
|
|
package core |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"errors" |
|
|
|
|
"fmt" |
|
|
|
|
"math" |
|
|
|
|
"math/big" |
|
|
|
@ -444,10 +445,15 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { |
|
|
|
|
vmerr error // vm errors do not effect consensus and are therefore not assigned to err
|
|
|
|
|
) |
|
|
|
|
if contractCreation { |
|
|
|
|
ret, _, st.gasRemaining, vmerr = st.evm.Create(sender, msg.Data, st.gasRemaining, value) |
|
|
|
|
ret, _, st.gasRemaining, vmerr = st.evm.Create(sender, msg.Data, st.gasRemaining, value, rules.IsPrague) |
|
|
|
|
// Special case for EOF, if the initcode or deployed code is
|
|
|
|
|
// invalid, the tx is considered valid (so update nonce), but
|
|
|
|
|
// gas for initcode execution is not consumed.
|
|
|
|
|
// Only intrinsic creation transaction costs are charged.
|
|
|
|
|
if errors.Is(vmerr, vm.ErrInvalidEOFInitcode) { |
|
|
|
|
st.state.SetNonce(msg.From, st.state.GetNonce(sender.Address())+1) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// Increment the nonce for the next transaction
|
|
|
|
|
st.state.SetNonce(msg.From, st.state.GetNonce(sender.Address())+1) |
|
|
|
|
ret, st.gasRemaining, vmerr = st.evm.Call(sender, st.to(), msg.Data, st.gasRemaining, value) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|