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 a "governance" system contract that will be able to initiate rollbacks #471

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avm
Copy link
Collaborator

@avm avm commented Mar 5, 2025

During network launch, we may encounter misconfigurations, vulnerabilities or bugs in the validators or the provers that may result in malicious or breaking changes to the state of the blockchain. One way to deal with them at early stages of the mainnet is "rolling back" to a known good state when an authority decides to do so.

This patch adds a "governance" system contract on the main shard and a corresponding precompile, accepting rollback transactions signed by a "sudo key" (currently the same as the "main key" of the built-in system smart account). The rollback functionality itself will be implemented by following patches.

@avm avm force-pushed the governance-contract branch from 29bbee1 to c6c54df Compare March 5, 2025 14:34
@avm avm force-pushed the governance-contract branch from c6c54df to 77cf67b Compare March 5, 2025 14:36
@avm avm force-pushed the governance-contract branch from 77cf67b to 05de22e Compare March 5, 2025 14:45
@avm avm force-pushed the governance-contract branch from 05de22e to 7e2da06 Compare March 5, 2025 14:54
@avm avm force-pushed the governance-contract branch from 99b6271 to e3134f2 Compare March 6, 2025 11:01
@avm avm force-pushed the governance-contract branch from e3134f2 to 7268ec2 Compare March 6, 2025 11:36
@avm avm changed the title Add a "governance" system contract that can perform rollbacks. Add a "governance" system contract that will be able to initiate rollbacks Mar 6, 2025
@avm avm requested review from Zerg1996 and olegrok March 6, 2025 12:34
@avm avm marked this pull request as ready for review March 6, 2025 12:34
var _ ReadWritePrecompiledContract = (*governance)(nil)

func (g *governance) RequiredGas([]byte, StateDBReadOnly) (uint64, error) {
return 10, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder about putting all these gas values as constants into a single file. Not relevant to this PR tho

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.

4 participants