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

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
Member

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants