eth-blob-indexer/pkg/beacon/models.go
Roy Crihfield 1d1ee73ff2
Some checks failed
Tests / Run Blobscan scraper tests (push) Successful in 2m23s
Tests / Run Beacon collector tests (push) Failing after 22m23s
Implement Blobscan scraper (#2)
New utility to backfill data from Blobscan.

Reviewed-on: #2
2024-07-01 14:01:27 +00:00

40 lines
1.7 KiB
Go

package beacon
import "github.com/protolambda/zrnt/eth2/beacon/common"
type VersionedHash = common.Bytes32
// HeadEvent represents a "head" event from the Blobscan API
type HeadEvent struct {
Slot common.Slot `json:"slot"`
Block common.Root `json:"block"`
State common.Root `json:"state"`
CurrentDutyDependentRoot common.Root `json:"current_duty_dependent_root"`
PreviousDutyDependentRoot common.Root `json:"previous_duty_dependent_root"`
EpochTransition bool `json:"epoch_transition"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
// BlobSidecarEvent represents a "blob_sidecar" event from the Blobscan API
type BlobSidecarEvent struct {
BlockRoot common.Root `json:"block_root"`
Index string `json:"index"`
Slot common.Slot `json:"slot"`
KzgCommitment common.KZGCommitment `json:"kzg_commitment"`
VersionedHash VersionedHash `json:"versioned_hash"`
}
// BlobSidecarsResponse represents a response from the Blobscan API blob_sidecars endpoint
type BlobSidecarsResponse struct {
Data []BlobSidecar `json:"data"`
}
type BlobSidecar struct {
Index string `json:"index"`
Blob string `json:"blob"`
KzgCommitment common.KZGCommitment `json:"kzg_commitment"`
KzgProof string `json:"kzg_proof"`
SignedBlockHeader common.SignedBeaconBlockHeader `json:"signed_block_header"`
KzgCommitmentInclusionProof []string `json:"kzg_commitment_inclusion_proof"`
}