8000 Broadcast vote power. by Frozen · Pull Request #4748 · harmony-one/harmony · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Broadcast vote power. #4748

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

Merged
merged 5 commits into from
Sep 25, 2024
Merged

Broadcast vote power. #4748

merged 5 commits into from
Sep 25, 2024

Conversation

Frozen
Copy link
Contributor
@Frozen Frozen commented Aug 29, 2024

Leader broadcasts vote power, all others receive numbers and store. It available to receive throw api method GetLastSigningPower.

@Frozen Frozen self-assigned this Aug 29, 2024
@mur-me
Copy link
Collaborator
mur-me commented Sep 3, 2024

Hey @Frozen, during the testing I found a bug, more details below.


Result: signPower wasn't updating after consensus crash, last successful value is return
Expected result: signPower should be updated despite the consensus loss

How to reproduce:

  1. Start localnet in make debug or make debug-external
  2. Your sign power will be at the 68% which is enough for consensus and more than 66.6%
  3. Run curl against leader or check the watchdog UI:
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9506
{"jsonrpc":"2.0","id":1,"result":0.68}
  1. Kill one of the validators, e.x. on the 9000 port via:
ps -ef | grep harmony | grep 9000
kill PID
  1. Consensus will 8000 be broken after that, but if you run again curl or check UI in wd you will still get an old 68 signPower, which wasn't updated after crash.
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9506
{"jsonrpc":"2.0","id":1,"result":0.68}

@mur-me
Copy link
Collaborator
mur-me commented Sep 5, 2024

Thanks for the fix, @Frozen


I've tested the following scenario:

  1. Spin up localnet
    Result: Sing power == 68%
  2. Kill any internal node to loose consensus, e.x. current leader.
  3. Check the signing power via hmy_getLastSigningPower
    Result: signing power was 60%
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9610
{"jsonrpc":"2.0","id":1,"result":0.6}
  1. Restart killed node, wait until it rejoin consensus.
    Result: Sing power is again == 68%, consensus has been restored
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9600
{"jsonrpc":"2.0","id":1,"result":0.68}

@mur-me
Copy link
Collaborator
mur-me commented Sep 6, 2024

rn, blockchain couldn't spin up in RPC/Rosseta tests due to:

{
    "level": "error",
    "port": "9000",
    "ip": "127.0.0.1",
    "error": "cannot finalize block: Timeout waiting for commit sigs for reward calculation",
    "caller": "/go/src/github.com/harmony-one/harmony/consensus/consensus_block_proposing.go:236",
    "time": "2024-09-06T09:40:39.249311887Z",
    "message": "[ProposeNewBlock] Failed finalizing the new block"
}

@sophoah
Copy link
Contributor
sophoah commented Sep 9, 2024

@Frozen you latest rebase/conflict fix broke consensus on localnet. Please check

@Frozen
Copy link
Contributor Author
Frozen commented Sep 9, 2024

@Frozen you latest rebase/conflict fix broke consensus on localnet. Please check

Rebase on latest dev broke consensus. Fixed

@mur-me
Copy link
Collaborator
mur-me commented Sep 10, 2024

Thanks for the fix, @Frozen

I've tested the following scenario:

1. Spin up localnet
   **Result:** Sing power == 68%

2. Kill any internal node to loose consensus, e.x. current leader.

3. Check the signing power via `hmy_getLastSigningPower`
   **Result:** signing power was 60%
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9610
{"jsonrpc":"2.0","id":1,"result":0.6}
6. Restart killed node, wait until it rejoin consensus.
   **Result:** Sing power is again == 68%, consensus has been restored
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id": 1, "method": "hmy_getLastSigningPower","params": []}' 127.0.0.1:9600
{"jsonrpc":"2.0","id":1,"result":0.68}

Rechecked the same scenario as mentioned above on both shards with external validator:

  • signPower dropped bellow 67, e.x. 54
  • restored one of the validators
  • signPower went to the > 67 and new blocks have started to be created

Result: PASSED ✔️

@mur-me mur-me self-requested a review September 10, 2024 15:08
@sophoah
Copy link
Contributor
sophoah commented Sep 11, 2024

@Frozen please fix rebase and fix conflict with latest dev

@Frozen
Copy link
Contributor Author
Frozen commented Sep 13, 2024

Rebased

@sophoah
Copy link
Contributor
sophoah commented Sep 25, 2024

just finish testing this one with the latest rebase. All good for me. Good job @Frozen

@sophoah sophoah merged commit 1d8dfe6 into dev Sep 25, 2024
4 checks passed
@sophoah sophoah mentioned this pull request Oct 4, 2024
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.

4 participants
0