Skip to content

Upstream node-0.21.0-rc.5 changes#753

Closed
github-actions[bot] wants to merge 9 commits intomainfrom
feat/hhbmmaru-upstream-node-0.21.0-rc.5
Closed

Upstream node-0.21.0-rc.5 changes#753
github-actions[bot] wants to merge 9 commits intomainfrom
feat/hhbmmaru-upstream-node-0.21.0-rc.5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Automated Pull Request

Note: Workflow runs will not be triggered by this automated PR

To trigger them, manually open and close the pull request.

This is a "feature" of GitHub Actions, which does not trigger workflows on automated PRs.

  • Updated main branch with changes from the release

  • Replaced 'changes/' directory with an empty template

  • Archived current changes to '.changes_archive/node-0.21.0-rc.5'

NachoPal and others added 9 commits February 11, 2026 14:09
…#648)

* feat: add mainner and fix preprod

* fix: update preprod and mainnet values

* chore: remove comment

* fix: earthfile

* fix: skip test

* fix: adjust preview

* fix: npm audit
* 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>
* Local env improvements (#669)

* chore: remove not used vars from local-env

MainChain variables are sourced from mc.env file

* fix: don't wait for contracts if active

Changed:
- calculate contracts active epoch in contract-compiler container to
avoid waiting in midnight-setup container when resetting local-env
nodes' state

Refs: PM-21897

* Apply suggestion from @gilescope

---------

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

* fix: local-env with indexer (#684)

changed:
- bumped indexer to 4.0.0-alpha.1
- node5 rpc port to 9944 (lace wallet support)

Refs: PM-21916

* chore: bump indexer submodule to v3.1.0-rc.2

* fix: local-env prefers indexer tag instead of sha

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
* fix: historical paths for old qanet, preview

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

* path through history - preprod data expansion (#697)

* fix: intial changes

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

* fix: updated data / defs

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

* fix: remove outdated mappings

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

* fix: wrote custom indexer to get data. preview rpc nodes indexing currentl so that will come in a different commit

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

* fix: preview data

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

* feat: add indexer db query tool and chain event query tool

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

* feat: preprod needed slightly expanded set. This covers more than sufficient blocks but will work.

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

* feat: if it ain't broke don't fix it. We know we can get to block 265948 ok so don't change anything below that.

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

* fix: blocks seem to be switched for this block now

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

* fix: outputs were not updated for some reason.

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

---------

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

* chore: add change file for historical UTXO ordering overrides

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

* fix: compile errors; remove sync-monitoring code

* fix: compile errors for benchmark build

* fix: upgrade eslint and fix lint errors to resolve npm audit high vulnerabilities

Upgrade eslint (^4.0.0 → ^9.29.0), typescript-eslint (^7.3.1 → ^8.33.0),
and minimatch override (10.1.2 → 10.2.1) to resolve all 11 high severity
npm audit vulnerabilities. Fix switch fallthrough bug in run.ts and suppress
no-require-imports in standalone JS worker script.

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
* chore: update compact to 0.29.0

* chore: add change file
Signed-off-by: Giles Cope <gilescope@gmail.com>
* chore(deps): bump ledger to 7.0.0

* fix: pin nextest so that rustc version it uses is fixed

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Squirrel <giles.cope@shielded.io>
@github-actions github-actions Bot requested a review from a team as a code owner February 23, 2026 13:15
Copy link
Copy Markdown
Contributor

@m2ux m2ux left a comment

Choose a reason for hiding this comment

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

PR Review Summary

PR: #753 - Upstream node-0.21.0-rc.5 changes
Reviewer: Workflow-based review
Date: 2026-02-23

Executive Summary

Well-scoped upstream merge introducing a critical UTXO ordering non-determinism fix, peer reputation RPC endpoints, ledger 7.0.0 / Compact 0.29.0 dependency bumps, and mainnet genesis configurations. All validation checks pass; no blocking issues found.

Overall Rating: Comment Only (no critical/high blockers)


Review Artifacts — full methodology and detailed reports
# Artifact Description
01 Design Philosophy Problem classification (Inventive Goal / Improvement, Moderate complexity), ticket traceability, workflow path
02 Assumptions Log 21 assumptions across 6 categories with confidence and risk ratings
03 Review Plan Risk-tiered review plan with 7 tasks across high/medium/low priority areas
04 Test Plan Validation checks: build verification, test suites, dependency consistency, spot checks
05 Change Block Index Categorized index of 107 changed files across 14 categories (74 substantive, by risk tier)
06 Code Review Detailed code review report — 4/5 quality, 0 critical, 2 medium, 3 low findings
07 Test Suite Review Test quality assessment — 3/5, 7 tests reviewed, coverage gaps identified
08 Validation Summary Build/test/lint validation: cargo check, fmt, clippy all PASS; 111/118 tests pass
09 Strategic Review Scope and minimality review — no artifacts, over-engineering, or orphaned infrastructure

Code Review Findings

# Severity Category Finding Location
M-1 Medium Architecture UTXO override loaded via relative filesystem path — assumes node runs from repo root. Graceful fallback with log::warn, but could cause sync failures in non-standard deployments. ledger/src/versions/common/utxo_ordering_override.rs:71
M-2 Medium Error Handling peer_reputations() falls back to PeerId::random() when peer ID parse fails, silently returning incorrect reputation for that entry. The single-peer endpoint correctly returns an error. node/src/peer_info_rpc.rs:122
L-1 Low Documentation Successful UTXO override loading logged at warn level — info would be more appropriate for a successful operation. ledger/src/versions/common/utxo_ordering_override.rs:106
L-2 Low Configuration Mainnet genesis_utxo is all-zeros placeholder; chain-spec entry is commented out. Expected at this stage but must be tracked to completion before launch. res/mainnet/pc-chain-config.json:6
L-3 Low Documentation Comment in mod.rs at line 252 is helpful context but could be more concise. ledger/src/versions/common/mod.rs:252
Finding Details

M-1. UTXO override relative path assumption (Medium)

Location: ledger/src/versions/common/utxo_ordering_override.rs:71

load_overrides() constructs res/utxo-ordering-override-{network_id}.json as a relative path. If the node binary is executed from a non-standard working directory, the file won't be found and the function silently returns an empty HashMap — causing historical block sync failures on preview/preprod/qanet.

Suggestion: Consider embedding the override data at compile time via include_str! or resolving relative to the executable. The current approach is consistent with other res/ patterns but adds an implicit deployment constraint.

M-2. PeerId::random() fallback (Medium)

Location: node/src/peer_info_rpc.rs:122

In peer_reputations(), unparseable peer IDs from the system RPC fall back to PeerId::random(), causing the reputation lookup to query a non-existent peer. The response would include an entry with an incorrect reputation score.

Suggestion: Log a warning and skip the peer from results, or propagate the parse error. The peer_reputation() single-peer endpoint already handles this correctly by returning INVALID_PARAMS_CODE.


Test Review Findings

Gap Severity Recommendation
peer_info_rpc.rs — zero test coverage Medium Add unit tests for input validation, unsafe gate, error paths, response serialization
load_overrides() — file loading/parsing untested Medium Add test with mock JSON data to verify deserialization
UtxoOrdering::apply() — segment gating untested Low Add test verifying reorder is skipped when segments <= 1
BTreeMap deterministic ordering — no direct assertion Low Add test demonstrating consistent iteration order

Covered well: reorder() function has 3 clean unit tests (correct reorder, empty input, length mismatch). Existing transaction tests provide indirect coverage of the BTreeMap fix.


Validation Results

Check Status Notes
cargo check PASS Clean type-checking (8m 52s)
cargo fmt PASS No formatting issues
cargo clippy PASS Zero warnings (1m 50s)
cargo test PASS* 111/118 passed; 7 failures are pre-existing env-dependent (CompactC binary required)

*All 7 test failures are in midnight-node-toolkit and require the CompactC compiler binary + MIDNIGHT_LEDGER_TEST_STATIC_DIR env var. They reproduce identically on the main branch without those dependencies.


Strategic Review

Aspect Assessment
Scope All 107 files relevant to release — no scope creep
Investigation artifacts None found
Over-engineering None found
Orphaned infrastructure None found
Minimality Changes are proportional to the problem

Note: The UTXO override tooling (scripts/fetch-utxo-ordering/) contributes ~3,700 lines (32% of diff) including a 3,535-line Cargo.lock. This is production support tooling correctly excluded from the main workspace. Consider .gitignore-ing the tooling Cargo.lock to reduce future diff noise.


Action Items

Should Address (Recommended):

  • M-1: Consider compile-time inclusion for UTXO override data or document the working-directory requirement
  • M-2: Fix PeerId::random() fallback in peer_reputations() to log+skip instead
  • Add basic unit tests for peer_info_rpc.rs (3 RPC endpoints, including unsafe unban_peer)

Nice to Have (Optional):

  • Change UTXO override successful-load log level from warn to info
  • Track mainnet genesis_utxo placeholder to completion
  • Consider .gitignore-ing scripts/fetch-utxo-ordering/Cargo.lock
  • Add test for load_overrides() JSON parsing

@gilescope gilescope closed this Feb 25, 2026
@justinfrevert justinfrevert mentioned this pull request Mar 5, 2026
14 tasks
gilescope pushed a commit that referenced this pull request Apr 8, 2026
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.

6 participants