internal/ethapi: reject non-replay-protected txs over RPC (#22339)

This PR prevents users from submitting transactions without EIP-155 enabled. This behaviour can be overridden by specifying the flag --rpc.allow-unprotected-txs=true.
This commit is contained in:
Marius van der Wijden
2021-02-23 13:09:19 +01:00
committed by GitHub
parent c4a2b682ff
commit 142fbcfd6f
9 changed files with 39 additions and 10 deletions

View File

@ -41,9 +41,10 @@ import (
// EthAPIBackend implements ethapi.Backend for full nodes
type EthAPIBackend struct {
extRPCEnabled bool
eth *Ethereum
gpo *gasprice.Oracle
extRPCEnabled bool
allowUnprotectedTxs bool
eth *Ethereum
gpo *gasprice.Oracle
}
// ChainConfig returns the active chain configuration.
@ -292,6 +293,10 @@ func (b *EthAPIBackend) ExtRPCEnabled() bool {
return b.extRPCEnabled
}
func (b *EthAPIBackend) UnprotectedAllowed() bool {
return b.allowUnprotectedTxs
}
func (b *EthAPIBackend) RPCGasCap() uint64 {
return b.eth.config.RPCGasCap
}