-
Notifications
You must be signed in to change notification settings - Fork 529
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
Bitswap: rename deleteXX
to removeXX
, add tag to IPC
#16072
Conversation
!ci-build-me |
@@ -332,7 +332,7 @@ struct Libp2pHelperInterface { | |||
result @1 :ValidationResult; | |||
} | |||
|
|||
struct DeleteResource { | |||
struct RemoveResource { |
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.
A bit odd that we use tag below but not here, do you have an answer why?
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.
tag is a bit opaque I agree, it is mainly used in the mina net 2 library. The purpose seems to be to detect the type of body to sync. For example you may have a different action enabled for downloading epoch ledger vs block.
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.
UPD tag is part of encoded data, and root block id is hash of something derived from that data.
I.e. tag is sometimes provided to API for purposes of differentiating which function to use for the data. But for removal it isn't needed, data is perfectly referenced by the root block id alone.
@@ -52,14 +52,14 @@ func extractRootBlockList(l ipc.RootBlockId_List) ([]root, error) { | |||
return ids, nil | |||
} | |||
|
|||
func (m DeleteResourcePush) handle(app *app) { | |||
idsM, err := DeleteResourcePushT(m).Ids() | |||
func (m RemoveResourcePush) handle(app *app) { |
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.
Is the delete to remove name change just for the sake of better names or there is a more explicit reason behind int?
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.
it looks like a name change for the sake of a better name; i haven't found a collision with the previous name
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-nightly-me |
@@ -332,7 +332,7 @@ struct Libp2pHelperInterface { | |||
result @1 :ValidationResult; | |||
} | |||
|
|||
struct DeleteResource { | |||
struct RemoveResource { |
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.
UPD tag is part of encoded data, and root block id is hash of something derived from that data.
I.e. tag is sometimes provided to API for purposes of differentiating which function to use for the data. But for removal it isn't needed, data is perfectly referenced by the root block id alone.
deleteXX
to removeXX
, extend api of libp2p ipc
deleteXX
to removeXX
, extend api of libp2p ipcdeleteXX
to removeXX
, extend api of libp2p ipc
609c254
to
b2796f7
Compare
Fix sending resource update to provide tag accourding to the new Capnproto interface.
deleteXX
to removeXX
, extend api of libp2p ipcdeleteXX
to removeXX
, add tag to IPC
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.
Extended scope of PR: addition of tag implied that mkResourceUpdatedUpcall
became incorrectly implemented.
I believe we need to bundle two updates together
Explain the implementation and extract some code out of the function for better readability.
!ci-build-me |
!ci-build-me |
This PR renames a number of methods with names
deleteXX
toremoveXX
.It also adds a functions
create_download_resource_push_message
andcreate_remove_resource_push_message
that will later be used for organization of IPC between Ocaml's bit-catchup algrotihm code and Libp2p's functions exposing Biytswap functionality.