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

Client/v2 Custom Broadcast Logic #21851

Open
julienrbrt opened this issue Sep 23, 2024 · 0 comments
Open

Client/v2 Custom Broadcast Logic #21851

julienrbrt opened this issue Sep 23, 2024 · 0 comments
Assignees
Labels
C:client/v2 client/v2 package C:client client package

Comments

@julienrbrt
Copy link
Member

julienrbrt commented Sep 23, 2024

Introduce custom broadcast logic for client/v2.
With the arrival of server/v2 #21069 and the support for other consensus than CometBFT,
client/v2 needs to get updated.

Currently, client/v2 makes use of the client package from the SDK, and it's client.Context.
Those structs and package assume a CometBFT node.
This cannot be assumed anymore when using server/v2:

  • func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) {
    switch ctx.BroadcastMode {
    case flags.BroadcastSync:
    res, err = ctx.BroadcastTxSync(txBytes)
    case flags.BroadcastAsync:
    res, err = ctx.BroadcastTxAsync(txBytes)
    default:
    return nil, fmt.Errorf("unsupported return type %s; supported types: sync, async", ctx.BroadcastMode)
    }
    return res, err
    }

There is already work in that direction to abstract client from client/v2.
However, we need to go one step further and make it more extensible to support different broadcast methods / node interface (

type CometRPC interface {
)

Example usage case: Reecepbcups@49ca35c

@julienrbrt julienrbrt added C:client client package C:client/v2 client/v2 package labels Sep 23, 2024
@julienrbrt julienrbrt self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:client/v2 client/v2 package C:client client package
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant