-
Notifications
You must be signed in to change notification settings - Fork 657
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
feat: add wasm light client module to feat/wasm-clients branch #3486
feat: add wasm light client module to feat/wasm-clients branch #3486
Conversation
…to feat/wasm-clients
…to feat/wasm-clients
08-wasm: testing improvements
Co-authored-by: Blas Rodriguez Irizar <[email protected]>
…nesis-tests 08-wasm: nit improvements and genesis tests
return consensusState, nil | ||
} | ||
|
||
// ValidateSelfClient validates the client parameters for a client of the running chain | ||
// This function is only used to validate the client state the counterparty stores for this chain | ||
// Client must be in same revision as the executing chain | ||
func (k Keeper) ValidateSelfClient(ctx sdk.Context, clientState exported.ClientState) error { | ||
if clientState.ClientType() == exported.Wasm { |
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 we need the tendermint client state to be in data
instead of directly passing tendermint client state as the 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.
If the client type is 08-wasm
, then the tendermint client state is already in data
. We are unmarshaling the tendermint client state from the wasm client state in order to validate 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.
Won't any other non-tendermint wasm client states just fail here on line 306, which would bubble up the error to connOpenTry?
Am I missing something?
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.
Yes, but this is a self
client state validation. So prior to 08-wasm
, only 07-tendermint
self validation was supported as tendermint consensus was expected with ibc-go. This expands support to include 08-wasm
using tendermint consensus for counterparty chains that need to or want to use 08-wasm
+ a 07-tendermint light client cosmwasm contract
.
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.
Ayy, indeed! Makes sense. We'll definitely need future improvements to ValidateSelfClient
in a world where sdk supports various consensus engines.
nits: address some of the review feedback
docs: update ADR 027
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.
Thank so much for the fantastic work implementing this new light client module, @misko9. 🙏 Thank you also, @damiannolan and @DimitrisJim for the review of the PR and the rest of the team for spending hours also reviewing the code during our internal walkthrough. I will merge now this PR and we will continue with the remaining work on follow-up PRs.
Description
Wasm light client module
This PR adds a new light client to support wasm light client contracts. A chain that would like to use a wasm light client contract would add this module to their app.go. An existing chain will need to add 08-wasm to the allowed clients list. The module will create a wasm vm to run the wasm contracts. New contracts will be submitted through a governance proposal. Once approved, the contract can be used to create any number of clients. Gas consumption for the wasm vm is based off of wasmd's implementation. The bulk of the light client logic is executed in the contract with the module providing the interface and management of the contracts.
IBC spec: https://github.com/cosmos/ibc/tree/main/spec/client/ics-008-wasm-client
Commit Message / Changelog Entry
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.