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

Implement Epoch Processing Helpers - Attestations Matching #2379

Merged
merged 12 commits into from
Apr 26, 2019

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Apr 25, 2019

Part of #2307

This PR implements the following epoch processing helpers and tests, the helpers are grouped into one logical processing function for efficiency reason (we don't have to loop through the attestations N^2 times)

  • get_matching_source_attestations
  • get_matching_target_attestations
  • get_matching_head_attestations

Changes:

  • Fixed BlockRootAtSlot and BlockRoot
  • Fixed TargetRoot and HeadRoot to be byte, it was uint64
  • Implemented the 3 helpers above
  • Implemented the tests for the 3 helpers

@codecov
Copy link

codecov bot commented Apr 25, 2019

Codecov Report

Merging #2379 into spec-v0.6 will increase coverage by 0.08%.
The diff coverage is 87.5%.

@@              Coverage Diff              @@
##           spec-v0.6    #2379      +/-   ##
=============================================
+ Coverage      66.45%   66.54%   +0.08%     
=============================================
  Files            121      121              
  Lines           9599     9630      +31     
=============================================
+ Hits            6379     6408      +29     
  Misses          2511     2511              
- Partials         709      711       +2

@terencechain terencechain changed the base branch from master to spec-v0.6 April 25, 2019 17:26
@terencechain terencechain changed the title Update Epoch Processing Helpers Implement Epoch Processing Helpers - Attestations Matching Apr 25, 2019
@terencechain terencechain marked this pull request as ready for review April 25, 2019 17:36
return nil, fmt.Errorf("could not get block root for epoch %d: %v", epoch, err)
}

var tgtAtts []*pb.PendingAttestation
Copy link
Member

Choose a reason for hiding this comment

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

can you set the size of the slices beforehand to reduce memory allocations

@terencechain terencechain merged commit f9dbbb8 into spec-v0.6 Apr 26, 2019
return nil, fmt.Errorf("could not get block root for epoch %d: %v", epoch, err)
}

//var tgtAtts []*pb.PendingAttestation
Copy link
Member

Choose a reason for hiding this comment

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

Remove?

terencechain added a commit that referenced this pull request Apr 28, 2019
@0xKiwi 0xKiwi deleted the epoch-processing-helper-1 branch June 6, 2019 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants