diff --git a/core/state_processor.go b/core/state_processor.go index 0d84bbea51f7..e60e3c9096c3 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -93,6 +93,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg } func applyTransaction(msg types.Message, config *params.ChainConfig, author *common.Address, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) { + // check eip155 sign after EthPow block if config.IsEthPoWFork(blockNumber) && !tx.Protected() { return nil, types.ErrUnexpectedProtection } diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 939dd69396f3..d8d47521e1cf 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -731,10 +731,10 @@ func (s *BlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) m } // GetBlockByNumber returns the requested canonical block. -// * When blockNr is -1 the chain head is returned. -// * When blockNr is -2 the pending chain head is returned. -// * When fullTx is true all transactions in the block are returned, otherwise -// only the transaction hash is returned. +// - When blockNr is -1 the chain head is returned. +// - When blockNr is -2 the pending chain head is returned. +// - When fullTx is true all transactions in the block are returned, otherwise +// only the transaction hash is returned. func (s *BlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { block, err := s.b.BlockByNumber(ctx, number) if block != nil && err == nil { @@ -1660,6 +1660,10 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c // Ensure only eip155 signed transactions are submitted if EIP155Required is set. return common.Hash{}, errors.New("only replay-protected (EIP-155) transactions allowed over RPC") } + // check eip155 sign after EthPow block + if b.ChainConfig().IsEthPoWFork(b.CurrentBlock().Number()) && !tx.Protected() { + return common.Hash{}, types.ErrUnexpectedProtection + } if err := b.SendTx(ctx, tx); err != nil { return common.Hash{}, err }