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

Post BlockContents #7082

Closed

Conversation

mehdi-aouadi
Copy link
Contributor

PR Description

Implement Deneb PostBlock and PostBlindedBlock APIs
Spec

Fixed Issue(s)

#7013
#7075

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.

@mehdi-aouadi mehdi-aouadi self-assigned this Apr 26, 2023
@mehdi-aouadi mehdi-aouadi mentioned this pull request Apr 26, 2023
2 tasks
@mehdi-aouadi mehdi-aouadi force-pushed the 7013-post-blockcontents branch 3 times, most recently from 40226e0 to 8dcacb1 Compare April 26, 2023 19:50
@mehdi-aouadi mehdi-aouadi force-pushed the 7013-post-blockcontents branch from 8dcacb1 to 0fd78d7 Compare April 26, 2023 20:53
@mehdi-aouadi mehdi-aouadi marked this pull request as ready for review April 26, 2023 21:00
return AsyncApiResponse.respondWithCode(SC_ACCEPTED);
}
}));
Object requestBody = request.getRequestBody();
Copy link
Contributor

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...

Copy link
Contributor Author

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

Copy link
Contributor

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...

Copy link
Contributor

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...

@rolfyone
Copy link
Contributor

This would probably benefit from breaking down a bit!

@mehdi-aouadi mehdi-aouadi force-pushed the 7013-post-blockcontents branch from 50501a0 to 6ae25ca Compare April 28, 2023 09:45
@mehdi-aouadi mehdi-aouadi requested a review from rolfyone April 28, 2023 14:11
@@ -575,6 +577,18 @@ public SafeFuture<SendSignedBlockResult> sendSignedBlock(
.exceptionally(ex -> SendSignedBlockResult.rejected(ex.getMessage()));
}

@Override
public SafeFuture<SendSignedBlockResult> sendSignedBlockContents(
Copy link
Contributor

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.

@mehdi-aouadi
Copy link
Contributor Author

Closing it for now. The data structures need to be refactored

@mehdi-aouadi mehdi-aouadi deleted the 7013-post-blockcontents branch May 9, 2023 10:06
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.

3 participants