-
Notifications
You must be signed in to change notification settings - Fork 329
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
Insert ClientUpdate message into every transaction when splitting a message batch #2191
Comments
Note that there is a simple fix for this we included in PR #2167. The problem is also discussed here: #1971 (comment) The fix is: 7fd032b#diff-d18b8c452b8118832b4112538d034e9490cf2c30ab35c42d2e19d2f842131e14R518-R520 |
Catching this exception and retrying means that subsequent batches need to wait for the first transaction to be confirmed. |
that is my solution |
I see! You're including a
Hmm, not sure I understand what you mean. This exception is indeed caught, but there is no retrying involved in this solution. What happens is that the tx simulation fails (because there is no Do you see any problems with this approach? It works fine in practice, and we avoid adding additional |
I probably understand what you mean. The first batch has been submitted to the mem-pool. Subsequent batches can ignore the exception and submit it directly to the mem-pool. when first transaction confirmed , subsequent batches can using Latest Client to verify proof! Thank you for your answer! another question, if the default transaction fee is used, will it be regarded as failure or waste ? |
This is a good point. It is not regarded as failure. It can be regarded as waste, however. Let's think about the two solutions we have and how they affect gas+fee:
|
Assuming that there are only two Msg in the second batch, using the default gas at this time will inevitably cause waste func (cs ClientState) CheckHeaderAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore,
header exported.Header,
) (exported.ClientState, exported.ConsensusState, error) {
tmHeader, ok := header.(*Header)
if !ok {
return nil, nil, sdkerrors.Wrapf(
clienttypes.ErrInvalidHeader, "expected type %T, got %T", &Header{}, header,
)
}
prevConsState, _ := GetConsensusState(clientStore, cdc, header.GetHeight())
if prevConsState != nil {
// always Equal at here
if reflect.DeepEqual(prevConsState, tmHeader.ConsensusState()) {
return &cs, prevConsState, nil
}
conflictingHeader = true
} |
Interesting, thanks for highlighting that, I wasn't aware of it. Let's keep this issue open and we'll have a closer look and try to integrate falcons-x@8e3d2ae, so that we make Hermes more accurate wrt fee usage. I'll go ahead and groom the issue description to reflect the discussion here. Before we can adopt falcons-x@8e3d2ae, we will likely want to refactor the transaction partitioning mechanism, as the current approach is very fragile. |
Current design is to fill a Tx with messages until either If we go with fixing this in the worker, we should also refactor the code to actually fragment in the packet worker |
Thank you for your correction and agree with you |
Summary of Bug
error logs:
set chain config
max_msg_num
= 50set receiver chain average block time is 6s
The process of Hermes relaying packets can be divided into the following steps:
Suppose we assemble a batch of msgs with a length of 300, and then we start to build UpdateClientMsg at Event-Height and append it into Msgs, that is look like this:
Next, we start sending msgs, dividing 301 msgs into multiple Transaction, and the number of msgs in each Transaction is
max_msg_num
, So we got seven Transactions, called as then Transaction1,Transaction2....Transaction7assuming that the ClientState LatestHeight of the receiving chain is Event Height - 1 (proof height), Then transaction1 can execute estimate_gas successful , because Transaction1 contain UpdateClientMsg(client height = EventHeight)
at this time, Transaction1 is not confirmed (block time is 6S). We continue to send Transaction2. Because Transaction2 does not contain UpdateClientMsg, Transaction2 is bound to fail. error msg like this:
receive packet verification failed: couldn't verify counterparty packet commitment: failed packet commitment verification for client (07-tendermint-3): client state height < proof height ({0 89531} < {0 89532})
Solution:
insert Same UpdateClientMsg into Every Transaction
https://github.com/informalsystems/ibc-rs/blob/817aaa36a35914ec1370f62f9e5873ab8d65a53d/relayer/src/link/operational_data.rs#L190-L197
Version
Steps to Reproduce
Acceptance Criteria
For Admin Use
The text was updated successfully, but these errors were encountered: