Skip to content
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

Properly handle remote->local namespace mapping in blockchain plugin #911

Merged
merged 7 commits into from
Jul 28, 2022

Conversation

awrichar
Copy link
Contributor

@awrichar awrichar commented Jul 27, 2022

In the "new world" (network version 2), the blockchain plugin (like other plugins) should only deal with the local namespace name.

For network version 1, the (remote) namespace must be written on chain, so it's necessary to map back and forth from local to remote namespace name within the plugin. This does break the paradigm of keeping namespace mapping at a higher level only, but seems like the cleanest solution for old environments.

Note that this also alters the subscription creation logic for V1 vs. V2. For V1, there will be a shared subscription for all namespaces on a given contract (which is how FireFly 1.0 already behaves - it was changed in #865, but it's actually easiest to keep the old behavior for V1 contracts). For V2+ only, there will be a separate subscription created per namespace.

Includes a basic E2E test for namespace mapping.

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

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #911 (b5e0474) into main (5d68c05) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #911      +/-   ##
==========================================
- Coverage   99.96%   99.83%   -0.14%     
==========================================
  Files         298      299       +1     
  Lines       19452    19527      +75     
==========================================
+ Hits        19445    19494      +49     
- Misses          5       30      +25     
- Partials        2        3       +1     
Impacted Files Coverage Δ
internal/events/event_manager.go 100.00% <ø> (ø)
internal/operations/manager.go 100.00% <ø> (ø)
internal/blockchain/common/common.go 100.00% <100.00%> (ø)
internal/blockchain/ethereum/ethereum.go 100.00% <100.00%> (ø)
internal/blockchain/ethereum/eventstream.go 100.00% <100.00%> (ø)
internal/blockchain/fabric/eventstream.go 100.00% <100.00%> (ø)
internal/blockchain/fabric/fabric.go 100.00% <100.00%> (ø)
internal/dataexchange/ffdx/ffdx.go 100.00% <100.00%> (ø)
internal/events/batch_pin_complete.go 100.00% <100.00%> (ø)
internal/multiparty/manager.go 100.00% <100.00%> (ø)
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@awrichar awrichar force-pushed the mapnamespace branch 2 times, most recently from 8f8b418 to 3601b38 Compare July 27, 2022 17:21
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
This will ensure that not only is FireFly started, the expected namespace
is also ready.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Removes the need for some of the specific variations within each plugin's
tests as well.

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

@shorsher shorsher left a comment

Choose a reason for hiding this comment

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

❤️ PR's with more red. This looks really good.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@awrichar awrichar merged commit 847384c into hyperledger:main Jul 28, 2022
@awrichar awrichar deleted the mapnamespace branch July 28, 2022 13:46
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