-
Notifications
You must be signed in to change notification settings - Fork 17
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
Phase 5 #27
Conversation
We're now depending on the basecoin/phase-5-1 branch of ibc-rs, which is basically the master branch with informalsystems/hermes#1711 & informalsystems/hermes#1746 merged. So we can depend on the next release once those two PRs are merged. 👍 |
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.
Overall looks good to me! Just a few questions inline.
I'm glad we have the integration test now - it was quite expensive previously to have to verify the implementation locally on my side 😅 I'm equally glad that the test passes, of course 😁
@@ -284,7 +293,7 @@ impl<S: Default + ProvableStore + 'static> Application for BaseCoinApp<S> { | |||
fn commit(&self) -> ResponseCommit { | |||
let mut modules = self.modules.write().unwrap(); | |||
for m in modules.iter_mut() { | |||
m.commit().expect("failed to commit to state"); | |||
m.store().commit().expect("failed to commit to state"); |
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.
Why do you need to access the module's store at this level? Was it not sufficient to just have the commit()
method on the module itself, and then let the module handle interaction with its store? (Asking for context)
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.
Thanks for reviewing, @thanethomson! 🙏
I replaced the commit()
method with the store()
method because some modules need to share their module stores with gRPC service instances. I am working on a better design for this on the typed-stores
branch - I'll document this in a separate issue.
} | ||
|
||
fn authenticated_capability(&self, _port_id: &PortId) -> Result<Capability, ChannelError> { | ||
todo!() | ||
// TODO(hu55a1n1): Copy SDK impl |
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 interest's sake, what does this entail? I tried poking around in https://github.com/cosmos/ibc-go but couldn't find the corresponding code (haven't spent a huge amount of time reading through it though, so I probably just missed it).
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 was thinking we should do something like this -> https://github.com/cosmos/cosmos-sdk/blob/master/x/capability/keeper/keeper.go#L280
Also, we might need to modify the API on the ibc-rs module side -> https://github.com/informalsystems/ibc-rs/issues/1769
fn get_next_sequence_send( | ||
&self, | ||
_port_channel_id: &(PortId, ChannelId), | ||
port_channel_id: &(PortId, ChannelId), | ||
) -> Result<Sequence, ChannelError> { | ||
todo!() | ||
let path = IbcPath::SeqSends(port_channel_id.0.clone(), port_channel_id.1.clone()); | ||
self.store | ||
.get(Height::Pending, &path.into()) | ||
.map(|v| serde_json::from_str(&String::from_utf8(v).unwrap()).unwrap()) // safety - data on the store is assumed to be well-formed | ||
.ok_or_else(ChannelError::implementation_specific) | ||
} |
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.
Just thinking about packet sequences in general in light of our previous conversation about Tendermint app concurrency, this for me makes me think that reading from/writing to a single channel/port will have to be synchronous, right? I mean, we could still write to multiple channel/port combinations in parallel, but a single channel/port will have to only be accessible from a single thread/coroutine?
Not something actionable right now, of course, just trying to think of the longer-term concurrency implications.
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 is an important observation and we should definitely keep this in mind. In the current design, modules have exclusive write access to their module stores. These stores are shared with the gRPC query services which only require read access. None of the message gRPC services have been implemented yet. So, although module implementations are required to be MT-safe, the module stores are never written in parallel because (AFAIK) tendermint ABCI deliverTx
is never called in parallel.
Implements Phase 5 of informalsystems/hermes#1 - Add support IBC Channel machinery
(Resolves informalsystems/hermes#37)
Testing
basecoin-0
) and two ibc chains (ibc-0
&ibc-1
).ibc-0
andbasecoin-0
->RUST_BACKTRACE=1 hermes create channel basecoin-0 ibc-0 --port-a transfer --port-b transfer