Use RPC Client's Waiter functionality for auto-deploy procedure #152

Open
opened 2025-12-28 18:08:42 +00:00 by sami · 0 comments
Owner

Originally created by @AnnaShaleva on GitHub (Jul 10, 2023).

Current auto-deploy scheme sends notary requests with contracts deploy/update code and doesn't wait until main/fallback are accepted to chain. There are for ; ; prm.monitor.waitForNextBlock(ctx) loops that are used to track the consequenses of the contract deploy/update.

Describe the solution you'd like

I consider that we can safely get rid of for ; ; prm.monitor.waitForNextBlock(ctx) loops, create cancellable context, subscribe for Management's Deploy/Update notifications and use waiter.Wait to wait for either main or fallback. Cancellable context may be used to cancel waiter in case if contract update happens earlier on behalf of some other notary request. I think that with Waiter this code will be clearer. There's a prototype, but it can be improved as described above: 34b1944f7bdfb4f8c8fe8831499d57483ee9ff52.

The same approach can be applied to the simple GAS transfer transactions that increase notary balance for auto-deploy procedure participants.

Originally created by @AnnaShaleva on GitHub (Jul 10, 2023). ## Is your feature request related to a problem? Please describe. Current auto-deploy scheme sends notary requests with contracts deploy/update code and doesn't wait until main/fallback are accepted to chain. There are `for ; ; prm.monitor.waitForNextBlock(ctx)` loops that are used to track the consequenses of the contract deploy/update. ## Describe the solution you'd like I consider that we can safely get rid of `for ; ; prm.monitor.waitForNextBlock(ctx)` loops, create cancellable context, subscribe for Management's Deploy/Update notifications and use waiter.Wait to wait for either main or fallback. Cancellable context may be used to cancel waiter in case if contract update happens earlier on behalf of some other notary request. I think that with Waiter this code will be clearer. There's a prototype, but it can be improved as described above: 34b1944f7bdfb4f8c8fe8831499d57483ee9ff52. The same approach can be applied to the simple GAS transfer transactions that increase notary balance for auto-deploy procedure participants.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-contract#152
No description provided.