-
Notifications
You must be signed in to change notification settings - Fork 378
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
Metadata/locked transfer #6880
Metadata/locked transfer #6880
Conversation
60f5974
to
1d3a123
Compare
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.
Looks good! I think most comments I had were actually for my code-contributions :)
You will get some conflicts in the transport (e.g. multicast_raw
was renamed etc.) later on, when you rebase on the merged #6881
raiden/messages/metadata.py
Outdated
return keccak(rlp.encode(self.route)) | ||
return keccak(self._rlp_serialize()) | ||
|
||
def _rlp_serialize(self) -> bytes: |
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.
We should also get the triple check from @ulope for this.
This hash will only be used to verify the message (part of additional_hash
in the contract).
primitive_dict_to_nested_lists( )
constructs deterministically ordered nested lists of key/value tuples, which is the recommended way in rlp to represent dictionaries.
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.
Input from @ulope : just use canonical json seriliasation, package already present because of synapse
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.
This has been implemented now - the signature will not be compatible with older messages containing RouteMetadata
f240ff4
to
c76356b
Compare
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.
Found one location where a refactoring was missed, otherwise looks good.
I would also feel better if someone else would look over the serialisation for the hash.
c76356b
to
047af95
Compare
13d363e
to
677f57e
Compare
raiden/transfer/routes.py
Outdated
) -> List[RouteState]: | ||
"""Given a selected route, returns a filtered route table that | ||
contains only routes using the same forward channel and removes our own | ||
address in the process. | ||
Our address is also removed from the address metadata, if we are not the initiator |
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.
Currently, it would be easier for the receiver note if this would not happen, and we would include our (the senders) address-metadata all the time.
Otherwise the transport would have to inject the user-id (so that this can in turn be memorised in the state
for later creation of send-events that go back to the sender).
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.
Above described behaviour has been implemented
cf97a92
to
4137f78
Compare
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.
Looks good
add marshmallow dataclass union use recipient metadata
fix tests make address metadata optional consistent fixme changes requested fix lint fix lint
fix tests make address metadata optional consistent fixme changes requested fix lint fix lint
add marshmallow dataclass union use recipient metadata
fix tests make address metadata optional consistent fixme changes requested fix lint fix lint
6699425
to
485f3c3
Compare
Ok, something went wrong here - the last commit 485f3c3 is missing the actual code changes and just includes the resulting serialised messages |
Description
Metadata will be fetched from PFS and then forwarded to the
SendLockedTransfer
Event.The metadata for the complete route will be stored in the message in the
Metadata
field as well asrecipient_metadata
will be set.