From 3e20fd45fa53db8c33e256958e789c270f33bc51 Mon Sep 17 00:00:00 2001 From: zale144 Date: Fri, 13 Sep 2024 15:14:36 +0200 Subject: [PATCH] Remove redundant flag --- README.md | 1 + relayer/chains/cosmos/provider.go | 4 ---- relayer/chains/cosmos/tx.go | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 33ad4778c..290776c7e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - recommended to use fast query loop for fast rollapp chains (`min-loop-duration: 100ms`) - use `start --no-flush` to avoid flushing completely - in flush mode, will not expect acks immediately (supports delayedack) +- allows rollapp key to not have an account, ignores failed gas calculation because of it --- diff --git a/relayer/chains/cosmos/provider.go b/relayer/chains/cosmos/provider.go index 6134c27b0..ad4aec91c 100644 --- a/relayer/chains/cosmos/provider.go +++ b/relayer/chains/cosmos/provider.go @@ -135,7 +135,6 @@ func (pc CosmosProviderConfig) NewProvider(log *zap.Logger, homepath string, deb Input: os.Stdin, Output: os.Stdout, walletStateMap: map[string]*WalletState{}, - isRollapp: pc.DymRollapp, // TODO: this is a bit of a hack, we should probably have a better way to inject modules Cdc: MakeCodec(pc.Modules, pc.ExtraCodecs, pc.AccountPrefix, pc.AccountPrefix+"valoper"), @@ -165,9 +164,6 @@ type CosmosProvider struct { // thus making TX sequencing errors less likely. walletStateMap map[string]*WalletState - // for hacking around the fact that we want to avoid having to pay fees - isRollapp bool - // metrics to monitor the provider TotalFees sdk.Coins totalFeesMu sync.Mutex diff --git a/relayer/chains/cosmos/tx.go b/relayer/chains/cosmos/tx.go index a026a7cc4..8b0aeddb2 100644 --- a/relayer/chains/cosmos/tx.go +++ b/relayer/chains/cosmos/tx.go @@ -662,7 +662,7 @@ func (cc *CosmosProvider) buildMessages( _, adjusted, err = cc.CalculateGas(ctx, txf, txSignerKey, cMsgs...) if err != nil { // if rollapp, we can hardcode gas (calculation can fail if there is no existing account) - if cc.isRollapp { + if cc.PCfg.DymRollapp { adjusted = defaultRollappGas } else { return nil, 0, sdk.Coins{}, err @@ -1673,7 +1673,7 @@ func (cc *CosmosProvider) PrepareFactory(txf tx.Factory, signingKey string) (tx. WithFromAddress(from) // if rollapp, we know that the account might not exist at this point - if !cc.isRollapp { + if !cc.PCfg.DymRollapp { // Set the account number and sequence on the transaction factory and retry if fail if err = retry.Do(func() error { return txf.AccountRetriever().EnsureExists(cliCtx, from) @@ -1688,7 +1688,7 @@ func (cc *CosmosProvider) PrepareFactory(txf tx.Factory, signingKey string) (tx. if err = retry.Do(func() error { num, seq, err = txf.AccountRetriever().GetAccountNumberSequence(cliCtx, from) // if rollapp, we know that the account might not exist at this point - if err != nil && !cc.isRollapp { + if err != nil && !cc.PCfg.DymRollapp { return err } return nil