mirror of
https://github.com/ledgerwatch/erigon.git
synced 2026-02-06 13:01:45 +00:00
* 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
25 lines
736 B
Go
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
|
|
}
|