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

core: proto implementation for builder proposer #837

Merged

Conversation

ciaranmcveigh5
Copy link
Contributor

  • proto implementation for builder proposer
  • relevant tests

category: feature
ticket: #809

@@ -54,6 +54,12 @@ func ParSignedDataFromProto(typ DutyType, data *pbv1.ParSignedData) (ParSignedDa
return ParSignedData{}, errors.Wrap(err, "unmarshal block")
}
signedData = b
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i looked for this ParSignedDataFromProto function in the repo and this is it's only declaration so not sure if this needs to be implemented here

Copy link
Contributor

Choose a reason for hiding this comment

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

ParSignedDataFromProto is only called from ParSignedData<Set>FromProto which is called from parsigex to unmarshal protos received over the wire. But yeah, adding it here is correct.

@@ -110,6 +124,22 @@ func TestSetBlockSig(t *testing.T) {
require.NotEqual(t, clone.Signature(), block.Signature())
}

func TestSetBlindedBlockSig(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

may be wrong but this isn't testing anything in the proto.go file as far as i can see

should it be included? it's copied from the TestSetBlockSig which is also in this file

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, these tests should move to signeddata_test.go since it tests whether SignedData implementation is immutable and that SetSignature returns a new instance. This can also easily be converted into a table test that tests each implementation. Maybe add a //TODO(ciaran): extract common SigSignature table test for all implementations

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #837 (65fd1b5) into main (7ea6566) will increase coverage by 0.36%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main     #837      +/-   ##
==========================================
+ Coverage   54.84%   55.20%   +0.36%     
==========================================
  Files         111      111              
  Lines       11509    11515       +6     
==========================================
+ Hits         6312     6357      +45     
+ Misses       4283     4236      -47     
- Partials      914      922       +8     
Impacted Files Coverage Δ
core/proto.go 68.31% <50.00%> (-1.16%) ⬇️
core/dutydb/memory.go 70.63% <0.00%> (-1.28%) ⬇️
core/unsigneddata.go 41.24% <0.00%> (+1.69%) ⬆️
core/signeddata.go 41.25% <0.00%> (+11.55%) ⬆️
dkg/transport.go 66.66% <0.00%> (+12.96%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ea6566...65fd1b5. Read the comment docs.

@@ -110,6 +124,22 @@ func TestSetBlockSig(t *testing.T) {
require.NotEqual(t, clone.Signature(), block.Signature())
}

func TestSetBlindedBlockSig(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, these tests should move to signeddata_test.go since it tests whether SignedData implementation is immutable and that SetSignature returns a new instance. This can also easily be converted into a table test that tests each implementation. Maybe add a //TODO(ciaran): extract common SigSignature table test for all implementations

Comment on lines 72 to 77
VersionedSignedBlindedBeaconBlock: eth2api.VersionedSignedBlindedBeaconBlock{
Version: spec.DataVersionBellatrix,
Bellatrix: &eth2v1.SignedBlindedBeaconBlock{
Message: testutil.RandomBellatrixBlindedBeaconBlock(t),
Signature: testutil.RandomEth2Signature(),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

can extract this to testutil.RandomCoreVersionSignedBlindedBeaconBlock is you want to decrease creating these from scratch every time.

@@ -54,6 +54,12 @@ func ParSignedDataFromProto(typ DutyType, data *pbv1.ParSignedData) (ParSignedDa
return ParSignedData{}, errors.Wrap(err, "unmarshal block")
}
signedData = b
Copy link
Contributor

Choose a reason for hiding this comment

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

ParSignedDataFromProto is only called from ParSignedData<Set>FromProto which is called from parsigex to unmarshal protos received over the wire. But yeah, adding it here is correct.

@ciaranmcveigh5 ciaranmcveigh5 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jul 22, 2022
@obol-bulldozer obol-bulldozer bot merged commit e668bc6 into ObolNetwork:main Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants