You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm always frustrated when we can not nspcc-dev/neofs-node#3070 work easily with blocks. We can listen for events, but we don't know which event comes from which block. If we're to add a subscription to block header we're still getting this event when block starts, but we're not getting any when block processing ends. If we're to add the block number to emitted event the problem is still the same, you can only say that the old block was processed when you get an event from new block.
But blocks are important. We're doing off-chain calculations here, but we want them to be perfectly synchronized with the chain to implement something resembling of a storeBlock for our events, get clear boundaries and calculate proper per-block state. We can subscribe to headers, request a block, walk through transactions and get all application logs, but that'd be devastating performance-wise, too many of requests to do.
Describe the solution you'd like
An API like getblocknotifications (and gettransactionnotifications?) that accepts a block number/hash and extracts all notifications from all successful transactions executed in this block. With a filtering possibility, just like we have for regular subscriptions. It sounds terrifying initially, but in its essence it's very similar to what getblock does DB-wise, we're picking transactions one by one until block is done. Here we'd be picking application logs from the same DB entries effectively and filtering is not hard. So we can get it using the same DB we have now.
Other applications of it include node synchronization when it misses a block or two upon disconnect (contrary to full sync).
Describe alternatives you've considered
I'm open to any alternative suggestions.
Additional context
In some ways related to neo-project/neo#3583, but that one requires an additional index.
roman-khimov
changed the title
API to fetch all notifications in a block (with filters)
API to fetch all notifications from a block (with filters)
Dec 28, 2024
Is your feature request related to a problem? Please describe.
I'm always frustrated when we can not nspcc-dev/neofs-node#3070 work easily with blocks. We can listen for events, but we don't know which event comes from which block. If we're to add a subscription to block header we're still getting this event when block starts, but we're not getting any when block processing ends. If we're to add the block number to emitted event the problem is still the same, you can only say that the old block was processed when you get an event from new block.
But blocks are important. We're doing off-chain calculations here, but we want them to be perfectly synchronized with the chain to implement something resembling of a
storeBlock
for our events, get clear boundaries and calculate proper per-block state. We can subscribe to headers, request a block, walk through transactions and get all application logs, but that'd be devastating performance-wise, too many of requests to do.Describe the solution you'd like
An API like
getblocknotifications
(andgettransactionnotifications
?) that accepts a block number/hash and extracts all notifications from all successful transactions executed in this block. With a filtering possibility, just like we have for regular subscriptions. It sounds terrifying initially, but in its essence it's very similar to whatgetblock
does DB-wise, we're picking transactions one by one until block is done. Here we'd be picking application logs from the same DB entries effectively and filtering is not hard. So we can get it using the same DB we have now.Other applications of it include node synchronization when it misses a block or two upon disconnect (contrary to full sync).
Describe alternatives you've considered
I'm open to any alternative suggestions.
Additional context
In some ways related to neo-project/neo#3583, but that one requires an additional index.
CC @carpawell.
The text was updated successfully, but these errors were encountered: