From abaf7655f9c0e67363988012c017040678e73786 Mon Sep 17 00:00:00 2001 From: Zach Kelling Date: Fri, 26 Dec 2025 15:18:06 -0800 Subject: [PATCH] fix(gpu): use luxgpu build tag for CGO bindings The gpu package requires C++ headers that only exist locally. Using 'cgo' build tag caused CI failures when CGO was enabled but headers weren't present. Now uses 'luxgpu' custom build tag: - Default: stub implementation (no dependencies) - With -tags luxgpu: full CGO acceleration Build locally with GPU: go build -tags luxgpu ./... --- LICENSE | 137 +++++++++++++++++++++++++++++++++++++------- go.mod | 6 +- go.sum | 14 ++--- gpu/crypto.go | 2 +- gpu/crypto_nocgo.go | 2 +- 5 files changed, 123 insertions(+), 38 deletions(-) diff --git a/LICENSE b/LICENSE index 814c863..5b2cbe3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,122 @@ -BSD 3-Clause License +Lux Ecosystem License +Version 1.2, December 2025 -Copyright (C) 2020-2025, Lux Industries, Inc. +Copyright (c) 2020-2025 Lux Industries Inc. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +TECHNOLOGY PORTFOLIO - PATENT APPLICATIONS PLANNED +Contact: licensing@lux.network -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +================================================================================ + TERMS AND CONDITIONS +================================================================================ -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +1. DEFINITIONS -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + "Lux Primary Network" means the official Lux blockchain with Network ID=1 + and EVM Chain ID=96369. + + "Authorized Network" means the Lux Primary Network, official testnets/devnets, + and any L1/L2/L3 chain descending from the Lux Primary Network. + + "Descending Chain" means an L1/L2/L3 chain built on, anchored to, or deriving + security from the Lux Primary Network or its authorized testnets. + + "Research Use" means non-commercial academic research, education, personal + study, or evaluation purposes. + + "Commercial Use" means any use in connection with a product or service + offered for sale or fee, internal use by a for-profit entity, or any use + to generate revenue. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +2. GRANT OF LICENSE + + Subject to these terms, Lux Industries Inc grants you a non-exclusive, + royalty-free license to: + + (a) Use for Research Use without restriction; + + (b) Operate on the Lux Primary Network (Network ID=1, EVM Chain ID=96369); + + (c) Operate on official Lux testnets and devnets; + + (d) Operate L1/L2/L3 chains descending from the Lux Primary Network; + + (e) Build applications within the Lux ecosystem; + + (f) Contribute improvements back to the original repositories. + +3. RESTRICTIONS + + Without a commercial license from Lux Industries Inc, you may NOT: + + (a) Fork the Lux Network or any Lux software; + + (b) Create competing networks not descending from Lux Primary Network; + + (c) Use for Commercial Use outside the Lux ecosystem; + + (d) Sublicense or transfer rights outside the Lux ecosystem; + + (e) Use to create competing blockchain networks, exchanges, custody + services, or cryptographic systems outside the Lux ecosystem. + +4. NO FORKS POLICY + + Lux Industries Inc maintains ZERO TOLERANCE for unauthorized forks. + Any fork or deployment on an unauthorized network constitutes: + + (a) Breach of this license; + (b) Grounds for immediate legal action. + +5. RIGHTS RESERVATION + + All rights not explicitly granted are reserved by Lux Industries Inc. + + We plan to apply for patent protection for the technology in this + repository. Any implementation outside the Lux ecosystem may require + a separate commercial license. + +6. DISCLAIMER OF WARRANTY + + THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + +7. LIMITATION OF LIABILITY + + IN NO EVENT SHALL LUX INDUSTRIES INC BE LIABLE FOR ANY CLAIM, DAMAGES + OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. + +8. TERMINATION + + This license terminates immediately upon any breach, including but not + limited to deployment on unauthorized networks or creation of forks. + +9. GOVERNING LAW + + This License shall be governed by the laws of the State of Delaware. + +10. COMMERCIAL LICENSING + + For commercial use outside the Lux ecosystem: + + Lux Industries Inc. + Email: licensing@lux.network + Subject: Commercial License Request + +================================================================================ + TL;DR +================================================================================ + +- Research/academic use = OK +- Lux Primary Network (Network ID=1, Chain ID=96369) = OK +- L1/L2/L3 chains descending from Lux Primary Network = OK +- Commercial products outside Lux ecosystem = Contact licensing@lux.network +- Forks = Absolutely not + +================================================================================ + +See LP-0012 for full licensing documentation: +https://github.com/luxfi/lps/blob/main/LPs/lp-0012-ecosystem-licensing.md diff --git a/go.mod b/go.mod index 76200ac..0869ee2 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ exclude github.com/luxfi/geth v1.16.1 require ( filippo.io/age v1.2.1 - github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 + github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251221085550-b8e13ca38217 github.com/cloudflare/circl v1.6.2-0.20251204010831-23491bd573cf github.com/consensys/gnark-crypto v0.19.2 github.com/crate-crypto/go-eth-kzg v1.4.0 @@ -15,7 +15,6 @@ require ( github.com/google/gofuzz v1.2.0 github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 github.com/leanovate/gopter v0.2.11 - github.com/luxfi/cache v1.0.0 github.com/luxfi/ids v1.2.4 github.com/luxfi/log v1.1.26 github.com/mr-tron/base58 v1.2.0 @@ -34,9 +33,8 @@ require ( github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.14.1 // indirect - github.com/zeebo/assert v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect + go.uber.org/zap v1.27.1 // indirect golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index ae50d08..9a77e2b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ c2sp.org/CCTV/age v0.0.0-20240306222714-3ec4d716e805 h1:u2qwJeEvnypw+OCPUHmoZE3IqwfuN5kgDfo5MLzpNM0= -c2sp.org/CCTV/age v0.0.0-20240306222714-3ec4d716e805/go.mod h1:FomMrUJ2Lxt5jCLmZkG3FHa72zUprnhd3v/Z18Snm4w= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -43,8 +42,8 @@ filippo.io/age v1.2.1 h1:X0TZjehAZylOIj4DubWYU1vWQxv9bJpo+Uu2/LGhi1o= filippo.io/age v1.2.1/go.mod h1:JL9ew2lTN+Pyft4RiNGguFfOpewKwSHm5ayKD/A4004= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU= -github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251221085550-b8e13ca38217 h1:RNTau6sw5B3ltE+2GlzEom63eBMzoLUc+dhjmdIwNpI= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251221085550-b8e13ca38217/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -204,11 +203,8 @@ github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3x github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4= github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c= -github.com/luxfi/cache v1.0.0 h1:OcqGi/qs9ky+7O8fR6WMZtFsunvA40LBTg3QRQqJurs= -github.com/luxfi/cache v1.0.0/go.mod h1:BEvpffvV3SXs/KSa9nUC1TszxKwUdIHwIaoXpeiYU+Y= github.com/luxfi/ids v1.2.4 h1:e0OaeSI6xWjS9JnxxxfvCCs9HHDUrwDc3M9ctIhjcDI= github.com/luxfi/ids v1.2.4/go.mod h1:HwvRJSNbuZS+u+0JqeHfPX2S13iFyLCnfGxjBCmt244= github.com/luxfi/log v1.1.26 h1:ECnJ4wV7TF6WZ5gC6CD6ddZ4OhF+zhQij4bgVUhumDg= @@ -281,8 +277,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= -github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI= github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= @@ -304,8 +298,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= +go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/gpu/crypto.go b/gpu/crypto.go index 3a1a026..44f7948 100644 --- a/gpu/crypto.go +++ b/gpu/crypto.go @@ -1,4 +1,4 @@ -//go:build cgo +//go:build luxgpu // Package gpu provides GPU-accelerated cryptographic operations via libcrypto. // This bridges the luxcpp/crypto C++ library to Go, enabling: diff --git a/gpu/crypto_nocgo.go b/gpu/crypto_nocgo.go index 78b4fd5..c24d34e 100644 --- a/gpu/crypto_nocgo.go +++ b/gpu/crypto_nocgo.go @@ -1,4 +1,4 @@ -//go:build !cgo +//go:build !luxgpu // Package gpu provides GPU-accelerated cryptographic operations. // This file provides stub implementations when CGO is disabled.