-
Notifications
You must be signed in to change notification settings - Fork 305
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
Post BlockContents #7082
Post BlockContents #7082
Conversation
40226e0
to
8dcacb1
Compare
8dcacb1
to
0fd78d7
Compare
...eaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/PostBlock.java
Outdated
Show resolved
Hide resolved
return AsyncApiResponse.respondWithCode(SC_ACCEPTED); | ||
} | ||
})); | ||
Object requestBody = request.getRequestBody(); |
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.
If im not mistaken request.getRequestBody()
should be able to return you the real object so we might be able to clean this up a lot by checking request.getRequestBody() instanceof SignedBlockContents
and just calling request.getRequestBody
again to pass to the submits... the Object here isn't super pretty, or the casting it causes...
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.
Yes, it returns the real object but we can call request.getRequestBody()
only once, hence the Object
and casting usage
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.
Maybe take a look at #7094 - i think thats probably something more like what we want, where we define the type conversion and how to identify what the string is...
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.
The predicate could probably equally take a parser, we'd just have to parse twice or reset it... anyway, i think that's cleaner and we can reuse it whenever we get something like this...
data/provider/src/main/java/tech/pegasys/teku/api/ValidatorDataProvider.java
Outdated
Show resolved
Hide resolved
...s/src/referenceTest/java/tech/pegasys/teku/reference/altair/fork/TransitionTestExecutor.java
Outdated
Show resolved
Hide resolved
...a/tech/pegasys/teku/spec/datastructures/blocks/versions/deneb/SignedBlockContentsSchema.java
Show resolved
Hide resolved
...gasys/teku/infrastructure/restapi/openapi/request/OneOfJsonRequestContentTypeDefinition.java
Outdated
Show resolved
Hide resolved
...i/src/test/java/tech/pegasys/teku/infrastructure/restapi/endpoints/EndpointMetadataTest.java
Outdated
Show resolved
Hide resolved
infrastructure/json/src/main/java/tech/pegasys/teku/infrastructure/json/JsonUtil.java
Outdated
Show resolved
Hide resolved
infrastructure/json/src/test/java/tech/pegasys/teku/infrastructure/json/JsonUtilTest.java
Outdated
Show resolved
Hide resolved
This would probably benefit from breaking down a bit! |
50501a0
to
6ae25ca
Compare
@@ -575,6 +577,18 @@ public SafeFuture<SendSignedBlockResult> sendSignedBlock( | |||
.exceptionally(ex -> SendSignedBlockResult.rejected(ex.getMessage())); | |||
} | |||
|
|||
@Override | |||
public SafeFuture<SendSignedBlockResult> sendSignedBlockContents( |
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.
Would this method be chosen based on the milestone we are in? I wonder if we can fit everything in one data structure SignedBeaconBlock
and SignedBlockContents
so there is no additional methods.
Closing it for now. The data structures need to be refactored |
PR Description
Implement Deneb
PostBlock
andPostBlindedBlock
APIsSpec
Fixed Issue(s)
#7013
#7075
Documentation
doc-change-required
label to this PR if updates are required.Changelog