-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathevents.go
More file actions
51 lines (43 loc) · 1.84 KB
/
events.go
File metadata and controls
51 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package dasmon
import (
"time"
"github.com/libp2p/go-libp2p/core/peer"
)
type Event struct {
Timestamp time.Time `json:"ts,omitempty"`
SeqNum uint64 `json:"seq"`
Tracking *EvtNodeTracking `json:"node_tracking,omitempty"`
Custody *EvtCustodyUpdate `json:"custody_update,omitempty"`
Sampling *EvtSampling `json:"sampling,omitempty"`
Snapshot *EvtSystemSnapshot `json:"snapshot,omitempty"`
}
type EvtNodeTracking struct {
PeerID *peer.ID `json:"peer_id,omitempty"`
Tracking bool `json:"tracking,omitempty"`
Dropped bool `json:"dropped,omitempty"`
DropReason string `json:"drop_reason,omitempty"`
}
type ValueChange[T any] [2]T
type EvtCustodyUpdate struct {
PeerID *peer.ID `json:"peer_id,omitempty"`
Cgc *ValueChange[uint64] `json:"cgc"`
EarliestSlot *ValueChange[uint64] `json:"earliest_slot"`
DeltaFromHead int64 `json:"delta_from_head"`
}
// EvtSampling represents custody sampling events
type EvtSampling struct {
JobStartTimestamp time.Time `json:"job_start_timestamp,omitempty"`
PeerID *peer.ID `json:"peer_id,omitempty"`
Epoch uint64 `json:"epoch"`
Slot uint64 `json:"slot"`
BlockHash string `json:"block_hash"`
Column uint64 `json:"column_id"`
Result SamplingResult `json:"result,omitempty"`
Duration time.Duration `json:"duration,omitempty"` // Duration in milliseconds
ColumnSize int `json:"column_size,omitempty"` // Size in rows. In PeerDAS, this is effectively the number of blobs.
Error *DasmonError `json:"error,omitempty"`
}
type EvtSystemSnapshot struct {
CurrentHeadSlot uint64 `json:"current_head,omitempty"`
Status *EngineStatus `json:"status,omitempty"`
}