Skip to content

Conversation

@awrichar
Copy link
Contributor

Currently these fields are verified only by the receiver, which can lead to
sending a bad message that is rejected on the other end.

Currently these fields are verified only by the receiver, which can lead to
sending a bad message that is rejected on the other end.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #365 (f33043d) into main (7065837) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #365   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          239       239           
  Lines        12888     12884    -4     
=========================================
- Hits         12888     12884    -4     
Impacted Files Coverage Δ
internal/assets/token_pool.go 100.00% <100.00%> (ø)
internal/events/persist_batch.go 100.00% <100.00%> (ø)
internal/orchestrator/data_query.go 100.00% <100.00%> (ø)
internal/orchestrator/subscriptions.go 100.00% <100.00%> (ø)
pkg/fftypes/datatype.go 100.00% <100.00%> (ø)
pkg/fftypes/group.go 100.00% <100.00%> (ø)
pkg/fftypes/message.go 100.00% <100.00%> (ø)
pkg/fftypes/namearray.go 100.00% <100.00%> (ø)
pkg/fftypes/node.go 100.00% <100.00%> (ø)
pkg/fftypes/organization.go 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7065837...f33043d. Read the comment docs.

@awrichar
Copy link
Contributor Author

Looks like on Fabric, we generate an invalid topic name for org broadcasts. Not sure why it was working before - perhaps we're not doing the receiver-side validation of messages when dealing with org broadcasts? Seems like that should be in effect for all messages, including system definitions.

@awrichar
Copy link
Contributor Author

awrichar commented Dec 27, 2021

After further investigation, there are actually a few layers of problems here.

  1. We are ignoring message validation errors in many cases and persisting received messages that failed to validate
  2. We are generating topic names for Fabric root org broadcasts which violate the 64-char max length (and could therefore overflow db columns)
  3. Validation of FF names was extended to disallow UUIDs as names - but there are some cases (such as topic) where a UUID is acceptable, and other cases (such as token pools) where a UUID would cause confusion in a get-by-name-or-id scenario
  4. Topics and tags are not being validated by the sender before sending a message (ie the original issue noted in this PR)

Currently "names" and UUIDs are mutually exclusive in all cases - but this was overly
broad. New behavior is outlined below.

Some "named" objects already have an ID - therefore it's confusing to allow their name to
also be a UUID. These objects still cannot be named with a UUID:
  - organizations
  - nodes
  - groups
  - subscriptions
  - datatypes
  - token pools

For "name" fields that are simple strings, there is no confusion in setting them to a UUID,
and in fact a UUID may be a good choice in some scenarios. These fields can be a UUID:
  - namespaces
  - topics
  - tags

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@awrichar
Copy link
Contributor Author

Pushed additional fixes for the issues noted above. See each commit message for more details.

Copy link
Contributor

@peterbroadhurst peterbroadhurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting this contains a material change, that organizations are now all published on a common ff_organizations topic.

@peterbroadhurst peterbroadhurst merged commit a3b5bd3 into hyperledger:main Dec 29, 2021
@peterbroadhurst peterbroadhurst deleted the seal branch December 29, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants