Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcoded Genesis validator root #14404

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- `grpc-gateway-port` is renamed to http-port. The old name can still be used as an alias.
- `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias.
- `api-timeout` is changed from int flag to duration flag, default value updated.
- Replaced st.GenesisValidatorsRoot() function in p2p and rpc packages with hardcoded value of Genesis validator root

### Deprecated
- `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal.
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/p2p/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (s *Service) awaitStateInitialized() {
log.WithError(err).Fatal("failed to receive initial genesis data")
}
s.genesisTime = clock.GenesisTime()
gvr := clock.GenesisValidatorsRoot()
gvr := params.BeaconConfig().GenesisValidatorsRoot
s.genesisValidatorsRoot = gvr[:]
_, err = s.currentForkDigest() // initialize fork digest cache
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions beacon-chain/rpc/prysm/v1alpha1/node/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/execution"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/sync"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/io/logs"
"github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
Expand Down Expand Up @@ -101,11 +102,11 @@ func (ns *Server) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesi
gt = timestamppb.New(genesisTime)
}

genValRoot := ns.GenesisFetcher.GenesisValidatorsRoot()
genValRoot := params.BeaconConfig().GenesisValidatorsRoot[:]
return &ethpb.Genesis{
GenesisTime: gt,
DepositContractAddress: contractAddr,
GenesisValidatorsRoot: genValRoot[:],
GenesisValidatorsRoot: genValRoot,
}, nil
}

Expand Down
5 changes: 2 additions & 3 deletions beacon-chain/rpc/prysm/v1alpha1/validator/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (vs *Server) WaitForChainStart(_ *emptypb.Empty, stream ethpb.BeaconNodeVal
res := &ethpb.ChainStartResponse{
Started: true,
GenesisTime: head.GenesisTime(),
GenesisValidatorsRoot: head.GenesisValidatorsRoot(),
GenesisValidatorsRoot: params.BeaconConfig().GenesisValidatorsRoot[:],
}
return stream.Send(res)
}
Expand All @@ -199,11 +199,10 @@ func (vs *Server) WaitForChainStart(_ *emptypb.Empty, stream ethpb.BeaconNodeVal
}
log.WithField("startTime", clock.GenesisTime()).Debug("Received chain started event")
log.Debug("Sending genesis time notification to connected validator clients")
gvr := clock.GenesisValidatorsRoot()
res := &ethpb.ChainStartResponse{
Started: true,
GenesisTime: uint64(clock.GenesisTime().Unix()),
GenesisValidatorsRoot: gvr[:],
GenesisValidatorsRoot: params.BeaconConfig().GenesisValidatorsRoot[:],
}
return stream.Send(res)
}
Expand Down
Loading