Added light client database tables (#736)

This commit is contained in:
Giulio rebuffo 2022-11-15 19:59:55 +01:00 committed by GitHub
parent 10e842853b
commit b0cda9f301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -183,7 +183,7 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
return nil, fmt.Errorf("db verbosity set: %w", err) return nil, fmt.Errorf("db verbosity set: %w", err)
} }
} }
if err = env.SetOption(mdbx.OptMaxDB, 100); err != nil { if err = env.SetOption(mdbx.OptMaxDB, 200); err != nil {
return nil, err return nil, err
} }
if err = env.SetOption(mdbx.OptMaxReaders, kv.ReadersLimit); err != nil { if err = env.SetOption(mdbx.OptMaxReaders, kv.ReadersLimit); err != nil {

View File

@ -421,6 +421,13 @@ const (
// Erigon-CL // Erigon-CL
BeaconState = "BeaconState" BeaconState = "BeaconState"
// LightClientStore => LightClientStore object
// LightClientFinalityUpdate => latest finality update
// LightClientOptimisticUpdate => latest optimistic update
LightClient = "LightClient"
// Period (one every 27 hours) => LightClientUpdate
LightClientUpdates = "LightClientUpdates"
) )
// Keys // Keys
@ -448,6 +455,10 @@ var (
CurrentBodiesSnapshotHash = []byte("CurrentBodiesSnapshotHash") CurrentBodiesSnapshotHash = []byte("CurrentBodiesSnapshotHash")
CurrentBodiesSnapshotBlock = []byte("CurrentBodiesSnapshotBlock") CurrentBodiesSnapshotBlock = []byte("CurrentBodiesSnapshotBlock")
PlainStateVersion = []byte("PlainStateVersion") PlainStateVersion = []byte("PlainStateVersion")
LightClientStore = []byte("LightClientStore")
LightClientFinalityUpdate = []byte("LightClientFinalityUpdate")
LightClientOptimisticUpdate = []byte("LightClientOptimisticUpdate")
) )
// ChaindataTables - list of all buckets. App will panic if some bucket is not in this list. // ChaindataTables - list of all buckets. App will panic if some bucket is not in this list.
@ -561,6 +572,8 @@ var ChaindataTables = []string{
VerkleTrie, VerkleTrie,
BeaconState, BeaconState,
LightClient,
LightClientUpdates,
} }
const ( const (