Commit graph

8 commits

Author SHA1 Message Date
Anna Shaleva
42555668da rpcclient: add Waiter.Config
Include Waiter.PollConfig into Waiter.Config and use extended Waiter
configuration where needed.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-08-20 10:13:20 +03:00
Anna Shaleva
92c6361be8 rpcclient: integrate customizable Waiter with Actor
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-08-20 10:13:20 +03:00
Anna Shaleva
027d726b65 rpcclient: allow to tune PollingBased waiter
Some clients need more flexible awaiting options (e.g. for short-blocks
networks). The default behaviour is not changed, all exported APIs are
compatible. Ref. https://github.com/nspcc-dev/neofs-node/issues/2864.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-08-20 10:13:19 +03:00
Anna Shaleva
3e3991cef8 rpcclient: remove default PolingBased poll interval
pollTime is never 0 since MillisecondsPerBlock protocol configuration value
is present in `getversion` RPC response since 0.97.3 release. We don't have such
old RPC servers in the network anymore, thus this fallback code may be
safely removed.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-08-20 10:10:59 +03:00
Anna Shaleva
0c6627f13d *: use multierror wrapping where possible
Revert 5f6c01336c, remove all multierror
related nolint comments and use multierror wrapping instead.

Close #2906.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-03-05 13:54:10 +03:00
Anna Shaleva
f5b1bd3978 waiter: adopt headers subscription for WS-based tx awaiting
Try to subscribe for headers firstly, and then if RPC server doesn't
have this ability, fallback to block subscriptions to manage transaction
awaiting.

Close #3260.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-29 16:00:56 +03:00
Anna Shaleva
7c9b1d05d2 rpcclient: refactor waiter package naming
Adjust names of all used structures, no need to duplicate `Waiter` everywhere,
we already in the `waiter` package. Also, adjust comments to Actor so that links
to Waiter are properly described in docs.

Ref. #3265.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-12-29 15:22:50 +03:00
Ekaterina Pavlova
4c6dca876c rpcclient: move Waiter to a separate package
There are use-cases when not only Actor, but also Invoker and even
simple RPC client must wait (e.g. sendtx or dumptx CLI commands). Actor
requires optional signers in constructor, and it's not always
appropriate to create Actor only to be able to use Waiter, sometimes
it's needed to use only Waiter without Actor.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2023-12-28 15:30:15 +03:00