From d636c087484f90d70427949369f078232015dda5 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 14 Aug 2024 15:27:05 -0400 Subject: [PATCH 1/3] Update go --- CONTRIBUTING.md | 2 +- database/json_file_storage_test.go | 6 ++---- go.mod | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0b4b4ac..64889bb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Setup -To start developing on AWM Relayer, you'll need Golang v1.21.13. +To start developing on AWM Relayer, you'll need Golang v1.22.6. ## Issues diff --git a/database/json_file_storage_test.go b/database/json_file_storage_test.go index 9361a730..6f7a1303 100644 --- a/database/json_file_storage_test.go +++ b/database/json_file_storage_test.go @@ -50,10 +50,9 @@ func TestConcurrentWriteReadSingleChain(t *testing.T) { wg := sync.WaitGroup{} for i := 0; i < 10; i++ { wg.Add(1) - idx := i go func() { defer wg.Done() - testWrite(jsonStorage, relayerIDs[0], uint64(idx)) + testWrite(jsonStorage, relayerIDs[0], uint64(i)) }() } wg.Wait() @@ -94,10 +93,9 @@ func TestConcurrentWriteReadMultipleChains(t *testing.T) { wg := sync.WaitGroup{} for i := 0; i < 3; i++ { wg.Add(1) - index := i go func() { defer wg.Done() - testWrite(jsonStorage, relayerIDs[index], uint64(index)) + testWrite(jsonStorage, relayerIDs[i], uint64(i)) }() } wg.Wait() diff --git a/go.mod b/go.mod index e88ce79b..c82e40c1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ava-labs/awm-relayer -go 1.21.13 +go 1.22.6 require ( github.com/ava-labs/avalanchego v1.11.10 From 590966c0a530b97484d0b76ba3a9db6953a13e93 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 14 Aug 2024 15:48:34 -0400 Subject: [PATCH 2/3] Update linter --- scripts/versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/versions.sh b/scripts/versions.sh index 4c00db33..85951548 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -25,4 +25,4 @@ GINKGO_VERSION=${GINKGO_VERSION:-$(getDepVersion github.com/onsi/ginkgo/v2)} SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-update-avago-teleporter} # Set golangci-lint version -GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.55'} +GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.60'} From 41e7872dd91d44148416090ae04d1cd74096fb28 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Thu, 15 Aug 2024 09:58:18 -0400 Subject: [PATCH 3/3] Update loop --- relayer/application_relayer.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/relayer/application_relayer.go b/relayer/application_relayer.go index 2ae439c3..aa2ec06b 100644 --- a/relayer/application_relayer.go +++ b/relayer/application_relayer.go @@ -148,11 +148,8 @@ func (r *ApplicationRelayer) ProcessHeight( ) { var eg errgroup.Group for _, handler := range handlers { - // Copy the loop variable to a local variable to avoid the loop variable being captured by the - // goroutine. Once we upgrade to Go 1.22, we can use the loop variable directly in the goroutine. - h := handler eg.Go(func() error { - _, err := r.ProcessMessage(h) + _, err := r.ProcessMessage(handler) return err }) }