LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 454 forks source link

Create StateRecoveryDB and MessageRecoveryDB classes #9161

Open ishantiw opened 10 months ago

ishantiw commented 10 months ago

Description

// Data to be stored for state recovery
interface InclusionProof {
    height: number;
    stateRoot: Buffer;
    inclusionProof: OutboxRootWitness & { key: Buffer; value: Buffer };
    storeValue: Buffer;
    storeKey: Buffer;
}

interface ProofByHeight {
  Proof: Proof;
  Height: number
}

// Data to be stored for message recovery
interface CCMAndInclusionProofByHeight {
  ccms: CCM[];
  Proof: Proof;
  Height: number;
}

class MessageRecoveryDB { // Save CCMs and proof by height public setCCMs(chainID, CCMAndInclusionProofByHeight[]) {} public getCCMs(chainID) {} }



### Acceptance Criteria

- Should have all the files, interfaces and tests should be present

### Additional Information
- Relevant implementation https://github.com/LiskHQ/lisk-sdk/pull/8903