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

beacon node: renaming functions and services to better reflect what they do #14643

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Nov 15, 2024

What type of PR is this?

Other

What does this PR do? Why is it needed?

  • Renames some internal functions, logs, and names to better reflect their purpose.
  • eliminates a duplicate field in initialization ( POWBlockFetcher and E1thBlockFetcher do the same thing, now renamed to ExecutionBlockFetcher)

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@james-prysm james-prysm added the UX cosmetic / user experience related label Nov 15, 2024
@@ -240,7 +240,6 @@ func NewService(ctx context.Context, cfg *Config) *Service {
GenesisFetcher: s.cfg.GenesisFetcher,
FinalizationFetcher: s.cfg.FinalizationFetcher,
TimeFetcher: s.cfg.GenesisTimeFetcher,
BlockFetcher: s.cfg.ExecutionChainService,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had 2 registrations of Block Fetcher, one as block fetcher and one as Eth1BlockFetcher

@james-prysm james-prysm marked this pull request as ready for review November 15, 2024 22:16
@james-prysm james-prysm requested a review from a team as a code owner November 15, 2024 22:16
@@ -222,7 +222,7 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.Signed
return s.validateWithBatchVerifier(ctx, "aggregate", set)
}

func (s *Service) validateBlockInAttestation(ctx context.Context, satt ethpb.SignedAggregateAttAndProof) bool {
func (s *Service) validateBlockPresenceOrQueueAttestation(ctx context.Context, satt ethpb.SignedAggregateAttAndProof) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorter name + documentation would be better IMO

Copy link
Contributor Author

@james-prysm james-prysm Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly it feels like there's a deeper issue here why is the save like hacked into this lol the function does 2 things.
couldn't think of a better name, I didn't think validateBlockInAttestation represented what it did

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, should we not separate it into two different functions?

@rkapka
Copy link
Contributor

rkapka commented Nov 18, 2024

I would rename ExecutionChain to Execution because we never refer to anything by the term "execution chain"

Comment on lines +45 to 46
func (s *Service) processPendingAttsByBlkRoot(ctx context.Context) error {
ctx, span := trace.StartSpan(ctx, "processPendingAtts")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we changed the function name, shouldn't we rename the span too?

Suggested change
func (s *Service) processPendingAttsByBlkRoot(ctx context.Context) error {
ctx, span := trace.StartSpan(ctx, "processPendingAtts")
func (s *Service) processPendingAttsByBlkRoot(ctx context.Context) error {
ctx, span := trace.StartSpan(ctx, "processPendingAttsByBlkRoot")

@@ -222,7 +222,7 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.Signed
return s.validateWithBatchVerifier(ctx, "aggregate", set)
}

func (s *Service) validateBlockInAttestation(ctx context.Context, satt ethpb.SignedAggregateAttAndProof) bool {
func (s *Service) validateBlockPresenceOrQueueAttestation(ctx context.Context, satt ethpb.SignedAggregateAttAndProof) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, should we not separate it into two different functions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX cosmetic / user experience related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants