[#3] policy: Introduce policy contract interface wrapper #24

Merged
fyrchik merged 2 commits from aarifullin/policy-engine:feature/3_policy-contract-interface into master 2024-09-04 19:51:23 +00:00
Member

Signed-off-by: Airat Arifullin aarifullin@yadro.com

Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
aarifullin added the
help wanted
discussion
labels 2023-11-28 16:42:09 +00:00
aarifullin reviewed 2023-11-28 16:47:16 +00:00
@ -0,0 +44,4 @@
}
fullName := prefixedChainName(name, c.ID)
_, _, err = s.contractInterface.AddChain(big.NewInt(int64(kind)), target.Name, fullName, c.Bytes())
Author
Member

@fyrchik

Need your help, please

Despite this implementation works in frostfs-node (I checked locally), I think it is still raw.
There are some problems like should I return transactionHash and VUB from these invocations and consider them for awaitTx usage outside?

@fyrchik Need your help, please Despite this implementation works in `frostfs-node` (I checked locally), I think it is still raw. There are some problems like should I return `transactionHash` and `VUB` from these invocations and consider them for `awaitTx` usage outside?
Owner

Returning hash and VUB is desireable, but I believe we could use some callbacks in actor to catch them.

Returning hash and VUB is desireable, but I believe we could use some callbacks in actor to catch them.
aarifullin force-pushed feature/3_policy-contract-interface from 3699774a4f to f5f0374ecd 2023-11-29 09:42:48 +00:00 Compare
aarifullin force-pushed feature/3_policy-contract-interface from f5f0374ecd to 05ee9b2394 2023-11-29 09:55:14 +00:00 Compare
aarifullin requested review from storage-services-committers 2023-11-29 09:57:04 +00:00
aarifullin requested review from storage-services-developers 2023-11-29 09:57:05 +00:00
aarifullin requested review from storage-core-committers 2023-11-29 09:57:17 +00:00
aarifullin requested review from storage-core-developers 2023-11-29 09:57:17 +00:00
aarifullin force-pushed feature/3_policy-contract-interface from 05ee9b2394 to 8d0e4ed3f7 2023-11-29 09:59:18 +00:00 Compare
aarifullin force-pushed feature/3_policy-contract-interface from 8d0e4ed3f7 to 501c430225 2023-11-29 10:02:07 +00:00 Compare
aarifullin changed title from [#3] policy: Introduce policy contract interface wrapper to WIP: [#3] policy: Introduce policy contract interface wrapper 2023-11-29 11:17:58 +00:00
aarifullin force-pushed feature/3_policy-contract-interface from 501c430225 to ed87e82b5b 2023-11-29 13:45:28 +00:00 Compare
aarifullin changed title from WIP: [#3] policy: Introduce policy contract interface wrapper to [#3] policy: Introduce policy contract interface wrapper 2023-11-29 13:45:45 +00:00
dstepanov-yadro approved these changes 2023-11-29 15:12:56 +00:00
dkirillov reviewed 2023-11-30 09:27:33 +00:00
go.mod Outdated
@ -4,2 +4,3 @@
require github.com/stretchr/testify v1.8.4
require (
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20231124073422-e56e8d02eee3
Member

Can we user the latest version? We have different method signature now
(name is []byte

func AddChain(entity Kind, entityName string, name []byte, chain []byte) {

)

Can we user the latest version? We have different method signature now (name is `[]byte` https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/commit/a1b61d3949581f4d65b0d32a33d98ba9c193dc2a/policy/policy_contract.go#L84)
Author
Member

Ofc, thanks for this point

Ofc, thanks for this point
dkirillov marked this conversation as resolved
aarifullin force-pushed feature/3_policy-contract-interface from ed87e82b5b to 87210589f1 2023-11-30 15:56:44 +00:00 Compare
dkirillov approved these changes 2023-12-01 06:23:10 +00:00
acid-ant approved these changes 2023-12-01 06:53:29 +00:00
dkirillov reviewed 2023-12-04 13:40:04 +00:00
go.mod Outdated
@ -6,0 +9,4 @@
github.com/stretchr/testify v1.8.4
)
require (
Member

Can we keep just one require section with indirect dependencies?

Can we keep just one require section with indirect dependencies?
Author
Member

Sure!

Sure!
dkirillov marked this conversation as resolved
aarifullin force-pushed feature/3_policy-contract-interface from 87210589f1 to 5f7b8458ba 2023-12-06 09:26:49 +00:00 Compare
aarifullin force-pushed feature/3_policy-contract-interface from 5f7b8458ba to 1dea2d26e2 2023-12-06 09:28:35 +00:00 Compare
aarifullin requested review from dstepanov-yadro 2023-12-06 09:28:44 +00:00
aarifullin requested review from dkirillov 2023-12-06 09:28:44 +00:00
aarifullin requested review from acid-ant 2023-12-06 09:28:45 +00:00
dstepanov-yadro approved these changes 2023-12-06 10:54:08 +00:00
dkirillov approved these changes 2023-12-06 13:45:35 +00:00
acid-ant approved these changes 2023-12-07 07:47:17 +00:00
fyrchik reviewed 2023-12-07 09:11:05 +00:00
@ -0,0 +127,4 @@
if err != nil {
return nil, fmt.Errorf("can't parse integer bytes: %w", err)
}
return n.Bytes(), nil
Owner

This is invalid approach, n.Bytes() has different encoding
TryBytes is enough, irregardless of type (it will work for integer too).

This is invalid approach, `n.Bytes()` has different encoding `TryBytes` is enough, irregardless of type (it will work for integer too).
Author
Member

Alright. I have fixed.
This was copy-pasta from here

Alright. I have fixed. This was copy-pasta from [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/util.go#L49)
aarifullin force-pushed feature/3_policy-contract-interface from 1dea2d26e2 to 156018bcba 2023-12-07 11:01:46 +00:00 Compare
aarifullin requested review from dstepanov-yadro 2023-12-07 11:03:01 +00:00
aarifullin requested review from dkirillov 2023-12-07 11:03:02 +00:00
aarifullin requested review from acid-ant 2023-12-07 11:03:03 +00:00
fyrchik approved these changes 2023-12-07 11:04:56 +00:00
fyrchik merged commit 156018bcba into master 2023-12-07 11:05:25 +00:00
Sign in to join this conversation.
No description provided.