-
Notifications
You must be signed in to change notification settings - Fork 12
Build a channel #247
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
Build a channel #247
Conversation
b07b59c to
c6ed486
Compare
The insert function should return the previous value. If the value does not exist, it should return None. However, it is returning rlp([]) instead. Since this is the PoC branch, I fixed this temporarily.
Before this commit, serialization/deserialization does not work together. This commit fix it by moving datagram tag in the inner type and flattening it.
In the datagram code, ORDERED is 1 and UNORDERED is 0. In the ChannelOrder type, ORDERED is 0 and UNORDERED is 1. I made the datagram code to use the ChannelOrder type.
c6ed486 to
8878e76
Compare
| counterparty_channel_identifier: channel_identifier.clone(), | ||
| // Note: the array should be reversed in the future where `connection` becomes an array. | ||
| connection_hops: vec![connection.clone()], | ||
| connection_hops: vec![connection_end.counterparty_connection_identifier], |
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.
Note that ICS javascript example uses just connection (given as an argument) here. It's ok not to change if you think this is not important.
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.
Since the word "connection" was used in the channel/manager.rs code for the connection identifier, I used the term "connection_end".
We need a consistent naming rule. What do you prefer? Shall we use connection for the identifier? Shall we use connection for the ConnectionEnd?
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.
Ah, I was misunderstanding something. The name connection is already used in the function parameter, which represents connectionHops in javascript. And I misunderstood that we use previous here.
About your point, yes you're right but I think we can just stick to our convention (connection for id and connection_end for struct).
| Manager { | ||
| ctx, | ||
| } | ||
| } |
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.
What is "Acked-by: Park Juhyung [email protected]" in your commit message? ('Fix connection hop to use the same chain's identifier')
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.
I added it by mistake. I'll remove it.
There was a problem with the ICS spec. The spec was not distinguishing the connection's identifier in the two chains. Since a connection's identifier is different in each chain, we should use the identifier carefully.
Before this commit, we tried to log errors from executing datagram by checking the return value. The '?' operator, however, returns an error immediately. So I made a wrapper function and check errors in the wrapper function.
Before this commit, we should run the relayer after creating light clients. After this commit, we can run the relayer before creating light clients. It will make us to run tests easier.
8878e76 to
56eb390
Compare
I wrote code that builds a channel between two chains.
I found that there is an error while verifying the connection hops. I'll fix it soon after reading the channel spec again.I fixed all the errors.