diff --git a/cl/beacon/handler/pool.go b/cl/beacon/handler/pool.go index 3bc66779600..7cec7f1edca 100644 --- a/cl/beacon/handler/pool.go +++ b/cl/beacon/handler/pool.go @@ -16,7 +16,7 @@ import ( ) func (a *ApiHandler) GetEthV1BeaconPoolVoluntaryExits(w http.ResponseWriter, r *http.Request) (*beaconhttp.BeaconResponse, error) { - return newBeaconResponse(a.operationsPool.VoluntaryExistsPool.Raw()), nil + return newBeaconResponse(a.operationsPool.VoluntaryExitPool.Raw()), nil } func (a *ApiHandler) GetEthV1BeaconPoolAttesterSlashings(w http.ResponseWriter, r *http.Request) (*beaconhttp.BeaconResponse, error) { @@ -143,7 +143,7 @@ func (a *ApiHandler) PostEthV1BeaconPoolVoluntaryExits(w http.ResponseWriter, r http.Error(w, err.Error(), http.StatusInternalServerError) return } - a.operationsPool.VoluntaryExistsPool.Insert(req.VoluntaryExit.ValidatorIndex, &req) + a.operationsPool.VoluntaryExitPool.Insert(req.VoluntaryExit.ValidatorIndex, &req) } // Only write 200 w.WriteHeader(http.StatusOK) diff --git a/cl/beacon/handler/utils_test.go b/cl/beacon/handler/utils_test.go index 64c6684c629..94d22f1edb6 100644 --- a/cl/beacon/handler/utils_test.go +++ b/cl/beacon/handler/utils_test.go @@ -104,7 +104,7 @@ func setupTestingHandler(t *testing.T, v clparams.StateVersion, logger log.Logge return nil }).AnyTimes() voluntaryExitService.EXPECT().ProcessMessage(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, subnetID *uint64, msg *cltypes.SignedVoluntaryExit) error { - opPool.VoluntaryExistsPool.Insert(msg.VoluntaryExit.ValidatorIndex, msg) + opPool.VoluntaryExitPool.Insert(msg.VoluntaryExit.ValidatorIndex, msg) return nil }).AnyTimes() blsToExecutionChangeService.EXPECT().ProcessMessage(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, subnetID *uint64, msg *cltypes.SignedBLSToExecutionChange) error { diff --git a/cl/phase1/forkchoice/fork_choice_test.go b/cl/phase1/forkchoice/fork_choice_test.go index e89cd423f5d..5dbd3172518 100644 --- a/cl/phase1/forkchoice/fork_choice_test.go +++ b/cl/phase1/forkchoice/fork_choice_test.go @@ -108,7 +108,7 @@ func TestForkChoiceBasic(t *testing.T) { time.Sleep(time.Millisecond) } require.NoError(t, err) - require.Equal(t, len(pool.VoluntaryExistsPool.Raw()), 1) + require.Equal(t, len(pool.VoluntaryExitPool.Raw()), 1) } func TestForkChoiceChainBellatrix(t *testing.T) { diff --git a/cl/phase1/forkchoice/forkchoice_mock.go b/cl/phase1/forkchoice/forkchoice_mock.go index a06bf62bb19..3065a8bf3ae 100644 --- a/cl/phase1/forkchoice/forkchoice_mock.go +++ b/cl/phase1/forkchoice/forkchoice_mock.go @@ -178,7 +178,7 @@ func (f *ForkChoiceStorageMock) Partecipation(epoch uint64) (*solid.BitList, boo } func (f *ForkChoiceStorageMock) OnVoluntaryExit(signedVoluntaryExit *cltypes.SignedVoluntaryExit, test bool) error { - f.Pool.VoluntaryExistsPool.Insert(signedVoluntaryExit.VoluntaryExit.ValidatorIndex, signedVoluntaryExit) + f.Pool.VoluntaryExitPool.Insert(signedVoluntaryExit.VoluntaryExit.ValidatorIndex, signedVoluntaryExit) return nil } diff --git a/cl/phase1/network/services/voluntary_exit_service.go b/cl/phase1/network/services/voluntary_exit_service.go index aad10f33e63..aea1de9995b 100644 --- a/cl/phase1/network/services/voluntary_exit_service.go +++ b/cl/phase1/network/services/voluntary_exit_service.go @@ -44,7 +44,7 @@ func (s *voluntaryExitService) ProcessMessage(ctx context.Context, subnet *uint6 // ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#voluntary_exit voluntaryExit := msg.VoluntaryExit defer s.emitters.Publish("voluntary_exit", voluntaryExit) - if s.operationsPool.VoluntaryExistsPool.Has(voluntaryExit.ValidatorIndex) { + if s.operationsPool.VoluntaryExitPool.Has(voluntaryExit.ValidatorIndex) { return ErrIgnore } @@ -117,7 +117,7 @@ func (s *voluntaryExitService) ProcessMessage(ctx context.Context, subnet *uint6 return errors.New("ProcessVoluntaryExit: BLS verification failed") } - s.operationsPool.VoluntaryExistsPool.Insert(voluntaryExit.ValidatorIndex, msg) + s.operationsPool.VoluntaryExitPool.Insert(voluntaryExit.ValidatorIndex, msg) // Initiate exit // initiate_validator_exit(state, voluntary_exit.validator_index) diff --git a/cl/pool/operations_pool.go b/cl/pool/operations_pool.go index 92613eb2f1c..49b427fb2d8 100644 --- a/cl/pool/operations_pool.go +++ b/cl/pool/operations_pool.go @@ -30,7 +30,7 @@ type OperationsPool struct { ProposerSlashingsPool *OperationPool[libcommon.Bytes96, *cltypes.ProposerSlashing] BLSToExecutionChangesPool *OperationPool[libcommon.Bytes96, *cltypes.SignedBLSToExecutionChange] SignedContributionAndProofPool *OperationPool[libcommon.Bytes96, *cltypes.SignedContributionAndProof] - VoluntaryExistsPool *OperationPool[uint64, *cltypes.SignedVoluntaryExit] + VoluntaryExitPool *OperationPool[uint64, *cltypes.SignedVoluntaryExit] ContributionCache *OperationPool[cltypes.ContributionKey, [][]byte] } @@ -41,14 +41,14 @@ func NewOperationsPool(beaconCfg *clparams.BeaconChainConfig) OperationsPool { ProposerSlashingsPool: NewOperationPool[libcommon.Bytes96, *cltypes.ProposerSlashing](int(beaconCfg.MaxAttestations), "proposerSlashingsPool"), BLSToExecutionChangesPool: NewOperationPool[libcommon.Bytes96, *cltypes.SignedBLSToExecutionChange](int(beaconCfg.MaxBlsToExecutionChanges), "blsExecutionChangesPool"), SignedContributionAndProofPool: NewOperationPool[libcommon.Bytes96, *cltypes.SignedContributionAndProof](int(beaconCfg.MaxAttestations), "signedContributionAndProof"), - VoluntaryExistsPool: NewOperationPool[uint64, *cltypes.SignedVoluntaryExit](int(beaconCfg.MaxBlsToExecutionChanges), "voluntaryExitsPool"), + VoluntaryExitPool: NewOperationPool[uint64, *cltypes.SignedVoluntaryExit](int(beaconCfg.MaxBlsToExecutionChanges), "voluntaryExitsPool"), ContributionCache: NewOperationPool[cltypes.ContributionKey, [][]byte](int(beaconCfg.MaxAttestations), "contributionCache"), } } func (o *OperationsPool) NotifyBlock(blk *cltypes.BeaconBlock) { blk.Body.VoluntaryExits.Range(func(_ int, exit *cltypes.SignedVoluntaryExit, _ int) bool { - o.VoluntaryExistsPool.DeleteIfExist(exit.VoluntaryExit.ValidatorIndex) + o.VoluntaryExitPool.DeleteIfExist(exit.VoluntaryExit.ValidatorIndex) return true }) blk.Body.AttesterSlashings.Range(func(_ int, att *cltypes.AttesterSlashing, _ int) bool {