From a8475dce5ac14bc00ef4cddb55f6caf5005974a6 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 15 Feb 2023 09:47:24 +0100 Subject: [PATCH 1/2] eth/catalyst: send INVALID instead of INVALID_BLOCK_HASH --- beacon/engine/errors.go | 2 -- eth/catalyst/api.go | 2 +- eth/catalyst/api_test.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/beacon/engine/errors.go b/beacon/engine/errors.go index b2f31139256f..fe1137e0041d 100644 --- a/beacon/engine/errors.go +++ b/beacon/engine/errors.go @@ -74,8 +74,6 @@ var ( // - newPayloadV1: if the payload was accepted, but not processed (side chain) ACCEPTED = "ACCEPTED" - INVALIDBLOCKHASH = "INVALID_BLOCK_HASH" - GenericServerError = &EngineAPIError{code: -32000, msg: "Server error"} UnknownPayload = &EngineAPIError{code: -38001, msg: "Unknown payload"} InvalidForkChoiceState = &EngineAPIError{code: -38002, msg: "Invalid forkchoice state"} diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 00c4772185b1..cee9b2c508cc 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -448,7 +448,7 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData) (engine.Payloa block, err := engine.ExecutableDataToBlock(params) if err != nil { log.Debug("Invalid NewPayload params", "params", params, "error", err) - return engine.PayloadStatusV1{Status: engine.INVALIDBLOCKHASH}, nil + return engine.PayloadStatusV1{Status: engine.INVALID}, nil } // Stash away the last update to warn the user if the beacon client goes offline api.lastNewPayloadLock.Lock() diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index f7881415a434..f758ac7978b9 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -864,7 +864,7 @@ func TestInvalidBloom(t *testing.T) { if err != nil { t.Fatal(err) } - if status.Status != engine.INVALIDBLOCKHASH { + if status.Status != engine.INVALID { t.Errorf("invalid status: expected VALID got: %v", status.Status) } } From fc5b4fa68f2c158b1f462dbbae637cdfb9ad2416 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 15 Feb 2023 12:13:50 +0100 Subject: [PATCH 2/2] eth/catalyst: fix bad error msg --- eth/catalyst/api_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index f758ac7978b9..7155fb54d038 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -865,7 +865,7 @@ func TestInvalidBloom(t *testing.T) { t.Fatal(err) } if status.Status != engine.INVALID { - t.Errorf("invalid status: expected VALID got: %v", status.Status) + t.Errorf("invalid status: expected INVALID got: %v", status.Status) } }