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

Admin actions to correct state in EOS EVM #650

Closed
arhag opened this issue Sep 5, 2023 · 0 comments · Fixed by #651 or #654
Closed

Admin actions to correct state in EOS EVM #650

arhag opened this issue Sep 5, 2023 · 0 comments · Fixed by #651 or #654
Assignees
Labels
enhancement New feature or request 👍 lgtm
Milestone

Comments

@arhag
Copy link
Member

arhag commented Sep 5, 2023

Issues can arise due to bugs within the EOS EVM Contract that causes it to deviate from the intended behavior of the EVM protocol. This can lead to the state in the contract deviating from what it should be (and also deviating from what it is in the EOS EVM Node).

These deviations are possible without the EOS EVM Node necessarily failing to replay the virtual blockchain constructed from the transactions processed by EOS EVM Contract and committed within the EOS blockchain. In such a case, the easiest path to correcting the deviation is to simply correct to state to what it should be.

So, this issue tracks an enhancement to EOS EVM Contract which adds a set of new administrative actions (only callable by the same authority that can already update the EOS EVM Contract code) to modify the state in particular ways.

Three new actions are needed to modify the subset of contract state which impacts EVM state (i.e. is also replicated in EOS EVM Node):

  1. setkvstore: Set (upsert) or remove key-value storage slots from a specified account's storage. The account should be specified by its implementation-specific account ID.
  2. rmaccount: Remove an account (referenced by its implementation-specific account ID) and add it to the gcstore table so that later garbage collection processing can clean up any storage slots it leaves behind. Note: reference counts of any code attached to the account must be updated, and if the reference count reaches zero, the code should also be removed from the tables.
  3. addevmbal: Add a positive or negative delta to the balance stored in an EVM account. The account should be specified by its implementation-specific account ID. The invariant that the inevm table tracks the total sum of all EVM account balances should continue to be maintained (under the assumption that that the invariant was already true prior to the addevmbal action call).

Furthermore, three additional actions are needed to modify other parts of the contract state:

  1. addopenbal: Add a positive or negative delta to the balance stored within the EOS EVM Contract on the EOS side associated with an EOS account that opened a balance in the contract. The account should be specified using the EOS account name.
  2. rmgcstore: Remove an entry from the gcstore table. The entry should be specified by the primary key ID of the table row to be removed.
  3. freezeaccnt: Modify a flag associated with an EVM account (specified by the implementation-specific account ID) to put it into or take it out of a freeze state. When an EVM account is in the freeze state, no interactions with it are possible. The user cannot sign a transaction for that account. A contract at that account cannot be called. It should not even be possible to send value to the frozen account.
@arhag arhag added enhancement New feature or request 👍 lgtm labels Sep 5, 2023
@github-project-automation github-project-automation bot moved this to Todo in EOS EVM Sep 5, 2023
@arhag arhag added this to the 0.5.2 milestone Sep 5, 2023
@arhag arhag linked a pull request Sep 6, 2023 that will close this issue
@arhag arhag closed this as completed in #654 Sep 6, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in EOS EVM Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 👍 lgtm
Projects
Status: Done
2 participants