Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump c-kzg commit hash #244

Merged
merged 7 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/blst-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: blst benchmarks
on: [push, pull_request, workflow_dispatch]

env:
C_KZG_4844_GIT_HASH: 'a1d03803059471948e518820afa8518643e1b638'
C_KZG_4844_GIT_HASH: '624aa60d01da524827123506975431aa5454c80d'

jobs:
benchmarks:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/blst-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: blst tests
on: [push, pull_request, workflow_dispatch]

env:
C_KZG_4844_GIT_HASH: 'a1d03803059471948e518820afa8518643e1b638'
C_KZG_4844_GIT_HASH: '624aa60d01da524827123506975431aa5454c80d'

jobs:
tests:
Expand Down Expand Up @@ -50,19 +50,13 @@ jobs:
command: build
args: --manifest-path blst/Cargo.toml --target wasm32-unknown-unknown --no-default-features

- name: "[blst] Tests (minimal preset)"
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path blst/Cargo.toml --no-fail-fast --test eip_4844 tests --features minimal-spec

- name: "[blst] Tests (mainnet preset)"
- name: "[blst] Tests"
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path blst/Cargo.toml --no-fail-fast

- name: "[blst] Tests (mainnet preset, parallel)"
- name: "[blst] Tests (parallel)"
uses: actions-rs/cargo@v1
with:
command: test
Expand All @@ -82,7 +76,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path blst/Cargo.toml --all-targets --features=default,std,rand,parallel,minimal-spec -- -D warnings
args: --manifest-path blst/Cargo.toml --all-targets --features=default,std,rand,parallel -- -D warnings

- name: "[blst] Formatting"
uses: actions-rs/cargo@v1
Expand Down
1 change: 0 additions & 1 deletion arkworks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ default = ["std"]
std = ["ark-ff/std", "ark-ec/std", "ark-poly/std", "ark-std/std"]
print-trace = ["ark-std/print-trace"]
parallel = ["std", "ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel", "ark-std/parallel", "rayon"]
minimal-spec = ["kzg/minimal-spec", "kzg-bench/minimal-spec"]

[[bench]]
name = "fft"
Expand Down
1 change: 0 additions & 1 deletion blst/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ parallel = [
"dep:rayon",
"dep:num_cpus",
]
minimal-spec = ["kzg/minimal-spec", "kzg-bench/minimal-spec"]

# By default, compile with ADX extension if the host supports it.
# Binary can be executed on systems similar to the host.
Expand Down
18 changes: 9 additions & 9 deletions blst/csharp.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
From 4989dace3b71ebb422ca86545f937f8d3c77031a Mon Sep 17 00:00:00 2001
From: belijzajac <tautvydas749@gmail.com>
Date: Tue, 7 Mar 2023 20:50:46 +0200
Subject: [PATCH] Update linking
From 86aa67b0e3775514cc484ddd2adf6b5dc6e26803 Mon Sep 17 00:00:00 2001
From: sirse <artiom.tretjakovas2@gmail.com>
Date: Thu, 26 Oct 2023 13:40:30 +0300
Subject: [PATCH] Patch csharp binding

---
bindings/csharp/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/csharp/Makefile b/bindings/csharp/Makefile
index d5fa3dc..0a77983 100644
index 5158aad..af3b2a8 100644
--- a/bindings/csharp/Makefile
+++ b/bindings/csharp/Makefile
@@ -31,7 +31,7 @@ endif
@@ -39,7 +39,7 @@ else
endif

FIELD_ELEMENTS_PER_BLOB ?= 4096
INCLUDE_DIRS = ../../src ../../blst/bindings
-TARGETS = ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ)
+TARGETS = ckzg.c ../../../../target/release/rust_kzg_blst.a

CFLAGS += -O2 -Wall -Wextra -shared
CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
CFLAGS += ${addprefix -I,${INCLUDE_DIRS}}
--
2.39.2
2.34.1

20 changes: 10 additions & 10 deletions blst/go.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
From ed81f88f25548e15543df92905e72ab17726b21e Mon Sep 17 00:00:00 2001
From: ProgrammingBen <[email protected]>
Date: Sun, 24 Sep 2023 18:31:10 +0300
Subject: [PATCH] update linking
From 90e9a518ca03716ef1d9d77e263db25b56030867 Mon Sep 17 00:00:00 2001
From: sirse <[email protected]>
Date: Thu, 26 Oct 2023 14:09:11 +0300
Subject: [PATCH] Patch go binding

---
bindings/go/main.go | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bindings/go/main.go b/bindings/go/main.go
index 518d58c..10e6ab3 100644
index bdd5385..155fc81 100644
--- a/bindings/go/main.go
+++ b/bindings/go/main.go
@@ -5,7 +5,15 @@ package ckzg4844
// #ifndef FIELD_ELEMENTS_PER_BLOB
// #define FIELD_ELEMENTS_PER_BLOB 4096
// #endif
@@ -2,7 +2,15 @@ package ckzg4844

// #cgo CFLAGS: -I${SRCDIR}/../../src
// #cgo CFLAGS: -I${SRCDIR}/blst_headers
-// #include "c_kzg_4844.c"
+// #ifndef BYTES_PER_G1
+// #define BYTES_PER_G1 48
Expand All @@ -28,7 +28,7 @@ index 518d58c..10e6ab3 100644
import "C"

import (
@@ -14,9 +22,6 @@ import (
@@ -11,9 +19,6 @@ import (
"fmt"
"strings"
"unsafe"
Expand Down
29 changes: 7 additions & 22 deletions blst/nodejs.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
From 356c7ae798d125ee638ee0283fab9abca47a2e84 Mon Sep 17 00:00:00 2001
From 954c55533e265f32eabe0dc863b1add2478bb570 Mon Sep 17 00:00:00 2001
From: sirse <[email protected]>
Date: Sun, 24 Sep 2023 21:54:36 +0300
Subject: [PATCH] Update linking
Date: Thu, 26 Oct 2023 14:02:51 +0300
Subject: [PATCH] Patch nodejs binding

---
bindings/node.js/Makefile | 1 -
bindings/node.js/binding.gyp | 33 +++------------------------------
bindings/node.js/src/kzg.cxx | 4 ++++
3 files changed, 7 insertions(+), 31 deletions(-)
bindings/node.js/binding.gyp | 31 +++----------------------------
2 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/bindings/node.js/Makefile b/bindings/node.js/Makefile
index 17850ec..efc9961 100644
Expand All @@ -22,7 +21,7 @@ index 17850ec..efc9961 100644
@# Build the bindings
@$(YARN) node-gyp --loglevel=warn configure
diff --git a/bindings/node.js/binding.gyp b/bindings/node.js/binding.gyp
index 4f1e28b..6cde37f 100644
index 5ac368e..6cde37f 100644
--- a/bindings/node.js/binding.gyp
+++ b/bindings/node.js/binding.gyp
@@ -3,9 +3,7 @@
Expand All @@ -36,14 +35,13 @@ index 4f1e28b..6cde37f 100644
],
"include_dirs": [
"<(module_root_dir)/deps/blst/bindings",
@@ -16,33 +14,8 @@
@@ -16,31 +14,8 @@
"__BLST_PORTABLE__",
"NAPI_DISABLE_CPP_EXCEPTIONS"
],
- "conditions": [
- ["OS!='win'", {
- "sources": ["deps/blst/build/assembly.S"],
- "defines": ["FIELD_ELEMENTS_PER_BLOB=<!(echo ${FIELD_ELEMENTS_PER_BLOB:-4096})"],
- "cflags_cc": [
- "-std=c++17",
- "-fPIC"
Expand All @@ -53,7 +51,6 @@ index 4f1e28b..6cde37f 100644
- "sources": ["deps/blst/build/win64/*-x86_64.asm"],
- "defines": [
- "_CRT_SECURE_NO_WARNINGS",
- "FIELD_ELEMENTS_PER_BLOB=<!(powershell -Command \"if ($env:FIELD_ELEMENTS_PER_BLOB) { $env:FIELD_ELEMENTS_PER_BLOB } else { 4096 }\")"
- ],
- "msbuild_settings": {
- "ClCompile": {
Expand All @@ -72,18 +69,6 @@ index 4f1e28b..6cde37f 100644
]
}
]
diff --git a/bindings/node.js/src/kzg.cxx b/bindings/node.js/src/kzg.cxx
index 871aa90..f89b1e3 100644
--- a/bindings/node.js/src/kzg.cxx
+++ b/bindings/node.js/src/kzg.cxx
@@ -1,3 +1,7 @@
+#ifndef FIELD_ELEMENTS_PER_BLOB
+#define FIELD_ELEMENTS_PER_BLOB 4096
+#endif
+
#include "blst.h"
#include "c_kzg_4844.h"
#include <iostream>
--
2.34.1

29 changes: 13 additions & 16 deletions blst/python.patch
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
From 2c3dbbd6791389c760f0a3b073d37b38ec37807f Mon Sep 17 00:00:00 2001
From: povilassl <slivinskas.povilas@gmail.com>
Date: Sun, 24 Sep 2023 17:50:56 +0300
Subject: [PATCH] python patch
From a8ff3fe1e4372380f15769bbb8490b0089aa2928 Mon Sep 17 00:00:00 2001
From: sirse <artiom.tretjakovas2@gmail.com>
Date: Thu, 26 Oct 2023 13:51:37 +0300
Subject: [PATCH] Patch python binding

---
bindings/python/Makefile | 9 +++------
bindings/python/Makefile | 5 +----
bindings/python/setup.py | 6 +++---
2 files changed, 6 insertions(+), 9 deletions(-)
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/bindings/python/Makefile b/bindings/python/Makefile
index c6bd222..1d48e44 100644
index c6bd222..99d6501 100644
--- a/bindings/python/Makefile
+++ b/bindings/python/Makefile
@@ -1,11 +1,8 @@
.PHONY: all
-all: install test
-
all: install test
-../../src/c_kzg_4844.o:
- make -C../../src c_kzg_4844.o
-
+ all: install test
+
.PHONY: install
-install: setup.py ckzg.c ../../src/c_kzg_4844.o
+ install: setup.py ckzg.c
+install: setup.py ckzg.c
python3 setup.py install

.PHONY: test
diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index bf969cb..36d638c 100644
index b072833..db37db4 100644
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -8,11 +8,11 @@ def main():
@@ -8,10 +8,10 @@ def main():
ext_modules=[
Extension(
"ckzg",
- sources=["ckzg.c", "../../src/c_kzg_4844.c"],
+ sources=["ckzg.c"],
include_dirs=["../../inc", "../../src"],
define_macros=[("FIELD_ELEMENTS_PER_BLOB", "4096")],
- library_dirs=["../../lib"],
- libraries=["blst"])])
+ library_dirs=["../../lib", "../../../../target/release"],
Expand All @@ -47,5 +44,5 @@ index bf969cb..36d638c 100644
if __name__ == "__main__":
main()
--
2.37.0.windows.1
2.34.1

Loading