-
Notifications
You must be signed in to change notification settings - Fork 597
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
refactor: rename RegisterCounterpartyAddress rpc to RegisterCounterpartyPayee #1513
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1513 +/- ##
==========================================
- Coverage 80.27% 80.26% -0.01%
==========================================
Files 166 166
Lines 12252 12254 +2
==========================================
+ Hits 9835 9836 +1
- Misses 1954 1955 +1
Partials 463 463
|
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
// the relayer address | ||
string relayer_address = 3; | ||
// the counterparty relayer address |
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.
nit: update the comment to counterparty payee
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.
done
docs/ibc/proto-docs.md
Outdated
| `port_id` | [string](#string) | | unique port identifier | | ||
| `channel_id` | [string](#string) | | unique channel identifier | | ||
| `relayer_address` | [string](#string) | | the relayer address | |
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.
nit: is address
necessary in this naming if we don't have it for payee below?
string channel_id = 4 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
// the relayer address | ||
string relayer_address = 3; |
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.
same nit here re: either having relayer_address & counterparty_payee_address or just relayer & counterparty payee
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.
Yeah actually, it's a fair point. I chatted with @AdityaSripal about this and we felt pretty indifferent about it.
If we are going to go with one or the other I think we should go with dropping the address
suffix for consistency as counterparty_payee_address
is a bit wordy. What do you think?
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 think for purposes of consistency I'll go ahead and drop the address
suffix and make the changes in RegisterPayee
msgs also
// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify their | ||
// counterparty address before relaying. This ensures they will be properly compensated for forward relaying since |
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.
// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify their | |
// counterparty address before relaying. This ensures they will be properly compensated for forward relaying since | |
// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the | |
// counterparty payee address before relaying. This ensures they will be properly compensated for forward relaying since |
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'll update these docs both here and in the proto files as they're replicated and push the changes 👍
// RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee | ||
// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify their | ||
// counterparty address before relaying. This ensures they will be properly compensated for forward relaying since | ||
// destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function |
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.
// destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function | |
// destination chain must send back the counterparty payee in acknowledgement. This function |
// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify their | ||
// counterparty address before relaying. This ensures they will be properly compensated for forward relaying since | ||
// destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function | ||
// may be called more than once by a relayer, in which case, the latest counterparty address is always used. |
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.
// may be called more than once by a relayer, in which case, the latest counterparty address is always used. | |
// may be called more than once, in which case, the latest counterparty payee address is always used. |
docs/ibc/proto-docs.md
Outdated
@@ -1412,7 +1412,7 @@ Msg defines the ICS29 Msg service. | |||
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | |||
| ----------- | ------------ | ------------- | ------------| ------- | -------- | | |||
| `RegisterPayee` | [MsgRegisterPayee](#ibc.applications.fee.v1.MsgRegisterPayee) | [MsgRegisterPayeeResponse](#ibc.applications.fee.v1.MsgRegisterPayeeResponse) | RegisterPayee defines a rpc handler method for MsgRegisterPayee RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional payee to which escrowed packet fees will be paid out. The payee should be registered on the source chain from which packets originate as this is where fee distribution takes place. This function may be called more than once by a relayer, in which case, the latest payee is always used. | | | |||
| `RegisterCounterpartyAddress` | [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) | [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) | RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, the latest counterparty address is always used. | | | |||
| `RegisterCounterpartyPayee` | [MsgRegisterCounterpartyPayee](#ibc.applications.fee.v1.MsgRegisterCounterpartyPayee) | [MsgRegisterCounterpartyPayeeResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse) | RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, the latest counterparty address is always used. | | |
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.
isn't it that the counterparty address doesnt always have to be the relayer's source address?
Co-authored-by: Charly <charly@interchain.berlin>
Thanks for the suggestions @charleenfei, I've updated to remove the |
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.
nice work sham
@@ -1412,7 +1412,7 @@ Msg defines the ICS29 Msg service. | |||
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | |||
| ----------- | ------------ | ------------- | ------------| ------- | -------- | | |||
| `RegisterPayee` | [MsgRegisterPayee](#ibc.applications.fee.v1.MsgRegisterPayee) | [MsgRegisterPayeeResponse](#ibc.applications.fee.v1.MsgRegisterPayeeResponse) | RegisterPayee defines a rpc handler method for MsgRegisterPayee RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional payee to which escrowed packet fees will be paid out. The payee should be registered on the source chain from which packets originate as this is where fee distribution takes place. This function may be called more than once by a relayer, in which case, the latest payee is always used. | | | |||
| `RegisterCounterpartyAddress` | [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) | [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) | RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, the latest counterparty address is always used. | | | |||
| `RegisterCounterpartyPayee` | [MsgRegisterCounterpartyPayee](#ibc.applications.fee.v1.MsgRegisterCounterpartyPayee) | [MsgRegisterCounterpartyPayeeResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse) | RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty payee address before relaying. This ensures they will be properly compensated for forward relaying since the destination chain must include the registered counterparty payee address in the acknowledgement. This function may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. | | |
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 ensures they will be properly compensated for forward relaying since the destination chain must include the registered counterparty payee address in the acknowledgement.
This is not complete true with the introduction of the the MsgRegisterPayee, right? Because the payee that you register could get the fees even if the counterparty address is not registered. An operator could decide not to use the counterparty payee at all and only the payee, right?
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've updated must
to may
and included an additional note:
// A registered payee on the source chain will always override a registered counterparty payee.
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.
Sorry, @damiannolan, I think my comment above is not correct. I just realized while I was writing this comment on the other PR. I think you still need to register the counterparty address, otherwise we wouldn't know on the source chain to which payee to pay out the fees. The counterparty address may or may not have a payee registered.
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.
After the conversation this morning in the planning call, I think we need to update this comment again, right?
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.
Yep, done! Feel free to suggest changes
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 you, @damiannolan!
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.
LGTM! Not major comments, just a small nit 💯
cmd := &cobra.Command{ | ||
Use: "register-counterparty-payee [port-id] [channel-id] [relayer] [counterparty-payee] ", | ||
Short: "Register a counterparty payee address on a given channel.", | ||
Long: strings.TrimSpace(`Register a counterparty payee address on a given channel.`), |
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.
[nit] unnecessary strings.TrimSpace
call, this is just a regular string.
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 left this in from existing code and I think there's a good few of them around. Maybe we could open a follow up PR to remove them if you want, some general housekeeping.
Description
Renaming
RegisterCounterpartyAddress
rpc toRegisterCounterpartyPayee
closes: #XXXX
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.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes