Skip to content

Commit 107bd49

Browse files
feat: add merkle tree address to message program outputs (#326)
* feat: add merkle tree address to message program outputs * chore: deference address correctly to satisfy compiler * tests passing * update vkeys * update sha tag for celestia-app * update events.proto * use Address type for contract * tested and good to go --------- Co-authored-by: jonas089 <jonaspauli089@gmail.com>
1 parent 927364f commit 107bd49

File tree

15 files changed

+58
-262
lines changed

15 files changed

+58
-262
lines changed

crates/celestia-grpc-client/proto/celestia/zkism/v1/events.proto

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ message EventCreateInterchainSecurityModule {
2020
string owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
2121
// latest state
2222
string state = 3;
23+
// merkle tree address in bytes32 format
24+
string merkle_tree_address = 4;
2325
// the sp1 groth16 verifier key (hex-encoded)
24-
string groth16_vkey = 4;
26+
string groth16_vkey = 5;
2527
// hash-based commitment to the verifier key used for state transition (hex-encoded)
26-
string state_transition_vkey = 5;
28+
string state_transition_vkey = 6;
2729
// hash-based commitment to the verifier key used for state membership (hex-encoded)
28-
string state_membership_vkey = 6;
30+
string state_membership_vkey = 7;
2931
}
3032

3133
// EventUpdateInterchainSecurityModule defines the event type emitted when updating a InterchainSecurityModule.

crates/celestia-grpc-client/proto/celestia/zkism/v1/genesis.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ message GenesisState {
1212
// list of zk execution isms.
1313
repeated InterchainSecurityModule isms = 1 [(gogoproto.nullable) = false];
1414
// TODO: add messages to genesis state
15-
// params is the module parameters.
16-
Params params = 2 [(gogoproto.nullable) = false];
1715
}

crates/celestia-grpc-client/proto/celestia/zkism/v1/query.proto

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ service Query {
2020
rpc Isms(QueryIsmsRequest) returns (QueryIsmsResponse) {
2121
option (google.api.http).get = "/celestia/zkism/v1/isms";
2222
}
23-
24-
// Params defines an rpc method for querying the module parameters.
25-
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
26-
option (google.api.http).get = "/celestia/zkism/v1/params";
27-
}
2823
}
2924

3025
// QueryIsmRequest is the request type for the Ism rpc method.
@@ -50,12 +45,3 @@ message QueryIsmsResponse {
5045
// pagination defines the pagination in the response.
5146
cosmos.base.query.v1beta1.PageResponse pagination = 2;
5247
}
53-
54-
// QueryParamsRequest is the request type for the Params rpc method.
55-
message QueryParamsRequest {}
56-
57-
// QueryParamsResponse is the response type for the Params rpc method.
58-
message QueryParamsResponse {
59-
// params contains the module parameters
60-
Params params = 1 [(gogoproto.nullable) = false];
61-
}

crates/celestia-grpc-client/proto/celestia/zkism/v1/tx.proto

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ syntax = "proto3";
22

33
package celestia.zkism.v1;
44

5-
import "celestia/zkism/v1/types.proto";
65
import "cosmos/msg/v1/msg.proto";
7-
import "cosmos_proto/cosmos.proto";
86
import "gogoproto/gogo.proto";
97

108
option go_package = "github.com/celestiaorg/celestia-app/x/zkism/types";
@@ -14,16 +12,15 @@ service Msg {
1412
option (cosmos.msg.v1.service) = true;
1513

1614
// CreateInterchainSecurityModule defines the rpc method for creating a new zk ISM.
17-
rpc CreateInterchainSecurityModule(MsgCreateInterchainSecurityModule) returns (MsgCreateInterchainSecurityModuleResponse);
15+
rpc CreateInterchainSecurityModule(MsgCreateInterchainSecurityModule)
16+
returns (MsgCreateInterchainSecurityModuleResponse);
1817

1918
// UpdateInterchainSecurityModule defines the rpc method for updating an existing zk ISM.
20-
rpc UpdateInterchainSecurityModule(MsgUpdateInterchainSecurityModule) returns (MsgUpdateInterchainSecurityModuleResponse);
19+
rpc UpdateInterchainSecurityModule(MsgUpdateInterchainSecurityModule)
20+
returns (MsgUpdateInterchainSecurityModuleResponse);
2121

2222
// SubmitMessages defines the rpc method for verifying state membership of messages.
2323
rpc SubmitMessages(MsgSubmitMessages) returns (MsgSubmitMessagesResponse);
24-
25-
// UpdateParams defines the rpc method for updating the module parameters.
26-
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
2724
}
2825

2926
// MsgCreateInterchainSecurityModule is the request type for CreateInterchainSecurityModule.
@@ -33,12 +30,14 @@ message MsgCreateInterchainSecurityModule {
3330
string creator = 1;
3431
// initial trusted state
3532
bytes state = 2;
33+
// merkle tree address in byte32 format
34+
bytes merkle_tree_address = 3;
3635
// the sp1 groth16 verifier key
37-
bytes groth16_vkey = 3;
36+
bytes groth16_vkey = 4;
3837
// hash-based commitment to the verifier key used for state transition
39-
bytes state_transition_vkey = 4;
38+
bytes state_transition_vkey = 5;
4039
// hash-based commitment to the verifier key used for state membership
41-
bytes state_membership_vkey = 5;
40+
bytes state_membership_vkey = 6;
4241
}
4342

4443
// MsgCreateInterchainSecurityModuleResponse is the response type for CreateInterchainSecurityModule.
@@ -93,18 +92,3 @@ message MsgSubmitMessages {
9392

9493
// MsgSubmitMessagesResponse is the response type for SubmitMessages.
9594
message MsgSubmitMessagesResponse {}
96-
97-
// MsgUpdateParams is the request type for UpdateParams.
98-
message MsgUpdateParams {
99-
option (cosmos.msg.v1.signer) = "authority";
100-
101-
// authority is the address that controls the module (defaults to x/gov unless overwritten).
102-
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
103-
// params defines the x/zkism parameters to update.
104-
//
105-
// NOTE: All parameters must be supplied.
106-
Params params = 2 [(gogoproto.nullable) = false];
107-
};
108-
109-
// MsgUpdateParamsResponse defines the response type for UpdateParams.
110-
message MsgUpdateParamsResponse {};

crates/celestia-grpc-client/proto/celestia/zkism/v1/types.proto

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,14 @@ message InterchainSecurityModule {
1818
];
1919
// the owner or creator of the ism
2020
string owner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
21-
// current state
21+
// current state
2222
bytes state = 3;
23+
// merkle tree address in bytes32 format
24+
bytes merkle_tree_address = 4;
2325
// the sp1 groth16 verifier key
24-
bytes groth16_vkey = 4;
26+
bytes groth16_vkey = 5;
2527
// hash-based commitment to the verifier key used for state transition
26-
bytes state_transition_vkey = 5;
28+
bytes state_transition_vkey = 6;
2729
// hash-based commitment to the verifier key used for state membership
28-
bytes state_membership_vkey = 6;
29-
}
30-
31-
// Params defines the zk ism module parameters.
32-
message Params {
33-
option (gogoproto.goproto_getters) = false;
34-
35-
uint32 max_header_hashes = 1;
30+
bytes state_membership_vkey = 7;
3631
}

crates/celestia-grpc-client/src/proto/celestia.zkism.v1.rs

Lines changed: 21 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ pub struct EventCreateInterchainSecurityModule {
1313
/// latest state
1414
#[prost(string, tag="3")]
1515
pub state: ::prost::alloc::string::String,
16-
/// the sp1 groth16 verifier key (hex-encoded)
16+
/// merkle tree address in bytes32 format
1717
#[prost(string, tag="4")]
18+
pub merkle_tree_address: ::prost::alloc::string::String,
19+
/// the sp1 groth16 verifier key (hex-encoded)
20+
#[prost(string, tag="5")]
1821
pub groth16_vkey: ::prost::alloc::string::String,
1922
/// hash-based commitment to the verifier key used for state transition (hex-encoded)
20-
#[prost(string, tag="5")]
23+
#[prost(string, tag="6")]
2124
pub state_transition_vkey: ::prost::alloc::string::String,
2225
/// hash-based commitment to the verifier key used for state membership (hex-encoded)
23-
#[prost(string, tag="6")]
26+
#[prost(string, tag="7")]
2427
pub state_membership_vkey: ::prost::alloc::string::String,
2528
}
2629
/// EventUpdateInterchainSecurityModule defines the event type emitted when updating a InterchainSecurityModule.
@@ -58,37 +61,31 @@ pub struct InterchainSecurityModule {
5861
/// the owner or creator of the ism
5962
#[prost(string, tag="2")]
6063
pub owner: ::prost::alloc::string::String,
61-
/// current state
64+
/// current state
6265
#[prost(bytes="vec", tag="3")]
6366
pub state: ::prost::alloc::vec::Vec<u8>,
64-
/// the sp1 groth16 verifier key
67+
/// merkle tree address in bytes32 format
6568
#[prost(bytes="vec", tag="4")]
69+
pub merkle_tree_address: ::prost::alloc::vec::Vec<u8>,
70+
/// the sp1 groth16 verifier key
71+
#[prost(bytes="vec", tag="5")]
6672
pub groth16_vkey: ::prost::alloc::vec::Vec<u8>,
6773
/// hash-based commitment to the verifier key used for state transition
68-
#[prost(bytes="vec", tag="5")]
74+
#[prost(bytes="vec", tag="6")]
6975
pub state_transition_vkey: ::prost::alloc::vec::Vec<u8>,
7076
/// hash-based commitment to the verifier key used for state membership
71-
#[prost(bytes="vec", tag="6")]
77+
#[prost(bytes="vec", tag="7")]
7278
pub state_membership_vkey: ::prost::alloc::vec::Vec<u8>,
7379
}
74-
/// Params defines the zk ism module parameters.
75-
#[allow(clippy::derive_partial_eq_without_eq)]
76-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
77-
pub struct Params {
78-
#[prost(uint32, tag="1")]
79-
pub max_header_hashes: u32,
80-
}
8180
/// GenesisState defines the zkism module's genesis state.
8281
#[allow(clippy::derive_partial_eq_without_eq)]
8382
#[derive(Clone, PartialEq, ::prost::Message)]
8483
pub struct GenesisState {
8584
/// list of zk execution isms.
85+
///
86+
/// TODO: add messages to genesis state
8687
#[prost(message, repeated, tag="1")]
8788
pub isms: ::prost::alloc::vec::Vec<InterchainSecurityModule>,
88-
/// TODO: add messages to genesis state
89-
/// params is the module parameters.
90-
#[prost(message, optional, tag="2")]
91-
pub params: ::core::option::Option<Params>,
9289
}
9390
/// QueryIsmRequest is the request type for the Ism rpc method.
9491
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -123,19 +120,6 @@ pub struct QueryIsmsResponse {
123120
#[prost(message, optional, tag="2")]
124121
pub pagination: ::core::option::Option<super::super::super::cosmos::base::query::v1beta1::PageResponse>,
125122
}
126-
/// QueryParamsRequest is the request type for the Params rpc method.
127-
#[allow(clippy::derive_partial_eq_without_eq)]
128-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
129-
pub struct QueryParamsRequest {
130-
}
131-
/// QueryParamsResponse is the response type for the Params rpc method.
132-
#[allow(clippy::derive_partial_eq_without_eq)]
133-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
134-
pub struct QueryParamsResponse {
135-
/// params contains the module parameters
136-
#[prost(message, optional, tag="1")]
137-
pub params: ::core::option::Option<Params>,
138-
}
139123
/// MsgCreateInterchainSecurityModule is the request type for CreateInterchainSecurityModule.
140124
#[allow(clippy::derive_partial_eq_without_eq)]
141125
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -146,14 +130,17 @@ pub struct MsgCreateInterchainSecurityModule {
146130
/// initial trusted state
147131
#[prost(bytes="vec", tag="2")]
148132
pub state: ::prost::alloc::vec::Vec<u8>,
149-
/// the sp1 groth16 verifier key
133+
/// merkle tree address in byte32 format
150134
#[prost(bytes="vec", tag="3")]
135+
pub merkle_tree_address: ::prost::alloc::vec::Vec<u8>,
136+
/// the sp1 groth16 verifier key
137+
#[prost(bytes="vec", tag="4")]
151138
pub groth16_vkey: ::prost::alloc::vec::Vec<u8>,
152139
/// hash-based commitment to the verifier key used for state transition
153-
#[prost(bytes="vec", tag="4")]
140+
#[prost(bytes="vec", tag="5")]
154141
pub state_transition_vkey: ::prost::alloc::vec::Vec<u8>,
155142
/// hash-based commitment to the verifier key used for state membership
156-
#[prost(bytes="vec", tag="5")]
143+
#[prost(bytes="vec", tag="6")]
157144
pub state_membership_vkey: ::prost::alloc::vec::Vec<u8>,
158145
}
159146
/// MsgCreateInterchainSecurityModuleResponse is the response type for CreateInterchainSecurityModule.
@@ -213,23 +200,5 @@ pub struct MsgSubmitMessages {
213200
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
214201
pub struct MsgSubmitMessagesResponse {
215202
}
216-
/// MsgUpdateParams is the request type for UpdateParams.
217-
#[allow(clippy::derive_partial_eq_without_eq)]
218-
#[derive(Clone, PartialEq, ::prost::Message)]
219-
pub struct MsgUpdateParams {
220-
/// authority is the address that controls the module (defaults to x/gov unless overwritten).
221-
#[prost(string, tag="1")]
222-
pub authority: ::prost::alloc::string::String,
223-
/// params defines the x/zkism parameters to update.
224-
///
225-
/// NOTE: All parameters must be supplied.
226-
#[prost(message, optional, tag="2")]
227-
pub params: ::core::option::Option<Params>,
228-
}
229-
/// MsgUpdateParamsResponse defines the response type for UpdateParams.
230-
#[allow(clippy::derive_partial_eq_without_eq)]
231-
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
232-
pub struct MsgUpdateParamsResponse {
233-
}
234203
include!("celestia.zkism.v1.tonic.rs");
235204
// @@protoc_insertion_point(module)

0 commit comments

Comments
 (0)