-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map namespace between local name and remote name #895
Conversation
Currently the local namespace name is still used everywhere, but this is the first step in propagating both names further into the stack. Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Note: many sanity checks on token namespaces were removed, as it became clear that they were impossible to hit (cannot query database for one namespace and somehow receive a result from another namespace). Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Operations deal only with local namespace names, while other plugin operations use remote namespace names. Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Do not transmit a namespace in the definition. Every receiver will fill in a namespace based on the message containing the definition. Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Batch manager (and therefore all processors) is specific to a single namespace. Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
The namespaces on these items is not transmitted but is inferred from a previously created local definition (a contract listener or token pool). Therefore, all filtering is based on the local namespace name. Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Codecov Report
@@ Coverage Diff @@
## main #895 +/- ##
==========================================
+ Coverage 99.96% 99.97% +0.01%
==========================================
Files 298 298
Lines 19405 19274 -131
==========================================
- Hits 19399 19270 -129
+ Misses 5 4 -1
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
@@ -34,14 +33,17 @@ func (bm *definitionSender) DefineFFI(ctx context.Context, ffi *fftypes.FFI, wai | |||
} | |||
|
|||
if bm.multiparty { | |||
ffi.Namespace = bm.namespace // TODO: change validation to not check namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still a TODO
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea... needs to be done in firefly-common. I'll add a card to the board.
msg, err := bm.sendDefinitionDefault(ctx, datatype, core.SystemTagDefineDatatype, waitConfirm) | ||
if msg != nil { | ||
datatype.Message = msg.Header.ID | ||
} | ||
datatype.Namespace = bm.namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding, why do we set this right before returning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to ensure it's set on everything sent to the database or in an HTTP response, but not in anything packed for sending over dataexchange/sharedstorage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but will defer to @peterbroadhurst.
Just noting here we did talk about different ways to handle unsetting the namespace other than *.namespace = ""
Part of FIR-12
Orchestrator is now aware of the namespace local name and remote name, as are some of the managers. Plugins are intentionally not aware of the mapping, but are passed the local or remote namespace names as appropriate.
The only two items which record a remote namespace name are
Message
andGroup
. These now have an additionallocalNamespace
field, which will be populated with the local namespace, while the existingnamespace
field will be populated with the remote namespace (because it is part of the hash in both of these cases, it must remain the same for all members). In addition,Batch
andData
items will be populated with the remote namespace name for network transit (but will be stored with the local namespace name only). Beyond these, every other existing object simply continues to populate itsnamespace
with a local namespace name.Some more notes on how the local namespace is filled for other items: