From 34336062736dd4f2433172c62780bb017d924fbc Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Mon, 5 Dec 2022 10:57:46 -0800 Subject: [PATCH] op-geth: don't error on receipt deserialization on startup (#34) Part of the boot process looks at receipts in the database to determine which schema is used. When booting with legacy optimism style receipts in the database, an error message is shown on boot. This error message doesn't do anything, but this commit fixes the problem. If when checking for legacy receipts and `true` is returned, then geth will shutdown and tell the user to run a migration command to migrate to newer style receipts. We return `false` to prevent geth from shutting down. Further investigation is needed to ensure that having these receipts in the database won't cause any issues, we may need to migrate them similarly to the tool that the geth team wrote to upgrade the receipt serialization. --- core/types/legacy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/types/legacy.go b/core/types/legacy.go index 14ed30d883d4..e33b1ec1833a 100644 --- a/core/types/legacy.go +++ b/core/types/legacy.go @@ -39,6 +39,10 @@ func IsLegacyStoredReceipts(raw []byte) (bool, error) { if err := rlp.DecodeBytes(raw, &v5); err == nil { return false, nil } + var legacyOptimism []LegacyOptimismStoredReceiptRLP + if err := rlp.DecodeBytes(raw, &legacyOptimism); err == nil { + return false, nil + } return false, errors.New("value is not a valid receipt encoding") }