[#925] morph: Introduce switch rpc guarded rpc actor

* Introduce switch rpc guarded rpc actor in morph client
  to prevent using invalidated rpc actor when RPC switch
  happens.
* Initialize NewContractStorage with SwitchRPCGuardedActor.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-01-24 15:55:04 +03:00 committed by Evgenii Stratonikov
parent d13e37f70b
commit 1fe7736d92
2 changed files with 121 additions and 1 deletions

View file

@ -1061,7 +1061,7 @@ func initAccessPolicyEngine(_ context.Context, c *cfg) {
}
morphRuleStorage := policy_client.NewContractStorage(
c.cfgMorph.client.GetActor(),
client.NewSwitchRPCGuardedActor(c.cfgMorph.client),
c.cfgObject.cfgAccessPolicyEngine.policyContractHash)
ape := newAccessPolicyEngine(morphRuleStorage, localOverrideDB)