From 75c1d2cc805d47509f343d80fb3b06508df5395a Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Mon, 30 Sep 2024 15:59:11 +0200 Subject: [PATCH 1/6] add agent-version to status log --- eth/reqresp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eth/reqresp.go b/eth/reqresp.go index 04b0519..72da10f 100644 --- a/eth/reqresp.go +++ b/eth/reqresp.go @@ -552,8 +552,14 @@ func (r *ReqResp) delegateStream(ctx context.Context, upstream network.Stream) e func (r *ReqResp) Status(ctx context.Context, pid peer.ID) (status *pb.Status, err error) { defer func() { + av, err := r.host.Peerstore().Get(pid, "AgentVersion") + if err != nil { + av = "unknown" + } + reqData := map[string]any{ - "PeerID": pid.String(), + "AgentVersion": av, + "PeerID": pid.String(), } if status != nil { reqData["ForkDigest"] = hex.EncodeToString(status.ForkDigest) From d4cf8d6aa4f2a9937e41f69e9b0516c91dc05090 Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Thu, 3 Oct 2024 11:30:28 +0200 Subject: [PATCH 2/6] rename globalBeaconConfig variable --- eth/genesis.go | 4 ++-- eth/node_config.go | 6 +++--- eth/topic_score_params.go | 26 +++++++++++++------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eth/genesis.go b/eth/genesis.go index ad11e39..bef0846 100644 --- a/eth/genesis.go +++ b/eth/genesis.go @@ -24,7 +24,7 @@ var ( CapellaForkVersion ForkVersion DenebForkVersion ForkVersion - currentBeaconConfig = params.MainnetConfig() // init with Mainnet (we would override if needed) + globalBeaconConfig = params.MainnetConfig() // init with Mainnet (we would override if needed)z ) // configure global ForkVersion variables @@ -34,7 +34,7 @@ func initNetworkForkVersions(beaconConfig *params.BeaconChainConfig) { BellatrixForkVersion = ForkVersion(beaconConfig.BellatrixForkVersion) CapellaForkVersion = ForkVersion(beaconConfig.CapellaForkVersion) DenebForkVersion = ForkVersion(beaconConfig.DenebForkVersion) - currentBeaconConfig = beaconConfig + globalBeaconConfig = beaconConfig } // GenesisConfig represents the Genesis configuration with the Merkle Root diff --git a/eth/node_config.go b/eth/node_config.go index 94c0582..4f4b5bb 100644 --- a/eth/node_config.go +++ b/eth/node_config.go @@ -435,13 +435,13 @@ func topicFormatFromBase(topicBase string) (string, error) { func hasSubnets(topic string) (subnets uint64, hasSubnets bool) { switch topic { case p2p.GossipAttestationMessage: - return currentBeaconConfig.AttestationSubnetCount, true + return globalBeaconConfig.AttestationSubnetCount, true case p2p.GossipSyncCommitteeMessage: - return currentBeaconConfig.SyncCommitteeSubnetCount, true + return globalBeaconConfig.SyncCommitteeSubnetCount, true case p2p.GossipBlobSidecarMessage: - return currentBeaconConfig.BlobsidecarSubnetCount, true + return globalBeaconConfig.BlobsidecarSubnetCount, true default: return uint64(0), false diff --git a/eth/topic_score_params.go b/eth/topic_score_params.go index b99a11c..44f5f1c 100644 --- a/eth/topic_score_params.go +++ b/eth/topic_score_params.go @@ -80,7 +80,7 @@ func topicToScoreParamsMapper(topic string, activeValidators uint64) *pubsub.Top // defaultBlockTopicParams returns the Block-topic specific parameters that need to be given to the topic subscriber func defaultBlockTopicParams() *pubsub.TopicScoreParams { decayEpoch := time.Duration(5) - blocksPerEpoch := uint64(currentBeaconConfig.SlotsPerEpoch) + blocksPerEpoch := uint64(globalBeaconConfig.SlotsPerEpoch) meshWeight := -0.717 return &pubsub.TopicScoreParams{ TopicWeight: beaconBlockWeight, @@ -143,7 +143,7 @@ func defaultAggregateTopicParams(activeValidators uint64) *pubsub.TopicScorePara func defaultSyncContributionTopicParams() *pubsub.TopicScoreParams { // Determine the expected message rate for the particular gossip topic. - aggPerSlot := currentBeaconConfig.SyncCommitteeSubnetCount * currentBeaconConfig.TargetAggregatorsPerSyncSubcommittee + aggPerSlot := globalBeaconConfig.SyncCommitteeSubnetCount * globalBeaconConfig.TargetAggregatorsPerSyncSubcommittee firstMessageCap, err := decayLimit(scoreDecay(1*oneEpochDuration()), float64(aggPerSlot*2/gossipSubD)) if err != nil { slog.Warn("skipping initializing topic scoring", tele.LogAttrError(err)) @@ -179,7 +179,7 @@ func defaultSyncContributionTopicParams() *pubsub.TopicScoreParams { } func defaultAggregateSubnetTopicParams(activeValidators uint64) *pubsub.TopicScoreParams { - subnetCount := currentBeaconConfig.AttestationSubnetCount + subnetCount := globalBeaconConfig.AttestationSubnetCount // Get weight for each specific subnet. topicWeight := attestationTotalWeight / float64(subnetCount) subnetWeight := activeValidators / subnetCount @@ -188,13 +188,13 @@ func defaultAggregateSubnetTopicParams(activeValidators uint64) *pubsub.TopicSco return nil } // Determine the amount of validators expected in a subnet in a single slot. - numPerSlot := time.Duration(subnetWeight / uint64(currentBeaconConfig.SlotsPerEpoch)) + numPerSlot := time.Duration(subnetWeight / uint64(globalBeaconConfig.SlotsPerEpoch)) if numPerSlot == 0 { slog.Warn("numPerSlot is 0, skipping initializing topic scoring") return nil } comsPerSlot := committeeCountPerSlot(activeValidators) - exceedsThreshold := comsPerSlot >= 2*subnetCount/uint64(currentBeaconConfig.SlotsPerEpoch) + exceedsThreshold := comsPerSlot >= 2*subnetCount/uint64(globalBeaconConfig.SlotsPerEpoch) firstDecay := time.Duration(1) meshDecay := time.Duration(4) if exceedsThreshold { @@ -243,10 +243,10 @@ func defaultAggregateSubnetTopicParams(activeValidators uint64) *pubsub.TopicSco } func defaultSyncSubnetTopicParams(activeValidators uint64) *pubsub.TopicScoreParams { - subnetCount := currentBeaconConfig.SyncCommitteeSubnetCount + subnetCount := globalBeaconConfig.SyncCommitteeSubnetCount // Get weight for each specific subnet. topicWeight := syncCommitteesTotalWeight / float64(subnetCount) - syncComSize := currentBeaconConfig.SyncCommitteeSize + syncComSize := globalBeaconConfig.SyncCommitteeSize // Set the max as the sync committee size if activeValidators > syncComSize { activeValidators = syncComSize @@ -391,11 +391,11 @@ func defaultBlsToExecutionChangeTopicParams() *pubsub.TopicScoreParams { // utility functions func oneSlotDuration() time.Duration { - return time.Duration(currentBeaconConfig.SecondsPerSlot) * time.Second + return time.Duration(globalBeaconConfig.SecondsPerSlot) * time.Second } func oneEpochDuration() time.Duration { - return time.Duration(currentBeaconConfig.SlotsPerEpoch) * oneSlotDuration() + return time.Duration(globalBeaconConfig.SlotsPerEpoch) * oneSlotDuration() } // determines the decay rate from the provided time period till @@ -450,7 +450,7 @@ func maxScore() float64 { // Uses a very rough gauge for total aggregator size per slot. func aggregatorsPerSlot(activeValidators uint64) uint64 { comms := committeeCountPerSlot(activeValidators) - totalAggs := comms * currentBeaconConfig.TargetAggregatorsPerCommittee + totalAggs := comms * globalBeaconConfig.TargetAggregatorsPerCommittee return totalAggs } @@ -462,9 +462,9 @@ func committeeCountPerSlot(activeValidators uint64) uint64 { } func slotCommitteeCount(activeValidatorCount uint64) uint64 { - committeesPerSlot := activeValidatorCount / currentBeaconConfig.SecondsPerSlot / currentBeaconConfig.TargetCommitteeSize - if committeesPerSlot > currentBeaconConfig.MaxCommitteesPerSlot { - return currentBeaconConfig.MaxCommitteesPerSlot + committeesPerSlot := activeValidatorCount / globalBeaconConfig.SecondsPerSlot / globalBeaconConfig.TargetCommitteeSize + if committeesPerSlot > globalBeaconConfig.MaxCommitteesPerSlot { + return globalBeaconConfig.MaxCommitteesPerSlot } if committeesPerSlot == 0 { return 1 From 698a100b7896284569db9b7002a6d1fb3a60db8d Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Thu, 3 Oct 2024 11:36:03 +0200 Subject: [PATCH 3/6] add support for the BlockByRange RPC request --- eth/genesis.go | 26 ++++++ eth/reqresp.go | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 5 ++ go.sum | 27 +++++++ 4 files changed, 270 insertions(+) diff --git a/eth/genesis.go b/eth/genesis.go index bef0846..0beb70f 100644 --- a/eth/genesis.go +++ b/eth/genesis.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" ) @@ -92,3 +93,28 @@ func GetCurrentForkVersion(epoch primitives.Epoch, beaconConfg *params.BeaconCha return [4]byte{}, fmt.Errorf("not recognized case for epoch %d", epoch) } } + +func GetForkVersionFromForkDigest(forkD [4]byte) (forkV ForkVersion, err error) { + genesisRoot := GenesisConfigs[globalBeaconConfig.ConfigName].GenesisValidatorRoot + phase0D, _ := signing.ComputeForkDigest(Phase0ForkVersion[:], genesisRoot) + altairD, _ := signing.ComputeForkDigest(AltairForkVersion[:], genesisRoot) + bellatrixD, _ := signing.ComputeForkDigest(BellatrixForkVersion[:], genesisRoot) + capellaD, _ := signing.ComputeForkDigest(CapellaForkVersion[:], genesisRoot) + denebD, _ := signing.ComputeForkDigest(DenebForkVersion[:], genesisRoot) + switch forkD { + case phase0D: + forkV = Phase0ForkVersion + case altairD: + forkV = AltairForkVersion + case bellatrixD: + forkV = BellatrixForkVersion + case capellaD: + forkV = CapellaForkVersion + case denebD: + forkV = DenebForkVersion + default: + forkV = ForkVersion{} + err = fmt.Errorf("not recognized fork_version for (%s)", hex.EncodeToString([]byte(forkD[:]))) + } + return forkV, err +} diff --git a/eth/reqresp.go b/eth/reqresp.go index 72da10f..b52422c 100644 --- a/eth/reqresp.go +++ b/eth/reqresp.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "encoding/hex" + "errors" "fmt" "io" "log/slog" @@ -14,6 +15,7 @@ import ( "time" ssz "github.com/ferranbt/fastssz" + "github.com/libp2p/go-libp2p/core" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" @@ -22,6 +24,9 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types" + psync "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" + "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" + "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "go.opentelemetry.io/otel/attribute" @@ -729,6 +734,90 @@ func (r *ReqResp) MetaData(ctx context.Context, pid peer.ID) (resp *pb.MetaDataV return resp, nil } +func (r *ReqResp) BlocksByRangeV2(ctx context.Context, pid peer.ID, firstSlot, lastSlot uint64) ([]interfaces.ReadOnlySignedBeaconBlock, error) { + var err error + blocks := make([]interfaces.ReadOnlySignedBeaconBlock, 0, (lastSlot - firstSlot)) + + startT := time.Now() + + defer func() { + reqData := map[string]any{ + "PeerID": pid.String(), + } + + if blocks != nil { + reqData["RequestedBlocks"] = lastSlot - firstSlot + reqData["ReceivedBlocks"] = len(blocks) + reqData["Duration"] = time.Since(startT) + } + + if err != nil { + reqData["Error"] = err.Error() + } + + traceEvt := &hermeshost.TraceEvent{ + Type: "REQUEST_BLOCKS_BY_RANGE", + PeerID: r.host.ID(), + Timestamp: time.Now(), + Payload: reqData, + } + traceCtx := context.Background() + if err := r.cfg.DataStream.PutRecord(traceCtx, traceEvt); err != nil { + slog.Warn("failed to put record", tele.LogAttrError(err)) + } + + attrs := []attribute.KeyValue{ + attribute.String("rpc", "block_by_range"), + attribute.Bool("success", err == nil), + } + r.meterRequestCounter.Add(traceCtx, 1, metric.WithAttributes(attrs...)) + }() + + slog.Debug("Perform blocks_by_range request", tele.LogAttrPeerID(pid)) + stream, err := r.host.NewStream(ctx, pid, r.protocolID(p2p.RPCBlocksByRangeTopicV2)) + if err != nil { + return blocks, fmt.Errorf("new %s stream to peer %s: %w", p2p.RPCMetaDataTopicV2, pid, err) + } + defer stream.Close() + defer logDeferErr(stream.Reset, "failed closing stream") // no-op if closed + + req := &pb.BeaconBlocksByRangeRequest{ + StartSlot: primitives.Slot(firstSlot), + Count: (lastSlot - firstSlot), + Step: 1, + } + if err := r.writeRequest(ctx, stream, req); err != nil { + return blocks, fmt.Errorf("write block_by_range request: %w", err) + } + + // read and decode status response + process := func(blk interfaces.ReadOnlySignedBeaconBlock) error { + blocks = append(blocks, blk) + slog.Info( + "got signed_beacon_block", + slog.Attr{Key: "block_number", Value: slog.AnyValue(blk.Block().Slot())}, + slog.Attr{Key: "from", Value: slog.AnyValue(pid.String())}, + ) + return nil + } + + for i := uint64(0); ; i++ { + isFirstChunk := i == 0 + blk, err := r.readChunkedBlock(stream, &encoder.SszNetworkEncoder{}, isFirstChunk) + if errors.Is(err, io.EOF) { + break + } + if err != nil { + return nil, fmt.Errorf("reading block_by_range request: %w", err) + } + if err := process(blk); err != nil { + return nil, fmt.Errorf("processing block_by_range chunk: %w", err) + } + } + + return blocks, nil +} + // readRequest reads a request from the given network stream and populates the // data parameter with the decoded request. It also sets a read deadline on the // stream and returns an error if it fails to do so. After reading the request, @@ -861,3 +950,126 @@ func (r *ReqResp) writeResponse(ctx context.Context, stream network.Stream, data return nil } + +// ReadChunkedBlock handles each response chunk that is sent by the +// peer and converts it into a beacon block. +// Adaptation from Prysm's -> https://github.com/prysmaticlabs/prysm/blob/2e29164582c3665cdf5a472cd4ec9838655c9754/beacon-chain/sync/rpc_chunked_response.go#L85 +func (r *ReqResp) readChunkedBlock(stream core.Stream, encoding encoder.NetworkEncoding, isFirstChunk bool) (interfaces.ReadOnlySignedBeaconBlock, error) { + // Handle deadlines differently for first chunk + if isFirstChunk { + return r.readFirstChunkedBlock(stream, encoding) + } + return r.readResponseChunk(stream, encoding) +} + +// readFirstChunkedBlock reads the first chunked block and applies the appropriate deadlines to it. +func (r *ReqResp) readFirstChunkedBlock(stream core.Stream, encoding encoder.NetworkEncoding) (interfaces.ReadOnlySignedBeaconBlock, error) { + // read status + code, errMsg, err := psync.ReadStatusCode(stream, encoding) + if err != nil { + return nil, err + } + if code != 0 { + return nil, fmt.Errorf(errMsg) + } + // set deadline for reading from stream + if err = stream.SetWriteDeadline(time.Now().Add(r.cfg.WriteTimeout)); err != nil { + return nil, fmt.Errorf("failed setting write deadline on stream: %w", err) + } + // get fork version and block type + forkD, err := r.readForkDigestFromStream(stream) + if err != nil { + return nil, err + } + forkV, err := GetForkVersionFromForkDigest(forkD) + if err != nil { + return nil, err + } + return r.getBlockForForkVersion(forkV, encoding, stream) +} + +// readResponseChunk reads the response from the stream and decodes it into the +// provided message type. +func (r *ReqResp) readResponseChunk(stream core.Stream, encoding encoder.NetworkEncoding) (interfaces.ReadOnlySignedBeaconBlock, error) { + if err := stream.SetWriteDeadline(time.Now().Add(r.cfg.WriteTimeout)); err != nil { + return nil, fmt.Errorf("failed setting write deadline on stream: %w", err) + } + code, errMsg, err := psync.ReadStatusCode(stream, encoding) + if err != nil { + return nil, err + } + if code != 0 { + return nil, fmt.Errorf(errMsg) + } + // No-op for now with the rpc context. + forkD, err := r.readForkDigestFromStream(stream) + if err != nil { + return nil, err + } + forkV, err := GetForkVersionFromForkDigest(forkD) + if err != nil { + return nil, err + } + + return r.getBlockForForkVersion(forkV, encoding, stream) +} + +// readForkDigestFromStream reads any attached context-bytes to the payload. +func (r *ReqResp) readForkDigestFromStream(stream network.Stream) (forkD [4]byte, err error) { + // Read context (fork-digest) from stream (assumes it has it) + b := make([]byte, 4) + if _, err = stream.Read(b); err != nil { + return ForkVersion{}, err + } + copy(forkD[:], b) + return forkD, nil +} + +// getBlockForForkVersion returns an ReadOnlySignedBeaconBlock interface from the block type of each ForkVersion +func (r *ReqResp) getBlockForForkVersion(forkV ForkVersion, encoding encoder.NetworkEncoding, stream network.Stream) (sblk interfaces.ReadOnlySignedBeaconBlock, err error) { + switch forkV { + case Phase0ForkVersion: + blk := &pb.SignedBeaconBlock{} + err = encoding.DecodeWithMaxLength(stream, blk) + if err != nil { + return sblk, err + } + return blocks.NewSignedBeaconBlock(blk) + + case AltairForkVersion: + blk := &pb.SignedBeaconBlockAltair{} + err = encoding.DecodeWithMaxLength(stream, blk) + if err != nil { + return sblk, err + } + return blocks.NewSignedBeaconBlock(blk) + + case BellatrixForkVersion: + blk := &pb.SignedBeaconBlockBellatrix{} + err = encoding.DecodeWithMaxLength(stream, blk) + if err != nil { + return sblk, err + } + return blocks.NewSignedBeaconBlock(blk) + + case CapellaForkVersion: + blk := &pb.SignedBeaconBlockCapella{} + err = encoding.DecodeWithMaxLength(stream, blk) + if err != nil { + return sblk, err + } + return blocks.NewSignedBeaconBlock(blk) + + case DenebForkVersion: + blk := &pb.SignedBeaconBlockDeneb{} + err = encoding.DecodeWithMaxLength(stream, blk) + if err != nil { + return sblk, err + } + return blocks.NewSignedBeaconBlock(blk) + + default: + sblk, _ := blocks.NewSignedBeaconBlock(&pb.SignedBeaconBlock{}) + return sblk, fmt.Errorf("unrecognized fork_version (received:%s) (ours: %s) (global: %s)", forkV, r.cfg.ForkDigest, DenebForkVersion) + } +} diff --git a/go.mod b/go.mod index d29364e..f7fc11d 100644 --- a/go.mod +++ b/go.mod @@ -124,6 +124,7 @@ require ( github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/miekg/dns v1.1.62 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect @@ -171,6 +172,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect + github.com/prometheus/prom2json v1.3.0 // indirect github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 // indirect github.com/prysmaticlabs/gohashtree v0.0.4-beta // indirect github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c // indirect @@ -186,12 +188,15 @@ require ( github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.10.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect + github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 // indirect github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect + github.com/wealdtech/go-bytesutil v1.1.1 // indirect github.com/wlynxg/anet v0.0.4 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect diff --git a/go.sum b/go.sum index f72207b..7f76791 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,7 @@ cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgo cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -17,6 +18,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -37,6 +39,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= contrib.go.opencensus.io/exporter/jaeger v0.2.1 h1:yGBYzYMewVL0yO9qqJv3Z5+IRhPdU7e9o/2oKpX4YvI= contrib.go.opencensus.io/exporter/jaeger v0.2.1/go.mod h1:Y8IsLgdxqh1QxYxPC5IgXVmBaeLUeQFfBeBi9PbeZd0= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= @@ -402,6 +405,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= @@ -419,6 +423,7 @@ github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE0 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -525,9 +530,11 @@ github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -597,6 +604,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -782,6 +791,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -822,6 +832,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= +github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo= github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= @@ -954,6 +966,8 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0= +github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279/go.mod h1:GA3+Mq3kt3tYAfM0WZCu7ofy+GW9PuGysHfhr+6JX7s= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= @@ -967,6 +981,8 @@ github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/wealdtech/go-bytesutil v1.1.1 h1:ocEg3Ke2GkZ4vQw5lp46rmO+pfqCCTgq35gqOy8JKVc= +github.com/wealdtech/go-bytesutil v1.1.1/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/wlynxg/anet v0.0.4 h1:0de1OFQxnNqAu+x2FAKKCVIrnfGKQbs7FQz++tB0+Uw= github.com/wlynxg/anet v0.0.4/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= @@ -1062,7 +1078,9 @@ golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= @@ -1153,10 +1171,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= @@ -1261,12 +1281,15 @@ golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1300,6 +1323,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= @@ -1371,6 +1395,7 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -1457,7 +1482,9 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= From 674410ada88e43391f3184909709449d9726a92b Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Thu, 3 Oct 2024 12:51:17 +0200 Subject: [PATCH 4/6] fix: typo --- eth/genesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/genesis.go b/eth/genesis.go index 0beb70f..80fe581 100644 --- a/eth/genesis.go +++ b/eth/genesis.go @@ -25,7 +25,7 @@ var ( CapellaForkVersion ForkVersion DenebForkVersion ForkVersion - globalBeaconConfig = params.MainnetConfig() // init with Mainnet (we would override if needed)z + globalBeaconConfig = params.MainnetConfig() // init with Mainnet (we would override if needed) ) // configure global ForkVersion variables From bf5f2d641f3378701847bfe72af425eb94e507ed Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Thu, 3 Oct 2024 16:29:19 +0200 Subject: [PATCH 5/6] Add tests for req_resp --- eth/reqresp_test.go | 113 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 eth/reqresp_test.go diff --git a/eth/reqresp_test.go b/eth/reqresp_test.go new file mode 100644 index 0000000..7611fde --- /dev/null +++ b/eth/reqresp_test.go @@ -0,0 +1,113 @@ +package eth + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/probe-lab/hermes/host" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" + "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" +) + +var prysmConnectionGraceTime = 2 * time.Second + +func TestReqResp_ProtocolRequests(t *testing.T) { + // NOTE: be aware that the logs can generate noisy + + // Generate an Ethereum Node to communicate with the local Prysm node + ctx, mainCancel := context.WithCancel(context.Background()) + defer mainCancel() + ethNode, cancel := composeLocalEthNode(t, ctx) + defer cancel() + + // give enough time to connect to prysm node + time.Sleep(prysmConnectionGraceTime) + + // try all the request as the node is initialized + requestPing(t, ctx, ethNode) + requestStatus(t, ctx, ethNode) + requestMetaDataV2(t, ctx, ethNode) + requestBlockByRangeV2(t, ctx, ethNode) +} + +func requestPing(t *testing.T, ctx context.Context, ethNode *Node) { + err := ethNode.reqResp.Ping(ctx, ethNode.pryInfo.ID) + require.NoError(t, err) +} + +func requestStatus(t *testing.T, ctx context.Context, ethNode *Node) { + _, err := ethNode.reqResp.Status(ctx, ethNode.pryInfo.ID) + require.NoError(t, err) +} + +func requestMetaDataV2(t *testing.T, ctx context.Context, ethNode *Node) { + _, err := ethNode.reqResp.MetaData(ctx, ethNode.pryInfo.ID) + require.NoError(t, err) +} + +func requestBlockByRangeV2(t *testing.T, ctx context.Context, ethNode *Node) { + chainHead, err := ethNode.pryClient.ChainHead(ctx) + require.NoError(t, err) + + _, err = ethNode.reqResp.BlocksByRangeV2(ctx, ethNode.pryInfo.ID, uint64(chainHead.HeadSlot-5), uint64(chainHead.HeadSlot)) + require.NoError(t, err) +} + +func composeLocalEthNode(t *testing.T, ctx context.Context) (*Node, context.CancelFunc) { + config, err := DeriveKnownNetworkConfig(ctx, "mainnet") + require.NoError(t, err) + initNetworkForkVersions(config.Beacon) + + genesisConfig := GenesisConfigs["mainnet"] + forkV := DenebForkVersion + forkD, err := signing.ComputeForkDigest(DenebForkVersion[:], genesisConfig.GenesisValidatorRoot) + require.NoError(t, err) + + nodeCfg := &NodeConfig{ + GenesisConfig: config.Genesis, + NetworkConfig: config.Network, + BeaconConfig: config.Beacon, + + ForkDigest: forkD, + ForkVersion: forkV, + + DialTimeout: 10 * time.Second, + Devp2pHost: "127.0.0.0", + Devp2pPort: 9021, + Libp2pHost: "127.0.0.1", + Libp2pPort: 9020, + GossipSubMessageEncoder: encoder.SszNetworkEncoder{}, + RPCEncoder: encoder.SszNetworkEncoder{}, + + LocalTrustedAddr: true, + PrysmHost: "127.0.0.1", + PrysmPortHTTP: 3500, + PrysmPortGRPC: 4000, + + DataStreamType: host.DataStreamTypeLogger, + MaxPeers: 100, + DialConcurrency: 10, + + PubSubSubscriptionRequestLimit: 200, + PubSubQueueSize: 600, + Libp2pPeerscoreSnapshotFreq: 10 * time.Second, + Tracer: otel.GetTracerProvider().Tracer("hermes"), + Meter: otel.GetMeterProvider().Meter("hermes"), + } + ethNode, err := NewNode(nodeCfg) + require.NoError(t, err) + + nodeCtx, cancel := context.WithCancel(ctx) + go func() { + defer func() { + fmt.Println("closing test eth_node") + }() + err := ethNode.Start(nodeCtx) + require.NoError(t, err) + }() + return ethNode, cancel +} From 6da80a57e86b734e93bdb967e9572c0331b1afae Mon Sep 17 00:00:00 2001 From: Mikel Cortes Date: Thu, 3 Oct 2024 16:44:38 +0200 Subject: [PATCH 6/6] skip local test for ReqResp as it requires a local Prysm --- eth/reqresp_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eth/reqresp_test.go b/eth/reqresp_test.go index 7611fde..93f6dc1 100644 --- a/eth/reqresp_test.go +++ b/eth/reqresp_test.go @@ -17,6 +17,8 @@ var prysmConnectionGraceTime = 2 * time.Second func TestReqResp_ProtocolRequests(t *testing.T) { // NOTE: be aware that the logs can generate noisy + // ONLY run with a local trusted Prysm on "127.0.0.1:3500 / 4000" + t.Skip() // Generate an Ethereum Node to communicate with the local Prysm node ctx, mainCancel := context.WithCancel(context.Background())