Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Fix bftweight zero issue #8899

Merged
merged 10 commits into from
Sep 1, 2023
Merged

Conversation

ishantiw
Copy link
Contributor

@ishantiw ishantiw commented Aug 25, 2023

What was the problem?

This PR resolves #8883 & #8905 & #8849

How was it solved?

  • Introduce getBFTParametersActiveValidators to provide only active validators from BFT params.
  • Fix verifyValidatorsUpdate bitmap verification to properly handle bftWeight === 0 in bftWeightUpdate

How was it tested?

Run multiple chains and enable chain connector plugin, change validator set by staking/unstaking and observe CCUs

@ishantiw ishantiw changed the base branch from development to release/6.0.0 August 25, 2023 10:46
@ishantiw ishantiw self-assigned this Aug 25, 2023
Copy link

@gkoumout gkoumout left a comment

Choose a reason for hiding this comment

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

Left few comments.

@ishantiw ishantiw force-pushed the 8883-fix-bftweight-zero-issue branch 2 times, most recently from cb3c6e2 to c6074fb Compare August 31, 2023 14:46
♻️ Update based on LIP0053 updates

🐛 Filter out bftWeight===0 when saving validatorsPreimage

🐛 Filter out bftWeight===0 when computing validatorsHash

🐛 Filter out bftWeight===0 when selecting and validating aggregateCommit
@ishantiw ishantiw force-pushed the 8883-fix-bftweight-zero-issue branch from c6074fb to 8573a2f Compare August 31, 2023 14:50
@ishantiw ishantiw marked this pull request as ready for review August 31, 2023 14:51
@ishantiw ishantiw requested review from shuse2 and gkoumout August 31, 2023 14:51
Copy link

@gkoumout gkoumout left a comment

Choose a reason for hiding this comment

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

Two small comments, otherwise looks good. Moreover, don't we need to update tests for verifyValidatorsUpdate?

@ishantiw ishantiw requested a review from gkoumout September 1, 2023 12:15
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #8899 (a7c472c) into release/6.0.0 (a12b87f) will decrease coverage by 0.01%.
The diff coverage is 94.59%.

❗ Current head a7c472c differs from pull request most recent head 3396b05. Consider uploading reports for the commit 3396b05 to get more accurate results

Impacted file tree graph

@@                Coverage Diff                @@
##           release/6.0.0    #8899      +/-   ##
=================================================
- Coverage          83.61%   83.60%   -0.01%     
=================================================
  Files                601      601              
  Lines              22520    22537      +17     
  Branches            3319     3320       +1     
=================================================
+ Hits               18829    18843      +14     
- Misses              3691     3694       +3     
Files Changed Coverage
framework/src/genesis_block.ts 50.00%
...ain-connector-plugin/src/chain_connector_plugin.ts 100.00%
framework/src/engine/bft/method.ts 100.00%
framework/src/engine/bft/utils.ts 100.00%
...ne/consensus/certificate_generation/commit_pool.ts 100.00%
framework/src/engine/endpoint/consensus.ts 100.00%
framework/src/engine/generator/generator.ts 100.00%
...rability/base_interoperability_internal_methods.ts 100.00%

@ishantiw ishantiw force-pushed the 8883-fix-bftweight-zero-issue branch from bef3bc7 to 32de658 Compare September 1, 2023 13:48
Copy link

@gkoumout gkoumout left a comment

Choose a reason for hiding this comment

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

Looks good, just one optional comment.

@ishantiw ishantiw force-pushed the 8883-fix-bftweight-zero-issue branch from c7acfb8 to ca17ffe Compare September 1, 2023 14:23
@ishantiw ishantiw requested a review from gkoumout September 1, 2023 14:24
@ishantiw ishantiw force-pushed the 8883-fix-bftweight-zero-issue branch from a7c472c to ae5dbb5 Compare September 1, 2023 16:01
@ishantiw ishantiw enabled auto-merge (squash) September 1, 2023 16:22
@ishantiw ishantiw merged commit f842ee3 into release/6.0.0 Sep 1, 2023
@ishantiw ishantiw deleted the 8883-fix-bftweight-zero-issue branch September 1, 2023 16:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants