Skip to content
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

fix(stuck packet): sync properly after finding stuck packets #19

Merged
merged 20 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<div align="center">
<h1>Relayer</h1>

<h2>A note on Dymension patches:</h2>

- stuck packet search now syncs correctly
- will no longer unnecessarily wait for a block to elapse before syncing (good for slow chains)
- recommended to use fast query loop for fast rollapp chains (`min-loop-duration: 100ms`)

![banner](./docs/images/comp.gif)

[![Project Status: Initial Release](https://img.shields.io/badge/repo%20status-active-green.svg?style=flat-square)](https://www.repostatus.org/#active)
Expand Down
7 changes: 5 additions & 2 deletions relayer/chains/cosmos/cosmos_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu
if (persistence.latestHeight - persistence.latestQueriedBlock) < int64(defaultInSyncNumBlocksThreshold) {
ccp.inSync = true
firstTimeInSync = true
ccp.log.Info("Chain is in sync")
ccp.log.Info("Chain is in sync", zap.Bool("first time", firstTimeInSync))
} else {
ccp.log.Info("Chain is not yet in sync",
zap.Int64("latest_queried_block", persistence.latestQueriedBlock),
Expand Down Expand Up @@ -494,8 +494,11 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu
if stuckPacket != nil &&
ccp.chainProvider.ChainId() == stuckPacket.ChainID &&
newLatestQueriedBlock == int64(stuckPacket.EndHeight) {

newLatestQueriedBlock = persistence.latestHeight
i = persistence.latestHeight
danwt marked this conversation as resolved.
Show resolved Hide resolved
ccp.log.Debug("Parsed stuck packet height, skipping to current")

ccp.log.Info("Parsed stuck packet height, skipping to current", zap.Any("new latest queried block", persistence.latestHeight))
}
}

Expand Down
Loading