From 6fdda0f15d0b544099c630720e6bec904bf07d47 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 29 Nov 2023 13:53:45 +0300 Subject: [PATCH 1/3] rpcclient: add doc link to notifications ordering guarantees Signed-off-by: Anna Shaleva --- pkg/rpcclient/wsclient.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/rpcclient/wsclient.go b/pkg/rpcclient/wsclient.go index f86b9e9f7..b9e03f0f2 100644 --- a/pkg/rpcclient/wsclient.go +++ b/pkg/rpcclient/wsclient.go @@ -43,6 +43,10 @@ import ( // unblocking in this mode. No unsubscription is performed in this case, so it's // still the user responsibility to unsubscribe. // +// All Receive* methods provide notifications ordering and persistence guarantees. +// See https://github.com/nspcc-dev/neo-go/blob/master/docs/notifications.md#ordering-and-persistence-guarantees +// for more details on this topic. +// // Any received subscription items (blocks/transactions/nofitications) are passed // via pointers for efficiency, but the actual structures MUST NOT be changed, as // it may affect the functionality of other notification receivers. If multiple From 81a439a0d6412ee2b00c7fc97ab58d7c9020870f Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 29 Nov 2023 13:55:54 +0300 Subject: [PATCH 2/3] docs: fix typo Signed-off-by: Anna Shaleva --- docs/notifications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/notifications.md b/docs/notifications.md index 741d4a200..dc31cbd12 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -33,7 +33,7 @@ Filters use conjunctional logic. * new in-block transaction is announced after block processing, but before announcing the block itself * transaction notifications are only announced for successful transactions - * all announcements are being done in the same order they happen on the chain + * all announcements are being done in the same order they happen on the chain. First, OnPersist script execution is announced followed by notifications generated during the script execution. After that transaction execution is announced. It is then followed by notifications generated during this execution. Next, follows the From e3aa6bba4dbe72e08afbf62e4e27fd0010f2469c Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 29 Nov 2023 14:00:44 +0300 Subject: [PATCH 3/3] docs: add ordering guarantees for notary request events Signed-off-by: Anna Shaleva --- docs/notifications.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/notifications.md b/docs/notifications.md index dc31cbd12..41f2ada90 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -41,6 +41,10 @@ Filters use conjunctional logic. they're in the block. After all in-block transactions announcements PostPersist script execution is announced followed by notifications generated during the script execution. Finally, block announcement is followed. + * notary request events announcements are not bound to the chain processing. + Trigger for notary request notifications is notary request mempool content + change, thus, notary request event is announced every time notary request + enters or leaves notary pool. * unsubscription may not cancel pending, but not yet sent events ## Subscription management