Skip to content

Commit

Permalink
optimize hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Dec 2, 2024
1 parent 4ee51de commit 1c665b1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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",
Expand Down Expand Up @@ -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{
Expand All @@ -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",
}
Expand All @@ -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{
Expand All @@ -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",
}
Expand Down

0 comments on commit 1c665b1

Please sign in to comment.