Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 42c9c28

Browse files
authored
Update go-kzg-4844 to v0.3.0 (#1015)
[v0.3.0](https://github.com/crate-crypto/go-kzg-4844/releases/tag/v0.3.0) switches precompile input's z and y to big endian according to ethereum/EIPs#7020.
1 parent cf4bdbd commit 42c9c28

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

crypto/kzg/kzg.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ const (
1414

1515
type VersionedHash [32]byte
1616

17-
var gCryptoCtx gokzg4844.Context
17+
var gCryptoCtx *gokzg4844.Context
1818
var initCryptoCtx sync.Once
1919

2020
// InitializeCryptoCtx initializes the global context object returned via CryptoCtx
2121
func InitializeCryptoCtx() {
2222
initCryptoCtx.Do(func() {
23+
var err error
2324
// Initialize context to match the configurations that the
2425
// specs are using.
25-
ctx, err := gokzg4844.NewContext4096Insecure1337()
26+
gCryptoCtx, err = gokzg4844.NewContext4096Insecure1337()
2627
if err != nil {
2728
panic(fmt.Sprintf("could not create context, err : %v", err))
2829
}
29-
gCryptoCtx = *ctx
3030
})
3131
}
3232

3333
// Ctx returns a context object that stores all of the necessary configurations to allow one to
3434
// create and verify blob proofs. This function is expensive to run if the crypto context isn't
3535
// initialized, so production services should pre-initialize by calling InitializeCryptoCtx.
36-
func Ctx() gokzg4844.Context {
36+
func Ctx() *gokzg4844.Context {
3737
InitializeCryptoCtx()
3838
return gCryptoCtx
3939
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/anacrolix/log v0.14.0
1919
github.com/anacrolix/torrent v1.52.0
2020
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b
21-
github.com/crate-crypto/go-kzg-4844 v0.2.0
21+
github.com/crate-crypto/go-kzg-4844 v0.3.0
2222
github.com/deckarep/golang-set/v2 v2.3.0
2323
github.com/edsrzf/mmap-go v1.1.0
2424
github.com/go-stack/stack v1.8.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/Yj
108108
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
109109
github.com/consensys/gnark-crypto v0.10.0 h1:zRh22SR7o4K35SoNqouS9J/TKHTyU2QWaj5ldehyXtA=
110110
github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU=
111-
github.com/crate-crypto/go-kzg-4844 v0.2.0 h1:UVuHOE+5tIWrim4zf/Xaa43+MIsDCPyW76QhUpiMGj4=
112-
github.com/crate-crypto/go-kzg-4844 v0.2.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4=
111+
github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A=
112+
github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4=
113113
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
114114
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
115115
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

0 commit comments

Comments
 (0)