Skip to content

Commit

Permalink
Replace INVALID_BLOCK_HASH with INVALID (#6671)
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis authored Jan 23, 2023
1 parent 8dda361 commit aa5b79f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ethdb/privateapi/ethbackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,17 @@ func (s *EthBackendServer) EngineNewPayload(ctx context.Context, req *types2.Exe
blockHash := gointerfaces.ConvertH256ToHash(req.BlockHash)
if header.Hash() != blockHash {
log.Error("[NewPayload] invalid block hash", "stated", libcommon.Hash(blockHash), "actual", header.Hash())
return &remote.EnginePayloadStatus{Status: remote.EngineStatus_INVALID_BLOCK_HASH}, nil
return &remote.EnginePayloadStatus{
Status: remote.EngineStatus_INVALID,
ValidationError: "invalid block hash",
}, nil
}

for _, txn := range req.Transactions {
if types.TypedTransactionMarshalledAsRlpString(txn) {
log.Warn("[NewPayload] typed txn marshalled as RLP string", "txn", common.Bytes2Hex(txn))
return &remote.EnginePayloadStatus{
Status: remote.EngineStatus_INVALID,
LatestValidHash: nil,
ValidationError: "typed txn marshalled as RLP string",
}, nil
}
Expand All @@ -338,7 +340,6 @@ func (s *EthBackendServer) EngineNewPayload(ctx context.Context, req *types2.Exe
log.Warn("[NewPayload] failed to decode transactions", "err", err)
return &remote.EnginePayloadStatus{
Status: remote.EngineStatus_INVALID,
LatestValidHash: nil,
ValidationError: err.Error(),
}, nil
}
Expand Down

0 comments on commit aa5b79f

Please sign in to comment.