Skip to content
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

Custom proof specs in config #1574

Merged
merged 23 commits into from
Nov 25, 2021
Merged

Custom proof specs in config #1574

merged 23 commits into from
Nov 25, 2021

Conversation

hu55a1n1
Copy link
Member

@hu55a1n1 hu55a1n1 commented Nov 17, 2021

Closes: cosmos/ibc-rs#67

Description

Proof specs are currently read as JSON serialized TOML strings from the config. Serialize/Deserialize are derived on the ibc_proto::ics23 types.


For contributor use:

  • Added a changelog entry, using unclog.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@hu55a1n1 hu55a1n1 force-pushed the hu55a1n1/1561-custom-proof-specs branch from 2ab53cf to 3873c11 Compare November 19, 2021 09:20
@@ -1,6 +1,7 @@
use crate::prelude::*;
use ibc_proto::ics23::ProofSpec as ProtoProofSpec;
use ics23::ProofSpec;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI, with regard to #853 - this file (i.e. modules/src/core/ics23_commitment/specs.rs) is the only place where we use the ics23 crate. We only use it to get the definitions for the proof-specs for cosmos and to provide convert::From impls for our domain type (i.e. ProofSpecs). For all other cases, we use the ibc_proto::ics23 defs because we need to derive serde and other traits for these types.

@hu55a1n1 hu55a1n1 marked this pull request as ready for review November 19, 2021 11:20
@hu55a1n1 hu55a1n1 requested a review from romac November 19, 2021 17:21
@hu55a1n1 hu55a1n1 added this to the v0.9.1 milestone Nov 23, 2021
@romac romac self-assigned this Nov 24, 2021
proto/Cargo.toml Outdated Show resolved Hide resolved
relayer/src/config.rs Outdated Show resolved Hide resolved
modules/src/core/ics23_commitment/specs.rs Outdated Show resolved Hide resolved
proto/Cargo.toml Outdated Show resolved Hide resolved
relayer/src/config.rs Outdated Show resolved Hide resolved
@romac romac merged commit 46fedfb into master Nov 25, 2021
@romac romac deleted the hu55a1n1/1561-custom-proof-specs branch November 25, 2021 09:00
@@ -223,6 +223,60 @@ memo_prefix = ''
# ['transfer', 'channel-0'],
# ]

# Specify custom ICS23 proof-specs for the chain (serialized as JSON).
# Default: [`ProofSpecs::cosmos()`](modules/src/core/ics23_commitment/specs.rs)
proof-specs = '''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more operator-friendly manner to specify this? I tried to give an alternative suggestion in #1630 .

hu55a1n1 added a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Impl serde for ics23 proto types

* Add proof specs to client state

* Get proof specs from chain config

* Fix test compilation

* Define ProofSpecs domain type using ibc_proto::ics23 types

* Minor refactoring

* Add attrs for ics23 protos in proto-compiler

* Fix clippy errors

* Refactor Tendermint  to use domain type

* Parse config proofspecs as JSON serialized string

* Add Default impl for ProofSpecs

* Use serde(with) instead of newtype

* Get rid of unwraps

* Fix failing test

* Document proof-specs opt in config

* Minor refactoring to match style

* Create .changelog entry

* Serialilze ProofSpecs as a pretty formatted JSON string

* Set serde dep version to '1'

* Manually implement conversions b/w ProofSpec protos

* Disallow empty proof-specs

* Move custom serde serializer to its own module

Co-authored-by: Romain Ruetschi <romain@informal.systems>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to specify ProofSpecs for non-SDK chains
4 participants