Skip to content

Commit 4bf9bee

Browse files
fix(ibc-union): unused relayer in connection handshake callbacks
1 parent 819ce14 commit 4bf9bee

File tree

8 files changed

+22
-75
lines changed

8 files changed

+22
-75
lines changed

cosmwasm/ibc-union/core/msg/src/msg.rs

-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ pub struct MsgUpdateClient {
7171
pub struct MsgConnectionOpenInit {
7272
pub client_id: ClientId,
7373
pub counterparty_client_id: ClientId,
74-
pub relayer: String,
7574
}
7675

7776
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@@ -82,7 +81,6 @@ pub struct MsgConnectionOpenTry {
8281
pub client_id: ClientId,
8382
pub proof_init: Bytes,
8483
pub proof_height: u64,
85-
pub relayer: String,
8684
}
8785

8886
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@@ -92,7 +90,6 @@ pub struct MsgConnectionOpenAck {
9290
pub counterparty_connection_id: ConnectionId,
9391
pub proof_try: Bytes,
9492
pub proof_height: u64,
95-
pub relayer: String,
9693
}
9794

9895
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@@ -101,7 +98,6 @@ pub struct MsgConnectionOpenConfirm {
10198
pub connection_id: ConnectionId,
10299
pub proof_ack: Bytes,
103100
pub proof_height: u64,
104-
pub relayer: String,
105101
}
106102

107103
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]

cosmwasm/ibc-union/core/src/contract.rs

+22-45
Original file line numberDiff line numberDiff line change
@@ -191,62 +191,43 @@ pub fn execute(
191191
ExecuteMsg::ConnectionOpenInit(MsgConnectionOpenInit {
192192
client_id,
193193
counterparty_client_id,
194-
relayer,
195-
}) => {
196-
let relayer = deps.api.addr_validate(&relayer)?;
197-
connection_open_init(deps.branch(), client_id, counterparty_client_id, relayer)
198-
}
194+
}) => connection_open_init(deps.branch(), client_id, counterparty_client_id),
199195
ExecuteMsg::ConnectionOpenTry(MsgConnectionOpenTry {
200196
counterparty_client_id,
201197
counterparty_connection_id,
202198
client_id,
203199
proof_init,
204200
proof_height,
205-
relayer,
206-
}) => {
207-
let relayer = deps.api.addr_validate(&relayer)?;
208-
connection_open_try(
209-
deps.branch(),
210-
counterparty_client_id,
211-
counterparty_connection_id,
212-
client_id,
213-
proof_init.to_vec(),
214-
proof_height,
215-
relayer,
216-
)
217-
}
201+
}) => connection_open_try(
202+
deps.branch(),
203+
counterparty_client_id,
204+
counterparty_connection_id,
205+
client_id,
206+
proof_init.to_vec(),
207+
proof_height,
208+
),
218209
ExecuteMsg::ConnectionOpenAck(MsgConnectionOpenAck {
219210
connection_id,
220211
counterparty_connection_id,
221212
proof_try,
222213
proof_height,
223-
relayer,
224-
}) => {
225-
let relayer = deps.api.addr_validate(&relayer)?;
226-
connection_open_ack(
227-
deps.branch(),
228-
connection_id,
229-
counterparty_connection_id,
230-
proof_try.to_vec(),
231-
proof_height,
232-
relayer,
233-
)
234-
}
214+
}) => connection_open_ack(
215+
deps.branch(),
216+
connection_id,
217+
counterparty_connection_id,
218+
proof_try.to_vec(),
219+
proof_height,
220+
),
235221
ExecuteMsg::ConnectionOpenConfirm(MsgConnectionOpenConfirm {
236222
connection_id,
237223
proof_ack,
238224
proof_height,
239-
relayer,
240-
}) => {
241-
let relayer = deps.api.addr_validate(&relayer)?;
242-
connection_open_confirm(
243-
deps.branch(),
244-
connection_id,
245-
proof_ack.to_vec(),
246-
proof_height,
247-
relayer,
248-
)
249-
}
225+
}) => connection_open_confirm(
226+
deps.branch(),
227+
connection_id,
228+
proof_ack.to_vec(),
229+
proof_height,
230+
),
250231
ExecuteMsg::ChannelOpenInit(MsgChannelOpenInit {
251232
port_id,
252233
counterparty_port_id,
@@ -916,7 +897,6 @@ fn connection_open_init(
916897
mut deps: DepsMut,
917898
client_id: ClientId,
918899
counterparty_client_id: ClientId,
919-
_relayer: Addr,
920900
) -> ContractResult {
921901
let connection_id = next_connection_id(deps.branch())?;
922902
let connection = Connection {
@@ -945,7 +925,6 @@ fn connection_open_try(
945925
client_id: ClientId,
946926
proof_init: Vec<u8>,
947927
proof_height: u64,
948-
_relayer: Addr,
949928
) -> ContractResult {
950929
let connection_id = next_connection_id(deps.branch())?;
951930
let connection = Connection {
@@ -1001,7 +980,6 @@ fn connection_open_ack(
1001980
counterparty_connection_id: ConnectionId,
1002981
proof_try: Vec<u8>,
1003982
proof_height: u64,
1004-
_relayer: Addr,
1005983
) -> ContractResult {
1006984
let mut connection = deps.storage.read::<Connections>(&connection_id)?;
1007985
if connection.state != ConnectionState::Init {
@@ -1059,7 +1037,6 @@ fn connection_open_confirm(
10591037
connection_id: ConnectionId,
10601038
proof_ack: Vec<u8>,
10611039
proof_height: u64,
1062-
_relayer: Addr,
10631040
) -> ContractResult {
10641041
let mut connection = deps.storage.read::<Connections>(&connection_id)?;
10651042
if connection.state != ConnectionState::TryOpen {

cosmwasm/ibc-union/core/src/tests.rs

-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ fn connection_open_init(deps: DepsMut) -> Result<Response, ContractError> {
7474
let msg = MsgConnectionOpenInit {
7575
client_id: ClientId!(1),
7676
counterparty_client_id: ClientId!(2),
77-
relayer: mock_addr(RELAYER).into_string(),
7877
};
7978
execute(
8079
deps,
@@ -91,7 +90,6 @@ fn connection_open_try(deps: DepsMut) -> Result<Response, ContractError> {
9190
client_id: ClientId!(1),
9291
proof_init: vec![1, 2, 3].into(),
9392
proof_height: 1,
94-
relayer: mock_addr(RELAYER).into_string(),
9593
};
9694

9795
execute(
@@ -107,7 +105,6 @@ fn connection_open_confirm(deps: DepsMut) -> Result<Response, ContractError> {
107105
connection_id: ConnectionId!(1),
108106
proof_ack: vec![1, 2, 3].into(),
109107
proof_height: 1,
110-
relayer: mock_addr(RELAYER).into_string(),
111108
};
112109

113110
execute(

cosmwasm/ibc-union/core/src/tests/connection/ibc.rs

-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ fn connection_open_init_ok() {
3333
let msg = MsgConnectionOpenInit {
3434
client_id: ClientId!(1),
3535
counterparty_client_id: ClientId!(2),
36-
relayer: mock_addr(RELAYER).into_string(),
3736
};
3837
assert!(execute(
3938
deps.as_mut(),
@@ -99,7 +98,6 @@ fn connection_open_try_ok() {
9998
client_id: ClientId!(1),
10099
proof_init: vec![1, 2, 3].into(),
101100
proof_height: 1,
102-
relayer: mock_addr(RELAYER).into_string(),
103101
};
104102

105103
assert!(execute(
@@ -135,7 +133,6 @@ fn connection_open_try_client_not_found() {
135133
client_id: ClientId!(1),
136134
proof_init: vec![1, 2, 3].into(),
137135
proof_height: 1,
138-
relayer: mock_addr(RELAYER).into_string(),
139136
};
140137

141138
assert_eq!(
@@ -181,7 +178,6 @@ fn connection_open_try_commitment_saved() {
181178
client_id: ClientId!(1),
182179
proof_init: vec![1, 2, 3].into(),
183180
proof_height: 1,
184-
relayer: mock_addr(RELAYER).into_string(),
185181
};
186182

187183
execute(
@@ -228,7 +224,6 @@ fn connection_open_ack_ok() {
228224
counterparty_connection_id: ConnectionId!(1),
229225
proof_try: vec![1, 2, 3].into(),
230226
proof_height: 1,
231-
relayer: mock_addr(RELAYER).into_string(),
232227
};
233228

234229
assert!(execute(
@@ -270,7 +265,6 @@ fn connection_open_ack_commitment_saved() {
270265
counterparty_connection_id: ConnectionId!(1),
271266
proof_try: vec![1, 2, 3].into(),
272267
proof_height: 1,
273-
relayer: mock_addr(RELAYER).into_string(),
274268
};
275269

276270
execute(
@@ -316,7 +310,6 @@ fn connection_open_confirm_ok() {
316310
connection_id: ConnectionId!(1),
317311
proof_ack: vec![1, 2, 3].into(),
318312
proof_height: 1,
319-
relayer: mock_addr(RELAYER).into_string(),
320313
};
321314

322315
assert!(execute(

evm/contracts/core/25-handler/IBCMsgs.sol

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ library IBCMsgs {
2222
struct MsgConnectionOpenInit {
2323
uint32 clientId;
2424
uint32 counterpartyClientId;
25-
address relayer;
2625
}
2726

2827
struct MsgConnectionOpenTry {
@@ -31,22 +30,19 @@ library IBCMsgs {
3130
uint32 clientId;
3231
bytes proofInit;
3332
uint64 proofHeight;
34-
address relayer;
3533
}
3634

3735
struct MsgConnectionOpenAck {
3836
uint32 connectionId;
3937
uint32 counterpartyConnectionId;
4038
bytes proofTry;
4139
uint64 proofHeight;
42-
address relayer;
4340
}
4441

4542
struct MsgConnectionOpenConfirm {
4643
uint32 connectionId;
4744
bytes proofAck;
4845
uint64 proofHeight;
49-
address relayer;
5046
}
5147

5248
struct MsgChannelOpenInit {

lib/ibc-solidity/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ maybe_sol_attr! {
425425
struct MsgConnectionOpenInit {
426426
uint32 client_id;
427427
uint32 counterparty_client_id;
428-
address relayer;
429428
}
430429

431430
struct MsgConnectionOpenTry {
@@ -434,22 +433,19 @@ maybe_sol_attr! {
434433
uint32 client_id;
435434
bytes proof_init;
436435
uint64 proof_height;
437-
address relayer;
438436
}
439437

440438
struct MsgConnectionOpenAck {
441439
uint32 connection_id;
442440
uint32 counterparty_connection_id;
443441
bytes proof_try;
444442
uint64 proof_height;
445-
address relayer;
446443
}
447444

448445
struct MsgConnectionOpenConfirm {
449446
uint32 connection_id;
450447
bytes proof_ack;
451448
uint64 proof_height;
452-
address relayer;
453449
}
454450

455451
struct MsgChannelOpenInit {

voyager/plugins/transaction/cosmos-sdk/src/main.rs

-4
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ fn process_msgs(
715715
client_id: msg_connection_open_init.client_id,
716716
counterparty_client_id: msg_connection_open_init
717717
.counterparty_client_id,
718-
relayer: signer.to_string(),
719718
},
720719
),
721720
)
@@ -737,7 +736,6 @@ fn process_msgs(
737736
client_id: msg_connection_open_try.client_id,
738737
proof_init: msg_connection_open_try.proof_init,
739738
proof_height: msg_connection_open_try.proof_height,
740-
relayer: signer.to_string(),
741739
},
742740
),
743741
)
@@ -757,7 +755,6 @@ fn process_msgs(
757755
.counterparty_connection_id,
758756
proof_try: msg_connection_open_ack.proof_try,
759757
proof_height: msg_connection_open_ack.proof_height,
760-
relayer: signer.to_string(),
761758
},
762759
),
763760
)
@@ -775,7 +772,6 @@ fn process_msgs(
775772
connection_id: msg_connection_open_confirm.connection_id,
776773
proof_ack: msg_connection_open_confirm.proof_ack,
777774
proof_height: msg_connection_open_confirm.proof_height,
778-
relayer: signer.to_string(),
779775
},
780776
),
781777
)

voyager/plugins/transaction/ethereum/src/main.rs

-4
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ fn process_msgs<'a>(
552552
.connectionOpenInit(ibc_solidity::MsgConnectionOpenInit {
553553
client_id: data.client_id.raw(),
554554
counterparty_client_id: data.counterparty_client_id.raw(),
555-
relayer: relayer.into(),
556555
})
557556
.clear_decoder(),
558557
),
@@ -565,7 +564,6 @@ fn process_msgs<'a>(
565564
client_id: data.client_id.raw(),
566565
proof_init: data.proof_init.into(),
567566
proof_height: data.proof_height,
568-
relayer: relayer.into(),
569567
})
570568
.clear_decoder(),
571569
),
@@ -577,7 +575,6 @@ fn process_msgs<'a>(
577575
counterparty_connection_id: data.counterparty_connection_id.raw(),
578576
proof_height: data.proof_height,
579577
proof_try: data.proof_try.into(),
580-
relayer: relayer.into(),
581578
})
582579
.clear_decoder(),
583580
),
@@ -588,7 +585,6 @@ fn process_msgs<'a>(
588585
connection_id: data.connection_id.raw(),
589586
proof_ack: data.proof_ack.into(),
590587
proof_height: data.proof_height,
591-
relayer: relayer.into(),
592588
})
593589
.clear_decoder(),
594590
),

0 commit comments

Comments
 (0)