From 1c665b176c47cd9af50e8690b161359a499e41c2 Mon Sep 17 00:00:00 2001 From: blxdyx Date: Mon, 2 Dec 2024 10:37:23 +0800 Subject: [PATCH] optimize hot fix --- core/state/state_object.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index 364ae388817..ec9b3e8fe83 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -174,6 +174,10 @@ type HotFixPattern struct { } func (so *stateObject) patchGethHotFixMainnet1() { + if so.db.blockNum != 33851236 || (so.db.txIndex != 88 && so.db.txIndex != 89) { + return + } + totalPatches := []HotFixPattern{} // patch 1: BlockNum 33851236, txIndex 89 patch1 := HotFixPattern{ @@ -191,9 +195,6 @@ func (so *stateObject) patchGethHotFixMainnet1() { addr: libcommon.HexToAddress("0x00000000001f8b68515EfB546542397d3293CCfd"), kvList: make(Storage), } - if so.db.blockNum != patch1.blockNumber { - return - } patch1KVs := map[string]string{ "0x0000000000000000000000000000000000000000000000000000000000000001": "0x00000000000000000000000052db206170b430da8223651d28830e56ba3cdc04", @@ -257,6 +258,9 @@ func (so *stateObject) patchGethHotFixMainnet1() { } func (so *stateObject) patchGethHotFixChapel1() { + if so.db.blockNum != 35547779 || so.db.txIndex != 196 { + return + } totalPatches := []HotFixPattern{} // patch 1: BlockNum 35547779, txIndex 196 patch1 := HotFixPattern{ @@ -266,9 +270,7 @@ func (so *stateObject) patchGethHotFixChapel1() { addr: libcommon.HexToAddress("0x89791428868131eb109e42340ad01eb8987526b2"), kvList: make(Storage), } - if so.db.blockNum != patch1.blockNumber && so.db.txIndex != patch1.txIndex { - return - } + patch1KVs := map[string]string{ "0xf1e9242398de526b8dd9c25d38e65fbb01926b8940377762d7884b8b0dcdc3b0": "0x0000000000000000000000000000000000000000000000f6a7831804efd2cd0a", } @@ -292,6 +294,9 @@ func (so *stateObject) patchGethHotFixChapel1() { } func (so *stateObject) patchGethHotFixChapel2() { + if so.db.blockNum != 35548081 || so.db.txIndex != 486 { + return + } totalPatches := []HotFixPattern{} // patch 1: BlockNum 35548081, txIndex 486 patch1 := HotFixPattern{ @@ -302,10 +307,6 @@ func (so *stateObject) patchGethHotFixChapel2() { kvList: make(Storage), } - if so.db.blockNum != patch1.blockNumber && so.db.txIndex != patch1.txIndex { - return - } - patch1KVs := map[string]string{ "0xf1e9242398de526b8dd9c25d38e65fbb01926b8940377762d7884b8b0dcdc3b0": "0x0000000000000000000000000000000000000000000000114be8ecea72b64003", }