[#419] cmd/node: Cache eACL tables read from sidechain

Implement TTL cache of eACL tables read from sidechain. Use it as a eACL
storage in neofs-node app. Current cache size is set to 100, TTL is 30s
(constants).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-03-04 14:26:19 +03:00 committed by Leonard Lyubich
parent 34a51ed38b
commit f9342aa562
2 changed files with 35 additions and 2 deletions

View file

@ -343,9 +343,9 @@ func initObjectService(c *cfg) {
),
acl.WithLocalStorage(ls),
acl.WithEACLValidatorOptions(
eacl.WithEACLStorage(&morphEACLStorage{
eacl.WithEACLStorage(newCachedEACLStorage(&morphEACLStorage{
w: c.cfgObject.cnrClient,
}),
})),
eacl.WithLogger(c.log),
),
acl.WithNetmapState(c.cfgNetmap.state),