Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

RPC: pubsub defaults to confirmed but rpc http defaults to finalized #16596

Closed
jstarry opened this issue Apr 16, 2021 · 4 comments · Fixed by #16659
Closed

RPC: pubsub defaults to confirmed but rpc http defaults to finalized #16596

jstarry opened this issue Apr 16, 2021 · 4 comments · Fixed by #16659
Assignees

Comments

@jstarry
Copy link
Contributor

jstarry commented Apr 16, 2021

Problem

The default commitment for pubsub and http requests are different which can cause consistency issues in downstream clients.

This problem manifests itself in the web3 sdk. When a commitment is not specified for a Connection, an account info request will default to finalized but confirming a transaction will default to confirmed because it uses pubsub to subscribe to confirmation. This causes consistency problems in apps that may immediately fetch account state after confirming a transaction. The out of the box configuration shouldn't be error prone like this.

Proposed Solution

Default everything to confirmed?

Problem is that this is a breaking change and some clients may be surprised about the defaults changing. However, one could argue that any application requiring full finalization, should already be explicit about that in commitment parameters and not rely on defaults.

tag @mvines @CriesofCarrots

@ryoqun
Copy link
Contributor

ryoqun commented Apr 19, 2021

oh seems like another read consistency issue... allow me to tag.. #15705

@mvines
Copy link
Contributor

mvines commented Apr 20, 2021

Default everything to confirmed?

I think we still want to be conservative and default to finalized for everything, 100% safety by default

However, one could argue that any application requiring full finalization, should already be explicit about that in commitment parameters and not rely on defaults.

Pretty sure this'll break some exchanges that already assume finalized by default

@jstarry
Copy link
Contributor Author

jstarry commented Apr 20, 2021

Ok, by being conservative, developers opt into lower levels of safety if they wish but by default get a slow but safe experience. We should consolidate in the other direction then and change the Pubsub default to finalized

@mvines
Copy link
Contributor

mvines commented Apr 20, 2021

We should consolidate in the other direction then and change the Pubsub default to finalized

100%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants