github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/db/kafka/passthrough.go (about) 1 package kafka 2 3 import ( 4 "context" 5 "io" 6 7 "github.com/ethereum/go-ethereum/common" 8 types "github.com/prysmaticlabs/eth2-types" 9 "github.com/prysmaticlabs/prysm/beacon-chain/db/filters" 10 iface "github.com/prysmaticlabs/prysm/beacon-chain/state/interface" 11 "github.com/prysmaticlabs/prysm/proto/beacon/db" 12 pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" 13 eth "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1" 14 "github.com/prysmaticlabs/prysm/proto/interfaces" 15 ) 16 17 // DatabasePath -- passthrough. 18 func (e Exporter) DatabasePath() string { 19 return e.db.DatabasePath() 20 } 21 22 // ClearDB -- passthrough. 23 func (e Exporter) ClearDB() error { 24 return e.db.ClearDB() 25 } 26 27 // Backup -- passthrough. 28 func (e Exporter) Backup(ctx context.Context, outputDir string, overridePermission bool) error { 29 return e.db.Backup(ctx, outputDir, false) 30 } 31 32 // Block -- passthrough. 33 func (e Exporter) Block(ctx context.Context, blockRoot [32]byte) (interfaces.SignedBeaconBlock, error) { 34 return e.db.Block(ctx, blockRoot) 35 } 36 37 // HeadBlock -- passthrough. 38 func (e Exporter) HeadBlock(ctx context.Context) (interfaces.SignedBeaconBlock, error) { 39 return e.db.HeadBlock(ctx) 40 } 41 42 // Blocks -- passthrough. 43 func (e Exporter) Blocks(ctx context.Context, f *filters.QueryFilter) ([]interfaces.SignedBeaconBlock, [][32]byte, error) { 44 return e.db.Blocks(ctx, f) 45 } 46 47 // BlockRoots -- passthrough. 48 func (e Exporter) BlockRoots(ctx context.Context, f *filters.QueryFilter) ([][32]byte, error) { 49 return e.db.BlockRoots(ctx, f) 50 } 51 52 // BlocksBySlot -- passthrough. 53 func (e Exporter) BlocksBySlot(ctx context.Context, slot types.Slot) (bool, []interfaces.SignedBeaconBlock, error) { 54 return e.db.BlocksBySlot(ctx, slot) 55 } 56 57 // BlockRootsBySlot -- passthrough. 58 func (e Exporter) BlockRootsBySlot(ctx context.Context, slot types.Slot) (bool, [][32]byte, error) { 59 return e.db.BlockRootsBySlot(ctx, slot) 60 } 61 62 // HasBlock -- passthrough. 63 func (e Exporter) HasBlock(ctx context.Context, blockRoot [32]byte) bool { 64 return e.db.HasBlock(ctx, blockRoot) 65 } 66 67 // State -- passthrough. 68 func (e Exporter) State(ctx context.Context, blockRoot [32]byte) (iface.BeaconState, error) { 69 return e.db.State(ctx, blockRoot) 70 } 71 72 // StateSummary -- passthrough. 73 func (e Exporter) StateSummary(ctx context.Context, blockRoot [32]byte) (*pb.StateSummary, error) { 74 return e.db.StateSummary(ctx, blockRoot) 75 } 76 77 // GenesisState -- passthrough. 78 func (e Exporter) GenesisState(ctx context.Context) (iface.BeaconState, error) { 79 return e.db.GenesisState(ctx) 80 } 81 82 // ProposerSlashing -- passthrough. 83 func (e Exporter) ProposerSlashing(ctx context.Context, slashingRoot [32]byte) (*eth.ProposerSlashing, error) { 84 return e.db.ProposerSlashing(ctx, slashingRoot) 85 } 86 87 // AttesterSlashing -- passthrough. 88 func (e Exporter) AttesterSlashing(ctx context.Context, slashingRoot [32]byte) (*eth.AttesterSlashing, error) { 89 return e.db.AttesterSlashing(ctx, slashingRoot) 90 } 91 92 // HasProposerSlashing -- passthrough. 93 func (e Exporter) HasProposerSlashing(ctx context.Context, slashingRoot [32]byte) bool { 94 return e.db.HasProposerSlashing(ctx, slashingRoot) 95 } 96 97 // HasAttesterSlashing -- passthrough. 98 func (e Exporter) HasAttesterSlashing(ctx context.Context, slashingRoot [32]byte) bool { 99 return e.db.HasAttesterSlashing(ctx, slashingRoot) 100 } 101 102 // VoluntaryExit -- passthrough. 103 func (e Exporter) VoluntaryExit(ctx context.Context, exitRoot [32]byte) (*eth.VoluntaryExit, error) { 104 return e.db.VoluntaryExit(ctx, exitRoot) 105 } 106 107 // HasVoluntaryExit -- passthrough. 108 func (e Exporter) HasVoluntaryExit(ctx context.Context, exitRoot [32]byte) bool { 109 return e.db.HasVoluntaryExit(ctx, exitRoot) 110 } 111 112 // JustifiedCheckpoint -- passthrough. 113 func (e Exporter) JustifiedCheckpoint(ctx context.Context) (*eth.Checkpoint, error) { 114 return e.db.JustifiedCheckpoint(ctx) 115 } 116 117 // FinalizedCheckpoint -- passthrough. 118 func (e Exporter) FinalizedCheckpoint(ctx context.Context) (*eth.Checkpoint, error) { 119 return e.db.FinalizedCheckpoint(ctx) 120 } 121 122 // DepositContractAddress -- passthrough. 123 func (e Exporter) DepositContractAddress(ctx context.Context) ([]byte, error) { 124 return e.db.DepositContractAddress(ctx) 125 } 126 127 // SaveHeadBlockRoot -- passthrough. 128 func (e Exporter) SaveHeadBlockRoot(ctx context.Context, blockRoot [32]byte) error { 129 return e.db.SaveHeadBlockRoot(ctx, blockRoot) 130 } 131 132 // GenesisBlock -- passthrough. 133 func (e Exporter) GenesisBlock(ctx context.Context) (interfaces.SignedBeaconBlock, error) { 134 return e.db.GenesisBlock(ctx) 135 } 136 137 // SaveGenesisBlockRoot -- passthrough. 138 func (e Exporter) SaveGenesisBlockRoot(ctx context.Context, blockRoot [32]byte) error { 139 return e.db.SaveGenesisBlockRoot(ctx, blockRoot) 140 } 141 142 // SaveState -- passthrough. 143 func (e Exporter) SaveState(ctx context.Context, st iface.ReadOnlyBeaconState, blockRoot [32]byte) error { 144 return e.db.SaveState(ctx, st, blockRoot) 145 } 146 147 // SaveStateSummary -- passthrough. 148 func (e Exporter) SaveStateSummary(ctx context.Context, summary *pb.StateSummary) error { 149 return e.db.SaveStateSummary(ctx, summary) 150 } 151 152 // SaveStateSummaries -- passthrough. 153 func (e Exporter) SaveStateSummaries(ctx context.Context, summaries []*pb.StateSummary) error { 154 return e.db.SaveStateSummaries(ctx, summaries) 155 } 156 157 // SaveStates -- passthrough. 158 func (e Exporter) SaveStates(ctx context.Context, states []iface.ReadOnlyBeaconState, blockRoots [][32]byte) error { 159 return e.db.SaveStates(ctx, states, blockRoots) 160 } 161 162 // SaveProposerSlashing -- passthrough. 163 func (e Exporter) SaveProposerSlashing(ctx context.Context, slashing *eth.ProposerSlashing) error { 164 return e.db.SaveProposerSlashing(ctx, slashing) 165 } 166 167 // SaveAttesterSlashing -- passthrough. 168 func (e Exporter) SaveAttesterSlashing(ctx context.Context, slashing *eth.AttesterSlashing) error { 169 return e.db.SaveAttesterSlashing(ctx, slashing) 170 } 171 172 // SaveVoluntaryExit -- passthrough. 173 func (e Exporter) SaveVoluntaryExit(ctx context.Context, exit *eth.VoluntaryExit) error { 174 return e.db.SaveVoluntaryExit(ctx, exit) 175 } 176 177 // SaveJustifiedCheckpoint -- passthrough. 178 func (e Exporter) SaveJustifiedCheckpoint(ctx context.Context, checkpoint *eth.Checkpoint) error { 179 return e.db.SaveJustifiedCheckpoint(ctx, checkpoint) 180 } 181 182 // SaveFinalizedCheckpoint -- passthrough. 183 func (e Exporter) SaveFinalizedCheckpoint(ctx context.Context, checkpoint *eth.Checkpoint) error { 184 return e.db.SaveFinalizedCheckpoint(ctx, checkpoint) 185 } 186 187 // SaveDepositContractAddress -- passthrough. 188 func (e Exporter) SaveDepositContractAddress(ctx context.Context, addr common.Address) error { 189 return e.db.SaveDepositContractAddress(ctx, addr) 190 } 191 192 // DeleteState -- passthrough. 193 func (e Exporter) DeleteState(ctx context.Context, blockRoot [32]byte) error { 194 return e.db.DeleteState(ctx, blockRoot) 195 } 196 197 // DeleteStates -- passthrough. 198 func (e Exporter) DeleteStates(ctx context.Context, blockRoots [][32]byte) error { 199 return e.db.DeleteStates(ctx, blockRoots) 200 } 201 202 // HasState -- passthrough. 203 func (e Exporter) HasState(ctx context.Context, blockRoot [32]byte) bool { 204 return e.db.HasState(ctx, blockRoot) 205 } 206 207 // HasStateSummary -- passthrough. 208 func (e Exporter) HasStateSummary(ctx context.Context, blockRoot [32]byte) bool { 209 return e.db.HasStateSummary(ctx, blockRoot) 210 } 211 212 // IsFinalizedBlock -- passthrough. 213 func (e Exporter) IsFinalizedBlock(ctx context.Context, blockRoot [32]byte) bool { 214 return e.db.IsFinalizedBlock(ctx, blockRoot) 215 } 216 217 // FinalizedChildBlock -- passthrough. 218 func (e Exporter) FinalizedChildBlock(ctx context.Context, blockRoot [32]byte) (interfaces.SignedBeaconBlock, error) { 219 return e.db.FinalizedChildBlock(ctx, blockRoot) 220 } 221 222 // PowchainData -- passthrough 223 func (e Exporter) PowchainData(ctx context.Context) (*db.ETH1ChainData, error) { 224 return e.db.PowchainData(ctx) 225 } 226 227 // SavePowchainData -- passthrough 228 func (e Exporter) SavePowchainData(ctx context.Context, data *db.ETH1ChainData) error { 229 return e.db.SavePowchainData(ctx, data) 230 } 231 232 // ArchivedPointRoot -- passthrough 233 func (e Exporter) ArchivedPointRoot(ctx context.Context, index types.Slot) [32]byte { 234 return e.db.ArchivedPointRoot(ctx, index) 235 } 236 237 // HasArchivedPoint -- passthrough 238 func (e Exporter) HasArchivedPoint(ctx context.Context, index types.Slot) bool { 239 return e.db.HasArchivedPoint(ctx, index) 240 } 241 242 // LastArchivedRoot -- passthrough 243 func (e Exporter) LastArchivedRoot(ctx context.Context) [32]byte { 244 return e.db.LastArchivedRoot(ctx) 245 } 246 247 // HighestSlotBlocksBelow -- passthrough 248 func (e Exporter) HighestSlotBlocksBelow(ctx context.Context, slot types.Slot) ([]interfaces.SignedBeaconBlock, error) { 249 return e.db.HighestSlotBlocksBelow(ctx, slot) 250 } 251 252 // HighestSlotStatesBelow -- passthrough 253 func (e Exporter) HighestSlotStatesBelow(ctx context.Context, slot types.Slot) ([]iface.ReadOnlyBeaconState, error) { 254 return e.db.HighestSlotStatesBelow(ctx, slot) 255 } 256 257 // LastArchivedSlot -- passthrough 258 func (e Exporter) LastArchivedSlot(ctx context.Context) (types.Slot, error) { 259 return e.db.LastArchivedSlot(ctx) 260 } 261 262 // RunMigrations -- passthrough 263 func (e Exporter) RunMigrations(ctx context.Context) error { 264 return e.db.RunMigrations(ctx) 265 } 266 267 // CleanUpDirtyStates -- passthrough 268 func (e Exporter) CleanUpDirtyStates(ctx context.Context, slotsPerArchivedPoint types.Slot) error { 269 return e.db.RunMigrations(ctx) 270 } 271 272 // LoadGenesis -- passthrough 273 func (e Exporter) LoadGenesis(ctx context.Context, r io.Reader) error { 274 return e.db.LoadGenesis(ctx, r) 275 } 276 277 // SaveGenesisData -- passthrough 278 func (e Exporter) SaveGenesisData(ctx context.Context, state iface.BeaconState) error { 279 return e.db.SaveGenesisData(ctx, state) 280 } 281 282 // EnsureEmbeddedGenesis -- passthrough. 283 func (e Exporter) EnsureEmbeddedGenesis(ctx context.Context) error { 284 return e.db.EnsureEmbeddedGenesis(ctx) 285 }