-
Notifications
You must be signed in to change notification settings - Fork 104
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
Extend transaction subscription to include block_time #228
Comments
cc @fanatid |
Giving this a look today. I'll report back on what I find. |
Wouldnt it make more sense to just subscribe to the block meta updates
instead of having some side effect that if you provide this param that the
TX transmission gets delayed?
That seems like an "unexpected" side effect that could trip someone up ?
I understand that the goal is to avoid to get multiple different types of
messages for the user to handle?
…On Tue, Oct 31, 2023 at 3:19 AM Liam Vovk ***@***.***> wrote:
Currently the transaction notification doesn't include block_time,
however this is included in the standard RPC interface here
<https://docs.solana.com/api/http#gettransaction>. A few options
1. Update SubscribeUpdateTransaction to include optional uint64
block_time field that gets set based on existence of block_meta in the
SlotsMessages
2. Same as 1 but update SubscribeRequestFilterTransactions with optional
bool block_meta_required field that defaults to false
if block_meta_required is true
- Prevent txn broadcast until block_meta is present
else
- broadcast whether block_meta is present or not
—
Reply to this email directly, view it on GitHub
<#228>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHOYRMA6KKE3IPKHDB42E3YCAOHPAVCNFSM6AAAAAA6WWWD76VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DSMRYGA3DEMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@vovkman the block time is made available in the slot update event but not the transaction. It does have the slot in which case getBlockTime can be passed for fined the block_time (which you may have already known but adding to the record) |
No need for getBlockTime, the block subscription data already provides this via gRPC :
This subscription would give access to both transactions and block_time since the block meta message would include the block time for the specific transactions:
IF we want to add block_time to the transaction it should definitely be a flag and also something that clearly indicates that it will slow down transaction delivery (e.g. |
Yeah this is meant to simplify things for clients. I think the |
@vovkman would a client cache that buffered and then flushed the transactions once the block be confirmed suffice for your use case? This would allow you to have access to the block metadata at the same time as processing the transaction but does add delay to the processing. |
I would prefer for the changes to be in the plugin itself. Right now the plugin works for power users, but I don't see a downside to adding more logic to make it simple for regular users too |
@vovkman @linuskendall here is a pros and cons list as I see it:
Wait for block flagPro
Con
Client side transaction cache+flushPros
Con
|
I am personally more in favor of |
We will need to buffer all the transactions for the slot and flush them so it definitely means a lot more server side buffering for the client in this mode (however: confirmed and finalzied anyway has the same semantics so I don't think it will be a huge difference). I think having a flag is a little bit inelegant, but maybe it's the best way to do it? another way would be to specify a unique commitment level (
The benefit of making this a commitment level type thing is that commitment levels already mean "how fast/slow will i receive these updates" (in addition to meaning something about the forking states/validity). |
Currently the transaction notification doesn't include
block_time
, however this is included in the standard RPC interface here. A few optionsSubscribeUpdateTransaction
to includeoptional uint64 block_time
field that gets set based on existence of block_meta in theSlotsMessages
SubscribeRequestFilterTransactions
withoptional bool block_meta_required
field that defaults to falseif
block_meta_required
is trueblock_meta
is presentelse
block_meta
is present or notCould be argued that this should be done client side, but I prefer reducing as many messages as possible at the source
The text was updated successfully, but these errors were encountered: