ethereumjs-monorepo

@ethereumjs/verkle / CheckpointDB

Class: CheckpointDB

DB is a thin wrapper around the underlying levelup db, which validates inputs and sets encoding type.

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CheckpointDB(opts)

Initialize a DB instance.

Parameters

Name Type
opts CheckpointDBOpts

Defined in

db/checkpoint.ts:43

Properties

_stats

_stats: Object

Type declaration

Name Type
cache { hits: number = 0; reads: number = 0; writes: number = 0 }
cache.hits number
cache.reads number
cache.writes number
db { hits: number = 0; reads: number = 0; writes: number = 0 }
db.hits number
db.reads number
db.writes number

Defined in

db/checkpoint.ts:27


cacheSize

Readonly cacheSize: number

Defined in

db/checkpoint.ts:14


checkpoints

checkpoints: Checkpoint[]

Defined in

db/checkpoint.ts:12


db

db: DB<Uint8Array, Uint8Array>

Defined in

db/checkpoint.ts:13

Methods

batch

batch(opStack): Promise<void>

Inherit Doc

Parameters

Name Type
opStack BatchDBOp<Uint8Array, Uint8Array>[]

Returns

Promise<void>

Implementation of

DB.batch

Defined in

db/checkpoint.ts:217


checkpoint

checkpoint(root): void

Adds a new checkpoint to the stack

Parameters

Name Type
root Uint8Array

Returns

void

Defined in

db/checkpoint.ts:83


commit

commit(): Promise<void>

Commits the latest checkpoint

Returns

Promise<void>

Defined in

db/checkpoint.ts:90


del

del(key): Promise<void>

Inherit Doc

Parameters

Name Type
key Uint8Array

Returns

Promise<void>

Implementation of

DB.del

Defined in

db/checkpoint.ts:195


get

get(key): Promise<undefined | Uint8Array>

Inherit Doc

Parameters

Name Type
key Uint8Array

Returns

Promise<undefined | Uint8Array>

Implementation of

DB.get

Defined in

db/checkpoint.ts:134


hasCheckpoints

hasCheckpoints(): boolean

Is the DB during a checkpoint phase?

Returns

boolean

Defined in

db/checkpoint.ts:75


open

open(): Promise<void>

Returns

Promise<void>

Implementation of

DB.open

Defined in

db/checkpoint.ts:267


put

put(key, value): Promise<void>

Inherit Doc

Parameters

Name Type
key Uint8Array
value Uint8Array

Returns

Promise<void>

Implementation of

DB.put

Defined in

db/checkpoint.ts:173


revert

revert(): Promise<Uint8Array>

Reverts the latest checkpoint

Returns

Promise<Uint8Array>

Defined in

db/checkpoint.ts:126


setCheckpoints

setCheckpoints(checkpoints): void

Flush the checkpoints and use the given checkpoints instead.

Parameters

Name Type
checkpoints Checkpoint[]

Returns

void

Defined in

db/checkpoint.ts:61


shallowCopy

shallowCopy(): CheckpointDB

Inherit Doc

Returns

CheckpointDB

Implementation of

DB.shallowCopy

Defined in

db/checkpoint.ts:263


stats

stats(reset?): Object

Parameters

Name Type Default value
reset boolean true

Returns

Object

Name Type
cache { hits: number = 0; reads: number = 0; writes: number = 0 }
cache.hits number
cache.reads number
cache.writes number
db { hits: number = 0; reads: number = 0; writes: number = 0 }
db.hits number
db.reads number
db.writes number
size number

Defined in

db/checkpoint.ts:241