mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
review comments, pt. 1
This commit is contained in:
parent
e3cd999230
commit
33400fb152
4 changed files with 9 additions and 7 deletions
|
|
@ -135,7 +135,7 @@ func ApplyTransactionWithEVM(msg *Message, config *params.ChainConfig, gp *GasPo
|
||||||
}
|
}
|
||||||
*usedGas += result.UsedGas
|
*usedGas += result.UsedGas
|
||||||
|
|
||||||
return MakeReceipt(evm, result, statedb, blockNumber, blockHash, tx, *usedGas, root), err
|
return MakeReceipt(evm, result, statedb, blockNumber, blockHash, tx, *usedGas, root), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeReceipt generates the receipt object for a transaction given its execution result.
|
// MakeReceipt generates the receipt object for a transaction given its execution result.
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,9 @@ type Message struct {
|
||||||
// account nonce in state.
|
// account nonce in state.
|
||||||
// This field will be set to true for operations like RPC eth_call.
|
// This field will be set to true for operations like RPC eth_call.
|
||||||
SkipNonceChecks bool
|
SkipNonceChecks bool
|
||||||
// When SkipFromEoACheck is true, the message sender is not checked to be an EOA.
|
|
||||||
SkipFromEoACheck bool
|
// When SkipFromEOACheck is true, the message sender is not checked to be an EOA.
|
||||||
|
SkipFromEOACheck bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// TransactionToMessage converts a transaction into a Message.
|
// TransactionToMessage converts a transaction into a Message.
|
||||||
|
|
@ -163,7 +164,7 @@ func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.In
|
||||||
Data: tx.Data(),
|
Data: tx.Data(),
|
||||||
AccessList: tx.AccessList(),
|
AccessList: tx.AccessList(),
|
||||||
SkipNonceChecks: false,
|
SkipNonceChecks: false,
|
||||||
SkipFromEoACheck: false,
|
SkipFromEOACheck: false,
|
||||||
BlobHashes: tx.BlobHashes(),
|
BlobHashes: tx.BlobHashes(),
|
||||||
BlobGasFeeCap: tx.BlobGasFeeCap(),
|
BlobGasFeeCap: tx.BlobGasFeeCap(),
|
||||||
}
|
}
|
||||||
|
|
@ -297,7 +298,7 @@ func (st *StateTransition) preCheck() error {
|
||||||
msg.From.Hex(), stNonce)
|
msg.From.Hex(), stNonce)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !msg.SkipFromEoACheck {
|
if !msg.SkipFromEOACheck {
|
||||||
// Make sure the sender is an EOA
|
// Make sure the sender is an EOA
|
||||||
codeHash := st.state.GetCodeHash(msg.From)
|
codeHash := st.state.GetCodeHash(msg.From)
|
||||||
if codeHash != (common.Hash{}) && codeHash != types.EmptyCodeHash {
|
if codeHash != (common.Hash{}) && codeHash != types.EmptyCodeHash {
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,8 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy returns a copy of the precompiled contracts.
|
// Copy returns a copy of the precompiled contracts. The precompiled
|
||||||
|
// contracts are shallow-copied. It should be safe as they are stateless/immutable.
|
||||||
func (p PrecompiledContracts) Copy() PrecompiledContracts {
|
func (p PrecompiledContracts) Copy() PrecompiledContracts {
|
||||||
c := make(PrecompiledContracts)
|
c := make(PrecompiledContracts)
|
||||||
for k, v := range p {
|
for k, v := range p {
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,7 @@ func (args *TransactionArgs) ToMessage(baseFee *big.Int, skipNonceCheck, skipEoA
|
||||||
BlobGasFeeCap: (*big.Int)(args.BlobFeeCap),
|
BlobGasFeeCap: (*big.Int)(args.BlobFeeCap),
|
||||||
BlobHashes: args.BlobHashes,
|
BlobHashes: args.BlobHashes,
|
||||||
SkipNonceChecks: skipNonceCheck,
|
SkipNonceChecks: skipNonceCheck,
|
||||||
SkipFromEoACheck: skipEoACheck,
|
SkipFromEOACheck: skipEoACheck,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue