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

Signing Blinded/BlobSidecar requests #887

Merged
merged 17 commits into from
Aug 31, 2023

Conversation

usmansaleem
Copy link
Contributor

PR Description

Implement signing of BlindedBlobSidecar and BlobSidecar requests.

Fixed Issue(s)

Fixes #883

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Testing

  • I thought about testing these changes in a realistic/non-local environment.

return validatorRegistration;
}
}
public record Eth2SigningRequestBody(
Copy link
Contributor

Choose a reason for hiding this comment

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

That's much nicer to read

final BlobSidecar tekuBlobSidecar = new DataStructureUtil(spec).randomBlobSidecar();
signingRoot =
new SigningRootUtil(spec).signingRootForBlobSidecar(tekuBlobSidecar, tekuForkInfo);
blindedBlobSidecar = fromInternalBlobSidecar(tekuBlobSidecar);
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it building a blinded blob side car in both cases. Is there a difference between the two?

Copy link
Contributor

@gfukushima gfukushima left a comment

Choose a reason for hiding this comment

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

lgtm, few spdx to fix only

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice clean up by using record

Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

Looks pretty straight forward, mostly just questions/renames.

It's a shame w3s needs to know about blinded blocks...is that just because of the Teku class hierarchy dependency?

CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +47 to +49
public tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlindedBlobSidecar
asInternalBlindedBlobSidecar(final SpecVersion spec) {
final BlindedBlobSidecarSchema blindedBlobSidecarSchema =
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be BlobSidecar type instead now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is internal (Teku) class.

@usmansaleem
Copy link
Contributor Author

Looks pretty straight forward, mostly just questions/renames.

It's a shame w3s needs to know about blinded blocks...is that just because of the Teku class hierarchy dependency?

Correct, Teku's classes are used to calculate signing root, hence we need them.

Comment on lines 440 to 454
if (isBlinded) {
// generate random blinded blobsidecar
final BlindedBlobSidecar tekuBlindedBlobSidecar =
new DataStructureUtil(spec).randomBlindedBlobSidecar();
signingRoot =
new SigningRootUtil(spec)
.signingRootForBlindedBlobSidecar(tekuBlindedBlobSidecar, tekuForkInfo);
blobSidecar = fromInternalBlindedBlobSidecar(tekuBlindedBlobSidecar);
} else {
// generate random blobsidecar
final BlobSidecar tekuBlobSidecar = new DataStructureUtil(spec).randomBlobSidecar();
signingRoot =
new SigningRootUtil(spec).signingRootForBlobSidecar(tekuBlobSidecar, tekuForkInfo);
blobSidecar = fromInternalBlobSidecar(tekuBlobSidecar);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Still don't understand why we are testing two cases. They are the same as far as Web3Signer is concerned. Are we gaining anything but having the other test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I was still thinking with regards to Teku side of things ... I'll fix the test case to test only "BlobSidecar"

@@ -134,7 +134,7 @@ dependencyManagement {
dependency 'com.azure:azure-core-http-netty:1.13.5'

dependency 'com.zaxxer:HikariCP:5.0.1'
dependency 'org.postgresql:postgresql:42.5.3'
dependency 'org.postgresql:postgresql:42.6.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this fix an issue? Probably worthy of a changelog entry if that's the case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was originally to fix an issue reported by owasp dependency-check plugin, however, it was later turned out to be false positive i.e. PostgreSQL 12 is affected, not the JDBC driver. I am going to revert this back to 42.5.3. The JDBC driver should be update from a separate PR.

@usmansaleem usmansaleem enabled auto-merge (squash) August 31, 2023 07:38
@usmansaleem usmansaleem merged commit 0bb49c6 into Consensys:master Aug 31, 2023
2 checks passed
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.

Implement Blinded/Blobsidecar signing in Web3Signer
4 participants