Skip to content

v3.0: Sort in **descending** stake order (backport of #8787)#8805

Merged
AshwinSekar merged 1 commit intov3.0from
mergify/bp/v3.0/pr-8787
Nov 24, 2025
Merged

v3.0: Sort in **descending** stake order (backport of #8787)#8805
AshwinSekar merged 1 commit intov3.0from
mergify/bp/v3.0/pr-8787

Conversation

@mergify
Copy link

@mergify mergify bot commented Oct 31, 2025

Problem

  • stake-weighted sorting with some randomness was doing it backward
    • ignore randomness for now, assume rng always return 0.5
    • 2 nodes, stake=1, stake=2
    • weights = 0.5^(1/1) = 0.5
    • weights = 0.5^(1/2) = 0.707
    • node with stake 2 would come 2nd in list

Summary of Changes

  • reverse the sort comparison

Fixes #


This is an automatic backport of pull request #8787 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner October 31, 2025 13:08
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.4%. Comparing base (3454667) to head (2036d12).

Additional details and impacted files
@@           Coverage Diff           @@
##             v3.0    #8805   +/-   ##
=======================================
  Coverage    83.4%    83.4%           
=======================================
  Files         810      810           
  Lines      366213   366213           
=======================================
+ Hits       305677   305701   +24     
+ Misses      60536    60512   -24     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@t-nelson
Copy link

t-nelson commented Nov 5, 2025

out of an abundance of caution, we want to see this on testnet for a bit before accepting this one

@bw-solana
Copy link

@AshwinSekar @OliverNChalk - can we check metrics from testnet?

@OliverNChalk
Copy link

OliverNChalk commented Nov 19, 2025

Here's the "raw" optimistic confirmation lag for last ~15 days:

image

With a 20 slot ema (although im not sure how much i rust influx):

image

Trend seems to be downwards...

@bw-solana
Copy link

it at least doesn't seem to be adversely affected. Still a minority of stake on v3.1 (~25%), so wouldn't expect differences to be too pronounced

@t-nelson
Copy link

it at least doesn't seem to be adversely affected. Still a minority of stake on v3.1 (~25%), so wouldn't expect differences to be too pronounced

doesn't this affect block inclusion so we should see higher staked votes landing earlier in upgraded nodes?

@OliverNChalk
Copy link

Yeah, I think we're expecting confirmation lag to trend downwards which it appears to (marginally).

@bw-solana
Copy link

doesn't this affect block inclusion so we should see higher staked votes landing earlier in upgraded nodes?

In theory, yes, but spot checking a few slots from 141vSYKGRPNGieSrGJy8EeDVBcbjSr6aWkimNgrNZ6xN, things still seem pretty random.

I'm assuming we're sorting properly within vote storage, but latency into the scheduler likely still dominates as vote storage remains small (not sure if we have a metric that can confirm this)

@t-nelson
Copy link

how does the trend look this week. should be more adoption by now

Copy link

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

received offline confirmation that this is in fact effective

@AshwinSekar AshwinSekar merged commit c913f6c into v3.0 Nov 24, 2025
42 checks passed
@AshwinSekar AshwinSekar deleted the mergify/bp/v3.0/pr-8787 branch November 24, 2025 21:44
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.

6 participants