-
Notifications
You must be signed in to change notification settings - Fork 27
Sig agg precursor #231
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
Merged
Merged
Sig agg precursor #231
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5a0135e
fix: update containers for signature aggregation
anshalshukla 24363ed
fix: adjust validator signing, container update changes
anshalshukla f20d8e1
Merge branch 'main' into sig-agg
anshalshukla 7b0b3a6
fix: failing tests
anshalshukla 3b02587
feat: aggregate attestations
anshalshukla bc35513
update: change AggregatedAttestations to AggregatedAttestation
anshalshukla 2ea8946
refactor: variable naming
anshalshukla e8225fd
feat: aggregate signature as list of naive signatures
anshalshukla a9bd016
fix: make it more pythonic
anshalshukla 3338bbb
fix: address comments
anshalshukla 7e78094
rename: NaiveAggregatedSignatures to NaiveAggregatedSignature
anshalshukla ce7d152
refactor: move NaiveAggregatedSignature to attestation types
anshalshukla 9e05a53
fixes: nit comments
anshalshukla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,13 +13,17 @@ | |||||
| AttestationData, | ||||||
| SignedAttestation, | ||||||
| ) | ||||||
| from lean_spec.subspecs.containers.block.block import ( | ||||||
| from lean_spec.subspecs.containers.block import ( | ||||||
| Block, | ||||||
| BlockBody, | ||||||
| BlockSignatures, | ||||||
| BlockWithAttestation, | ||||||
| SignedBlockWithAttestation, | ||||||
| ) | ||||||
| from lean_spec.subspecs.containers.block.types import Attestations, BlockSignatures | ||||||
| from lean_spec.subspecs.containers.block.types import ( | ||||||
| AggregatedAttestations, | ||||||
| NaiveAggregatedSignature, | ||||||
| ) | ||||||
| from lean_spec.subspecs.containers.checkpoint import Checkpoint | ||||||
| from lean_spec.subspecs.containers.slot import Slot | ||||||
| from lean_spec.subspecs.containers.state import Validators | ||||||
|
|
@@ -133,7 +137,7 @@ def set_anchor_block_default(self) -> ForkChoiceTest: | |||||
| proposer_index=self.anchor_state.latest_block_header.proposer_index, | ||||||
| parent_root=self.anchor_state.latest_block_header.parent_root, | ||||||
| state_root=hash_tree_root(self.anchor_state), | ||||||
| body=BlockBody(attestations=Attestations(data=[])), | ||||||
| body=BlockBody(attestations=AggregatedAttestations(data=[])), | ||||||
| ) | ||||||
| return self | ||||||
|
|
||||||
|
|
@@ -153,7 +157,7 @@ def set_max_slot_default(self) -> ForkChoiceTest: | |||||
| if isinstance(step, BlockStep): | ||||||
| max_slot_value = max(max_slot_value, int(step.block.slot)) | ||||||
| elif isinstance(step, AttestationStep): | ||||||
| max_slot_value = max(max_slot_value, int(step.attestation.message.data.slot)) | ||||||
| max_slot_value = max(max_slot_value, int(step.attestation.message.slot)) | ||||||
|
|
||||||
| self.max_slot = Slot(max_slot_value) | ||||||
|
|
||||||
|
|
@@ -344,15 +348,23 @@ def _build_block_from_spec( | |||||
| ) | ||||||
|
|
||||||
| # Sign all attestations and the proposer attestation | ||||||
| signature_list = [key_manager.sign_attestation(att) for att in attestations] | ||||||
| signature_list.append(key_manager.sign_attestation(proposer_attestation)) | ||||||
| attestation_signatures = [ | ||||||
|
||||||
| key_manager.sign_attestation_data(att.validator_id, att.data) for att in attestations | ||||||
| ] | ||||||
| proposer_signature = key_manager.sign_attestation_data( | ||||||
| proposer_attestation.validator_id, | ||||||
| proposer_attestation.data, | ||||||
| ) | ||||||
|
|
||||||
| return SignedBlockWithAttestation( | ||||||
| message=BlockWithAttestation( | ||||||
| block=final_block, | ||||||
| proposer_attestation=proposer_attestation, | ||||||
| ), | ||||||
| signature=BlockSignatures(data=signature_list), | ||||||
| signature=BlockSignatures( | ||||||
| attestation_signatures=NaiveAggregatedSignature(data=attestation_signatures), | ||||||
|
||||||
| attestation_signatures=NaiveAggregatedSignature(data=attestation_signatures), | |
| attestation_signatures=NaiveAggregatedSignature(data=attestation_signatures), |
this is a list of NaiveAggregatedSignature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.