-
Notifications
You must be signed in to change notification settings - Fork 78
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
Conversation
return validatorRegistration; | ||
} | ||
} | ||
public record Eth2SigningRequestBody( |
There was a problem hiding this comment.
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
.../src/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/KZGProof.java
Show resolved
Hide resolved
final BlobSidecar tekuBlobSidecar = new DataStructureUtil(spec).randomBlobSidecar(); | ||
signingRoot = | ||
new SigningRootUtil(spec).signingRootForBlobSidecar(tekuBlobSidecar, tekuForkInfo); | ||
blindedBlobSidecar = fromInternalBlobSidecar(tekuBlobSidecar); |
There was a problem hiding this comment.
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?
There was a problem hiding this 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
There was a problem hiding this comment.
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
.../src/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/KZGProof.java
Outdated
Show resolved
Hide resolved
...ch/pegasys/web3signer/core/service/http/handlers/signing/eth2/json/KZGProofDeserializer.java
Outdated
Show resolved
Hide resolved
...tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/json/KZGProofSerializer.java
Outdated
Show resolved
Hide resolved
.../test/java/tech/pegasys/web3signer/tests/signing/BlsBlindedBlobcarSigningAcceptanceTest.java
Outdated
Show resolved
Hide resolved
...nce-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2SigningRequestBodyBuilder.java
Outdated
Show resolved
Hide resolved
.../tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/Eth2SigningRequestBody.java
Outdated
Show resolved
Hide resolved
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show resolved
Hide resolved
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this 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?
...nce-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/Eth2SigningRequestBodyBuilder.java
Show resolved
Hide resolved
.../test/java/tech/pegasys/web3signer/tests/signing/BlsBlindedBlobcarSigningAcceptanceTest.java
Outdated
Show resolved
Hide resolved
.../test/java/tech/pegasys/web3signer/tests/signing/BlsBlindedBlobcarSigningAcceptanceTest.java
Outdated
Show resolved
Hide resolved
...c/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/BlobSidecar.java
Fixed
Show resolved
Hide resolved
public tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlindedBlobSidecar | ||
asInternalBlindedBlobSidecar(final SpecVersion spec) { | ||
final BlindedBlobSidecarSchema blindedBlobSidecarSchema = |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Correct, Teku's classes are used to calculate signing root, hence we need them. |
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); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"
gradle/versions.gradle
Outdated
@@ -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' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
PR Description
Implement signing of BlindedBlobSidecar and BlobSidecar requests.
Fixed Issue(s)
Fixes #883
Documentation
doc-change-required
label to this PR if updates are required.Changelog
Testing