Skip to content

Conversation

@colinkim
Copy link
Contributor

Summary

This PR upgrades the Go toolchain version and updates related dependencies.
As part of the upgrade, additional CGO-based stress and concurrency tests
were added for blst to ensure safety and correctness under parallel workloads.


Changes

  • Upgrade Go version to 1.22 and update module dependencies
  • Remove github.com/fjl/memsize/memsizeui dependency
  • Adjust CI / build configuration to align with the new Go version
  • Add CGO-based concurrency and stress tests for blst

Tests

The following tests were executed to validate correctness and stability
after the Go version upgrade:

  • ✅ Unit tests (go test ./...)
  • ✅ Race detection (go test -race ./...)
  • ✅ CGO-based blst stress and concurrency tests
    • High parallel goroutine execution
    • Concurrent BLS signature verification and aggregation
    • Validation of thread-safety and memory safety under load

Notes

  • The added blst tests are intended to catch potential race conditions
    or non-deterministic behavior introduced by CGO interactions or
    Go runtime changes.
  • No functional behavior changes are expected outside of improved
    safety guarantees and test coverage.

colinkim and others added 9 commits January 14, 2026 16:46
Co-authored-by: Felix Lange <fjl@twurst.com>
Replace manual byte-by-byte XOR implementation with the optimized
bitutil.XORBytes function. This improves performance by using word-sized
operations on supported architectures while maintaining the same
functionality. The optimized version processes data in bulk rather than
one byte at a time

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
@egonspace egonspace changed the title Refactor/go version refactor: go version Jan 16, 2026
@egonspace egonspace added the enhancement New feature or request label Jan 16, 2026
@egonspace egonspace added this to the Launch StableNet Testnet milestone Jan 16, 2026
@eomti-wm
Copy link
Contributor

eomti-wm commented Jan 16, 2026

For reference, go-ethereum's PR #28946 (Go 1.22 upgrade) includes some additional changes that could improve this PR:

  1. build/checksums.txt: Update to Go 1.22.x binary checksums for build verification
  2. crypto/signature_nocgo.go: Implement btCurve wrapper instead of using //nolint directives
    • go-ethereum replaced deprecated elliptic.Unmarshal with a custom implementation rather than suppressing the warning
  3. EllipticCurve interface: Currently declared but not used - consider utilizing it as go-ethereum does

Using //nolint to suppress warnings is a temporary workaround. If these functions are completely removed in future Go versions, it could cause issues. Aligning with go-ethereum's approach would provide better long-term maintainability.

Ref: ethereum/go-ethereum#28946

@eomti-wm
Copy link
Contributor

Per golangci-lint#4273, v1.55.2 does not support Go 1.22. Upgrade to v1.56.0+ is required

@colinkim
Copy link
Contributor Author

colinkim commented Jan 16, 2026

Updated the PR with the following changes:

  1. **Go 1.22 Migration[#28946] **: fully adopted and standard libraries (slog, slices, cmp) and fixed lint errors.
  2. Security Fix: Applied a 2KB limit on RLPx handshake messages to prevent potential DoS attacks (upstream cherry-pick).
  3. Build Cleanup: Removed internal SSL configurations from Dockerfile.

@colinkim
Copy link
Contributor Author

Resolved. I applied the upgrade to v1.59.0 via cherry-pick from upstream. Link

Copy link
Member

@0xmhha 0xmhha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. change checksum :
build/checksums.txt -> need to update Go 1.21.6 → Go 1.22.x checksums
  1. README.md:237 -> need to change Go version 1.19 → "1.21 or later"

@0xmhha
Copy link
Member

0xmhha commented Jan 16, 2026

  1. .travis.yml:113, 120 -> need to update go version

Use `github.com/decred/dcrd/dcrec/secp256k1/v4` directly rather than
`github.com/btcsuite/btcd/btcec/v2` which is just a wrapper around the
underlying decred library. Inspired by
cosmos/cosmos-sdk#15018

`github.com/btcsuite/btcd/btcec/v2` has a very annoying breaking change
when upgrading from `v2.3.3` to `v2.3.4`. The easiest way to workaround
this is to just remove the wrapper.

Would be very nice if you could backport this to the release branches.

References:
- btcsuite/btcd#2221
- cometbft/cometbft#4294
- cometbft/cometbft#3728
- zeta-chain/node#2934
@colinkim
Copy link
Contributor Author

Updated the PR with the following changes:

  • Updated build/checksums.txt to Go 1.22.x checksums
  • Updated Go version requirement in README.md (1.19 → 1.22 or later)
  • Updated Go version in .travis.yml to align with Go 1.22

@0xmhha
Copy link
Member

0xmhha commented Jan 19, 2026

@colinkim
still not updated build/checksum.txt

@colinkim
Copy link
Contributor Author

Updated the PR with the following changes:

  • .github/workflows/go.yml
  • build/checksums.txt

Copy link
Member

@0xmhha 0xmhha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@colinkim colinkim merged commit 4f48bdd into dev Jan 21, 2026
3 checks passed
@colinkim colinkim deleted the refactor/go-version branch January 21, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants