generated from TrueCloudLab/basic
morph: Remove name transformer in morph policy client #32
No reviewers
TrueCloudLab/storage-services-developers
TrueCloudLab/storage-core-developers
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/policy-engine#32
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/policy-engine:fix/remove_container_name_transformer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It is not required to transform long names because container chains will be added by container ID but not by a resource name.
Adding chains by converted CID to a resource name was a mistake left after first prototype implementations.
e2573c563e
todef9032615
@TrueCloudLab/storage-core-developers
@TrueCloudLab/storage-services-developers
The maximum key length for a contract storage is
64
and storageKey is<'n'/'c'/'i'> + <cid> + <name>
Entity kind is
1
byte longCID
can have45
characters in base58:GCrGDRmQL4xTFnt2R5byeCiQX4fTbJ7ZR1xyV7hXGPZT
So,
46
bytes are already reserved-> 18
can be used to name a chain in the policy contract.Let's look at prefixedChainName.
So, chains are named with prefix like
ingress:some_chain_id
and we list chains for a target with prefixingress
.It means we can use only 10 characters to name chains. WDYT?
For CID we may use raw byte array, there is no requirement to have human-readable keys in contract.
Another possibility to increase useful key size is to add indirection: store
CID -> 4-byte ID
mapping and start all keys with 4-byte ID.This can be done without changing contract interface.
Could you clarify your idea, please:
"start all keys with" sounds like you suggest to cut the prefix from CID. Am I right?
@aarifullin cutting prefix is an option, but in contract we can have u32 numbers incrementing from 0, so that they will definitely be different.