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

remove unnecessary conditions in Matrix::compute_rank #16

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

x100111010
Copy link
Member

by @Slixe

In fn compute_rank(&self) remove the if condition previously used to remove the bounds check.
According to the issue linked (rust-lang/rust#90794) it has been fixed since 1.72.

@0xA001113 We should check if we can make more improvements like this.

@0xA001113
Copy link
Member

0xA001113 commented Oct 24, 2024

I understand why Kaspa didn't want to merge it for now as it is risky consensus critical change. I did already some basic smoke testing:

  1. Running a devnet on 1 node.
  2. Running a testnet on 3 nodes with the changes and mine against the nodes, sync it afterwards from a node without the changes.
  3. Running a testnet on 2 of 3 nodes with the changes, 1 of 3 nodes without the changes and mine against the nodes.
  4. Running a testnet on 1 of 3 nodes with the changes, 2 of 3 nodes without the changes and mine against the nodes.
  5. Running a mainnet node with the changes, and N nodes without the changes and mine against the nodes.

Moreover, I've tested this patch for quite some time now in our mainnet and testnet and so far all looks good. However I can measure the performance improvement only during benchmark and no real enhancement in production use with 1bps networks. Haven't tested 10bps yet.

I will merge it for now as I like to removal of unsafe code. @Slixe: Many thanks!

@0xA001113 0xA001113 merged commit 2d9b0ee into spectre-project:dev-0.3.16 Oct 24, 2024
5 of 6 checks passed
@Slixe
Copy link

Slixe commented Oct 24, 2024

let me do better then..

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.

None yet

3 participants