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

Create StateRecoveryDB and MessageRecoveryDB classes #9161

Open
Tracked by #6919
ishantiw opened this issue Nov 29, 2023 · 0 comments
Open
Tracked by #6919

Create StateRecoveryDB and MessageRecoveryDB classes #9161

ishantiw opened this issue Nov 29, 2023 · 0 comments

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Nov 29, 2023

Description

  • Propose and define types for each data type, define getDBInstance to create DB instance. Below is one proposal,
// 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;
}
  • Define DB classes for state and message recovery without implementation
class StateRecoveryDB {
	// Save proof by height
	public setInclusionProof(chainID, queryKey, proofByHeight) {}
	public getInclusionProof(chainID, queryKey) {}
      public getInclusionProofByHeight(height: number) {}
      public deleteInclusionProofsUntilHeight(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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants