Skip to content

fix: remove non-determinism#679

Merged
justinfrevert merged 3 commits into
release/node-0.20.2from
giles-match-order
Feb 15, 2026
Merged

fix: remove non-determinism#679
justinfrevert merged 3 commits into
release/node-0.20.2from
giles-match-order

Conversation

@gilescope

@gilescope gilescope commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Using a hashmap, unshielded tx with 1 input have a deterministic iteration, but for unsigned tx with more than one input then it's non-deterministic.

Ensure deterministic ordering. This order might be a tad peculiar but it gets past the 6xx block that was the first to cause issues.

How did I find it:
I was syncing with preview. 80% of the time I was getting panics - I guess the true figure was 75% of the time because there are 2 hashmaps and with 2 entries in them you get 4 combos. When I switched to the btreemap I got panics every time I got to that block. When I did rev on both inputs and outputs I got panics all the time , but when rev inputs and not outputs then every time I got past the 634 block on preview.

#679

Signed-off-by: Giles Cope <gilescope@gmail.com>
@gilescope gilescope marked this pull request as ready for review February 14, 2026 12:20
@gilescope gilescope requested a review from a team as a code owner February 14, 2026 12:20
Comment thread ledger/src/versions/common/api/transaction.rs Outdated
Just this change would not be enough to get to head.
@gilescope gilescope changed the title fix: keep existing preview ordering fix: remove non-determinism Feb 15, 2026

@justinfrevert justinfrevert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like it should improve things.

@justinfrevert justinfrevert enabled auto-merge (squash) February 15, 2026 17:15
@justinfrevert justinfrevert merged commit 9101543 into release/node-0.20.2 Feb 15, 2026
31 checks passed
@justinfrevert justinfrevert deleted the giles-match-order branch February 15, 2026 17:59
ozgb pushed a commit that referenced this pull request Feb 18, 2026
* fix: keep existing preview ordering

Signed-off-by: Giles Cope <gilescope@gmail.com>

* preview has other tx with different orderings.

Just this change would not be enough to get to head.

* fix npm audit finding

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>
ozgb pushed a commit that referenced this pull request Feb 18, 2026
* fix: keep existing preview ordering

Signed-off-by: Giles Cope <gilescope@gmail.com>

* preview has other tx with different orderings.

Just this change would not be enough to get to head.

* fix npm audit finding

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>
ozgb added a commit that referenced this pull request Feb 18, 2026
* chore: update indexer commit to fix sbom checks

* feat: add network_peerReputations and network_peerReputation RPC endpoints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>

* feat: add unsafe RPC to unban peers (#666)

* feat: add unsafe RPC to unban peers

Useful for node operators to use when a peer is banned but has since corrected it’s behaviour.

Without this RPC, the only way to reset peer reputation is to restart the node (reputation exists in memory only).

* docs: add pr link to change file

* fix: remove non-determinism (#679)

* fix: keep existing preview ordering

Signed-off-by: Giles Cope <gilescope@gmail.com>

* preview has other tx with different orderings.

Just this change would not be enough to get to head.

* fix npm audit finding

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>

* fix: sync non-deterministically while historical chain patch is pending (#685)

* fix: sync non-deterministically while historical chain patch is pending

* docs: add pr link to change file

* docs: add ticket link to change file

* chore: cargo fmt

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Squirrel <giles.cope@shielded.io>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>
ozgb added a commit that referenced this pull request Feb 18, 2026
* fix: remove non-determinism (#679)

* fix: keep existing preview ordering

Signed-off-by: Giles Cope <gilescope@gmail.com>

* preview has other tx with different orderings.

Just this change would not be enough to get to head.

* fix npm audit finding

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>

* fix: sync non-deterministically while historical chain patch is pending (#685)

* fix: sync non-deterministically while historical chain patch is pending

* docs: add pr link to change file

* docs: add ticket link to change file

* feat: add unsafe RPC to unban peers (#666)

* feat: add unsafe RPC to unban peers

Useful for node operators to use when a peer is banned but has since corrected it’s behaviour.

Without this RPC, the only way to reset peer reputation is to restart the node (reputation exists in memory only).

* docs: add pr link to change file

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Squirrel <giles.cope@shielded.io>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>
m2ux added a commit that referenced this pull request Apr 23, 2026
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Apr 23, 2026
Signed-off-by: Mike Clay <mike.clay@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants