eth-blob-indexer/pkg/beacon/models.go

40 lines
1.7 KiB
Go
Raw Normal View History

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"`
}