Skip to content

Implement a forked sort package from go1.13 for stable masternode sorting#489

Open
endale98 wants to merge 3 commits into
BuildOnViction:masterfrom
endale98:feat/custom-sort
Open

Implement a forked sort package from go1.13 for stable masternode sorting#489
endale98 wants to merge 3 commits into
BuildOnViction:masterfrom
endale98:feat/custom-sort

Conversation

@endale98
Copy link
Copy Markdown

@endale98 endale98 commented Dec 6, 2024

Description

This PR addresses the issue of ensuring stable sorting of masternodes across different Go versions. To achieve this, we have forked the sort package from Go 1.13 and implemented it specifically for the masternode sorting algorithm.

The forked sort package guarantees consistent behavior, providing stability and reliability in the sorting process regardless of the underlying Go version.

Changes

Utility Functions:

  • common/sort/slice.go.
  • common/sort/sort.go.
  • common/sort/slice_go113.go.
  • common/sort/genzfunc.go.
  • common/sort/zfuncversion.go.

Import Changes:

  • core/blockchain.go: Updated import statement to use the new sort package from github.com/tomochain/tomochain/common/sort.

Tests:

  • common/sort/example_interface_test.go.
  • common/sort/example_keys_test.go.
  • common/sort/example_multi_test.go.
  • common/sort/example_test.go.
  • common/sort/example_wrapper_test.go.
  • common/sort/export_test.go.
  • common/sort/sort_test.go.

Impact

This change ensures:

  • Consistent sorting behavior across Go versions.
  • Stable and predictable masternode operations, improving reliability of the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant