-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix max seat number computation #12
base: main
Are you sure you want to change the base?
Conversation
It's still not 100% accurate, but it would give the result closer to the truth
std::cmp::max( | ||
seats_before_statelessnet, | ||
protocol_config.num_chunk_only_producer_seats, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should sum up these numbers or taking the maximum. Current value is for sure smaller than we need.
current <= maximum <= sum
For Statelessnet, the values are 20, 300, 320.
Instead of spending hours on the investigation, I suggest starting using maximum and fix it later again if we see the other issues here.
protocol_config.num_chunk_only_producer_seats, | ||
) | ||
} | ||
|
||
/// This implementation is ported from near-api-js: | ||
/// https://github.com/near/near-api-js/blob/bdbf839f54fbc399d7299da8cf9966bbdc426238/packages/utils/src/validators.ts#L24-L50 | ||
fn find_seat_price_for_protocol_before_49( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think we don't need to check protocol version for the current change because protocol_config.num_chunk_only_producer_seats
will be zero for older protocol versions, so it will not affect the result.
@telezhnaya I checked it on mainnet and it does not look right to me: The 100th seat (the last block producer seat is 816k NEAR at the moment, so you only need that to be the block producer, and you need even less to be a chunk producer!) To be fair, the main branch version is even more off: |
@telezhnaya What is our final call here? Do we need this PR to be merged? Can you double-check that the numbers match the expectations? |
No, not now |
Fixes #11
It's still not 100% accurate, but it would give the result closer to the truth.