From dcb974dfb5ca23049ed6f51a32431db9390a3a51 Mon Sep 17 00:00:00 2001 From: taratorio <94537774+taratorio@users.noreply.github.com> Date: Sun, 28 Apr 2024 15:27:14 +0300 Subject: [PATCH 1/2] core/types: fix codecgen for go1.22 --- core/types/receipt_codecgen_gen.go | 290 ++++++++++++----------------- go.mod | 4 +- go.sum | 19 +- 3 files changed, 130 insertions(+), 183 deletions(-) diff --git a/core/types/receipt_codecgen_gen.go b/core/types/receipt_codecgen_gen.go index e2bc7db9db1..7bfcaf3d7ec 100644 --- a/core/types/receipt_codecgen_gen.go +++ b/core/types/receipt_codecgen_gen.go @@ -7,10 +7,11 @@ package types import ( "errors" - libcommon "github.com/ledgerwatch/erigon-lib/common" + pkg1_common "github.com/ledgerwatch/erigon-lib/common" codec1978 "github.com/ugorji/go/codec" pkg2_big "math/big" "runtime" + "sort" "strconv" ) @@ -31,7 +32,8 @@ const ( ) var ( - errCodecSelferOnlyMapOrArrayEncodeToStruct2 = errors.New(`only encoded map or array can be decoded into a struct`) + errCodecSelferOnlyMapOrArrayEncodeToStruct2 = errors.New(`only encoded map or array can be decoded into a struct`) + _ sort.Interface = nil ) type codecSelfer2 struct{} @@ -39,22 +41,51 @@ type codecSelfer2 struct{} func codecSelfer2False() bool { return false } func codecSelfer2True() bool { return true } +type codecSelfer2stringSlice []string + +func (p codecSelfer2stringSlice) Len() int { return len(p) } +func (p codecSelfer2stringSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } +func (p codecSelfer2stringSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } + +type codecSelfer2uint64Slice []uint64 + +func (p codecSelfer2uint64Slice) Len() int { return len(p) } +func (p codecSelfer2uint64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } +func (p codecSelfer2uint64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } + +type codecSelfer2int64Slice []int64 + +func (p codecSelfer2int64Slice) Len() int { return len(p) } +func (p codecSelfer2int64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } +func (p codecSelfer2int64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } + +type codecSelfer2float64Slice []float64 + +func (p codecSelfer2float64Slice) Len() int { return len(p) } +func (p codecSelfer2float64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } +func (p codecSelfer2float64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } + func init() { - if codec1978.GenVersion != 19 { + if codec1978.GenVersion != 28 { _, file, _, _ := runtime.Caller(0) ver := strconv.FormatInt(int64(codec1978.GenVersion), 10) - panic(errors.New("codecgen version mismatch: current: 19, need " + ver + ". Re-generate file: " + file)) + panic(errors.New("codecgen version mismatch: current: 28, need " + ver + ". Re-generate file: " + file)) } if false { // reference the types, but skip this branch at build/run time - var _ libcommon.Address + var _ pkg1_common.Address var _ pkg2_big.Int } } +func (Receipt) codecSelferViaCodecgen() {} func (x *Receipt) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r + if z.EncBasicHandle().CheckCircularRef { + z.EncEncode(x) + return + } if x == nil { r.EncodeNil() } else { @@ -84,7 +115,7 @@ func (x *Receipt) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Receipt) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(x) @@ -113,50 +144,36 @@ func (x *Receipt) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Receipt) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if z.DecCheckBreak() { - break - } - } + for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ { z.DecReadMapElemKey() - yys3 := z.StringView(r.DecodeStringAsBytes()) + yys3 := r.DecodeStringAsBytes() z.DecReadMapElemValue() - switch yys3 { + switch string(yys3) { case "Type": x.Type = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) case "1": - x.PostState = r.DecodeBytes(([]byte)(x.PostState), false) + x.PostState = z.DecodeBytesInto(([]byte)(x.PostState)) case "2": x.Status = (uint64)(r.DecodeUint64()) case "3": x.CumulativeGasUsed = (uint64)(r.DecodeUint64()) default: - z.DecStructFieldNotFound(-1, yys3) + z.DecStructFieldNotFound(-1, string(yys3)) } // end switch yys3 } // end for yyj3 } func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r var yyj9 int var yyb9 bool var yyhl9 bool = l >= 0 - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = z.DecCheckBreak() - } + yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) if yyb9 { z.DecReadArrayEnd() return @@ -164,23 +181,15 @@ func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecReadArrayElem() x.Type = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = z.DecCheckBreak() - } + yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) if yyb9 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - x.PostState = r.DecodeBytes(([]byte)(x.PostState), false) + x.PostState = z.DecodeBytesInto(([]byte)(x.PostState)) yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = z.DecCheckBreak() - } + yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) if yyb9 { z.DecReadArrayEnd() return @@ -188,39 +197,28 @@ func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecReadArrayElem() x.Status = (uint64)(r.DecodeUint64()) yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = z.DecCheckBreak() - } + yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) if yyb9 { z.DecReadArrayEnd() return } z.DecReadArrayElem() x.CumulativeGasUsed = (uint64)(r.DecodeUint64()) - for { - yyj9++ - if yyhl9 { - yyb9 = yyj9 > l - } else { - yyb9 = z.DecCheckBreak() - } - if yyb9 { - break - } + yyj9++ + for ; z.DecContainerNext(yyj9, l, yyhl9); yyj9++ { z.DecReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } } func (x *Receipt) IsCodecEmpty() bool { - return !(x.Type != 0 && len(x.PostState) != 0 && x.Status != 0 && x.CumulativeGasUsed != 0 && true) + return !(x.Type != 0 || len(x.PostState) != 0 || x.Status != 0 || x.CumulativeGasUsed != 0 || false) } +func (Receipts) codecSelferViaCodecgen() {} func (x Receipts) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() @@ -231,15 +229,20 @@ func (x Receipts) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Receipts) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r h.decReceipts((*Receipts)(x), d) } +func (Log) codecSelferViaCodecgen() {} func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r + if z.EncBasicHandle().CheckCircularRef { + z.EncEncode(x) + return + } if x == nil { r.EncodeNil() } else { @@ -255,13 +258,13 @@ func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { if !z.EncBinary() { z.EncTextMarshal(*yy6) } else { - h.enccommon_Address((*libcommon.Address)(yy6), e) + z.F.EncSliceUint8V(([]uint8)(yy6[:]), e) } z.EncWriteArrayElem() if x.Topics == nil { r.EncodeNil() } else { - h.encSlicecommon_Hash(([]libcommon.Hash)(x.Topics), e) + h.encSlicecommon_Hash(([]pkg1_common.Hash)(x.Topics), e) } // end block: if x.Topics slice == nil z.EncWriteArrayElem() if x.Data == nil { @@ -276,7 +279,7 @@ func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Log) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(x) @@ -305,52 +308,38 @@ func (x *Log) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Log) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if z.DecCheckBreak() { - break - } - } + for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ { z.DecReadMapElemKey() - yys3 := z.StringView(r.DecodeStringAsBytes()) + yys3 := r.DecodeStringAsBytes() z.DecReadMapElemValue() - switch yys3 { + switch string(yys3) { case "1": if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&x.Address) } else { - h.deccommon_Address((*libcommon.Address)(&x.Address), d) + z.F.DecSliceUint8N(([]uint8)(x.Address[:]), d) } case "2": - h.decSlicecommon_Hash((*[]libcommon.Hash)(&x.Topics), d) + h.decSlicecommon_Hash((*[]pkg1_common.Hash)(&x.Topics), d) case "3": - x.Data = r.DecodeBytes(([]byte)(x.Data), false) + x.Data = z.DecodeBytesInto(([]byte)(x.Data)) default: - z.DecStructFieldNotFound(-1, yys3) + z.DecStructFieldNotFound(-1, string(yys3)) } // end switch yys3 } // end for yyj3 } func (x *Log) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r var yyj10 int var yyb10 bool var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = z.DecCheckBreak() - } + yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) if yyb10 { z.DecReadArrayEnd() return @@ -359,54 +348,39 @@ func (x *Log) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&x.Address) } else { - h.deccommon_Address((*libcommon.Address)(&x.Address), d) + z.F.DecSliceUint8N(([]uint8)(x.Address[:]), d) } yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = z.DecCheckBreak() - } + yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) if yyb10 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - h.decSlicecommon_Hash((*[]libcommon.Hash)(&x.Topics), d) + h.decSlicecommon_Hash((*[]pkg1_common.Hash)(&x.Topics), d) yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = z.DecCheckBreak() - } + yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) if yyb10 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - x.Data = r.DecodeBytes(([]byte)(x.Data), false) - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = z.DecCheckBreak() - } - if yyb10 { - break - } + x.Data = z.DecodeBytesInto(([]byte)(x.Data)) + yyj10++ + for ; z.DecContainerNext(yyj10, l, yyhl10); yyj10++ { z.DecReadArrayElem() z.DecStructFieldNotFound(yyj10-1, "") } } func (x *Log) IsCodecEmpty() bool { - return !(len(x.Address) != 0 && len(x.Topics) != 0 && len(x.Data) != 0 && true) + return !(x.Address != pkg1_common.Address{} || len(x.Topics) != 0 || len(x.Data) != 0 || false) } +func (Logs) codecSelferViaCodecgen() {} func (x Logs) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() @@ -417,26 +391,26 @@ func (x Logs) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Logs) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r h.decLogs((*Logs)(x), d) } func (x codecSelfer2) encReceipts(v Receipts, e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for _, yyv1 := range v { + for yyv1 := range v { z.EncWriteArrayElem() - if yyv1 == nil { + if v[yyv1] == nil { r.EncodeNil() } else { - yyv1.CodecEncodeSelf(e) + v[yyv1].CodecEncodeSelf(e) } } z.EncWriteArrayEnd() @@ -444,7 +418,7 @@ func (x codecSelfer2) encReceipts(v Receipts, e *codec1978.Encoder) { func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r yyv1 := *v @@ -483,7 +457,7 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { } } var yyj1 int - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -516,7 +490,7 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = make([]*Receipt, 0) + yyv1 = []*Receipt{} yyc1 = true } } @@ -526,48 +500,30 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { } } -func (x codecSelfer2) enccommon_Address(v *libcommon.Address, e *codec1978.Encoder) { - var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if v == nil { - r.EncodeNil() - return - } - r.EncodeStringBytesRaw(((*[20]byte)(v))[:]) -} - -func (x codecSelfer2) deccommon_Address(v *libcommon.Address, d *codec1978.Decoder) { +func (x codecSelfer2) encSlicecommon_Hash(v []pkg1_common.Hash, e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - r.DecodeBytes(((*[20]byte)(v))[:], true) -} - -func (x codecSelfer2) encSlicecommon_Hash(v []libcommon.Hash, e *codec1978.Encoder) { - var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for _, yyv1 := range v { + for yyv1 := range v { z.EncWriteArrayElem() - yy2 := &yyv1 + yy2 := &v[yyv1] if !z.EncBinary() { z.EncTextMarshal(*yy2) } else { - h.enccommon_Hash((*libcommon.Hash)(yy2), e) + z.F.EncSliceUint8V(([]uint8)(yy2[:]), e) } } z.EncWriteArrayEnd() } -func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Decoder) { +func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r yyv1 := *v @@ -581,7 +537,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco } } else if yyl1 == 0 { if yyv1 == nil { - yyv1 = []libcommon.Hash{} + yyv1 = []pkg1_common.Hash{} yyc1 = true } else if len(yyv1) != 0 { yyv1 = yyv1[:0] @@ -597,7 +553,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco if yyrl1 <= cap(yyv1) { yyv1 = yyv1[:yyrl1] } else { - yyv1 = make([]libcommon.Hash, yyrl1) + yyv1 = make([]pkg1_common.Hash, yyrl1) } yyc1 = true } else if yyl1 != len(yyv1) { @@ -606,20 +562,20 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco } } var yyj1 int - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 32) } else { yyrl1 = 8 } - yyv1 = make([]libcommon.Hash, yyrl1) + yyv1 = make([]pkg1_common.Hash, yyrl1) yyc1 = true } yyh1.ElemContainerState(yyj1) var yydb1 bool if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, libcommon.Hash{}) + yyv1 = append(yyv1, pkg1_common.Hash{}) yyc1 = true } if yydb1 { @@ -628,7 +584,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&yyv1[yyj1]) } else { - h.deccommon_Hash((*libcommon.Hash)(&yyv1[yyj1]), d) + z.F.DecSliceUint8N(([]uint8)(yyv1[yyj1][:]), d) } } } @@ -636,7 +592,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = make([]libcommon.Hash, 0) + yyv1 = []pkg1_common.Hash{} yyc1 = true } } @@ -646,39 +602,21 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Deco } } -func (x codecSelfer2) enccommon_Hash(v *libcommon.Hash, e *codec1978.Encoder) { - var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if v == nil { - r.EncodeNil() - return - } - r.EncodeStringBytesRaw(((*[32]byte)(v))[:]) -} - -func (x codecSelfer2) deccommon_Hash(v *libcommon.Hash, d *codec1978.Decoder) { - var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - r.DecodeBytes(((*[32]byte)(v))[:], true) -} - func (x codecSelfer2) encLogs(v Logs, e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelperEncoder(e) + z, r := codec1978.GenHelper().Encoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for _, yyv1 := range v { + for yyv1 := range v { z.EncWriteArrayElem() - if yyv1 == nil { + if v[yyv1] == nil { r.EncodeNil() } else { - yyv1.CodecEncodeSelf(e) + v[yyv1].CodecEncodeSelf(e) } } z.EncWriteArrayEnd() @@ -686,7 +624,7 @@ func (x codecSelfer2) encLogs(v Logs, e *codec1978.Encoder) { func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelperDecoder(d) + z, r := codec1978.GenHelper().Decoder(d) _, _, _ = h, z, r yyv1 := *v @@ -725,7 +663,7 @@ func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { } } var yyj1 int - for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination + for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -758,7 +696,7 @@ func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = make([]*Log, 0) + yyv1 = []*Log{} yyc1 = true } } diff --git a/go.mod b/go.mod index 46b3268e4ce..f6aa49f58f3 100644 --- a/go.mod +++ b/go.mod @@ -84,8 +84,8 @@ require ( github.com/stretchr/testify v1.9.0 github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e github.com/tidwall/btree v1.6.0 - github.com/ugorji/go/codec v1.1.13 - github.com/ugorji/go/codec/codecgen v1.1.13 + github.com/ugorji/go/codec v1.2.12 + github.com/ugorji/go/codec/codecgen v1.2.12 github.com/urfave/cli/v2 v2.27.1 github.com/valyala/fastjson v1.6.4 github.com/vektah/gqlparser/v2 v2.5.10 diff --git a/go.sum b/go.sum index f9b9d592b86..4dca66574a5 100644 --- a/go.sum +++ b/go.sum @@ -896,11 +896,10 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= -github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= -github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4= -github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= -github.com/ugorji/go/codec/codecgen v1.1.13 h1:rGpZ4Q63VcWA3DMBbIHvg+SQweUkfXBBa/f9X0W+tFg= -github.com/ugorji/go/codec/codecgen v1.1.13/go.mod h1:EhCxlc7Crov+HLygD4+hBCitXNrrGKRrRWj+pRsyJGg= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec/codecgen v1.2.12 h1:BWbVmWOPwNT9RcRR+WTPYzJeA4WXBSb1O6XJgl4Te0U= +github.com/ugorji/go/codec/codecgen v1.2.12/go.mod h1:JgbiBomDZo5t1eXffkNLgSu+qeuKWCNWxJBvTG4riRI= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= @@ -981,6 +980,7 @@ golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= @@ -1024,6 +1024,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1081,6 +1082,7 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= @@ -1109,6 +1111,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1185,6 +1189,7 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -1196,6 +1201,7 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1208,6 +1214,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1274,6 +1281,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 7824fc09d12eee99eed6a3e33ba2edb7e1462c38 Mon Sep 17 00:00:00 2001 From: taratorio <94537774+taratorio@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:24:11 +0300 Subject: [PATCH 2/2] disable codecgen for logs and receipts --- core/types/receipt.go | 12 +- core/types/receipt_codecgen_gen.go | 290 +++++++++++++++++------------ go.mod | 4 +- go.sum | 19 +- 4 files changed, 192 insertions(+), 133 deletions(-) diff --git a/core/types/receipt.go b/core/types/receipt.go index e5689de13f0..8741cbc6eae 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -20,19 +20,25 @@ import ( "bytes" "errors" "fmt" - "github.com/ledgerwatch/erigon-lib/common/hexutil" "io" "math/big" libcommon "github.com/ledgerwatch/erigon-lib/common" + "github.com/ledgerwatch/erigon-lib/common/hexutil" "github.com/ledgerwatch/erigon-lib/common/hexutility" - "github.com/ledgerwatch/erigon/crypto" "github.com/ledgerwatch/erigon/rlp" ) // go:generate gencodec -type Receipt -field-override receiptMarshaling -out gen_receipt_json.go -//go:generate codecgen -o receipt_codecgen_gen.go -r "^Receipts$|^Receipt$|^Logs$|^Log$" -st "codec" -j=false -nx=true -ta=true -oe=false -d 2 receipt.go log.go + +// disabling codecgen generation since it does not work for go1.22 +// to get it working need to update github.com/ugorji/go/codec to v1.2.12 which has the fix: +// - https://github.com/ugorji/go/commit/8286c2dc986535d23e3fad8d3e816b9dd1e5aea6 +// however updating the lib has caused us issues in the past, and we don't have good unit test coverage for updating atm +// we also use this for storing Receipts and Logs in the DB - we won't be doing that in Erigon 3 +// do not regen, more context: https://github.com/ledgerwatch/erigon/pull/10105#pullrequestreview-2027423601 +// go:generate codecgen -o receipt_codecgen_gen.go -r "^Receipts$|^Receipt$|^Logs$|^Log$" -st "codec" -j=false -nx=true -ta=true -oe=false -d 2 receipt.go log.go var ( receiptStatusFailedRLP = []byte{} diff --git a/core/types/receipt_codecgen_gen.go b/core/types/receipt_codecgen_gen.go index 7bfcaf3d7ec..e2bc7db9db1 100644 --- a/core/types/receipt_codecgen_gen.go +++ b/core/types/receipt_codecgen_gen.go @@ -7,11 +7,10 @@ package types import ( "errors" - pkg1_common "github.com/ledgerwatch/erigon-lib/common" + libcommon "github.com/ledgerwatch/erigon-lib/common" codec1978 "github.com/ugorji/go/codec" pkg2_big "math/big" "runtime" - "sort" "strconv" ) @@ -32,8 +31,7 @@ const ( ) var ( - errCodecSelferOnlyMapOrArrayEncodeToStruct2 = errors.New(`only encoded map or array can be decoded into a struct`) - _ sort.Interface = nil + errCodecSelferOnlyMapOrArrayEncodeToStruct2 = errors.New(`only encoded map or array can be decoded into a struct`) ) type codecSelfer2 struct{} @@ -41,51 +39,22 @@ type codecSelfer2 struct{} func codecSelfer2False() bool { return false } func codecSelfer2True() bool { return true } -type codecSelfer2stringSlice []string - -func (p codecSelfer2stringSlice) Len() int { return len(p) } -func (p codecSelfer2stringSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } -func (p codecSelfer2stringSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } - -type codecSelfer2uint64Slice []uint64 - -func (p codecSelfer2uint64Slice) Len() int { return len(p) } -func (p codecSelfer2uint64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } -func (p codecSelfer2uint64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } - -type codecSelfer2int64Slice []int64 - -func (p codecSelfer2int64Slice) Len() int { return len(p) } -func (p codecSelfer2int64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } -func (p codecSelfer2int64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } - -type codecSelfer2float64Slice []float64 - -func (p codecSelfer2float64Slice) Len() int { return len(p) } -func (p codecSelfer2float64Slice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } -func (p codecSelfer2float64Slice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } - func init() { - if codec1978.GenVersion != 28 { + if codec1978.GenVersion != 19 { _, file, _, _ := runtime.Caller(0) ver := strconv.FormatInt(int64(codec1978.GenVersion), 10) - panic(errors.New("codecgen version mismatch: current: 28, need " + ver + ". Re-generate file: " + file)) + panic(errors.New("codecgen version mismatch: current: 19, need " + ver + ". Re-generate file: " + file)) } if false { // reference the types, but skip this branch at build/run time - var _ pkg1_common.Address + var _ libcommon.Address var _ pkg2_big.Int } } -func (Receipt) codecSelferViaCodecgen() {} func (x *Receipt) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - if z.EncBasicHandle().CheckCircularRef { - z.EncEncode(x) - return - } if x == nil { r.EncodeNil() } else { @@ -115,7 +84,7 @@ func (x *Receipt) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Receipt) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(x) @@ -144,36 +113,50 @@ func (x *Receipt) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Receipt) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 - for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ { + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if z.DecCheckBreak() { + break + } + } z.DecReadMapElemKey() - yys3 := r.DecodeStringAsBytes() + yys3 := z.StringView(r.DecodeStringAsBytes()) z.DecReadMapElemValue() - switch string(yys3) { + switch yys3 { case "Type": x.Type = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) case "1": - x.PostState = z.DecodeBytesInto(([]byte)(x.PostState)) + x.PostState = r.DecodeBytes(([]byte)(x.PostState), false) case "2": x.Status = (uint64)(r.DecodeUint64()) case "3": x.CumulativeGasUsed = (uint64)(r.DecodeUint64()) default: - z.DecStructFieldNotFound(-1, string(yys3)) + z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 } func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj9 int var yyb9 bool var yyhl9 bool = l >= 0 - yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = z.DecCheckBreak() + } if yyb9 { z.DecReadArrayEnd() return @@ -181,15 +164,23 @@ func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecReadArrayElem() x.Type = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) yyj9++ - yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = z.DecCheckBreak() + } if yyb9 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - x.PostState = z.DecodeBytesInto(([]byte)(x.PostState)) + x.PostState = r.DecodeBytes(([]byte)(x.PostState), false) yyj9++ - yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = z.DecCheckBreak() + } if yyb9 { z.DecReadArrayEnd() return @@ -197,28 +188,39 @@ func (x *Receipt) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { z.DecReadArrayElem() x.Status = (uint64)(r.DecodeUint64()) yyj9++ - yyb9 = !z.DecContainerNext(yyj9, l, yyhl9) + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = z.DecCheckBreak() + } if yyb9 { z.DecReadArrayEnd() return } z.DecReadArrayElem() x.CumulativeGasUsed = (uint64)(r.DecodeUint64()) - yyj9++ - for ; z.DecContainerNext(yyj9, l, yyhl9); yyj9++ { + for { + yyj9++ + if yyhl9 { + yyb9 = yyj9 > l + } else { + yyb9 = z.DecCheckBreak() + } + if yyb9 { + break + } z.DecReadArrayElem() z.DecStructFieldNotFound(yyj9-1, "") } } func (x *Receipt) IsCodecEmpty() bool { - return !(x.Type != 0 || len(x.PostState) != 0 || x.Status != 0 || x.CumulativeGasUsed != 0 || false) + return !(x.Type != 0 && len(x.PostState) != 0 && x.Status != 0 && x.CumulativeGasUsed != 0 && true) } -func (Receipts) codecSelferViaCodecgen() {} func (x Receipts) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() @@ -229,20 +231,15 @@ func (x Receipts) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Receipts) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r h.decReceipts((*Receipts)(x), d) } -func (Log) codecSelferViaCodecgen() {} func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r - if z.EncBasicHandle().CheckCircularRef { - z.EncEncode(x) - return - } if x == nil { r.EncodeNil() } else { @@ -258,13 +255,13 @@ func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { if !z.EncBinary() { z.EncTextMarshal(*yy6) } else { - z.F.EncSliceUint8V(([]uint8)(yy6[:]), e) + h.enccommon_Address((*libcommon.Address)(yy6), e) } z.EncWriteArrayElem() if x.Topics == nil { r.EncodeNil() } else { - h.encSlicecommon_Hash(([]pkg1_common.Hash)(x.Topics), e) + h.encSlicecommon_Hash(([]libcommon.Hash)(x.Topics), e) } // end block: if x.Topics slice == nil z.EncWriteArrayElem() if x.Data == nil { @@ -279,7 +276,7 @@ func (x *Log) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Log) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(x) @@ -308,38 +305,52 @@ func (x *Log) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Log) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyhl3 bool = l >= 0 - for yyj3 := 0; z.DecContainerNext(yyj3, l, yyhl3); yyj3++ { + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if z.DecCheckBreak() { + break + } + } z.DecReadMapElemKey() - yys3 := r.DecodeStringAsBytes() + yys3 := z.StringView(r.DecodeStringAsBytes()) z.DecReadMapElemValue() - switch string(yys3) { + switch yys3 { case "1": if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&x.Address) } else { - z.F.DecSliceUint8N(([]uint8)(x.Address[:]), d) + h.deccommon_Address((*libcommon.Address)(&x.Address), d) } case "2": - h.decSlicecommon_Hash((*[]pkg1_common.Hash)(&x.Topics), d) + h.decSlicecommon_Hash((*[]libcommon.Hash)(&x.Topics), d) case "3": - x.Data = z.DecodeBytesInto(([]byte)(x.Data)) + x.Data = r.DecodeBytes(([]byte)(x.Data), false) default: - z.DecStructFieldNotFound(-1, string(yys3)) + z.DecStructFieldNotFound(-1, yys3) } // end switch yys3 } // end for yyj3 } func (x *Log) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj10 int var yyb10 bool var yyhl10 bool = l >= 0 - yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = z.DecCheckBreak() + } if yyb10 { z.DecReadArrayEnd() return @@ -348,39 +359,54 @@ func (x *Log) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&x.Address) } else { - z.F.DecSliceUint8N(([]uint8)(x.Address[:]), d) + h.deccommon_Address((*libcommon.Address)(&x.Address), d) } yyj10++ - yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = z.DecCheckBreak() + } if yyb10 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - h.decSlicecommon_Hash((*[]pkg1_common.Hash)(&x.Topics), d) + h.decSlicecommon_Hash((*[]libcommon.Hash)(&x.Topics), d) yyj10++ - yyb10 = !z.DecContainerNext(yyj10, l, yyhl10) + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = z.DecCheckBreak() + } if yyb10 { z.DecReadArrayEnd() return } z.DecReadArrayElem() - x.Data = z.DecodeBytesInto(([]byte)(x.Data)) - yyj10++ - for ; z.DecContainerNext(yyj10, l, yyhl10); yyj10++ { + x.Data = r.DecodeBytes(([]byte)(x.Data), false) + for { + yyj10++ + if yyhl10 { + yyb10 = yyj10 > l + } else { + yyb10 = z.DecCheckBreak() + } + if yyb10 { + break + } z.DecReadArrayElem() z.DecStructFieldNotFound(yyj10-1, "") } } func (x *Log) IsCodecEmpty() bool { - return !(x.Address != pkg1_common.Address{} || len(x.Topics) != 0 || len(x.Data) != 0 || false) + return !(len(x.Address) != 0 && len(x.Topics) != 0 && len(x.Data) != 0 && true) } -func (Logs) codecSelferViaCodecgen() {} func (x Logs) CodecEncodeSelf(e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { r.EncodeNil() @@ -391,26 +417,26 @@ func (x Logs) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Logs) CodecDecodeSelf(d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r h.decLogs((*Logs)(x), d) } func (x codecSelfer2) encReceipts(v Receipts, e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for yyv1 := range v { + for _, yyv1 := range v { z.EncWriteArrayElem() - if v[yyv1] == nil { + if yyv1 == nil { r.EncodeNil() } else { - v[yyv1].CodecEncodeSelf(e) + yyv1.CodecEncodeSelf(e) } } z.EncWriteArrayEnd() @@ -418,7 +444,7 @@ func (x codecSelfer2) encReceipts(v Receipts, e *codec1978.Encoder) { func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yyv1 := *v @@ -457,7 +483,7 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { } } var yyj1 int - for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -490,7 +516,7 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Receipt{} + yyv1 = make([]*Receipt, 0) yyc1 = true } } @@ -500,30 +526,48 @@ func (x codecSelfer2) decReceipts(v *Receipts, d *codec1978.Decoder) { } } -func (x codecSelfer2) encSlicecommon_Hash(v []pkg1_common.Hash, e *codec1978.Encoder) { +func (x codecSelfer2) enccommon_Address(v *libcommon.Address, e *codec1978.Encoder) { + var h codecSelfer2 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if v == nil { + r.EncodeNil() + return + } + r.EncodeStringBytesRaw(((*[20]byte)(v))[:]) +} + +func (x codecSelfer2) deccommon_Address(v *libcommon.Address, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + r.DecodeBytes(((*[20]byte)(v))[:], true) +} + +func (x codecSelfer2) encSlicecommon_Hash(v []libcommon.Hash, e *codec1978.Encoder) { + var h codecSelfer2 + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for yyv1 := range v { + for _, yyv1 := range v { z.EncWriteArrayElem() - yy2 := &v[yyv1] + yy2 := &yyv1 if !z.EncBinary() { z.EncTextMarshal(*yy2) } else { - z.F.EncSliceUint8V(([]uint8)(yy2[:]), e) + h.enccommon_Hash((*libcommon.Hash)(yy2), e) } } z.EncWriteArrayEnd() } -func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.Decoder) { +func (x codecSelfer2) decSlicecommon_Hash(v *[]libcommon.Hash, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yyv1 := *v @@ -537,7 +581,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De } } else if yyl1 == 0 { if yyv1 == nil { - yyv1 = []pkg1_common.Hash{} + yyv1 = []libcommon.Hash{} yyc1 = true } else if len(yyv1) != 0 { yyv1 = yyv1[:0] @@ -553,7 +597,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De if yyrl1 <= cap(yyv1) { yyv1 = yyv1[:yyrl1] } else { - yyv1 = make([]pkg1_common.Hash, yyrl1) + yyv1 = make([]libcommon.Hash, yyrl1) } yyc1 = true } else if yyl1 != len(yyv1) { @@ -562,20 +606,20 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De } } var yyj1 int - for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 32) } else { yyrl1 = 8 } - yyv1 = make([]pkg1_common.Hash, yyrl1) + yyv1 = make([]libcommon.Hash, yyrl1) yyc1 = true } yyh1.ElemContainerState(yyj1) var yydb1 bool if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, pkg1_common.Hash{}) + yyv1 = append(yyv1, libcommon.Hash{}) yyc1 = true } if yydb1 { @@ -584,7 +628,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(&yyv1[yyj1]) } else { - z.F.DecSliceUint8N(([]uint8)(yyv1[yyj1][:]), d) + h.deccommon_Hash((*libcommon.Hash)(&yyv1[yyj1]), d) } } } @@ -592,7 +636,7 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []pkg1_common.Hash{} + yyv1 = make([]libcommon.Hash, 0) yyc1 = true } } @@ -602,21 +646,39 @@ func (x codecSelfer2) decSlicecommon_Hash(v *[]pkg1_common.Hash, d *codec1978.De } } +func (x codecSelfer2) enccommon_Hash(v *libcommon.Hash, e *codec1978.Encoder) { + var h codecSelfer2 + z, r := codec1978.GenHelperEncoder(e) + _, _, _ = h, z, r + if v == nil { + r.EncodeNil() + return + } + r.EncodeStringBytesRaw(((*[32]byte)(v))[:]) +} + +func (x codecSelfer2) deccommon_Hash(v *libcommon.Hash, d *codec1978.Decoder) { + var h codecSelfer2 + z, r := codec1978.GenHelperDecoder(d) + _, _, _ = h, z, r + r.DecodeBytes(((*[32]byte)(v))[:], true) +} + func (x codecSelfer2) encLogs(v Logs, e *codec1978.Encoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Encoder(e) + z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if v == nil { r.EncodeNil() return } z.EncWriteArrayStart(len(v)) - for yyv1 := range v { + for _, yyv1 := range v { z.EncWriteArrayElem() - if v[yyv1] == nil { + if yyv1 == nil { r.EncodeNil() } else { - v[yyv1].CodecEncodeSelf(e) + yyv1.CodecEncodeSelf(e) } } z.EncWriteArrayEnd() @@ -624,7 +686,7 @@ func (x codecSelfer2) encLogs(v Logs, e *codec1978.Encoder) { func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { var h codecSelfer2 - z, r := codec1978.GenHelper().Decoder(d) + z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yyv1 := *v @@ -663,7 +725,7 @@ func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { } } var yyj1 int - for yyj1 = 0; z.DecContainerNext(yyj1, yyl1, yyhl1); yyj1++ { + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || z.DecCheckBreak()); yyj1++ { // bounds-check-elimination if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) @@ -696,7 +758,7 @@ func (x codecSelfer2) decLogs(v *Logs, d *codec1978.Decoder) { yyv1 = yyv1[:yyj1] yyc1 = true } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*Log{} + yyv1 = make([]*Log, 0) yyc1 = true } } diff --git a/go.mod b/go.mod index f6aa49f58f3..46b3268e4ce 100644 --- a/go.mod +++ b/go.mod @@ -84,8 +84,8 @@ require ( github.com/stretchr/testify v1.9.0 github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e github.com/tidwall/btree v1.6.0 - github.com/ugorji/go/codec v1.2.12 - github.com/ugorji/go/codec/codecgen v1.2.12 + github.com/ugorji/go/codec v1.1.13 + github.com/ugorji/go/codec/codecgen v1.1.13 github.com/urfave/cli/v2 v2.27.1 github.com/valyala/fastjson v1.6.4 github.com/vektah/gqlparser/v2 v2.5.10 diff --git a/go.sum b/go.sum index 4dca66574a5..f9b9d592b86 100644 --- a/go.sum +++ b/go.sum @@ -896,10 +896,11 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/ugorji/go/codec/codecgen v1.2.12 h1:BWbVmWOPwNT9RcRR+WTPYzJeA4WXBSb1O6XJgl4Te0U= -github.com/ugorji/go/codec/codecgen v1.2.12/go.mod h1:JgbiBomDZo5t1eXffkNLgSu+qeuKWCNWxJBvTG4riRI= +github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= +github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4= +github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= +github.com/ugorji/go/codec/codecgen v1.1.13 h1:rGpZ4Q63VcWA3DMBbIHvg+SQweUkfXBBa/f9X0W+tFg= +github.com/ugorji/go/codec/codecgen v1.1.13/go.mod h1:EhCxlc7Crov+HLygD4+hBCitXNrrGKRrRWj+pRsyJGg= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= @@ -980,7 +981,6 @@ golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= @@ -1024,7 +1024,6 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1082,7 +1081,6 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= @@ -1111,8 +1109,6 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1189,7 +1185,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -1201,7 +1196,6 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1214,7 +1208,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1281,8 +1274,6 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=