fix(crypto): remove vendored secp256k1 to drop duplicate symbols at link#4
Merged
nebojsa94 merged 1 commit intoMay 18, 2026
Merged
Conversation
When nitro's libstylus.a and other modules (zksync-go etc.) are linked into the same binary, the macOS linker errors out with ~50 duplicate `_secp256k1_*` symbols because two different cgo-compiled .o files each embed the full libsecp256k1 implementation. On Linux this was masked by `-Wl,--allow-multiple-definition`, but newer macOS ld doesn't accept that flag. Drops nitro's own vendored libsecp256k1 + Go wrappers under `go-ethereum/crypto/secp256k1/` and switches the two import sites (`go-ethereum/crypto/signature_cgo.go`, fuzz/system test) to upstream `github.com/ethereum/go-ethereum/crypto/secp256k1`. MVS in the consumer binary then keeps a single copy of secp256k1. The Rust side (libstylus.a) is unchanged — only Go imports/files moved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When tenderly-core links a binary that pulls in both nitro's
libstylus.aand other modules that vendor secp256k1 (e.g.zksync-go), the macOS linker errors with ~50 duplicate_secp256k1_*symbols because two different cgo-compiled .o files each embed the full libsecp256k1 implementation:On Linux CI this was masked by
-Wl,--allow-multiple-definitionin tenderly-core'sBUILD_FLAGS, but newer macOSlddoesn't accept that flag, so local macOS builds fail outright.This drops nitro's own vendored libsecp256k1 + Go wrappers under
go-ethereum/crypto/secp256k1/(185 files, ~70K deletions) and switches the two consumer sites (go-ethereum/crypto/signature_cgo.go,tests/fuzzers/secp256k1/secp_test.go,system_tests/timeboost_test.go) to upstreamgithub.com/ethereum/go-ethereum/crypto/secp256k1. MVS in the consumer binary then keeps a single copy.The Rust side (
libstylus.a) is unchanged — only Go imports/files moved.Tests
go mod tidyin net-nitro succeeds after the import-path renames; it auto-addsgithub.com/ethereum/go-ethereum v1.10.26(MVS will pick the higher tenderly-core pin v1.17.2 at consumer build time).nitro-d3ca07605e9b-{linux,macos}.tar.gz) were republished bygsutil cpfromd7575265ccc0— byte-identical Rust output.Services affected
Any tenderly-core service that links nitro into a binary together with another secp256k1-vendoring module (zksync, etc.). Concretely:
tenderly-server, node-server services, anything building fromcmd/*.