Skip to content

Commit

Permalink
Remove redundant flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Sep 13, 2024
1 parent b366330 commit 3e20fd4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down
4 changes: 0 additions & 4 deletions relayer/chains/cosmos/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions relayer/chains/cosmos/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 3e20fd4

Please sign in to comment.