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

Align Attestation Fields in State/Block With Spec #1072

Closed
wants to merge 7 commits into from

Conversation

rauljordan
Copy link
Contributor

Part of #781


Description

This PR replaces the deprecated proto field for repeated AggregatedAttestation pending_attestations in the BeaconState by a repeated PendingAttestationRecord latest_attestations and changes all instances in the core/ package for tests to pass and the system to build correctly.

Additionally, we deprecate a beacon blocks' repeated AggregatedAttestation and replace them by repeated Attestation attestations within the block body appropriately. After this PR, it will be possible to easily deprecate all other instances of AggregatedAttestation across the repo correctly.

@rauljordan rauljordan self-assigned this Dec 11, 2018
@rauljordan rauljordan added this to the Ruby - v0.1 milestone Dec 11, 2018
// TODO(#781): Pending refactor from the spec.
_ = slot
_ = crossLinkRecords
// for _, attestation := range pendingAttestations {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not entirely sure what to do here other than commenting out the bulk of this function, as it will break and the inner logic will be inherently different due to spec changes. Ideas @terenc3t @prestonvanloon?

@@ -78,9 +78,9 @@ func GetShardAndCommitteesForSlot(shardCommittees []*pb.ShardAndCommitteeArray,

// AreAttesterBitfieldsValid validates that the length of the attester bitfield matches the attester indices
// defined in the Crystallized State.
func AreAttesterBitfieldsValid(attestation *pb.AggregatedAttestation, attesterIndices []uint32) bool {
func AreAttesterBitfieldsValid(participationBitfield []byte, attesterIndices []uint32) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's best to pass the actual item a function needs rather than a full struct when it only accesses one or two pieces of a struct, so changed it appropriately

@rauljordan
Copy link
Contributor Author

Closing this as we will be using the generated protos as our canonical type definitions

@rauljordan rauljordan closed this Dec 17, 2018
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.

1 participant