Files
prysm/third_party/com_github_ethereum_c_kzg_4844.patch
Manu NALEPA ab5505e13e Implement all needed KZG wrappers for peerDAS in the kzg package. (#15186)
* Implement all needed KZG wrappers for peerDAS in the `kzg` package.

This way, If we need to change the KZG backend, the only package to
modify is the `kzg` package.

* `.bazelrc`: Add `build --compilation_mode=opt`

* Remove --compilation_mode=opt, use supranational blst headers.

* Fix Terence's comment.

* Fix Terence`s comments.

---------

Co-authored-by: Preston Van Loon <preston@pvl.dev>
2025-04-17 22:43:41 +00:00

45 lines
1.4 KiB
Diff

diff --git a/bindings/go/BUILD.bazel b/bindings/go/BUILD.bazel
index 7e49df7..1d476f7 100644
--- a/bindings/go/BUILD.bazel
+++ b/bindings/go/BUILD.bazel
@@ -4,10 +4,14 @@ load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go",
srcs = ["main.go"],
+ cdeps = [
+ "@com_github_supranational_blst//:blst",
+ "//src:kzg",
+ ],
cgo = True,
copts = [
- "-Ibindings/go/src",
- "-Ibindings/go/bindings/go/blst_headers",
+ "-Iexternal/com_github_ethereum_c_kzg_4844/src",
+ "-Iexternal/com_github_supranational_blst/bindings/blst_headers",
],
importpath = "github.com/ethereum/c-kzg-4844/v2/bindings/go",
importpath_aliases = ["github.com/ethereum/c-kzg-4844/bindings/go"],
visibility = ["//visibility:public"],
diff --git a/bindings/go/blst_headers/BUILD.bazel b/bindings/go/blst_headers/BUILD.bazel
new file mode 100644
index 0000000..82cad2c
--- /dev/null
+++ b/bindings/go/blst_headers/BUILD.bazel
@@ -0,0 +1,5 @@
+cc_library(
+ name = "hdrs",
+ hdrs = glob(["*.h"]),
+ visibility = ["//visibility:public"],
+)
diff --git a/src/BUILD.bazel b/src/BUILD.bazel
new file mode 100644
index 0000000..b3f845d
--- /dev/null
+++ b/src/BUILD.bazel
@@ -0,0 +1,5 @@
+cc_library(
+ name = "kzg",
+ hdrs = glob(["ckzg.*", "*/*.c", "*/*.h"]),
+ visibility = ["//visibility:public"],
+)