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

Implement mainchain State Recovery Command execution #7021

Closed
Tracked by #6915
mitsuaki-u opened this issue Feb 21, 2022 · 0 comments · Fixed by #7167
Closed
Tracked by #6915

Implement mainchain State Recovery Command execution #7021

mitsuaki-u opened this issue Feb 21, 2022 · 0 comments · Fixed by #7167
Assignees
Labels
framework/module/interoperability Interoperability module
Milestone

Comments

@mitsuaki-u
Copy link
Contributor

mitsuaki-u commented Feb 21, 2022

Description

Add state recovery command execution to mainchain interoperability module.

let storeQueries be an empty array

for each entry in trs.params.storeEntries:
    # The recover function corresponding to the module ID applies the recovery logic
    route processing logic to the module given by trs.params.moduleID
    recover(trs.params.chainID, trs.params.moduleID, entry.storePrefix, entry.storeKey, entry.storeValue)
    if the previous call fails:
        execution fails and trs is invalid

    emptyStore = empty bytes # Define an empty store entry
    query = { key: entry.storekey,
              value: SHA-256(emptyStore),
              bitmap: entry.bitmap}
    push query to storeQueries

terminatedStateAccount(trs.params.chainID).stateRoot = SMTCalculateRoot(trs.params.siblingHashes, storeQueries)

Acceptance Criteria

  • Add unit tests for execution command
  • Import this class for use in sidechain interoperability module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework/module/interoperability Interoperability module
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants