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

Add proving schemes state to pubkey module #427

Merged
merged 9 commits into from
Dec 4, 2024
Merged

Conversation

hacheigriega
Copy link
Member

@hacheigriega hacheigriega commented Nov 29, 2024

Explanation of Changes

The public key end blocker now checks the percentage of validators that have registered the secp256k1 public key on chain. If this check passes the 80% threshold, the activation height of the proving scheme is set to ActivationLag blocks after the block at which the threshold is reached. When the activation height is reached, the proving scheme is set to active status and all validators without the required public key gets jailed.

This activation height is set to -1 by default to signify that activation process is not in progress. Also note that if the public key registration rate goes below the 80% threshold after an activation process begins (due to a new validator without the required key joining with substantial voting power), the activation height is reverted to -1.

For testing convenience, this ActivationLag is currently set to a small number, 25. This value is a parameter that is subject to change through governance process.

Batching is skipped until the secp256k1 proving scheme is activated.

Testing

Added simple unit tests but jailing is not tested yet.
Tested activation process & cancellation of activation process on a local multi-node network.

Closes: #421

@hacheigriega hacheigriega force-pushed the hy/batch-boot branch 2 times, most recently from 2a95404 to dc5f3da Compare November 29, 2024 22:00
@hacheigriega hacheigriega marked this pull request as ready for review November 30, 2024 13:25
x/pubkey/keeper/endblock.go Show resolved Hide resolved
x/pubkey/keeper/keeper.go Show resolved Hide resolved
scripts/local_multi_setup.sh Outdated Show resolved Hide resolved
x/pubkey/keeper/endblock.go Show resolved Hide resolved
x/pubkey/keeper/endblock_test.go Show resolved Hide resolved
Copy link
Member

@mariocao mariocao left a comment

Choose a reason for hiding this comment

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

Apart from my small few comments, everything looks great! 🥇 🙌

x/pubkey/types/params.go Outdated Show resolved Hide resolved
x/pubkey/types/params.go Outdated Show resolved Hide resolved
@hacheigriega hacheigriega merged commit 8de6b43 into main Dec 4, 2024
9 of 10 checks passed
@hacheigriega hacheigriega deleted the hy/batch-boot branch December 4, 2024 19:23
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.

✨ Implement a state for indicating if proving scheme is enabled
3 participants