Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

HIP 16 implementation #676

Merged
merged 3 commits into from
Nov 18, 2020
Merged

HIP 16 implementation #676

merged 3 commits into from
Nov 18, 2020

Conversation

evanmcc
Copy link
Contributor

@evanmcc evanmcc commented Nov 4, 2020

This PR adds new election behavior that ignores hotspot scores in both selection and old elector removal. It will need to be activated by chain var, seeing election_version to 4.

@evanmcc
Copy link
Contributor Author

evanmcc commented Nov 4, 2020

helium/HIP#55

{Remove, Replace} = determine_sizes(Size, OldLen, Delay, Ledger),

%% remove dupes, sort
{OldGroupScored0, Gateways1} = dedup(OldGroup0, Gateways0, Ledger),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I know this is probably just to keep the code super similar but calling it "Scored" is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not as confusing any more now that I saw the default score of 1.0 thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix.

src/blockchain_election.erl Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 9, 2020

Codecov Report

Merging #676 (b6afb9c) into master (f76bc24) will increase coverage by 0.14%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #676      +/-   ##
==========================================
+ Coverage   67.96%   68.11%   +0.14%     
==========================================
  Files          93       93              
  Lines       12175    12211      +36     
==========================================
+ Hits         8275     8317      +42     
+ Misses       3900     3894       -6     
Impacted Files Coverage Δ
src/blockchain_election.erl 80.18% <94.28%> (+2.78%) ⬆️
src/transactions/v1/blockchain_txn_vars_v1.erl 61.86% <100.00%> (+0.08%) ⬆️
src/handlers/blockchain_gossip_handler.erl 59.09% <0.00%> (-9.10%) ⬇️
src/handlers/blockchain_sync_handler.erl 92.72% <0.00%> (-1.82%) ⬇️
src/transactions/blockchain_txn_mgr.erl 54.12% <0.00%> (-0.92%) ⬇️
src/blockchain.erl 63.14% <0.00%> (-0.10%) ⬇️
src/ledger/v1/blockchain_ledger_v1.erl 76.74% <0.00%> (+0.11%) ⬆️
src/blockchain_worker.erl 38.99% <0.00%> (+0.26%) ⬆️
src/blockchain_gateway_cache.erl 64.39% <0.00%> (+9.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f76bc24...b6afb9c. Read the comment docs.

@abhay
Copy link
Contributor

abhay commented Nov 17, 2020

LG!

Copy link
Member

@vihu vihu left a comment

Choose a reason for hiding this comment

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

lgtm

@evanmcc evanmcc merged commit 14f283d into master Nov 18, 2020
@evanmcc evanmcc deleted the pevm/random-election branch November 18, 2020 00:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants