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

feat(code/consensus): Add support for full nodes #742

Open
romac opened this issue Jan 8, 2025 · 2 comments
Open

feat(code/consensus): Add support for full nodes #742

romac opened this issue Jan 8, 2025 · 2 comments
Assignees
Labels
code Code/implementation related core Related to the core consensus implementation feature New feature or request good first issue Good for newcomers
Milestone

Comments

@romac
Copy link
Member

romac commented Jan 8, 2025

Background

All nodes have a validator key. A validator node is a node that has its validator key included in the "current" validator set.

A validator node signs and broadcasts consensus messages. Every node gossip consensus messages. Every processes sends and receives consensus control/gossip messages.

Validator nodes may have a more restrictive network setup. But this is not mandatory.

So, being a validator is not a characteristic, it is a property. A node can be a validator in height H but not in height H + 1. This is application dependent.

All nodes process messages in the same way. But when producing a message, a node whose validator key is not in the current validator set implements a noop. An active validator sign the message and "broadcast" it.

by @cason

Implementation

Change the logic in malachitebft-consensus to not emit Sign* and Publish* effects when we are not in the validator set.

Testing

Update the test framework so that we can mark some nodes as not being part of the validator set (turning them into full nodes) ideally with a nice fluent API, e.g.:

let mut test = TestBuilder::<()>::new();

// validator node (in validator set, voting power 1 by default)
test.add_node().start().wait_until(5).success();

// validator node (in validator set, voting power 5)
test.add_node().with_voting_power(5).start().wait_until(5).success();

// full node (not in validator set)
test.add_node().full_node().start().wait_until(5).success();

test.build().run(Duration::from_secs(30)).await
@romac romac added feature New feature or request good first issue Good for newcomers code Code/implementation related labels Jan 8, 2025
@romac romac added this to the Phase 5 milestone Jan 8, 2025
@romac romac added the core Related to the core consensus implementation label Jan 8, 2025
@hoank101
Copy link
Contributor

hoank101 commented Jan 8, 2025

hi, i can do it, please asign to me

@romac
Copy link
Member Author

romac commented Jan 8, 2025

Awesome, thank you! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code/implementation related core Related to the core consensus implementation feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants