Skip to content

feat: Add Provider API for decrypted txs and include eon id for shutterised bid options#6

Merged
blockchainluffy merged 3 commits intomainfrom
provider-api
Oct 31, 2025
Merged

feat: Add Provider API for decrypted txs and include eon id for shutterised bid options#6
blockchainluffy merged 3 commits intomainfrom
provider-api

Conversation

@blockchainluffy
Copy link
Copy Markdown
Owner

No description provided.

@blockchainluffy blockchainluffy changed the title Add Provider API for decrypted txs and include eon id for shutterised bid options feat: Add Provider API for decrypted txs and include eon id for shutterised bid options Oct 30, 2025
Copy link
Copy Markdown

@jannikluhn jannikluhn left a comment

Choose a reason for hiding this comment

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

just some naming suggestions

$ref: '#/definitions/googlerpcStatus'
parameters:
- name: txHash
description: Transaction hash to get the decrypted transaction for.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unclear if this is the hash of the plaintext or the encrypted transaction

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 txHash always refers to plaintext transaction hash as that is also used in bid and preconfirmations

/v1/provider/get_decrypted_transaction:
get:
summary: GetDecryptedTransaction
description: GetDecryptedTransaction is called by the provider to get the decrypted transaction.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unclear what "the decrypted transaction" is

v1GetDecryptedTransactionResponse:
type: object
properties:
decryptedTx:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe add a pattern to indicate that it should be (presumably) hex encoded

ctx context.Context,
req *providerapiv1.GetDecryptedTransactionRequest,
) (*providerapiv1.GetDecryptedTransactionResponse, error) {
txHashes := req.GetTxHash()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

txHash = ...

// DecryptedTransactionData represents the decrypted transaction data
type DecryptedTransactionData struct {
TxHash string `json:"tx_hash"`
Identity string `json:"identity"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are we cleanly distinguishing identity, identity preimage, identity prefix, etc.? Which one is this?

Comment thread p2p/pkg/rpc/provider/service.go Outdated
}

// GetDecryptedTxResponse represents the response from shutter sequencer endpoint
type GetDecryptedTxResponse struct {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GetDecryptedTransactionResponse for consistency

}

// DecryptedTransactionData represents the decrypted transaction data
type DecryptedTransactionData struct {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

GetDecryptedTransactionData maybe for consistency?

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.

this is used in the above struct, so should not matter, imo

TxHash string `json:"tx_hash"`
Identity string `json:"identity"`
DecryptionKey string `json:"decryption_key"`
DecryptedTx string `json:"decrypted_tx"` // hex encoded
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

DecryptedTransaction (I don't care either way, just think it should be consistent)

Comment thread p2p/pkg/rpc/provider/service.go Outdated
Timeout: 30 * time.Second,
}

reqHTTP, err := http.NewRequestWithContext(ctx, http.MethodGet, s.shutterSequencerEndpoint+"/get_decrypted_tx/"+txHashes, nil)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Have we already defined the API somewhere? If it's REST, it should probably be just /decrypted_tx without the get.

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 api is part of sequencer and yes, it is rest api, I updating it to just decrypted_tx

rpc GetCommitmentInfo(GetCommitmentInfoRequest) returns (CommitmentInfoResponse) {
option (google.api.http) = {get: "/v1/provider/get_commitment_info"};
}
// GetDecryptedTransaction
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 confused why this exist, don't we already have the Swagger API definition?

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.

this proto file is used to auto generate the swagger definition and the bindings

@blockchainluffy blockchainluffy merged commit 6ae54f7 into main Oct 31, 2025
3 of 5 checks passed
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.

2 participants