erigon/cl/persistence/interface.go
Giulio rebuffo 2d9e378fe8
[Caplin] More efficient Archive format (#9414)
* Minified Beacon Blocks
* Added sparse branching Diffs
* Removed kv.CurrentEpochAttestations and kv.PreviousEpochAttestations
* Never misses a single block on gossip (improved network)
* Simplified blocks insertion
* Added birectional balances links.
* Bugs fixed and overall stability improved.
* Mainnet Archive node size: 144 GB
* States reconstruction time: 1 Day 16 Hours
2024-02-14 13:34:56 +01:00

25 lines
736 B
Go

package persistence
import (
"context"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/cl/cltypes"
"github.com/ledgerwatch/erigon/cl/sentinel/peers"
)
type BlockSource interface {
GetRange(ctx context.Context, tx kv.Tx, from uint64, count uint64) (*peers.PeeredObject[[]*cltypes.SignedBeaconBlock], error)
PurgeRange(ctx context.Context, tx kv.Tx, from uint64, count uint64) error
GetBlock(ctx context.Context, tx kv.Tx, slot uint64) (*peers.PeeredObject[*cltypes.SignedBeaconBlock], error)
}
type BeaconChainWriter interface {
WriteBlock(ctx context.Context, tx kv.RwTx, block *cltypes.SignedBeaconBlock, canonical bool) error
}
type BeaconChainDatabase interface {
BlockSource
BeaconChainWriter
}