blobber

package module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2023 License: GPL-3.0 Imports: 23 Imported by: 1

README

Beacon Chain DevP2P Blob Testing Proxy

!! WARNING !!

Running some of the actions included in this tool will get a validator SLASHED.

Please exercise caution when using this tool and never use it on Mainnet!

Description

Testing tool that sits as a proxy between the beacon and validator clients in order to intercept proposals, and then modify, delay, conceal or corrupt the blobs included in the proposal, which are then relayed to all the beacon clients via the DevP2P network.

    graph LR;
        subgraph identifier[" "]
            beaconClient(Beacon Client)
            validatorClient(Validator Client)
            proxy(Blobber)
            BeaconDevP2P(Beacon DevP2P Network)
        end

        validatorClient -->|Attestations Request| proxy
        proxy -->|Attestations Request| beaconClient
        beaconClient -->|Attestations Response| proxy
        proxy -->|Attestations Response| validatorClient

        validatorClient -->|Proposal Request| proxy
        proxy -->|Proposal Request| beaconClient
        beaconClient -->|Proposal Response| proxy
        proxy -.->|Modified/Signed Proposal Response| BeaconDevP2P

        linkStyle 0,1 stroke-width:3px,fill:none,stroke:darkgreen;
        linkStyle 2,3 stroke-width:3px,fill:none,stroke:green;
        linkStyle 4,5 stroke-width:3px,fill:none,stroke:blue;
        linkStyle 6,7 stroke-width:3px,fill:none,stroke:darkblue;

Documentation

Index

Constants

View Source
const (
	PortBeaconTCP    = 9000
	PortBeaconUDP    = 9000
	PortBeaconAPI    = 4000
	PortBeaconGRPC   = 4001
	PortMetrics      = 8080
	PortValidatorAPI = 5000
	FarFutureEpoch   = beacon_common.Epoch(0xffffffffffffffff)

	DEFAULT_BLOBBER_HOST       = "0.0.0.0"
	DEFAULT_BLOBBER_PORT       = 19999
	DEFAULT_PROXIES_PORT_START = 20000

	DEFAULT_VALIDATOR_LOAD_TIMEOUT_SECONDS = 20
)

Variables

This section is empty.

Functions

func ParseResponse

func ParseResponse(response []byte) (string, *deneb.BlockContents, error)

Types

type Blobber

type Blobber struct {

	// Configuration object
	*config.Config
	// contains filtered or unexported fields
}

func NewBlobber

func NewBlobber(ctx context.Context, opts ...config.Option) (*Blobber, error)

func (*Blobber) AddBeaconClient

func (b *Blobber) AddBeaconClient(cl *beacon_client.BeaconClient, validatorProxy bool) *validator_proxy.ValidatorProxy

func (*Blobber) Address

func (b *Blobber) Address() string

func (*Blobber) Close

func (b *Blobber) Close()

func (*Blobber) GetProducedBlockRoots added in v1.0.5

func (b *Blobber) GetProducedBlockRoots() map[beacon_common.Slot][32]byte

func (*Blobber) IncludeBlobRecord added in v1.0.5

func (b *Blobber) IncludeBlobRecord() *common.BlobRecord

Return a list of blobs that each slot action has classified as must-be-included

func (*Blobber) RejectBlobRecord added in v1.0.5

func (b *Blobber) RejectBlobRecord() *common.BlobRecord

Return a list of blobs that each slot action has classified as must-be-rejected

type BlockDataStruct

type BlockDataStruct struct {
	Version string          `json:"version"`
	Data    json.RawMessage `json:"data"`
}

type BuiltBlocksMap added in v1.0.5

type BuiltBlocksMap struct {
	BlockRoots map[beacon_common.Slot][32]byte
	sync.RWMutex
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL