Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 14 additions & 7 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,21 @@ func (st *StateTransition) buyGas() error {
}

func (st *StateTransition) preCheck() error {
// Only check transactions that are not fake
if !st.msg.IsFake() {
// Make sure the sender is an EOA
code := st.state.GetCode(st.msg.From())
_, delegated := types.ParseDelegation(code)
if len(code) > 0 && !delegated {
// If the sender on L1 is a (delegated) EOA, then it must be a (delegated) EOA on L2, too.
// If the sender on L1 is a contract, then we apply address aliasing.
// The probability that the aliased address happens to be a smart contract on L2 is negligible.
return fmt.Errorf("%w: address %v, len(code): %d", ErrSenderNoEOA, st.msg.From().Hex(), len(code))
}
}

if st.msg.IsL1MessageTx() {
// No fee fields to check, no nonce to check, and no need to check if EOA (L1 already verified it for us)
// No fee fields to check, no nonce to check
// Gas is free, but no refunds!
st.gas += st.msg.Gas()
st.initialGas = st.msg.Gas()
Expand All @@ -291,12 +304,6 @@ func (st *StateTransition) preCheck() error {
return fmt.Errorf("%w: address %v, nonce: %d", ErrNonceMax,
st.msg.From().Hex(), stNonce)
}
// Make sure the sender is an EOA
code := st.state.GetCode(st.msg.From())
_, delegated := types.ParseDelegation(code)
if len(code) > 0 && !delegated {
return fmt.Errorf("%w: address %v, len(code): %d", ErrSenderNoEOA, st.msg.From().Hex(), len(code))
}
}
// Make sure that transaction gasFeeCap is greater than the baseFee (post london)
// Note: Logically, this should be `IsCurie`, but we keep `IsLondon` to ensure backward compatibility.
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 25 // Patch version component of the current release
VersionPatch = 26 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down
Loading