Skip to content

Commit 8e6bbd0

Browse files
ONECaseyMaxMustermann2GheisMohammadiFrozen“GheisMohammadi”
authored
Mainnet Release Candidate 4.3.14-rc2 hotfix to main (#4339)
* Rebase dev branch to current main branch (#4318) * add openssl compatibility on m2 chips using darwin (#4302) Adds support for OpenSSL on MacOS Ventura using m2 chips. * [dumpdb] ensure each cross link is dumped (#4311) * bump libp2p to version 0.24.0 and update its dependencies and relevant tests (#4315) * Removed legacy syncing peer provider. (#4260) * Removed legacy syncing peer provider. * Fix localnet. * Fix migrate version. * Rebased on main. * Fix formatting. * Remove blockchain dependency from engine. (#4310) * Consensus doesn't require anymore `Node` as a circular dependency. * Rebased upon main. * Removed engine beacon chain dependency. * Fixed nil error. * Fixed error. * bump libp2p to version 0.24.0 and update its dependencies and relevant tests * fix format, remove wrongly added configs * add back wrongly deleted comment * fix travis go checker Co-authored-by: Konstantin <[email protected]> Co-authored-by: “GheisMohammadi” <“[email protected]”> * bump libp2p to version 0.24.0 and update its dependencies and relevant tests (#4315) * Removed legacy syncing peer provider. (#4260) * Removed legacy syncing peer provider. * Fix localnet. * Fix migrate version. * Rebased on main. * Fix formatting. * Remove blockchain dependency from engine. (#4310) * Consensus doesn't require anymore `Node` as a circular dependency. * Rebased upon main. * Removed engine beacon chain dependency. * Fixed nil error. * Fixed error. * bump libp2p to version 0.24.0 and update its dependencies and relevant tests * fix format, remove wrongly added configs * add back wrongly deleted comment * fix travis go checker Co-authored-by: Konstantin <[email protected]> Co-authored-by: “GheisMohammadi” <“[email protected]”> * Fix for consensus stuck. (#4307) * Added check for block validity. * Starts new view change if block invalid. * Revert "Starts new view change if block invalid." This reverts commit e889fa5. * staged dns sync v1.0 (#4316) * staged dns sync v1.0 * enabled stream downloader for localnet * fix code review issues * remove extra lock Co-authored-by: “GheisMohammadi” <“[email protected]”> * add description for closing client and change randomize process to ma… (#4276) * add description for closing client and change randomize process to make sure only online nodes are added to sync config * fix sync test * fix legacy limitNumPeers test * add WaitForEachPeerToConnect to node configs to make parallel peer connection optional Co-authored-by: “GheisMohammadi” <“[email protected]”> * Small fixes and code cleanup for network stack. (#4320) * staged dns sync v1.0 * enabled stream downloader for localnet * fix code review issues * remove extra lock * staged dns sync v1.0 * Fixed, code clean up and other. * Fixed, code clean up and other. * Fixed, code clean up and other. * Fix config. Co-authored-by: “GheisMohammadi” <“[email protected]”> * Fix not disable cache in archival mode (#4322) * Feature registry (#4324) * Registry for services. * Test. * Reverted comment. * Fix. * Slash fix (#4284) * Implementation of new slashing rate calculation * Write tests for then new slashing rate calculation * Add engine.applySlashing tests * fix #4059 Co-authored-by: Alex Brezas <[email protected]> Co-authored-by: Dimitris Lamprinos <[email protected]> * Bump github.com/aws/aws-sdk-go from 1.30.1 to 1.33.0 (#4325) (#4328) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.1 to 1.33.0. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.33.0/CHANGELOG.md) - [Commits](aws/aws-sdk-go@v1.30.1...v1.33.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/btcsuite/btcd from 0.21.0-beta to 0.23.2 (#4327) (#4329) Bumps [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.21.0-beta to 0.23.2. - [Release notes](https://github.com/btcsuite/btcd/releases) - [Changelog](https://github.com/btcsuite/btcd/blob/master/CHANGES) - [Commits](btcsuite/btcd@v0.21.0-beta...v0.23.2) --- updated-dependencies: - dependency-name: github.com/btcsuite/btcd dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix epoch chain initialization issue (#4331) * Fix getting epoch number. (#4279) * feat: update dockerfile with some enhacement (#4250) * feat: update dockerfile with some enhancement * [docker] fix: update golang version Co-authored-by: MaxMustermann2 <[email protected]> * [build] github action update (#4336) * [ops] update github action files * [ops] add debug message in github action * [ops] fix GPG action variable * [ops] fix macos-12 build * [ops] fix macos-12 build * [ops] fix macos-12 build * [ops] fix macos-12 build * [ops] fix macos-12 build * [ops] fix macos-12 build * [cmd] update year version (#4334) * chore(build): upgrade golang to 1.19 (#4335) * chore(build): upgrade golang to 1.19 * chore(build): run `go mod tidy` * chore(build): run `goimports -w -e ${file}` * chore(build): revert github ci changes * chore(build): pin golang version to 1.19.5 * chore(build): fix protoc version on gen files * chore(build): fix protoc-gen-go to v1.26.0 (#4337) * fix config migration issue (#4338) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Max <[email protected]> Co-authored-by: Gheis <[email protected]> Co-authored-by: Konstantin <[email protected]> Co-authored-by: “GheisMohammadi” <“[email protected]”> Co-authored-by: Danny Willis <[email protected]> Co-authored-by: PeekPI <[email protected]> Co-authored-by: Alex Brezas <[email protected]> Co-authored-by: Dimitris Lamprinos <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gheis Mohammadi <[email protected]> Co-authored-by: Jason Yi <[email protected]> Co-authored-by: Soph <[email protected]>
1 parent a32a175 commit 8e6bbd0

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

Diff for: cmd/harmony/config_migrations.go

+34-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"errors"
55
"fmt"
66
"sort"
7+
"strconv"
8+
"strings"
79

810
goversion "github.com/hashicorp/go-version"
911
"github.com/pelletier/go-toml"
@@ -335,8 +337,38 @@ func getNextVersion(x map[string]configMigrationFunc) string {
335337
keys[i] = k
336338
i++
337339
}
338-
sort.Strings(keys)
339-
requiredFunc := x[keys[len(keys)-1]]
340+
// sorting keys (versions)
341+
// each key is in format "x.x.x". Normal sort won't work if the versions
342+
// don't have same number of digits, for example 1.02.10 and 1.2.9
343+
// so, we need a custom sort
344+
sort.Slice(keys, func(i, j int) bool {
345+
v1 := keys[i]
346+
v2 := keys[j]
347+
v1Parts := strings.Split(v1, ".")
348+
v2Parts := strings.Split(v2, ".")
349+
if len(v1Parts) > len(v2Parts) {
350+
return true
351+
} else if len(v1Parts) < len(v2Parts) {
352+
return false
353+
}
354+
for i := 0; i < len(v1Parts); i++ {
355+
n1, err1 := strconv.ParseInt(v1Parts[i], 10, 32)
356+
if err1 != nil {
357+
panic("wrong version format")
358+
}
359+
n2, err2 := strconv.ParseInt(v2Parts[i], 10, 32)
360+
if err2 != nil {
361+
panic("wrong version format")
362+
}
363+
if n1 > n2 {
364+
return true
365+
} else if n1 < n2 {
366+
return false
367+
}
368+
}
369+
return false
370+
})
371+
requiredFunc := x[keys[0]]
340372
tree = requiredFunc(tree)
341373
return tree.Get("Version").(string)
342374
}

0 commit comments

Comments
 (0)