Skip to content

Bid update to include Shutter specific fields#5

Merged
blockchainluffy merged 14 commits intomainfrom
shutter-bid-opts-impl
Oct 14, 2025
Merged

Bid update to include Shutter specific fields#5
blockchainluffy merged 14 commits intomainfrom
shutter-bid-opts-impl

Conversation

@blockchainluffy
Copy link
Copy Markdown
Owner

  • This PR introduces ShutterisedBidOption, containing identityPrefix field for shutter encrypted transaction.
  • It also allows for encrypted transactions to be sent via rawTransactions field of the Bid, not checking it for validity of the transaction.

Comment thread p2p/gen/openapi/debugapi/v1/debugapi.swagger.yaml
Comment thread p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml Outdated
Comment thread p2p/gen/openapi/bidderapi/v1/bidderapi.swagger.yaml Outdated
Comment thread p2p/gen/openapi/providerapi/v1/providerapi.swagger.yaml Outdated
Comment thread p2p/rpc/bidderapi/v1/bidderapi.proto Outdated
Comment thread p2p/rpc/providerapi/v1/providerapi.proto Outdated
Comment thread p2p/pkg/rpc/provider/service.go Outdated
case *bidderapiv1.BidOption_PositionConstraint:
c := bOpt.GetPositionConstraint()
if c == nil {
continue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this looks strange, would suggest to revert to a tagless switch with bOpt.GetPositionConstraint() != nil or bOptGetShutterisedBidOption() != nil respectively

opt := &providerapiv1.BidOption{
Opt: &providerapiv1.BidOption_ShutterisedBidOption{
ShutterisedBidOption: &providerapiv1.ShutterisedBidOption{
IdentityPrefix: c.GetIdentityPrefix(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't EncryptedTransaction missing here?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

yes, nice catch

};

message ShutterisedBidOption {
string identity_prefix = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same as above I guess: We added the encrypted tx to the bid option in the bidder API, don't we need it in the provider API as well?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

adding here

Comment thread p2p/pkg/rpc/bidder/service.go Outdated
switch option.GetOpt().(type) {
case *bidderapiv1.BidOption_ShutterisedBidOption:
c := option.GetShutterisedBidOption()
if c == nil || c.GetIdentityPrefix() == "" || c.GetEncryptedTx() == "" {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm unsure about the validation of bids, it seems we hardly do any at the moment. Is this already handled somewhere else? In line 148 of this file there's a validation function, would it make sense to add something there? Concretely, we don't check that the identity prefix has the right size (unless it's checked automatically somehow through the protobuf definitions, but then I don't see why we check for non-emptyness). Also, the mapping from tx hash to bid option seems brittle, is it guaranteed that the lengths are equal (including, is it possible to have 0 or 2 or more bid options per trasaction)?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

makes sense, added checks for identity prefix length and removed constraint on bidOption length

properties:
identityPrefix:
type: string
description: Hex string encoding of the identity prefix of the transaction that the bidder wants to include in the block.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we should standardize all hex-encoded fields to consistently include the 0x prefix. This follows Ethereum conventions and the approach we use in the Shutter API, and it also makes it immediately clear from the string representation which encoding we’re dealing with.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The standard followed in mev-commit repo, is to not include 0x prefix to the hex encoded strings, which is also followed here!

@blockchainluffy blockchainluffy merged commit a34f4ea into main Oct 14, 2025
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