diff --git a/bigmodexp/bigmodexp.go b/bigmodexp/bigmodexp.go new file mode 100644 index 0000000..d90b729 --- /dev/null +++ b/bigmodexp/bigmodexp.go @@ -0,0 +1,17 @@ +// Copyright (C) 2025, Lux Industries Inc. All rights reserved. +// +// Package bigmodexp re-exports the patched math/big from go-bigmodexpfix +// under the luxfi/crypto namespace so that downstream packages never +// import ethereum/* directly. +// +// The upstream package provides a patched big.Int.Exp that fixes a +// consensus-critical modular exponentiation edge case. + +package bigmodexp + +import ( + upstream "github.com/ethereum/go-bigmodexpfix/src/math/big" +) + +// Int is the patched big.Int with the fixed Exp implementation. +type Int = upstream.Int diff --git a/go.mod b/go.mod index f056d55..4d4bf28 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,8 @@ require ( github.com/crate-crypto/go-eth-kzg v1.5.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 github.com/ethereum/c-kzg-4844/v2 v2.1.5 + github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab + github.com/ethereum/go-verkle v0.2.2 github.com/google/btree v1.1.3 github.com/google/gofuzz v1.2.0 github.com/jedisct1/go-minisign v0.0.0-20241212093149-d2f9f49435c7 @@ -34,6 +36,7 @@ require ( require ( filippo.io/hpke v0.4.0 // indirect github.com/bits-and-blooms/bitset v1.24.4 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/luxfi/utils v1.1.0 // indirect diff --git a/go.sum b/go.sum index 0388273..1d2c4e2 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/crate-crypto/go-eth-kzg v1.5.0 h1:FYRiJMJG2iv+2Dy3fi14SVGjcPteZ5HAAUe4YWlJygc= github.com/crate-crypto/go-eth-kzg v1.5.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -117,6 +119,10 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= +github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= +github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= +github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= +github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= diff --git a/verkle/verkle.go b/verkle/verkle.go new file mode 100644 index 0000000..4ac7ae2 --- /dev/null +++ b/verkle/verkle.go @@ -0,0 +1,49 @@ +// Copyright (C) 2025, Lux Industries Inc. All rights reserved. +// +// Package verkle re-exports the go-verkle library under the luxfi/crypto +// namespace so that downstream packages (luxfi/geth, luxfi/node, etc.) +// never import ethereum/* directly. + +package verkle + +import ( + upstream "github.com/ethereum/go-verkle" +) + +// --- Type aliases --- + +type ( + VerkleNode = upstream.VerkleNode + InternalNode = upstream.InternalNode + LeafNode = upstream.LeafNode + Empty = upstream.Empty + Point = upstream.Point + Fr = upstream.Fr + VerkleProof = upstream.VerkleProof + StateDiff = upstream.StateDiff + NodeResolverFn = upstream.NodeResolverFn + IPAConfig = upstream.IPAConfig + Proof = upstream.Proof +) + +// --- Constants --- + +const NodeWidth = upstream.NodeWidth + +// --- Functions --- + +var ( + ParseNode = upstream.ParseNode + New = upstream.New + ToDot = upstream.ToDot + GetConfig = upstream.GetConfig + MakeVerkleMultiProof = upstream.MakeVerkleMultiProof + SerializeProof = upstream.SerializeProof + HashPointToBytes = upstream.HashPointToBytes + FromLEBytes = upstream.FromLEBytes + FromBytes = upstream.FromBytes + DeserializeProof = upstream.DeserializeProof + MergeTrees = upstream.MergeTrees + BatchNewLeafNode = upstream.BatchNewLeafNode + PreStateTreeFromProof = upstream.PreStateTreeFromProof +)