prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com/
GNU General Public License v3.0
3.41k stars 962 forks source link

Does Prysm have an interface similar to /lighthouse/validator_inclusion? #12381

Open cppfuns opened 1 year ago

cppfuns commented 1 year ago

I'm developing a consensus browser, but the browser uses the following api /lighthouse/validator_inclusion

https://github.com/gobitfly/eth2-beaconchain-explorer/blob/4c05fb9e782c3e5536782d5491b74833317c791a/rpc/lighthouse.go#L855

    resp, err := lc.get(fmt.Sprintf("%s/lighthouse/validator_inclusion/%d/global", lc.endpoint, request_epoch))
    if err != nil {
        return nil, fmt.Errorf("error retrieving validator participation data for epoch %v: %v", epoch, err)
    }

Interface Introduction

https://lighthouse-book.sigmaprime.io/validator-inclusion.html

Is there a similar interface on the Prysm side that can be replaced?

I checked the prysm related code and found that the same data returned by "/lighthouse/validator_inclusion" will be deleted

https://github.com/prysmaticlabs/prysm/blob/ad749a40b696a94cc240d4ddef9b1061d3a39bb3/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go#L549

    cp := bs.FinalizationFetcher.FinalizedCheckpt()
    p := &ethpb.ValidatorParticipationResponse{
        Epoch:     requestedEpoch,
        Finalized: requestedEpoch <= cp.Epoch,
        Participation: &ethpb.ValidatorParticipation{
            // TODO(7130): Remove these three deprecated fields.
            GlobalParticipationRate:          float32(b.PrevEpochTargetAttested) / float32(b.ActivePrevEpoch),
            VotedEther:                       b.PrevEpochTargetAttested,
            EligibleEther:                    b.ActivePrevEpoch,

Why was it removed, because of performance issues? How will prysm plan to obtain it later?

Why the test for this question

We are the technical team from opside.network (A Decentralized ZK-RaaS Network.), we are exploring related technologies

james-prysm commented 4 months ago

sorry a response was not given until now, is this still something that is needed?

cppfuns commented 3 months ago

sorry a response was not given until now, is this still something that is needed?

yes still needed