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: trickle validators #6660

Merged

Conversation

ksrichard
Copy link
Contributor

@ksrichard ksrichard commented Oct 31, 2024

Description

We allow here only a configured (in Consensus constants) number of validator nodes to be active in an epoch, so this way we avoid having way too much validators appear at the same time.
All the validator nodes are saved to the blockchain database, when there is a new validator node registration UTXO, but with a different start epoch that is calculated from the already saved validator nodes.
There is a new gRPC method called GetValidatorNodeChanges, where we can ask base node to give back all the validator node additions and deletions in the given start/end height range.
When Layer-2 scans new blocks and sees that there is a change in the validator node set, simply calls this new grpc method and adds/removes validator nodes. This way base node controls fully how many nodes are registered at which epoch.

Motivation and Context

Layer-2 validator nodes are registered all at once when they were added to the chain with a special UTXO, but it allows to register too many nodes at the same time, so consensus can catch up much slower.

How Has This Been Tested?

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

Copy link

github-actions bot commented Oct 31, 2024

Test Results (CI)

    3 files    129 suites   41m 30s ⏱️
1 341 tests 1 341 ✅ 0 💤 0 ❌
4 021 runs  4 021 ✅ 0 💤 0 ❌

Results for commit 7ff6931.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Oct 31, 2024

Test Results (Integration tests)

 2 files  11 suites   24m 8s ⏱️
36 tests 35 ✅ 0 💤 1 ❌
37 runs  36 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 7ff6931.

♻️ This comment has been updated with latest results.

@ksrichard ksrichard changed the title WIP: feat: trickle validators feat: trickle validators Nov 7, 2024
@ksrichard ksrichard marked this pull request as ready for review November 7, 2024 12:07
@ksrichard ksrichard requested a review from a team as a code owner November 7, 2024 12:07
@ksrichard ksrichard changed the title feat: trickle validators WIP: feat: trickle validators Nov 7, 2024
@ksrichard ksrichard marked this pull request as draft November 7, 2024 12:43
@hansieodendaal
Copy link
Contributor

Interesting approach.

LGTM, apart form failing clippy and tests.

@ksrichard ksrichard changed the title WIP: feat: trickle validators feat: trickle validators Nov 8, 2024
@ksrichard ksrichard marked this pull request as ready for review November 8, 2024 13:38
@sdbondi sdbondi merged commit 9005c11 into tari-project:feature-dan2 Nov 11, 2024
16 of 17 checks passed
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