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

*: consensus abstraction #3327

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

*: consensus abstraction #3327

wants to merge 26 commits into from

Conversation

pinebit
Copy link
Contributor

@pinebit pinebit commented Oct 8, 2024

Summary of changes:

  1. Introduced & implemented ConsensusController interface.
  2. Refactored the entire consensus package with increased test coverage.
  3. Added cluster run --consensus-protocol=xyz flag.
  4. Wired Priority protocol to change the current core consensus algorithm.
  5. Support to run two consensus protocols at a time (one for Priority - QBFT and another is for Core).
  6. Added docs/consensus.md

category: feature
ticket: #3304

@ObolNetwork ObolNetwork deleted a comment from codecov bot Oct 10, 2024
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 74.13333% with 97 lines in your changes missing coverage. Please review.

Project coverage is 58.82%. Comparing base (774902f) to head (078de38).

Files with missing lines Patch % Lines
app/app.go 0.00% 41 Missing ⚠️
core/consensus/controller.go 67.44% 10 Missing and 4 partials ⚠️
core/consensus/qbft/qbft.go 76.36% 12 Missing and 1 partial ⚠️
core/corepb/v1/consensus.pb.go 40.00% 9 Missing ⚠️
core/consensus/qbft/transport.go 73.07% 7 Missing ⚠️
core/consensus/qbft/msg.go 70.00% 6 Missing ⚠️
cluster/manifestpb/v1/manifest.pb.go 0.00% 5 Missing ⚠️
core/deadline.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3327      +/-   ##
==========================================
+ Coverage   58.68%   58.82%   +0.14%     
==========================================
  Files         210      216       +6     
  Lines       30290    30449     +159     
==========================================
+ Hits        17777    17913     +136     
- Misses      10621    10636      +15     
- Partials     1892     1900       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pinebit pinebit marked this pull request as ready for review October 10, 2024 15:02
@pinebit pinebit changed the title *: initial consensus factory implementation *: consensus abstraction Oct 11, 2024
Copy link
Collaborator

@gsora gsora left a comment

Choose a reason for hiding this comment

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

Mostly minor comments, generally looks great

cmd/createcluster.go Show resolved Hide resolved
protocolID string
}

func NewConsensusMetrics(protocolID string) ConsensusMetrics {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird that golangci-lint didn't complain for missing godoc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not complain indeed. I will go over every exported function and add godoc.

core/consensus/protocols/protocols.go Show resolved Hide resolved
@pinebit
Copy link
Contributor Author

pinebit commented Oct 15, 2024

Added @OisinKyne to review at least:

  • docs/consensus.md
  • CLI flags
  • Metrics changes

app/app.go Outdated Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
docs/consensus.md Outdated Show resolved Hide resolved
docs/consensus.md Outdated Show resolved Hide resolved
docs/consensus.md Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 17, 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.

3 participants