fix(codegen): point //go:linkname at abigen for go-ethereum v1.16+#16
Merged
Conversation
go-ethereum v1.16 moved the contract-binding codegen helpers from github.com/ethereum/go-ethereum/accounts/abi/bind to github.com/ethereum/go-ethereum/accounts/abi/abigen, and renamed bindStructTypeGo -> bindStructType and bindTopicTypeGo -> bindTopicType (dropping the "Go" suffix). The "structured" helper kept its name. contract_parsing.go reached into those symbols via //go:linkname and broke with the keep-core security fork's go-ethereum bump to v1.17.3 (failing the Docker build at `make generate` with undefined references during cgo link). Update the linkname targets to point at the new abigen package; bump the local go.mod's go-ethereum to v1.17.3 so the codegen tool can actually link against the new symbol layout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The go-ethereum v1.17.3 dependency on this branch raises the required
Go version (go.mod 'go 1.24.0'), so the workflows' hardcoded Go 1.22
plus GOTOOLCHAIN=local fails with:
go: go.mod requires go >= 1.24.0 (running go 1.22.12; GOTOOLCHAIN=local)
Switch to go-version-file: go.mod so the workflows track the module's
declared Go version automatically.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 23, 2026
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.
Summary
go-ethereum v1.16 moved the binding-generation helpers from
`github.com/ethereum/go-ethereum/accounts/abi/bind` to
`github.com/ethereum/go-ethereum/accounts/abi/abigen` and renamed two of them:
`tools/generators/ethereum/contract_parsing.go` reaches into those symbols via `//go:linkname` (signatures use `map[string]struct{}` rather than the package-private `map[string]*tmplStruct`; this works because Go's linker doesn't type-check linkname targets and both value types are pointer-sized in memory).
Pointing the directives at the post-rename names in the post-move package lets the codegen tool link cleanly against go-ethereum v1.16, v1.17, and later. This is needed for tlabs-xyz/keep-core-security#13 (a security PR bumping go-ethereum 1.13.15 → 1.17.3 to clear 5 High CVEs); the Docker build's `make generate` step fails to link without this fix.
Changes
Verification
Caveats
`//go:linkname` is fragile by design — Go authors don't guarantee the stability of unexported symbols. A longer-term fix would be to either:
This PR keeps the existing approach because the same compatibility hazard already lived in v1.7.0; the rename is the minimum-diff fix needed to unblock the go-ethereum v1.17.3 security bump downstream. A follow-up to remove the linkname approach is worthwhile.
Test plan
🤖 Generated with Claude Code