Skip to content

Commit 70dfadd

Browse files
authored
core/types: disable go:generate codecgen for receipts and logs (#10105)
running `go generate ./...` fails with: ``` codecgen error: error running 'go run codecgen-main-2.generated.go': exit status 1, console: panic: encoding alphabet includes duplicate symbols goroutine 1 [running]: encoding/base64.NewEncoding(...) /usr/local/go/src/encoding/base64/base64.go:82 github.com/ugorji/go/codec.init() /Users/milen/go/pkg/mod/github.com/ugorji/go/codec@v1.1.13/gen.go:168 +0xf1c exit status 2 ``` this is a problem when using go1.22 and it has been fixed here: - ugorji/go@8286c2d - issue: ugorji/go#407
1 parent 9e7e8c3 commit 70dfadd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/types/receipt.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ import (
2020
"bytes"
2121
"errors"
2222
"fmt"
23-
"github.com/ledgerwatch/erigon-lib/common/hexutil"
2423
"io"
2524
"math/big"
2625

2726
libcommon "github.com/ledgerwatch/erigon-lib/common"
27+
"github.com/ledgerwatch/erigon-lib/common/hexutil"
2828
"github.com/ledgerwatch/erigon-lib/common/hexutility"
29-
3029
"github.com/ledgerwatch/erigon/crypto"
3130
"github.com/ledgerwatch/erigon/rlp"
3231
)
3332

3433
// go:generate gencodec -type Receipt -field-override receiptMarshaling -out gen_receipt_json.go
35-
//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
34+
35+
// disabling codecgen generation since it does not work for go1.22
36+
// to get it working need to update github.com/ugorji/go/codec to v1.2.12 which has the fix:
37+
// - https://github.com/ugorji/go/commit/8286c2dc986535d23e3fad8d3e816b9dd1e5aea6
38+
// however updating the lib has caused us issues in the past, and we don't have good unit test coverage for updating atm
39+
// we also use this for storing Receipts and Logs in the DB - we won't be doing that in Erigon 3
40+
// do not regen, more context: https://github.com/ledgerwatch/erigon/pull/10105#pullrequestreview-2027423601
41+
// 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
3642

3743
var (
3844
receiptStatusFailedRLP = []byte{}

0 commit comments

Comments
 (0)