Skip to content

Conversation

@awrichar
Copy link
Contributor

When enabled, FireFly will post to /api/v1/init on the DX connector with a list of all current nodes,
before initial connect of the websocket and before each reconnect.

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2022

Codecov Report

Merging #507 (0dd54d4) into main (60e00ff) will decrease coverage by 0.01%.
The diff coverage is 96.49%.

❗ Current head 0dd54d4 differs from pull request most recent head 7b837b1. Consider uploading reports for the commit 7b837b1 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##              main     #507      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files          267      275       +8     
  Lines        15270    15725     +455     
===========================================
+ Hits         15270    15723     +453     
- Misses           0        1       +1     
- Partials         0        1       +1     
Impacted Files Coverage Δ
internal/blockchain/ethereum/ethereum.go 100.00% <ø> (ø)
internal/dataexchange/ffdx/ffdx.go 98.81% <92.30%> (-1.19%) ⬇️
internal/blockchain/fabric/fabric.go 100.00% <100.00%> (ø)
internal/dataexchange/ffdx/config.go 100.00% <100.00%> (ø)
...nal/definitions/definition_handler_network_node.go 100.00% <100.00%> (ø)
internal/networkmap/register_node.go 100.00% <100.00%> (ø)
internal/orchestrator/orchestrator.go 100.00% <100.00%> (ø)
internal/tokens/fftokens/fftokens.go 100.00% <100.00%> (ø)
pkg/wsclient/wsclient.go 100.00% <100.00%> (ø)
internal/assets/manager.go 100.00% <0.00%> (ø)
... and 25 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 60e00ff...7b837b1. Read the comment docs.

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

Not sure why coverage is showing a drop in dxhttps, as that file was previously removed.

Also @peterbroadhurst identified an additional follow-on, in that the plugin should specifically reject all requests during the window that it is disconnected from the websocket (to avoid sending a request to a non-initialized DX). Can be added here or done as a new PR.

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.

Would like to get your spelling thoughts before we merge @awrichar
However, the code looks great

// DataExchangeManifestEnabled determines whether to require+validate a manifest from other DX instances in the network. Must be supported by the connector
DataExchangeManifestEnabled = "manifestEnabled"
// DataExchangeReInitEnabled instructs FireFly to always post all current nodes to the /init API before connecting or reconnecting to the connector
DataExchangeReInitEnabled = "reInitEnabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be initEnabled - as you should always set this whenever you have a ffdx plugin that supports init. So we don't need to indicate the re (which is a bit confusing)

Copy link
Contributor

Choose a reason for hiding this comment

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

Another spelling could be:
"apiVersion": "1.1"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think initEnabled is appropriate. Personally I think it should be independently toggleable regardless of the plugin version.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
return false, i18n.NewError(w.ctx, i18n.MsgWSClosing)
}

retry = !initial || attempt < w.initialRetryAttempts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Want to highlight since it's not obvious in the diff - the logic around initialRetryAttempts appears to have been broken in the original code (so that it would only try once to connect on startup before failing). It's tangential to the bulk of the changes in this PR, but it should be working now (with unit test added to demonstrate).

@awrichar awrichar changed the title Add "reInitEnabled" config to DX Add "initEnabled" config to DX Feb 11, 2022
Only requests that may rely on an updated list of peers are blocked.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
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.

👍

@peterbroadhurst peterbroadhurst merged commit df3d441 into hyperledger:main Feb 11, 2022
@peterbroadhurst peterbroadhurst deleted the dxinit branch February 11, 2022 21:21
@gabriel-indik gabriel-indik linked an issue Feb 17, 2022 that may be closed by this pull request
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.

Data Exchange - FireFly initialization change

3 participants