Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

endale98
Copy link

@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