Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework/module/interoperability Interoperability module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants