-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fluffy: Implement poke in state network #2750
base: master
Are you sure you want to change the base?
Conversation
Leaving this as a draft PR until the specs are updated |
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.
lgtm but would wait with merging until accepted in specs first.
fluffy/rpc/rpc_portal_state_api.nim
Outdated
rpcServer.rpc("portal_stateGetContent") do( | ||
contentKey: string, parentContent: Opt[string] | ||
) -> ContentInfo: |
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.
For a user this API does complicate things. Feels like the "health" of the network should not be pushed towards the UX of user API. But perhaps its ok as an Opt
...
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.
Actually I agree and for this reason I didn't propose changing the JSON-RPC spec to add this in my other PR. I'm planning to revert this part but I'll wait to see what happens with the spec changes first.
Poke in the state network is feasible by passing in the parent offer when looking up content. The fetched state content is then combined with the parent offer to build the offer which is used in the poke.
I'm going to suggest that poke is added to the state network specs because I can't see any reason for it to be disabled after implementing this change.
I've also added poke to the stateGetContent JSON-RPC method by supporting an optional parentContent parameter which should contain the parent offer which is required in order to enable poke.