aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[consensus] Improve seed for leader election

Open igor-aptos opened this issue 3 years ago • 10 comments

Add root hash of the most recent block used for leader reputation

This is change changes the protocol, but this diff makes it backwards compatible:

  • if new genesis is created - new protocol is used
  • old network uses old protocol, until onchain config is changed via governance to use new protocol

Description

Test Plan

Needs multiple nodes for a proper test, smoke/forge coverage (including compat) should cover this well.


This change is Reviewable

igor-aptos avatar Sep 16 '22 04:09 igor-aptos

Forge is running suite compat on testnet ==> 502b7e65a5003bb3538b690c6685874de1adc29c

Forge is running suite land_blocking on 502b7e65a5003bb3538b690c6685874de1adc29c

:white_check_mark: Forge suite compat success on testnet ==> 502b7e65a5003bb3538b690c6685874de1adc29c

Compatibility test results for testnet ==> 502b7e65a5003bb3538b690c6685874de1adc29c (PR)
1. Check liveness of validators at old version: testnet
compatibility::simple-validator-upgrade::liveness-check : 8432 TPS, 4380 ms latency, 6600 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: 502b7e65a5003bb3538b690c6685874de1adc29c
compatibility::simple-validator-upgrade::single-validator-upgrade : 5656 TPS, 6617 ms latency, 8800 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: 502b7e65a5003bb3538b690c6685874de1adc29c
compatibility::simple-validator-upgrade::half-validator-upgrade : 5644 TPS, 6616 ms latency, 8600 ms p99 latency,no expired txns
4. upgrading second batch to new version: 502b7e65a5003bb3538b690c6685874de1adc29c
compatibility::simple-validator-upgrade::rest-validator-upgrade : 7588 TPS, 4692 ms latency, 9700 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet ==> 502b7e65a5003bb3538b690c6685874de1adc29c passed
Test Ok

:white_check_mark: Forge suite land_blocking success on 502b7e65a5003bb3538b690c6685874de1adc29c

performance benchmark with full nodes : 8088 TPS, 4906 ms latency, 6900 ms p99 latency,no expired txns
Test Ok

Forge is running suite land_blocking on f2db73c268fdd819050f1ebb76e2777ff1960d01

Forge is running suite compat on testnet ==> f2db73c268fdd819050f1ebb76e2777ff1960d01

:white_check_mark: Forge suite land_blocking success on f2db73c268fdd819050f1ebb76e2777ff1960d01

performance benchmark with full nodes : 7830 TPS, 5026 ms latency, 7800 ms p99 latency,(!) expired 3861 out of 3386640 txns
Test Ok

:white_check_mark: Forge suite compat success on testnet ==> f2db73c268fdd819050f1ebb76e2777ff1960d01

Compatibility test results for testnet ==> f2db73c268fdd819050f1ebb76e2777ff1960d01 (PR)
1. Check liveness of validators at old version: testnet
compatibility::simple-validator-upgrade::liveness-check : 8018 TPS, 4600 ms latency, 6400 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: f2db73c268fdd819050f1ebb76e2777ff1960d01
compatibility::simple-validator-upgrade::single-validator-upgrade : 5815 TPS, 6481 ms latency, 8200 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: f2db73c268fdd819050f1ebb76e2777ff1960d01
compatibility::simple-validator-upgrade::half-validator-upgrade : 5510 TPS, 6698 ms latency, 9200 ms p99 latency,no expired txns
4. upgrading second batch to new version: f2db73c268fdd819050f1ebb76e2777ff1960d01
compatibility::simple-validator-upgrade::rest-validator-upgrade : 7500 TPS, 4812 ms latency, 8500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet ==> f2db73c268fdd819050f1ebb76e2777ff1960d01 passed
Test Ok

github-actions[bot] avatar Sep 16 '22 18:09 github-actions[bot]

The changes look good to me but can you provide more context on why is this needed? Also, update the PR description accordingly.

sitalkedia avatar Sep 17 '22 15:09 sitalkedia

Forge is running suite compat on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> f77821223b4fc54104bf3925fc7d1636ac8d111b

github-actions[bot] avatar Oct 25 '22 19:10 github-actions[bot]

Forge is running suite land_blocking on f77821223b4fc54104bf3925fc7d1636ac8d111b

github-actions[bot] avatar Oct 25 '22 19:10 github-actions[bot]

:white_check_mark: Forge suite land_blocking success on f77821223b4fc54104bf3925fc7d1636ac8d111b

performance benchmark with full nodes : 6337 TPS, 6332 ms latency, 15300 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Oct 25 '22 19:10 github-actions[bot]

:white_check_mark: Forge suite compat success on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> f77821223b4fc54104bf3925fc7d1636ac8d111b

Compatibility test results for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> f77821223b4fc54104bf3925fc7d1636ac8d111b (PR)
1. Check liveness of validators at old version: 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7406 TPS, 5209 ms latency, 7300 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: f77821223b4fc54104bf3925fc7d1636ac8d111b
compatibility::simple-validator-upgrade::single-validator-upgrade : 4552 TPS, 8870 ms latency, 11800 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: f77821223b4fc54104bf3925fc7d1636ac8d111b
compatibility::simple-validator-upgrade::half-validator-upgrade : 4800 TPS, 8763 ms latency, 11500 ms p99 latency,no expired txns
4. upgrading second batch to new version: f77821223b4fc54104bf3925fc7d1636ac8d111b
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6823 TPS, 5821 ms latency, 9500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> f77821223b4fc54104bf3925fc7d1636ac8d111b passed
Test Ok

github-actions[bot] avatar Oct 25 '22 19:10 github-actions[bot]

Forge is running suite land_blocking on e5b0e925aad002fa99f55968fabb6084ca92ad01

github-actions[bot] avatar Oct 25 '22 20:10 github-actions[bot]

Forge is running suite compat on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> e5b0e925aad002fa99f55968fabb6084ca92ad01

github-actions[bot] avatar Oct 25 '22 20:10 github-actions[bot]

:white_check_mark: Forge suite land_blocking success on e5b0e925aad002fa99f55968fabb6084ca92ad01

performance benchmark with full nodes : 7026 TPS, 5650 ms latency, 7900 ms p99 latency,no expired txns
Test Ok

github-actions[bot] avatar Oct 25 '22 21:10 github-actions[bot]

:white_check_mark: Forge suite compat success on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> e5b0e925aad002fa99f55968fabb6084ca92ad01

Compatibility test results for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> e5b0e925aad002fa99f55968fabb6084ca92ad01 (PR)
1. Check liveness of validators at old version: 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7261 TPS, 5356 ms latency, 7700 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: e5b0e925aad002fa99f55968fabb6084ca92ad01
compatibility::simple-validator-upgrade::single-validator-upgrade : 4756 TPS, 8652 ms latency, 11600 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: e5b0e925aad002fa99f55968fabb6084ca92ad01
compatibility::simple-validator-upgrade::half-validator-upgrade : 4784 TPS, 8462 ms latency, 11200 ms p99 latency,no expired txns
4. upgrading second batch to new version: e5b0e925aad002fa99f55968fabb6084ca92ad01
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6425 TPS, 6028 ms latency, 11500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> e5b0e925aad002fa99f55968fabb6084ca92ad01 passed
Test Ok

github-actions[bot] avatar Oct 25 '22 21:10 github-actions[bot]

I've already stacked #4973 on top.

I already have a test in #4986, but have to restack that on top of both.

igor-aptos avatar Nov 02 '22 22:11 igor-aptos