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

Explicit policy values initialization and changes #1867

Closed
roman-khimov opened this issue Aug 23, 2020 · 1 comment · Fixed by #2265
Closed

Explicit policy values initialization and changes #1867

roman-khimov opened this issue Aug 23, 2020 · 1 comment · Fixed by #2265
Labels
Discussion Initial issue state - proposed but not yet accepted

Comments

@roman-khimov
Copy link
Contributor

Summary or problem description
#1795 has removed policy contract's Initialize effectively moving default values from the storage to the code. It's a bit dangerous in that now node implementation can change these values without any notice, bypassing regular governance mechanisms unless some particular value is to be set via committee-signed transactions.

So while the problem of future changes to the policy contract and their influence on Initialize and state root is absolutely valid, I think it can be solved in a bit different manner keeping regular governance scheme in the loop and giving more transparency for the end user.

Do you have any solution you want to propose?
I'd propose reverting this change and establishing a protocol for new policy values rollout.

This would mean that the initial set of the values would be the same (and would never change!), it would be stored as usual, so that no software update could affect it (and all the network would always be in agreement regarding these values) and these values could only be changed via committee-signed transaction (as it was originally intended to).

For the new policy values we would use the following protocol:

  • release Neo update with some NewPolicyValue
    • its initialization shouldn't be added to Initialize
    • GetNewPolicyValue would just throw an error until it's initialized
    • code using this value should be prepared for this error and fallback to old behavior (when this value didn't exist at all) in this case
    • SetNewPolicyValue would be available with regular committee check
  • push (high priority) committee-signed transaction that invokes SetNewPolicyValue and sets it to whatever default value we need
  • everything works as usual afterwards
    • GetNewPolicyValue returns the value set by committee and code may use it for whatever purposes
    • it can by updated with SetNewPolicyValue again if needed

We may also add some dependency on block number in the logic (like this setting is only valid to get after block X). And in the future this mechanism could also be tied to the VM/execution engine versioning, but the basic idea would be the same --- every policy value would be stored in the storage and have some transaction associated with its creation/change, either genesis or committee-signed one.

Neo Version

  • Neo 3

Where in the software does this update applies to?

  • Other: Policy contract and governance
@roman-khimov roman-khimov added the Discussion Initial issue state - proposed but not yet accepted label Aug 23, 2020
@Qiao-Jin
Copy link
Contributor

Qiao-Jin commented Sep 2, 2020

Please read more about info about stateroot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Initial issue state - proposed but not yet accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants