Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

chunk, prod, pss, storage, swarm: trigger trojan chunk sending #2166

Merged
merged 16 commits into from
May 4, 2020

Conversation

santicomp2014
Copy link
Contributor

@santicomp2014 santicomp2014 commented Apr 24, 2020

EXPERIMENTAL
(will not merge to master)


WIP for triggering trojan chunk sending used by implementation for global pinning.

this is invoked after trying to download content and failing, this will be a trigger to start the global pinning lifecycle.

Related issue: #2161

This PR:

  • creates a new prod (recovery package) package for global pinning
  • implements a way to trigger the sending of the trojan chunk; this should happen after failing to download content which the node understands is globally pinned.
  • implemented by a fallback recoveryHook in netstore (similar to deliveryHook)
  • should use feed-base retrieval but this maybe branch off into a separate PR.
    • sending should be done first with the hooks with a const target list hardwired in recovery package first
  • then it could be replaced with feed-based implementation

Remove TODOs for deprecated code after iteration

@santicomp2014 santicomp2014 added global pinning experimental implementation of global pinning builds on open PR Builds on a PR that is not yet merged. It is blocked until then and the diff won't make sense yet. in progress labels Apr 24, 2020
@mortelli mortelli mentioned this pull request Apr 24, 2020
6 tasks
@mortelli mortelli removed the builds on open PR Builds on a PR that is not yet merged. It is blocked until then and the diff won't make sense yet. label Apr 27, 2020
@@ -99,6 +100,7 @@ type NetStore struct {
requestGroup singleflight.Group
RemoteGet RemoteGetFunc
logger log.Logger
prod *prod.Prod
Copy link
Member

Choose a reason for hiding this comment

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

No, the dependency is the other way round more natural.
Here i would assign a function or if you insist, an interface with
Recover method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was changed to be similar to Deliver hook.
This was one of the reasons there was an import cycle error.

@santicomp2014 santicomp2014 marked this pull request as ready for review April 30, 2020 17:20
@santicomp2014 santicomp2014 requested review from zelig and mortelli April 30, 2020 17:20
Copy link
Member

@zelig zelig left a comment

Choose a reason for hiding this comment

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

i think this is done no?

Copy link
Contributor

@mortelli mortelli left a comment

Choose a reason for hiding this comment

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

very nice job on the TestSenderCall func 👏

i think this needs just one more iteration and we're good to go 👍

prod/prod.go Outdated Show resolved Hide resolved
prod/prod.go Show resolved Hide resolved
prod/prod.go Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
…n prod tests, refactored methods common methods in pss/prod testing, added comments for deliver and recover callbacks in respective fields
Copy link
Contributor Author

@santicomp2014 santicomp2014 left a comment

Choose a reason for hiding this comment

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

I addressed all the comments.
Thanks for the feedback

prod/prod.go Outdated Show resolved Hide resolved
prod/prod.go Show resolved Hide resolved
prod/prod.go Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
storage/netstore.go Outdated Show resolved Hide resolved
storage/netstore.go Outdated Show resolved Hide resolved
storage/netstore.go Outdated Show resolved Hide resolved
storage/netstore.go Outdated Show resolved Hide resolved
storage/netstore.go Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
prod/prod_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mortelli mortelli left a comment

Choose a reason for hiding this comment

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

good stuff! thank you for addressing everything.

@santicomp2014 santicomp2014 merged commit cef5587 into global-pinning May 4, 2020
@mortelli mortelli deleted the global-pinning-trigger-trojanchunk branch May 4, 2020 19:10
@mortelli mortelli changed the title trigger trojan chunk sending chunk, prod, pss, storage, swarm: trigger trojan chunk sending Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
global pinning experimental implementation of global pinning ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants