mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Debug HTTP endpoints (#13164)
* Debug HTTP endpoints * register endpoints * tests * small fixes * config test fix
This commit is contained in:
12
consensus-types/forkchoice/BUILD.bazel
Normal file
12
consensus-types/forkchoice/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["types.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/v4/consensus-types/forkchoice",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//consensus-types/primitives:go_default_library",
|
||||
"//proto/prysm/v1alpha1:go_default_library",
|
||||
],
|
||||
)
|
||||
54
consensus-types/forkchoice/types.go
Normal file
54
consensus-types/forkchoice/types.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package forkchoice
|
||||
|
||||
import (
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||
)
|
||||
|
||||
type NodeValidity uint8
|
||||
|
||||
const (
|
||||
Valid NodeValidity = iota
|
||||
Invalid
|
||||
Optimistic
|
||||
)
|
||||
|
||||
func (v NodeValidity) String() string {
|
||||
switch v {
|
||||
case Valid:
|
||||
return "valid"
|
||||
case Invalid:
|
||||
return "invalid"
|
||||
case Optimistic:
|
||||
return "optimistic"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
type Dump struct {
|
||||
JustifiedCheckpoint *eth.Checkpoint
|
||||
FinalizedCheckpoint *eth.Checkpoint
|
||||
UnrealizedJustifiedCheckpoint *eth.Checkpoint
|
||||
UnrealizedFinalizedCheckpoint *eth.Checkpoint
|
||||
ProposerBoostRoot []byte
|
||||
PreviousProposerBoostRoot []byte
|
||||
HeadRoot []byte
|
||||
ForkChoiceNodes []*Node
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
Validity NodeValidity
|
||||
ExecutionOptimistic bool
|
||||
Slot primitives.Slot
|
||||
JustifiedEpoch primitives.Epoch
|
||||
FinalizedEpoch primitives.Epoch
|
||||
UnrealizedJustifiedEpoch primitives.Epoch
|
||||
UnrealizedFinalizedEpoch primitives.Epoch
|
||||
Balance uint64
|
||||
Weight uint64
|
||||
Timestamp uint64
|
||||
BlockRoot []byte
|
||||
ParentRoot []byte
|
||||
ExecutionBlockHash []byte
|
||||
}
|
||||
Reference in New Issue
Block a user