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

Add blob signing endpoints #302

Merged
merged 22 commits into from
May 16, 2023

Conversation

realbigsean
Copy link
Contributor

Resolves #300

Notes

Questions

  • 202 vs 200 response code doesn’t really work the same anymore with these separate POST requests. I'm not sure how we should handle this. We could keep the existing meaning for each, it will just mean most requests return a 202 and only the final block/blob message for a slot leads to import and returns a 200.
  • There’s no spec definition of the BlockContents struct for SSZ serialization. This struct is solely for communication here and not used in consensus elsewhere. Should the SSZ definition be included here? Should we add some similar type's definition to the consensus spec? Can we describe this SSZ type in terms of spec objects? (e.g., SignedBeaconBlock with BlobSidecars appended?)
  • Generally is it OK for the existing /validator/block endpoints to return a new type only for deneb (BlockContents) ?

@jimmygchen
Copy link
Contributor

Probably need to add the new endpoint to the top level CHANGES.md as well.

@jimmygchen
Copy link
Contributor

The top level validator-flow.md has some explanation on the block proposing flow, maybe worth adding blob signing to the Block Proposing section?

@@ -89,6 +89,8 @@ paths:
$ref: "./apis/beacon/blocks/blinded_blocks.yaml"
/eth/v1/beacon/blocks:
$ref: "./apis/beacon/blocks/blocks.yaml"
/eth/v1/beacon/blob_sidecar:
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should make this /eth/v1/beacon/blinded_blob_sidecar?

@arnetheduck
Copy link
Contributor

ethereum/consensus-specs#3244 is now ready for review - it would be nice to leave this PR open for a bit until that has been merged and we've had time to evaluate the impact of blinded-only blobs.

Instructs the beacon node to broadcast a newly signed blob to the beacon network,
to be included in the beacon chain. A success response (20x) indicates that the blob
passed gossip validation and was successfully broadcast onto the network.
The beacon node is also expected to integrate the blob into state once it receives the
Copy link
Contributor

Choose a reason for hiding this comment

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

The description here needs to be changed. Blobs are not expected to be integrated into state.

"202":
description: "The blob could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast."
"400":
description: "The `SignedBlobSidecar` object is invalid and could not be broadcast"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't be SignedBlindedBlobSidecar instead of SignedBlobSidecar?

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess description is talking about constructed object

@tbenr
Copy link
Contributor

tbenr commented Feb 15, 2023

A curiosity. What's the rationale behind having separate SignedBlindedBlobSidecar instead of a single post with an array of SignedBlindedBlobSidecar?

I can image a more streamlined flow in VC which is (remote)sign and publish for each Sidecar. But I can still see benefits of having aggregated methods for remote-signing and publishing: it better scale with increasing number of blobs.

@jimmygchen
Copy link
Contributor

A curiosity. What's the rationale behind having separate SignedBlindedBlobSidecar instead of a single post with an array of SignedBlindedBlobSidecar?

I can image a more streamlined flow in VC which is (remote)sign and publish for each Sidecar. But I can still see benefits of having aggregated methods for remote-signing and publishing: it better scale with increasing number of blobs.

I'm guessing it's for the same reason as separating blobs from the block request - so that it can be sent to the BN and lets it starts publishing to gossip more quickly. Although I wonder if it still provide the same benefit if we're sending blinded blobs between VC and BN. Does it still make sense to even separate block and blobs if we go with blinded blobs?

@tbenr
Copy link
Contributor

tbenr commented Feb 16, 2023

Although I wonder if it still provide the same benefit if we're sending blinded blobs between VC and BN

On the proposer side, blobs are available immediately, all together. When VC post them all (blindly signed) to BN, bn can gossip them all together in parallel. The only problem i see is that the return code for the publish will (maybe) take in consideration partial failures. So we exchange a single call with more complex error handling\retry from the VC side.

Same consideration applies for remote signing (web3signer) all blinded blobs with one call.

@realbigsean
Copy link
Contributor Author

A curiosity. What's the rationale behind having separate SignedBlindedBlobSidecar instead of a single post with an array of SignedBlindedBlobSidecar?
I can image a more streamlined flow in VC which is (remote)sign and publish for each Sidecar. But I can still see benefits of having aggregated methods for remote-signing and publishing: it better scale with increasing number of blobs.

I'm guessing it's for the same reason as separating blobs from the block request - so that it can be sent to the BN and lets it starts publishing to gossip more quickly. Although I wonder if it still provide the same benefit if we're sending blinded blobs between VC and BN. Does it still make sense to even separate block and blobs if we go with blinded blobs?

Yeah, I honestly don't have a sense for whether a batch or individual requests would be faster and at what number of blobs. It made intuitive sense to me to view this endpoint as a "gossip publisher" in which case having it mirror the gossip topic's contents made sense. Open to changing this.

As far as how blinding impacts this, we can blind and cache in the beacon node per-blob, so I'm not sure I see how that impacts whether to publish them separately. Would keeping them together in blinding be a reduction in complexity or faster?

@realbigsean
Copy link
Contributor Author

On the proposer side, blobs are available immediately, all together. When VC post them all (blindly signed) to BN, bn can gossip them all together in parallel. The only problem i see is that the return code for the publish will (maybe) take in consideration partial failures. So we exchange a single call with more complex error handling\retry from the VC side.

I agree the error handling gets more complex, the 200 vs 202 response codes end up having different meanings here

@tbenr
Copy link
Contributor

tbenr commented Feb 16, 2023

Another consideration is the "stickiness" required by blinded flows. I mean, when a VC can use multiple BNs, the publish calls must end on the same BN that handled the block/blobs production. Different BNs wont be able to unblind them. (I don't know if any clients has implemented a shared cache between different BN "clusters", teku didn't). So having multiple calls required to complete the entire flow become more exposed to eventual failover in the middle of the flow.

Maybe @mcdee might have opinions on these topics.

@jimmygchen
Copy link
Contributor

Different BNs wont be able to unblind them. (I don't know if any clients has implemented a shared cache between different BN "clusters", teku didn't). >

I think that's definitely a very strong point against separating the calls if a shared cache is required between BNs.

Although I'm not fully grasping why different BNs can't unblind them?
Let's say the VC submitted a signed block, and signed blinded sidecars all to different BNs, and each BN then sends them off to the relays individually, and then each receives the corresponding unblinded block / unblinded blobs back, wouldn't they be able to publish them separately? Am I missing something?

g11tech
g11tech previously approved these changes Apr 10, 2023
Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lodestar has implemented the full contents signing flow

@rolfyone
Copy link
Collaborator

rolfyone commented May 5, 2023

Where are we at with this? Can we fix conflicts and think about merging?

@realbigsean realbigsean dismissed stale reviews from ghost and g11tech via 1b08ee4 May 12, 2023 14:17
types/deneb/block.yaml Outdated Show resolved Hide resolved
@realbigsean
Copy link
Contributor Author

Fixed the conflicts @rolfyone

I'm still interested it people have thoughts on this: #302 (comment)

But that's it from my POV

@rolfyone
Copy link
Collaborator

add an entry in the changes for one :)

mcdee
mcdee previously approved these changes May 16, 2023
Copy link
Collaborator

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to add a PR making changes closer to what you want, but at least this should be adequate as a start.

@rolfyone rolfyone merged commit f0ffbb8 into ethereum:master May 16, 2023
realbigsean added a commit to realbigsean/beacon-APIs that referenced this pull request Oct 30, 2023
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.

Blob Signing APIs
9 participants